@feedmepos/mf-connect 0.1.113-prod → 0.1.114-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 +66 -1
- package/dist/{App-2J4yDonr.js → App-CIWTDYuZ.js} +700 -654
- package/dist/AuditLogs-BluLDXu9.js +2016 -0
- package/dist/{Bin-BU_hVuxJ.js → Bin-jS6pM4L3.js} +8 -8
- package/dist/Broadcast-DBqsSZ0S.js +306 -0
- package/dist/{CampaignAnalytic-DUUmFMvy.js → CampaignAnalytic-DJrjXD4H.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BZirReIy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js} +9 -9
- package/dist/{Card-DS2K_LFv.js → Card-B10nLilL.js} +25 -24
- package/dist/{Collections-BFdRdPHR.js → Collections-BN42A73p.js} +197 -185
- package/dist/{Credit-CODfiox3.js → Credit-0SS26HGE.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B2T5G1hZ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-KvZebiOu.js → EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js} +32 -32
- package/dist/{Experience-BGBWc8Ep.js → Experience-D7qPzsrc.js} +32 -31
- package/dist/{FileSaver.min-DJAN3Eu0.js → FileSaver.min-BKWoklMK.js} +1 -1
- package/dist/{Game-6yyn0uAd.js → Game-BoYMwfog.js} +19 -18
- package/dist/{GiftCardSetup-B096bTm0.js → GiftCardSetup-B87O0xzo.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ChvUXdF-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js} +7 -7
- package/dist/{Goals-Db2mwbRo.js → Goals-CVxf3xCA.js} +4 -4
- package/dist/Grab-mGL1Mue_.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-xdEzwMcS.js → ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js} +1 -1
- package/dist/{Index-580WNkG2.js → Index-Dptuy-6c.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BkAQXKNJ.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CR6sSnx4.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js} +1 -1
- package/dist/{LoyaltyDashboard-Clr2aiUP.js → LoyaltyDashboard-BxhI6RAE.js} +15 -15
- package/dist/MainLayout-YfDxvZXl.js +4 -0
- package/dist/{MainLayout-_iCyT5mw.js → MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js} +5 -4
- package/dist/{Marketing-fq1wxANq.js → Marketing-C2cVJacf.js} +4 -4
- package/dist/MarketingMaterialEdit-DkOEy_L-.js +1037 -0
- package/dist/{Member-BfRy196y.js → Member-DufbKDOh.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BAR44Qcp.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js} +43 -50
- package/dist/{MemberImportHistory-C4622Ivs.js → MemberImportHistory-DlFN-uQl.js} +7 -7
- package/dist/{MemberList-DqtsMN_N.js → MemberList-B344n8I4.js} +103 -105
- package/dist/{MemberTransactions-DsUoFg3z.js → MemberTransactions-BS7H640M.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CzFMUgXM.js → MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js} +4228 -4176
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CVQYcuQ6.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js} +1 -1
- package/dist/{Mission-B0GO4LiM.js → Mission-D2ed_oKn.js} +22 -21
- package/dist/{Overview-XpJJmHqs.js → Overview-CLh_T6YY.js} +145 -144
- package/dist/{Overview-CVITimwN.js → Overview-DJa-hXDC.js} +23 -22
- package/dist/{Point-B7aCrMkI.js → Point-DAPeg1VD.js} +22 -21
- package/dist/{Promotion-DfVcuXHy.js → Promotion-CPPCMMFl.js} +137 -131
- package/dist/{Queue-BT7O2cvj.js → Queue-BcPwCRcM.js} +47 -46
- package/dist/{Record-CAc030dz.js → Record-C5XKn--g.js} +9 -9
- package/dist/{Review-CyXo4GTY.js → Review-Cc51luIv.js} +2 -2
- package/dist/ReviewFacebookCallback-BSGInFB8.js +225 -0
- package/dist/{ReviewGoogleCallback-BxiFOl0B.js → ReviewGoogleCallback-C1gY4vcP.js} +5 -5
- package/dist/{Reward-ChfNtdwX.js → Reward-k1R3hLiF.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CpQu_QBQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js +1923 -0
- package/dist/{Segment-H2zBDZeh.js → Segment-DsBnIvje.js} +290 -291
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0jCJ-Xq.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DW_ViNZM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js} +4 -4
- package/dist/Setting-BRueNgc4.js +574 -0
- package/dist/{SettingAdvertisements-DPQHP3-B.js → SettingAdvertisements-BrVcQyhF.js} +12 -12
- package/dist/Settings-fOvXd29Z.js +286 -0
- package/dist/{Store-B2f5HVQc.js → Store-rrh2pIHH.js} +661 -654
- package/dist/{StoreRewards-QxfaEt9f.js → StoreRewards-D-jivVKr.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js +7007 -0
- package/dist/{Tier-BSk4rBm8.js → Tier-DJiLtw3M.js} +2576 -687
- package/dist/{Title-CIzpB8TT.js → Title-s0bzA7yZ.js} +94 -92
- package/dist/{Transaction-BjxxNEHa.js → Transaction-CQ-CJ_eh.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BMutYxOU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js} +26 -26
- package/dist/{Voucher-B2lFq21Y.js → Voucher-9vydRET7.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BWV631It.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js} +16 -16
- package/dist/WhatsappAccount-D12Hvzfl.js +159 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js +39 -0
- package/dist/WhatsappBot-o5b_0CnB.js +629 -0
- package/dist/WhatsappBotLogs-CK_V_iT5.js +372 -0
- package/dist/WhatsappBotSettings-BooibLUg.js +694 -0
- package/dist/WhatsappLayout-bOyNHGUI.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js +253 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCoB0Fsa.js → ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js} +2 -2
- package/dist/{app-DgFVWdhA.js → app-DV3e2LkD.js} +10610 -8223
- package/dist/app.js +4 -3
- package/dist/{base.export-B6Rojjek.js → base.export-DQUUtGmy.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-C6ID0exl.js → business-BZ0boE-5.js} +1 -1
- package/dist/campaign-CsfFq2S-.js +400 -0
- package/dist/{campaign-BgSJXWdU.js → campaign-DMrtYWcs.js} +31 -25
- package/dist/{campaign.enum-CVvm0LMm.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/campaign.fn-C-CdNNdR.js +776 -0
- package/dist/{collectible.enum-DGQVW464.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-dV4F8R-j.js → collection.fn-C-rryKSc.js} +2 -2
- package/dist/{currency-DlHi_3WN.js → currency-BOd9iVZV.js} +1 -1
- package/dist/duplicateCampaign-ey_rW0Bz.js +51 -0
- package/dist/{effect-BJgmiWY4.js → effect-BP6Hkxmj.js} +1 -1
- package/dist/{email-addresses-3GTx_xTh.js → email-addresses-CO61QAq0.js} +2 -2
- package/dist/feature-flag-Bq1SgbYC.js +868 -0
- package/dist/feature-flag-lvPP0ED-.js +50 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-BX0JQP06.js → helper-BRpts-M-.js} +1 -1
- package/dist/{index-BIpAzktM.js → index-03WIXl-H.js} +8 -7
- package/dist/{index-BeCKw7Y3.js → index-B0RavybO.js} +19 -6
- package/dist/{index-DeNbsrQx.js → index-BDNkoALK.js} +1 -1
- package/dist/{index-Bl5aHABH.js → index-BV5aPSYo.js} +11 -10
- package/dist/{index-Cnw0B8Lc.js → index-Bk20uvPY.js} +1 -1
- package/dist/index-Bn19rfby.js +14571 -0
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-nmw7_9ZE.js → index-Cj-eugzc.js} +1 -1
- package/dist/{index-uXgPJlic.js → index-CoROn5OA.js} +2700 -2613
- package/dist/{index-DdMVrWZy.js → index-CrBhcMaL.js} +8028 -10767
- package/dist/{index-2xed2K8D.js → index-CsBjAM3E.js} +4 -3
- package/dist/{index-CiFReW-F.js → index-D1t4_KaG.js} +1 -1
- package/dist/{index-DRNdJ_KC.js → index-D3wGTCWf.js} +8 -7
- package/dist/{index-CtBLnWVG.js → index-D41kjcrZ.js} +683 -581
- package/dist/{index-CNULhBPM.js → index-DIZLkVe0.js} +691 -230
- package/dist/{index-QaWLGgEC.js → index-DucKyzrD.js} +2 -2
- package/dist/{index-o2OQljHs.js → index-R5WS21OL.js} +4 -4
- package/dist/index-RwNlbTO8.js +115 -0
- package/dist/{index-R0qlOO6J.js → index-VYI0zWNC.js} +29 -15
- package/dist/index-ZRE89TKq.js +80 -0
- package/dist/{index-BHT6cvWA.js → index-_Cj-bsd_.js} +396 -232
- package/dist/{index-Y2Pu1YkB.js → index-mToWKHVs.js} +2 -2
- package/dist/{index.esm2017-Dum0onrS.js → index.esm2017-B_Sag8Pg.js} +209 -209
- package/dist/{loading-B2mSdkfy.js → loading-C5fVI0ry.js} +1 -1
- package/dist/{lodash-DtOypaKt.js → lodash-COo8_xCU.js} +1 -1
- package/dist/{member-import-C2pLnh44.js → member-import-I_pKwUfF.js} +6 -5
- package/dist/{membership-BWyBGF4n.js → membership-BgfH9Kva.js} +3 -3
- package/dist/{money-3lCCVCeP.js → money-Cr07YDlV.js} +1 -1
- package/dist/{number-zlqy2MLG.js → number-DFsj0dkh.js} +1 -1
- package/dist/objectid-Cu89BzwI.js +145 -0
- package/dist/{onboarding-BqD3B4M1.js → onboarding-DlkJCm-5.js} +25 -25
- package/dist/{onboardingSetup-CCQ90jg7.js → onboardingSetup-BEhVj613.js} +2 -2
- package/dist/{plugins-Bj3npYnL.js → plugins-CPTtiKqf.js} +3 -3
- package/dist/{MarketingMaterialEdit-0h7E0n5e.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-5dDuZEb7.js → reward-DqY0mQ_5.js} +1 -1
- package/dist/{rule-NqLeSyoO.js → rule-mJJ48eKw.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-C1QftpDG.js +188 -0
- package/dist/{timezone-B0lkgvh-.js → timezone-BBgBHels.js} +1 -1
- package/dist/{transaction.fn-CACuVUBe.js → transaction.fn-Sr0hj3kY.js} +2 -2
- package/dist/{trigger-BKJwKTJx.js → trigger-PUP0mwKM.js} +8 -8
- package/dist/{useMarketingMaterialActions-DERvOmen.js → useMarketingMaterialActions-faslwaHd.js} +3 -3
- package/dist/{usePagination-FkjroUq2.js → usePagination-Be6nIQ9y.js} +1 -1
- package/dist/{user-H9MnsLbu.js → user-DBSYzG_9.js} +1 -1
- package/dist/vue-i18n-C6c2jsH3.js +2365 -0
- package/dist/{xlsx-BVmtIl_i.js → xlsx-Bfo19lFv.js} +786 -786
- package/dist/{zod-DI7OBdxu.js → zod-CihbDg3N.js} +1 -1
- package/package.json +12 -3
- package/dist/Broadcast-CoirZUyr.js +0 -271
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyIOw_HH.js +0 -2431
- package/dist/ReviewFacebookCallback--IcyheQA.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang--5K-qagY.js +0 -1883
- package/dist/Setting-D4XOHSHT.js +0 -2036
- package/dist/Settings-Dt_oLoGl.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Db2cd6ny.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9L-AayN.js +0 -142
- package/dist/campaign-DDfFBFye.js +0 -228
- package/dist/campaign.fn-DRabv93K.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-CmhDYsk6.js +0 -51
- package/dist/objectid-b2KGvMA7.js +0 -145
- package/dist/rule-builder-BzYwbbj4.js +0 -102
- package/dist/template-fjUz6xrU.js +0 -236
- package/dist/vue-i18n-DbJO6sZW.js +0 -2365
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as M, useSlots as G, ref as F, watch as z, computed as b, openBlock as t, createElementBlock as s, createElementVNode as a, normalizeClass as N, unref as e, toDisplayString as d, Fragment as w, createBlock as U, createCommentVNode as C, createVNode as E, renderSlot as W, onMounted as q, withCtx as L, renderList as R, createStaticVNode as J } from "vue";
|
|
2
|
+
import { u as K } from "./loading-C5fVI0ry.js";
|
|
3
|
+
import { u as Q } from "./business-BZ0boE-5.js";
|
|
4
|
+
import { components as x, useSnackbar as X } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as O } from "./vue-i18n-C6c2jsH3.js";
|
|
6
|
+
import { h as A } from "./moment-D7p2TMB-.js";
|
|
7
|
+
import { g as Z, f as ee } from "./google-BQK68wbe.js";
|
|
8
|
+
import { R as ne } from "./app-DV3e2LkD.js";
|
|
9
|
+
import { useRouter as oe } from "vue-router";
|
|
10
|
+
import { r as $ } from "./index-BV5aPSYo.js";
|
|
11
|
+
const te = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white overflow-hidden" }, ce = ["src"], ae = { class: "flex flex-col flex-1 gap-4 min-w-0" }, se = { class: "fm-typo-en-body-md-600 capitalize" }, re = { class: "truncate" }, le = { class: "truncate" }, ie = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "truncate"
|
|
14
|
+
}, ue = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "truncate"
|
|
17
|
+
}, de = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate"
|
|
20
|
+
}, me = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, H = /* @__PURE__ */ M({
|
|
21
|
+
__name: "ReviewSource",
|
|
22
|
+
props: {
|
|
23
|
+
icon: {},
|
|
24
|
+
name: {},
|
|
25
|
+
connected: { type: Boolean },
|
|
26
|
+
subtitle: {},
|
|
27
|
+
syncing: { type: Boolean },
|
|
28
|
+
tokenExpired: { type: Boolean },
|
|
29
|
+
lastSyncTime: {}
|
|
30
|
+
},
|
|
31
|
+
emits: ["connect", "sync"],
|
|
32
|
+
setup(r, { emit: h }) {
|
|
33
|
+
const f = r, S = h, { t: l } = O(), c = G(), k = F(null);
|
|
34
|
+
z(
|
|
35
|
+
() => f.syncing,
|
|
36
|
+
(i) => {
|
|
37
|
+
i && (k.value = /* @__PURE__ */ new Date());
|
|
38
|
+
},
|
|
39
|
+
{ immediate: !0 }
|
|
40
|
+
);
|
|
41
|
+
const p = b(
|
|
42
|
+
() => f.lastSyncTime ? A(f.lastSyncTime) : null
|
|
43
|
+
), T = b(() => {
|
|
44
|
+
var i;
|
|
45
|
+
return ((i = p.value) == null ? void 0 : i.fromNow()) ?? "";
|
|
46
|
+
}), B = b(
|
|
47
|
+
() => {
|
|
48
|
+
var i;
|
|
49
|
+
return ((i = p.value) == null ? void 0 : i.format("D MMM YYYY, HH:mm")) ?? "";
|
|
50
|
+
}
|
|
51
|
+
), I = b(
|
|
52
|
+
() => A(k.value ?? void 0).format("HH:mm")
|
|
53
|
+
), u = b(() => f.syncing ? "syncing" : p.value ? "synced" : "never");
|
|
54
|
+
return (i, m) => (t(), s("div", te, [
|
|
55
|
+
a("div", {
|
|
56
|
+
class: N(["flex items-center gap-12 p-16", e(c).default ? "border-b border-fm-color-neutral-gray-100" : ""])
|
|
57
|
+
}, [
|
|
58
|
+
a("img", {
|
|
59
|
+
src: r.icon,
|
|
60
|
+
class: "w-10 h-10 shrink-0"
|
|
61
|
+
}, null, 8, ce),
|
|
62
|
+
a("div", ae, [
|
|
63
|
+
a("span", se, d(r.name), 1),
|
|
64
|
+
r.connected ? (t(), s("div", {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: N(["flex items-center gap-8 fm-typo-en-body-sm-400 truncate", {
|
|
67
|
+
"text-fm-color-typo-secondary": u.value !== "syncing",
|
|
68
|
+
"text-fm-color-typo-warning": u.value === "syncing"
|
|
69
|
+
}])
|
|
70
|
+
}, [
|
|
71
|
+
a("span", {
|
|
72
|
+
class: N(["w-8 h-8 rounded-full shrink-0", {
|
|
73
|
+
"bg-fm-color-system-success-400": u.value === "synced",
|
|
74
|
+
"bg-fm-color-primary": u.value === "syncing",
|
|
75
|
+
"bg-fm-color-neutral-gray-300": u.value === "never"
|
|
76
|
+
}])
|
|
77
|
+
}, null, 2),
|
|
78
|
+
u.value === "synced" ? (t(), s(w, { key: 0 }, [
|
|
79
|
+
a("span", re, d(e(l)("connect.review.lastSynced", { relative: T.value })), 1),
|
|
80
|
+
m[3] || (m[3] = a("span", { class: "text-fm-color-neutral-gray-300" }, "·", -1)),
|
|
81
|
+
a("span", le, d(B.value), 1)
|
|
82
|
+
], 64)) : u.value === "syncing" ? (t(), s("span", ie, d(e(l)("connect.review.syncingNow", { time: I.value })), 1)) : (t(), s("span", ue, d(e(l)("connect.review.neverSynced")), 1))
|
|
83
|
+
], 2)) : (t(), s("span", de, d(r.subtitle || e(l)("connect.review.notConnected")), 1))
|
|
84
|
+
]),
|
|
85
|
+
r.connected ? (t(), s(w, { key: 0 }, [
|
|
86
|
+
r.tokenExpired ? (t(), U(e(x).FmChip, {
|
|
87
|
+
key: 0,
|
|
88
|
+
label: e(l)("connect.review.expired"),
|
|
89
|
+
variant: "critical"
|
|
90
|
+
}, null, 8, ["label"])) : C("", !0),
|
|
91
|
+
E(e(x).FmButton, {
|
|
92
|
+
variant: "secondary",
|
|
93
|
+
"prepend-icon": "refresh",
|
|
94
|
+
label: e(l)("connect.review.reconnect"),
|
|
95
|
+
onClick: m[0] || (m[0] = (_) => S("connect"))
|
|
96
|
+
}, null, 8, ["label"]),
|
|
97
|
+
r.tokenExpired ? C("", !0) : (t(), U(e(x).FmButton, {
|
|
98
|
+
key: 1,
|
|
99
|
+
variant: "primary",
|
|
100
|
+
"prepend-icon": "sync",
|
|
101
|
+
label: e(l)("connect.review.sync"),
|
|
102
|
+
loading: r.syncing,
|
|
103
|
+
onClick: m[1] || (m[1] = (_) => S("sync"))
|
|
104
|
+
}, null, 8, ["label", "loading"]))
|
|
105
|
+
], 64)) : C("", !0)
|
|
106
|
+
], 2),
|
|
107
|
+
r.connected ? C("", !0) : (t(), s("div", {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: N(["flex items-center justify-between gap-12 p-16", e(c).default ? "border-b border-fm-color-neutral-gray-100" : ""])
|
|
110
|
+
}, [
|
|
111
|
+
a("span", me, d(e(l)("connect.review.connectHint", { name: r.name })), 1),
|
|
112
|
+
E(e(x).FmButton, {
|
|
113
|
+
"prepend-icon": "add",
|
|
114
|
+
label: e(l)("connect.review.connect"),
|
|
115
|
+
onClick: m[2] || (m[2] = (_) => S("connect"))
|
|
116
|
+
}, null, 8, ["label"])
|
|
117
|
+
], 2)),
|
|
118
|
+
W(i.$slots, "default")
|
|
119
|
+
]));
|
|
120
|
+
}
|
|
121
|
+
}), ye = { class: "p-24 flex flex-col gap-8" }, fe = { class: "flex flex-col flex-1 min-w-0" }, ge = { class: "fm-typo-en-body-lg-600 truncate" }, pe = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, ve = ["src"], be = { class: "flex flex-col flex-1 min-w-0" }, ke = { class: "fm-typo-en-body-lg-600 truncate" }, we = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, Te = /* @__PURE__ */ M({
|
|
122
|
+
__name: "Settings",
|
|
123
|
+
setup(r) {
|
|
124
|
+
const { t: h } = O(), f = X(), S = oe(), l = Q(), c = F(null), k = F(!1), p = F(!1), T = b(
|
|
125
|
+
() => {
|
|
126
|
+
var n;
|
|
127
|
+
return c.value ? ((n = c.value.google) == null ? void 0 : n.accessToken) === null : !1;
|
|
128
|
+
}
|
|
129
|
+
), B = b(
|
|
130
|
+
() => {
|
|
131
|
+
var n;
|
|
132
|
+
return c.value ? ((n = c.value.facebook) == null ? void 0 : n.token) === null : !1;
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
function I(n) {
|
|
136
|
+
const o = window.location.pathname.replace(/\/review(?:\/.*)?$/, "");
|
|
137
|
+
return `${window.location.origin}${o}${n}`;
|
|
138
|
+
}
|
|
139
|
+
async function u() {
|
|
140
|
+
await K.minor(async () => {
|
|
141
|
+
c.value = await $.getSource();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function i(n) {
|
|
145
|
+
var o;
|
|
146
|
+
return (o = l.locations.find(
|
|
147
|
+
(g) => g._id.toString() === n
|
|
148
|
+
)) == null ? void 0 : o.name;
|
|
149
|
+
}
|
|
150
|
+
function m(n) {
|
|
151
|
+
return n.map((o) => i(o)).filter((o) => o !== void 0).join(", ");
|
|
152
|
+
}
|
|
153
|
+
function _() {
|
|
154
|
+
f.open({
|
|
155
|
+
message: h("connect.review.syncSuccess"),
|
|
156
|
+
type: "success"
|
|
157
|
+
}), S.push({ name: ne["$connect-REVIEW_OVERVIEW"] });
|
|
158
|
+
}
|
|
159
|
+
async function P() {
|
|
160
|
+
var n, o;
|
|
161
|
+
k.value = !0;
|
|
162
|
+
try {
|
|
163
|
+
await $.syncGoogleReviews(), _();
|
|
164
|
+
} catch (g) {
|
|
165
|
+
if (await u(), ((o = (n = c.value) == null ? void 0 : n.google) == null ? void 0 : o.accessToken) === null) {
|
|
166
|
+
f.open({
|
|
167
|
+
message: h("connect.review.tokenExpired"),
|
|
168
|
+
type: "error"
|
|
169
|
+
});
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
throw g;
|
|
173
|
+
} finally {
|
|
174
|
+
k.value = !1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function Y() {
|
|
178
|
+
var n, o;
|
|
179
|
+
p.value = !0;
|
|
180
|
+
try {
|
|
181
|
+
await $.syncFacebookReviews(), _();
|
|
182
|
+
} catch (g) {
|
|
183
|
+
if (await u(), ((o = (n = c.value) == null ? void 0 : n.facebook) == null ? void 0 : o.token) === null) {
|
|
184
|
+
f.open({
|
|
185
|
+
message: h("connect.review.tokenExpired"),
|
|
186
|
+
type: "error"
|
|
187
|
+
});
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
throw g;
|
|
191
|
+
} finally {
|
|
192
|
+
p.value = !1;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async function j() {
|
|
196
|
+
const n = I("/review/google/callback"), { callbackUrl: o } = await $.getOauthUrl("google", n);
|
|
197
|
+
window.location.href = o;
|
|
198
|
+
}
|
|
199
|
+
async function D() {
|
|
200
|
+
const n = I("/review/facebook/callback"), { callbackUrl: o } = await $.getOauthUrl("facebook", n);
|
|
201
|
+
window.location.href = o;
|
|
202
|
+
}
|
|
203
|
+
return q(() => {
|
|
204
|
+
u(), l.readLocations();
|
|
205
|
+
}), (n, o) => {
|
|
206
|
+
var g, V;
|
|
207
|
+
return t(), s("div", ye, [
|
|
208
|
+
e(c) ? (t(), s(w, { key: 0 }, [
|
|
209
|
+
E(H, {
|
|
210
|
+
icon: e(Z),
|
|
211
|
+
name: "google",
|
|
212
|
+
connected: !!e(c).google,
|
|
213
|
+
syncing: e(k),
|
|
214
|
+
"token-expired": e(T),
|
|
215
|
+
"last-sync-time": (g = e(c).google) == null ? void 0 : g.lastSyncTime,
|
|
216
|
+
onConnect: j,
|
|
217
|
+
onSync: P
|
|
218
|
+
}, {
|
|
219
|
+
default: L(() => {
|
|
220
|
+
var v;
|
|
221
|
+
return [
|
|
222
|
+
(t(!0), s(w, null, R((v = e(c).google) == null ? void 0 : v.locations, (y) => (t(), s("div", {
|
|
223
|
+
key: y.googleLocationName,
|
|
224
|
+
class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
|
|
225
|
+
}, [
|
|
226
|
+
E(e(x).FmIcon, {
|
|
227
|
+
name: "location_on",
|
|
228
|
+
class: "text-fm-color-neutral-gray-300 shrink-0"
|
|
229
|
+
}),
|
|
230
|
+
a("div", fe, [
|
|
231
|
+
a("span", ge, d(y.displayName), 1),
|
|
232
|
+
a("span", pe, d(i(y.locationId)), 1)
|
|
233
|
+
])
|
|
234
|
+
]))), 128))
|
|
235
|
+
];
|
|
236
|
+
}),
|
|
237
|
+
_: 1
|
|
238
|
+
}, 8, ["icon", "connected", "syncing", "token-expired", "last-sync-time"]),
|
|
239
|
+
E(H, {
|
|
240
|
+
icon: e(ee),
|
|
241
|
+
name: "facebook",
|
|
242
|
+
connected: !!e(c).facebook,
|
|
243
|
+
syncing: e(p),
|
|
244
|
+
"token-expired": e(B),
|
|
245
|
+
"last-sync-time": (V = e(c).facebook) == null ? void 0 : V.lastSyncTime,
|
|
246
|
+
onConnect: D,
|
|
247
|
+
onSync: Y
|
|
248
|
+
}, {
|
|
249
|
+
default: L(() => {
|
|
250
|
+
var v;
|
|
251
|
+
return [
|
|
252
|
+
(t(!0), s(w, null, R((v = e(c).facebook) == null ? void 0 : v.pages, (y) => (t(), s("div", {
|
|
253
|
+
key: y.facebookPageId,
|
|
254
|
+
class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
|
|
255
|
+
}, [
|
|
256
|
+
y.pageProfileImageUrl ? (t(), s("img", {
|
|
257
|
+
key: 0,
|
|
258
|
+
src: y.pageProfileImageUrl,
|
|
259
|
+
class: "w-10 h-10 rounded-full shrink-0 object-cover"
|
|
260
|
+
}, null, 8, ve)) : (t(), U(e(x).FmIcon, {
|
|
261
|
+
key: 1,
|
|
262
|
+
name: "person",
|
|
263
|
+
class: "text-fm-color-neutral-gray-300 shrink-0"
|
|
264
|
+
})),
|
|
265
|
+
a("div", be, [
|
|
266
|
+
a("span", ke, d(y.pageName), 1),
|
|
267
|
+
a("span", we, d(m(y.locationIds)), 1)
|
|
268
|
+
])
|
|
269
|
+
]))), 128))
|
|
270
|
+
];
|
|
271
|
+
}),
|
|
272
|
+
_: 1
|
|
273
|
+
}, 8, ["icon", "connected", "syncing", "token-expired", "last-sync-time"])
|
|
274
|
+
], 64)) : (t(), s(w, { key: 1 }, R(["google", "facebook"], (v) => a("div", {
|
|
275
|
+
key: v,
|
|
276
|
+
class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16"
|
|
277
|
+
}, [...o[0] || (o[0] = [
|
|
278
|
+
J('<div class="animate-pulse flex items-center gap-12"><div class="w-10 h-10 rounded-full bg-fm-color-neutral-gray-100 shrink-0"></div><div class="flex-1 min-w-0 space-y-8"><div class="h-16 w-20 rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-full max-w-[160px] rounded bg-fm-color-neutral-gray-100"></div></div><div class="h-32 w-24 rounded bg-fm-color-neutral-gray-100 shrink-0"></div></div>', 1)
|
|
279
|
+
])])), 64))
|
|
280
|
+
]);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
Te as default
|
|
286
|
+
};
|