@feedmepos/mf-connect 0.1.114-dev → 0.1.115-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/dist/{App-CIWTDYuZ.js → App-43mZfFAr.js} +11 -11
- package/dist/{AuditLogs-BluLDXu9.js → AuditLogs-BPpdm96t.js} +13 -13
- package/dist/{Bin-jS6pM4L3.js → Bin-CA7v180Y.js} +8 -8
- package/dist/{Broadcast-DBqsSZ0S.js → Broadcast-qmdifF2Y.js} +12 -12
- package/dist/{CampaignAnalytic-DJrjXD4H.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
- package/dist/{Card-B10nLilL.js → Card-D8icsk7L.js} +23 -23
- package/dist/{Collections-BN42A73p.js → Collections--THcD-E_.js} +8 -8
- package/dist/{Credit-0SS26HGE.js → Credit-JrbtVMBp.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js} +36 -36
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +6 -6
- package/dist/{Experience-D7qPzsrc.js → Experience-CFeRqBoj.js} +13 -13
- package/dist/{FileSaver.min-BKWoklMK.js → FileSaver.min-CCXIBm58.js} +1 -1
- package/dist/{Game-BoYMwfog.js → Game-CPxq6Ex3.js} +13 -13
- package/dist/{GiftCardSetup-B87O0xzo.js → GiftCardSetup-D0esVZDp.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
- package/dist/{Goals-CVxf3xCA.js → Goals-DaKI6uXt.js} +4 -4
- package/dist/{Grab-mGL1Mue_.js → Grab-BWzdN_cd.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
- package/dist/{Index-Dptuy-6c.js → Index-2kENoaZm.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
- package/dist/{LoyaltyDashboard-BxhI6RAE.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
- package/dist/{MainLayout-YfDxvZXl.js → MainLayout-DwnjGXh6.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +3 -3
- package/dist/Marketing-DCco__2F.js +273 -0
- package/dist/{MarketingMaterialEdit-DkOEy_L-.js → MarketingMaterialEdit-BbgFtrYP.js} +6 -6
- package/dist/{Member-DufbKDOh.js → Member-B--nYyr0.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +24 -24
- package/dist/{MemberImportHistory-DlFN-uQl.js → MemberImportHistory-D52Y4RTC.js} +7 -7
- package/dist/{MemberList-B344n8I4.js → MemberList-13Owa1fj.js} +14 -14
- package/dist/{MemberTransactions-BS7H640M.js → MemberTransactions-CpXEWNbq.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
- package/dist/{Mission-D2ed_oKn.js → Mission-Ci-UzXSu.js} +14 -14
- package/dist/{Overview-CLh_T6YY.js → Overview-CKxSfAGF.js} +4 -4
- package/dist/{Overview-DJa-hXDC.js → Overview-CXen9Ram.js} +21 -21
- package/dist/{Point-DAPeg1VD.js → Point-CR3YOaag.js} +14 -14
- package/dist/{Promotion-CPPCMMFl.js → Promotion-tw3J4ul-.js} +14 -14
- package/dist/{Queue-BcPwCRcM.js → Queue-BZGA5ZXt.js} +13 -13
- package/dist/{Record-C5XKn--g.js → Record-BTevVXnT.js} +9 -9
- package/dist/{Review-Cc51luIv.js → Review-BU7c8ZF0.js} +2 -2
- package/dist/{ReviewFacebookCallback-BSGInFB8.js → ReviewFacebookCallback-BnMF6Arh.js} +5 -5
- package/dist/{ReviewGoogleCallback-C1gY4vcP.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
- package/dist/{Reward-k1R3hLiF.js → Reward-jlA_7cxz.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +14 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js → RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js} +15 -15
- package/dist/{Segment-DsBnIvje.js → Segment-C1Bwm--Q.js} +26 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
- package/dist/{Setting-BRueNgc4.js → Setting-CDM4RhLW.js} +14 -14
- package/dist/{SettingAdvertisements-BrVcQyhF.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
- package/dist/{Settings-fOvXd29Z.js → Settings-D-0tvZRr.js} +5 -5
- package/dist/{Store-rrh2pIHH.js → Store-C56dXtc4.js} +27 -27
- package/dist/{StoreRewards-D-jivVKr.js → StoreRewards-DQ1Q6WS6.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js → StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js} +25 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js} +2 -2
- package/dist/{Tier-DJiLtw3M.js → Tier-D4CPZqw7.js} +27 -27
- package/dist/{Title-s0bzA7yZ.js → Title-DCbwhUic.js} +23 -23
- package/dist/{Transaction-CQ-CJ_eh.js → Transaction-C5LrasXr.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +6 -6
- package/dist/{Voucher-9vydRET7.js → Voucher-rrVbNZKR.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +12 -12
- package/dist/{WhatsappAccount-D12Hvzfl.js → WhatsappAccount-oJDo5zTr.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js} +1 -1
- package/dist/WhatsappBot-Cl64wG_F.js +876 -0
- package/dist/{WhatsappBotLogs-CK_V_iT5.js → WhatsappBotLogs-D3uT4EiB.js} +64 -64
- package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
- package/dist/{WhatsappLayout-bOyNHGUI.js → WhatsappLayout-C639d2HP.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
- package/dist/{app-DV3e2LkD.js → app-CgimGODl.js} +214 -214
- package/dist/app.js +1 -1
- package/dist/{base.export-DQUUtGmy.js → base.export-D2P6HFvo.js} +2 -2
- package/dist/{business-BZ0boE-5.js → business-Bu5TqSA0.js} +1 -1
- package/dist/{campaign-CsfFq2S-.js → campaign-BFIXSgdJ.js} +8 -8
- package/dist/{campaign-DMrtYWcs.js → campaign-zJxttSIk.js} +2 -2
- package/dist/{campaign.fn-C-CdNNdR.js → campaign.fn-gvjlcEfe.js} +20 -20
- package/dist/{collection.fn-C-rryKSc.js → collection.fn-DOm0HsSh.js} +2 -2
- package/dist/{currency-BOd9iVZV.js → currency-BpbQvbm8.js} +1 -1
- package/dist/{duplicateCampaign-ey_rW0Bz.js → duplicateCampaign-CvsvjRE9.js} +2 -2
- package/dist/{effect-BP6Hkxmj.js → effect-D-GtNB3n.js} +1 -1
- package/dist/{email-addresses-CO61QAq0.js → email-addresses-BKMoAtMi.js} +2 -2
- package/dist/{feature-flag-Bq1SgbYC.js → feature-flag-BJ_eyKsq.js} +1 -1
- package/dist/{feature-flag-lvPP0ED-.js → feature-flag-Bo-k5sIG.js} +1 -1
- package/dist/{helper-BRpts-M-.js → helper-CkfjBgMM.js} +1 -1
- package/dist/{index-CoROn5OA.js → index-B6kU3PkV.js} +2 -2
- package/dist/{index-B0RavybO.js → index-BAtUrtqM.js} +2 -2
- package/dist/{index-Bn19rfby.js → index-BKsxIwbi.js} +3 -3
- package/dist/{index-R5WS21OL.js → index-BdEXUNoG.js} +1 -1
- package/dist/{index-BV5aPSYo.js → index-Bhl5IRXy.js} +9 -9
- package/dist/{index-Cj-eugzc.js → index-BpTIulTX.js} +1 -1
- package/dist/{index-RwNlbTO8.js → index-C-iwb2Ln.js} +49 -55
- package/dist/{index-03WIXl-H.js → index-CCEXSPxk.js} +2 -2
- package/dist/{index-CsBjAM3E.js → index-CIej31pF.js} +1 -1
- package/dist/{index-DucKyzrD.js → index-CQ8XFbBk.js} +2 -2
- package/dist/{index-Bk20uvPY.js → index-CfQuYqXn.js} +1 -1
- package/dist/{index-D3wGTCWf.js → index-CuREApMc.js} +2 -2
- package/dist/{index-DIZLkVe0.js → index-D0JK99Ko.js} +9 -8
- package/dist/{index-_Cj-bsd_.js → index-DKxN1mMS.js} +4 -4
- package/dist/{index-ZRE89TKq.js → index-DQ8JJhxs.js} +15 -21
- package/dist/{index-D1t4_KaG.js → index-DUAZOMVJ.js} +1 -1
- package/dist/{index-D41kjcrZ.js → index-DqGs6RJG.js} +4 -4
- package/dist/{index-VYI0zWNC.js → index-DwU3fsLW.js} +2 -2
- package/dist/{index-CrBhcMaL.js → index-LygS9WsG.js} +3 -3
- package/dist/{index-BDNkoALK.js → index-feCrYhi6.js} +1 -1
- package/dist/{index-mToWKHVs.js → index-zTvr2GR4.js} +2 -2
- package/dist/{index.esm2017-B_Sag8Pg.js → index.esm2017-DZi9IQPS.js} +1 -1
- package/dist/{loading-C5fVI0ry.js → loading-Brid2wnu.js} +1 -1
- package/dist/{lodash-COo8_xCU.js → lodash-C1epw3Kv.js} +1 -1
- package/dist/{member-import-I_pKwUfF.js → member-import-DAIxTIiu.js} +1 -1
- package/dist/{membership-BgfH9Kva.js → membership-BZmljFhF.js} +2 -2
- package/dist/{money-Cr07YDlV.js → money-cLcyGcSZ.js} +1 -1
- package/dist/{number-DFsj0dkh.js → number-C2jPLJr2.js} +1 -1
- package/dist/{objectid-Cu89BzwI.js → objectid-C-wocWKI.js} +6 -6
- package/dist/{onboarding-DlkJCm-5.js → onboarding-oRfy_g05.js} +3 -3
- package/dist/{onboardingSetup-BEhVj613.js → onboardingSetup-BLD6m8HY.js} +2 -2
- package/dist/{plugins-CPTtiKqf.js → plugins-CUsr9vB0.js} +3 -3
- package/dist/{reward-DqY0mQ_5.js → reward-UOT03odb.js} +1 -1
- package/dist/{rule-mJJ48eKw.js → rule-BgJnPjkI.js} +10 -10
- package/dist/{template-C1QftpDG.js → template-BZyFhr73.js} +6 -6
- package/dist/{timezone-BBgBHels.js → timezone-BXA4wq7Y.js} +1 -1
- package/dist/{transaction.fn-Sr0hj3kY.js → transaction.fn-CQ4fpRt3.js} +2 -2
- package/dist/{trigger-PUP0mwKM.js → trigger-DXJCGT0q.js} +5 -5
- package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
- package/dist/{usePagination-Be6nIQ9y.js → usePagination-Pp4okWr8.js} +1 -1
- package/dist/{user-DBSYzG_9.js → user-B3gXcAIy.js} +1 -1
- package/dist/{vue-i18n-C6c2jsH3.js → vue-i18n-DWGiC_vs.js} +158 -158
- package/dist/{xlsx-Bfo19lFv.js → xlsx-CCaDUTgW.js} +1 -1
- package/dist/{zod-CihbDg3N.js → zod-CPwjOxvW.js} +1 -1
- package/package.json +1 -1
- package/dist/Marketing-C2cVJacf.js +0 -236
- package/dist/WhatsappBot-o5b_0CnB.js +0 -629
- package/dist/WhatsappBotSettings-BooibLUg.js +0 -694
- package/dist/useMarketingMaterialActions-faslwaHd.js +0 -96
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
import { defineComponent as Z, ref as B, computed as M, watch as H, onBeforeUnmount as te, resolveComponent as k, openBlock as o, createElementBlock as i, createElementVNode as t, normalizeClass as R, unref as e, toDisplayString as a, createBlock as T, withCtx as S, createTextVNode as Q, createVNode as $, createCommentVNode as D, Fragment as N, renderList as X, mergeModels as le, useModel as se, isRef as ce } from "vue";
|
|
2
|
+
import { u as Y } from "./vue-i18n-DWGiC_vs.js";
|
|
3
|
+
import { useRouter as ie } from "vue-router";
|
|
4
|
+
import { useCoreStore as pe } from "@feedmepos/mf-common";
|
|
5
|
+
import { S as K, a as oe } from "./index-CCEXSPxk.js";
|
|
6
|
+
import { w as J } from "./index-DQ8JJhxs.js";
|
|
7
|
+
import { u as ue, _ as de, w as me } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js";
|
|
8
|
+
import { R as U } from "./app-CgimGODl.js";
|
|
9
|
+
import { _ as fe } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js";
|
|
10
|
+
import { b as re } from "./browser-BSAOEeIM.js";
|
|
11
|
+
const xe = { class: "min-w-0" }, ve = { class: "flex items-center gap-[12px]" }, he = ["src"], _e = { key: 1 }, ge = { class: "min-w-0 flex-1" }, ye = ["title"], be = { key: 1 }, we = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, Be = { class: "relative z-10 shrink-0" }, ke = ["aria-label", "title", "aria-expanded", "disabled", "aria-busy"], $e = { class: "text-[14px] text-fm-color-typo-error" }, Ce = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Ae = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-[12px] text-fm-color-typo-tertiary"
|
|
14
|
+
}, Ie = {
|
|
15
|
+
key: 0,
|
|
16
|
+
role: "alert",
|
|
17
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
18
|
+
}, Te = /* @__PURE__ */ Z({
|
|
19
|
+
__name: "WhatsappAccountCard",
|
|
20
|
+
props: {
|
|
21
|
+
account: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["removed"],
|
|
24
|
+
setup(C, { emit: m }) {
|
|
25
|
+
const h = C, c = m, { t: n, locale: p } = Y(), u = B(!1), _ = B(""), f = B(!1), y = B(!1);
|
|
26
|
+
let x;
|
|
27
|
+
const {
|
|
28
|
+
name: A,
|
|
29
|
+
phoneNumber: b,
|
|
30
|
+
initials: I,
|
|
31
|
+
state: P,
|
|
32
|
+
avatarColor: w,
|
|
33
|
+
profilePictureUrl: l,
|
|
34
|
+
profilePictureFailed: g
|
|
35
|
+
} = ue(() => h.account), v = M(() => P.value === "connected"), d = M(() => ({
|
|
36
|
+
name: U["$connect-WHATSAPP_ACCOUNT"],
|
|
37
|
+
params: { clientId: h.account.clientId }
|
|
38
|
+
}));
|
|
39
|
+
function G(E) {
|
|
40
|
+
return new Intl.DateTimeFormat(p.value, {
|
|
41
|
+
year: "numeric",
|
|
42
|
+
month: "short",
|
|
43
|
+
day: "numeric"
|
|
44
|
+
}).format(new Date(E));
|
|
45
|
+
}
|
|
46
|
+
async function V() {
|
|
47
|
+
if (u.value) return;
|
|
48
|
+
const E = K.getBusinessId();
|
|
49
|
+
if (!E) {
|
|
50
|
+
_.value = n("connect.whatsappBot.errors.selectBusiness");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const r = h.account.clientId, s = new AbortController();
|
|
54
|
+
x = s, u.value = !0, _.value = "";
|
|
55
|
+
try {
|
|
56
|
+
await J.deleteClient(E, r, s.signal), s.signal.aborted || c("removed", r);
|
|
57
|
+
} catch {
|
|
58
|
+
s.signal.aborted || (_.value = n("connect.whatsappBot.errors.removeAccount"));
|
|
59
|
+
} finally {
|
|
60
|
+
x === s && (x = void 0, u.value = !1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function L() {
|
|
64
|
+
x == null || x.abort(), x = void 0, u.value = !1, _.value = "";
|
|
65
|
+
}
|
|
66
|
+
return H(
|
|
67
|
+
() => K.getBusinessId(),
|
|
68
|
+
() => {
|
|
69
|
+
L(), y.value = !1;
|
|
70
|
+
}
|
|
71
|
+
), te(L), (E, r) => {
|
|
72
|
+
const s = k("RouterLink"), W = k("FmCircularProgress"), j = k("FmIcon"), q = k("FmMenuItem"), ee = k("FmMenu");
|
|
73
|
+
return o(), i("li", xe, [
|
|
74
|
+
t("div", {
|
|
75
|
+
class: R(["relative h-full border border-fm-color-neutral-gray-100 rounded-[16px] p-[20px] flex flex-col gap-[16px] bg-fm-color-neutral-white text-fm-color-typo-primary", {
|
|
76
|
+
"cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100": v.value
|
|
77
|
+
}])
|
|
78
|
+
}, [
|
|
79
|
+
t("div", ve, [
|
|
80
|
+
t("div", {
|
|
81
|
+
"aria-hidden": "true",
|
|
82
|
+
class: R(["w-[48px] h-[48px] rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", e(w)])
|
|
83
|
+
}, [
|
|
84
|
+
e(l) && !e(g) ? (o(), i("img", {
|
|
85
|
+
key: 0,
|
|
86
|
+
src: e(l),
|
|
87
|
+
alt: "",
|
|
88
|
+
class: "w-full h-full object-cover",
|
|
89
|
+
referrerpolicy: "no-referrer",
|
|
90
|
+
onError: r[0] || (r[0] = (O) => g.value = !0)
|
|
91
|
+
}, null, 40, he)) : (o(), i("span", _e, a(e(I)), 1))
|
|
92
|
+
], 2),
|
|
93
|
+
t("div", ge, [
|
|
94
|
+
t("h2", {
|
|
95
|
+
class: "text-[16px] leading-[24px] font-semibold truncate",
|
|
96
|
+
title: e(A)
|
|
97
|
+
}, [
|
|
98
|
+
v.value ? (o(), T(s, {
|
|
99
|
+
key: 0,
|
|
100
|
+
to: d.value,
|
|
101
|
+
class: "text-inherit no-underline after:absolute after:inset-0 after:rounded-[16px] focus-visible:outline-none focus-visible:after:ring-[2px] focus-visible:after:ring-fm-color-primary focus-visible:after:ring-offset-[2px]"
|
|
102
|
+
}, {
|
|
103
|
+
default: S(() => [
|
|
104
|
+
Q(a(e(A)), 1)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 8, ["to"])) : (o(), i("span", be, a(e(A)), 1))
|
|
108
|
+
], 8, ye),
|
|
109
|
+
t("p", we, a(e(b)), 1)
|
|
110
|
+
]),
|
|
111
|
+
t("div", Be, [
|
|
112
|
+
$(ee, {
|
|
113
|
+
placement: "bottom-end",
|
|
114
|
+
width: 220,
|
|
115
|
+
disabled: u.value,
|
|
116
|
+
"stop-click-propagation": "",
|
|
117
|
+
onMenuChanged: r[3] || (r[3] = (O) => f.value = O)
|
|
118
|
+
}, {
|
|
119
|
+
"menu-button": S(() => [
|
|
120
|
+
t("button", {
|
|
121
|
+
type: "button",
|
|
122
|
+
"aria-label": e(n)("connect.whatsappBot.moreActions"),
|
|
123
|
+
title: e(n)("connect.whatsappBot.moreActions"),
|
|
124
|
+
"aria-haspopup": "menu",
|
|
125
|
+
"aria-expanded": f.value,
|
|
126
|
+
disabled: u.value,
|
|
127
|
+
"aria-busy": u.value,
|
|
128
|
+
class: R(["w-[32px] h-[32px] flex items-center justify-center rounded-[8px] text-fm-color-typo-tertiary transition-colors hover:bg-fm-color-neutral-gray-100 hover:text-fm-color-typo-primary focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary disabled:cursor-wait disabled:opacity-50", { "bg-fm-color-neutral-gray-100": f.value }])
|
|
129
|
+
}, [
|
|
130
|
+
u.value ? (o(), T(W, {
|
|
131
|
+
key: 0,
|
|
132
|
+
size: "md",
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
})) : (o(), T(j, {
|
|
135
|
+
key: 1,
|
|
136
|
+
name: "more_vert",
|
|
137
|
+
size: "sm",
|
|
138
|
+
"aria-hidden": "true"
|
|
139
|
+
}))
|
|
140
|
+
], 10, ke)
|
|
141
|
+
]),
|
|
142
|
+
default: S(() => [
|
|
143
|
+
v.value ? (o(), T(q, {
|
|
144
|
+
key: 0,
|
|
145
|
+
label: e(n)("connect.whatsappBot.notificationGroup.title"),
|
|
146
|
+
disabled: u.value,
|
|
147
|
+
"onUpdate:modelValue": r[1] || (r[1] = (O) => y.value = !0)
|
|
148
|
+
}, {
|
|
149
|
+
prepend: S(() => [
|
|
150
|
+
$(j, {
|
|
151
|
+
name: "notifications",
|
|
152
|
+
size: "sm",
|
|
153
|
+
outline: "",
|
|
154
|
+
"aria-hidden": "true"
|
|
155
|
+
})
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["label", "disabled"])) : D("", !0),
|
|
159
|
+
$(q, {
|
|
160
|
+
disabled: u.value,
|
|
161
|
+
"onUpdate:modelValue": r[2] || (r[2] = (O) => V())
|
|
162
|
+
}, {
|
|
163
|
+
prepend: S(() => [
|
|
164
|
+
$(j, {
|
|
165
|
+
name: "delete",
|
|
166
|
+
size: "sm",
|
|
167
|
+
outline: "",
|
|
168
|
+
class: "text-fm-color-typo-error",
|
|
169
|
+
"aria-hidden": "true"
|
|
170
|
+
})
|
|
171
|
+
]),
|
|
172
|
+
label: S(() => [
|
|
173
|
+
t("span", $e, a(e(n)("connect.common.delete")), 1)
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 8, ["disabled"])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["disabled"])
|
|
180
|
+
])
|
|
181
|
+
]),
|
|
182
|
+
t("div", Ce, [
|
|
183
|
+
$(fe, { state: e(P) }, null, 8, ["state"]),
|
|
184
|
+
v.value && C.account.connectedAt ? (o(), i("span", Ae, a(e(n)("connect.whatsappBot.connectedSince", {
|
|
185
|
+
date: G(C.account.connectedAt)
|
|
186
|
+
})), 1)) : D("", !0)
|
|
187
|
+
]),
|
|
188
|
+
_.value ? (o(), i("p", Ie, a(_.value), 1)) : D("", !0)
|
|
189
|
+
], 2),
|
|
190
|
+
y.value ? (o(), T(de, {
|
|
191
|
+
key: 0,
|
|
192
|
+
modelValue: y.value,
|
|
193
|
+
"onUpdate:modelValue": r[4] || (r[4] = (O) => y.value = O),
|
|
194
|
+
account: C.account
|
|
195
|
+
}, null, 8, ["modelValue", "account"])) : D("", !0)
|
|
196
|
+
]);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}), Fe = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] gap-[16px]" }, Se = /* @__PURE__ */ Z({
|
|
200
|
+
__name: "WhatsappAccountList",
|
|
201
|
+
props: {
|
|
202
|
+
accounts: {}
|
|
203
|
+
},
|
|
204
|
+
emits: ["removed"],
|
|
205
|
+
setup(C, { emit: m }) {
|
|
206
|
+
const h = m;
|
|
207
|
+
return (c, n) => (o(), i("ul", Fe, [
|
|
208
|
+
(o(!0), i(N, null, X(C.accounts, (p) => (o(), T(Te, {
|
|
209
|
+
key: p.clientId,
|
|
210
|
+
account: p,
|
|
211
|
+
onRemoved: n[0] || (n[0] = (u) => h("removed", u))
|
|
212
|
+
}, null, 8, ["account"]))), 128))
|
|
213
|
+
]));
|
|
214
|
+
}
|
|
215
|
+
}), z = [
|
|
216
|
+
{ key: "autoReplies", icon: "chat" },
|
|
217
|
+
{ key: "settings", icon: "menu_book" },
|
|
218
|
+
{ key: "escalations", icon: "notifications" },
|
|
219
|
+
{ key: "excludedAccounts", icon: "pause_circle" }
|
|
220
|
+
], Pe = { class: "text-[18px] font-semibold" }, Ve = { class: "flex flex-col gap-[24px] py-[8px]" }, Le = { class: "flex flex-col gap-[12px]" }, De = { class: "text-[13px] font-medium text-fm-color-typo-secondary" }, Ee = {
|
|
221
|
+
"aria-hidden": "true",
|
|
222
|
+
class: "flex gap-[8px]"
|
|
223
|
+
}, Me = {
|
|
224
|
+
"aria-live": "polite",
|
|
225
|
+
"aria-atomic": "true",
|
|
226
|
+
class: "flex min-h-[260px] flex-col items-start gap-[16px]"
|
|
227
|
+
}, We = { class: "sr-only" }, je = {
|
|
228
|
+
"aria-hidden": "true",
|
|
229
|
+
class: "flex h-[56px] w-[56px] items-center justify-center rounded-[16px] bg-fm-color-primary-oats text-fm-color-primary"
|
|
230
|
+
}, Oe = { class: "flex flex-col gap-[8px]" }, Ue = { class: "text-[20px] leading-[28px] font-semibold" }, Ne = { class: "text-[14px] leading-[22px] text-fm-color-typo-secondary" }, Ge = {
|
|
231
|
+
key: 0,
|
|
232
|
+
class: "flex w-full flex-col items-center gap-[12px]"
|
|
233
|
+
}, Re = {
|
|
234
|
+
key: 0,
|
|
235
|
+
role: "status",
|
|
236
|
+
class: "flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
237
|
+
}, He = {
|
|
238
|
+
role: "alert",
|
|
239
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
240
|
+
}, ze = ["src", "alt"], Qe = { class: "flex w-full min-w-0 flex-col gap-[6px]" }, Ke = { class: "text-[13px] font-medium text-fm-color-typo-secondary" }, Ze = ["href"], Je = { class: "w-full rounded-[12px] bg-fm-color-neutral-gray-100 p-[16px] text-[14px] leading-[20px]" }, Xe = { class: "flex w-full items-center justify-between gap-[12px]" }, Ye = /* @__PURE__ */ Z({
|
|
241
|
+
__name: "WhatsappBotTutorialDialog",
|
|
242
|
+
props: /* @__PURE__ */ le({
|
|
243
|
+
clientId: {}
|
|
244
|
+
}, {
|
|
245
|
+
modelValue: { type: Boolean, required: !0 },
|
|
246
|
+
modelModifiers: {}
|
|
247
|
+
}),
|
|
248
|
+
emits: ["update:modelValue"],
|
|
249
|
+
setup(C) {
|
|
250
|
+
const m = C, h = se(C, "modelValue"), { t: c } = Y(), n = B(0), p = M(() => z[n.value]), u = M(
|
|
251
|
+
() => n.value === z.length - 1
|
|
252
|
+
), _ = M(() => K.getBusinessId()), f = B(""), y = B(""), x = B(!1), A = B("");
|
|
253
|
+
let b;
|
|
254
|
+
async function I() {
|
|
255
|
+
b == null || b.abort();
|
|
256
|
+
const w = new AbortController();
|
|
257
|
+
b = w, f.value = "", y.value = "", A.value = "", x.value = !0;
|
|
258
|
+
try {
|
|
259
|
+
if (!_.value || !m.clientId) {
|
|
260
|
+
A.value = c(
|
|
261
|
+
_.value ? "connect.whatsappBot.notificationGroup.notReady" : "connect.whatsappBot.errors.selectBusiness"
|
|
262
|
+
);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const l = await J.getNotificationGroup(
|
|
266
|
+
_.value,
|
|
267
|
+
m.clientId,
|
|
268
|
+
w.signal
|
|
269
|
+
);
|
|
270
|
+
if (w.signal.aborted) return;
|
|
271
|
+
const g = await re.toDataURL(l.inviteLink, {
|
|
272
|
+
width: 224,
|
|
273
|
+
margin: 2,
|
|
274
|
+
errorCorrectionLevel: "M"
|
|
275
|
+
});
|
|
276
|
+
if (w.signal.aborted) return;
|
|
277
|
+
f.value = l.inviteLink, y.value = g;
|
|
278
|
+
} catch (l) {
|
|
279
|
+
if (w.signal.aborted) return;
|
|
280
|
+
A.value = c(
|
|
281
|
+
l instanceof oe && l.status === 409 ? "connect.whatsappBot.notificationGroup.notReady" : l instanceof oe && l.status === 404 ? "connect.whatsappBot.errors.accountNotFound" : "connect.whatsappBot.errors.loadGroup"
|
|
282
|
+
);
|
|
283
|
+
} finally {
|
|
284
|
+
w.signal.aborted || (x.value = !1);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
H(
|
|
288
|
+
[h, () => p.value.key, _, () => m.clientId],
|
|
289
|
+
([w, l]) => {
|
|
290
|
+
w && l === "escalations" ? I() : b == null || b.abort();
|
|
291
|
+
}
|
|
292
|
+
), te(() => b == null ? void 0 : b.abort());
|
|
293
|
+
function P() {
|
|
294
|
+
u.value ? h.value = !1 : n.value += 1;
|
|
295
|
+
}
|
|
296
|
+
return H(h, (w) => {
|
|
297
|
+
w && (n.value = 0);
|
|
298
|
+
}), (w, l) => {
|
|
299
|
+
const g = k("FmIcon"), v = k("FmCircularProgress"), d = k("FmButton"), G = k("FmDialog");
|
|
300
|
+
return o(), T(G, {
|
|
301
|
+
modelValue: h.value,
|
|
302
|
+
"onUpdate:modelValue": l[1] || (l[1] = (V) => h.value = V),
|
|
303
|
+
"min-width": "min(600px, calc(100% - 32px))",
|
|
304
|
+
"max-width": "600px",
|
|
305
|
+
"max-height": "90vh",
|
|
306
|
+
"dismiss-away": ""
|
|
307
|
+
}, {
|
|
308
|
+
"dialog-header": S(() => [
|
|
309
|
+
t("h2", Pe, a(e(c)("connect.whatsappBot.tutorial.title")), 1)
|
|
310
|
+
]),
|
|
311
|
+
"dialog-footer": S(() => [
|
|
312
|
+
t("div", Xe, [
|
|
313
|
+
$(d, {
|
|
314
|
+
variant: "secondary",
|
|
315
|
+
"border-color": "neutral-gray-200",
|
|
316
|
+
label: e(c)("connect.common.back"),
|
|
317
|
+
disabled: n.value === 0,
|
|
318
|
+
"prepend-icon": "chevron_left",
|
|
319
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
320
|
+
onClick: l[0] || (l[0] = (V) => n.value -= 1)
|
|
321
|
+
}, null, 8, ["label", "disabled"]),
|
|
322
|
+
$(d, {
|
|
323
|
+
label: u.value ? e(c)("connect.whatsappBot.tutorial.done") : e(c)("connect.common.next"),
|
|
324
|
+
"append-icon": u.value ? void 0 : "chevron_right",
|
|
325
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
326
|
+
onClick: P
|
|
327
|
+
}, null, 8, ["label", "append-icon"])
|
|
328
|
+
])
|
|
329
|
+
]),
|
|
330
|
+
default: S(() => [
|
|
331
|
+
t("div", Ve, [
|
|
332
|
+
t("div", Le, [
|
|
333
|
+
t("p", De, a(e(c)("connect.whatsappBot.tutorial.progress", {
|
|
334
|
+
current: n.value + 1,
|
|
335
|
+
total: e(z).length
|
|
336
|
+
})), 1),
|
|
337
|
+
t("div", Ee, [
|
|
338
|
+
(o(!0), i(N, null, X(e(z), (V, L) => (o(), i("span", {
|
|
339
|
+
key: L,
|
|
340
|
+
class: R([
|
|
341
|
+
"h-[4px] flex-1 rounded-full",
|
|
342
|
+
L <= n.value ? "bg-fm-color-primary" : "bg-fm-color-neutral-gray-100"
|
|
343
|
+
])
|
|
344
|
+
}, null, 2))), 128))
|
|
345
|
+
])
|
|
346
|
+
]),
|
|
347
|
+
t("div", Me, [
|
|
348
|
+
t("span", We, a(e(c)("connect.whatsappBot.tutorial.progress", {
|
|
349
|
+
current: n.value + 1,
|
|
350
|
+
total: e(z).length
|
|
351
|
+
})), 1),
|
|
352
|
+
t("div", je, [
|
|
353
|
+
$(g, {
|
|
354
|
+
name: p.value.icon,
|
|
355
|
+
size: "lg"
|
|
356
|
+
}, null, 8, ["name"])
|
|
357
|
+
]),
|
|
358
|
+
t("div", Oe, [
|
|
359
|
+
t("h3", Ue, a(e(c)(`connect.whatsappBot.tutorial.steps.${p.value.key}.title`)), 1),
|
|
360
|
+
t("p", Ne, a(e(c)(
|
|
361
|
+
`connect.whatsappBot.tutorial.steps.${p.value.key}.description`
|
|
362
|
+
)), 1)
|
|
363
|
+
]),
|
|
364
|
+
p.value.key === "escalations" ? (o(), i("div", Ge, [
|
|
365
|
+
x.value ? (o(), i("div", Re, [
|
|
366
|
+
$(v),
|
|
367
|
+
Q(" " + a(e(c)("connect.whatsappBot.notificationGroup.loading")), 1)
|
|
368
|
+
])) : A.value ? (o(), i(N, { key: 1 }, [
|
|
369
|
+
t("p", He, a(A.value), 1),
|
|
370
|
+
$(d, {
|
|
371
|
+
label: e(c)("connect.whatsappBot.tryAgain"),
|
|
372
|
+
"prepend-icon": "refresh",
|
|
373
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
374
|
+
onClick: I
|
|
375
|
+
}, null, 8, ["label"])
|
|
376
|
+
], 64)) : f.value ? (o(), i(N, { key: 2 }, [
|
|
377
|
+
t("img", {
|
|
378
|
+
src: y.value,
|
|
379
|
+
alt: e(c)("connect.whatsappBot.notificationGroup.qrAlt"),
|
|
380
|
+
width: "224",
|
|
381
|
+
height: "224",
|
|
382
|
+
class: "rounded-[12px] border border-fm-color-neutral-gray-100"
|
|
383
|
+
}, null, 8, ze),
|
|
384
|
+
t("div", Qe, [
|
|
385
|
+
t("span", Ke, a(e(c)("connect.whatsappBot.notificationGroup.inviteLink")), 1),
|
|
386
|
+
t("a", {
|
|
387
|
+
href: f.value,
|
|
388
|
+
target: "_blank",
|
|
389
|
+
rel: "noopener noreferrer",
|
|
390
|
+
class: "break-all rounded-[8px] border border-fm-color-neutral-gray-200 p-[12px] font-mono text-[13px] text-fm-color-primary underline focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary"
|
|
391
|
+
}, a(f.value), 9, Ze)
|
|
392
|
+
])
|
|
393
|
+
], 64)) : D("", !0)
|
|
394
|
+
])) : D("", !0),
|
|
395
|
+
t("p", Je, a(e(c)(`connect.whatsappBot.tutorial.steps.${p.value.key}.hint`)), 1)
|
|
396
|
+
])
|
|
397
|
+
])
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
}, 8, ["modelValue"]);
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
}), qe = { class: "text-[18px] font-semibold" }, et = {
|
|
404
|
+
key: 0,
|
|
405
|
+
role: "status",
|
|
406
|
+
class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
|
|
407
|
+
}, tt = { class: "text-[18px] font-semibold" }, ot = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, nt = {
|
|
408
|
+
key: 1,
|
|
409
|
+
class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
|
|
410
|
+
}, at = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, lt = { class: "text-fm-color-typo-secondary" }, st = { class: "flex flex-col gap-[14px]" }, rt = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, ct = { key: 0 }, it = { class: "font-semibold" }, pt = { class: "font-semibold" }, ut = { class: "font-semibold" }, dt = { class: "font-semibold" }, mt = { key: 3 }, ft = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary" }, xt = { class: "relative w-[232px] h-[232px] xs:justify-self-center border border-fm-color-neutral-gray-100 rounded-[12px] flex items-center justify-center overflow-hidden" }, vt = {
|
|
411
|
+
key: 0,
|
|
412
|
+
role: "status",
|
|
413
|
+
class: "flex flex-col items-center gap-[12px] text-[13px]"
|
|
414
|
+
}, ht = {
|
|
415
|
+
key: 1,
|
|
416
|
+
class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
|
|
417
|
+
}, _t = {
|
|
418
|
+
role: "alert",
|
|
419
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
420
|
+
}, gt = ["src", "alt"], yt = {
|
|
421
|
+
key: 3,
|
|
422
|
+
role: "status",
|
|
423
|
+
"aria-live": "polite",
|
|
424
|
+
class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
|
|
425
|
+
}, bt = /* @__PURE__ */ Z({
|
|
426
|
+
__name: "WhatsappConnectDialog",
|
|
427
|
+
props: {
|
|
428
|
+
modelValue: { type: Boolean, required: !0 },
|
|
429
|
+
modelModifiers: {}
|
|
430
|
+
},
|
|
431
|
+
emits: /* @__PURE__ */ le(["connected"], ["update:modelValue"]),
|
|
432
|
+
setup(C, { emit: m }) {
|
|
433
|
+
const h = se(C, "modelValue"), c = m, { t: n } = Y(), p = B(""), u = B(!1), _ = B(""), f = B(!1), y = B();
|
|
434
|
+
let x, A, b;
|
|
435
|
+
function I() {
|
|
436
|
+
x == null || x.abort(), clearTimeout(A), A = void 0, clearTimeout(b), b = void 0;
|
|
437
|
+
}
|
|
438
|
+
async function P(l, g, v) {
|
|
439
|
+
if (!v.aborted) {
|
|
440
|
+
try {
|
|
441
|
+
const d = await J.getClient(l, g, v);
|
|
442
|
+
if (v.aborted) return;
|
|
443
|
+
if (f.value = d.status === "connected" || d.status === "connecting" && d.connectedAt !== null, d.status === "connected" && d.connectedAt !== null && d.profileStatus === "ready") {
|
|
444
|
+
I(), f.value = !1, y.value = d, c("connected", d), b = setTimeout(() => {
|
|
445
|
+
h.value = !1;
|
|
446
|
+
}, 1800);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (d.status === "disconnected") {
|
|
450
|
+
I(), f.value = !1, p.value = "", _.value = n("connect.whatsappBot.errors.qrExpired");
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
} catch (d) {
|
|
454
|
+
if (v.aborted) return;
|
|
455
|
+
if (d instanceof oe && d.status === 409) {
|
|
456
|
+
I(), f.value = !1, p.value = "", _.value = n("connect.whatsappBot.errors.accountAlreadyLinked");
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
v.aborted || (A = setTimeout(() => {
|
|
461
|
+
P(l, g, v);
|
|
462
|
+
}, 2e3));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
async function w() {
|
|
466
|
+
I();
|
|
467
|
+
const l = new AbortController();
|
|
468
|
+
x = l, p.value = "", _.value = "", f.value = !1, y.value = void 0, u.value = !0;
|
|
469
|
+
try {
|
|
470
|
+
const g = K.getBusinessId();
|
|
471
|
+
if (!g)
|
|
472
|
+
throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
|
|
473
|
+
const v = await J.createClient(
|
|
474
|
+
g,
|
|
475
|
+
l.signal
|
|
476
|
+
), d = await re.toDataURL(v.qr, {
|
|
477
|
+
width: 224,
|
|
478
|
+
margin: 2,
|
|
479
|
+
errorCorrectionLevel: "M"
|
|
480
|
+
});
|
|
481
|
+
l.signal.aborted || (p.value = d, P(g, v.clientId, l.signal));
|
|
482
|
+
} catch (g) {
|
|
483
|
+
l.signal.aborted || (_.value = g instanceof Error ? g.message : n("connect.whatsappBot.errors.loadQr"));
|
|
484
|
+
} finally {
|
|
485
|
+
l.signal.aborted || (u.value = !1);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return H(
|
|
489
|
+
h,
|
|
490
|
+
(l) => {
|
|
491
|
+
l ? w() : I();
|
|
492
|
+
},
|
|
493
|
+
{ immediate: !0 }
|
|
494
|
+
), te(I), (l, g) => {
|
|
495
|
+
const v = k("i18n-t"), d = k("FmCircularProgress"), G = k("FmButton"), V = k("FmDialog");
|
|
496
|
+
return o(), T(V, {
|
|
497
|
+
modelValue: h.value,
|
|
498
|
+
"onUpdate:modelValue": g[0] || (g[0] = (L) => h.value = L),
|
|
499
|
+
"min-width": "min(720px, calc(100% - 32px))",
|
|
500
|
+
"max-width": "720px",
|
|
501
|
+
"max-height": "90vh",
|
|
502
|
+
"dismiss-away": ""
|
|
503
|
+
}, {
|
|
504
|
+
"dialog-header": S(() => [
|
|
505
|
+
t("h2", qe, a(e(n)("connect.whatsappBot.connectAccount")), 1)
|
|
506
|
+
]),
|
|
507
|
+
default: S(() => {
|
|
508
|
+
var L, E, r;
|
|
509
|
+
return [
|
|
510
|
+
y.value ? (o(), i("div", et, [
|
|
511
|
+
g[1] || (g[1] = t("div", {
|
|
512
|
+
"aria-hidden": "true",
|
|
513
|
+
class: "w-[64px] h-[64px] rounded-full bg-fm-color-system-success-100 text-fm-color-typo-success flex items-center justify-center mb-[8px]"
|
|
514
|
+
}, [
|
|
515
|
+
t("svg", {
|
|
516
|
+
width: "32",
|
|
517
|
+
height: "32",
|
|
518
|
+
viewBox: "0 0 24 24",
|
|
519
|
+
fill: "none",
|
|
520
|
+
stroke: "currentColor",
|
|
521
|
+
"stroke-width": "2.2",
|
|
522
|
+
"stroke-linecap": "round",
|
|
523
|
+
"stroke-linejoin": "round"
|
|
524
|
+
}, [
|
|
525
|
+
t("path", { d: "M20 6 9 17l-5-5" })
|
|
526
|
+
])
|
|
527
|
+
], -1)),
|
|
528
|
+
t("h3", tt, a(e(n)("connect.whatsappBot.accountConnected")), 1),
|
|
529
|
+
t("p", ot, a(((L = y.value.account) == null ? void 0 : L.businessName) || ((E = y.value.account) == null ? void 0 : E.name) || e(n)("connect.whatsappBot.unnamedAccount")) + " · " + a(((r = y.value.account) == null ? void 0 : r.phoneNumber) || e(n)("connect.whatsappBot.phoneUnavailable")), 1)
|
|
530
|
+
])) : (o(), i("div", nt, [
|
|
531
|
+
t("div", at, [
|
|
532
|
+
t("p", lt, a(e(n)("connect.whatsappBot.scanDescription")), 1),
|
|
533
|
+
t("ol", st, [
|
|
534
|
+
(o(), i(N, null, X(4, (s) => t("li", {
|
|
535
|
+
key: s,
|
|
536
|
+
class: "flex gap-[12px]"
|
|
537
|
+
}, [
|
|
538
|
+
t("span", rt, a(s), 1),
|
|
539
|
+
s === 1 ? (o(), i("span", ct, a(e(n)("connect.whatsappBot.steps.openApp")), 1)) : s === 2 ? (o(), T(v, {
|
|
540
|
+
key: 1,
|
|
541
|
+
keypath: "connect.whatsappBot.steps.openSettings",
|
|
542
|
+
tag: "span",
|
|
543
|
+
scope: "global"
|
|
544
|
+
}, {
|
|
545
|
+
menu: S(() => [
|
|
546
|
+
t("b", it, a(e(n)("connect.whatsappBot.menu")), 1)
|
|
547
|
+
]),
|
|
548
|
+
settings: S(() => [
|
|
549
|
+
t("b", pt, a(e(n)("connect.whatsappBot.settings")), 1)
|
|
550
|
+
]),
|
|
551
|
+
_: 1
|
|
552
|
+
})) : s === 3 ? (o(), T(v, {
|
|
553
|
+
key: 2,
|
|
554
|
+
keypath: "connect.whatsappBot.steps.linkDevice",
|
|
555
|
+
tag: "span",
|
|
556
|
+
scope: "global"
|
|
557
|
+
}, {
|
|
558
|
+
linkedDevices: S(() => [
|
|
559
|
+
t("b", ut, a(e(n)("connect.whatsappBot.linkedDevices")), 1)
|
|
560
|
+
]),
|
|
561
|
+
linkDevice: S(() => [
|
|
562
|
+
t("b", dt, a(e(n)("connect.whatsappBot.linkDevice")), 1)
|
|
563
|
+
]),
|
|
564
|
+
_: 1
|
|
565
|
+
})) : (o(), i("span", mt, a(e(n)("connect.whatsappBot.steps.scanQr")), 1))
|
|
566
|
+
])), 64))
|
|
567
|
+
]),
|
|
568
|
+
t("p", ft, a(e(n)("connect.whatsappBot.connectionNote")), 1)
|
|
569
|
+
]),
|
|
570
|
+
t("div", xt, [
|
|
571
|
+
u.value ? (o(), i("div", vt, [
|
|
572
|
+
$(d),
|
|
573
|
+
Q(a(e(n)("connect.whatsappBot.generatingQr")), 1)
|
|
574
|
+
])) : _.value ? (o(), i("div", ht, [
|
|
575
|
+
t("p", _t, a(_.value), 1),
|
|
576
|
+
$(G, {
|
|
577
|
+
label: e(n)("connect.whatsappBot.tryAgain"),
|
|
578
|
+
"prepend-icon": "refresh",
|
|
579
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
580
|
+
onClick: w
|
|
581
|
+
}, null, 8, ["label"])
|
|
582
|
+
])) : p.value ? (o(), i("img", {
|
|
583
|
+
key: 2,
|
|
584
|
+
src: p.value,
|
|
585
|
+
alt: e(n)("connect.whatsappBot.qrAlt"),
|
|
586
|
+
width: "224",
|
|
587
|
+
height: "224",
|
|
588
|
+
class: R({ "opacity-20": f.value })
|
|
589
|
+
}, null, 10, gt)) : D("", !0),
|
|
590
|
+
f.value ? (o(), i("div", yt, [
|
|
591
|
+
$(d),
|
|
592
|
+
Q(" " + a(e(n)("connect.whatsappBot.connecting")), 1)
|
|
593
|
+
])) : D("", !0)
|
|
594
|
+
])
|
|
595
|
+
]))
|
|
596
|
+
];
|
|
597
|
+
}),
|
|
598
|
+
_: 1
|
|
599
|
+
}, 8, ["modelValue"]);
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
}), wt = { class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] xs:px-[16px] py-[32px] flex flex-col items-center text-center gap-[8px]" }, Bt = { class: "text-[20px] leading-[28px] font-bold" }, kt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px] [text-wrap:pretty]" }, $t = ["aria-label"], Ct = {
|
|
603
|
+
"aria-hidden": "true",
|
|
604
|
+
class: "flex h-[36px] w-[36px] shrink-0 items-center justify-center rounded-[10px] bg-fm-color-primary-oats text-fm-color-primary"
|
|
605
|
+
}, At = { class: "flex flex-col gap-[4px]" }, It = { class: "text-[14px] leading-[20px] font-semibold" }, Tt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ft = /* @__PURE__ */ Z({
|
|
606
|
+
__name: "WhatsappEmptyState",
|
|
607
|
+
emits: ["connect"],
|
|
608
|
+
setup(C, { emit: m }) {
|
|
609
|
+
const h = m, { t: c } = Y();
|
|
610
|
+
return (n, p) => {
|
|
611
|
+
const u = k("FmIcon"), _ = k("FmButton");
|
|
612
|
+
return o(), i("div", wt, [
|
|
613
|
+
p[1] || (p[1] = t("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
|
|
614
|
+
t("svg", {
|
|
615
|
+
width: "34",
|
|
616
|
+
height: "34",
|
|
617
|
+
viewBox: "0 0 24 24",
|
|
618
|
+
fill: "none",
|
|
619
|
+
stroke: "currentColor",
|
|
620
|
+
"stroke-width": "1.6",
|
|
621
|
+
"stroke-linecap": "round",
|
|
622
|
+
"stroke-linejoin": "round",
|
|
623
|
+
"aria-hidden": "true"
|
|
624
|
+
}, [
|
|
625
|
+
t("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
|
|
626
|
+
t("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
|
|
627
|
+
])
|
|
628
|
+
], -1)),
|
|
629
|
+
t("h2", Bt, a(e(c)("connect.whatsappBot.emptyTitle")), 1),
|
|
630
|
+
t("p", kt, a(e(c)("connect.whatsappBot.emptyDescription")), 1),
|
|
631
|
+
t("ul", {
|
|
632
|
+
"aria-label": e(c)("connect.whatsappBot.tutorial.title"),
|
|
633
|
+
class: "mt-[24px] grid w-full max-w-[880px] grid-cols-2 xs:grid-cols-1 gap-[20px] text-left"
|
|
634
|
+
}, [
|
|
635
|
+
(o(!0), i(N, null, X(e(z), (f) => (o(), i("li", {
|
|
636
|
+
key: f.key,
|
|
637
|
+
class: "flex items-start gap-[12px]"
|
|
638
|
+
}, [
|
|
639
|
+
t("div", Ct, [
|
|
640
|
+
$(u, {
|
|
641
|
+
name: f.icon,
|
|
642
|
+
size: "sm"
|
|
643
|
+
}, null, 8, ["name"])
|
|
644
|
+
]),
|
|
645
|
+
t("div", At, [
|
|
646
|
+
t("h3", It, a(e(c)(`connect.whatsappBot.tutorial.steps.${f.key}.title`)), 1),
|
|
647
|
+
t("p", Tt, a(e(c)(`connect.whatsappBot.tutorial.steps.${f.key}.description`)), 1)
|
|
648
|
+
])
|
|
649
|
+
]))), 128))
|
|
650
|
+
], 8, $t),
|
|
651
|
+
$(_, {
|
|
652
|
+
class: "mt-[16px] !rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
653
|
+
label: e(c)("connect.whatsappBot.connectAccount"),
|
|
654
|
+
"prepend-icon": "add",
|
|
655
|
+
onClick: p[0] || (p[0] = (f) => h("connect"))
|
|
656
|
+
}, null, 8, ["label"])
|
|
657
|
+
]);
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
function St(C) {
|
|
662
|
+
const m = B(!1);
|
|
663
|
+
let h = !1, c = !1, n = !1;
|
|
664
|
+
function p() {
|
|
665
|
+
return `feedme_connect_whatsapp_bot_tutorial:${C.value}`;
|
|
666
|
+
}
|
|
667
|
+
function u(y) {
|
|
668
|
+
let x = n;
|
|
669
|
+
try {
|
|
670
|
+
x || (x = localStorage.getItem(p()) === "1");
|
|
671
|
+
} catch {
|
|
672
|
+
}
|
|
673
|
+
h = !!C.value && !y && !x, c = !1;
|
|
674
|
+
}
|
|
675
|
+
function _() {
|
|
676
|
+
c = h;
|
|
677
|
+
}
|
|
678
|
+
function f() {
|
|
679
|
+
if (c) {
|
|
680
|
+
m.value = !0, n = !0;
|
|
681
|
+
try {
|
|
682
|
+
localStorage.setItem(p(), "1");
|
|
683
|
+
} catch {
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
h = !1, c = !1;
|
|
687
|
+
}
|
|
688
|
+
return H(
|
|
689
|
+
C,
|
|
690
|
+
() => {
|
|
691
|
+
m.value = !1, h = !1, c = !1, n = !1;
|
|
692
|
+
},
|
|
693
|
+
{ flush: "sync" }
|
|
694
|
+
), { tutorialOpen: m, startConnection: u, onConnected: _, onConnectionClosed: f };
|
|
695
|
+
}
|
|
696
|
+
const Pt = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, Vt = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, Lt = { class: "flex items-center gap-8" }, Dt = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, Et = { class: "flex items-center gap-[8px] flex-wrap" }, Mt = {
|
|
697
|
+
key: 0,
|
|
698
|
+
class: "mt-[8px] w-full text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
|
|
699
|
+
}, Wt = ["aria-label"], jt = {
|
|
700
|
+
key: 3,
|
|
701
|
+
role: "status",
|
|
702
|
+
class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
703
|
+
}, Ot = {
|
|
704
|
+
key: 4,
|
|
705
|
+
class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[16px]"
|
|
706
|
+
}, Ut = {
|
|
707
|
+
role: "alert",
|
|
708
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
709
|
+
}, Yt = /* @__PURE__ */ Z({
|
|
710
|
+
__name: "WhatsappBot",
|
|
711
|
+
setup(C) {
|
|
712
|
+
const { t: m } = Y(), h = ie(), c = pe(), n = M(() => {
|
|
713
|
+
var r, s;
|
|
714
|
+
return !!((s = (r = c.sessionUser.value) == null ? void 0 : r.role) != null && s.isAdmin);
|
|
715
|
+
}), p = M(() => K.getBusinessId()), { tutorialOpen: u, startConnection: _, onConnected: f, onConnectionClosed: y } = St(p), x = B([]), A = B(), b = B(!0), I = B("");
|
|
716
|
+
let P, w;
|
|
717
|
+
const l = M(
|
|
718
|
+
() => x.value.filter((r) => me(r) !== void 0)
|
|
719
|
+
), g = M(
|
|
720
|
+
() => [
|
|
721
|
+
{
|
|
722
|
+
label: m("connect.whatsappBot.accounts"),
|
|
723
|
+
value: U["$connect-WHATSAPP_BOT"],
|
|
724
|
+
badge: l.value.length
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
label: m("connect.whatsappBot.settings"),
|
|
728
|
+
value: U["$connect-WHATSAPP_BOT_SETTINGS"]
|
|
729
|
+
},
|
|
730
|
+
...n.value ? [
|
|
731
|
+
{
|
|
732
|
+
label: m("connect.whatsappBot.logs.title"),
|
|
733
|
+
value: U["$connect-WHATSAPP_BOT_LOGS"]
|
|
734
|
+
}
|
|
735
|
+
] : []
|
|
736
|
+
]
|
|
737
|
+
), v = M(() => {
|
|
738
|
+
const r = h.currentRoute.value.name;
|
|
739
|
+
return g.value.some((s) => s.value === r) ? r : U["$connect-WHATSAPP_BOT"];
|
|
740
|
+
});
|
|
741
|
+
async function d(r = !1) {
|
|
742
|
+
clearTimeout(w), P == null || P.abort();
|
|
743
|
+
const s = new AbortController();
|
|
744
|
+
P = s, r || (b.value = !0, I.value = "");
|
|
745
|
+
try {
|
|
746
|
+
const W = K.getBusinessId();
|
|
747
|
+
if (!W)
|
|
748
|
+
throw new Error(m("connect.whatsappBot.errors.selectBusiness"));
|
|
749
|
+
const j = await J.listClients(W, s.signal);
|
|
750
|
+
s.signal.aborted || (x.value = j, I.value = "");
|
|
751
|
+
} catch (W) {
|
|
752
|
+
!s.signal.aborted && !r && (I.value = W instanceof Error ? W.message : m("connect.whatsappBot.errors.loadSessions"));
|
|
753
|
+
} finally {
|
|
754
|
+
s.signal.aborted || (b.value = !1, w = setTimeout(() => void d(!0), 1e4));
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
function G(r) {
|
|
758
|
+
x.value = x.value.filter(
|
|
759
|
+
(s) => s.clientId !== r
|
|
760
|
+
), d(!0);
|
|
761
|
+
}
|
|
762
|
+
const V = B(!1);
|
|
763
|
+
function L() {
|
|
764
|
+
_(l.value.length > 0), V.value = !0;
|
|
765
|
+
}
|
|
766
|
+
function E(r) {
|
|
767
|
+
A.value = r.clientId, x.value = [
|
|
768
|
+
...x.value.filter((s) => s.clientId !== r.clientId),
|
|
769
|
+
r
|
|
770
|
+
], f();
|
|
771
|
+
}
|
|
772
|
+
return H(V, (r) => {
|
|
773
|
+
r || (y(), d());
|
|
774
|
+
}), H(
|
|
775
|
+
p,
|
|
776
|
+
() => {
|
|
777
|
+
V.value = !1, A.value = void 0, x.value = [], d();
|
|
778
|
+
},
|
|
779
|
+
{ immediate: !0 }
|
|
780
|
+
), te(() => {
|
|
781
|
+
P == null || P.abort(), clearTimeout(w);
|
|
782
|
+
}), (r, s) => {
|
|
783
|
+
var ne, ae;
|
|
784
|
+
const W = k("FmPill"), j = k("FmButton"), q = k("RouterLink"), ee = k("RouterView"), O = k("FmCircularProgress");
|
|
785
|
+
return o(), i(N, null, [
|
|
786
|
+
t("div", Pt, [
|
|
787
|
+
t("div", Vt, [
|
|
788
|
+
t("div", Lt, [
|
|
789
|
+
t("h1", Dt, a(e(m)("connect.navigation.whatsappBot")), 1),
|
|
790
|
+
$(W, { variant: "beta" })
|
|
791
|
+
]),
|
|
792
|
+
t("div", Et, [
|
|
793
|
+
$(j, {
|
|
794
|
+
variant: "tertiary",
|
|
795
|
+
label: e(m)("connect.whatsappBot.tutorial.learnMore"),
|
|
796
|
+
"prepend-icon": "help_outline",
|
|
797
|
+
class: "!h-[36px] !rounded-full !px-[16px] [&_.label]:text-[14px]",
|
|
798
|
+
onClick: s[0] || (s[0] = (F) => u.value = !0)
|
|
799
|
+
}, null, 8, ["label"]),
|
|
800
|
+
v.value === e(U)["$connect-WHATSAPP_BOT"] && l.value.length ? (o(), T(j, {
|
|
801
|
+
key: 0,
|
|
802
|
+
label: e(m)("connect.whatsappBot.connectAccountCta"),
|
|
803
|
+
"prepend-icon": "add",
|
|
804
|
+
class: "!h-[36px] !rounded-full !px-[16px] [&_.label]:text-[14px]",
|
|
805
|
+
onClick: L
|
|
806
|
+
}, null, 8, ["label"])) : D("", !0)
|
|
807
|
+
])
|
|
808
|
+
]),
|
|
809
|
+
l.value.length ? (o(), i("p", Mt, a(e(m)("connect.whatsappBot.description")), 1)) : D("", !0),
|
|
810
|
+
t("nav", {
|
|
811
|
+
"aria-label": e(m)("connect.navigation.whatsappBot"),
|
|
812
|
+
class: "mt-[16px] flex gap-[24px] overflow-x-auto border-b border-fm-color-neutral-gray-100"
|
|
813
|
+
}, [
|
|
814
|
+
(o(!0), i(N, null, X(g.value, (F) => (o(), T(q, {
|
|
815
|
+
key: F.value,
|
|
816
|
+
to: { name: F.value },
|
|
817
|
+
"aria-current": v.value === F.value ? "page" : void 0,
|
|
818
|
+
class: R([
|
|
819
|
+
"flex h-[40px] shrink-0 items-center gap-[6px] whitespace-nowrap border-b-[2px] px-[2px] text-[14px] leading-[20px] font-medium no-underline transition-colors hover:text-fm-color-primary focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-fm-color-primary",
|
|
820
|
+
v.value === F.value ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-fm-color-typo-secondary"
|
|
821
|
+
])
|
|
822
|
+
}, {
|
|
823
|
+
default: S(() => [
|
|
824
|
+
Q(a(F.label) + " ", 1),
|
|
825
|
+
F.badge ? (o(), i("span", {
|
|
826
|
+
key: 0,
|
|
827
|
+
class: R([
|
|
828
|
+
"min-w-[20px] rounded-full px-[6px] text-center text-[12px] leading-[20px] font-semibold tabular-nums",
|
|
829
|
+
v.value === F.value ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
830
|
+
])
|
|
831
|
+
}, a(F.badge), 3)) : D("", !0)
|
|
832
|
+
]),
|
|
833
|
+
_: 2
|
|
834
|
+
}, 1032, ["to", "aria-current", "class"]))), 128))
|
|
835
|
+
], 8, Wt),
|
|
836
|
+
v.value === e(U)["$connect-WHATSAPP_BOT_SETTINGS"] ? (o(), T(ee, { key: 1 })) : v.value === e(U)["$connect-WHATSAPP_BOT_LOGS"] ? (o(), T(ee, {
|
|
837
|
+
key: 2,
|
|
838
|
+
accounts: l.value
|
|
839
|
+
}, null, 8, ["accounts"])) : b.value ? (o(), i("div", jt, [
|
|
840
|
+
$(O),
|
|
841
|
+
Q(" " + a(e(m)("connect.whatsappBot.loadingSessions")), 1)
|
|
842
|
+
])) : I.value ? (o(), i("div", Ot, [
|
|
843
|
+
t("p", Ut, a(I.value), 1),
|
|
844
|
+
$(j, {
|
|
845
|
+
label: e(m)("connect.whatsappBot.tryAgain"),
|
|
846
|
+
"prepend-icon": "refresh",
|
|
847
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
848
|
+
onClick: s[1] || (s[1] = (F) => d())
|
|
849
|
+
}, null, 8, ["label"])
|
|
850
|
+
])) : l.value.length ? (o(), T(Se, {
|
|
851
|
+
key: 5,
|
|
852
|
+
accounts: l.value,
|
|
853
|
+
onRemoved: G
|
|
854
|
+
}, null, 8, ["accounts"])) : (o(), T(Ft, {
|
|
855
|
+
key: 6,
|
|
856
|
+
onConnect: L
|
|
857
|
+
}))
|
|
858
|
+
]),
|
|
859
|
+
(o(), T(bt, {
|
|
860
|
+
key: p.value,
|
|
861
|
+
modelValue: V.value,
|
|
862
|
+
"onUpdate:modelValue": s[2] || (s[2] = (F) => V.value = F),
|
|
863
|
+
onConnected: E
|
|
864
|
+
}, null, 8, ["modelValue"])),
|
|
865
|
+
$(Ye, {
|
|
866
|
+
modelValue: e(u),
|
|
867
|
+
"onUpdate:modelValue": s[3] || (s[3] = (F) => ce(u) ? u.value = F : null),
|
|
868
|
+
"client-id": ((ne = l.value.find((F) => F.clientId === A.value)) == null ? void 0 : ne.clientId) ?? ((ae = l.value[0]) == null ? void 0 : ae.clientId)
|
|
869
|
+
}, null, 8, ["modelValue", "client-id"])
|
|
870
|
+
], 64);
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
export {
|
|
875
|
+
Yt as default
|
|
876
|
+
};
|