@feedmepos/mf-connect 0.1.98-beta.53 → 0.1.98-beta.55
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/{App-GVbZXaOb.js → App-Cw_SF7wy.js} +8 -8
- package/dist/{AuditLogs-COC3VF6K.js → AuditLogs-Cw-iziOh.js} +10 -10
- package/dist/{Bin-BqN1F26B.js → Bin-B3IwyAnR.js} +8 -8
- package/dist/{Broadcast-BXP5eA1_.js → Broadcast-DrxqOsXe.js} +11 -11
- package/dist/{CampaignAnalytic-B3Vm1qDu.js → CampaignAnalytic-CIPWAZeN.js} +6 -6
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CkX0_HxH.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-fcuFjICN.js} +6 -7
- package/dist/{Card-UnclF25U.js → Card-UQwdG0vG.js} +21 -21
- package/dist/{Collections-DjrrHxTV.js → Collections-C4YnGhND.js} +8 -8
- package/dist/{Credit-DoDJIxEC.js → Credit-DCk2y4Tm.js} +12 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BM_btYhW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DqHOH-gI.js} +33 -34
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ftrIH_p9.js → EffectSheet.vue_vue_type_style_index_0_lang-_B8KkV6r.js} +6 -6
- package/dist/{Experience-Dr2Arehy.js → Experience-Db78ZHrz.js} +12 -12
- package/dist/{FileSaver.min-D9YchN9l.js → FileSaver.min-DfiXN-cw.js} +1 -1
- package/dist/{Game-3dq-RL7M.js → Game-dZl0xglE.js} +13 -13
- package/dist/{GiftCardSetup-DD1r4qll.js → GiftCardSetup-C0bikX4h.js} +9 -9
- package/dist/{Grab-Ca0WiQpm.js → Grab-DgLocdm2.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D66OFyD2.js → ImageInput.vue_vue_type_script_setup_true_lang-CxvT0OKP.js} +1 -1
- package/dist/{Index-8kZCkUM2.js → Index-CdpEW-Cz.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CUCAO-YP.js → LocationPicker.vue_vue_type_script_setup_true_lang-BSFgJ_eG.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Cggoq2NY.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DqnHquHg.js} +1 -1
- package/dist/{LoyaltyDashboard-DT-hdzf3.js → LoyaltyDashboard-C-grmjut.js} +10 -10
- package/dist/{MainLayout-7w0y1egK.js → MainLayout-D6B6xRwy.js} +3 -3
- package/dist/{Marketing-DPJc-3ff.js → Marketing-BzPTImcn.js} +4 -4
- package/dist/{MarketingMaterialEdit-D-hqhuMF.js → MarketingMaterialEdit--ATQqcpX.js} +6 -6
- package/dist/Member-BX-8sexf.js +649 -0
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dl8u5fl6.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dkw9Wn1M.js} +23 -23
- package/dist/{MemberImportHistory-DAQ65F9g.js → MemberImportHistory-CLbmY4_Y.js} +7 -7
- package/dist/{MemberList-D5FzPL99.js → MemberList-DQhtO8LL.js} +14 -14
- package/dist/{MemberTransactions-DZaibYxC.js → MemberTransactions-BRZxbhZS.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-6xakpZEo.js → MessageInput.vue_vue_type_script_setup_true_lang-azZANLtU.js} +10 -10
- package/dist/{Mission-PXCFl4e-.js → Mission-CXE8Gr5g.js} +13 -13
- package/dist/{Overview-CcDElaj4.js → Overview-CcLgKLey.js} +4 -4
- package/dist/{Overview-BOlwqxBU.js → Overview-Wc_nkop_.js} +19 -19
- package/dist/{Point-CDSO_YG3.js → Point-w2r_uzND.js} +12 -12
- package/dist/{Promotion-DVw7hepB.js → Promotion-DFT8oAap.js} +13 -13
- package/dist/{Queue-DUb4qqpc.js → Queue-DMisBGyP.js} +11 -11
- package/dist/{Record-r2Bj4Y-2.js → Record-DaCQ9fWs.js} +9 -9
- package/dist/{Review-D5sC1CpN.js → Review-CapDuSOW.js} +2 -2
- package/dist/{ReviewFacebookCallback-C-pIS4uj.js → ReviewFacebookCallback-B58jwoO8.js} +5 -5
- package/dist/{ReviewGoogleCallback-wKBmFpBe.js → ReviewGoogleCallback-BuKfAzg4.js} +5 -5
- package/dist/{Reward-eY6C0L7i.js → Reward-BKmAIDMj.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CEXYfR09.js → RewardGroup.vue_vue_type_script_setup_true_lang-CcM0sAI4.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-ifUAqLwG.js → RuleGroup.vue_vue_type_script_setup_true_lang-DBw2hSKH.js} +16 -17
- package/dist/{Segment-CKXmFk6Q.js → Segment-DvpoSNUk.js} +32 -33
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DD7KLdTt.js → SelectItems.vue_vue_type_script_setup_true_lang-DoXvWKBk.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bl3KaAjj.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C1ll8PAQ.js} +21 -21
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-tpcHzd48.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-mZetZdjJ.js} +4 -4
- package/dist/{Setting-K-x016Eq.js → Setting-B5kt3xg-.js} +14 -14
- package/dist/{SettingAdvertisements-BGznpHIH.js → SettingAdvertisements-K9K4kJ0K.js} +12 -12
- package/dist/{Settings-CrPLvP2-.js → Settings-COKSGA87.js} +5 -5
- package/dist/{Store-PbvFQ03o.js → Store-FWqFmQkz.js} +25 -25
- package/dist/{StoreRewards-pYNbeyOQ.js → StoreRewards-Bmcaz6FR.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C5YoHPxm.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BNbEQu8Y.js} +23 -23
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DOyli0Kj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dryke9SW.js} +2 -2
- package/dist/{Tier-BHlyTQfq.js → Tier-BNAY4zUT.js} +2238 -601
- package/dist/{Title-CSuSHz1O.js → Title-BfWmhZZ_.js} +32 -33
- package/dist/{Transaction-bKcfOmz1.js → Transaction-DYTygEuQ.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C6Pb93cp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Ch4s6p4Z.js} +20 -20
- package/dist/{Voucher-D_zf4aRU.js → Voucher-BEbl-HsE.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D1VBWUFD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-w2W2qt_7.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CRz6uhOz.js → ZodTextField.vue_vue_type_script_setup_true_lang-CBFwmgOo.js} +2 -2
- package/dist/{app-DsVK_Z9F.js → app-Do6spNSS.js} +2960 -2928
- package/dist/app.js +1 -1
- package/dist/{base.export-wsjx1b1F.js → base.export-D-qcrTy9.js} +2 -2
- package/dist/{business-emEflb7G.js → business-B77L5zCr.js} +1 -1
- package/dist/{campaign-CH1zEmK_.js → campaign-0nB3kGlT.js} +8 -8
- package/dist/{campaign-CczdPZEx.js → campaign-P-G3HMdp.js} +2 -2
- package/dist/{campaign.enum-jb40hQyq.js → campaign.enum-CiMl44dc.js} +1 -1
- package/dist/{campaign.fn-ZvIMg3Jv.js → campaign.fn-DGv2wAqn.js} +31 -31
- package/dist/{collectible.enum-Q0sMqRej.js → collectible.enum-CmrLMPA0.js} +1 -1
- package/dist/{collection.fn-CpOJTvnW.js → collection.fn-Ctdy8JkU.js} +2 -2
- package/dist/{currency-nVkRZfQp.js → currency-B1ZqBYyA.js} +1 -1
- package/dist/{duplicateCampaign-DszCNBjZ.js → duplicateCampaign-DsBHk-PC.js} +2 -2
- package/dist/{effect-De3cFxjA.js → effect-BE4BASWL.js} +1 -1
- package/dist/{email-addresses-BENEAxtQ.js → email-addresses-DxUQ_4QV.js} +209 -201
- package/dist/{helper-DjTmaBve.js → helper-BiKiceul.js} +1 -1
- package/dist/{index-BMQVCeHN.js → index-4F0WCPZ9.js} +354 -231
- package/dist/{index-Wd_vLVMH.js → index-B5vzubou.js} +1384 -1328
- package/dist/{index-BEU1eux8.js → index-BAtDTJo_.js} +1 -1
- package/dist/{index-P2yevS6i.js → index-BSyn-LO2.js} +1 -1
- package/dist/{index-BxRbdJOU.js → index-BncZ0745.js} +1 -1
- package/dist/{index-BH4TDRw4.js → index-CY0DaRSA.js} +2 -2
- package/dist/{index-fl12LmlG.js → index-CZtFd2Mm.js} +1 -1
- package/dist/{index-BlsV0pDI.js → index-CexA3ZNo.js} +9 -9
- package/dist/{index-DlAwtfWQ.js → index-CnZuz4FU.js} +3 -3
- package/dist/{index-p0RFjPyp.js → index-CsVa3rDe.js} +1 -1
- package/dist/{index-CKfVSZcR.js → index-D-9Q09e5.js} +2 -2
- package/dist/{index-B-GBUWJi.js → index-DIxLpCbJ.js} +600 -570
- package/dist/{index-BanLR_f4.js → index-DwQKXUeH.js} +2 -2
- package/dist/{index-vV9W0EhO.js → index-Dz1VDJc9.js} +1 -1
- package/dist/{index-DEtIu7G-.js → index-IwteF-7z.js} +3 -3
- package/dist/{index-DrSpG2nV.js → index-UhOpaM-R.js} +1 -1
- package/dist/{index-DsviWEPT.js → index-fAq8fqc-.js} +109 -108
- package/dist/{index-Bj_LrRir.js → index-r1k7ANUt.js} +1 -1
- package/dist/{index.esm2017-C-k-2kM3.js → index.esm2017-DN7GSWnA.js} +1 -1
- package/dist/{loading-TBGTHWt0.js → loading-weS_D5KN.js} +1 -1
- package/dist/{lodash-qQ2ie1zb.js → lodash-BoP2NKA5.js} +1 -1
- package/dist/{member-import-B_sizua-.js → member-import-CjV5FVUq.js} +1 -1
- package/dist/{membership-DJIuI4sn.js → membership-Fj9ZYUTs.js} +3 -3
- package/dist/{money-BOnCYNt8.js → money-X6FLZyEA.js} +1 -1
- package/dist/{number-GrW7Sgoo.js → number-DyX5qBY-.js} +1 -1
- package/dist/{objectid-DPTR7IEN.js → objectid-CrUq8fo_.js} +5 -5
- package/dist/{plugins-D80BsQ8l.js → plugins-Dc-NoCH3.js} +3 -3
- package/dist/{reward-ByHQgT7i.js → reward-B59sZKug.js} +1 -1
- package/dist/{rule-Djn2x0ov.js → rule-DegJg1Uj.js} +335 -275
- package/dist/{template-CR7fSIew.js → template-PaICU_3w.js} +6 -6
- package/dist/{timezone-BQH2AZ_H.js → timezone-Bktwc_gB.js} +1 -1
- package/dist/{transaction.fn-sp8FkkYr.js → transaction.fn-CtL0hJK5.js} +1 -1
- package/dist/{trigger-Y9ted5Uv.js → trigger-y6iOxxCH.js} +5 -5
- package/dist/{useMarketingMaterialActions-jZ3QuyxF.js → useMarketingMaterialActions-CGzkoaFi.js} +3 -3
- package/dist/{usePagination-pzo4ADvP.js → usePagination-cvobvego.js} +1 -1
- package/dist/{user-BtkZFzFm.js → user-DqcwNxjc.js} +1 -1
- package/dist/{vue-i18n-DHFwvj0q.js → vue-i18n-CKaxNvA5.js} +391 -391
- package/dist/{xlsx-BWsO-8j5.js → xlsx-NQidEwsK.js} +1 -1
- package/dist/{zod-BMKVB5Fl.js → zod-De7xWhI3.js} +1 -1
- package/package.json +2 -2
- package/dist/Member-CkRqgHe4.js +0 -630
- package/dist/rule-builder-Dp6YiO8-.js +0 -126
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
import { defineComponent as J, resolveComponent as v, unref as t, openBlock as n, createElementBlock as i, normalizeClass as W, renderSlot as ne, createElementVNode as s, createVNode as u, ref as g, computed as P, onMounted as xe, onBeforeUnmount as Se, Fragment as Y, createStaticVNode as Le, withCtx as M, renderList as Q, createBlock as E, toDisplayString as r, createCommentVNode as c, createTextVNode as le, isRef as Ae, watch as Me, createSlots as Ne } from "vue";
|
|
2
|
+
import "./index-UhOpaM-R.js";
|
|
3
|
+
import { useDialog as ue } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as de } from "./vue-i18n-CKaxNvA5.js";
|
|
5
|
+
import { useCoreStore as Fe } from "@feedmepos/mf-common";
|
|
6
|
+
import { F as re } from "./FileSaver.min-DfiXN-cw.js";
|
|
7
|
+
import { u as O, w as Pe } from "./xlsx-NQidEwsK.js";
|
|
8
|
+
import { u as De } from "./app-wDQR6dpb.js";
|
|
9
|
+
import { M as ie, a as Be } from "./member-import-CjV5FVUq.js";
|
|
10
|
+
import { m as A } from "./index-D-9Q09e5.js";
|
|
11
|
+
import { useRouter as Ye } from "vue-router";
|
|
12
|
+
import { R as I } from "./app-Do6spNSS.js";
|
|
13
|
+
const Oe = { class: "fm-typo-en-body-sm-400 justify-center flex items-center w-full" }, Ve = /* @__PURE__ */ J({
|
|
14
|
+
__name: "FmAdminBadge",
|
|
15
|
+
props: {
|
|
16
|
+
class: { default: void 0 },
|
|
17
|
+
selectable: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
setup(G) {
|
|
20
|
+
const m = G, N = Fe();
|
|
21
|
+
return (D, f) => {
|
|
22
|
+
var e;
|
|
23
|
+
const k = v("FmIcon");
|
|
24
|
+
return (e = t(N).sessionUser.value) != null && e.role.isAdmin ? (n(), i("div", {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: W([
|
|
27
|
+
"group gap-8 inline-flex items-center relative border-1 border-dashed rounded-md border-red-500 hover:border-opacity-30 transition-opacity",
|
|
28
|
+
{ "select-none": !m.selectable }
|
|
29
|
+
])
|
|
30
|
+
}, [
|
|
31
|
+
ne(D.$slots, "default"),
|
|
32
|
+
s("div", {
|
|
33
|
+
class: W([
|
|
34
|
+
"pointer-events-none opacity-90 flex items-center justify-center rounded-xxxl bg-red-500 text-white group-hover:opacity-20",
|
|
35
|
+
m.class,
|
|
36
|
+
{
|
|
37
|
+
absolute: !0,
|
|
38
|
+
"bottom-[-5px] right-[-8px] px-4 h-[25px] w-[25px] border-2 border-red-800": !0
|
|
39
|
+
}
|
|
40
|
+
])
|
|
41
|
+
}, [
|
|
42
|
+
s("span", Oe, [
|
|
43
|
+
u(k, {
|
|
44
|
+
name: "support_agent",
|
|
45
|
+
size: "sm",
|
|
46
|
+
outline: ""
|
|
47
|
+
})
|
|
48
|
+
])
|
|
49
|
+
], 2)
|
|
50
|
+
], 2)) : ne(D.$slots, "non-admin", { key: 1 });
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}), $e = { class: "w-[800px] max-w-full space-y-24 pb-16" }, Ue = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
56
|
+
}, He = { class: "flex justify-end" }, Ge = {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: "flex items-center rounded-md border border-fm-color-neutral-gray-300 p-16"
|
|
59
|
+
}, qe = { class: "fm-typo-en-body-lg-400 min-w-0 flex-1 truncate px-8" }, je = { class: "flex items-center justify-between" }, ze = { class: "fm-typo-en-title-sm-800" }, Qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, We = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "rounded-md bg-fm-color-system-error-100 p-16 fm-typo-en-body-sm-400"
|
|
62
|
+
}, Je = {
|
|
63
|
+
key: 1,
|
|
64
|
+
class: "rounded-md bg-fm-color-system-info-100 p-16 fm-typo-en-body-md-400"
|
|
65
|
+
}, Ke = {
|
|
66
|
+
key: 2,
|
|
67
|
+
class: "space-y-16"
|
|
68
|
+
}, Xe = { class: "grid grid-cols-2 gap-8 md:grid-cols-4" }, Ze = { class: "fm-typo-en-title-sm-800" }, et = { class: "fm-typo-en-title-sm-800" }, tt = { class: "fm-typo-en-title-sm-800" }, at = { class: "fm-typo-en-title-sm-800" }, ot = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
71
|
+
}, st = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
74
|
+
}, nt = { class: "fm-typo-en-body-md-400" }, lt = { class: "fm-typo-en-body-md-600" }, rt = {
|
|
75
|
+
key: 4,
|
|
76
|
+
class: "rounded-md bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400"
|
|
77
|
+
}, it = {
|
|
78
|
+
key: 3,
|
|
79
|
+
class: "space-y-12"
|
|
80
|
+
}, ut = { class: "rounded-md bg-fm-color-system-error-100 p-16" }, dt = { class: "fm-typo-en-body-sm-400" }, ct = {
|
|
81
|
+
key: 4,
|
|
82
|
+
class: "rounded-md bg-fm-color-system-error-100 p-16"
|
|
83
|
+
}, mt = { class: "fm-typo-en-body-sm-400" }, pt = { class: "fm-typo-en-body-sm-400" }, ft = {
|
|
84
|
+
key: 5,
|
|
85
|
+
class: "rounded-md bg-fm-color-system-success-100 p-16"
|
|
86
|
+
}, vt = { class: "fm-typo-en-body-sm-400" }, yt = {
|
|
87
|
+
key: 6,
|
|
88
|
+
class: "rounded-md bg-fm-color-system-info-100 p-16"
|
|
89
|
+
}, bt = { class: "fm-typo-en-body-sm-400" }, _t = { class: "flex items-center justify-end gap-8" }, gt = /* @__PURE__ */ J({
|
|
90
|
+
__name: "ImportMemberDialog",
|
|
91
|
+
setup(G) {
|
|
92
|
+
const { t: m } = de(), N = ue(), D = De(), f = g(null), k = g(null), e = g(null), d = g(""), R = g(""), B = g(!1), T = g(!1), x = g(!1), S = g(!1), b = g(!1), h = g(!0);
|
|
93
|
+
let w, _ = 0;
|
|
94
|
+
const L = g({
|
|
95
|
+
mode: "UPSERT"
|
|
96
|
+
}), q = [
|
|
97
|
+
{ label: "Create missing members only", value: "CREATE" },
|
|
98
|
+
{ label: "Update existing members only", value: "UPDATE" },
|
|
99
|
+
{ label: "Create and update members", value: "UPSERT" }
|
|
100
|
+
], j = [
|
|
101
|
+
{
|
|
102
|
+
label: "CSV",
|
|
103
|
+
icon: "csv",
|
|
104
|
+
value: "csv"
|
|
105
|
+
/* csv */
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: "Excel",
|
|
109
|
+
icon: "description",
|
|
110
|
+
value: "xlsx"
|
|
111
|
+
/* xlsx */
|
|
112
|
+
}
|
|
113
|
+
], z = P(
|
|
114
|
+
() => {
|
|
115
|
+
var a;
|
|
116
|
+
return ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
|
|
117
|
+
((a = e.value) == null ? void 0 : a.status) ?? ""
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
), K = P(() => {
|
|
121
|
+
var a;
|
|
122
|
+
return !(((a = e.value) == null ? void 0 : a.status) !== "READY" || !e.value.file || R.value !== e.value.businessName || !S.value || e.value.summary.sharedProfiles > 0 && !T.value || e.value.summary.balanceRows > 0 && !x.value);
|
|
123
|
+
}), ce = P(() => {
|
|
124
|
+
const a = e.value, o = a == null ? void 0 : a.summary, p = !!a && R.value === a.businessName;
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
label: "Status is READY",
|
|
128
|
+
passed: (a == null ? void 0 : a.status) === "READY",
|
|
129
|
+
value: (a == null ? void 0 : a.status) ?? "missing"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "Uploaded file exists",
|
|
133
|
+
passed: !!(a != null && a.file),
|
|
134
|
+
value: a != null && a.file ? "yes" : "no"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: "Business name matches exactly",
|
|
138
|
+
passed: p,
|
|
139
|
+
value: `entered "${R.value}" / expected "${(a == null ? void 0 : a.businessName) ?? ""}"`
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: "Shared-profile acknowledgement",
|
|
143
|
+
passed: !(o != null && o.sharedProfiles) || T.value,
|
|
144
|
+
value: o != null && o.sharedProfiles ? `${T.value ? "checked" : "required"} (${o.sharedProfiles} rows)` : "not required"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: "Balance-replacement acknowledgement",
|
|
148
|
+
passed: !(o != null && o.balanceRows) || x.value,
|
|
149
|
+
value: o != null && o.balanceRows ? `${x.value ? "checked" : "required"} (${o.balanceRows} rows)` : "not required"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: "Import responsibility acknowledgement",
|
|
153
|
+
passed: S.value,
|
|
154
|
+
value: S.value ? "checked" : "required"
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
});
|
|
158
|
+
function me(a) {
|
|
159
|
+
var o, p;
|
|
160
|
+
f.value = ((p = (o = a.target) == null ? void 0 : o.files) == null ? void 0 : p[0]) ?? null;
|
|
161
|
+
}
|
|
162
|
+
function pe() {
|
|
163
|
+
k.value && (k.value.value = "", k.value.click());
|
|
164
|
+
}
|
|
165
|
+
function fe(a) {
|
|
166
|
+
const o = [
|
|
167
|
+
[...ie],
|
|
168
|
+
[...Be]
|
|
169
|
+
], p = O.aoa_to_sheet(o);
|
|
170
|
+
if (a === "csv") {
|
|
171
|
+
re.saveAs(
|
|
172
|
+
new Blob([O.sheet_to_csv(p)], {
|
|
173
|
+
type: "text/csv;charset=utf-8;"
|
|
174
|
+
}),
|
|
175
|
+
"ImportMemberTemplate.csv"
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const y = O.book_new();
|
|
180
|
+
for (let C = 0; C < ie.length; C++) {
|
|
181
|
+
const $ = p[O.encode_cell({ r: 1, c: C })];
|
|
182
|
+
$ && ($.z = "@");
|
|
183
|
+
}
|
|
184
|
+
O.book_append_sheet(y, p, "Members"), Pe(y, "ImportMemberTemplate.xlsx", { cellStyles: !0 });
|
|
185
|
+
}
|
|
186
|
+
async function ve() {
|
|
187
|
+
if (!f.value) {
|
|
188
|
+
d.value = "Please upload a file.";
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (!B.value) {
|
|
192
|
+
d.value = "Please read and acknowledge the import warnings.";
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
b.value = !0, d.value = "";
|
|
196
|
+
try {
|
|
197
|
+
const a = new FormData();
|
|
198
|
+
a.append("file", f.value), a.append("config", JSON.stringify(L.value)), e.value = await A.import(a), await F();
|
|
199
|
+
} catch (a) {
|
|
200
|
+
d.value = a instanceof Error ? a.message : String(a);
|
|
201
|
+
} finally {
|
|
202
|
+
b.value = !1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async function ye(a) {
|
|
206
|
+
var p, y;
|
|
207
|
+
if (!e.value) return !1;
|
|
208
|
+
const o = e.value._id.toString();
|
|
209
|
+
try {
|
|
210
|
+
const C = await A.readImport(o);
|
|
211
|
+
return a !== _ || ((p = e.value) == null ? void 0 : p._id.toString()) !== o ? !1 : (e.value = C, !0);
|
|
212
|
+
} catch (C) {
|
|
213
|
+
if (a !== _ || ((y = e.value) == null ? void 0 : y._id.toString()) !== o)
|
|
214
|
+
return !1;
|
|
215
|
+
throw C;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
async function F() {
|
|
219
|
+
var o;
|
|
220
|
+
V();
|
|
221
|
+
const a = _;
|
|
222
|
+
try {
|
|
223
|
+
if (!await ye(a)) return;
|
|
224
|
+
} catch (p) {
|
|
225
|
+
if (a !== _) return;
|
|
226
|
+
d.value = p instanceof Error ? p.message : String(p), z.value && (w = setTimeout(F, 5e3));
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
a === _ && z.value && (w = setTimeout(F, ((o = e.value) == null ? void 0 : o.status) === "RUNNING" ? 5e3 : 1500));
|
|
230
|
+
}
|
|
231
|
+
async function be() {
|
|
232
|
+
try {
|
|
233
|
+
e.value = await A.resumableImport(), e.value && await F();
|
|
234
|
+
} catch (a) {
|
|
235
|
+
d.value = a instanceof Error ? a.message : String(a);
|
|
236
|
+
} finally {
|
|
237
|
+
h.value = !1;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function V() {
|
|
241
|
+
_ += 1, w && clearTimeout(w), w = void 0;
|
|
242
|
+
}
|
|
243
|
+
function _e() {
|
|
244
|
+
V(), e.value = null, f.value = null, d.value = "", S.value = !1;
|
|
245
|
+
}
|
|
246
|
+
async function ge() {
|
|
247
|
+
if (!(!e.value || !K.value)) {
|
|
248
|
+
b.value = !0, d.value = "";
|
|
249
|
+
try {
|
|
250
|
+
e.value = await A.confirmImport(e.value._id.toString(), {
|
|
251
|
+
businessName: R.value,
|
|
252
|
+
fileHash: e.value.fileHash,
|
|
253
|
+
previewVersion: e.value.previewVersion,
|
|
254
|
+
acknowledgeSharedProfiles: T.value,
|
|
255
|
+
acknowledgeBalanceReplacement: x.value
|
|
256
|
+
}), await F();
|
|
257
|
+
} catch (a) {
|
|
258
|
+
d.value = a instanceof Error ? a.message : String(a);
|
|
259
|
+
} finally {
|
|
260
|
+
b.value = !1;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function he() {
|
|
265
|
+
if (e.value) {
|
|
266
|
+
b.value = !0, d.value = "";
|
|
267
|
+
try {
|
|
268
|
+
e.value = await A.retryImport(e.value._id.toString()), await F();
|
|
269
|
+
} catch (a) {
|
|
270
|
+
d.value = a instanceof Error ? a.message : String(a);
|
|
271
|
+
} finally {
|
|
272
|
+
b.value = !1;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async function we() {
|
|
277
|
+
if (!e.value || ["COMPLETED", "CANCELLED", "INVALID"].includes(e.value.status)) {
|
|
278
|
+
N.close();
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (e.value.status !== "CANCELLING") {
|
|
282
|
+
b.value = !0, d.value = "";
|
|
283
|
+
try {
|
|
284
|
+
const a = await A.cancelImport(e.value._id.toString());
|
|
285
|
+
V(), e.value = a, e.value.status === "CANCELLING" && await F();
|
|
286
|
+
} catch (a) {
|
|
287
|
+
d.value = a instanceof Error ? a.message : String(a);
|
|
288
|
+
} finally {
|
|
289
|
+
b.value = !1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async function ke() {
|
|
294
|
+
if (!e.value) return;
|
|
295
|
+
const a = await A.downloadImportResult(e.value._id.toString());
|
|
296
|
+
re.saveAs(a, `member-import-${e.value._id}.csv`);
|
|
297
|
+
}
|
|
298
|
+
return xe(be), Se(V), (a, o) => {
|
|
299
|
+
var X, Z, ee, te, ae, oe, se;
|
|
300
|
+
const p = v("FmSelect"), y = v("FmButton"), C = v("FmMenuItem"), $ = v("FmMenu"), Ee = v("FmDropField"), U = v("FmCheckbox"), Ie = v("FmChip"), H = v("FmCard"), Re = v("FmTextField"), Ce = v("FmHelperText"), Te = v("FmSpacer");
|
|
301
|
+
return n(), i("div", $e, [
|
|
302
|
+
t(h) ? (n(), i("div", Ue, " Checking for an unfinished import… ")) : t(e) ? (n(), i(Y, { key: 2 }, [
|
|
303
|
+
s("div", je, [
|
|
304
|
+
s("div", null, [
|
|
305
|
+
s("div", ze, r(((X = t(e).file) == null ? void 0 : X.originalName) ?? "Unknown file"), 1),
|
|
306
|
+
s("div", Qe, " Import " + r(t(e)._id) + " · " + r(t(e).status), 1)
|
|
307
|
+
]),
|
|
308
|
+
u(Ie, {
|
|
309
|
+
label: t(e).status,
|
|
310
|
+
compact: ""
|
|
311
|
+
}, null, 8, ["label"])
|
|
312
|
+
]),
|
|
313
|
+
t(e).file ? c("", !0) : (n(), i("div", We, " The saved import is missing its uploaded file. Cancel it and upload the file again. ")),
|
|
314
|
+
t(z) ? (n(), i("div", Je, r(t(e).status === "RUNNING" ? "Importing members…" : t(e).status === "CANCELLING" ? "Cancelling import…" : "Preparing import preview…"), 1)) : c("", !0),
|
|
315
|
+
t(e).status === "READY" ? (n(), i("div", Ke, [
|
|
316
|
+
s("div", Xe, [
|
|
317
|
+
u(H, {
|
|
318
|
+
variant: "outlined",
|
|
319
|
+
class: "p-12"
|
|
320
|
+
}, {
|
|
321
|
+
default: M(() => [
|
|
322
|
+
s("div", Ze, r(t(e).summary.total), 1),
|
|
323
|
+
o[8] || (o[8] = s("div", { class: "fm-typo-en-body-sm-400" }, "Rows", -1))
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
}),
|
|
327
|
+
u(H, {
|
|
328
|
+
variant: "outlined",
|
|
329
|
+
class: "p-12"
|
|
330
|
+
}, {
|
|
331
|
+
default: M(() => [
|
|
332
|
+
s("div", et, r(t(e).summary.create), 1),
|
|
333
|
+
o[9] || (o[9] = s("div", { class: "fm-typo-en-body-sm-400" }, "Create", -1))
|
|
334
|
+
]),
|
|
335
|
+
_: 1
|
|
336
|
+
}),
|
|
337
|
+
u(H, {
|
|
338
|
+
variant: "outlined",
|
|
339
|
+
class: "p-12"
|
|
340
|
+
}, {
|
|
341
|
+
default: M(() => [
|
|
342
|
+
s("div", tt, r(t(e).summary.update), 1),
|
|
343
|
+
o[10] || (o[10] = s("div", { class: "fm-typo-en-body-sm-400" }, "Update", -1))
|
|
344
|
+
]),
|
|
345
|
+
_: 1
|
|
346
|
+
}),
|
|
347
|
+
u(H, {
|
|
348
|
+
variant: "outlined",
|
|
349
|
+
class: "p-12"
|
|
350
|
+
}, {
|
|
351
|
+
default: M(() => [
|
|
352
|
+
s("div", at, r(t(e).summary.balanceRows), 1),
|
|
353
|
+
o[11] || (o[11] = s("div", { class: "fm-typo-en-body-sm-400" }, "Balance rows", -1))
|
|
354
|
+
]),
|
|
355
|
+
_: 1
|
|
356
|
+
})
|
|
357
|
+
]),
|
|
358
|
+
t(e).summary.balanceRows ? (n(), i("div", ot, " Final target totals — Credit: " + r(t(e).summary.creditTargetTotal) + ", Experience: " + r(t(e).summary.experienceTargetTotal) + ", Points: " + r(t(e).summary.pointTargetTotal) + ". Tier changes: " + r(t(e).summary.tierRows) + ". ", 1)) : c("", !0),
|
|
359
|
+
t(e).summary.sharedProfiles ? (n(), i("div", st, r(t(e).summary.sharedProfiles) + " rows can update a shared profile used by another business. ", 1)) : c("", !0),
|
|
360
|
+
s("div", nt, [
|
|
361
|
+
o[12] || (o[12] = le(" To confirm your action, type ", -1)),
|
|
362
|
+
s("span", lt, r(t(e).businessName), 1),
|
|
363
|
+
o[13] || (o[13] = le(" in the text field ", -1))
|
|
364
|
+
]),
|
|
365
|
+
u(Re, {
|
|
366
|
+
modelValue: t(R),
|
|
367
|
+
"onUpdate:modelValue": o[3] || (o[3] = (l) => Ae(R) ? R.value = l : null)
|
|
368
|
+
}, null, 8, ["modelValue"]),
|
|
369
|
+
t(e).summary.sharedProfiles ? (n(), E(U, {
|
|
370
|
+
key: 2,
|
|
371
|
+
"model-value": t(T),
|
|
372
|
+
value: "shared-profile",
|
|
373
|
+
label: "I understand that shared profile fields can affect other businesses.",
|
|
374
|
+
"onUpdate:modelValue": o[4] || (o[4] = (l) => T.value = l)
|
|
375
|
+
}, null, 8, ["model-value"])) : c("", !0),
|
|
376
|
+
t(e).summary.balanceRows ? (n(), E(U, {
|
|
377
|
+
key: 3,
|
|
378
|
+
"model-value": t(x),
|
|
379
|
+
value: "balance-replacement",
|
|
380
|
+
label: "I understand that populated balance cells replace final balances.",
|
|
381
|
+
"onUpdate:modelValue": o[5] || (o[5] = (l) => x.value = l)
|
|
382
|
+
}, null, 8, ["model-value"])) : c("", !0),
|
|
383
|
+
u(U, {
|
|
384
|
+
"model-value": t(S),
|
|
385
|
+
value: "import-responsibility",
|
|
386
|
+
label: "I acknowledge that I understand what data I import and will take the responsibility",
|
|
387
|
+
"onUpdate:modelValue": o[6] || (o[6] = (l) => S.value = l)
|
|
388
|
+
}, null, 8, ["model-value"]),
|
|
389
|
+
t(D).debugMode ? (n(), i("div", rt, [
|
|
390
|
+
o[14] || (o[14] = s("div", { class: "fm-typo-en-body-sm-600" }, "Start import checks", -1)),
|
|
391
|
+
(n(!0), i(Y, null, Q(t(ce), (l) => (n(), i("div", {
|
|
392
|
+
key: l.label,
|
|
393
|
+
class: "flex gap-8"
|
|
394
|
+
}, [
|
|
395
|
+
s("span", {
|
|
396
|
+
class: W(l.passed ? "text-green-600" : "text-red-600")
|
|
397
|
+
}, r(l.passed ? "✓" : "✗"), 3),
|
|
398
|
+
s("span", null, r(l.label) + ": " + r(l.value), 1)
|
|
399
|
+
]))), 128))
|
|
400
|
+
])) : c("", !0)
|
|
401
|
+
])) : c("", !0),
|
|
402
|
+
t(e).status === "INVALID" ? (n(), i("div", it, [
|
|
403
|
+
s("div", ut, [
|
|
404
|
+
o[15] || (o[15] = s("div", { class: "fm-typo-en-body-md-600" }, "The file is not importable", -1)),
|
|
405
|
+
s("div", dt, r(t(e).error), 1)
|
|
406
|
+
]),
|
|
407
|
+
(n(!0), i(Y, null, Q((Z = t(e).rowErrors) == null ? void 0 : Z.slice(0, 10), (l) => (n(), i("div", {
|
|
408
|
+
key: l.rowNumber,
|
|
409
|
+
class: "fm-typo-en-body-sm-400"
|
|
410
|
+
}, " Row " + r(l.rowNumber) + ": " + r(l.errors.join("; ")), 1))), 128))
|
|
411
|
+
])) : c("", !0),
|
|
412
|
+
t(e).status === "STOPPED" ? (n(), i("div", ct, [
|
|
413
|
+
o[16] || (o[16] = s("div", { class: "fm-typo-en-body-md-600" }, "Import stopped", -1)),
|
|
414
|
+
s("div", mt, r(t(e).summary.completed) + " rows completed before the first runtime error. Fix the cause, then retry this same import safely. ", 1),
|
|
415
|
+
s("div", pt, r(t(e).error), 1)
|
|
416
|
+
])) : c("", !0),
|
|
417
|
+
t(e).status === "COMPLETED" ? (n(), i("div", ft, [
|
|
418
|
+
o[17] || (o[17] = s("div", { class: "fm-typo-en-body-md-600" }, "Import completed", -1)),
|
|
419
|
+
s("div", vt, r(t(e).summary.completed) + " members were processed. ", 1)
|
|
420
|
+
])) : c("", !0),
|
|
421
|
+
t(e).status === "CANCELLED" ? (n(), i("div", yt, [
|
|
422
|
+
o[18] || (o[18] = s("div", { class: "fm-typo-en-body-md-600" }, "Import cancelled", -1)),
|
|
423
|
+
s("div", bt, r(t(e).summary.completed) + " rows were completed before cancellation. ", 1)
|
|
424
|
+
])) : c("", !0)
|
|
425
|
+
], 64)) : (n(), i(Y, { key: 1 }, [
|
|
426
|
+
o[7] || (o[7] = Le('<div class="rounded-md bg-fm-color-system-warning-100 p-16"><div class="fm-typo-en-title-sm-800"> Import changes production data </div><div class="fm-typo-en-body-md-400 text-fm-color-typo-secondary"><div class="grid grid-cols-[auto_1fr] gap-x-8 gap-y-8"><span aria-hidden="true">•</span><span>The file is fully validated before any member is changed.</span><span aria-hidden="true">•</span><span>Keep the sample row and paste your members from row 3 onward.</span><span aria-hidden="true">•</span><span>Blank cells keep existing values.</span><span aria-hidden="true">•</span><span>Use <code>__CLEAR__</code> to clear supported fields.</span><span aria-hidden="true">•</span><span>Use <code>DD/MM/YYYY</code> for every date column, for example <code>01/12/1989</code>. The sample row adds <code>(DD/MM/YYYY)</code> as a reminder; omit it in member rows.</span><span aria-hidden="true">•</span><span>Credit without CreditExpiryDate remains normal and non-expiring.</span><span aria-hidden="true">•</span><span> Each title requires one matching positional expiry. Quote both comma-separated fields in CSV, for example <code>"VIP,VVIP,SVIP"</code> and <code>"05/09/2026,06/09/2026,07/09/2026"</code>. </span></div></div></div>', 1)),
|
|
427
|
+
u(p, {
|
|
428
|
+
modelValue: t(L).mode,
|
|
429
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => t(L).mode = l),
|
|
430
|
+
label: "Import mode",
|
|
431
|
+
items: q
|
|
432
|
+
}, null, 8, ["modelValue"]),
|
|
433
|
+
s("div", He, [
|
|
434
|
+
u($, null, {
|
|
435
|
+
"menu-button": M(() => [
|
|
436
|
+
u(y, {
|
|
437
|
+
variant: "tertiary",
|
|
438
|
+
icon: "download",
|
|
439
|
+
label: "Download template"
|
|
440
|
+
})
|
|
441
|
+
]),
|
|
442
|
+
default: M(() => [
|
|
443
|
+
(n(), i(Y, null, Q(j, (l) => u(C, {
|
|
444
|
+
key: l.value,
|
|
445
|
+
icon: l.icon,
|
|
446
|
+
label: l.label,
|
|
447
|
+
selectable: "",
|
|
448
|
+
onClick: (wt) => fe(l.value)
|
|
449
|
+
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
450
|
+
]),
|
|
451
|
+
_: 1
|
|
452
|
+
})
|
|
453
|
+
]),
|
|
454
|
+
t(f) ? (n(), i("div", Ge, [
|
|
455
|
+
u(y, {
|
|
456
|
+
variant: "tertiary",
|
|
457
|
+
"prepend-icon": "attach_file"
|
|
458
|
+
}),
|
|
459
|
+
s("p", qe, r(t(f).name), 1),
|
|
460
|
+
u(y, {
|
|
461
|
+
variant: "plain",
|
|
462
|
+
label: t(m)("Replace File"),
|
|
463
|
+
onClick: pe
|
|
464
|
+
}, null, 8, ["label"]),
|
|
465
|
+
s("input", {
|
|
466
|
+
ref_key: "replaceFileInput",
|
|
467
|
+
ref: k,
|
|
468
|
+
id: "member-import-file",
|
|
469
|
+
accept: ".csv, .xlsx",
|
|
470
|
+
class: "hidden",
|
|
471
|
+
type: "file",
|
|
472
|
+
onChange: me
|
|
473
|
+
}, null, 544)
|
|
474
|
+
])) : (n(), E(Ee, {
|
|
475
|
+
key: 0,
|
|
476
|
+
accept: ".csv, .xlsx",
|
|
477
|
+
"max-file-size": 5e6,
|
|
478
|
+
onFileUpload: o[1] || (o[1] = (l) => f.value = l)
|
|
479
|
+
})),
|
|
480
|
+
u(U, {
|
|
481
|
+
"model-value": t(B),
|
|
482
|
+
value: "import-warnings",
|
|
483
|
+
label: "I have read and understand these import rules.",
|
|
484
|
+
"onUpdate:modelValue": o[2] || (o[2] = (l) => B.value = l)
|
|
485
|
+
}, null, 8, ["model-value"])
|
|
486
|
+
], 64)),
|
|
487
|
+
t(d) ? (n(), E(Ce, {
|
|
488
|
+
key: 3,
|
|
489
|
+
state: "error",
|
|
490
|
+
text: t(d)
|
|
491
|
+
}, null, 8, ["text"])) : c("", !0),
|
|
492
|
+
s("div", _t, [
|
|
493
|
+
t(e) && ["INVALID", "STOPPED", "COMPLETED", "CANCELLED"].includes(t(e).status) ? (n(), E(y, {
|
|
494
|
+
key: 0,
|
|
495
|
+
variant: "tertiary",
|
|
496
|
+
icon: "download",
|
|
497
|
+
label: "Download result",
|
|
498
|
+
disabled: t(e).summary.total === 0,
|
|
499
|
+
onClick: ke
|
|
500
|
+
}, null, 8, ["disabled"])) : c("", !0),
|
|
501
|
+
((ee = t(e)) == null ? void 0 : ee.status) === "INVALID" ? (n(), E(y, {
|
|
502
|
+
key: 1,
|
|
503
|
+
variant: "tertiary",
|
|
504
|
+
label: "Choose another file",
|
|
505
|
+
onClick: _e
|
|
506
|
+
})) : c("", !0),
|
|
507
|
+
u(Te),
|
|
508
|
+
u(y, {
|
|
509
|
+
variant: "secondary",
|
|
510
|
+
label: ((te = t(e)) == null ? void 0 : te.status) === "CANCELLING" ? "Cancelling…" : t(e) && ["COMPLETED", "CANCELLED", "INVALID"].includes(t(e).status) ? "Close" : "Cancel",
|
|
511
|
+
disabled: t(b) || ((ae = t(e)) == null ? void 0 : ae.status) === "CANCELLING",
|
|
512
|
+
onClick: we
|
|
513
|
+
}, null, 8, ["label", "disabled"]),
|
|
514
|
+
t(e) ? c("", !0) : (n(), E(y, {
|
|
515
|
+
key: 2,
|
|
516
|
+
label: "Validate file",
|
|
517
|
+
disabled: !t(f) || !t(B) || t(b),
|
|
518
|
+
onClick: ve
|
|
519
|
+
}, null, 8, ["disabled"])),
|
|
520
|
+
((oe = t(e)) == null ? void 0 : oe.status) === "READY" ? (n(), E(y, {
|
|
521
|
+
key: 3,
|
|
522
|
+
label: "Start import",
|
|
523
|
+
disabled: !t(K) || t(b),
|
|
524
|
+
onClick: ge
|
|
525
|
+
}, null, 8, ["disabled"])) : c("", !0),
|
|
526
|
+
((se = t(e)) == null ? void 0 : se.status) === "STOPPED" ? (n(), E(y, {
|
|
527
|
+
key: 4,
|
|
528
|
+
label: "Retry import",
|
|
529
|
+
disabled: t(b) || !t(e).file,
|
|
530
|
+
onClick: he
|
|
531
|
+
}, null, 8, ["disabled"])) : c("", !0)
|
|
532
|
+
])
|
|
533
|
+
]);
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
}), ht = { class: "px-24 flex flex-col gap-y-16 pb-24" }, Ft = /* @__PURE__ */ J({
|
|
537
|
+
__name: "Member",
|
|
538
|
+
setup(G) {
|
|
539
|
+
const m = Ye(), { t: N } = de(), D = ue(), f = [
|
|
540
|
+
{
|
|
541
|
+
label: N("connect.loyalty.member.tabs.member_list"),
|
|
542
|
+
value: I["$connect-LOYALTY_MEMBER_LIST"]
|
|
543
|
+
}
|
|
544
|
+
], k = P(() => {
|
|
545
|
+
var w, _, L;
|
|
546
|
+
const h = m.currentRoute.value.name;
|
|
547
|
+
return h == I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"] ? {
|
|
548
|
+
title: "Import history",
|
|
549
|
+
description: void 0,
|
|
550
|
+
backButton: !0,
|
|
551
|
+
onBackButton: async () => {
|
|
552
|
+
await m.push({
|
|
553
|
+
name: I["$connect-LOYALTY_MEMBER_LIST"]
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
} : h != I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
|
|
557
|
+
title: e.value.label,
|
|
558
|
+
description: void 0
|
|
559
|
+
} : (e.value = f[1], {
|
|
560
|
+
backButton: !0,
|
|
561
|
+
title: N("connect.loyalty.member.title"),
|
|
562
|
+
description: `${(w = d.value) == null ? void 0 : w.name} (${(_ = d.value) == null ? void 0 : _._id}) (${(L = d.value) == null ? void 0 : L.phoneNumber})`,
|
|
563
|
+
onBackButton: async () => {
|
|
564
|
+
await m.push({ name: I["$connect-LOYALTY_MEMBER_LIST"] });
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
}), e = g(
|
|
568
|
+
f.find((h) => h.value === m.currentRoute.value.name) ?? f[0]
|
|
569
|
+
), d = g(), R = P(
|
|
570
|
+
() => m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] || m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
571
|
+
), B = P(
|
|
572
|
+
() => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_TRANSACTIONS"]
|
|
573
|
+
), T = P(
|
|
574
|
+
() => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
575
|
+
);
|
|
576
|
+
async function x(h) {
|
|
577
|
+
await m.push({ name: h });
|
|
578
|
+
}
|
|
579
|
+
async function S() {
|
|
580
|
+
D.open({
|
|
581
|
+
title: "Import members",
|
|
582
|
+
closeButton: !1,
|
|
583
|
+
dismissAway: !1,
|
|
584
|
+
maxHeight: "90vh",
|
|
585
|
+
contentComponent: gt
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
async function b() {
|
|
589
|
+
await m.push({
|
|
590
|
+
name: I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
return Me(
|
|
594
|
+
() => m.currentRoute.value.name,
|
|
595
|
+
async (h) => {
|
|
596
|
+
e.value = f.find((_) => _.value === h) ?? f[0];
|
|
597
|
+
const w = m.currentRoute.value.params.id;
|
|
598
|
+
w && (d.value = await A.readById(w));
|
|
599
|
+
},
|
|
600
|
+
{ immediate: !0 }
|
|
601
|
+
), (h, w) => {
|
|
602
|
+
const _ = v("FmButton"), L = v("FmPageHead"), q = v("FmTabs"), j = v("RouterView");
|
|
603
|
+
return n(), i(Y, null, [
|
|
604
|
+
u(L, {
|
|
605
|
+
title: t(k).title,
|
|
606
|
+
description: t(k).description,
|
|
607
|
+
"back-button": t(k).backButton,
|
|
608
|
+
"onClick:back": t(k).onBackButton
|
|
609
|
+
}, Ne({ _: 2 }, [
|
|
610
|
+
t(B) ? {
|
|
611
|
+
name: "append",
|
|
612
|
+
fn: M(() => [
|
|
613
|
+
u(Ve, null, {
|
|
614
|
+
default: M(() => [
|
|
615
|
+
t(T) ? (n(), E(_, {
|
|
616
|
+
key: 0,
|
|
617
|
+
label: "Import history",
|
|
618
|
+
"prepend-icon": "work_history",
|
|
619
|
+
variant: "tertiary",
|
|
620
|
+
onClick: b
|
|
621
|
+
})) : c("", !0),
|
|
622
|
+
u(_, {
|
|
623
|
+
label: t(N)("connect.loyalty.member.import"),
|
|
624
|
+
"prepend-icon": "download",
|
|
625
|
+
onClick: S
|
|
626
|
+
}, null, 8, ["label"])
|
|
627
|
+
]),
|
|
628
|
+
_: 1
|
|
629
|
+
})
|
|
630
|
+
]),
|
|
631
|
+
key: "0"
|
|
632
|
+
} : void 0
|
|
633
|
+
]), 1032, ["title", "description", "back-button", "onClick:back"]),
|
|
634
|
+
s("div", ht, [
|
|
635
|
+
t(R) ? c("", !0) : (n(), E(q, {
|
|
636
|
+
key: 0,
|
|
637
|
+
"model-value": t(e).value,
|
|
638
|
+
items: f,
|
|
639
|
+
"onUpdate:modelValue": x
|
|
640
|
+
}, null, 8, ["model-value"])),
|
|
641
|
+
u(j)
|
|
642
|
+
])
|
|
643
|
+
], 64);
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
export {
|
|
648
|
+
Ft as default
|
|
649
|
+
};
|