@feedmepos/mf-connect 0.1.98-beta.47 → 0.1.98-beta.49
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-JFPlzU0L.js → App-DpEetYST.js} +8 -8
- package/dist/{AuditLogs-Bk6QCZgp.js → AuditLogs-Cmo803hX.js} +10 -10
- package/dist/{Bin-CHi79olc.js → Bin-DJfXzuaK.js} +8 -8
- package/dist/{Broadcast-DSicPemE.js → Broadcast-CNgV44yY.js} +11 -11
- package/dist/{CampaignAnalytic-B3czdnvb.js → CampaignAnalytic-B2Rn2EJg.js} +6 -6
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CkC0A-ix.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bns7bxjM.js} +7 -7
- package/dist/{Card-Begf7uD_.js → Card-B2VUzTu-.js} +20 -20
- package/dist/{Collections-BSmTzG4a.js → Collections-CND1NP87.js} +8 -8
- package/dist/{Credit-BqZ9lr6S.js → Credit-DVwWQVhX.js} +12 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-qMqks3fR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BAkLmXrV.js} +34 -35
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Ck2PxSye.js → EffectSheet.vue_vue_type_style_index_0_lang-C_iJZVqp.js} +16 -16
- package/dist/{Experience-i0bu7uAI.js → Experience-byIWULhh.js} +12 -12
- package/dist/{FileSaver.min-Ck6lXfKM.js → FileSaver.min-CaXtjHRv.js} +1 -1
- package/dist/{Game-Be02GnjR.js → Game-tzliFFnf.js} +13 -13
- package/dist/{GiftCardSetup-DPN3NhND.js → GiftCardSetup-CUZn8cQ_.js} +9 -9
- package/dist/{Grab-BKIYI2d-.js → Grab-Bj955oc2.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BqylTCHX.js → ImageInput.vue_vue_type_script_setup_true_lang-DM6s0VaT.js} +1 -1
- package/dist/{Index-BD_l8T_M.js → Index-qie7NJrQ.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cch5RizQ.js → LocationPicker.vue_vue_type_script_setup_true_lang-DN_0AboA.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D3psJutm.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CrDegDYa.js} +1 -1
- package/dist/LoyaltyDashboard-D_SjNwRv.js +2218 -0
- package/dist/{MainLayout-C96xSNND.js → MainLayout-B4LQ7fj3.js} +3 -3
- package/dist/{Marketing-Bg6DFKg5.js → Marketing-BP2jjkGw.js} +4 -4
- package/dist/{MarketingMaterialEdit-BYbWgB2R.js → MarketingMaterialEdit-BDP-tlCV.js} +6 -6
- package/dist/Member-BIT0lu05.js +642 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-CmR5L_FZ.js +1287 -0
- package/dist/{MemberImportHistory-Bw-M3Zx-.js → MemberImportHistory-CXq5k3za.js} +26 -24
- package/dist/MemberList-DgQrAUhF.js +336 -0
- package/dist/{MemberTransactions-DEzFrc9e.js → MemberTransactions-SD0EK9MQ.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CFpMazFG.js → MessageInput.vue_vue_type_script_setup_true_lang-B_P--gRo.js} +10 -10
- package/dist/{Mission-CWeWfTdC.js → Mission-Dcc8TywU.js} +13 -13
- package/dist/{Overview-CPMN5kuM.js → Overview-2n-3zYgT.js} +3 -3
- package/dist/{Overview-De06lJt0.js → Overview-ClsCoDwC.js} +19 -19
- package/dist/{Point-XfVYDIbj.js → Point-yoPNIfen.js} +12 -12
- package/dist/{Promotion-Q646p6RE.js → Promotion-Bo8fwRxo.js} +13 -13
- package/dist/{Queue-BNfc0ySV.js → Queue-DOMCJIfy.js} +11 -11
- package/dist/{Record-Dx5pZmpm.js → Record-B_GFsmRS.js} +9 -9
- package/dist/{Review-BX5Z5ivr.js → Review-D-UnLgKx.js} +2 -2
- package/dist/{ReviewFacebookCallback-B6GFP04-.js → ReviewFacebookCallback-CSkzBR52.js} +5 -5
- package/dist/{ReviewGoogleCallback-BWgxTbuf.js → ReviewGoogleCallback-DXW6TAxP.js} +5 -5
- package/dist/{Reward-DOImZVUL.js → Reward-CqNDQ5fM.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-8fuZmrBK.js → RewardGroup.vue_vue_type_script_setup_true_lang-CZPtIroB.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-C9kWB5Zw.js → RuleGroup.vue_vue_type_script_setup_true_lang-xzJ738TT.js} +15 -15
- package/dist/{Segment-BndDCfLd.js → Segment-B3keIMfg.js} +33 -34
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DV1X7e-_.js → SelectItems.vue_vue_type_script_setup_true_lang-B1IbP3lO.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-O9ohGQxg.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BvrNFNDo.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D2knZbHq.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BtJyfV2S.js} +4 -4
- package/dist/{Setting-DPm0lJmq.js → Setting-CUf7r25C.js} +14 -14
- package/dist/{SettingAdvertisements-DdPGyRNI.js → SettingAdvertisements-BnfH2GWe.js} +12 -12
- package/dist/{Settings-BQPDUWyz.js → Settings-CVyEvBdL.js} +5 -5
- package/dist/{Store-Cw-c2Wgl.js → Store-yJsGBJjp.js} +24 -24
- package/dist/{StoreRewards-CYkHL-h6.js → StoreRewards-E009h_Ki.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DClGeare.js → StoreTransactions.vue_vue_type_script_setup_true_lang-dFIK3_9i.js} +22 -22
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DekQ8_F8.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BWytuBNh.js} +2 -2
- package/dist/{Tier-B7QmbFn8.js → Tier-D6l8QcgM.js} +25 -25
- package/dist/{Title-CRM_l4YE.js → Title-CKdZ_ulb.js} +22 -22
- package/dist/{Transaction-C1jXS8Le.js → Transaction-CHzWDrMp.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-yPF04Hth.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D5-CNeZh.js} +6 -6
- package/dist/{Voucher-Cfh_Wudx.js → Voucher-g84i_O99.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BkiXzbFh.js → VoucherEditor.vue_vue_type_script_setup_true_lang-HofDeLRx.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BEFynSZm.js → ZodTextField.vue_vue_type_script_setup_true_lang-B2QIFX1P.js} +2 -2
- package/dist/{app-CEWVaJEZ.js → app-CVfoAVMp.js} +238 -238
- package/dist/app.js +1 -1
- package/dist/{business-DWLMb2lG.js → business-DZUUnIjL.js} +1 -1
- package/dist/{campaign-DwYJGuSz.js → campaign-BIbDOJuM.js} +8 -8
- package/dist/{campaign-DRJO5ydK.js → campaign-CI_rZpSy.js} +2 -2
- package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BBJZPv79.js} +1 -1
- package/dist/{campaign.fn-CPfN51jT.js → campaign.fn-BSKTKKn_.js} +57 -57
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-Bpd7su_n.js} +1 -1
- package/dist/{collection.fn-j4_hDjjy.js → collection.fn-CGLzb4iJ.js} +2 -2
- package/dist/{duplicateCampaign-CQ-yfh9b.js → duplicateCampaign-DvYTuIU-.js} +2 -2
- package/dist/{effect-DU8lcl8m.js → effect-DeuwDSDb.js} +1 -1
- package/dist/{email-addresses-DUpMDrGS.js → email-addresses-CXSJ6d0R.js} +2 -2
- package/dist/{export-BFMh5l4w.js → export-DMrK_zVs.js} +3 -3
- package/dist/{helper-DSvUKuiG.js → helper-CuwR4Iok.js} +1 -1
- package/dist/{index-JlyOHqyG.js → index-BGM2LdBN.js} +3 -3
- package/dist/{index-CWbvBvE3.js → index-BIE7IDVs.js} +2 -2
- package/dist/{index-DD3Jlx01.js → index-BnF40VHU.js} +1 -1
- package/dist/{index-rZdY3BW8.js → index-Br-IwWs2.js} +7 -7
- package/dist/{index-C69TnizM.js → index-BsGpbfSM.js} +1 -1
- package/dist/{index-CDyGueuB.js → index-BsL2fRDR.js} +82 -83
- package/dist/{index-D8_jwrSU.js → index-BtCff_X4.js} +1 -1
- package/dist/{index--mkEqsYz.js → index-CVshuS9x.js} +2 -2
- package/dist/{index-CrKfbYDf.js → index-CmXN0dX2.js} +281 -283
- package/dist/{index-CvVrgPmm.js → index-CsKzQMVH.js} +10766 -8027
- package/dist/{index-CuyxKvmh.js → index-D0RwTeSK.js} +7 -8
- package/dist/{index-CvaF2wtX.js → index-Di34zXvz.js} +1 -1
- package/dist/{index-DCbCuJXP.js → index-DtlEsLvC.js} +1 -1
- package/dist/{index-B-tBxRw2.js → index-KJ9fWfKI.js} +2 -2
- package/dist/{index-DLZ_cPwd.js → index-Z1kANjy2.js} +1 -1
- package/dist/{index-D-swy6qD.js → index-mkULcMHp.js} +1 -1
- package/dist/{index-CWEtTfxy.js → index-ux77Q19k.js} +24 -25
- package/dist/{index-BVWwOMHO.js → index-v0Wp7wZh.js} +11 -12
- package/dist/{index.esm2017-B2wpsz6n.js → index.esm2017-7ccdC84w.js} +132 -132
- package/dist/{loading-BHHf9MeD.js → loading-CRmkbq3n.js} +1 -1
- package/dist/{lodash-zHycpMIs.js → lodash-Bc-ryXNQ.js} +1 -1
- package/dist/{member-import-MTwvl8TG.js → member-import-DlkhFBuH.js} +8 -8
- package/dist/{membership-Ctqa96gd.js → membership-B26RzkXD.js} +3 -3
- package/dist/{money-C9m7TfMA.js → money-DQctndhn.js} +1 -1
- package/dist/{number-ng88zCwj.js → number-Bf6ikkos.js} +1 -1
- package/dist/objectid-rBYoX-d0.js +145 -0
- package/dist/{plugins-MY2whJpz.js → plugins-C67nSbj6.js} +3 -3
- package/dist/{reward-DiiV8MQE.js → reward-C43tP4ms.js} +1 -1
- package/dist/{rule-builder-BVEerrEc.js → rule-builder-C8VKx9qo.js} +1 -1
- package/dist/{rule-C31n55fZ.js → rule-ferkW3Tn.js} +3 -3
- package/dist/{template-CtcRYRZb.js → template-6TQsSBnV.js} +6 -6
- package/dist/{timezone-Ck4iMIrt.js → timezone-CHLqfxGX.js} +1 -1
- package/dist/{transaction.fn-BI0-LgQG.js → transaction.fn-Ck4GNkX8.js} +1 -1
- package/dist/{trigger-_5hAtyky.js → trigger-DW-HI3-m.js} +5 -5
- package/dist/{useMarketingMaterialActions-CX9qJp_O.js → useMarketingMaterialActions-DgjXENGq.js} +3 -3
- package/dist/{usePagination-DZKDMzEh.js → usePagination-DK5YxY0V.js} +1 -1
- package/dist/{user-C-Db5JiY.js → user-CEgC8bHe.js} +1 -1
- package/dist/{vue-i18n-BbF7bmsx.js → vue-i18n-CVwaGWN7.js} +237 -237
- package/dist/{xlsx-CzpvTfCU.js → xlsx-BjSGml1D.js} +440 -440
- package/dist/{zod-HtL78lno.js → zod-CIM7JLfN.js} +1 -1
- package/package.json +3 -1
- package/dist/LoyaltyDashboard-D0eq0Gaw.js +0 -1345
- package/dist/Member-B4NAFx8G.js +0 -573
- package/dist/MemberList-DXpa6_Rb.js +0 -1603
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/objectid-BTsufz4u.js +0 -145
package/dist/Member-B4NAFx8G.js
DELETED
|
@@ -1,573 +0,0 @@
|
|
|
1
|
-
import { defineComponent as G, resolveComponent as p, unref as t, openBlock as s, createElementBlock as c, normalizeClass as Z, renderSlot as ee, createElementVNode as n, createVNode as i, ref as _, computed as B, onMounted as he, onBeforeUnmount as ke, Fragment as N, createTextVNode as P, withCtx as I, renderList as te, createBlock as g, toDisplayString as l, createCommentVNode as m, isRef as we, watch as Te, createSlots as Re } from "vue";
|
|
2
|
-
import "./index-DD3Jlx01.js";
|
|
3
|
-
import { useDialog as ne } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as ae } from "./vue-i18n-BbF7bmsx.js";
|
|
5
|
-
import { useCoreStore as xe } from "@feedmepos/mf-common";
|
|
6
|
-
import { F as oe } from "./FileSaver.min-Ck6lXfKM.js";
|
|
7
|
-
import { u as j, w as Ee } from "./xlsx-CzpvTfCU.js";
|
|
8
|
-
import { m as E } from "./index-CWbvBvE3.js";
|
|
9
|
-
import { useRouter as Ie } from "vue-router";
|
|
10
|
-
import { R as k } from "./app-CEWVaJEZ.js";
|
|
11
|
-
const Se = { class: "fm-typo-en-body-sm-400 justify-center flex items-center w-full" }, Ce = /* @__PURE__ */ G({
|
|
12
|
-
__name: "FmAdminBadge",
|
|
13
|
-
props: {
|
|
14
|
-
class: { default: void 0 },
|
|
15
|
-
selectable: { type: Boolean, default: !1 }
|
|
16
|
-
},
|
|
17
|
-
setup(V) {
|
|
18
|
-
const d = V, R = xe();
|
|
19
|
-
return (f, e) => {
|
|
20
|
-
var y;
|
|
21
|
-
const r = p("FmIcon");
|
|
22
|
-
return (y = t(R).sessionUser.value) != null && y.role.isAdmin ? (s(), c("div", {
|
|
23
|
-
key: 0,
|
|
24
|
-
class: Z([
|
|
25
|
-
"group gap-8 inline-flex items-center relative border-1 border-dashed rounded-md border-red-500 hover:border-opacity-30 transition-opacity",
|
|
26
|
-
{ "select-none": !d.selectable }
|
|
27
|
-
])
|
|
28
|
-
}, [
|
|
29
|
-
ee(f.$slots, "default"),
|
|
30
|
-
n("div", {
|
|
31
|
-
class: Z([
|
|
32
|
-
"pointer-events-none opacity-90 flex items-center justify-center rounded-xxxl bg-red-500 text-white group-hover:opacity-20",
|
|
33
|
-
d.class,
|
|
34
|
-
{
|
|
35
|
-
absolute: !0,
|
|
36
|
-
"bottom-[-5px] right-[-8px] px-4 h-[25px] w-[25px] border-2 border-red-800": !0
|
|
37
|
-
}
|
|
38
|
-
])
|
|
39
|
-
}, [
|
|
40
|
-
n("span", Se, [
|
|
41
|
-
i(r, {
|
|
42
|
-
name: "support_agent",
|
|
43
|
-
size: "sm",
|
|
44
|
-
outline: ""
|
|
45
|
-
})
|
|
46
|
-
])
|
|
47
|
-
], 2)
|
|
48
|
-
], 2)) : ee(f.$slots, "non-admin", { key: 1 });
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}), Fe = { class: "w-[720px] max-w-full space-y-24 pb-16" }, Ae = {
|
|
52
|
-
key: 0,
|
|
53
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
54
|
-
}, Be = { class: "flex justify-end" }, Le = {
|
|
55
|
-
key: 1,
|
|
56
|
-
class: "flex items-center rounded-md border border-fm-color-neutral-gray-300 p-16"
|
|
57
|
-
}, Me = { class: "fm-typo-en-body-lg-400 min-w-0 flex-1 truncate px-8" }, Pe = { for: "member-import-file" }, Ne = { class: "flex items-center justify-between" }, Oe = { class: "fm-typo-en-title-sm-800" }, De = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ve = {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "rounded-md bg-fm-color-system-error-100 p-16 fm-typo-en-body-sm-400"
|
|
60
|
-
}, Ye = {
|
|
61
|
-
key: 1,
|
|
62
|
-
class: "rounded-md bg-fm-color-system-info-100 p-16 fm-typo-en-body-md-400"
|
|
63
|
-
}, Ue = {
|
|
64
|
-
key: 2,
|
|
65
|
-
class: "space-y-16"
|
|
66
|
-
}, $e = { class: "grid grid-cols-2 gap-8 md:grid-cols-4" }, He = { class: "fm-typo-en-title-sm-800" }, je = { class: "fm-typo-en-title-sm-800" }, Ge = { class: "fm-typo-en-title-sm-800" }, ze = { class: "fm-typo-en-title-sm-800" }, Je = {
|
|
67
|
-
key: 0,
|
|
68
|
-
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
69
|
-
}, qe = {
|
|
70
|
-
key: 1,
|
|
71
|
-
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
72
|
-
}, Qe = { class: "fm-typo-en-body-md-400" }, Ke = { class: "fm-typo-en-body-md-600" }, We = {
|
|
73
|
-
key: 3,
|
|
74
|
-
class: "space-y-12"
|
|
75
|
-
}, Xe = { class: "rounded-md bg-fm-color-system-error-100 p-16" }, Ze = { class: "fm-typo-en-body-sm-400" }, et = {
|
|
76
|
-
key: 4,
|
|
77
|
-
class: "rounded-md bg-fm-color-system-error-100 p-16"
|
|
78
|
-
}, tt = { class: "fm-typo-en-body-sm-400" }, ot = { class: "fm-typo-en-body-sm-400" }, nt = {
|
|
79
|
-
key: 5,
|
|
80
|
-
class: "rounded-md bg-fm-color-system-success-100 p-16"
|
|
81
|
-
}, at = { class: "fm-typo-en-body-sm-400" }, st = { class: "flex items-center justify-end gap-8" }, lt = /* @__PURE__ */ G({
|
|
82
|
-
__name: "ImportMemberDialog",
|
|
83
|
-
setup(V) {
|
|
84
|
-
const { t: d } = ae(), R = ne(), f = _(null), e = _(null), r = _(""), y = _(""), w = _(!1), F = _(!1), b = _(!1), O = _(!0);
|
|
85
|
-
let A;
|
|
86
|
-
const L = _({
|
|
87
|
-
mode: "UPSERT"
|
|
88
|
-
}), Y = [
|
|
89
|
-
{ label: "Create missing members only", value: "CREATE" },
|
|
90
|
-
{ label: "Update existing members only", value: "UPDATE" },
|
|
91
|
-
{ label: "Create and update members", value: "UPSERT" }
|
|
92
|
-
], v = [
|
|
93
|
-
"Id",
|
|
94
|
-
"Name",
|
|
95
|
-
"Phone",
|
|
96
|
-
"Email",
|
|
97
|
-
"Gender",
|
|
98
|
-
"CardNo",
|
|
99
|
-
"Birthday",
|
|
100
|
-
"Credit",
|
|
101
|
-
"CreditExpiryDate",
|
|
102
|
-
"Experience",
|
|
103
|
-
"Point",
|
|
104
|
-
"Tier",
|
|
105
|
-
"Titles",
|
|
106
|
-
"AvgSpent",
|
|
107
|
-
"LastVisit",
|
|
108
|
-
"Feedback",
|
|
109
|
-
"LastSeasonTierEarned",
|
|
110
|
-
"LastSeasonPointEarned",
|
|
111
|
-
"JoinedAt",
|
|
112
|
-
"JoinedAtLocation",
|
|
113
|
-
"VisitFrequency"
|
|
114
|
-
], x = [
|
|
115
|
-
{
|
|
116
|
-
label: "CSV",
|
|
117
|
-
icon: "csv",
|
|
118
|
-
value: "csv"
|
|
119
|
-
/* csv */
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
label: "Excel",
|
|
123
|
-
icon: "description",
|
|
124
|
-
value: "xlsx"
|
|
125
|
-
/* xlsx */
|
|
126
|
-
}
|
|
127
|
-
], h = B(
|
|
128
|
-
() => {
|
|
129
|
-
var a;
|
|
130
|
-
return ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING"].includes(
|
|
131
|
-
((a = e.value) == null ? void 0 : a.status) ?? ""
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
), S = B(() => {
|
|
135
|
-
var a;
|
|
136
|
-
return !(((a = e.value) == null ? void 0 : a.status) !== "READY" || !e.value.file || y.value !== e.value.businessName || e.value.summary.sharedProfiles > 0 && !w.value || e.value.summary.balanceRows > 0 && !F.value);
|
|
137
|
-
});
|
|
138
|
-
function U(a) {
|
|
139
|
-
var o, C;
|
|
140
|
-
f.value = ((C = (o = a.target) == null ? void 0 : o.files) == null ? void 0 : C[0]) ?? null;
|
|
141
|
-
}
|
|
142
|
-
function $(a) {
|
|
143
|
-
if (a === "csv") {
|
|
144
|
-
oe.saveAs(
|
|
145
|
-
new Blob([v.join(",")], {
|
|
146
|
-
type: "text/csv;charset=utf-8;"
|
|
147
|
-
}),
|
|
148
|
-
"ImportMemberTemplate.csv"
|
|
149
|
-
);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const o = j.aoa_to_sheet([v]), C = j.book_new();
|
|
153
|
-
j.book_append_sheet(C, o, "Members"), Ee(C, "ImportMemberTemplate.xlsx");
|
|
154
|
-
}
|
|
155
|
-
async function se() {
|
|
156
|
-
if (!f.value) {
|
|
157
|
-
r.value = "Please upload a file.";
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
b.value = !0, r.value = "";
|
|
161
|
-
try {
|
|
162
|
-
const a = new FormData();
|
|
163
|
-
a.append("file", f.value), a.append("config", JSON.stringify(L.value)), e.value = await E.import(a), await M();
|
|
164
|
-
} catch (a) {
|
|
165
|
-
r.value = a instanceof Error ? a.message : String(a);
|
|
166
|
-
} finally {
|
|
167
|
-
b.value = !1;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async function le() {
|
|
171
|
-
e.value && (e.value = await E.readImport(e.value._id.toString()));
|
|
172
|
-
}
|
|
173
|
-
async function M() {
|
|
174
|
-
var a;
|
|
175
|
-
H();
|
|
176
|
-
try {
|
|
177
|
-
await le();
|
|
178
|
-
} catch (o) {
|
|
179
|
-
r.value = o instanceof Error ? o.message : String(o);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
h.value && (A = setTimeout(M, ((a = e.value) == null ? void 0 : a.status) === "RUNNING" ? 5e3 : 1500));
|
|
183
|
-
}
|
|
184
|
-
async function re() {
|
|
185
|
-
try {
|
|
186
|
-
e.value = await E.resumableImport(), e.value && await M();
|
|
187
|
-
} catch (a) {
|
|
188
|
-
r.value = a instanceof Error ? a.message : String(a);
|
|
189
|
-
} finally {
|
|
190
|
-
O.value = !1;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function H() {
|
|
194
|
-
A && clearTimeout(A), A = void 0;
|
|
195
|
-
}
|
|
196
|
-
function ie() {
|
|
197
|
-
H(), e.value = null, f.value = null, r.value = "";
|
|
198
|
-
}
|
|
199
|
-
async function ue() {
|
|
200
|
-
if (!(!e.value || !S.value)) {
|
|
201
|
-
b.value = !0, r.value = "";
|
|
202
|
-
try {
|
|
203
|
-
e.value = await E.confirmImport(e.value._id.toString(), {
|
|
204
|
-
businessName: y.value,
|
|
205
|
-
fileHash: e.value.fileHash,
|
|
206
|
-
previewVersion: e.value.previewVersion,
|
|
207
|
-
acknowledgeSharedProfiles: w.value,
|
|
208
|
-
acknowledgeBalanceReplacement: F.value
|
|
209
|
-
}), await M();
|
|
210
|
-
} catch (a) {
|
|
211
|
-
r.value = a instanceof Error ? a.message : String(a);
|
|
212
|
-
} finally {
|
|
213
|
-
b.value = !1;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
async function ce() {
|
|
218
|
-
if (e.value) {
|
|
219
|
-
b.value = !0, r.value = "";
|
|
220
|
-
try {
|
|
221
|
-
e.value = await E.retryImport(e.value._id.toString()), await M();
|
|
222
|
-
} catch (a) {
|
|
223
|
-
r.value = a instanceof Error ? a.message : String(a);
|
|
224
|
-
} finally {
|
|
225
|
-
b.value = !1;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
async function me() {
|
|
230
|
-
if (!e.value) {
|
|
231
|
-
R.close();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
try {
|
|
235
|
-
await E.cancelImport(e.value._id.toString());
|
|
236
|
-
} catch {
|
|
237
|
-
}
|
|
238
|
-
R.close();
|
|
239
|
-
}
|
|
240
|
-
async function de() {
|
|
241
|
-
if (!e.value) return;
|
|
242
|
-
const a = await E.downloadImportResult(e.value._id.toString());
|
|
243
|
-
oe.saveAs(a, `member-import-${e.value._id}.csv`);
|
|
244
|
-
}
|
|
245
|
-
return he(re), ke(H), (a, o) => {
|
|
246
|
-
var J, q, Q, K, W, X;
|
|
247
|
-
const C = p("FmSelect"), T = p("FmButton"), pe = p("FmMenuItem"), fe = p("FmMenu"), ye = p("FmDropField"), ve = p("FmChip"), D = p("FmCard"), be = p("FmTextField"), z = p("FmCheckbox"), _e = p("FmHelperText"), ge = p("FmSpacer");
|
|
248
|
-
return s(), c("div", Fe, [
|
|
249
|
-
t(O) ? (s(), c("div", Ae, " Checking for an unfinished import… ")) : t(e) ? (s(), c(N, { key: 2 }, [
|
|
250
|
-
n("div", Ne, [
|
|
251
|
-
n("div", null, [
|
|
252
|
-
n("div", Oe, l(((J = t(e).file) == null ? void 0 : J.originalName) ?? "Unknown file"), 1),
|
|
253
|
-
n("div", De, " Import " + l(t(e)._id) + " · " + l(t(e).status), 1)
|
|
254
|
-
]),
|
|
255
|
-
i(ve, {
|
|
256
|
-
label: t(e).status,
|
|
257
|
-
compact: ""
|
|
258
|
-
}, null, 8, ["label"])
|
|
259
|
-
]),
|
|
260
|
-
t(e).file ? m("", !0) : (s(), c("div", Ve, " The saved import is missing its uploaded file. Cancel it and upload the file again. ")),
|
|
261
|
-
t(h) ? (s(), c("div", Ye, l(t(e).status === "RUNNING" ? "Importing members…" : "Preparing import preview…"), 1)) : m("", !0),
|
|
262
|
-
t(e).status === "READY" ? (s(), c("div", Ue, [
|
|
263
|
-
n("div", $e, [
|
|
264
|
-
i(D, {
|
|
265
|
-
variant: "outlined",
|
|
266
|
-
class: "p-12"
|
|
267
|
-
}, {
|
|
268
|
-
default: I(() => [
|
|
269
|
-
n("div", He, l(t(e).summary.total), 1),
|
|
270
|
-
o[6] || (o[6] = n("div", { class: "fm-typo-en-body-sm-400" }, "Rows", -1))
|
|
271
|
-
]),
|
|
272
|
-
_: 1
|
|
273
|
-
}),
|
|
274
|
-
i(D, {
|
|
275
|
-
variant: "outlined",
|
|
276
|
-
class: "p-12"
|
|
277
|
-
}, {
|
|
278
|
-
default: I(() => [
|
|
279
|
-
n("div", je, l(t(e).summary.create), 1),
|
|
280
|
-
o[7] || (o[7] = n("div", { class: "fm-typo-en-body-sm-400" }, "Create", -1))
|
|
281
|
-
]),
|
|
282
|
-
_: 1
|
|
283
|
-
}),
|
|
284
|
-
i(D, {
|
|
285
|
-
variant: "outlined",
|
|
286
|
-
class: "p-12"
|
|
287
|
-
}, {
|
|
288
|
-
default: I(() => [
|
|
289
|
-
n("div", Ge, l(t(e).summary.update), 1),
|
|
290
|
-
o[8] || (o[8] = n("div", { class: "fm-typo-en-body-sm-400" }, "Update", -1))
|
|
291
|
-
]),
|
|
292
|
-
_: 1
|
|
293
|
-
}),
|
|
294
|
-
i(D, {
|
|
295
|
-
variant: "outlined",
|
|
296
|
-
class: "p-12"
|
|
297
|
-
}, {
|
|
298
|
-
default: I(() => [
|
|
299
|
-
n("div", ze, l(t(e).summary.balanceRows), 1),
|
|
300
|
-
o[9] || (o[9] = n("div", { class: "fm-typo-en-body-sm-400" }, "Balance rows", -1))
|
|
301
|
-
]),
|
|
302
|
-
_: 1
|
|
303
|
-
})
|
|
304
|
-
]),
|
|
305
|
-
t(e).summary.balanceRows ? (s(), c("div", Je, " Final target totals — Credit: " + l(t(e).summary.creditTargetTotal) + ", Experience: " + l(t(e).summary.experienceTargetTotal) + ", Points: " + l(t(e).summary.pointTargetTotal) + ". Tier changes: " + l(t(e).summary.tierRows) + ". ", 1)) : m("", !0),
|
|
306
|
-
t(e).summary.sharedProfiles ? (s(), c("div", qe, l(t(e).summary.sharedProfiles) + " rows can update a shared profile used by another business. ", 1)) : m("", !0),
|
|
307
|
-
n("div", Qe, [
|
|
308
|
-
o[10] || (o[10] = P(" To confirm your action, type ", -1)),
|
|
309
|
-
n("span", Ke, l(t(e).businessName), 1),
|
|
310
|
-
o[11] || (o[11] = P(" in the text field ", -1))
|
|
311
|
-
]),
|
|
312
|
-
i(be, {
|
|
313
|
-
modelValue: t(y),
|
|
314
|
-
"onUpdate:modelValue": o[2] || (o[2] = (u) => we(y) ? y.value = u : null)
|
|
315
|
-
}, null, 8, ["modelValue"]),
|
|
316
|
-
t(e).summary.sharedProfiles ? (s(), g(z, {
|
|
317
|
-
key: 2,
|
|
318
|
-
"model-value": t(w),
|
|
319
|
-
value: "shared-profile",
|
|
320
|
-
label: "I understand that shared profile fields can affect other businesses.",
|
|
321
|
-
"onUpdate:modelValue": o[3] || (o[3] = (u) => w.value = u)
|
|
322
|
-
}, null, 8, ["model-value"])) : m("", !0),
|
|
323
|
-
t(e).summary.balanceRows ? (s(), g(z, {
|
|
324
|
-
key: 3,
|
|
325
|
-
"model-value": t(F),
|
|
326
|
-
value: "balance-replacement",
|
|
327
|
-
label: "I understand that populated balance cells replace final balances.",
|
|
328
|
-
"onUpdate:modelValue": o[4] || (o[4] = (u) => F.value = u)
|
|
329
|
-
}, null, 8, ["model-value"])) : m("", !0)
|
|
330
|
-
])) : m("", !0),
|
|
331
|
-
t(e).status === "INVALID" ? (s(), c("div", We, [
|
|
332
|
-
n("div", Xe, [
|
|
333
|
-
o[12] || (o[12] = n("div", { class: "fm-typo-en-body-md-600" }, "The file is not importable", -1)),
|
|
334
|
-
n("div", Ze, l(t(e).error), 1)
|
|
335
|
-
]),
|
|
336
|
-
(s(!0), c(N, null, te((q = t(e).rowErrors) == null ? void 0 : q.slice(0, 10), (u) => (s(), c("div", {
|
|
337
|
-
key: u.rowNumber,
|
|
338
|
-
class: "fm-typo-en-body-sm-400"
|
|
339
|
-
}, " Row " + l(u.rowNumber) + ": " + l(u.errors.join("; ")), 1))), 128))
|
|
340
|
-
])) : m("", !0),
|
|
341
|
-
t(e).status === "STOPPED" ? (s(), c("div", et, [
|
|
342
|
-
o[13] || (o[13] = n("div", { class: "fm-typo-en-body-md-600" }, "Import stopped", -1)),
|
|
343
|
-
n("div", tt, l(t(e).summary.completed) + " rows completed before the first runtime error. Fix the cause, then retry this same import safely. ", 1),
|
|
344
|
-
n("div", ot, l(t(e).error), 1)
|
|
345
|
-
])) : m("", !0),
|
|
346
|
-
t(e).status === "COMPLETED" ? (s(), c("div", nt, [
|
|
347
|
-
o[14] || (o[14] = n("div", { class: "fm-typo-en-body-md-600" }, "Import completed", -1)),
|
|
348
|
-
n("div", at, l(t(e).summary.completed) + " members were processed. ", 1)
|
|
349
|
-
])) : m("", !0)
|
|
350
|
-
], 64)) : (s(), c(N, { key: 1 }, [
|
|
351
|
-
o[5] || (o[5] = n("div", { class: "rounded-md bg-fm-color-system-warning-100 p-16" }, [
|
|
352
|
-
n("div", { class: "fm-typo-en-body-md-600" }, "Import changes production data"),
|
|
353
|
-
n("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
|
|
354
|
-
P(" The file is fully validated before any member is changed. Blank cells keep existing values. Use "),
|
|
355
|
-
n("code", null, "__CLEAR__"),
|
|
356
|
-
P(" to clear supported fields. CSV title lists must be quoted, for example "),
|
|
357
|
-
n("code", null, '"VIP,VVIP,SVIP"'),
|
|
358
|
-
P(". ")
|
|
359
|
-
])
|
|
360
|
-
], -1)),
|
|
361
|
-
i(C, {
|
|
362
|
-
modelValue: t(L).mode,
|
|
363
|
-
"onUpdate:modelValue": o[0] || (o[0] = (u) => t(L).mode = u),
|
|
364
|
-
label: "Import mode",
|
|
365
|
-
items: Y
|
|
366
|
-
}, null, 8, ["modelValue"]),
|
|
367
|
-
n("div", Be, [
|
|
368
|
-
i(fe, null, {
|
|
369
|
-
"menu-button": I(() => [
|
|
370
|
-
i(T, {
|
|
371
|
-
variant: "tertiary",
|
|
372
|
-
icon: "download",
|
|
373
|
-
label: "Download template"
|
|
374
|
-
})
|
|
375
|
-
]),
|
|
376
|
-
default: I(() => [
|
|
377
|
-
(s(), c(N, null, te(x, (u) => i(pe, {
|
|
378
|
-
key: u.value,
|
|
379
|
-
icon: u.icon,
|
|
380
|
-
label: u.label,
|
|
381
|
-
selectable: "",
|
|
382
|
-
onClick: (it) => $(u.value)
|
|
383
|
-
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
384
|
-
]),
|
|
385
|
-
_: 1
|
|
386
|
-
})
|
|
387
|
-
]),
|
|
388
|
-
t(f) ? (s(), c("div", Le, [
|
|
389
|
-
i(T, {
|
|
390
|
-
variant: "tertiary",
|
|
391
|
-
"prepend-icon": "attach_file"
|
|
392
|
-
}),
|
|
393
|
-
n("p", Me, l(t(f).name), 1),
|
|
394
|
-
n("label", Pe, [
|
|
395
|
-
i(T, {
|
|
396
|
-
variant: "plain",
|
|
397
|
-
label: t(d)("Replace File")
|
|
398
|
-
}, null, 8, ["label"]),
|
|
399
|
-
n("input", {
|
|
400
|
-
id: "member-import-file",
|
|
401
|
-
accept: ".csv, .xlsx",
|
|
402
|
-
class: "hidden",
|
|
403
|
-
type: "file",
|
|
404
|
-
onChange: U
|
|
405
|
-
}, null, 32)
|
|
406
|
-
])
|
|
407
|
-
])) : (s(), g(ye, {
|
|
408
|
-
key: 0,
|
|
409
|
-
accept: ".csv, .xlsx",
|
|
410
|
-
"max-file-size": 5e6,
|
|
411
|
-
onFileUpload: o[1] || (o[1] = (u) => f.value = u)
|
|
412
|
-
}))
|
|
413
|
-
], 64)),
|
|
414
|
-
t(r) ? (s(), g(_e, {
|
|
415
|
-
key: 3,
|
|
416
|
-
state: "error",
|
|
417
|
-
text: t(r)
|
|
418
|
-
}, null, 8, ["text"])) : m("", !0),
|
|
419
|
-
n("div", st, [
|
|
420
|
-
t(e) && ["INVALID", "STOPPED", "COMPLETED"].includes(t(e).status) ? (s(), g(T, {
|
|
421
|
-
key: 0,
|
|
422
|
-
variant: "tertiary",
|
|
423
|
-
icon: "download",
|
|
424
|
-
label: "Download result",
|
|
425
|
-
onClick: de
|
|
426
|
-
})) : m("", !0),
|
|
427
|
-
((Q = t(e)) == null ? void 0 : Q.status) === "INVALID" ? (s(), g(T, {
|
|
428
|
-
key: 1,
|
|
429
|
-
variant: "tertiary",
|
|
430
|
-
label: "Choose another file",
|
|
431
|
-
onClick: ie
|
|
432
|
-
})) : m("", !0),
|
|
433
|
-
i(ge),
|
|
434
|
-
i(T, {
|
|
435
|
-
variant: "secondary",
|
|
436
|
-
label: ((K = t(e)) == null ? void 0 : K.status) === "COMPLETED" ? "Close" : "Cancel",
|
|
437
|
-
onClick: me
|
|
438
|
-
}, null, 8, ["label"]),
|
|
439
|
-
t(e) ? m("", !0) : (s(), g(T, {
|
|
440
|
-
key: 2,
|
|
441
|
-
label: "Validate file",
|
|
442
|
-
disabled: !t(f) || t(b),
|
|
443
|
-
onClick: se
|
|
444
|
-
}, null, 8, ["disabled"])),
|
|
445
|
-
((W = t(e)) == null ? void 0 : W.status) === "READY" ? (s(), g(T, {
|
|
446
|
-
key: 3,
|
|
447
|
-
label: "Start import",
|
|
448
|
-
disabled: !t(S) || t(b),
|
|
449
|
-
onClick: ue
|
|
450
|
-
}, null, 8, ["disabled"])) : m("", !0),
|
|
451
|
-
((X = t(e)) == null ? void 0 : X.status) === "STOPPED" ? (s(), g(T, {
|
|
452
|
-
key: 4,
|
|
453
|
-
label: "Retry import",
|
|
454
|
-
disabled: t(b) || !t(e).file,
|
|
455
|
-
onClick: ce
|
|
456
|
-
}, null, 8, ["disabled"])) : m("", !0)
|
|
457
|
-
])
|
|
458
|
-
]);
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
}), rt = { class: "px-24 flex flex-col gap-y-16 pb-24" }, gt = /* @__PURE__ */ G({
|
|
462
|
-
__name: "Member",
|
|
463
|
-
setup(V) {
|
|
464
|
-
const d = Ie(), { t: R } = ae(), f = ne(), e = [
|
|
465
|
-
{
|
|
466
|
-
label: R("connect.loyalty.member.tabs.member_list"),
|
|
467
|
-
value: k["$connect-LOYALTY_MEMBER_LIST"]
|
|
468
|
-
}
|
|
469
|
-
], r = B(() => {
|
|
470
|
-
var x, h, S;
|
|
471
|
-
const v = d.currentRoute.value.name;
|
|
472
|
-
return v == k["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"] ? {
|
|
473
|
-
title: "Import history",
|
|
474
|
-
description: void 0,
|
|
475
|
-
backButton: !0,
|
|
476
|
-
onBackButton: async () => {
|
|
477
|
-
await d.push({
|
|
478
|
-
name: k["$connect-LOYALTY_MEMBER_LIST"]
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
} : v != k["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
|
|
482
|
-
title: y.value.label,
|
|
483
|
-
description: void 0
|
|
484
|
-
} : (y.value = e[1], {
|
|
485
|
-
backButton: !0,
|
|
486
|
-
title: R("connect.loyalty.member.title"),
|
|
487
|
-
description: `${(x = w.value) == null ? void 0 : x.name} (${(h = w.value) == null ? void 0 : h._id}) (${(S = w.value) == null ? void 0 : S.phoneNumber})`,
|
|
488
|
-
onBackButton: async () => {
|
|
489
|
-
await d.push({ name: k["$connect-LOYALTY_MEMBER_LIST"] });
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
}), y = _(
|
|
493
|
-
e.find((v) => v.value === d.currentRoute.value.name) ?? e[0]
|
|
494
|
-
), w = _(), F = B(
|
|
495
|
-
() => d.currentRoute.value.name === k["$connect-LOYALTY_MEMBER_TRANSACTIONS"] || d.currentRoute.value.name === k["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
496
|
-
), b = B(
|
|
497
|
-
() => d.currentRoute.value.name !== k["$connect-LOYALTY_MEMBER_TRANSACTIONS"]
|
|
498
|
-
), O = B(
|
|
499
|
-
() => d.currentRoute.value.name !== k["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
500
|
-
);
|
|
501
|
-
async function A(v) {
|
|
502
|
-
await d.push({ name: v });
|
|
503
|
-
}
|
|
504
|
-
async function L() {
|
|
505
|
-
f.open({
|
|
506
|
-
title: "Import members",
|
|
507
|
-
closeButton: !1,
|
|
508
|
-
dismissAway: !1,
|
|
509
|
-
contentComponent: lt
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
async function Y() {
|
|
513
|
-
await d.push({
|
|
514
|
-
name: k["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
return Te(
|
|
518
|
-
() => d.currentRoute.value.name,
|
|
519
|
-
async (v) => {
|
|
520
|
-
y.value = e.find((h) => h.value === v) ?? e[0];
|
|
521
|
-
const x = d.currentRoute.value.params.id;
|
|
522
|
-
x && (w.value = await E.readById(x));
|
|
523
|
-
},
|
|
524
|
-
{ immediate: !0 }
|
|
525
|
-
), (v, x) => {
|
|
526
|
-
const h = p("FmButton"), S = p("FmPageHead"), U = p("FmTabs"), $ = p("RouterView");
|
|
527
|
-
return s(), c(N, null, [
|
|
528
|
-
i(S, {
|
|
529
|
-
title: t(r).title,
|
|
530
|
-
description: t(r).description,
|
|
531
|
-
"back-button": t(r).backButton,
|
|
532
|
-
"onClick:back": t(r).onBackButton
|
|
533
|
-
}, Re({ _: 2 }, [
|
|
534
|
-
t(b) ? {
|
|
535
|
-
name: "append",
|
|
536
|
-
fn: I(() => [
|
|
537
|
-
i(Ce, null, {
|
|
538
|
-
default: I(() => [
|
|
539
|
-
t(O) ? (s(), g(h, {
|
|
540
|
-
key: 0,
|
|
541
|
-
label: "Import history",
|
|
542
|
-
"prepend-icon": "work_history",
|
|
543
|
-
variant: "tertiary",
|
|
544
|
-
onClick: Y
|
|
545
|
-
})) : m("", !0),
|
|
546
|
-
i(h, {
|
|
547
|
-
label: t(R)("connect.loyalty.member.import"),
|
|
548
|
-
"prepend-icon": "download",
|
|
549
|
-
onClick: L
|
|
550
|
-
}, null, 8, ["label"])
|
|
551
|
-
]),
|
|
552
|
-
_: 1
|
|
553
|
-
})
|
|
554
|
-
]),
|
|
555
|
-
key: "0"
|
|
556
|
-
} : void 0
|
|
557
|
-
]), 1032, ["title", "description", "back-button", "onClick:back"]),
|
|
558
|
-
n("div", rt, [
|
|
559
|
-
t(F) ? m("", !0) : (s(), g(U, {
|
|
560
|
-
key: 0,
|
|
561
|
-
"model-value": t(y).value,
|
|
562
|
-
items: e,
|
|
563
|
-
"onUpdate:modelValue": A
|
|
564
|
-
}, null, 8, ["model-value"])),
|
|
565
|
-
i($)
|
|
566
|
-
])
|
|
567
|
-
], 64);
|
|
568
|
-
};
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
export {
|
|
572
|
-
gt as default
|
|
573
|
-
};
|