@feedmepos/mf-connect 0.1.118-prod → 0.1.119-dev
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/README.md +12 -8
- package/dist/{App-BHcTqLff.js → App-z-u6skb5.js} +349 -337
- package/dist/AuditLogs-J0UJ3HJW.js +2016 -0
- package/dist/{Bin-DWhXJmHo.js → Bin-Dh9RAgYi.js} +8 -8
- package/dist/{Broadcast-Ct1DL8Pd.js → Broadcast-Dg6azPS8.js} +22 -21
- package/dist/{CampaignAnalytic-BSEKCM-4.js → CampaignAnalytic-CVB4dstO.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BxRg2Wu8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DYgBeT23.js} +8 -9
- package/dist/{Card-B7DwrAPH.js → Card-CY736Ul0.js} +22 -22
- package/dist/{Collections-BJw4JJq_.js → Collections-CdTKWkZZ.js} +197 -185
- package/dist/{Credit-BteIGXkp.js → Credit-CUhEKlMI.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CSFwIzOS.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CBwgeTXh.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BC4jTtVY.js +4439 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BDZ21UHA.js → EffectSheet.vue_vue_type_style_index_0_lang-D5-EKqG9.js} +30 -30
- package/dist/{Experience-C_VQVfJX.js → Experience-CMp09U-6.js} +32 -31
- package/dist/{FileSaver.min-CMiQUZQE.js → FileSaver.min-Bq5McdmK.js} +1 -1
- package/dist/{Game-BiHMrMBF.js → Game-Dv5NvG-q.js} +19 -18
- package/dist/{GiftCardSetup-DtJIm6oI.js → GiftCardSetup-SO2Tk5In.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BKGnPAEj.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CgG5vHCp.js} +7 -7
- package/dist/{Goals-B7VjLMDT.js → Goals-BEwQP4cY.js} +4 -4
- package/dist/Grab-npbL7p7S.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C9ecPgpJ.js → ImageInput.vue_vue_type_script_setup_true_lang-BDGEqsWE.js} +1 -1
- package/dist/{Index-D_DIHKZG.js → Index-8F2LOWng.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DSwB0Ubn.js → LocationPicker.vue_vue_type_script_setup_true_lang-BwAjki7Y.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-dk8_eVwd.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DK4C0Y9j.js} +1 -1
- package/dist/{LoyaltyDashboard-DOgHeJdK.js → LoyaltyDashboard-rWm0b8cm.js} +15 -15
- package/dist/{MainLayout-CfYgoXLS.js → MainLayout-ezbgp2IQ.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-Bz2LGHUd.js → MainLayout.vue_vue_type_script_setup_true_lang-1QY5-U5y.js} +3 -3
- package/dist/{Marketing-B6TCrwaR.js → Marketing-DcWF4xVc.js} +4 -4
- package/dist/{MarketingMaterialEdit-Bu3a9NGj.js → MarketingMaterialEdit-C1bXj_hU.js} +214 -211
- package/dist/{Member-X51KrYXV.js → Member-CgDZqGsV.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CYU21JaO.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dh1_j06F.js} +39 -47
- package/dist/{MemberImportHistory-CHd9fx7E.js → MemberImportHistory-DT3QJ5se.js} +7 -7
- package/dist/{MemberList-D4L3bSlw.js → MemberList-Bm05jnbk.js} +103 -105
- package/dist/{MemberTransactions-CEgjfhnX.js → MemberTransactions-D90tTpdC.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-zsaig_yK.js → MessageInput.vue_vue_type_script_setup_true_lang-jvgjOXXA.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-YZQkKG66.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CxL-Nh6i.js} +1 -1
- package/dist/{Mission-BEVtvY0-.js → Mission-D_l2eJI3.js} +22 -21
- package/dist/{Overview-DVoXXZ16.js → Overview-1AYfTeMD.js} +20 -20
- package/dist/{Overview-4QRkldza.js → Overview-BOZBnorP.js} +145 -144
- package/dist/{Point-BJmebaL9.js → Point-Cqy4XzeG.js} +22 -21
- package/dist/{Promotion-DWZZBofu.js → Promotion-9RDNbCgB.js} +137 -131
- package/dist/{Queue-DLdsyhCT.js → Queue-D2Eie_np.js} +45 -45
- package/dist/{Record-QOD3XELf.js → Record-e4B--FD8.js} +9 -9
- package/dist/{Review-CKmhyuqj.js → Review-DcUpSvc-.js} +2 -2
- package/dist/ReviewFacebookCallback-BhHdYb4X.js +225 -0
- package/dist/{ReviewGoogleCallback-CDriVQPZ.js → ReviewGoogleCallback-JPkamgo2.js} +5 -5
- package/dist/Reward-BQJw-R8V.js +444 -0
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-ZgYX2QwC.js → RewardGroup.vue_vue_type_script_setup_true_lang-D_DSQ8q2.js} +13 -13
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DfWjXTx3.js +1923 -0
- package/dist/{Segment-URdB0lnl.js → Segment-Cjdqsqqg.js} +303 -306
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmI2LAsz.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-g-CJUZBF.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCEgZzA4.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-lbH0b170.js} +4 -4
- package/dist/{Setting-BDIHH2Wk.js → Setting-B3HK4mtx.js} +159 -148
- package/dist/{SettingAdvertisements-CkJYZnIN.js → SettingAdvertisements-BQFJpdIm.js} +12 -12
- package/dist/Settings-DKWkiRuA.js +286 -0
- package/dist/{Store-CV0kYncl.js → Store-mp1LyXwr.js} +28 -28
- package/dist/{StoreRewards-30kSkAZ_.js → StoreRewards-DiSB6d7_.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAYKqf-Y.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-be7ksTJw.js +7007 -0
- package/dist/{Tier-DiQSC3iv.js → Tier-CxaXh96q.js} +2575 -687
- package/dist/{Title-DixxpjAg.js → Title-Byz0TGpi.js} +95 -94
- package/dist/{Transaction-DQK4LUGD.js → Transaction-CNXulI3o.js} +2 -2
- package/dist/Upselling-Dto64bmE.js +1013 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CL-GKkuD.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C0bfVZf8.js} +26 -26
- package/dist/{Voucher-CSVlk_Hr.js → Voucher-CVw3E8Y4.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CiSoy0Ky.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C0d3ktXA.js} +12 -12
- package/dist/{WhatsappAccount-CQYbv2Ew.js → WhatsappAccount-5vLzjaIV.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DjgRo9iA.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CwGBRX-Q.js} +1 -1
- package/dist/{WhatsappBot-DdO9Bfvh.js → WhatsappBot-BWJbD7Gk.js} +6 -6
- package/dist/{WhatsappBotLogs-CjjWJGND.js → WhatsappBotLogs-C8gpmZyC.js} +6 -6
- package/dist/{WhatsappBotSettings-DYGx-kRr.js → WhatsappBotSettings-BvPnKHz-.js} +4 -4
- package/dist/WhatsappLayout-DJXhXeXf.js +21 -0
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DTUytfe5.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BxUYjrWQ.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DdCUr_Zm.js → ZodTextField.vue_vue_type_script_setup_true_lang-CkjzVKif.js} +2 -2
- package/dist/{app-CqQeNnGq.js → app-BF1vds2J.js} +11496 -10741
- package/dist/app.js +4 -3
- package/dist/{base.export-Dls5LQeu.js → base.export-B7FU8J4P.js} +2 -2
- package/dist/{business-gvLSQklz.js → business-DkUMhys1.js} +1 -1
- package/dist/{campaign-Cd6GmA4U.js → campaign-0AgQP43B.js} +34 -28
- package/dist/{campaign-BqazvOUj.js → campaign-C9cVkGMF.js} +121 -94
- package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-Dx-Zo68Q.js} +2 -1
- package/dist/campaign.fn-N6rJeDUx.js +776 -0
- package/dist/{collection.fn-CERMsFPh.js → collection.fn-B_QnW0e3.js} +2 -2
- package/dist/{currency-IkiKiNg1.js → currency-XQmondpC.js} +1 -1
- package/dist/duplicateCampaign-CvQRWP-Z.js +51 -0
- package/dist/{effect-j_T62HBN.js → effect-Mwn1x6qN.js} +1 -1
- package/dist/{email-addresses-CN1kPlEj.js → email-addresses-DQQAi6-l.js} +2 -2
- package/dist/{feature-flag-DDfyOLsv.js → feature-flag-B1VMMZMd.js} +144 -144
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-DVUe13eh.js → helper-D1R8vyjc.js} +1 -1
- package/dist/{index-fNYUguDQ.js → index-BU6CU5MP.js} +389 -232
- package/dist/{index-DALsfLV7.js → index-Bm43wR8L.js} +2699 -2613
- package/dist/{index-jS16KX9p.js → index-Bym-ZIcv.js} +1 -1
- package/dist/{index-BvoOJdfc.js → index-C9Nbb7wc.js} +2 -2
- package/dist/{index-UJHdDEG1.js → index-CLlGMbnP.js} +1 -1
- package/dist/{index-BvkqHehI.js → index-CPB7j8Wn.js} +10 -10
- package/dist/{index-COuLtOaw.js → index-CRAuAyO3.js} +1 -1
- package/dist/{index-k7FFxt_M.js → index-Cg8Z5eYT.js} +2 -2
- package/dist/{index-CPyK4a5J.js → index-CzE9ZPDV.js} +4 -4
- package/dist/{index-Cjy0SXCn.js → index-D5BwAYuA.js} +197 -197
- package/dist/{index-ep_Kxxid.js → index-DMfCzjiA.js} +2 -2
- package/dist/{index-DMiaWY0s.js → index-DQnCdGWe.js} +682 -581
- package/dist/{index-D_1pnadB.js → index-DaUhJ6xV.js} +29 -15
- package/dist/{index-9RBtEPPj.js → index-P8DDRVa3.js} +1 -1
- package/dist/{index-C_SaKemI.js → index-Rs75lw-x.js} +1 -1
- package/dist/{index-C-IajuP1.js → index-ZYrey0SM.js} +10 -10
- package/dist/{index-CWGbeg5X.js → index-eR9mqPPV.js} +19 -6
- package/dist/{index-BmIfGArh.js → index-mOGrVzUV.js} +3 -3
- package/dist/{index-lzQ6ehOk.js → index-ug7pxPAX.js} +608 -251
- package/dist/{index-DzbVgUEP.js → index-ytSMcSMt.js} +1 -1
- package/dist/{index.esm2017-vJKhLfdu.js → index.esm2017-Gkctw9Mb.js} +111 -111
- package/dist/{loading-jZV2Dm--.js → loading-kUQqT44G.js} +1 -1
- package/dist/{lodash-C2pLek0l.js → lodash-B4AjV7YZ.js} +1 -1
- package/dist/{member-import-BKI7soRD.js → member-import-CwDUG5mj.js} +1 -1
- package/dist/{membership-smdlFpPr.js → membership-BI6U8-eM.js} +2 -2
- package/dist/{money-5XyTnYwW.js → money-Bum-AbB7.js} +1 -1
- package/dist/{number-DHU9qJJQ.js → number-uAoNqG-N.js} +1 -1
- package/dist/objectid-CPTCMH2h.js +145 -0
- package/dist/{onboarding-C_5pyGx-.js → onboarding-wtYzQipv.js} +36 -36
- package/dist/{onboardingSetup-Bd1V-Ipy.js → onboardingSetup-DlYM-oqd.js} +2 -2
- package/dist/{plugins-D1Ru-da5.js → plugins-BGyTPNfc.js} +3 -3
- package/dist/{reward-BqPl68Xk.js → reward-D0xtG-bp.js} +1 -1
- package/dist/{rule-WBrRXwL-.js → rule-BAA5-vRj.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-DKgW9ul3.js +188 -0
- package/dist/{timezone-O4qrCDcK.js → timezone-Bbw2OeEP.js} +1 -1
- package/dist/{transaction.fn-CY_F8Nb8.js → transaction.fn-DZdNjP_E.js} +2 -2
- package/dist/{trigger-D-vySeIB.js → trigger-BpotFb7G.js} +9 -9
- package/dist/{useMarketingMaterialActions-kA6SLHy_.js → useMarketingMaterialActions-CQ1M0N9c.js} +4 -4
- package/dist/{usePagination-AYE_RJH2.js → usePagination-qALFI_Td.js} +1 -1
- package/dist/{user-DJcMkYXP.js → user-X_94TRIK.js} +1 -1
- package/dist/vue-i18n-CRFpVnMa.js +2365 -0
- package/dist/{xlsx--s3hBdDk.js → xlsx-DW48eXDT.js} +224 -224
- package/dist/{zod-IpHRbxaJ.js → zod-BAP9II5C.js} +1 -1
- package/package.json +8 -3
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJotVIKM.js +0 -3496
- package/dist/ReviewFacebookCallback-C6DlaJ_j.js +0 -238
- package/dist/Reward-DftoZfPN.js +0 -442
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DHmBwLNP.js +0 -1884
- package/dist/Settings-9gaegvYJ.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dgwyk3NA.js +0 -1265
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CDUhH6wp.js +0 -142
- package/dist/WhatsappLayout-B6k_79Kl.js +0 -21
- package/dist/campaign.fn-C0oMb1fs.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/objectid-jT5g6pGt.js +0 -145
- package/dist/rule-builder-DAlSbaWh.js +0 -102
- package/dist/template-DDquG4Xc.js +0 -236
- package/dist/vue-i18n-kXHiDb_1.js +0 -2365
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, computed as M, openBlock as l, createElementBlock as g, normalizeClass as j, createElementVNode as u, createBlock as T, unref as e, toDisplayString as h, createCommentVNode as S, createVNode as y, onMounted as B, ref as P, Fragment as $, renderList as U, resolveComponent as z, isRef as V } from "vue";
|
|
2
|
-
import { u as R } from "./vue-i18n-kXHiDb_1.js";
|
|
3
|
-
import { components as I } from "@feedmepos/ui-library";
|
|
4
|
-
import { r as L } from "./index-C-IajuP1.js";
|
|
5
|
-
import { u as A } from "./business-gvLSQklz.js";
|
|
6
|
-
import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-DSwB0Ubn.js";
|
|
7
|
-
import { R as D } from "./app-CqQeNnGq.js";
|
|
8
|
-
import { useRouter as G } from "vue-router";
|
|
9
|
-
const O = ["src"], W = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, q = {
|
|
10
|
-
key: 2,
|
|
11
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
|
|
12
|
-
}, J = /* @__PURE__ */ C({
|
|
13
|
-
__name: "FacebookPageConfig",
|
|
14
|
-
props: {
|
|
15
|
-
page: {},
|
|
16
|
-
expanded: { type: Boolean },
|
|
17
|
-
availableLocations: {}
|
|
18
|
-
},
|
|
19
|
-
emits: ["toggleExpand", "toggleLocation"],
|
|
20
|
-
setup(s, { emit: n }) {
|
|
21
|
-
const _ = s, f = n, { t: i } = R(), m = M(() => _.page.locationIds);
|
|
22
|
-
return (w, p) => (l(), g("div", {
|
|
23
|
-
class: j([
|
|
24
|
-
"rounded-lg border overflow-hidden transition-colors",
|
|
25
|
-
s.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
|
|
26
|
-
])
|
|
27
|
-
}, [
|
|
28
|
-
u("button", {
|
|
29
|
-
class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
|
|
30
|
-
onClick: p[0] || (p[0] = (c) => f("toggleExpand"))
|
|
31
|
-
}, [
|
|
32
|
-
s.page.pageProfileImageUrl ? (l(), g("img", {
|
|
33
|
-
key: 0,
|
|
34
|
-
src: s.page.pageProfileImageUrl,
|
|
35
|
-
class: "w-32 h-32 rounded-full shrink-0 object-cover"
|
|
36
|
-
}, null, 8, O)) : (l(), T(e(I).FmIcon, {
|
|
37
|
-
key: 1,
|
|
38
|
-
name: "thumb_up",
|
|
39
|
-
class: "text-fm-color-neutral-gray-400 shrink-0"
|
|
40
|
-
})),
|
|
41
|
-
u("span", W, h(s.page.pageName), 1),
|
|
42
|
-
s.page.locationIds.length > 0 ? (l(), g("span", q, h(e(i)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : S("", !0),
|
|
43
|
-
y(e(I).FmIcon, {
|
|
44
|
-
name: s.expanded ? "expand_less" : "expand_more",
|
|
45
|
-
class: "text-fm-color-neutral-gray-400 shrink-0"
|
|
46
|
-
}, null, 8, ["name"])
|
|
47
|
-
]),
|
|
48
|
-
s.expanded ? (l(), T(H, {
|
|
49
|
-
key: 0,
|
|
50
|
-
locations: s.availableLocations,
|
|
51
|
-
"selected-ids": e(m),
|
|
52
|
-
onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
|
|
53
|
-
}, null, 8, ["locations", "selected-ids"])) : S("", !0)
|
|
54
|
-
], 2));
|
|
55
|
-
}
|
|
56
|
-
}), K = { class: "flex flex-col gap-8" }, Q = /* @__PURE__ */ C({
|
|
57
|
-
__name: "FacebookPageLocationMapping",
|
|
58
|
-
props: {
|
|
59
|
-
pages: {}
|
|
60
|
-
},
|
|
61
|
-
emits: ["update:pages"],
|
|
62
|
-
setup(s, { emit: n }) {
|
|
63
|
-
const _ = s, f = A();
|
|
64
|
-
B(() => f.readLocations());
|
|
65
|
-
const i = n, m = P(null), w = M(() => {
|
|
66
|
-
const r = /* @__PURE__ */ new Set();
|
|
67
|
-
for (const v of _.pages)
|
|
68
|
-
v.locationIds.forEach((a) => r.add(a));
|
|
69
|
-
return r;
|
|
70
|
-
});
|
|
71
|
-
function p(r) {
|
|
72
|
-
const v = new Set(r.locationIds);
|
|
73
|
-
return f.locations.filter((a) => {
|
|
74
|
-
const b = a._id.toString();
|
|
75
|
-
return !w.value.has(b) || v.has(b);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function c(r, v) {
|
|
79
|
-
const a = v._id.toString(), b = _.pages.map((o) => {
|
|
80
|
-
if (o.facebookPageId !== r) return o;
|
|
81
|
-
const t = o.locationIds.includes(a);
|
|
82
|
-
return {
|
|
83
|
-
...o,
|
|
84
|
-
locationIds: t ? o.locationIds.filter((k) => k !== a) : [...o.locationIds, a]
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
i("update:pages", b);
|
|
88
|
-
}
|
|
89
|
-
function F(r) {
|
|
90
|
-
m.value = m.value === r ? null : r;
|
|
91
|
-
}
|
|
92
|
-
return (r, v) => (l(), g("div", K, [
|
|
93
|
-
(l(!0), g($, null, U(s.pages, (a) => (l(), T(J, {
|
|
94
|
-
key: a.facebookPageId,
|
|
95
|
-
page: a,
|
|
96
|
-
expanded: e(m) === a.facebookPageId,
|
|
97
|
-
"available-locations": p(a),
|
|
98
|
-
onToggleExpand: (b) => F(a.facebookPageId),
|
|
99
|
-
onToggleLocation: (b) => c(a.facebookPageId, b)
|
|
100
|
-
}, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
|
|
101
|
-
]));
|
|
102
|
-
}
|
|
103
|
-
}), X = { class: "flex flex-col min-h-full gap-16 p-24" }, Y = {
|
|
104
|
-
key: 0,
|
|
105
|
-
class: "flex flex-col items-center justify-center flex-1 gap-16"
|
|
106
|
-
}, Z = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ee = {
|
|
107
|
-
key: 1,
|
|
108
|
-
class: "flex flex-col items-center justify-center flex-1 gap-16"
|
|
109
|
-
}, oe = { class: "fm-typo-en-body-lg-600" }, te = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ne = {
|
|
110
|
-
key: 2,
|
|
111
|
-
class: "flex flex-col items-center justify-center flex-1 gap-16"
|
|
112
|
-
}, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, le = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ C({
|
|
113
|
-
__name: "ReviewFacebookCallback",
|
|
114
|
-
setup(s) {
|
|
115
|
-
const { t: n } = R(), _ = G();
|
|
116
|
-
function f() {
|
|
117
|
-
return _.replace({ name: D["$connect-REVIEW_SETTINGS"] });
|
|
118
|
-
}
|
|
119
|
-
const i = P([]), m = P(!1), w = P(!1), p = P(!1), c = P(null), F = M(
|
|
120
|
-
() => i.value.some((o) => o.locationIds.length > 0)
|
|
121
|
-
);
|
|
122
|
-
function r(o, t) {
|
|
123
|
-
const k = new Map(
|
|
124
|
-
t.map((d) => [d.facebookPageId, d])
|
|
125
|
-
);
|
|
126
|
-
return o.map((d) => {
|
|
127
|
-
var x;
|
|
128
|
-
return {
|
|
129
|
-
...d,
|
|
130
|
-
locationIds: ((x = k.get(d.facebookPageId)) == null ? void 0 : x.locationIds) ?? []
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
function v(o, t) {
|
|
135
|
-
return o instanceof Error ? o.message : t;
|
|
136
|
-
}
|
|
137
|
-
async function a() {
|
|
138
|
-
var d;
|
|
139
|
-
const o = window.location.hash;
|
|
140
|
-
if (!o) {
|
|
141
|
-
c.value = n("connect.review.noToken");
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const k = new URLSearchParams(o.slice(1)).get("access_token");
|
|
145
|
-
if (!k) {
|
|
146
|
-
c.value = n("connect.review.noToken");
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
m.value = !0;
|
|
150
|
-
try {
|
|
151
|
-
const x = await L.getSource(), N = ((d = x == null ? void 0 : x.facebook) == null ? void 0 : d.pages) ?? [], E = await L.connectFacebook(k);
|
|
152
|
-
i.value = r((E == null ? void 0 : E.pages) ?? [], N), i.value.length === 0 && (c.value = n("connect.review.facebook.noPages"));
|
|
153
|
-
} catch (x) {
|
|
154
|
-
c.value = v(x, n("connect.review.facebook.failed"));
|
|
155
|
-
} finally {
|
|
156
|
-
m.value = !1;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async function b() {
|
|
160
|
-
const o = i.value.filter((t) => t.locationIds.length > 0).map((t) => ({
|
|
161
|
-
facebookPageId: t.facebookPageId,
|
|
162
|
-
locationIds: t.locationIds
|
|
163
|
-
}));
|
|
164
|
-
if (o.length === 0) {
|
|
165
|
-
c.value = n("connect.review.noMappings");
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
w.value = !0;
|
|
169
|
-
try {
|
|
170
|
-
await L.updateFacebookPages(o), p.value = !0, setTimeout(f, 2e3);
|
|
171
|
-
} catch (t) {
|
|
172
|
-
c.value = v(t, n("connect.review.facebook.failed"));
|
|
173
|
-
} finally {
|
|
174
|
-
w.value = !1;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return B(a), (o, t) => {
|
|
178
|
-
const k = z("FmPageHead");
|
|
179
|
-
return l(), g($, null, [
|
|
180
|
-
y(k, {
|
|
181
|
-
title: e(n)("connect.navigation.review")
|
|
182
|
-
}, null, 8, ["title"]),
|
|
183
|
-
u("div", X, [
|
|
184
|
-
e(m) ? (l(), g("div", Y, [
|
|
185
|
-
y(e(I).FmIcon, {
|
|
186
|
-
name: "sync",
|
|
187
|
-
size: "xl",
|
|
188
|
-
class: "animate-spin text-fm-color-neutral-gray-400"
|
|
189
|
-
}),
|
|
190
|
-
u("p", Z, h(e(n)("connect.review.facebook.fetching")), 1)
|
|
191
|
-
])) : e(p) ? (l(), g("div", ee, [
|
|
192
|
-
y(e(I).FmIcon, {
|
|
193
|
-
name: "check_circle",
|
|
194
|
-
size: "xl",
|
|
195
|
-
class: "text-fm-color-typo-success"
|
|
196
|
-
}),
|
|
197
|
-
u("p", oe, h(e(n)("connect.review.facebook.success")), 1),
|
|
198
|
-
u("p", te, h(e(n)("connect.review.redirecting")), 1)
|
|
199
|
-
])) : e(c) ? (l(), g("div", ne, [
|
|
200
|
-
y(e(I).FmIcon, {
|
|
201
|
-
name: "error",
|
|
202
|
-
size: "xl",
|
|
203
|
-
class: "text-fm-color-system-error-500"
|
|
204
|
-
}),
|
|
205
|
-
u("p", ae, h(e(n)("connect.review.errorTitle")), 1),
|
|
206
|
-
u("p", se, h(e(c)), 1),
|
|
207
|
-
y(e(I).FmButton, {
|
|
208
|
-
label: e(n)("connect.review.goBack"),
|
|
209
|
-
onClick: t[0] || (t[0] = (d) => f())
|
|
210
|
-
}, null, 8, ["label"])
|
|
211
|
-
])) : e(i).length > 0 ? (l(), g($, { key: 3 }, [
|
|
212
|
-
u("p", ce, h(e(n)("connect.review.facebook.selectPage")), 1),
|
|
213
|
-
y(Q, {
|
|
214
|
-
pages: e(i),
|
|
215
|
-
"onUpdate:pages": t[1] || (t[1] = (d) => V(i) ? i.value = d : null)
|
|
216
|
-
}, null, 8, ["pages"]),
|
|
217
|
-
u("div", le, [
|
|
218
|
-
y(e(I).FmButton, {
|
|
219
|
-
variant: "outlined",
|
|
220
|
-
label: e(n)("connect.review.cancel"),
|
|
221
|
-
onClick: t[2] || (t[2] = (d) => f())
|
|
222
|
-
}, null, 8, ["label"]),
|
|
223
|
-
y(e(I).FmButton, {
|
|
224
|
-
label: e(n)("connect.review.connect"),
|
|
225
|
-
disabled: !e(F),
|
|
226
|
-
loading: e(w),
|
|
227
|
-
onClick: b
|
|
228
|
-
}, null, 8, ["label", "disabled", "loading"])
|
|
229
|
-
])
|
|
230
|
-
], 64)) : S("", !0)
|
|
231
|
-
])
|
|
232
|
-
], 64);
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
export {
|
|
237
|
-
ve as default
|
|
238
|
-
};
|
package/dist/Reward-DftoZfPN.js
DELETED
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as O, onMounted as q, toDisplayString as B } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as Q, components as L } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as G } from "./loading-jZV2Dm--.js";
|
|
5
|
-
import { u as J, C as ee } from "./membership-smdlFpPr.js";
|
|
6
|
-
import { f as j, p as te } from "./plugins-D1Ru-da5.js";
|
|
7
|
-
import { u as oe } from "./vue-i18n-kXHiDb_1.js";
|
|
8
|
-
import { c as ae } from "./object-BYyQ0PZp.js";
|
|
9
|
-
import { Z as F } from "./zod-IpHRbxaJ.js";
|
|
10
|
-
import "./index-DALsfLV7.js";
|
|
11
|
-
import { a as N } from "./index-BvoOJdfc.js";
|
|
12
|
-
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
13
|
-
import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CiSoy0Ky.js";
|
|
14
|
-
import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-BDZ21UHA.js";
|
|
15
|
-
import { J as K } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
-
import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DdCUr_Zm.js";
|
|
17
|
-
import { i as de } from "./helper-DVUe13eh.js";
|
|
18
|
-
import { u as pe, r as P } from "./reward-BqPl68Xk.js";
|
|
19
|
-
import "./index-jS16KX9p.js";
|
|
20
|
-
import { C as ce } from "./campaign.fn-C0oMb1fs.js";
|
|
21
|
-
import { e as me } from "./effect-j_T62HBN.js";
|
|
22
|
-
import { useRouter as ue } from "vue-router";
|
|
23
|
-
import { R as ye } from "./app-CqQeNnGq.js";
|
|
24
|
-
const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
|
|
25
|
-
__name: "EditRewardSheet",
|
|
26
|
-
emits: ["update"],
|
|
27
|
-
setup(W, { expose: n, emit: I }) {
|
|
28
|
-
const p = J(), { minor: C } = G, v = x(!1), a = x({}), y = x(), R = H(() => {
|
|
29
|
-
var l;
|
|
30
|
-
return ((l = a.value.option) == null ? void 0 : l.collectibleType) === "CREDIT" ? N.superRefine((e, o) => {
|
|
31
|
-
var i, m, g, r;
|
|
32
|
-
!((m = (i = e.option) == null ? void 0 : i.validityOption) != null && m.validForDay) && !((r = (g = e.option) == null ? void 0 : g.validityOption) != null && r.validBefore) && o.addIssue({
|
|
33
|
-
code: "custom",
|
|
34
|
-
path: [],
|
|
35
|
-
message: "Credit validity must be set"
|
|
36
|
-
});
|
|
37
|
-
}) : N;
|
|
38
|
-
}), u = H(() => {
|
|
39
|
-
const l = R.value.safeParse(a.value);
|
|
40
|
-
return l.success ? [] : l.error.errors;
|
|
41
|
-
});
|
|
42
|
-
function _(l, e) {
|
|
43
|
-
l && (y.value = void 0, a.value = e), v.value = l;
|
|
44
|
-
}
|
|
45
|
-
const D = I;
|
|
46
|
-
async function S() {
|
|
47
|
-
const l = R.value.safeParse(a.value);
|
|
48
|
-
!l.success || !l.data || (await C(
|
|
49
|
-
async () => {
|
|
50
|
-
var e;
|
|
51
|
-
l.data.option.type === "VOUCHER" && y.value && (l.data.option.collectibleConfig.image = await j.update(
|
|
52
|
-
((e = l.data.option.collectibleConfig) == null ? void 0 : e.image) || j.collectibleImagePath(void 0, y.value),
|
|
53
|
-
y.value
|
|
54
|
-
));
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
message: "Uploading reward image",
|
|
58
|
-
successMessage: "Reward image updated"
|
|
59
|
-
}
|
|
60
|
-
), D("update", l.data));
|
|
61
|
-
}
|
|
62
|
-
function T(l) {
|
|
63
|
-
l === "VOUCHER" ? a.value.option = {
|
|
64
|
-
collectible: null,
|
|
65
|
-
type: "VOUCHER",
|
|
66
|
-
collectibleConfig: de("VOUCHER", {
|
|
67
|
-
business: le().currentBusiness.value._id
|
|
68
|
-
}),
|
|
69
|
-
earningOption: {
|
|
70
|
-
amount: 1,
|
|
71
|
-
type: "FIXED"
|
|
72
|
-
},
|
|
73
|
-
validityOption: {
|
|
74
|
-
validForDay: 7
|
|
75
|
-
}
|
|
76
|
-
} : a.value.option = {
|
|
77
|
-
collectible: p.loyaltyRewards.raw[0]._id,
|
|
78
|
-
collectibleType: p.loyaltyRewards.raw[0].type,
|
|
79
|
-
type: "LOYALTY",
|
|
80
|
-
earningOption: {
|
|
81
|
-
amount: 1,
|
|
82
|
-
type: "FIXED"
|
|
83
|
-
},
|
|
84
|
-
validityOption: {
|
|
85
|
-
validForDay: 7
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function $(l) {
|
|
90
|
-
a.value.option.collectible = l, a.value.option.collectibleType = p.loyaltyRewards.raw.find(
|
|
91
|
-
(e) => e._id === l
|
|
92
|
-
).type;
|
|
93
|
-
}
|
|
94
|
-
const V = x();
|
|
95
|
-
return n({
|
|
96
|
-
showSheet: _
|
|
97
|
-
}), (l, e) => {
|
|
98
|
-
const o = w("FmSelect"), i = w("FmForm"), m = w("FmButton"), g = w("FmSideSheet");
|
|
99
|
-
return b(), h(g, {
|
|
100
|
-
"max-width": 560,
|
|
101
|
-
modelValue: t(v),
|
|
102
|
-
"onUpdate:modelValue": [
|
|
103
|
-
e[8] || (e[8] = (r) => Z(v) ? v.value = r : null),
|
|
104
|
-
e[9] || (e[9] = (r) => v.value = r)
|
|
105
|
-
],
|
|
106
|
-
header: "Edit reward"
|
|
107
|
-
}, {
|
|
108
|
-
"side-sheet-footer": A(() => [
|
|
109
|
-
f("div", fe, [
|
|
110
|
-
d(m, {
|
|
111
|
-
variant: "primary",
|
|
112
|
-
type: "button",
|
|
113
|
-
label: "Confirm",
|
|
114
|
-
disabled: t(u).length > 0,
|
|
115
|
-
onClick: e[6] || (e[6] = (r) => S())
|
|
116
|
-
}, null, 8, ["disabled"]),
|
|
117
|
-
d(m, {
|
|
118
|
-
variant: "secondary",
|
|
119
|
-
type: "button",
|
|
120
|
-
label: "Cancel",
|
|
121
|
-
onClick: e[7] || (e[7] = (r) => v.value = !1)
|
|
122
|
-
})
|
|
123
|
-
])
|
|
124
|
-
]),
|
|
125
|
-
default: A(() => [
|
|
126
|
-
d(K, { json: t(a) }, null, 8, ["json"]),
|
|
127
|
-
d(i, {
|
|
128
|
-
class: "flex flex-col gap-y-24",
|
|
129
|
-
ref_key: "formRef",
|
|
130
|
-
ref: V,
|
|
131
|
-
onValidationSuccess: e[5] || (e[5] = (r) => S())
|
|
132
|
-
}, {
|
|
133
|
-
default: A(() => {
|
|
134
|
-
var r, E, c;
|
|
135
|
-
return [
|
|
136
|
-
d(se, {
|
|
137
|
-
modelValue: t(a).name,
|
|
138
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
|
|
139
|
-
label: "Reward Name",
|
|
140
|
-
schema: t(F).typeAtPath(t(R), "name", []),
|
|
141
|
-
"error-text": t(F).helperText(t(u), "name")
|
|
142
|
-
}, null, 8, ["modelValue", "schema", "error-text"]),
|
|
143
|
-
d(o, {
|
|
144
|
-
label: "Reward Type",
|
|
145
|
-
disabled: !!t(a)._id,
|
|
146
|
-
items: [
|
|
147
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
148
|
-
{ label: "Loyalty", value: "LOYALTY" }
|
|
149
|
-
],
|
|
150
|
-
"model-value": t(a).option.type,
|
|
151
|
-
"onUpdate:modelValue": T
|
|
152
|
-
}, null, 8, ["disabled", "model-value"]),
|
|
153
|
-
t(a).option.type == "LOYALTY" ? (b(), h(o, {
|
|
154
|
-
key: 0,
|
|
155
|
-
label: "Loyalty type",
|
|
156
|
-
items: t(p).loyaltyRewards.items,
|
|
157
|
-
"model-value": t(a).option.collectible,
|
|
158
|
-
"onUpdate:modelValue": $
|
|
159
|
-
}, null, 8, ["items", "model-value"])) : k("", !0),
|
|
160
|
-
t(a).option.type === "LOYALTY" ? (b(), M(Y, { key: 1 }, [
|
|
161
|
-
e[10] || (e[10] = f("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
162
|
-
((r = t(p).loyaltyRewards.items.find(
|
|
163
|
-
(s) => {
|
|
164
|
-
var U;
|
|
165
|
-
return s.value === ((U = t(a)) == null ? void 0 : U.option.collectible);
|
|
166
|
-
}
|
|
167
|
-
)) == null ? void 0 : r.raw.type) !== "TITLE" ? (b(), h(ne, {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: "mt-[-8px]",
|
|
170
|
-
rules: [
|
|
171
|
-
t(F).ruleAtPath(t(R), "option.earningOption", [
|
|
172
|
-
t(a).option.type
|
|
173
|
-
])
|
|
174
|
-
],
|
|
175
|
-
"helper-state": t(F).helperState(t(u), "option.earningOption"),
|
|
176
|
-
"error-text": t(F).helperText(t(u), "option.earningOption"),
|
|
177
|
-
"fixed-type": !0,
|
|
178
|
-
"model-value": t(a).option.earningOption,
|
|
179
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
|
|
180
|
-
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : k("", !0),
|
|
181
|
-
d(re, {
|
|
182
|
-
class: "!gap-24",
|
|
183
|
-
"for-credit": t(a).option.type === "LOYALTY" && ((E = t(p).loyaltyRewards.items.find(
|
|
184
|
-
(s) => {
|
|
185
|
-
var U;
|
|
186
|
-
return s.value === ((U = t(a).option) == null ? void 0 : U.collectible);
|
|
187
|
-
}
|
|
188
|
-
)) == null ? void 0 : E.raw.type) === "CREDIT",
|
|
189
|
-
type: t(a).option.type === "VOUCHER" ? "range" : "custom",
|
|
190
|
-
rules: [
|
|
191
|
-
t(F).ruleAtPath(t(R), "option.validityOption", [
|
|
192
|
-
t(a).option.type
|
|
193
|
-
])
|
|
194
|
-
],
|
|
195
|
-
"model-value": t(a).option.validityOption,
|
|
196
|
-
"onUpdate:modelValue": e[2] || (e[2] = (s) => t(a).option.validityOption = s)
|
|
197
|
-
}, null, 8, ["for-credit", "type", "rules", "model-value"])
|
|
198
|
-
], 64)) : k("", !0),
|
|
199
|
-
t(a).option.type === "VOUCHER" ? (b(), h(ie, {
|
|
200
|
-
key: 2,
|
|
201
|
-
"reward-image": t(y),
|
|
202
|
-
"model-value": ((c = t(a)) == null ? void 0 : c.option.collectibleConfig) ?? void 0,
|
|
203
|
-
"onUpdate:modelValue": e[3] || (e[3] = (s) => t(a).option.collectibleConfig = s),
|
|
204
|
-
"onUpdate:rewardImage": e[4] || (e[4] = (s) => y.value = s)
|
|
205
|
-
}, null, 8, ["reward-image", "model-value"])) : k("", !0),
|
|
206
|
-
d(K, { json: t(u) }, null, 8, ["json"])
|
|
207
|
-
];
|
|
208
|
-
}),
|
|
209
|
-
_: 1
|
|
210
|
-
}, 512)
|
|
211
|
-
]),
|
|
212
|
-
_: 1
|
|
213
|
-
}, 8, ["modelValue"]);
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}), ve = { class: "px-24 flex flex-col gap-y-16" }, ge = { class: "flex items-center justify-between w-full" }, be = { class: "flex flex-col gap-16 text-center" }, Re = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ X({
|
|
217
|
-
__name: "Reward",
|
|
218
|
-
setup(W) {
|
|
219
|
-
const { t: n } = oe(), I = {
|
|
220
|
-
label: n("connect.storeRewards.create"),
|
|
221
|
-
value: "create",
|
|
222
|
-
isPrimary: !0,
|
|
223
|
-
prependIcon: "add"
|
|
224
|
-
}, p = J(), C = pe(), { global: v, minor: a } = G, y = ue(), R = Q(), u = x({
|
|
225
|
-
searchKey: "",
|
|
226
|
-
columnFilters: []
|
|
227
|
-
}), _ = H(() => C.rewards);
|
|
228
|
-
function D(e) {
|
|
229
|
-
y.push({
|
|
230
|
-
name: ye["$connect-STORE_REWARD_COLLECTIONS"],
|
|
231
|
-
params: { id: e }
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
const S = [
|
|
235
|
-
{
|
|
236
|
-
header: n("connect.storeRewards.table.name"),
|
|
237
|
-
accessorFn: (e) => e.name
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
header: n("connect.storeRewards.table.type"),
|
|
241
|
-
cell(e) {
|
|
242
|
-
return e.row.original.collectibleConfig ? ee[e.row.original.collectibleConfig.type].chip() : "N/A";
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
header: n("connect.storeRewards.table.summary"),
|
|
247
|
-
accessorFn: (e) => {
|
|
248
|
-
var o, i;
|
|
249
|
-
if (e.option.type === "VOUCHER")
|
|
250
|
-
return me((i = (o = e.option.collectibleConfig) == null ? void 0 : o.extras) == null ? void 0 : i.effect);
|
|
251
|
-
if (e.option.collectibleType == "TITLE") {
|
|
252
|
-
const m = p.sortedTitles.find(
|
|
253
|
-
(g) => g._id == e.option.collectible
|
|
254
|
-
);
|
|
255
|
-
return `Get ${m == null ? void 0 : m.name} valid for ${e.option.validityOption.validForDay} days`;
|
|
256
|
-
}
|
|
257
|
-
return `Get ${e.option.earningOption.amount} ${ce.formattedType(e.option.collectibleType)}`;
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
header: n("connect.storeRewards.table.actions"),
|
|
262
|
-
cell(e) {
|
|
263
|
-
return O("div", { class: "flex items-center justify-end gap-4" }, [
|
|
264
|
-
O(
|
|
265
|
-
L.FmMenu,
|
|
266
|
-
{
|
|
267
|
-
placement: "bottom-end",
|
|
268
|
-
onClick: (o) => {
|
|
269
|
-
o.stopPropagation();
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"menu-button": () => O(L.FmButton, {
|
|
274
|
-
icon: "more_vert",
|
|
275
|
-
iconColor: "neutral-gray-400",
|
|
276
|
-
variant: "tertiary"
|
|
277
|
-
}),
|
|
278
|
-
default: () => [
|
|
279
|
-
e.row.original.option.type === "VOUCHER" && O(L.FmMenuItem, {
|
|
280
|
-
label: "View collections",
|
|
281
|
-
onClick: async (o) => {
|
|
282
|
-
o.stopPropagation(), D(
|
|
283
|
-
e.row.original.option.collectible
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}),
|
|
287
|
-
O(
|
|
288
|
-
L.FmMenuItem,
|
|
289
|
-
{
|
|
290
|
-
onClick: async (o) => {
|
|
291
|
-
o.stopPropagation(), $(e.row.original);
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
label: O(
|
|
296
|
-
"div",
|
|
297
|
-
{
|
|
298
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
299
|
-
},
|
|
300
|
-
"Delete"
|
|
301
|
-
)
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
]
|
|
305
|
-
}
|
|
306
|
-
)
|
|
307
|
-
]);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
], T = x();
|
|
311
|
-
async function $(e) {
|
|
312
|
-
await te.remove(
|
|
313
|
-
n("connect.storeRewards.delete.confirm"),
|
|
314
|
-
n("connect.storeRewards.delete.title")
|
|
315
|
-
) && await a(
|
|
316
|
-
async () => {
|
|
317
|
-
await P.deleteReward(e._id), await C.readRewards();
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
message: n("connect.storeRewards.delete.message"),
|
|
321
|
-
successMessage: n("connect.storeRewards.delete.success")
|
|
322
|
-
}
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
async function V(e) {
|
|
326
|
-
var o;
|
|
327
|
-
e || (e = {
|
|
328
|
-
name: "",
|
|
329
|
-
option: {
|
|
330
|
-
type: "LOYALTY",
|
|
331
|
-
collectible: p.loyaltyRewards.items[0].value,
|
|
332
|
-
collectibleType: p.loyaltyRewards.items[0].raw.type,
|
|
333
|
-
validityOption: {
|
|
334
|
-
validForDay: 7
|
|
335
|
-
},
|
|
336
|
-
earningOption: {
|
|
337
|
-
type: "FIXED",
|
|
338
|
-
amount: 1
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}), (o = T.value) == null || o.showSheet(!0, ae(e));
|
|
342
|
-
}
|
|
343
|
-
async function l(e) {
|
|
344
|
-
let o = !1;
|
|
345
|
-
e._id && e.option.type === "VOUCHER" && await new Promise((i) => {
|
|
346
|
-
R.open({
|
|
347
|
-
title: "Confirmation",
|
|
348
|
-
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
349
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
350
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
351
|
-
}).onPrimary(async () => {
|
|
352
|
-
o = !0, i();
|
|
353
|
-
}).onSecondary(async () => {
|
|
354
|
-
i();
|
|
355
|
-
});
|
|
356
|
-
}), await a(
|
|
357
|
-
async () => {
|
|
358
|
-
var i;
|
|
359
|
-
e.collectibleConfig = void 0, e._id ? await P.updateReward(e._id, {
|
|
360
|
-
...e,
|
|
361
|
-
updateCollection: o
|
|
362
|
-
}) : await P.createReward(e), await C.readRewards(), (i = T.value) == null || i.showSheet(!1);
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
message: "Updating reward",
|
|
366
|
-
successMessage: "Reward updated successfully"
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
return q(async () => {
|
|
371
|
-
await v(async () => {
|
|
372
|
-
await p.readMembership(), await p.readRewards(), await C.readRewards();
|
|
373
|
-
});
|
|
374
|
-
}), (e, o) => {
|
|
375
|
-
const i = w("FmPageHead"), m = w("FmSearch"), g = w("FmTable"), r = w("FmButton"), E = w("FmCard");
|
|
376
|
-
return b(), M(Y, null, [
|
|
377
|
-
d(i, {
|
|
378
|
-
title: t(n)("connect.reward.title"),
|
|
379
|
-
actions: [I],
|
|
380
|
-
"back-button": !0,
|
|
381
|
-
"onClick:action": o[0] || (o[0] = () => V()),
|
|
382
|
-
"onClick:back": o[1] || (o[1] = () => {
|
|
383
|
-
var c;
|
|
384
|
-
return (c = t(y)) == null ? void 0 : c.back();
|
|
385
|
-
})
|
|
386
|
-
}, null, 8, ["title", "actions"]),
|
|
387
|
-
f("div", ve, [
|
|
388
|
-
t(_) && t(_).length > 0 ? (b(), M(Y, { key: 0 }, [
|
|
389
|
-
f("div", ge, [
|
|
390
|
-
o[6] || (o[6] = f("div", { class: "flex gap-8" }, null, -1)),
|
|
391
|
-
d(m, {
|
|
392
|
-
modelValue: t(u).searchKey,
|
|
393
|
-
"onUpdate:modelValue": o[2] || (o[2] = (c) => t(u).searchKey = c),
|
|
394
|
-
class: "",
|
|
395
|
-
placeholder: "search",
|
|
396
|
-
collapsible: ""
|
|
397
|
-
}, null, 8, ["modelValue"])
|
|
398
|
-
]),
|
|
399
|
-
d(g, {
|
|
400
|
-
"row-data": t(_),
|
|
401
|
-
"column-defs": S,
|
|
402
|
-
"search-value": t(u).searchKey,
|
|
403
|
-
"column-filter": t(u).columnFilters,
|
|
404
|
-
onRowClick: o[3] || (o[3] = (c) => V(c.original)),
|
|
405
|
-
"hide-footer": t(_).length < 10
|
|
406
|
-
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
407
|
-
], 64)) : (b(), h(E, {
|
|
408
|
-
key: 1,
|
|
409
|
-
variant: "outlined",
|
|
410
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
411
|
-
}, {
|
|
412
|
-
default: A(() => [
|
|
413
|
-
o[7] || (o[7] = f("img", {
|
|
414
|
-
src: z,
|
|
415
|
-
class: "aspect-square w-[150px]"
|
|
416
|
-
}, null, -1)),
|
|
417
|
-
f("div", be, [
|
|
418
|
-
f("div", Re, B(t(n)("connect.storeRewards.empty.title")), 1),
|
|
419
|
-
f("div", Ce, B(t(n)("connect.storeRewards.empty.description")), 1)
|
|
420
|
-
]),
|
|
421
|
-
d(r, {
|
|
422
|
-
variant: "primary",
|
|
423
|
-
label: t(n)("connect.storeRewards.empty.action"),
|
|
424
|
-
onClick: o[4] || (o[4] = (c) => V()),
|
|
425
|
-
icon: "add"
|
|
426
|
-
}, null, 8, ["label"])
|
|
427
|
-
]),
|
|
428
|
-
_: 1
|
|
429
|
-
})),
|
|
430
|
-
d(we, {
|
|
431
|
-
ref_key: "rewardSheetRef",
|
|
432
|
-
ref: T,
|
|
433
|
-
onUpdate: o[5] || (o[5] = (c) => l(c))
|
|
434
|
-
}, null, 512)
|
|
435
|
-
])
|
|
436
|
-
], 64);
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
export {
|
|
441
|
-
Ke as default
|
|
442
|
-
};
|