@feedmepos/mf-connect 0.1.89-prod → 0.1.90-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-Caz3AQQ2.js → Analytic-BMwxfYv_.js} +11 -11
- package/dist/{App-D_q4nHiY.js → App-D_SZawqp.js} +7 -7
- package/dist/{Bin-DURa0qe2.js → Bin-Dd1a25j_.js} +8 -8
- package/dist/{Broadcast-ByDjXqap.js → Broadcast-UAp6rjTh.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BD8mWUzO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFe8C9fR.js} +7 -7
- package/dist/{Card-BSSzVrbz.js → Card-CQuGfckK.js} +19 -19
- package/dist/{Collections-CTwUl8W3.js → Collections-oWvNX_oo.js} +8 -8
- package/dist/{Credit-TgZBmYsM.js → Credit-tGCTd7QC.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DZV3JtDl.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7h5K6lN.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BwOs5NHt.js → EffectSheet.vue_vue_type_style_index_0_lang-BvIk7GMj.js} +6 -6
- package/dist/{Experience-DUCO6do6.js → Experience-D6w2OyuS.js} +8 -8
- package/dist/{FileSaver.min-BaCfYtPG.js → FileSaver.min-9I0Uce_o.js} +1 -1
- package/dist/{Game-DcwQSCjZ.js → Game-Bj8mS5qz.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BSMwEFqp.js → ImageInput.vue_vue_type_script_setup_true_lang-D3B7IMDV.js} +1 -1
- package/dist/{Index-Bp2CKHw3.js → Index-Dsexv-ef.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-WWVHvcOU.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CmB12mvX.js} +1 -1
- package/dist/{MainLayout-Q_0POZ4I.js → MainLayout-o1wQv9lH.js} +1 -1
- package/dist/{Marketing-D52IYXPR.js → Marketing-Dz0sk_DR.js} +6 -6
- package/dist/{Member-sxjxhLwQ.js → Member-rFVgJTbb.js} +12 -12
- package/dist/{MemberList-vLNFHNRw.js → MemberList-BpnL4Fbw.js} +436 -441
- package/dist/{MemberTransactions-BeHeN0Rk.js → MemberTransactions-ouq288EU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B6cF0EC3.js → MessageInput.vue_vue_type_script_setup_true_lang-wSeJMwF7.js} +9 -9
- package/dist/{Mission-CnJCjBhe.js → Mission-D1KR53bD.js} +9 -9
- package/dist/{Overview-B3jRs_Cg.js → Overview-B5bzlo0A.js} +19 -19
- package/dist/{Point-BldY5wb0.js → Point-DTifJVdo.js} +8 -8
- package/dist/{Promotion-CsGhqlY0.js → Promotion-DAtAw5kG.js} +9 -9
- package/dist/{Queue-CLa2pSXF.js → Queue-DBnvPuuW.js} +11 -11
- package/dist/{Record-JbbAM6lI.js → Record-DI-q_FuN.js} +9 -9
- package/dist/{Reward-wgiBCIV3.js → Reward-C9CxDqz_.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DiNlpy7_.js → RewardGroup.vue_vue_type_script_setup_true_lang-BBE5Ymqj.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B3Ylb1vx.js → RuleGroup.vue_vue_type_script_setup_true_lang-DNM6f0iG.js} +15 -15
- package/dist/{Segment-BQiZ51Wi.js → Segment-B0Oy6ajr.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DbXFTjAN.js → SelectItems.vue_vue_type_script_setup_true_lang-Be6Ykmkc.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Be_kiAB6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-MARrd7Nr.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DS1MWUOc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-w9sbHf1G.js} +4 -4
- package/dist/Setting-BUfHh3b6.js +2028 -0
- package/dist/{SettingAdvertisements-OdDM05s7.js → SettingAdvertisements-D2qWdId7.js} +12 -12
- package/dist/{Store-D1Q0wOXk.js → Store-mNM5AzFJ.js} +22 -22
- package/dist/{StoreRewards-2Gdv7uu4.js → StoreRewards-D4-c0EPM.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-tk42owGe.js +1118 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BKzZIJkt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C65gN2Gd.js} +5 -3
- package/dist/{Tier-DOnYGgah.js → Tier-swAmEa8-.js} +22 -22
- package/dist/{Title-F4XJw6oN.js → Title-BQQBoFOx.js} +21 -21
- package/dist/{Transaction-Ws7kBZUE.js → Transaction-BCjSkDrw.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BZb0EXgi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-IDqjTwZt.js} +6 -6
- package/dist/{Voucher-DX8MKz00.js → Voucher-BAGLTdGv.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-tUNn1vRE.js → VoucherEditor.vue_vue_type_script_setup_true_lang-7CKmTEVm.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BvgIZlIh.js → ZodTextField.vue_vue_type_script_setup_true_lang-B_0BhFd7.js} +2 -2
- package/dist/{app-C-nC9SMv.js → app-Dij-Gw3J.js} +49 -45
- package/dist/app.js +1 -1
- package/dist/{business-CrQ_qouH.js → business-BPttWtAG.js} +1 -1
- package/dist/{campaign-CBRSag11.js → campaign-DVQC46G6.js} +8 -8
- package/dist/{campaign-shm1Nb7g.js → campaign-PkE8sv2w.js} +1 -1
- package/dist/{campaign.enum-C-p5_XEd.js → campaign.enum-D6sGv-i6.js} +1 -1
- package/dist/{campaign.fn-BGzZfg1o.js → campaign.fn-CKpORxQM.js} +161 -161
- package/dist/{collectible.enum-DxOoBouZ.js → collectible.enum-MjUCS47s.js} +1 -1
- package/dist/{collection.fn-BKmv2KVW.js → collection.fn-BgLy48_a.js} +2 -2
- package/dist/{dto-BRQj35uX.js → dto-Cr1_4S0y.js} +4 -4
- package/dist/{effect-Bbc7QO26.js → effect-CZOUmaXH.js} +1 -1
- package/dist/{email-addresses-CdmKczY8.js → email-addresses-DgPF09-i.js} +2 -2
- package/dist/{export-xWupGZRl.js → export-BGwLWDbw.js} +3 -3
- package/dist/{helper-C_t7u0sc.js → helper-BpGjM57Y.js} +1 -1
- package/dist/{index-C6PeL89d.js → index-8Mt35h00.js} +3 -3
- package/dist/{index-DaCQrz9t.js → index-AGdd55s3.js} +3 -3
- package/dist/{index-DAhj82tf.js → index-BzNxgycz.js} +1 -1
- package/dist/{index-lZq2A3X2.js → index-C2b2PGqB.js} +3 -3
- package/dist/{index-BxosLsfW.js → index-CZbs1ScI.js} +1 -1
- package/dist/index-CsjJKy32.js +85 -0
- package/dist/{index-RsNRLaWL.js → index-D3jQoHcb.js} +23 -12
- package/dist/{index-ClEGMTrv.js → index-DG88MQyX.js} +1 -1
- package/dist/{index-DW7nPyed.js → index-DVtnOY4x.js} +6 -6
- package/dist/{index-BaGjDOR2.js → index-DjEcMAQl.js} +1 -1
- package/dist/{index-CLvFXL_E.js → index-Dx04wWQ2.js} +4 -4
- package/dist/{index-REoHVOcy.js → index-dSK3QWJX.js} +1 -1
- package/dist/{index-BHwWZLKa.js → index-qGQhKrNH.js} +5 -3
- package/dist/{index.esm2017-DIVK9KD2.js → index.esm2017-BnCWqavv.js} +1 -1
- package/dist/{loading-xptL2Ny2.js → loading-kCbpDTvS.js} +1 -1
- package/dist/{lodash-88xjswCi.js → lodash-C4AZ3S-J.js} +1 -1
- package/dist/{membership-eoLCZt_p.js → membership-D2-ldXWY.js} +3 -3
- package/dist/{money-DcsDa1nm.js → money-BueaFHxA.js} +1 -1
- package/dist/{number-BkGWCSrD.js → number-DQbzn_l_.js} +1 -1
- package/dist/{objectid-gUqB9tj7.js → objectid-B_jNHjAd.js} +5 -5
- package/dist/{plugins-DoTCd9nY.js → plugins-D5Na7PGX.js} +3 -3
- package/dist/{reward-Culc3-Rv.js → reward-DJqNxI9u.js} +1 -1
- package/dist/{rule-DUDjRs8M.js → rule-CHRKj3Qt.js} +3 -3
- package/dist/{rule-builder-CkZtoez-.js → rule-builder-CEZ2VxtL.js} +1 -1
- package/dist/{template-CxhdtuLf.js → template-BFhV6iql.js} +7 -7
- package/dist/{timezone-CdsdekR2.js → timezone-BQhT-oxQ.js} +5 -3
- package/dist/{trigger-CFXIiuLd.js → trigger-nhg31Cm2.js} +5 -5
- package/dist/usePagination-z6Io9pE3.js +220 -0
- package/dist/{user-C7hrMSvV.js → user-uP7Z7WUa.js} +1 -1
- package/dist/{vue-i18n-BdGyU2Nr.js → vue-i18n-DYzNH5z4.js} +158 -158
- package/dist/{xlsx-BN2KFkI2.js → xlsx-DTeYpknU.js} +1 -1
- package/dist/{zod-DvUTBth7.js → zod-YWGh4sc1.js} +1 -1
- package/package.json +1 -1
- package/dist/Setting-De1lCG6N.js +0 -1989
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-NtxHf8HF.js +0 -1016
- package/dist/index-DDQaEXt7.js +0 -76
- package/dist/usePagination-BSeGmTq6.js +0 -177
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { defineComponent as be, computed as H, ref as G, resolveComponent as V, openBlock as
|
|
2
|
-
import { h as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { e as
|
|
5
|
-
import { w as
|
|
6
|
-
import "./index-
|
|
7
|
-
import "./index-
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { D as
|
|
12
|
-
import { d as
|
|
13
|
-
import { p as
|
|
14
|
-
import { u as
|
|
15
|
-
import { C as
|
|
16
|
-
import { defineStore as
|
|
17
|
-
import { u as
|
|
18
|
-
import { f as ee } from "./number-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./index-
|
|
23
|
-
import { s as
|
|
24
|
-
import { u as
|
|
25
|
-
import { B as
|
|
26
|
-
import { m as
|
|
1
|
+
import { defineComponent as be, computed as H, ref as G, resolveComponent as V, openBlock as u, createElementBlock as A, Fragment as q, createElementVNode as n, unref as t, createBlock as U, createCommentVNode as le, createVNode as _, renderList as ie, withCtx as xe, createTextVNode as Me, toDisplayString as $, withDirectives as Re, vShow as Le, watch as ze, onBeforeMount as at, h as K, onMounted as je, isRef as rt, normalizeClass as st } from "vue";
|
|
2
|
+
import { h as C } from "./moment-D7p2TMB-.js";
|
|
3
|
+
import { useDialog as Ve, components as ve } from "@feedmepos/ui-library";
|
|
4
|
+
import { e as it, M as lt } from "./email-addresses-DgPF09-i.js";
|
|
5
|
+
import { w as ct } from "./xlsx-DTeYpknU.js";
|
|
6
|
+
import "./index-CZbs1ScI.js";
|
|
7
|
+
import "./index-AGdd55s3.js";
|
|
8
|
+
import { u as Ie, C as Be, s as dt } from "./membership-D2-ldXWY.js";
|
|
9
|
+
import { c as mt } from "./index-qGQhKrNH.js";
|
|
10
|
+
import { _ as Ye } from "./lodash-C4AZ3S-J.js";
|
|
11
|
+
import { D as ut } from "./type_drinks-D6jnpvwV.js";
|
|
12
|
+
import { d as pt, e as ft, f as bt, g as yt, h as gt } from "./index-Dx04wWQ2.js";
|
|
13
|
+
import { p as Pe, c as Oe, b as Ue } from "./plugins-D5Na7PGX.js";
|
|
14
|
+
import { u as qe } from "./loading-kCbpDTvS.js";
|
|
15
|
+
import { C as Ee } from "./collection.fn-BgLy48_a.js";
|
|
16
|
+
import { defineStore as vt } from "pinia";
|
|
17
|
+
import { u as Ke } from "./business-BPttWtAG.js";
|
|
18
|
+
import { f as ee } from "./number-DQbzn_l_.js";
|
|
19
|
+
import "./index-C2b2PGqB.js";
|
|
20
|
+
import "./index-DVtnOY4x.js";
|
|
21
|
+
import "./index-DG88MQyX.js";
|
|
22
|
+
import "./index-8Mt35h00.js";
|
|
23
|
+
import { s as xt } from "./index-CuvNtC_M.js";
|
|
24
|
+
import { u as Ge, _ as He } from "./usePagination-z6Io9pE3.js";
|
|
25
|
+
import { B as ht, e as _t } from "./export-BGwLWDbw.js";
|
|
26
|
+
import { m as Te } from "./index-BzNxgycz.js";
|
|
27
27
|
import { o as he } from "./objectId-dwaoBfJX.js";
|
|
28
|
-
import { F as
|
|
29
|
-
import { g as
|
|
30
|
-
import { useRouter as
|
|
31
|
-
import { m as
|
|
32
|
-
import { t as
|
|
33
|
-
import { R as
|
|
34
|
-
import { t as
|
|
35
|
-
import { g as
|
|
36
|
-
const
|
|
28
|
+
import { F as Ae } from "./collectible.enum-MjUCS47s.js";
|
|
29
|
+
import { g as St, b as Ct } from "./campaign-DVQC46G6.js";
|
|
30
|
+
import { useRouter as We } from "vue-router";
|
|
31
|
+
import { m as fe } from "./index-CsjJKy32.js";
|
|
32
|
+
import { t as wt } from "./index-D3jQoHcb.js";
|
|
33
|
+
import { R as Je } from "./app-Dij-Gw3J.js";
|
|
34
|
+
import { t as Ft } from "./money-BueaFHxA.js";
|
|
35
|
+
import { g as Mt, a as Tt, b as kt } from "./user-uP7Z7WUa.js";
|
|
36
|
+
const At = { class: "flex flex-col" }, Et = { key: 1 }, Vt = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, It = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, $t = /* @__PURE__ */ be({
|
|
37
37
|
__name: "MemberStatsDialog",
|
|
38
38
|
props: {
|
|
39
39
|
member: {
|
|
@@ -46,25 +46,25 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
setup(y) {
|
|
49
|
-
var
|
|
50
|
-
const k =
|
|
49
|
+
var ce, ae, W, re;
|
|
50
|
+
const k = Ve(), p = Ie(), x = y, s = H(
|
|
51
51
|
() => {
|
|
52
|
-
var
|
|
53
|
-
return (((
|
|
52
|
+
var f;
|
|
53
|
+
return (((f = x.member.collection) == null ? void 0 : f.TITLE) ?? []).reduce(
|
|
54
54
|
(c, M) => {
|
|
55
|
-
var
|
|
56
|
-
const r =
|
|
55
|
+
var S, T, O, E, R;
|
|
56
|
+
const r = p.sortedTitles.find(
|
|
57
57
|
(te) => te._id.toString() === M.collectible
|
|
58
58
|
);
|
|
59
59
|
if (!r) return c;
|
|
60
60
|
const i = [...M.expiryBalance ?? []].sort(
|
|
61
|
-
(te, z) =>
|
|
61
|
+
(te, z) => C(te.expiredAt).isAfter(C(z.expiredAt)) ? -1 : 1
|
|
62
62
|
);
|
|
63
|
-
return (
|
|
63
|
+
return (S = i[0]) != null && S.expiredAt && C((T = i[0]) == null ? void 0 : T.expiredAt).isBefore(C()) || c.push({
|
|
64
64
|
_id: r._id,
|
|
65
65
|
name: r.name,
|
|
66
|
-
expiredAt: (O = i[0]) != null && O.expiredAt ?
|
|
67
|
-
expiresIn:
|
|
66
|
+
expiredAt: (O = i[0]) != null && O.expiredAt ? C((E = i[0]) == null ? void 0 : E.expiredAt).toISOString() : "",
|
|
67
|
+
expiresIn: C((R = i[0]) == null ? void 0 : R.expiredAt).diff(C(), "days")
|
|
68
68
|
}), c;
|
|
69
69
|
},
|
|
70
70
|
[]
|
|
@@ -72,67 +72,67 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
72
72
|
}
|
|
73
73
|
), o = G({
|
|
74
74
|
cardNo: x.member.cardNo,
|
|
75
|
-
experience: ((ae = (
|
|
75
|
+
experience: ((ae = (ce = x.member.collection) == null ? void 0 : ce.POINT) == null ? void 0 : ae[0].balance) ?? 0,
|
|
76
76
|
tier: ((re = (W = x.member.collection) == null ? void 0 : W.TIER) == null ? void 0 : re[0].balance) ?? -1,
|
|
77
|
-
titles: s.value.map((
|
|
77
|
+
titles: s.value.map((f) => ({ expiredAt: f.expiresIn, id: f._id })) ?? void 0
|
|
78
78
|
}), g = H(
|
|
79
|
-
() => (
|
|
80
|
-
label:
|
|
81
|
-
value:
|
|
82
|
-
sublabel: s.value.some((c) => c._id ===
|
|
79
|
+
() => (p.sortedTitles ?? []).map((f) => ({
|
|
80
|
+
label: f.name,
|
|
81
|
+
value: f._id.toString(),
|
|
82
|
+
sublabel: s.value.some((c) => c._id === f._id) ? "Owned" : void 0
|
|
83
83
|
}))
|
|
84
|
-
),
|
|
85
|
-
label:
|
|
86
|
-
sublabel: `${
|
|
87
|
-
from:
|
|
88
|
-
to:
|
|
84
|
+
), d = H(() => (p.sortedTiers ?? []).map((f, c) => ({
|
|
85
|
+
label: f.name,
|
|
86
|
+
sublabel: `${f.option.from} - ${f.option.to}`,
|
|
87
|
+
from: f.option.from,
|
|
88
|
+
to: f.option.to,
|
|
89
89
|
value: c + 1
|
|
90
90
|
})));
|
|
91
91
|
function w() {
|
|
92
92
|
var M, r;
|
|
93
|
-
const
|
|
93
|
+
const f = ((M = d.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : M.from) ?? 0, c = (r = d.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : r.to;
|
|
94
94
|
o.value.experience = Math.min(
|
|
95
|
-
c ??
|
|
96
|
-
Math.max(
|
|
95
|
+
c ?? f,
|
|
96
|
+
Math.max(f, o.value.experience ?? 0)
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
var M, r, i,
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
99
|
+
const m = H(() => {
|
|
100
|
+
var M, r, i, S, T, O;
|
|
101
|
+
const f = ((r = (M = x.member.collection) == null ? void 0 : M.TIER) == null ? void 0 : r[0].balance) ?? -1, c = ((S = (i = x.member.collection) == null ? void 0 : i.POINT) == null ? void 0 : S[0].balance) ?? 0;
|
|
102
|
+
if (f != o.value.tier) return !0;
|
|
103
103
|
if (o.value.experience && o.value.experience != c) {
|
|
104
|
-
const E = ((T =
|
|
105
|
-
if (o.value.experience < E ||
|
|
104
|
+
const E = ((T = d.value[f - 1]) == null ? void 0 : T.from) ?? 0, R = ((O = d.value[f - 1]) == null ? void 0 : O.to) ?? 0;
|
|
105
|
+
if (o.value.experience < E || R && o.value.experience > R)
|
|
106
106
|
return !0;
|
|
107
107
|
}
|
|
108
108
|
return !1;
|
|
109
109
|
});
|
|
110
|
-
function v(
|
|
110
|
+
function v(f) {
|
|
111
111
|
var c;
|
|
112
|
-
return (c = s.value.find((M) => M._id ===
|
|
112
|
+
return (c = s.value.find((M) => M._id === f)) == null ? void 0 : c.expiresIn;
|
|
113
113
|
}
|
|
114
114
|
const I = H(() => {
|
|
115
|
-
const
|
|
116
|
-
return
|
|
115
|
+
const f = pt.safeParse(o.value);
|
|
116
|
+
return f.success ? void 0 : f.error.errors;
|
|
117
117
|
});
|
|
118
|
-
function
|
|
118
|
+
function N(f) {
|
|
119
119
|
var c, M;
|
|
120
|
-
return (M = (c = I.value) == null ? void 0 : c.find((r) => r.path.join(".") ===
|
|
120
|
+
return (M = (c = I.value) == null ? void 0 : c.find((r) => r.path.join(".") === f)) == null ? void 0 : M.message;
|
|
121
121
|
}
|
|
122
|
-
function L(
|
|
122
|
+
function L(f) {
|
|
123
123
|
var c;
|
|
124
|
-
return (c = I.value) == null ? void 0 : c.filter((M) => M.path.join(".").startsWith(
|
|
124
|
+
return (c = I.value) == null ? void 0 : c.filter((M) => M.path.join(".").startsWith(f)).map((M) => M.message);
|
|
125
125
|
}
|
|
126
126
|
async function P() {
|
|
127
127
|
await x.onSubmit(o.value), k.close();
|
|
128
128
|
}
|
|
129
|
-
return (
|
|
129
|
+
return (f, c) => {
|
|
130
130
|
var te, z;
|
|
131
|
-
const M = V("FmSelect"), r = V("FmStepperField"), i = V("FmTextField"),
|
|
132
|
-
return
|
|
133
|
-
n("div",
|
|
131
|
+
const M = V("FmSelect"), r = V("FmStepperField"), i = V("FmTextField"), S = V("FmField"), T = V("FmFormGroup"), O = V("FmButton"), E = V("FmHelperText"), R = V("FmSpacer");
|
|
132
|
+
return u(), A(q, null, [
|
|
133
|
+
n("div", At, [
|
|
134
134
|
c[6] || (c[6] = n("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
135
|
-
t(
|
|
135
|
+
t(d).length ? (u(), U(M, {
|
|
136
136
|
key: 0,
|
|
137
137
|
modelValue: t(o).tier,
|
|
138
138
|
"onUpdate:modelValue": [
|
|
@@ -140,57 +140,57 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
140
140
|
w
|
|
141
141
|
],
|
|
142
142
|
label: "Member Tier",
|
|
143
|
-
items: t(
|
|
144
|
-
"helper-text":
|
|
145
|
-
"helper-state":
|
|
146
|
-
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) :
|
|
143
|
+
items: t(d),
|
|
144
|
+
"helper-text": N("tier"),
|
|
145
|
+
"helper-state": N("tier") ? "error" : void 0
|
|
146
|
+
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : le("", !0),
|
|
147
147
|
_(r, {
|
|
148
148
|
"model-value": t(o).experience ?? 0,
|
|
149
149
|
"onUpdate:modelValue": c[1] || (c[1] = (F) => t(o).experience = F),
|
|
150
150
|
label: "Member Experience",
|
|
151
151
|
"max-fraction-digits": 0,
|
|
152
|
-
"helper-text":
|
|
153
|
-
"helper-state":
|
|
152
|
+
"helper-text": N("experience"),
|
|
153
|
+
"helper-state": N("experience") ? "error" : void 0
|
|
154
154
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
155
155
|
c[7] || (c[7] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
156
156
|
_(i, {
|
|
157
157
|
modelValue: t(o).cardNo,
|
|
158
158
|
"onUpdate:modelValue": c[2] || (c[2] = (F) => t(o).cardNo = F),
|
|
159
159
|
label: "Card number",
|
|
160
|
-
"helper-text":
|
|
161
|
-
"helper-state":
|
|
160
|
+
"helper-text": N("cardNo"),
|
|
161
|
+
"helper-state": N("cardNo") ? "error" : void 0
|
|
162
162
|
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
163
163
|
c[8] || (c[8] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
164
|
-
(te = t(o).titles) != null && te.length ? (
|
|
164
|
+
(te = t(o).titles) != null && te.length ? (u(), A("div", Et, [...c[5] || (c[5] = [
|
|
165
165
|
n("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
166
166
|
n("div", { class: "flex-1" }, "Title"),
|
|
167
167
|
n("div", { class: "flex-1" }, "Expires in days"),
|
|
168
168
|
n("div", { class: "w-24 h-1" })
|
|
169
169
|
], -1)
|
|
170
|
-
])])) :
|
|
171
|
-
(
|
|
172
|
-
n("div",
|
|
173
|
-
t(s).some((a) => a._id === F.id) ? (
|
|
170
|
+
])])) : le("", !0),
|
|
171
|
+
(u(!0), A(q, null, ie(t(o).titles ?? [], (F, J) => (u(), A("div", { key: J }, [
|
|
172
|
+
n("div", Vt, [
|
|
173
|
+
t(s).some((a) => a._id === F.id) ? (u(), U(T, {
|
|
174
174
|
key: 1,
|
|
175
175
|
"model-value": "",
|
|
176
176
|
class: "flex-1"
|
|
177
177
|
}, {
|
|
178
178
|
default: xe(() => [
|
|
179
|
-
_(
|
|
179
|
+
_(S, {
|
|
180
180
|
disabled: !0,
|
|
181
181
|
class: "text-fm-color-typo-secondary"
|
|
182
182
|
}, {
|
|
183
183
|
default: xe(() => {
|
|
184
184
|
var a;
|
|
185
185
|
return [
|
|
186
|
-
|
|
186
|
+
Me($((a = t(g).find((e) => e.value === F.id)) == null ? void 0 : a.label), 1)
|
|
187
187
|
];
|
|
188
188
|
}),
|
|
189
189
|
_: 2
|
|
190
190
|
}, 1024)
|
|
191
191
|
]),
|
|
192
192
|
_: 2
|
|
193
|
-
}, 1024)) : (
|
|
193
|
+
}, 1024)) : (u(), U(M, {
|
|
194
194
|
key: 0,
|
|
195
195
|
modelValue: F.id,
|
|
196
196
|
"onUpdate:modelValue": [(a) => F.id = a, (a) => F.expiredAt = v(a) ?? 1],
|
|
@@ -222,14 +222,14 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
222
222
|
}
|
|
223
223
|
}, null, 8, ["onClick"])
|
|
224
224
|
]),
|
|
225
|
-
(
|
|
225
|
+
(u(!0), A(q, null, ie(L(`titles.${J}`), (a, e) => (u(), U(E, {
|
|
226
226
|
key: e,
|
|
227
227
|
class: "items-center",
|
|
228
228
|
state: "error",
|
|
229
229
|
text: a.toString()
|
|
230
230
|
}, null, 8, ["text"]))), 128))
|
|
231
231
|
]))), 128)),
|
|
232
|
-
t(g).length && (((z = t(o).titles) == null ? void 0 : z.length) ?? 0) < t(g).length ? (
|
|
232
|
+
t(g).length && (((z = t(o).titles) == null ? void 0 : z.length) ?? 0) < t(g).length ? (u(), U(O, {
|
|
233
233
|
key: 2,
|
|
234
234
|
icon: "add",
|
|
235
235
|
label: "Give title",
|
|
@@ -249,16 +249,16 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
249
249
|
}
|
|
250
250
|
];
|
|
251
251
|
})
|
|
252
|
-
})) :
|
|
252
|
+
})) : le("", !0)
|
|
253
253
|
]),
|
|
254
|
-
n("div",
|
|
254
|
+
n("div", It, [
|
|
255
255
|
Re(_(E, {
|
|
256
256
|
state: "warning",
|
|
257
257
|
text: "Updating member will cause tier to change"
|
|
258
258
|
}, null, 512), [
|
|
259
|
-
[
|
|
259
|
+
[Le, t(m)]
|
|
260
260
|
]),
|
|
261
|
-
_(
|
|
261
|
+
_(R),
|
|
262
262
|
_(O, {
|
|
263
263
|
variant: "secondary",
|
|
264
264
|
label: "Cancel",
|
|
@@ -276,7 +276,7 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
276
276
|
], 64);
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
}), Dt = { class: "fm-typo-en-title-sm-800" }, Nt = { class: "space-y-16" },
|
|
279
|
+
}), Dt = { class: "fm-typo-en-title-sm-800" }, Nt = { class: "space-y-16" }, Bt = { class: "flex flex-nowrap gap-8 items-center justify-end pt-24 w-full" }, Yt = /* @__PURE__ */ be({
|
|
280
280
|
__name: "CreditCoinDialog",
|
|
281
281
|
props: {
|
|
282
282
|
type: { type: String, required: !0 },
|
|
@@ -287,59 +287,59 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
289
|
setup(y) {
|
|
290
|
-
const k =
|
|
290
|
+
const k = Ve(), p = y, x = G({
|
|
291
291
|
amount: 1,
|
|
292
292
|
day: 1,
|
|
293
293
|
remark: void 0
|
|
294
|
-
}), s = G(!0), o = H(() =>
|
|
295
|
-
function g(
|
|
296
|
-
s.value =
|
|
294
|
+
}), s = G(!0), o = H(() => Ee.formattedType(p.type.toUpperCase()));
|
|
295
|
+
function g(m) {
|
|
296
|
+
s.value = m, !m && p.type === "coin" && (x.value.day = void 0);
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
299
|
-
if (
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
`Are you sure to send ${x.value.amount} ${o.value.toLowerCase()}${
|
|
298
|
+
async function d() {
|
|
299
|
+
if (p.action === "send") {
|
|
300
|
+
const m = x.value.day ? `, expire in ${x.value.day} days` : "";
|
|
301
|
+
Pe.confirm(
|
|
302
|
+
`Are you sure to send ${x.value.amount} ${o.value.toLowerCase()}${m}? This action cannot be reversed.`
|
|
303
303
|
).then(async (v) => {
|
|
304
|
-
v && await
|
|
304
|
+
v && await p.onSubmit(x.value);
|
|
305
305
|
});
|
|
306
306
|
} else
|
|
307
|
-
|
|
307
|
+
Pe.confirm(
|
|
308
308
|
`Are you sure to deduct ${x.value.amount} ${o.value.toLowerCase()}? This action cannot be reversed.`
|
|
309
|
-
).then(async (
|
|
310
|
-
|
|
309
|
+
).then(async (m) => {
|
|
310
|
+
m && await p.onSubmit(x.value);
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
313
|
const w = H(() => {
|
|
314
|
-
const v = (
|
|
314
|
+
const v = (p.action === "send" ? p.type === "coin" ? ft : bt : p.type === "coin" ? yt : gt).safeParse(x.value);
|
|
315
315
|
return v.success == !1 ? v.error.flatten().fieldErrors : void 0;
|
|
316
316
|
});
|
|
317
|
-
return (
|
|
318
|
-
const I = V("FmStepperField"),
|
|
319
|
-
return
|
|
317
|
+
return (m, v) => {
|
|
318
|
+
const I = V("FmStepperField"), N = V("FmSwitch"), L = V("FmTextarea"), P = V("FmButton"), ce = V("FmCard");
|
|
319
|
+
return u(), U(ce, { class: "flex flex-col gap-16 p-16" }, {
|
|
320
320
|
default: xe(() => {
|
|
321
|
-
var ae, W, re,
|
|
321
|
+
var ae, W, re, f, c, M;
|
|
322
322
|
return [
|
|
323
|
-
n("div", Dt, $(
|
|
324
|
-
|
|
323
|
+
n("div", Dt, $(p.action == "send" ? "Send" : "Deduct") + " " + $(t(Be)[p.type.toUpperCase()].name), 1),
|
|
324
|
+
Me(" " + $(t(w)) + " ", 1),
|
|
325
325
|
n("div", Nt, [
|
|
326
326
|
_(I, {
|
|
327
327
|
modelValue: t(x).amount,
|
|
328
328
|
"onUpdate:modelValue": v[0] || (v[0] = (r) => t(x).amount = r),
|
|
329
|
-
label: `${t(
|
|
329
|
+
label: `${t(Be)[p.type.toUpperCase()].name} amount`,
|
|
330
330
|
"is-currency": !0,
|
|
331
331
|
"max-fraction-digits": 2,
|
|
332
332
|
"helper-state": (ae = t(w)) != null && ae.amount ? "error" : void 0,
|
|
333
333
|
"helper-text": (re = (W = t(w)) == null ? void 0 : W.amount) == null ? void 0 : re[0]
|
|
334
334
|
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
335
|
-
y.action === "send" &&
|
|
335
|
+
y.action === "send" && p.type === "coin" ? (u(), U(N, {
|
|
336
336
|
key: 0,
|
|
337
337
|
"model-value": t(s),
|
|
338
338
|
label: `${t(o)} expires`,
|
|
339
339
|
"label-placement": "right",
|
|
340
340
|
"onUpdate:modelValue": v[1] || (v[1] = (r) => g(r))
|
|
341
|
-
}, null, 8, ["model-value", "label"])) :
|
|
342
|
-
y.action === "send" && t(s) ? (
|
|
341
|
+
}, null, 8, ["model-value", "label"])) : le("", !0),
|
|
342
|
+
y.action === "send" && t(s) ? (u(), U(I, {
|
|
343
343
|
key: 1,
|
|
344
344
|
modelValue: t(x).day,
|
|
345
345
|
"onUpdate:modelValue": v[2] || (v[2] = (r) => t(x).day = r),
|
|
@@ -348,16 +348,16 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
348
348
|
"append-text": "day(s)",
|
|
349
349
|
max: 9999,
|
|
350
350
|
min: 0,
|
|
351
|
-
"helper-state": (
|
|
351
|
+
"helper-state": (f = t(w)) != null && f.day ? "error" : void 0,
|
|
352
352
|
"helper-text": (M = (c = t(w)) == null ? void 0 : c.day) == null ? void 0 : M[0]
|
|
353
|
-
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) :
|
|
353
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : le("", !0),
|
|
354
354
|
_(L, {
|
|
355
355
|
modelValue: t(x).remark,
|
|
356
356
|
"onUpdate:modelValue": v[3] || (v[3] = (r) => t(x).remark = r),
|
|
357
357
|
label: "Remark"
|
|
358
358
|
}, null, 8, ["modelValue"])
|
|
359
359
|
]),
|
|
360
|
-
n("div",
|
|
360
|
+
n("div", Bt, [
|
|
361
361
|
_(P, {
|
|
362
362
|
variant: "secondary",
|
|
363
363
|
label: "Cancel",
|
|
@@ -369,7 +369,7 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
369
369
|
variant: "primary",
|
|
370
370
|
label: "Submit",
|
|
371
371
|
size: "md",
|
|
372
|
-
onClick: v[5] || (v[5] = async () =>
|
|
372
|
+
onClick: v[5] || (v[5] = async () => d())
|
|
373
373
|
}, null, 8, ["disabled"])
|
|
374
374
|
])
|
|
375
375
|
];
|
|
@@ -378,25 +378,25 @@ const Et = { class: "flex flex-col" }, Vt = { key: 1 }, It = { class: "flex flex
|
|
|
378
378
|
});
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
}),
|
|
381
|
+
}), Xe = vt("segment", () => {
|
|
382
382
|
const y = G([]);
|
|
383
383
|
async function k() {
|
|
384
|
-
const
|
|
384
|
+
const p = await dt.readAll({
|
|
385
385
|
limit: 1e3,
|
|
386
386
|
skip: 0,
|
|
387
387
|
sortBy: "_id",
|
|
388
388
|
descending: !0
|
|
389
389
|
});
|
|
390
|
-
y.value =
|
|
390
|
+
y.value = p.resources;
|
|
391
391
|
}
|
|
392
392
|
return {
|
|
393
393
|
segments: y,
|
|
394
394
|
read: k
|
|
395
395
|
};
|
|
396
396
|
});
|
|
397
|
-
class
|
|
397
|
+
class Pt extends ht {
|
|
398
398
|
}
|
|
399
|
-
const
|
|
399
|
+
const Ot = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" }, Ut = { class: "hidden xs:!flex items-center justify-end" }, Rt = { class: "flex items-center justify-between mb-4" }, Lt = { class: "flex items-center justify-between gap-x-8" }, zt = { class: "fm-typo-en-body-lg-600" }, jt = { class: "px-4 py-0.5 rounded-md bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" }, qt = { class: "xs:hidden flex justify-between gap-x-4" }, ke = /* @__PURE__ */ be({
|
|
400
400
|
__name: "MemberCollectionTable",
|
|
401
401
|
props: {
|
|
402
402
|
member: {
|
|
@@ -425,36 +425,36 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
425
425
|
}
|
|
426
426
|
},
|
|
427
427
|
setup(y) {
|
|
428
|
-
const k = y,
|
|
428
|
+
const k = y, p = G({
|
|
429
429
|
search: ""
|
|
430
|
-
}), x = G(!1), { tableMeta: s, rowData: o, onSort: g, debouncedFetchData:
|
|
430
|
+
}), x = G(!1), { tableMeta: s, rowData: o, onSort: g, debouncedFetchData: d, onSearch: w } = Ge(async (v) => {
|
|
431
431
|
const I = {
|
|
432
|
-
...
|
|
432
|
+
...p.value,
|
|
433
433
|
...k.filters
|
|
434
434
|
};
|
|
435
|
-
return await
|
|
435
|
+
return await Te.readCollectionsByMemberId(
|
|
436
436
|
k.member._id.toString(),
|
|
437
437
|
v,
|
|
438
438
|
I
|
|
439
439
|
);
|
|
440
440
|
});
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
ze(
|
|
442
|
+
p,
|
|
443
443
|
() => {
|
|
444
|
-
|
|
444
|
+
d();
|
|
445
445
|
},
|
|
446
446
|
{ deep: !0 }
|
|
447
447
|
);
|
|
448
|
-
async function
|
|
448
|
+
async function m() {
|
|
449
449
|
try {
|
|
450
450
|
x.value = !0;
|
|
451
451
|
const v = {
|
|
452
|
-
...
|
|
452
|
+
...p.value,
|
|
453
453
|
...k.filters
|
|
454
454
|
};
|
|
455
|
-
await
|
|
456
|
-
exporter: new
|
|
457
|
-
readFunction: (I) =>
|
|
455
|
+
await _t({
|
|
456
|
+
exporter: new Pt(),
|
|
457
|
+
readFunction: (I) => Te.readCollectionsByMemberId(
|
|
458
458
|
k.member._id.toString(),
|
|
459
459
|
I,
|
|
460
460
|
v
|
|
@@ -468,52 +468,52 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
468
468
|
x.value = !1;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
return
|
|
472
|
-
await
|
|
471
|
+
return at(async () => {
|
|
472
|
+
await d();
|
|
473
473
|
}), (v, I) => {
|
|
474
|
-
const
|
|
475
|
-
return
|
|
474
|
+
const N = V("FmSearch"), L = V("FmButton");
|
|
475
|
+
return u(), A("div", Ot, [
|
|
476
476
|
n("div", Ut, [
|
|
477
|
-
_(
|
|
477
|
+
_(N, {
|
|
478
478
|
class: "hidden xs:!flex",
|
|
479
|
-
modelValue: t(
|
|
479
|
+
modelValue: t(p).search,
|
|
480
480
|
"onUpdate:modelValue": [
|
|
481
|
-
I[0] || (I[0] = (P) => t(
|
|
481
|
+
I[0] || (I[0] = (P) => t(p).search = P),
|
|
482
482
|
t(w)
|
|
483
483
|
],
|
|
484
484
|
placeholder: "Search",
|
|
485
485
|
collapsible: ""
|
|
486
486
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
487
|
-
y.withExport ? (
|
|
487
|
+
y.withExport ? (u(), U(L, {
|
|
488
488
|
key: 0,
|
|
489
489
|
icon: "ios_share",
|
|
490
490
|
variant: "tertiary",
|
|
491
|
-
onClick:
|
|
492
|
-
})) :
|
|
491
|
+
onClick: m
|
|
492
|
+
})) : le("", !0)
|
|
493
493
|
]),
|
|
494
|
-
n("div",
|
|
495
|
-
n("div",
|
|
496
|
-
n("div",
|
|
497
|
-
n("div",
|
|
494
|
+
n("div", Rt, [
|
|
495
|
+
n("div", Lt, [
|
|
496
|
+
n("div", zt, $(k.title), 1),
|
|
497
|
+
n("div", jt, $(t(s).totalRows), 1)
|
|
498
498
|
]),
|
|
499
|
-
n("div",
|
|
500
|
-
_(
|
|
501
|
-
modelValue: t(
|
|
499
|
+
n("div", qt, [
|
|
500
|
+
_(N, {
|
|
501
|
+
modelValue: t(p).search,
|
|
502
502
|
"onUpdate:modelValue": [
|
|
503
|
-
I[1] || (I[1] = (P) => t(
|
|
503
|
+
I[1] || (I[1] = (P) => t(p).search = P),
|
|
504
504
|
t(w)
|
|
505
505
|
],
|
|
506
506
|
placeholder: "Search"
|
|
507
507
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
508
|
-
y.withExport ? (
|
|
508
|
+
y.withExport ? (u(), U(L, {
|
|
509
509
|
key: 0,
|
|
510
510
|
icon: "ios_share",
|
|
511
511
|
variant: "tertiary",
|
|
512
|
-
onClick:
|
|
513
|
-
})) :
|
|
512
|
+
onClick: m
|
|
513
|
+
})) : le("", !0)
|
|
514
514
|
])
|
|
515
515
|
]),
|
|
516
|
-
_(
|
|
516
|
+
_(He, {
|
|
517
517
|
loading: t(s).isLoading,
|
|
518
518
|
"row-data": t(o),
|
|
519
519
|
"row-count": t(s).totalRows,
|
|
@@ -523,7 +523,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
523
523
|
"page-size": t(s).pageSize,
|
|
524
524
|
"shrink-at": !1,
|
|
525
525
|
onSortChange: t(g),
|
|
526
|
-
onPageChange: I[2] || (I[2] = (P) => t(
|
|
526
|
+
onPageChange: I[2] || (I[2] = (P) => t(d)({
|
|
527
527
|
pageSize: P.pageSize,
|
|
528
528
|
pageIndex: P.pageIndex
|
|
529
529
|
}))
|
|
@@ -531,7 +531,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
531
531
|
]);
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
}),
|
|
534
|
+
}), Kt = /* @__PURE__ */ be({
|
|
535
535
|
__name: "MemberVouchers",
|
|
536
536
|
props: {
|
|
537
537
|
member: {
|
|
@@ -540,7 +540,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
542
|
setup(y) {
|
|
543
|
-
const k = y,
|
|
543
|
+
const k = y, p = [
|
|
544
544
|
{
|
|
545
545
|
header: "Voucher title",
|
|
546
546
|
meta: {
|
|
@@ -559,14 +559,14 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
559
559
|
{
|
|
560
560
|
header: "Claimed at",
|
|
561
561
|
accessorKey: "_id",
|
|
562
|
-
accessorFn: (o) =>
|
|
562
|
+
accessorFn: (o) => C(he(o._id.toString())).format("D MMM YYYY"),
|
|
563
563
|
enableSorting: !1
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
566
|
header: "Expired at",
|
|
567
567
|
cell(o) {
|
|
568
|
-
var
|
|
569
|
-
const g = (w = (
|
|
568
|
+
var d, w, m, v;
|
|
569
|
+
const g = (w = (d = o.row.original.expiryBalance) == null ? void 0 : d[0]) != null && w.expiredAt ? C((v = (m = o.row.original.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : v.expiredAt).format(
|
|
570
570
|
"D MMM YYYY"
|
|
571
571
|
) : "-";
|
|
572
572
|
return K("div", {}, g);
|
|
@@ -576,39 +576,39 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
576
576
|
{
|
|
577
577
|
header: "Transfer open",
|
|
578
578
|
accessorFn: (o) => {
|
|
579
|
-
var g,
|
|
580
|
-
return
|
|
579
|
+
var g, d, w;
|
|
580
|
+
return xt((w = (d = (g = o.pf_collectible) == null ? void 0 : g.options) == null ? void 0 : d.enableTransfer) == null ? void 0 : w.toString());
|
|
581
581
|
},
|
|
582
582
|
enableSorting: !1
|
|
583
583
|
}
|
|
584
584
|
], x = (o) => ({
|
|
585
|
-
type:
|
|
585
|
+
type: Ae.enum.VOUCHER,
|
|
586
586
|
isActive: o
|
|
587
587
|
}), s = (o) => {
|
|
588
|
-
var g,
|
|
588
|
+
var g, d, w, m, v, I, N;
|
|
589
589
|
return {
|
|
590
590
|
CollectionID: o._id,
|
|
591
591
|
Title: (g = o.pf_collectible) == null ? void 0 : g.name,
|
|
592
|
-
ClaimedAt:
|
|
592
|
+
ClaimedAt: C(he(o._id.toString())).format(
|
|
593
593
|
"D MMM YYYY, hh:mmA"
|
|
594
594
|
),
|
|
595
|
-
ExpiredAt: (w = (
|
|
596
|
-
TransferOpen: ((
|
|
595
|
+
ExpiredAt: (w = (d = o.expiryBalance) == null ? void 0 : d[0]) != null && w.expiredAt ? C((v = (m = o.expiryBalance) == null ? void 0 : m[0]) == null ? void 0 : v.expiredAt).format("D MMM YYYY") : "",
|
|
596
|
+
TransferOpen: ((N = (I = o.pf_collectible) == null ? void 0 : I.options) == null ? void 0 : N.enableTransfer) || !1
|
|
597
597
|
};
|
|
598
598
|
};
|
|
599
|
-
return (o, g) => (
|
|
599
|
+
return (o, g) => (u(), A(q, null, [
|
|
600
600
|
g[0] || (g[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
|
|
601
|
-
_(
|
|
601
|
+
_(ke, {
|
|
602
602
|
member: k.member,
|
|
603
|
-
columns:
|
|
603
|
+
columns: p,
|
|
604
604
|
title: "Active voucher",
|
|
605
605
|
filters: x(!0),
|
|
606
606
|
withExport: !0,
|
|
607
607
|
transformExportRecord: s
|
|
608
608
|
}, null, 8, ["member", "filters"]),
|
|
609
|
-
_(
|
|
609
|
+
_(ke, {
|
|
610
610
|
member: k.member,
|
|
611
|
-
columns:
|
|
611
|
+
columns: p,
|
|
612
612
|
title: "Past voucher",
|
|
613
613
|
filters: x(!1),
|
|
614
614
|
withExport: !0,
|
|
@@ -616,7 +616,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
616
616
|
}, null, 8, ["member", "filters"])
|
|
617
617
|
], 64));
|
|
618
618
|
}
|
|
619
|
-
}),
|
|
619
|
+
}), Gt = /* @__PURE__ */ be({
|
|
620
620
|
__name: "MemberMissions",
|
|
621
621
|
props: {
|
|
622
622
|
member: {
|
|
@@ -625,7 +625,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
setup(y) {
|
|
628
|
-
const k = y,
|
|
628
|
+
const k = y, p = [
|
|
629
629
|
{
|
|
630
630
|
header: "Mission title",
|
|
631
631
|
meta: {
|
|
@@ -644,8 +644,8 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
644
644
|
{
|
|
645
645
|
header: "Type",
|
|
646
646
|
accessorFn: (s) => {
|
|
647
|
-
var o, g,
|
|
648
|
-
return
|
|
647
|
+
var o, g, d;
|
|
648
|
+
return Oe.title(((d = (g = (o = s == null ? void 0 : s.pf_collectible) == null ? void 0 : o.extras) == null ? void 0 : g.mission) == null ? void 0 : d.type) || "-");
|
|
649
649
|
},
|
|
650
650
|
enableSorting: !1
|
|
651
651
|
},
|
|
@@ -659,12 +659,12 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
659
659
|
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
660
660
|
completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
661
661
|
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
662
|
-
},
|
|
662
|
+
}, d = St(
|
|
663
663
|
s.row.original.pf_campaign
|
|
664
|
-
),
|
|
664
|
+
), m = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && d === "active" ? "completed" : (o = s.row.original) != null && o.deactivatedAt ? "expired" : d;
|
|
665
665
|
return K(ve.FmChip, {
|
|
666
|
-
class: g[
|
|
667
|
-
label:
|
|
666
|
+
class: g[m],
|
|
667
|
+
label: Oe.title(m),
|
|
668
668
|
compact: !0
|
|
669
669
|
});
|
|
670
670
|
}
|
|
@@ -678,7 +678,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
678
678
|
},
|
|
679
679
|
{
|
|
680
680
|
header: "Summary",
|
|
681
|
-
accessorFn: (s) => s != null && s.pf_campaign ?
|
|
681
|
+
accessorFn: (s) => s != null && s.pf_campaign ? Ct(s.pf_campaign) : "Deleted Campaign",
|
|
682
682
|
enableSorting: !1
|
|
683
683
|
},
|
|
684
684
|
{
|
|
@@ -689,25 +689,25 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
689
689
|
{
|
|
690
690
|
header: "Total Step",
|
|
691
691
|
accessorFn: (s) => {
|
|
692
|
-
var o, g,
|
|
693
|
-
return ((
|
|
692
|
+
var o, g, d;
|
|
693
|
+
return ((d = (g = (o = s == null ? void 0 : s.pf_collectible) == null ? void 0 : o.extras) == null ? void 0 : g.mission) == null ? void 0 : d.end) ?? 0;
|
|
694
694
|
},
|
|
695
695
|
enableSorting: !1
|
|
696
696
|
}
|
|
697
697
|
], x = {
|
|
698
|
-
type:
|
|
698
|
+
type: Ae.enum.STAMP
|
|
699
699
|
};
|
|
700
|
-
return (s, o) => (
|
|
700
|
+
return (s, o) => (u(), A(q, null, [
|
|
701
701
|
o[0] || (o[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
|
|
702
|
-
_(
|
|
702
|
+
_(ke, {
|
|
703
703
|
member: k.member,
|
|
704
|
-
columns:
|
|
704
|
+
columns: p,
|
|
705
705
|
title: "Mission",
|
|
706
706
|
filters: x
|
|
707
707
|
}, null, 8, ["member"])
|
|
708
708
|
], 64));
|
|
709
709
|
}
|
|
710
|
-
}),
|
|
710
|
+
}), Ht = /* @__PURE__ */ be({
|
|
711
711
|
__name: "MemberGames",
|
|
712
712
|
props: {
|
|
713
713
|
member: {
|
|
@@ -716,7 +716,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
716
716
|
}
|
|
717
717
|
},
|
|
718
718
|
setup(y) {
|
|
719
|
-
const k = y,
|
|
719
|
+
const k = y, p = [
|
|
720
720
|
{
|
|
721
721
|
header: "Game title",
|
|
722
722
|
meta: {
|
|
@@ -735,14 +735,14 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
735
735
|
{
|
|
736
736
|
header: "Claimed at",
|
|
737
737
|
accessorKey: "_id",
|
|
738
|
-
accessorFn: (s) =>
|
|
738
|
+
accessorFn: (s) => C(he(s._id.toString())).format("D MMM YYYY"),
|
|
739
739
|
enableSorting: !1
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
742
|
header: "Expired at",
|
|
743
743
|
cell(s) {
|
|
744
|
-
var g,
|
|
745
|
-
const o = (
|
|
744
|
+
var g, d, w, m;
|
|
745
|
+
const o = (d = (g = s.row.original.expiryBalance) == null ? void 0 : g[0]) != null && d.expiredAt ? C((m = (w = s.row.original.expiryBalance) == null ? void 0 : w[0]) == null ? void 0 : m.expiredAt).format(
|
|
746
746
|
"D MMM YYYY"
|
|
747
747
|
) : "-";
|
|
748
748
|
return K("div", {}, o);
|
|
@@ -755,32 +755,32 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
755
755
|
enableSorting: !1
|
|
756
756
|
}
|
|
757
757
|
], x = (s) => ({
|
|
758
|
-
type:
|
|
758
|
+
type: Ae.enum.GAME,
|
|
759
759
|
isActive: s
|
|
760
760
|
});
|
|
761
|
-
return (s, o) => (
|
|
761
|
+
return (s, o) => (u(), A(q, null, [
|
|
762
762
|
o[0] || (o[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
|
|
763
|
-
_(
|
|
763
|
+
_(ke, {
|
|
764
764
|
member: k.member,
|
|
765
|
-
columns:
|
|
765
|
+
columns: p,
|
|
766
766
|
title: "Active game token",
|
|
767
767
|
filters: x(!0)
|
|
768
768
|
}, null, 8, ["member", "filters"])
|
|
769
769
|
], 64));
|
|
770
770
|
}
|
|
771
|
-
}),
|
|
771
|
+
}), Wt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, Jt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, Xt = { class: "space-y-16" }, Qt = { class: "flex gap-16 items-center" }, Zt = { class: "flex-auto" }, eo = { class: "fm-typo-en-body-md-600" }, to = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = { class: "fm-typo-en-body-md-800" }, ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ro = { class: "fm-typo-en-body-md-600" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, io = { class: "fm-typo-en-body-md-800" }, lo = { class: "gap-16 grid grid-cols-1" }, co = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mo = { class: "fm-typo-en-body-md-600" }, uo = { class: "p-16 grid md:grid-cols-3 lg:grid-cols-3 border-2 border-fm-color-neutral-gray-100 rounded-lg gap-16 divide-y md:divide-y-0 lg:divide-y-0 md:divide-x lg:divide-x divide-fm-color-neutral-gray-100" }, po = { class: "flex justify-between mb-16" }, fo = { class: "fm-typo-en-title-sm-600" }, bo = ["onClick"], yo = { class: "flex flex-col gap-y-16" }, go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vo = { class: "fm-typo-en-body-md-600" }, xo = { class: "space-y-8" }, ho = {
|
|
772
772
|
key: 0,
|
|
773
773
|
class: "space-x-8"
|
|
774
|
-
},
|
|
774
|
+
}, _o = {
|
|
775
775
|
key: 1,
|
|
776
776
|
class: "text-fm-color-typo-secondary"
|
|
777
|
-
},
|
|
777
|
+
}, So = { class: "space-y-8" }, Co = ["src"], wo = { class: "fm-typo-en-body-md-600" }, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Mo = {
|
|
778
778
|
key: 1,
|
|
779
779
|
class: "text-fm-color-typo-secondary"
|
|
780
|
-
},
|
|
780
|
+
}, To = {
|
|
781
781
|
key: 1,
|
|
782
782
|
class: "space-y-24"
|
|
783
|
-
},
|
|
783
|
+
}, ko = { class: "space-y-8" }, Ao = { class: "fm-typo-en-title-md-800" }, Eo = { class: "space-y-4" }, Vo = { class: "fm-typo-en-body-md-600" }, Io = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, $o = { class: "space-y-8" }, Do = { class: "fm-typo-en-title-md-800" }, No = { class: "space-y-4" }, Bo = { class: "fm-typo-en-body-md-600" }, Yo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, Po = /* @__PURE__ */ be({
|
|
784
784
|
__name: "MemberDetailSheet",
|
|
785
785
|
props: {
|
|
786
786
|
member: {
|
|
@@ -789,11 +789,11 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
791
|
emits: ["update:member"],
|
|
792
|
-
setup(y, { expose: k, emit:
|
|
793
|
-
const x =
|
|
792
|
+
setup(y, { expose: k, emit: p }) {
|
|
793
|
+
const x = We(), s = Ie(), o = Ke(), g = Xe(), d = Ve(), { minor: w } = qe, m = y, v = p, I = H(() => o.locations.map((a) => ({
|
|
794
794
|
label: a.name,
|
|
795
795
|
value: a._id
|
|
796
|
-
}))),
|
|
796
|
+
}))), N = H(() => (m.member.segment || []).map((a) => {
|
|
797
797
|
var e;
|
|
798
798
|
return ((e = g.segments.find((b) => b._id === a)) == null ? void 0 : e.name) || "";
|
|
799
799
|
}).filter(Boolean)), L = [
|
|
@@ -803,15 +803,15 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
803
803
|
{
|
|
804
804
|
label: "Experiences",
|
|
805
805
|
getter: (a) => {
|
|
806
|
-
var e, b,
|
|
807
|
-
return ee(((
|
|
806
|
+
var e, b, D;
|
|
807
|
+
return ee(((D = (b = (e = a.collection) == null ? void 0 : e.POINT) == null ? void 0 : b[0]) == null ? void 0 : D.balance) ?? 0, 2);
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
{
|
|
811
811
|
label: "Credits",
|
|
812
812
|
getter: (a) => {
|
|
813
|
-
var e, b,
|
|
814
|
-
return ee(((
|
|
813
|
+
var e, b, D;
|
|
814
|
+
return ee(((D = (b = (e = a.collection) == null ? void 0 : e.CREDIT) == null ? void 0 : b[0]) == null ? void 0 : D.balance) ?? 0, 2);
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
]
|
|
@@ -821,11 +821,11 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
821
821
|
stats: [
|
|
822
822
|
{
|
|
823
823
|
label: "Active vouchers",
|
|
824
|
-
getter: () => ee(
|
|
824
|
+
getter: () => ee(S.value.active, 0)
|
|
825
825
|
},
|
|
826
826
|
{
|
|
827
827
|
label: "Past vouchers",
|
|
828
|
-
getter: () => ee(
|
|
828
|
+
getter: () => ee(S.value.past, 0)
|
|
829
829
|
}
|
|
830
830
|
]
|
|
831
831
|
},
|
|
@@ -851,7 +851,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
851
851
|
var e, b;
|
|
852
852
|
return ee(
|
|
853
853
|
((b = (e = a.collection) == null ? void 0 : e.GAME) == null ? void 0 : b.reduce(
|
|
854
|
-
(
|
|
854
|
+
(D, B) => D + B.balance,
|
|
855
855
|
0
|
|
856
856
|
)) || 0,
|
|
857
857
|
0
|
|
@@ -869,7 +869,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
869
869
|
}
|
|
870
870
|
]
|
|
871
871
|
}
|
|
872
|
-
],
|
|
872
|
+
], ce = (() => {
|
|
873
873
|
const e = [];
|
|
874
874
|
for (let b = 0; b < L.length; b += 3)
|
|
875
875
|
e.push(L.slice(b, b + 3));
|
|
@@ -879,8 +879,8 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
879
879
|
switch (a.stopPropagation(), e) {
|
|
880
880
|
case "Store bundle":
|
|
881
881
|
await x.push({
|
|
882
|
-
name:
|
|
883
|
-
params: { id:
|
|
882
|
+
name: Je["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
883
|
+
params: { id: m.member._id.toString() },
|
|
884
884
|
query: { tab: "store" }
|
|
885
885
|
});
|
|
886
886
|
break;
|
|
@@ -890,30 +890,30 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
async function W(a, e) {
|
|
893
|
-
|
|
893
|
+
d.open({
|
|
894
894
|
title: "",
|
|
895
|
-
dialogComponent:
|
|
895
|
+
dialogComponent: Yt,
|
|
896
896
|
dialogComponentProps: {
|
|
897
897
|
type: a,
|
|
898
898
|
action: e,
|
|
899
899
|
onSubmit: async (b) => {
|
|
900
900
|
await w(
|
|
901
901
|
async () => {
|
|
902
|
-
const
|
|
903
|
-
"credit-send":
|
|
904
|
-
"credit-deduct":
|
|
905
|
-
"coin-send":
|
|
906
|
-
"coin-deduct":
|
|
907
|
-
},
|
|
908
|
-
X && await X(
|
|
902
|
+
const D = {
|
|
903
|
+
"credit-send": fe.sendCredit,
|
|
904
|
+
"credit-deduct": fe.deductCredit,
|
|
905
|
+
"coin-send": fe.sendCoin,
|
|
906
|
+
"coin-deduct": fe.deductCoin
|
|
907
|
+
}, B = `${a}-${e}`, X = D[B];
|
|
908
|
+
X && await X(m.member._id, b), v("update:member"), d.close();
|
|
909
909
|
},
|
|
910
910
|
{
|
|
911
|
-
message: `Adjusting ${
|
|
911
|
+
message: `Adjusting ${Ee.formattedType(
|
|
912
912
|
a.toUpperCase()
|
|
913
913
|
).toLowerCase()}`,
|
|
914
|
-
successMessage: `${b.amount} ${
|
|
914
|
+
successMessage: `${b.amount} ${Ee.formattedType(
|
|
915
915
|
a.toUpperCase()
|
|
916
|
-
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${
|
|
916
|
+
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${m.member.phoneNumber}`
|
|
917
917
|
}
|
|
918
918
|
);
|
|
919
919
|
}
|
|
@@ -921,26 +921,26 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
async function re() {
|
|
924
|
-
|
|
924
|
+
d.open({
|
|
925
925
|
title: "Update member statistics",
|
|
926
|
-
contentComponent:
|
|
926
|
+
contentComponent: $t,
|
|
927
927
|
contentComponentProps: {
|
|
928
|
-
member:
|
|
928
|
+
member: m.member,
|
|
929
929
|
onSubmit: async (a) => {
|
|
930
930
|
await w(
|
|
931
931
|
async () => {
|
|
932
|
-
await
|
|
932
|
+
await fe.updateMember(m.member._id, a), v("update:member"), d.close();
|
|
933
933
|
},
|
|
934
934
|
{
|
|
935
935
|
message: "Updating member stats",
|
|
936
|
-
successMessage: `Updated member ${
|
|
936
|
+
successMessage: `Updated member ${m.member.phoneNumber} stats successfully`
|
|
937
937
|
}
|
|
938
938
|
);
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
|
-
const
|
|
943
|
+
const f = [
|
|
944
944
|
{
|
|
945
945
|
label: "Mobile No.",
|
|
946
946
|
key: "phoneNumber"
|
|
@@ -948,9 +948,9 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
948
948
|
{
|
|
949
949
|
label: "Tier",
|
|
950
950
|
getter: (a) => {
|
|
951
|
-
var se,
|
|
952
|
-
const e = (((
|
|
953
|
-
return `${b} (${
|
|
951
|
+
var se, de, ye, h, Y;
|
|
952
|
+
const e = (((de = Ye.first((se = m.member.collection) == null ? void 0 : se.TIER)) == null ? void 0 : de.balance) || 0) - 1, b = M.value.name, D = ((h = (ye = a.collection) == null ? void 0 : ye.POINT) == null ? void 0 : h[0].balance) ?? 0, B = s.sortedTiers[e + 1], X = ((Y = B == null ? void 0 : B.option) == null ? void 0 : Y.from) ?? 1 / 0;
|
|
953
|
+
return `${b} (${D}/${X})`;
|
|
954
954
|
}
|
|
955
955
|
},
|
|
956
956
|
{
|
|
@@ -959,12 +959,12 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
959
959
|
},
|
|
960
960
|
{
|
|
961
961
|
label: "Birthday",
|
|
962
|
-
getter: (a) => a.birthday ?
|
|
962
|
+
getter: (a) => a.birthday ? C(a.birthday).format("D MMM YYYY") : "-"
|
|
963
963
|
}
|
|
964
964
|
], c = [
|
|
965
965
|
{
|
|
966
966
|
label: "Customer since",
|
|
967
|
-
getter: (a) =>
|
|
967
|
+
getter: (a) => C(he(a._id.toString())).format("D MMM YYYY")
|
|
968
968
|
},
|
|
969
969
|
{
|
|
970
970
|
label: "Joined at location",
|
|
@@ -975,22 +975,22 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
975
975
|
},
|
|
976
976
|
{
|
|
977
977
|
label: "Total visit(s)",
|
|
978
|
-
getter: (a) =>
|
|
978
|
+
getter: (a) => Ue.singularOrPlural(a.stats.visitCount, "bill")
|
|
979
979
|
},
|
|
980
980
|
{
|
|
981
981
|
label: "Last visit",
|
|
982
|
-
getter: (a) =>
|
|
982
|
+
getter: (a) => C(a.stats.lastVisit).fromNow()
|
|
983
983
|
},
|
|
984
984
|
{
|
|
985
985
|
label: "Frequency",
|
|
986
|
-
getter: (a) => `Every ${
|
|
986
|
+
getter: (a) => `Every ${Ue.singularOrPlural(
|
|
987
987
|
Number(Math.ceil(a.stats.avgVisitFrequency).toFixed(0)),
|
|
988
988
|
"day"
|
|
989
989
|
)}`
|
|
990
990
|
},
|
|
991
991
|
{
|
|
992
992
|
label: "Average spend",
|
|
993
|
-
getter: (a) =>
|
|
993
|
+
getter: (a) => mt.Dinero.fromNumber({ number: Number(a.stats.avgBillSize || 0) }).toFormat(
|
|
994
994
|
!0
|
|
995
995
|
)
|
|
996
996
|
}
|
|
@@ -1007,28 +1007,28 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1007
1007
|
// key: 'lastSeasonPointEarned',
|
|
1008
1008
|
// },
|
|
1009
1009
|
], M = H(() => {
|
|
1010
|
-
var b,
|
|
1011
|
-
const a = (((
|
|
1010
|
+
var b, D;
|
|
1011
|
+
const a = (((D = Ye.first((b = m.member.collection) == null ? void 0 : b.TIER)) == null ? void 0 : D.balance) || 0) - 1, e = s.sortedTiers[a];
|
|
1012
1012
|
return { name: (e == null ? void 0 : e.name) || "-", tier: a, config: e };
|
|
1013
1013
|
}), r = H(() => {
|
|
1014
1014
|
var a;
|
|
1015
|
-
return (((a =
|
|
1016
|
-
var
|
|
1017
|
-
const b = (
|
|
1015
|
+
return (((a = m.member.collection) == null ? void 0 : a.TITLE) || []).map((e) => {
|
|
1016
|
+
var D, B, X;
|
|
1017
|
+
const b = (D = s.sortedTitles) == null ? void 0 : D.find(
|
|
1018
1018
|
(se) => se._id == e.collectible
|
|
1019
1019
|
);
|
|
1020
1020
|
return {
|
|
1021
1021
|
name: b == null ? void 0 : b.name,
|
|
1022
|
-
expiredAt: (X = (
|
|
1022
|
+
expiredAt: (X = (B = e.expiryBalance) == null ? void 0 : B.at(-1)) == null ? void 0 : X.expiredAt,
|
|
1023
1023
|
collectible: b
|
|
1024
1024
|
};
|
|
1025
1025
|
}).filter(
|
|
1026
|
-
(e) => e.expiredAt ?
|
|
1026
|
+
(e) => e.expiredAt ? C(e.expiredAt).isAfter(C()) : !0
|
|
1027
1027
|
);
|
|
1028
|
-
}), i = G({ stamp: 0, progressive: 0 }),
|
|
1028
|
+
}), i = G({ stamp: 0, progressive: 0 }), S = G({ active: 0, past: 0 }), T = G([]), O = H(
|
|
1029
1029
|
() => T.value.reduce((a, e) => a + e.count, 0)
|
|
1030
1030
|
), E = G(!0);
|
|
1031
|
-
function
|
|
1031
|
+
function R() {
|
|
1032
1032
|
E.value = !0, F.value = z[0];
|
|
1033
1033
|
}
|
|
1034
1034
|
function te() {
|
|
@@ -1056,27 +1056,27 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1056
1056
|
value: "game"
|
|
1057
1057
|
}
|
|
1058
1058
|
], F = G(z[0]), J = async () => {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
), T.value = await
|
|
1063
|
-
|
|
1064
|
-
), i.value = await
|
|
1065
|
-
|
|
1059
|
+
S.value = await Te.readCollectionCountByMemberId(
|
|
1060
|
+
m.member._id.toString(),
|
|
1061
|
+
Ae.enum.VOUCHER
|
|
1062
|
+
), T.value = await wt.readPurchaseCountByMember(
|
|
1063
|
+
m.member._id.toString()
|
|
1064
|
+
), i.value = await Te.readMissionCountByMemberId(
|
|
1065
|
+
m.member._id.toString()
|
|
1066
1066
|
);
|
|
1067
1067
|
};
|
|
1068
|
-
return
|
|
1068
|
+
return je(async () => {
|
|
1069
1069
|
await s.readMembership(), await J(), o.locations.length || await o.readLocations();
|
|
1070
|
-
}),
|
|
1070
|
+
}), ze(E, async () => {
|
|
1071
1071
|
await J();
|
|
1072
1072
|
}), k({
|
|
1073
|
-
showSheet:
|
|
1073
|
+
showSheet: R,
|
|
1074
1074
|
hideSheet: te
|
|
1075
1075
|
}), (a, e) => {
|
|
1076
|
-
const b = V("FmTabs"),
|
|
1077
|
-
return
|
|
1076
|
+
const b = V("FmTabs"), D = V("FmAvatar"), B = V("FmButton"), X = V("FmIcon"), se = V("FmChip"), de = V("FmCard"), ye = V("FmSideSheet");
|
|
1077
|
+
return u(), U(ye, {
|
|
1078
1078
|
modelValue: t(E),
|
|
1079
|
-
"onUpdate:modelValue": e[5] || (e[5] = (h) =>
|
|
1079
|
+
"onUpdate:modelValue": e[5] || (e[5] = (h) => rt(E) ? E.value = h : null),
|
|
1080
1080
|
header: "Member Detail",
|
|
1081
1081
|
"dismiss-away": "",
|
|
1082
1082
|
"close-button": !0,
|
|
@@ -1084,7 +1084,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1084
1084
|
}, {
|
|
1085
1085
|
"side-sheet-footer": xe(() => [...e[19] || (e[19] = [])]),
|
|
1086
1086
|
default: xe(() => [
|
|
1087
|
-
n("div",
|
|
1087
|
+
n("div", Wt, [
|
|
1088
1088
|
n("div", null, [
|
|
1089
1089
|
_(b, {
|
|
1090
1090
|
"model-value": t(F).value,
|
|
@@ -1093,61 +1093,61 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1093
1093
|
"onUpdate:modelValue": e[0] || (e[0] = (h) => F.value = z.find((Y) => Y.value === h))
|
|
1094
1094
|
}, null, 8, ["model-value"])
|
|
1095
1095
|
]),
|
|
1096
|
-
t(F).value == "overview" ? (
|
|
1097
|
-
n("div",
|
|
1096
|
+
t(F).value == "overview" ? (u(), A(q, { key: 0 }, [
|
|
1097
|
+
n("div", Jt, [
|
|
1098
1098
|
n("div", null, [
|
|
1099
1099
|
e[9] || (e[9] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1100
|
-
n("div",
|
|
1101
|
-
n("div",
|
|
1102
|
-
_(
|
|
1100
|
+
n("div", Xt, [
|
|
1101
|
+
n("div", Qt, [
|
|
1102
|
+
_(D, {
|
|
1103
1103
|
name: y.member.photoUrl ? void 0 : y.member.name,
|
|
1104
1104
|
src: y.member.photoUrl || void 0
|
|
1105
1105
|
}, null, 8, ["name", "src"]),
|
|
1106
|
-
n("div",
|
|
1106
|
+
n("div", Zt, [
|
|
1107
1107
|
e[7] || (e[7] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1108
|
-
n("div",
|
|
1109
|
-
n("div",
|
|
1110
|
-
n("div",
|
|
1111
|
-
e[6] || (e[6] =
|
|
1112
|
-
n("span",
|
|
1108
|
+
n("div", eo, $(y.member.name), 1),
|
|
1109
|
+
n("div", to, $(y.member._id), 1),
|
|
1110
|
+
n("div", oo, [
|
|
1111
|
+
e[6] || (e[6] = Me(" Member Card: ", -1)),
|
|
1112
|
+
n("span", no, $(y.member.cardNo ? y.member.cardNo : "-"), 1)
|
|
1113
1113
|
])
|
|
1114
1114
|
]),
|
|
1115
|
-
_(
|
|
1115
|
+
_(B, {
|
|
1116
1116
|
variant: "tertiary",
|
|
1117
1117
|
icon: "settings",
|
|
1118
1118
|
onClick: re
|
|
1119
1119
|
})
|
|
1120
1120
|
]),
|
|
1121
|
-
(
|
|
1122
|
-
n("div",
|
|
1123
|
-
n("div",
|
|
1121
|
+
(u(), A(q, null, ie(f, (h, Y) => n("div", { key: Y }, [
|
|
1122
|
+
n("div", ao, $(h.label), 1),
|
|
1123
|
+
n("div", ro, $(h.key ? y.member[h.key] : h.getter(y.member)), 1)
|
|
1124
1124
|
])), 64)),
|
|
1125
|
-
n("div",
|
|
1126
|
-
e[8] || (e[8] =
|
|
1127
|
-
n("span",
|
|
1125
|
+
n("div", so, [
|
|
1126
|
+
e[8] || (e[8] = Me(" Referral Code: ", -1)),
|
|
1127
|
+
n("span", io, $(y.member.referralCode ? y.member.referralCode : "-"), 1)
|
|
1128
1128
|
])
|
|
1129
1129
|
])
|
|
1130
1130
|
]),
|
|
1131
1131
|
n("div", null, [
|
|
1132
1132
|
e[10] || (e[10] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1133
|
-
n("div",
|
|
1134
|
-
(
|
|
1133
|
+
n("div", lo, [
|
|
1134
|
+
(u(), A(q, null, ie(c, (h) => n("div", {
|
|
1135
1135
|
key: h.key
|
|
1136
1136
|
}, [
|
|
1137
|
-
n("div",
|
|
1138
|
-
n("div",
|
|
1137
|
+
n("div", co, $(h.label), 1),
|
|
1138
|
+
n("div", mo, $(h.key ? m.member.stats[h.key] || "-" : h.getter(y.member)), 1)
|
|
1139
1139
|
])), 64))
|
|
1140
1140
|
])
|
|
1141
1141
|
])
|
|
1142
1142
|
]),
|
|
1143
1143
|
e[13] || (e[13] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1144
|
-
(
|
|
1145
|
-
(
|
|
1144
|
+
(u(!0), A(q, null, ie(t(ce), (h) => (u(), A("div", uo, [
|
|
1145
|
+
(u(!0), A(q, null, ie(h, (Y, oe) => (u(), A("div", { key: oe }, [
|
|
1146
1146
|
n("div", {
|
|
1147
|
-
class:
|
|
1147
|
+
class: st(oe !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1148
1148
|
}, [
|
|
1149
|
-
n("div",
|
|
1150
|
-
n("div",
|
|
1149
|
+
n("div", po, [
|
|
1150
|
+
n("div", fo, $(Y.label), 1),
|
|
1151
1151
|
n("button", {
|
|
1152
1152
|
onClick: (j) => ae(j, Y.label)
|
|
1153
1153
|
}, [
|
|
@@ -1156,71 +1156,71 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1156
1156
|
outline: "",
|
|
1157
1157
|
size: "md"
|
|
1158
1158
|
})
|
|
1159
|
-
], 8,
|
|
1159
|
+
], 8, bo)
|
|
1160
1160
|
]),
|
|
1161
|
-
n("div",
|
|
1162
|
-
(
|
|
1161
|
+
n("div", yo, [
|
|
1162
|
+
(u(!0), A(q, null, ie(Y.stats, (j) => (u(), A("div", {
|
|
1163
1163
|
key: j.key
|
|
1164
1164
|
}, [
|
|
1165
|
-
n("div",
|
|
1166
|
-
n("div",
|
|
1165
|
+
n("div", go, $(j.label), 1),
|
|
1166
|
+
n("div", vo, $(j.getter(y.member)), 1)
|
|
1167
1167
|
]))), 128))
|
|
1168
1168
|
])
|
|
1169
1169
|
], 2)
|
|
1170
1170
|
]))), 128))
|
|
1171
1171
|
]))), 256)),
|
|
1172
|
-
n("div",
|
|
1172
|
+
n("div", xo, [
|
|
1173
1173
|
e[11] || (e[11] = n("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1174
|
-
t(
|
|
1175
|
-
(
|
|
1174
|
+
t(N).length ? (u(), A("div", ho, [
|
|
1175
|
+
(u(!0), A(q, null, ie(t(N), (h) => (u(), U(se, {
|
|
1176
1176
|
label: h.toString()
|
|
1177
1177
|
}, null, 8, ["label"]))), 256))
|
|
1178
|
-
])) : (
|
|
1178
|
+
])) : (u(), A("div", _o, "No titles"))
|
|
1179
1179
|
]),
|
|
1180
1180
|
e[14] || (e[14] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1181
|
-
n("div",
|
|
1181
|
+
n("div", So, [
|
|
1182
1182
|
e[12] || (e[12] = n("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1183
|
-
t(r).length ? (
|
|
1183
|
+
t(r).length ? (u(!0), A(q, { key: 0 }, ie(t(r).filter((h) => h.collectible), (h) => (u(), A("div", {
|
|
1184
1184
|
class: "flex items-center gap-x-8 h-48",
|
|
1185
1185
|
key: h.name
|
|
1186
1186
|
}, [
|
|
1187
1187
|
n("img", {
|
|
1188
|
-
src: h.collectible.image || t(
|
|
1188
|
+
src: h.collectible.image || t(ut),
|
|
1189
1189
|
class: "aspect-square h-full object-contain"
|
|
1190
|
-
}, null, 8,
|
|
1190
|
+
}, null, 8, Co),
|
|
1191
1191
|
n("div", null, [
|
|
1192
|
-
n("div",
|
|
1193
|
-
n("div",
|
|
1192
|
+
n("div", wo, $(h.name), 1),
|
|
1193
|
+
n("div", Fo, " Expired on " + $(t(C)(h.expiredAt).format("MMM D, Y")), 1)
|
|
1194
1194
|
])
|
|
1195
|
-
]))), 128)) : (
|
|
1195
|
+
]))), 128)) : (u(), A("div", Mo, "No titles"))
|
|
1196
1196
|
])
|
|
1197
|
-
], 64)) : t(F).value == "loyalty" ? (
|
|
1198
|
-
_(
|
|
1197
|
+
], 64)) : t(F).value == "loyalty" ? (u(), A("div", To, [
|
|
1198
|
+
_(de, {
|
|
1199
1199
|
class: "p-16 space-y-24",
|
|
1200
1200
|
variant: "outlined"
|
|
1201
1201
|
}, {
|
|
1202
1202
|
default: xe(() => {
|
|
1203
|
-
var h, Y, oe, j, ue, pe
|
|
1203
|
+
var h, Y, oe, j, me, ue, pe;
|
|
1204
1204
|
return [
|
|
1205
|
-
n("div",
|
|
1205
|
+
n("div", ko, [
|
|
1206
1206
|
e[15] || (e[15] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit ", -1)),
|
|
1207
|
-
n("div",
|
|
1207
|
+
n("div", Ao, $(((oe = (Y = (h = y.member.collection) == null ? void 0 : h.CREDIT) == null ? void 0 : Y[0]) == null ? void 0 : oe.balance) ?? 0), 1)
|
|
1208
1208
|
]),
|
|
1209
|
-
n("div",
|
|
1209
|
+
n("div", Eo, [
|
|
1210
1210
|
e[16] || (e[16] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1211
|
-
n("div",
|
|
1212
|
-
(Q, Z) => Z.expiredAt && t(
|
|
1211
|
+
n("div", Vo, $(((pe = (ue = (me = (j = y.member.collection) == null ? void 0 : j.CREDIT) == null ? void 0 : me[0]) == null ? void 0 : ue.expiryBalance) == null ? void 0 : pe.reduce(
|
|
1212
|
+
(Q, Z) => Z.expiredAt && t(C)(Z.expiredAt).isAfter(t(C)()) && t(C)(Z.expiredAt).isBefore(t(C)().add(30, "days")) ? Q + Z.amount : Q,
|
|
1213
1213
|
0
|
|
1214
1214
|
)) ?? 0), 1)
|
|
1215
1215
|
]),
|
|
1216
|
-
n("div",
|
|
1217
|
-
_(
|
|
1216
|
+
n("div", Io, [
|
|
1217
|
+
_(B, {
|
|
1218
1218
|
label: "Add credit",
|
|
1219
1219
|
icon: "add",
|
|
1220
1220
|
variant: "plain",
|
|
1221
1221
|
onClick: e[1] || (e[1] = (Q) => W("credit", "send"))
|
|
1222
1222
|
}),
|
|
1223
|
-
_(
|
|
1223
|
+
_(B, {
|
|
1224
1224
|
label: "Deduct credit",
|
|
1225
1225
|
icon: "remove",
|
|
1226
1226
|
variant: "plain",
|
|
@@ -1231,32 +1231,32 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1231
1231
|
}),
|
|
1232
1232
|
_: 1
|
|
1233
1233
|
}),
|
|
1234
|
-
_(
|
|
1234
|
+
_(de, {
|
|
1235
1235
|
class: "p-16 space-y-24",
|
|
1236
1236
|
variant: "outlined"
|
|
1237
1237
|
}, {
|
|
1238
1238
|
default: xe(() => {
|
|
1239
|
-
var h, Y, oe, j, ue, pe
|
|
1239
|
+
var h, Y, oe, j, me, ue, pe;
|
|
1240
1240
|
return [
|
|
1241
|
-
n("div",
|
|
1241
|
+
n("div", $o, [
|
|
1242
1242
|
e[17] || (e[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
|
|
1243
1243
|
n("div", Do, $(((oe = (Y = (h = y.member.collection) == null ? void 0 : h.COIN) == null ? void 0 : Y[0]) == null ? void 0 : oe.balance) ?? 0), 1)
|
|
1244
1244
|
]),
|
|
1245
1245
|
n("div", No, [
|
|
1246
1246
|
e[18] || (e[18] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1247
|
-
n("div",
|
|
1248
|
-
(Q, Z) => Z.expiredAt && t(
|
|
1247
|
+
n("div", Bo, $(((pe = (ue = (me = (j = y.member.collection) == null ? void 0 : j.COIN) == null ? void 0 : me[0]) == null ? void 0 : ue.expiryBalance) == null ? void 0 : pe.reduce(
|
|
1248
|
+
(Q, Z) => Z.expiredAt && t(C)(Z.expiredAt).isAfter(t(C)()) && t(C)(Z.expiredAt).isBefore(t(C)().add(30, "days")) ? Q + Z.amount : Q,
|
|
1249
1249
|
0
|
|
1250
1250
|
)) ?? 0), 1)
|
|
1251
1251
|
]),
|
|
1252
|
-
n("div",
|
|
1253
|
-
_(
|
|
1252
|
+
n("div", Yo, [
|
|
1253
|
+
_(B, {
|
|
1254
1254
|
label: "Add point",
|
|
1255
1255
|
icon: "add",
|
|
1256
1256
|
variant: "plain",
|
|
1257
1257
|
onClick: e[3] || (e[3] = (Q) => W("coin", "send"))
|
|
1258
1258
|
}),
|
|
1259
|
-
_(
|
|
1259
|
+
_(B, {
|
|
1260
1260
|
label: "Deduct point",
|
|
1261
1261
|
icon: "remove",
|
|
1262
1262
|
variant: "plain",
|
|
@@ -1267,32 +1267,32 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1267
1267
|
}),
|
|
1268
1268
|
_: 1
|
|
1269
1269
|
})
|
|
1270
|
-
])) : t(F).value == "voucher" ? (
|
|
1270
|
+
])) : t(F).value == "voucher" ? (u(), U(Kt, {
|
|
1271
1271
|
key: 2,
|
|
1272
|
-
member:
|
|
1273
|
-
}, null, 8, ["member"])) : t(F).value == "mission" ? (
|
|
1272
|
+
member: m.member
|
|
1273
|
+
}, null, 8, ["member"])) : t(F).value == "mission" ? (u(), U(Gt, {
|
|
1274
1274
|
key: 3,
|
|
1275
|
-
member:
|
|
1276
|
-
}, null, 8, ["member"])) : t(F).value == "game" ? (
|
|
1275
|
+
member: m.member
|
|
1276
|
+
}, null, 8, ["member"])) : t(F).value == "game" ? (u(), U(Ht, {
|
|
1277
1277
|
key: 4,
|
|
1278
|
-
member:
|
|
1279
|
-
}, null, 8, ["member"])) :
|
|
1278
|
+
member: m.member
|
|
1279
|
+
}, null, 8, ["member"])) : le("", !0)
|
|
1280
1280
|
])
|
|
1281
1281
|
]),
|
|
1282
1282
|
_: 1
|
|
1283
1283
|
}, 8, ["modelValue"]);
|
|
1284
1284
|
};
|
|
1285
1285
|
}
|
|
1286
|
-
}),
|
|
1286
|
+
}), Oo = { class: "flex items-center justify-end" }, Sn = /* @__PURE__ */ be({
|
|
1287
1287
|
__name: "MemberList",
|
|
1288
1288
|
setup(y) {
|
|
1289
|
-
const k =
|
|
1289
|
+
const k = Xe(), p = Ie(), x = Ke(), { minor: s } = qe, o = We(), g = [
|
|
1290
1290
|
{
|
|
1291
1291
|
header: "Name",
|
|
1292
1292
|
enableSorting: !0,
|
|
1293
1293
|
accessorKey: "name",
|
|
1294
1294
|
cell(r) {
|
|
1295
|
-
return
|
|
1295
|
+
return Mt(r.row.original);
|
|
1296
1296
|
}
|
|
1297
1297
|
},
|
|
1298
1298
|
{
|
|
@@ -1301,7 +1301,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1301
1301
|
accessorKey: "phoneNumber"
|
|
1302
1302
|
},
|
|
1303
1303
|
{
|
|
1304
|
-
accessorFn: (r) =>
|
|
1304
|
+
accessorFn: (r) => C(he(r._id.toString())).format("D MMM YYYY"),
|
|
1305
1305
|
header: "Customer Since",
|
|
1306
1306
|
accessorKey: "_id",
|
|
1307
1307
|
id: "_id"
|
|
@@ -1311,9 +1311,9 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1311
1311
|
header: "Tier",
|
|
1312
1312
|
enableSorting: !0,
|
|
1313
1313
|
cell(r) {
|
|
1314
|
-
return
|
|
1314
|
+
return Tt(
|
|
1315
1315
|
r.row.original,
|
|
1316
|
-
|
|
1316
|
+
p.sortedTiers
|
|
1317
1317
|
);
|
|
1318
1318
|
}
|
|
1319
1319
|
},
|
|
@@ -1321,17 +1321,17 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1321
1321
|
header: "Title",
|
|
1322
1322
|
enableSorting: !1,
|
|
1323
1323
|
cell(r) {
|
|
1324
|
-
return
|
|
1324
|
+
return kt(
|
|
1325
1325
|
r.row.original,
|
|
1326
|
-
|
|
1326
|
+
p.sortedTitles
|
|
1327
1327
|
);
|
|
1328
1328
|
}
|
|
1329
1329
|
},
|
|
1330
1330
|
{
|
|
1331
1331
|
accessorKey: "collection_CREDIT_0_balance",
|
|
1332
1332
|
accessorFn: (r) => {
|
|
1333
|
-
var i,
|
|
1334
|
-
return ee(((T = (
|
|
1333
|
+
var i, S, T;
|
|
1334
|
+
return ee(((T = (S = (i = r.collection) == null ? void 0 : i.CREDIT) == null ? void 0 : S[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1335
1335
|
},
|
|
1336
1336
|
header: "Credit(s)",
|
|
1337
1337
|
enableSorting: !0
|
|
@@ -1339,8 +1339,8 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1339
1339
|
{
|
|
1340
1340
|
accessorKey: "collection_POINT_0_balance",
|
|
1341
1341
|
accessorFn: (r) => {
|
|
1342
|
-
var i,
|
|
1343
|
-
return ee(((T = (
|
|
1342
|
+
var i, S, T;
|
|
1343
|
+
return ee(((T = (S = (i = r.collection) == null ? void 0 : i.POINT) == null ? void 0 : S[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1344
1344
|
},
|
|
1345
1345
|
header: "Experience(s)",
|
|
1346
1346
|
enableSorting: !0
|
|
@@ -1348,8 +1348,8 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1348
1348
|
{
|
|
1349
1349
|
accessorKey: "collection_COIN_0_balance",
|
|
1350
1350
|
accessorFn: (r) => {
|
|
1351
|
-
var i,
|
|
1352
|
-
return ee(((T = (
|
|
1351
|
+
var i, S, T;
|
|
1352
|
+
return ee(((T = (S = (i = r.collection) == null ? void 0 : i.COIN) == null ? void 0 : S[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
1353
1353
|
},
|
|
1354
1354
|
header: "Point(s)",
|
|
1355
1355
|
enableSorting: !0
|
|
@@ -1369,22 +1369,22 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1369
1369
|
return (i = r.stats) == null ? void 0 : i.lastVisit;
|
|
1370
1370
|
},
|
|
1371
1371
|
sortingFn: (r, i) => {
|
|
1372
|
-
var
|
|
1373
|
-
return new Date((
|
|
1372
|
+
var S, T;
|
|
1373
|
+
return new Date((S = r.original.stats) == null ? void 0 : S.lastVisit).getTime() - new Date((T = i.original.stats) == null ? void 0 : T.lastVisit).getTime();
|
|
1374
1374
|
},
|
|
1375
1375
|
id: "stats.lastVisit",
|
|
1376
1376
|
header: "Last visit",
|
|
1377
1377
|
cell(r) {
|
|
1378
|
-
var i,
|
|
1378
|
+
var i, S;
|
|
1379
1379
|
return K("div", { class: "flex items-center justify-end gap-4" }, [
|
|
1380
1380
|
K(
|
|
1381
1381
|
"span",
|
|
1382
|
-
(i = r.row.original.stats) != null && i.lastVisit ?
|
|
1382
|
+
(i = r.row.original.stats) != null && i.lastVisit ? C((S = r.row.original.stats) == null ? void 0 : S.lastVisit).fromNow() : "NA"
|
|
1383
1383
|
),
|
|
1384
1384
|
K(
|
|
1385
1385
|
ve.FmTooltip,
|
|
1386
1386
|
{
|
|
1387
|
-
content:
|
|
1387
|
+
content: C(r.row.original.stats.lastVisit).format(
|
|
1388
1388
|
"D MMM YYYY - hh:mmA"
|
|
1389
1389
|
)
|
|
1390
1390
|
},
|
|
@@ -1418,12 +1418,12 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
], { tableMeta:
|
|
1421
|
+
], { tableMeta: d, rowData: w, onSort: m, debouncedFetchData: v, onSearch: I } = Ge(fe.read), N = G(), L = G(!1), P = G(), ce = H(() => x.locations.map((r) => ({
|
|
1422
1422
|
label: r.name,
|
|
1423
1423
|
value: r._id
|
|
1424
1424
|
})));
|
|
1425
1425
|
async function ae() {
|
|
1426
|
-
P.value = await
|
|
1426
|
+
P.value = await fe.readById(
|
|
1427
1427
|
P.value._id.toString()
|
|
1428
1428
|
), L.value = !0;
|
|
1429
1429
|
}
|
|
@@ -1432,99 +1432,94 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1432
1432
|
}
|
|
1433
1433
|
async function re(r) {
|
|
1434
1434
|
await o.push({
|
|
1435
|
-
name:
|
|
1435
|
+
name: Je["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
1436
1436
|
params: { id: r }
|
|
1437
1437
|
});
|
|
1438
1438
|
}
|
|
1439
|
-
const
|
|
1439
|
+
const f = {
|
|
1440
1440
|
sortBy: "_id",
|
|
1441
1441
|
descending: !1,
|
|
1442
|
-
rowsPerPage: 1e3
|
|
1443
|
-
page: 1,
|
|
1444
|
-
rowsNumber: 0
|
|
1442
|
+
rowsPerPage: 1e3
|
|
1445
1443
|
};
|
|
1446
1444
|
function c(r) {
|
|
1447
|
-
const i =
|
|
1445
|
+
const i = C(r);
|
|
1448
1446
|
return i.isValid() ? i.format("DD/MM/YYYY") : "";
|
|
1449
1447
|
}
|
|
1450
1448
|
async function M() {
|
|
1451
|
-
const r = new
|
|
1452
|
-
limit: 1,
|
|
1453
|
-
skip: 0,
|
|
1454
|
-
sortBy: d.sortBy,
|
|
1455
|
-
descending: d.descending
|
|
1456
|
-
})).meta.totalResources ?? 0, C = d.rowsPerPage;
|
|
1449
|
+
const r = new lt(), i = f.rowsPerPage;
|
|
1457
1450
|
await s(
|
|
1458
1451
|
async () => {
|
|
1459
|
-
var
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
limit:
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1452
|
+
var O, E, R, te, z, F, J, a, e, b, D, B, X, se, de, ye, h, Y, oe, j, me, ue, pe, Q, Z;
|
|
1453
|
+
let S, T = !0;
|
|
1454
|
+
for (; T; ) {
|
|
1455
|
+
const we = await fe.readCursor({
|
|
1456
|
+
limit: i,
|
|
1457
|
+
sortBy: f.sortBy,
|
|
1458
|
+
descending: f.descending,
|
|
1459
|
+
...S ? { cursor: S } : {}
|
|
1460
|
+
});
|
|
1461
|
+
if (!we.resources.length)
|
|
1462
|
+
break;
|
|
1463
|
+
for (const l of we.resources) {
|
|
1464
|
+
const Qe = (O = it.parseOneAddress(
|
|
1470
1465
|
l == null ? void 0 : l.email
|
|
1471
|
-
)) != null &&
|
|
1466
|
+
)) != null && O.domain.includes("feedmepos.com") ? void 0 : l.email, Ze = (R = ((E = l == null ? void 0 : l.collection) == null ? void 0 : E.TITLE) || []) == null ? void 0 : R.reduce(
|
|
1472
1467
|
(ne, ge) => {
|
|
1473
1468
|
var Se, Ce;
|
|
1474
|
-
const _e = (Ce = (Se =
|
|
1475
|
-
(
|
|
1469
|
+
const _e = (Ce = (Se = p.sortedTitles) == null ? void 0 : Se.find(
|
|
1470
|
+
(Fe) => Fe._id === ge.collectible
|
|
1476
1471
|
)) == null ? void 0 : Ce.name;
|
|
1477
1472
|
return !_e || ge.balance <= 0 || ne.push(_e), ne;
|
|
1478
1473
|
},
|
|
1479
1474
|
[]
|
|
1480
|
-
),
|
|
1475
|
+
), et = (p.sortedTitles || []).reduce(
|
|
1481
1476
|
(ne, ge) => {
|
|
1482
|
-
var Se, Ce,
|
|
1483
|
-
const _e = (
|
|
1484
|
-
(
|
|
1485
|
-
)) == null ? void 0 : Ce.expiryBalance) == null ? void 0 :
|
|
1486
|
-
return ne[ge.name] = _e ?
|
|
1477
|
+
var Se, Ce, Fe, Ne;
|
|
1478
|
+
const _e = (Ne = (Fe = (Ce = (((Se = l == null ? void 0 : l.collection) == null ? void 0 : Se.TITLE) || []).find(
|
|
1479
|
+
(nt) => nt.collectible === ge._id
|
|
1480
|
+
)) == null ? void 0 : Ce.expiryBalance) == null ? void 0 : Fe[0]) == null ? void 0 : Ne.expiredAt;
|
|
1481
|
+
return ne[ge.name] = _e ? C(_e).format("DD/MM/YYYY") : "", ne;
|
|
1487
1482
|
},
|
|
1488
1483
|
{}
|
|
1489
|
-
),
|
|
1484
|
+
), tt = ((F = (z = (te = l.collection) == null ? void 0 : te.CREDIT) == null ? void 0 : z.at(0)) == null ? void 0 : F.balance) || 0, $e = ((b = (e = (a = (J = l.collection) == null ? void 0 : J.CREDIT) == null ? void 0 : a.at(0)) == null ? void 0 : e.expiryBalance) == null ? void 0 : b.reduce(
|
|
1490
1485
|
(ne, ge) => ne + ge.amount,
|
|
1491
1486
|
0
|
|
1492
|
-
)) || 0,
|
|
1487
|
+
)) || 0, De = ee(tt, 2), ot = {
|
|
1493
1488
|
ID: l._id.toString(),
|
|
1494
|
-
Name: ((
|
|
1489
|
+
Name: ((D = l.name) == null ? void 0 : D.trim()) || "",
|
|
1495
1490
|
Phone: ((B = l == null ? void 0 : l.phoneNumber) == null ? void 0 : B.trim()) || "",
|
|
1496
|
-
Email:
|
|
1491
|
+
Email: Qe || "",
|
|
1497
1492
|
Gender: l.gender || "",
|
|
1498
1493
|
CardNo: l.cardNo || "",
|
|
1499
1494
|
Birthday: l != null && l.birthday ? c(l == null ? void 0 : l.birthday) : "",
|
|
1500
|
-
Credit: (Number(
|
|
1501
|
-
FreeCredit: Number(
|
|
1502
|
-
TotalCredit: Number(
|
|
1503
|
-
Exp: l != null && l.collection ? ((
|
|
1504
|
-
Point: l != null && l.collection ? ((
|
|
1505
|
-
Tier: l != null && l.collection ? ((
|
|
1506
|
-
Titles:
|
|
1507
|
-
...
|
|
1495
|
+
Credit: (Number(De) - Number($e)).toFixed(2),
|
|
1496
|
+
FreeCredit: Number($e.toFixed(2)),
|
|
1497
|
+
TotalCredit: Number(De),
|
|
1498
|
+
Exp: l != null && l.collection ? ((de = (se = (X = l.collection) == null ? void 0 : X.POINT) == null ? void 0 : se.at(0)) == null ? void 0 : de.balance) ?? 0 : 0,
|
|
1499
|
+
Point: l != null && l.collection ? ((Y = (h = (ye = l.collection) == null ? void 0 : ye.COIN) == null ? void 0 : h.at(0)) == null ? void 0 : Y.balance) ?? 0 : 0,
|
|
1500
|
+
Tier: l != null && l.collection ? ((me = (j = (oe = l.collection) == null ? void 0 : oe.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : me.balance) ?? 0 : 0,
|
|
1501
|
+
Titles: Ze.join(","),
|
|
1502
|
+
...et,
|
|
1508
1503
|
TotalTransaction: l.stats.visitCount,
|
|
1509
|
-
AvgSpent:
|
|
1504
|
+
AvgSpent: Ft(Number(l.stats.avgBillSize || 0)).toFormat(
|
|
1510
1505
|
!1
|
|
1511
1506
|
),
|
|
1512
1507
|
TotalSpent: l.stats.avgBillSize * l.stats.visitCount,
|
|
1513
1508
|
LastVisit: c(l.stats.lastVisit),
|
|
1514
1509
|
Feedback: ((ue = l.stats) == null ? void 0 : ue.feedbackCount) || 0,
|
|
1515
1510
|
LastSeasonTierEarned: ((pe = l.stats) == null ? void 0 : pe.lastSeasonTierEarned) || 0,
|
|
1516
|
-
LastSeasonPointEarned: ((
|
|
1511
|
+
LastSeasonPointEarned: ((Q = l.stats) == null ? void 0 : Q.lastSeasonPointEarned) || 0,
|
|
1517
1512
|
JoinedAt: c(l.joinAt || he(l._id)),
|
|
1518
|
-
JoinedAtLocation: l.location && ((
|
|
1513
|
+
JoinedAtLocation: l.location && ((Z = ce.value.find((ne) => ne.value == l.location)) == null ? void 0 : Z.label) || "-",
|
|
1519
1514
|
VisitFrequency: `${Number(
|
|
1520
1515
|
Math.ceil(l.stats.avgVisitFrequency).toFixed(0)
|
|
1521
1516
|
)}`
|
|
1522
1517
|
};
|
|
1523
|
-
r.addRecord(
|
|
1518
|
+
r.addRecord(ot);
|
|
1524
1519
|
}
|
|
1525
|
-
|
|
1520
|
+
S = we.meta.nextCursor ?? void 0, T = we.meta.hasNext && !!S;
|
|
1526
1521
|
}
|
|
1527
|
-
await
|
|
1522
|
+
await ct(
|
|
1528
1523
|
r.buildExcel(),
|
|
1529
1524
|
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
1530
1525
|
{
|
|
@@ -1532,7 +1527,7 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1532
1527
|
bookSST: !1,
|
|
1533
1528
|
type: "array"
|
|
1534
1529
|
}
|
|
1535
|
-
)
|
|
1530
|
+
);
|
|
1536
1531
|
},
|
|
1537
1532
|
{
|
|
1538
1533
|
message: "Exporting member...",
|
|
@@ -1540,17 +1535,17 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1540
1535
|
}
|
|
1541
1536
|
);
|
|
1542
1537
|
}
|
|
1543
|
-
return
|
|
1544
|
-
await
|
|
1538
|
+
return je(async () => {
|
|
1539
|
+
await p.readMembership(), await k.read(), await x.readLocations(), await v();
|
|
1545
1540
|
}), (r, i) => {
|
|
1546
|
-
const
|
|
1547
|
-
return
|
|
1548
|
-
n("div",
|
|
1549
|
-
_(
|
|
1541
|
+
const S = V("FmSearch"), T = V("FmButton"), O = V("FmSnackbar");
|
|
1542
|
+
return u(), A("div", null, [
|
|
1543
|
+
n("div", Oo, [
|
|
1544
|
+
_(S, {
|
|
1550
1545
|
class: "mt-4",
|
|
1551
|
-
modelValue: t(
|
|
1546
|
+
modelValue: t(d).searchValue,
|
|
1552
1547
|
"onUpdate:modelValue": [
|
|
1553
|
-
i[0] || (i[0] = (E) => t(
|
|
1548
|
+
i[0] || (i[0] = (E) => t(d).searchValue = E),
|
|
1554
1549
|
t(I)
|
|
1555
1550
|
],
|
|
1556
1551
|
placeholder: "Search",
|
|
@@ -1573,35 +1568,35 @@ const Rt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" },
|
|
|
1573
1568
|
action: "Refresh",
|
|
1574
1569
|
onOnAction: W
|
|
1575
1570
|
}, null, 512), [
|
|
1576
|
-
[
|
|
1571
|
+
[Le, t(L)]
|
|
1577
1572
|
]),
|
|
1578
|
-
_(
|
|
1579
|
-
loading: t(
|
|
1573
|
+
_(He, {
|
|
1574
|
+
loading: t(d).isLoading,
|
|
1580
1575
|
"row-data": t(w),
|
|
1581
|
-
"row-count": t(
|
|
1576
|
+
"row-count": t(d).totalRows,
|
|
1582
1577
|
"column-defs": g,
|
|
1583
1578
|
"shrink-at": !1,
|
|
1584
|
-
"page-count": t(
|
|
1585
|
-
"page-index": t(
|
|
1586
|
-
"page-size": t(
|
|
1587
|
-
onSortChange: t(
|
|
1579
|
+
"page-count": t(d).pageCount,
|
|
1580
|
+
"page-index": t(d).pageIndex,
|
|
1581
|
+
"page-size": t(d).pageSize,
|
|
1582
|
+
onSortChange: t(m),
|
|
1588
1583
|
onPageChange: i[2] || (i[2] = (E) => t(v)({ pageSize: E.pageSize, pageIndex: E.pageIndex })),
|
|
1589
1584
|
onRowClick: i[3] || (i[3] = (E) => {
|
|
1590
|
-
var
|
|
1591
|
-
P.value = E.original, (
|
|
1585
|
+
var R;
|
|
1586
|
+
P.value = E.original, (R = t(N)) == null || R.showSheet();
|
|
1592
1587
|
})
|
|
1593
1588
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
1594
|
-
t(P) ? (
|
|
1589
|
+
t(P) ? (u(), U(Po, {
|
|
1595
1590
|
key: 0,
|
|
1596
1591
|
ref_key: "sheetRef",
|
|
1597
|
-
ref:
|
|
1592
|
+
ref: N,
|
|
1598
1593
|
member: t(P),
|
|
1599
1594
|
"onUpdate:member": ae
|
|
1600
|
-
}, null, 8, ["member"])) :
|
|
1595
|
+
}, null, 8, ["member"])) : le("", !0)
|
|
1601
1596
|
]);
|
|
1602
1597
|
};
|
|
1603
1598
|
}
|
|
1604
1599
|
});
|
|
1605
1600
|
export {
|
|
1606
|
-
|
|
1601
|
+
Sn as default
|
|
1607
1602
|
};
|