@feedmepos/mf-connect 0.1.98-beta.86 → 0.1.98-beta.89
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 +62 -5
- package/dist/{App-C3brXgJH.js → App-D4hRwK-o.js} +586 -569
- package/dist/{AuditLogs-CknggPMD.js → AuditLogs-D_PrLKVP.js} +13 -13
- package/dist/{Bin-BOE-Liwr.js → Bin-DF_1hlo5.js} +8 -8
- package/dist/{Broadcast-BStqQOUT.js → Broadcast-D81xkQ0B.js} +12 -12
- package/dist/{CampaignAnalytic-Dga32CpH.js → CampaignAnalytic-960oR5Nw.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CldyOaCt.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-WOfSfATi.js} +8 -8
- package/dist/{Card-CQxp73o4.js → Card-nF9lexRS.js} +23 -23
- package/dist/{Collections-BRms0YoR.js → Collections-CJbGLkwm.js} +8 -8
- package/dist/{Credit-DW7Vq-01.js → Credit-tfInnpDW.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BXK40fTr.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CAPxB3r7.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bv2r2gFI.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BM2UlBtj.js} +35 -36
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-TBjXJglM.js → EffectSheet.vue_vue_type_style_index_0_lang-BfrzJxWQ.js} +6 -6
- package/dist/{Experience-C_H8mmJJ.js → Experience-2uX3ESg5.js} +13 -13
- package/dist/{FileSaver.min-C5N6-O4l.js → FileSaver.min-DqWpgesn.js} +1 -1
- package/dist/{Game-LgNoMtbs.js → Game-BQtHns1v.js} +13 -13
- package/dist/{GiftCardSetup-DmL416w3.js → GiftCardSetup-B4I83SkJ.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DqDerUNT.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DujMhaOh.js} +7 -7
- package/dist/{Goals-D-maM_jj.js → Goals-DSkXACjH.js} +4 -4
- package/dist/{Grab-DKbgjw7e.js → Grab-ArpQ-7LU.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZ3UDnkx.js → ImageInput.vue_vue_type_script_setup_true_lang-GdfKNEdQ.js} +1 -1
- package/dist/{Index-_cZDq1HS.js → Index-Bb8k7ofl.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Chm-x4fo.js → LocationPicker.vue_vue_type_script_setup_true_lang-tHLWrX4C.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Ez1QV7ON.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C5E_mvcD.js} +1 -1
- package/dist/{LoyaltyDashboard-D1B3MjhC.js → LoyaltyDashboard-C-U8HulY.js} +23 -24
- package/dist/MainLayout-TV3HyBYh.js +4 -0
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-Bf-Kvl5W.js → MainLayout.vue_vue_type_script_setup_true_lang-lO1k_OLo.js} +5 -4
- package/dist/{Marketing-C4apg5nO.js → Marketing-CWe_R_3E.js} +4 -4
- package/dist/MarketingMaterialEdit-TGP6o6Vv.js +1037 -0
- package/dist/{Member-B2W3wm1r.js → Member-DDZ8TLLZ.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-l3edYke6.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CweUf6Iv.js} +24 -24
- package/dist/{MemberImportHistory-C3i6ekKS.js → MemberImportHistory-Til1afm1.js} +7 -7
- package/dist/{MemberList-CsIsMafE.js → MemberList-uoSeAZlO.js} +14 -14
- package/dist/{MemberTransactions-Cdndq5ic.js → MemberTransactions-MxJWI1es.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BtVvv1xd.js → MessageInput.vue_vue_type_script_setup_true_lang-B4H67Tvb.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DwXsAI7F.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DhHMIgza.js} +1 -1
- package/dist/{Mission-Fa1VYYZa.js → Mission-C_hcFlzC.js} +14 -14
- package/dist/{Overview-DSmO8LtX.js → Overview-B3ugdY_2.js} +4 -4
- package/dist/{Overview-oxeTbsQ8.js → Overview-Bxe-Kfci.js} +21 -21
- package/dist/{Point-CWpQn9W_.js → Point-BBVTyXIL.js} +14 -14
- package/dist/{Promotion-CoYdDRod.js → Promotion-D-44JTkv.js} +14 -14
- package/dist/{Queue-Bij3hgY2.js → Queue-BNjlzhJ_.js} +13 -13
- package/dist/{Record-Be2TI_X_.js → Record-C34UZ1q6.js} +9 -9
- package/dist/{Review-C-QnIayC.js → Review-C4iuNBR7.js} +2 -2
- package/dist/{ReviewFacebookCallback-CPyXfHvB.js → ReviewFacebookCallback-Bsp6WSaQ.js} +5 -5
- package/dist/{ReviewGoogleCallback-BPNB0btT.js → ReviewGoogleCallback-Ddqe1tZZ.js} +5 -5
- package/dist/{Reward-RyaVdYyZ.js → Reward-CjybtjcT.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C2ebKu-S.js → RewardGroup.vue_vue_type_script_setup_true_lang-Do_obBgC.js} +14 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BZ_wN3Gj.js → RuleGroup.vue_vue_type_script_setup_true_lang-BiGexpsh.js} +15 -15
- package/dist/{Segment-CE7Ca2Zo.js → Segment-BU5W9wBQ.js} +26 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-vODQiSna.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Buih6X5R.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CgI_qWVw.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DN-VwmTf.js} +4 -4
- package/dist/{Setting-BC6ir0DR.js → Setting-BsCkMHQZ.js} +14 -14
- package/dist/{SettingAdvertisements-DLmxEwdG.js → SettingAdvertisements-CTTFCozw.js} +12 -12
- package/dist/{Settings-CF78Ug2K.js → Settings-D3_nrJff.js} +5 -5
- package/dist/{Store-CZTZTO1x.js → Store-DRWKc7Q7.js} +29 -30
- package/dist/{StoreRewards-BdtlvNcm.js → StoreRewards-_4iqQsak.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DSKYWLE_.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Db4fakO6.js} +25 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DsQiBOV4.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CAO3Ycxn.js} +2 -2
- package/dist/{Tier-5eUYHhoX.js → Tier-Cj_4Z8PG.js} +27 -27
- package/dist/{Title-ibn2JnRB.js → Title-Bjg44PZP.js} +23 -23
- package/dist/{Transaction-BZzL13MU.js → Transaction-DbehbwRK.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DUv9nFqV.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DeMdcwb2.js} +6 -6
- package/dist/{Voucher-B6qYDcnp.js → Voucher-DARWiV1M.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CI7NwvnH.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BYNjq7K0.js} +12 -12
- package/dist/WhatsappAccount-CBx-FoRb.js +158 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BFUOuRGy.js +39 -0
- package/dist/{WhatsappBot-BhrP6JnO.js → WhatsappBot-MSJq0pE4.js} +229 -221
- package/dist/WhatsappBotLogs-CEyUngzi.js +372 -0
- package/dist/WhatsappBotSettings-NIE8NeN4.js +387 -0
- package/dist/{WhatsappBotTickets-DJnC4c2j.js → WhatsappBotTickets-OCmEkzeD.js} +3 -3
- package/dist/WhatsappLayout-DLPLalle.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-D_bVWePp.js +195 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C2nesHNf.js → ZodTextField.vue_vue_type_script_setup_true_lang-HVcTakep.js} +2 -2
- package/dist/{app-C5bfcrJd.js → app-CsPUjtBR.js} +670 -522
- package/dist/app.js +1 -1
- package/dist/{base.export-0man_ZSH.js → base.export-CSSDz0q9.js} +2 -2
- package/dist/{business-BW09R8w1.js → business-BwGS0vma.js} +5 -5
- package/dist/{campaign-Dxbvq3Zl.js → campaign-Bw44Blhh.js} +8 -8
- package/dist/{campaign-gSM8Uzyl.js → campaign-CwfENerv.js} +2 -2
- package/dist/{campaign.fn-CzNJtky2.js → campaign.fn-Bx7g_BvU.js} +31 -31
- package/dist/{collection.fn-BVUdafur.js → collection.fn-Ba8-HPHO.js} +2 -2
- package/dist/{currency-CcWkcszY.js → currency-CO5xQCxT.js} +1 -1
- package/dist/{duplicateCampaign-DDfAc-AY.js → duplicateCampaign-C2FQFuzl.js} +2 -2
- package/dist/{effect-Dn7anzDq.js → effect-BUxZHyCk.js} +1 -1
- package/dist/{email-addresses-BRRFCqW3.js → email-addresses-CfdqSZi6.js} +2 -2
- package/dist/feature-flag-DpIT0Nh2.js +50 -0
- package/dist/{helper-DPI5b1e1.js → helper-miVbMaVy.js} +1 -1
- package/dist/{index-D9SBKZvv.js → index-BC30mczi.js} +9 -9
- package/dist/{index-ZLyACIvN.js → index-Bshl0e-c.js} +2 -2
- package/dist/{index-_EvVNmhF.js → index-CMGEBPm-.js} +7746 -5975
- package/dist/{index-DtZ450Y-.js → index-CNX6rFiO.js} +3 -3
- package/dist/{index-CeDuysyp.js → index-CW07TXqO.js} +2 -2
- package/dist/{index-Dv9W26wg.js → index-CYVDCxVj.js} +1 -1
- package/dist/{index-Bi4203Wb.js → index-Co3X9LyE.js} +1 -1
- package/dist/{index-DPS6iW7Q.js → index-CxzJwolN.js} +1 -1
- package/dist/{index-D8rPhlZa.js → index-CyMrx8XA.js} +1 -1
- package/dist/{index-KNE2wEbP.js → index-D6RtVzN9.js} +2 -2
- package/dist/{index-CoFJoIox.js → index-DIOb3eOI.js} +14 -14
- package/dist/{index-BsSqDkI8.js → index-DSwOhkYZ.js} +2 -2
- package/dist/{index-U6kp2_A3.js → index-DgnQ18-j.js} +1 -1
- package/dist/{index-BBLmqV8g.js → index-Dy7VtHTZ.js} +3 -3
- package/dist/{index-xLDLoo67.js → index-L7SBt-2D.js} +19 -13
- package/dist/index-RwNlbTO8.js +115 -0
- package/dist/{index-BQ-9m3Ro.js → index-Se-R3ekJ.js} +2 -2
- package/dist/{index-BLQbc3Rv.js → index-bJ2Ur1Yd.js} +1 -1
- package/dist/{index-LSYjttVr.js → index-gP-EJA-Y.js} +2 -2
- package/dist/{index-ButxHAMi.js → index-mBHnjwCf.js} +10 -10
- package/dist/{index-sVyIf_p-.js → index-nZUfIfsn.js} +4 -4
- package/dist/{index.esm2017-DQJ6E2gu.js → index.esm2017-DlOLsAJL.js} +1 -1
- package/dist/{loading-DOyd2D4O.js → loading-BEDz7eTi.js} +1 -1
- package/dist/{lodash-BLqC3Cwx.js → lodash-Bx7d35Zs.js} +1 -1
- package/dist/{member-import-x7Vw0b3w.js → member-import-D4zgQyJX.js} +1 -1
- package/dist/{membership-CE9vEP2d.js → membership-VJBDeKcE.js} +2 -2
- package/dist/{money-CX-ZAEDu.js → money-Dh0agFMv.js} +1 -1
- package/dist/{number-CSungdQc.js → number-D2coZpxW.js} +1 -1
- package/dist/{objectid-DwEAf7Cc.js → objectid-DVSB63oC.js} +10 -10
- package/dist/{onboarding-BAJgDH9y.js → onboarding-CLwhjKAL.js} +3 -3
- package/dist/{onboardingSetup-GvIYNiAE.js → onboardingSetup-78evK8yB.js} +2 -2
- package/dist/{plugins-B1AphVoU.js → plugins-CKViI6Y3.js} +3 -3
- package/dist/{MarketingMaterialEdit-Dcjzvwfv.js → remy-icon-BhUGu2NI.js} +2 -1034
- package/dist/{reward-D2zC58M2.js → reward-Drd9EaxJ.js} +1 -1
- package/dist/{rule-CxoPKAlI.js → rule-Dr21X2h0.js} +10 -10
- package/dist/{template-KRS1NbWX.js → template-yVg3lQKo.js} +6 -6
- package/dist/{timezone-CW8sKc69.js → timezone-CGlmgCYo.js} +1 -1
- package/dist/{transaction.fn-Djbx8lHM.js → transaction.fn-outAFFwM.js} +2 -2
- package/dist/{trigger-RkjkEHrL.js → trigger-C1GL_8pm.js} +7 -7
- package/dist/{useMarketingMaterialActions-BUnl-bFY.js → useMarketingMaterialActions-D8MIFnMy.js} +3 -3
- package/dist/{usePagination-vdRzCfJw.js → usePagination-Dlx9q4a8.js} +1 -1
- package/dist/useWhatsappAccount-1Yy7aaA9.js +62 -0
- package/dist/{user-CamDVkKA.js → user-BtORKvTK.js} +1 -1
- package/dist/{vue-i18n-DwgfDwGn.js → vue-i18n-CkZqjA2G.js} +355 -355
- package/dist/{xlsx-DkuYe2Jz.js → xlsx-HAQ29LQq.js} +1 -1
- package/dist/{zod-BDeUQtCa.js → zod-DByiKRxr.js} +1 -1
- package/package.json +1 -1
- package/dist/MainLayout-C115sjz6.js +0 -4
- package/dist/WhatsappAccount-CodbP5kY.js +0 -342
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BAgSc0i4.js +0 -97
- package/dist/WhatsappBotSettings-CjDKw25J.js +0 -394
- package/dist/WhatsappLayout-BgW1ASQE.js +0 -21
- package/dist/feature-flag-D2MJ8eLY.js +0 -18
- package/dist/index-BVdImOs0.js +0 -1775
- package/dist/index-DgkRREfK.js +0 -72
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as M, ref as T, computed as L, watch as R, onBeforeUnmount as Q, resolveComponent as w, openBlock as n, createElementBlock as m, createElementVNode as o, normalizeClass as U, unref as e, toDisplayString as r, createBlock as k, withCtx as I, createTextVNode as G, createVNode as A, createCommentVNode as V, withModifiers as ae, Fragment as Z, renderList as q, useModel as se, mergeProps as le, createSlots as re } from "vue";
|
|
2
|
+
import { u as z } from "./vue-i18n-CkZqjA2G.js";
|
|
3
3
|
import { useRouter as ce } from "vue-router";
|
|
4
|
-
import { S as
|
|
5
|
-
import { w as
|
|
6
|
-
import { u as ue,
|
|
7
|
-
import { R as
|
|
4
|
+
import { S as D, a as ie } from "./index-CMGEBPm-.js";
|
|
5
|
+
import { w as N } from "./index-L7SBt-2D.js";
|
|
6
|
+
import { u as ue, w as pe } from "./useWhatsappAccount-1Yy7aaA9.js";
|
|
7
|
+
import { R as g } from "./app-CsPUjtBR.js";
|
|
8
|
+
import { _ as de } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BFUOuRGy.js";
|
|
8
9
|
import { b as me } from "./browser-BSAOEeIM.js";
|
|
9
|
-
const fe = { class: "flex items-center gap-[12px]" },
|
|
10
|
+
const fe = { class: "flex items-center gap-[12px]" }, ve = ["src"], xe = { key: 1 }, _e = { class: "min-w-0 flex-1" }, he = ["title"], ge = { key: 1 }, ye = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, be = { class: "relative z-10 flex shrink-0 items-center gap-[12px]" }, we = ["aria-label", "title", "disabled", "aria-busy"], Be = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Te = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "text-[12px] text-fm-color-typo-secondary"
|
|
12
13
|
}, ke = {
|
|
@@ -19,50 +20,50 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
19
20
|
account: {}
|
|
20
21
|
},
|
|
21
22
|
emits: ["removed"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
let
|
|
23
|
+
setup(F, { emit: i }) {
|
|
24
|
+
const s = F, f = i, { t: v, locale: u } = z(), l = T(!1), _ = T("");
|
|
25
|
+
let x;
|
|
25
26
|
const {
|
|
26
27
|
name: $,
|
|
27
|
-
phoneNumber:
|
|
28
|
-
initials:
|
|
29
|
-
state:
|
|
30
|
-
avatarColor:
|
|
31
|
-
profilePictureUrl:
|
|
28
|
+
phoneNumber: P,
|
|
29
|
+
initials: y,
|
|
30
|
+
state: E,
|
|
31
|
+
avatarColor: C,
|
|
32
|
+
profilePictureUrl: h,
|
|
32
33
|
profilePictureFailed: c
|
|
33
|
-
} = ue(() =>
|
|
34
|
-
name:
|
|
35
|
-
params: { clientId:
|
|
34
|
+
} = ue(() => s.account), p = L(() => E.value === "connected"), d = L(() => ({
|
|
35
|
+
name: g["$connect-WHATSAPP_ACCOUNT"],
|
|
36
|
+
params: { clientId: s.account.clientId }
|
|
36
37
|
}));
|
|
37
|
-
function W(
|
|
38
|
+
function W(S) {
|
|
38
39
|
return new Intl.DateTimeFormat(u.value, {
|
|
39
40
|
year: "numeric",
|
|
40
41
|
month: "short",
|
|
41
42
|
day: "numeric"
|
|
42
|
-
}).format(new Date(
|
|
43
|
+
}).format(new Date(S));
|
|
43
44
|
}
|
|
44
|
-
async function
|
|
45
|
+
async function j() {
|
|
45
46
|
if (l.value) return;
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
|
|
47
|
+
const S = D.getBusinessId();
|
|
48
|
+
if (!S) {
|
|
49
|
+
_.value = v("connect.whatsappBot.errors.selectBusiness");
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const a = s.account.clientId, t = new AbortController();
|
|
53
|
+
x = t, l.value = !0, _.value = "";
|
|
53
54
|
try {
|
|
54
|
-
await
|
|
55
|
+
await N.deleteClient(S, a, t.signal), t.signal.aborted || f("removed", a);
|
|
55
56
|
} catch {
|
|
56
|
-
t.signal.aborted || (
|
|
57
|
+
t.signal.aborted || (_.value = v("connect.whatsappBot.errors.removeAccount"));
|
|
57
58
|
} finally {
|
|
58
|
-
|
|
59
|
+
x === t && (x = void 0, l.value = !1);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
62
|
+
function B() {
|
|
63
|
+
x == null || x.abort(), x = void 0, l.value = !1, _.value = "";
|
|
63
64
|
}
|
|
64
|
-
return R(() =>
|
|
65
|
-
const t =
|
|
65
|
+
return R(() => D.getBusinessId(), B), Q(B), (S, a) => {
|
|
66
|
+
const t = w("RouterLink"), b = w("FmIcon"), O = w("FmCircularProgress");
|
|
66
67
|
return n(), m("li", null, [
|
|
67
68
|
o("div", {
|
|
68
69
|
class: U(["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", {
|
|
@@ -72,45 +73,45 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
72
73
|
o("div", fe, [
|
|
73
74
|
o("div", {
|
|
74
75
|
"aria-hidden": "true",
|
|
75
|
-
class: U(["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(
|
|
76
|
+
class: U(["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(C)])
|
|
76
77
|
}, [
|
|
77
|
-
e(
|
|
78
|
+
e(h) && !e(c) ? (n(), m("img", {
|
|
78
79
|
key: 0,
|
|
79
|
-
src: e(
|
|
80
|
+
src: e(h),
|
|
80
81
|
alt: "",
|
|
81
82
|
class: "w-full h-full object-cover",
|
|
82
83
|
referrerpolicy: "no-referrer",
|
|
83
|
-
onError:
|
|
84
|
-
}, null, 40,
|
|
84
|
+
onError: a[0] || (a[0] = (J) => c.value = !0)
|
|
85
|
+
}, null, 40, ve)) : (n(), m("span", xe, r(e(y)), 1))
|
|
85
86
|
], 2),
|
|
86
|
-
o("div",
|
|
87
|
+
o("div", _e, [
|
|
87
88
|
o("h2", {
|
|
88
89
|
class: "text-[16px] leading-[24px] font-semibold truncate",
|
|
89
90
|
title: e($)
|
|
90
91
|
}, [
|
|
91
|
-
p.value ? (n(),
|
|
92
|
+
p.value ? (n(), k(t, {
|
|
92
93
|
key: 0,
|
|
93
94
|
to: d.value,
|
|
94
95
|
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]"
|
|
95
96
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
97
|
+
default: I(() => [
|
|
98
|
+
G(r(e($)), 1)
|
|
98
99
|
]),
|
|
99
100
|
_: 1
|
|
100
101
|
}, 8, ["to"])) : (n(), m("span", ge, r(e($)), 1))
|
|
101
|
-
], 8,
|
|
102
|
-
o("p", ye, r(e(
|
|
102
|
+
], 8, he),
|
|
103
|
+
o("p", ye, r(e(P)), 1)
|
|
103
104
|
]),
|
|
104
105
|
o("div", be, [
|
|
105
|
-
p.value ? (n(),
|
|
106
|
+
p.value ? (n(), k(t, {
|
|
106
107
|
key: 0,
|
|
107
108
|
to: d.value,
|
|
108
|
-
"aria-label": e(
|
|
109
|
-
title: e(
|
|
109
|
+
"aria-label": e(v)("connect.common.edit"),
|
|
110
|
+
title: e(v)("connect.common.edit"),
|
|
110
111
|
class: "w-[32px] h-[32px] flex items-center justify-center rounded-[8px] text-fm-color-typo-tertiary no-underline 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"
|
|
111
112
|
}, {
|
|
112
|
-
default:
|
|
113
|
-
|
|
113
|
+
default: I(() => [
|
|
114
|
+
A(b, {
|
|
114
115
|
name: "edit",
|
|
115
116
|
size: "sm",
|
|
116
117
|
outline: "",
|
|
@@ -118,21 +119,21 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
118
119
|
})
|
|
119
120
|
]),
|
|
120
121
|
_: 1
|
|
121
|
-
}, 8, ["to", "aria-label", "title"])) :
|
|
122
|
+
}, 8, ["to", "aria-label", "title"])) : V("", !0),
|
|
122
123
|
o("button", {
|
|
123
124
|
type: "button",
|
|
124
|
-
"aria-label": e(
|
|
125
|
-
title: e(
|
|
125
|
+
"aria-label": e(v)("connect.common.remove"),
|
|
126
|
+
title: e(v)("connect.common.remove"),
|
|
126
127
|
disabled: l.value,
|
|
127
128
|
"aria-busy": l.value,
|
|
128
129
|
class: "w-[32px] h-[32px] flex items-center justify-center rounded-[8px] text-fm-color-typo-tertiary transition-colors hover:bg-fm-color-system-error-100 hover:text-fm-color-typo-error focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary disabled:cursor-wait disabled:opacity-50",
|
|
129
|
-
onClick: ae(
|
|
130
|
+
onClick: ae(j, ["stop"])
|
|
130
131
|
}, [
|
|
131
|
-
l.value ? (n(),
|
|
132
|
+
l.value ? (n(), k(O, {
|
|
132
133
|
key: 0,
|
|
133
134
|
size: "md",
|
|
134
135
|
"aria-hidden": "true"
|
|
135
|
-
})) : (n(),
|
|
136
|
+
})) : (n(), k(b, {
|
|
136
137
|
key: 1,
|
|
137
138
|
name: "delete",
|
|
138
139
|
size: "sm",
|
|
@@ -143,40 +144,40 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
143
144
|
])
|
|
144
145
|
]),
|
|
145
146
|
o("div", Be, [
|
|
146
|
-
|
|
147
|
-
p.value &&
|
|
148
|
-
date: W(
|
|
149
|
-
})), 1)) :
|
|
147
|
+
A(de, { state: e(E) }, null, 8, ["state"]),
|
|
148
|
+
p.value && F.account.connectedAt ? (n(), m("span", Te, r(e(v)("connect.whatsappBot.connectedSince", {
|
|
149
|
+
date: W(F.account.connectedAt)
|
|
150
|
+
})), 1)) : V("", !0)
|
|
150
151
|
]),
|
|
151
|
-
|
|
152
|
+
_.value ? (n(), m("p", ke, r(_.value), 1)) : V("", !0)
|
|
152
153
|
], 2)
|
|
153
154
|
]);
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
|
-
}), $e = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" },
|
|
157
|
+
}), $e = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, Pe = /* @__PURE__ */ M({
|
|
157
158
|
__name: "WhatsappAccountList",
|
|
158
159
|
props: {
|
|
159
160
|
accounts: {}
|
|
160
161
|
},
|
|
161
162
|
emits: ["removed"],
|
|
162
|
-
setup(
|
|
163
|
-
const
|
|
164
|
-
return (f,
|
|
165
|
-
(n(!0), m(
|
|
163
|
+
setup(F, { emit: i }) {
|
|
164
|
+
const s = i;
|
|
165
|
+
return (f, v) => (n(), m("ul", $e, [
|
|
166
|
+
(n(!0), m(Z, null, q(F.accounts, (u) => (n(), k(Ae, {
|
|
166
167
|
key: u.clientId,
|
|
167
168
|
account: u,
|
|
168
|
-
onRemoved:
|
|
169
|
+
onRemoved: v[0] || (v[0] = (l) => s("removed", l))
|
|
169
170
|
}, null, 8, ["account"]))), 128))
|
|
170
171
|
]));
|
|
171
172
|
}
|
|
172
|
-
}),
|
|
173
|
+
}), Ce = { class: "text-[18px] font-semibold" }, Se = {
|
|
173
174
|
key: 0,
|
|
174
175
|
role: "status",
|
|
175
176
|
class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
|
|
176
177
|
}, Ie = { class: "text-[18px] font-semibold" }, Fe = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, Ee = {
|
|
177
178
|
key: 1,
|
|
178
179
|
class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
|
|
179
|
-
}, We = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" },
|
|
180
|
+
}, We = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, Oe = { class: "text-fm-color-typo-secondary" }, He = { class: "flex flex-col gap-[14px]" }, Ve = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, De = { key: 0 }, je = { class: "font-semibold" }, Le = { class: "font-semibold" }, Ne = { class: "font-semibold" }, Me = { class: "font-semibold" }, Re = { key: 3 }, Ue = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Ge = { class: "relative w-[232px] h-[232px] xs:justify-self-center border border-fm-color-neutral-gray-100 rounded-xl flex items-center justify-center overflow-hidden" }, ze = {
|
|
180
181
|
key: 0,
|
|
181
182
|
role: "status",
|
|
182
183
|
class: "flex flex-col items-center gap-[12px] text-[13px]"
|
|
@@ -198,85 +199,85 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
198
199
|
modelModifiers: {}
|
|
199
200
|
},
|
|
200
201
|
emits: ["update:modelValue"],
|
|
201
|
-
setup(
|
|
202
|
-
const i = se(
|
|
203
|
-
let
|
|
204
|
-
function
|
|
205
|
-
|
|
202
|
+
setup(F) {
|
|
203
|
+
const i = se(F, "modelValue"), { t: s } = z(), f = T(""), v = T(!1), u = T(""), l = T(!1), _ = T();
|
|
204
|
+
let x, $, P;
|
|
205
|
+
function y() {
|
|
206
|
+
x == null || x.abort(), clearTimeout($), $ = void 0, clearTimeout(P), P = void 0;
|
|
206
207
|
}
|
|
207
|
-
async function
|
|
208
|
+
async function E(h, c, p) {
|
|
208
209
|
if (!p.aborted) {
|
|
209
210
|
try {
|
|
210
|
-
const d = await
|
|
211
|
+
const d = await N.getClient(h, c, p);
|
|
211
212
|
if (p.aborted) return;
|
|
212
213
|
if (l.value = d.status === "connected" || d.status === "connecting" && d.connectedAt !== null, d.status === "connected" && d.connectedAt !== null && d.profileStatus === "ready") {
|
|
213
|
-
|
|
214
|
+
y(), l.value = !1, _.value = d, P = setTimeout(() => {
|
|
214
215
|
i.value = !1;
|
|
215
216
|
}, 1800);
|
|
216
217
|
return;
|
|
217
218
|
}
|
|
218
219
|
if (d.status === "disconnected") {
|
|
219
|
-
|
|
220
|
+
y(), l.value = !1, f.value = "", u.value = s("connect.whatsappBot.errors.qrExpired");
|
|
220
221
|
return;
|
|
221
222
|
}
|
|
222
223
|
} catch (d) {
|
|
223
224
|
if (p.aborted) return;
|
|
224
225
|
if (d instanceof ie && d.status === 409) {
|
|
225
|
-
|
|
226
|
+
y(), l.value = !1, f.value = "", u.value = s("connect.whatsappBot.errors.accountAlreadyLinked");
|
|
226
227
|
return;
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
p.aborted || ($ = setTimeout(() => {
|
|
230
|
-
|
|
231
|
+
E(h, c, p);
|
|
231
232
|
}, 2e3));
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
|
-
async function
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
235
|
+
async function C() {
|
|
236
|
+
y();
|
|
237
|
+
const h = new AbortController();
|
|
238
|
+
x = h, f.value = "", u.value = "", l.value = !1, _.value = void 0, v.value = !0;
|
|
238
239
|
try {
|
|
239
|
-
const c =
|
|
240
|
+
const c = D.getBusinessId();
|
|
240
241
|
if (!c)
|
|
241
|
-
throw new Error(
|
|
242
|
-
const p = await
|
|
242
|
+
throw new Error(s("connect.whatsappBot.errors.selectBusiness"));
|
|
243
|
+
const p = await N.createClient(
|
|
243
244
|
c,
|
|
244
|
-
|
|
245
|
+
h.signal
|
|
245
246
|
), d = await me.toDataURL(p.qr, {
|
|
246
247
|
width: 224,
|
|
247
248
|
margin: 2,
|
|
248
249
|
errorCorrectionLevel: "M"
|
|
249
250
|
});
|
|
250
|
-
|
|
251
|
+
h.signal.aborted || (f.value = d, E(c, p.clientId, h.signal));
|
|
251
252
|
} catch (c) {
|
|
252
|
-
|
|
253
|
+
h.signal.aborted || (u.value = c instanceof Error ? c.message : s("connect.whatsappBot.errors.loadQr"));
|
|
253
254
|
} finally {
|
|
254
|
-
|
|
255
|
+
h.signal.aborted || (v.value = !1);
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
return R(
|
|
258
259
|
i,
|
|
259
|
-
(
|
|
260
|
-
|
|
260
|
+
(h) => {
|
|
261
|
+
h ? C() : y();
|
|
261
262
|
},
|
|
262
263
|
{ immediate: !0 }
|
|
263
|
-
),
|
|
264
|
-
const p =
|
|
265
|
-
return n(),
|
|
264
|
+
), Q(y), (h, c) => {
|
|
265
|
+
const p = w("i18n-t"), d = w("FmCircularProgress"), W = w("FmButton"), j = w("FmDialog");
|
|
266
|
+
return n(), k(j, {
|
|
266
267
|
modelValue: i.value,
|
|
267
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
268
|
+
"onUpdate:modelValue": c[0] || (c[0] = (B) => i.value = B),
|
|
268
269
|
"min-width": "min(720px, calc(100% - 32px))",
|
|
269
270
|
"max-width": "720px",
|
|
270
271
|
"max-height": "90vh",
|
|
271
272
|
"dismiss-away": ""
|
|
272
273
|
}, {
|
|
273
|
-
"dialog-header":
|
|
274
|
-
o("h2",
|
|
274
|
+
"dialog-header": I(() => [
|
|
275
|
+
o("h2", Ce, r(e(s)("connect.whatsappBot.connectAccount")), 1)
|
|
275
276
|
]),
|
|
276
|
-
default:
|
|
277
|
-
var
|
|
277
|
+
default: I(() => {
|
|
278
|
+
var B, S, a;
|
|
278
279
|
return [
|
|
279
|
-
|
|
280
|
+
_.value ? (n(), m("div", Se, [
|
|
280
281
|
c[1] || (c[1] = o("div", {
|
|
281
282
|
"aria-hidden": "true",
|
|
282
283
|
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]"
|
|
@@ -294,71 +295,71 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
294
295
|
o("path", { d: "M20 6 9 17l-5-5" })
|
|
295
296
|
])
|
|
296
297
|
], -1)),
|
|
297
|
-
o("h3", Ie, r(e(
|
|
298
|
-
o("p", Fe, r(((
|
|
298
|
+
o("h3", Ie, r(e(s)("connect.whatsappBot.accountConnected")), 1),
|
|
299
|
+
o("p", Fe, r(((B = _.value.account) == null ? void 0 : B.businessName) || ((S = _.value.account) == null ? void 0 : S.name) || e(s)("connect.whatsappBot.unnamedAccount")) + " · " + r(((a = _.value.account) == null ? void 0 : a.phoneNumber) || e(s)("connect.whatsappBot.phoneUnavailable")), 1)
|
|
299
300
|
])) : (n(), m("div", Ee, [
|
|
300
301
|
o("div", We, [
|
|
301
|
-
o("p",
|
|
302
|
-
o("ol",
|
|
303
|
-
(n(), m(
|
|
302
|
+
o("p", Oe, r(e(s)("connect.whatsappBot.scanDescription")), 1),
|
|
303
|
+
o("ol", He, [
|
|
304
|
+
(n(), m(Z, null, q(4, (t) => o("li", {
|
|
304
305
|
key: t,
|
|
305
306
|
class: "flex gap-[12px]"
|
|
306
307
|
}, [
|
|
307
|
-
o("span",
|
|
308
|
-
t === 1 ? (n(), m("span",
|
|
308
|
+
o("span", Ve, r(t), 1),
|
|
309
|
+
t === 1 ? (n(), m("span", De, r(e(s)("connect.whatsappBot.steps.openApp")), 1)) : t === 2 ? (n(), k(p, {
|
|
309
310
|
key: 1,
|
|
310
311
|
keypath: "connect.whatsappBot.steps.openSettings",
|
|
311
312
|
tag: "span",
|
|
312
313
|
scope: "global"
|
|
313
314
|
}, {
|
|
314
|
-
menu:
|
|
315
|
-
o("b",
|
|
315
|
+
menu: I(() => [
|
|
316
|
+
o("b", je, r(e(s)("connect.whatsappBot.menu")), 1)
|
|
316
317
|
]),
|
|
317
|
-
settings:
|
|
318
|
-
o("b",
|
|
318
|
+
settings: I(() => [
|
|
319
|
+
o("b", Le, r(e(s)("connect.whatsappBot.settings")), 1)
|
|
319
320
|
]),
|
|
320
321
|
_: 1
|
|
321
|
-
})) : t === 3 ? (n(),
|
|
322
|
+
})) : t === 3 ? (n(), k(p, {
|
|
322
323
|
key: 2,
|
|
323
324
|
keypath: "connect.whatsappBot.steps.linkDevice",
|
|
324
325
|
tag: "span",
|
|
325
326
|
scope: "global"
|
|
326
327
|
}, {
|
|
327
|
-
linkedDevices:
|
|
328
|
-
o("b",
|
|
328
|
+
linkedDevices: I(() => [
|
|
329
|
+
o("b", Ne, r(e(s)("connect.whatsappBot.linkedDevices")), 1)
|
|
329
330
|
]),
|
|
330
|
-
linkDevice:
|
|
331
|
-
o("b", Me, r(e(
|
|
331
|
+
linkDevice: I(() => [
|
|
332
|
+
o("b", Me, r(e(s)("connect.whatsappBot.linkDevice")), 1)
|
|
332
333
|
]),
|
|
333
334
|
_: 1
|
|
334
|
-
})) : (n(), m("span", Re, r(e(
|
|
335
|
+
})) : (n(), m("span", Re, r(e(s)("connect.whatsappBot.steps.scanQr")), 1))
|
|
335
336
|
])), 64))
|
|
336
337
|
]),
|
|
337
|
-
o("p", Ue, r(e(
|
|
338
|
+
o("p", Ue, r(e(s)("connect.whatsappBot.connectionNote")), 1)
|
|
338
339
|
]),
|
|
339
|
-
o("div",
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
o("div", Ge, [
|
|
341
|
+
v.value ? (n(), m("div", ze, [
|
|
342
|
+
A(d),
|
|
343
|
+
G(r(e(s)("connect.whatsappBot.generatingQr")), 1)
|
|
343
344
|
])) : u.value ? (n(), m("div", Ke, [
|
|
344
345
|
o("p", Qe, r(u.value), 1),
|
|
345
|
-
|
|
346
|
-
label: e(
|
|
346
|
+
A(W, {
|
|
347
|
+
label: e(s)("connect.whatsappBot.tryAgain"),
|
|
347
348
|
"prepend-icon": "refresh",
|
|
348
|
-
onClick:
|
|
349
|
+
onClick: C
|
|
349
350
|
}, null, 8, ["label"])
|
|
350
351
|
])) : f.value ? (n(), m("img", {
|
|
351
352
|
key: 2,
|
|
352
353
|
src: f.value,
|
|
353
|
-
alt: e(
|
|
354
|
+
alt: e(s)("connect.whatsappBot.qrAlt"),
|
|
354
355
|
width: "224",
|
|
355
356
|
height: "224",
|
|
356
357
|
class: U({ "opacity-20": l.value })
|
|
357
|
-
}, null, 10, Ze)) :
|
|
358
|
+
}, null, 10, Ze)) : V("", !0),
|
|
358
359
|
l.value ? (n(), m("div", Je, [
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
])) :
|
|
360
|
+
A(d),
|
|
361
|
+
G(" " + r(e(s)("connect.whatsappBot.connecting")), 1)
|
|
362
|
+
])) : V("", !0)
|
|
362
363
|
])
|
|
363
364
|
]))
|
|
364
365
|
];
|
|
@@ -370,10 +371,10 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
370
371
|
}), Ye = { class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]" }, qe = { class: "text-[20px] leading-[28px] font-bold" }, et = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px]" }, tt = /* @__PURE__ */ M({
|
|
371
372
|
__name: "WhatsappEmptyState",
|
|
372
373
|
emits: ["connect"],
|
|
373
|
-
setup(
|
|
374
|
-
const
|
|
375
|
-
return (
|
|
376
|
-
const l =
|
|
374
|
+
setup(F, { emit: i }) {
|
|
375
|
+
const s = i, { t: f } = z();
|
|
376
|
+
return (v, u) => {
|
|
377
|
+
const l = w("FmButton");
|
|
377
378
|
return n(), m("div", Ye, [
|
|
378
379
|
u[1] || (u[1] = o("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
|
|
379
380
|
o("svg", {
|
|
@@ -393,141 +394,145 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
393
394
|
], -1)),
|
|
394
395
|
o("h2", qe, r(e(f)("connect.whatsappBot.emptyTitle")), 1),
|
|
395
396
|
o("p", et, r(e(f)("connect.whatsappBot.emptyDescription")), 1),
|
|
396
|
-
|
|
397
|
+
A(l, {
|
|
397
398
|
class: "mt-[16px]",
|
|
398
399
|
label: e(f)("connect.whatsappBot.connectAccountCta"),
|
|
399
400
|
"prepend-icon": "add",
|
|
400
|
-
onClick: u[0] || (u[0] = (
|
|
401
|
+
onClick: u[0] || (u[0] = (_) => s("connect"))
|
|
401
402
|
}, null, 8, ["label"])
|
|
402
403
|
]);
|
|
403
404
|
};
|
|
404
405
|
}
|
|
405
406
|
}), ot = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, nt = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, at = { class: "flex items-center gap-8" }, st = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, lt = {
|
|
406
|
-
key:
|
|
407
|
+
key: 3,
|
|
407
408
|
role: "status",
|
|
408
409
|
class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
409
410
|
}, rt = {
|
|
410
|
-
key:
|
|
411
|
+
key: 4,
|
|
411
412
|
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]"
|
|
412
413
|
}, ct = {
|
|
413
414
|
role: "alert",
|
|
414
415
|
class: "text-[14px] text-fm-color-typo-error"
|
|
415
416
|
}, ht = /* @__PURE__ */ M({
|
|
416
417
|
__name: "WhatsappBot",
|
|
417
|
-
setup(
|
|
418
|
-
const { t: i } =
|
|
419
|
-
let l,
|
|
420
|
-
const
|
|
421
|
-
let
|
|
422
|
-
const
|
|
423
|
-
() => f.value.filter((
|
|
424
|
-
),
|
|
418
|
+
setup(F) {
|
|
419
|
+
const { t: i } = z(), s = ce(), f = T([]), v = T(!0), u = T("");
|
|
420
|
+
let l, _;
|
|
421
|
+
const x = T([]), $ = T(!0), P = T("");
|
|
422
|
+
let y, E;
|
|
423
|
+
const C = L(
|
|
424
|
+
() => f.value.filter((a) => pe(a) !== void 0)
|
|
425
|
+
), h = L(() => [
|
|
425
426
|
{
|
|
426
427
|
label: i("connect.whatsappBot.accounts"),
|
|
427
|
-
value:
|
|
428
|
-
badge:
|
|
428
|
+
value: g["$connect-WHATSAPP_BOT"],
|
|
429
|
+
badge: C.value.length
|
|
429
430
|
},
|
|
430
431
|
{
|
|
431
432
|
label: i("connect.whatsappBot.settings"),
|
|
432
|
-
value:
|
|
433
|
+
value: g["$connect-WHATSAPP_BOT_SETTINGS"]
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
label: i("connect.whatsappBot.logs.title"),
|
|
437
|
+
value: g["$connect-WHATSAPP_BOT_LOGS"]
|
|
433
438
|
},
|
|
434
439
|
{
|
|
435
440
|
label: i("connect.whatsappBot.tickets.title"),
|
|
436
|
-
value:
|
|
437
|
-
badge:
|
|
441
|
+
value: g["$connect-WHATSAPP_BOT_TICKETS"],
|
|
442
|
+
badge: x.value.length
|
|
438
443
|
}
|
|
439
|
-
]), c =
|
|
440
|
-
const
|
|
441
|
-
return
|
|
444
|
+
]), c = L(() => {
|
|
445
|
+
const a = s.currentRoute.value.name;
|
|
446
|
+
return a === g["$connect-WHATSAPP_BOT_SETTINGS"] || a === g["$connect-WHATSAPP_BOT_LOGS"] || a === g["$connect-WHATSAPP_BOT_TICKETS"] ? a : g["$connect-WHATSAPP_BOT"];
|
|
442
447
|
});
|
|
443
|
-
async function p(
|
|
444
|
-
clearTimeout(
|
|
448
|
+
async function p(a = !1) {
|
|
449
|
+
clearTimeout(E), y == null || y.abort();
|
|
445
450
|
const t = new AbortController();
|
|
446
|
-
|
|
451
|
+
y = t, a || ($.value = !0, P.value = "");
|
|
447
452
|
try {
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
453
|
+
const b = D.getBusinessId();
|
|
454
|
+
if (!b)
|
|
450
455
|
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
451
|
-
const
|
|
452
|
-
t.signal.aborted || (
|
|
453
|
-
} catch (
|
|
454
|
-
t.signal.aborted || (
|
|
456
|
+
const O = await N.listTickets(b, t.signal);
|
|
457
|
+
t.signal.aborted || (x.value = O, P.value = "");
|
|
458
|
+
} catch (b) {
|
|
459
|
+
t.signal.aborted || (P.value = b instanceof Error ? b.message : i("connect.whatsappBot.tickets.loadError"));
|
|
455
460
|
} finally {
|
|
456
|
-
t.signal.aborted || ($.value = !1,
|
|
461
|
+
t.signal.aborted || ($.value = !1, E = setTimeout(() => void p(!0), 1e4));
|
|
457
462
|
}
|
|
458
463
|
}
|
|
459
|
-
function d(
|
|
460
|
-
|
|
464
|
+
function d(a) {
|
|
465
|
+
x.value = x.value.filter((t) => t.id !== a), p(!0);
|
|
461
466
|
}
|
|
462
|
-
async function W(
|
|
463
|
-
clearTimeout(
|
|
467
|
+
async function W(a = !1) {
|
|
468
|
+
clearTimeout(_), l == null || l.abort();
|
|
464
469
|
const t = new AbortController();
|
|
465
|
-
l = t,
|
|
470
|
+
l = t, a || (v.value = !0, u.value = "");
|
|
466
471
|
try {
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
472
|
+
const b = D.getBusinessId();
|
|
473
|
+
if (!b)
|
|
469
474
|
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
470
|
-
const
|
|
471
|
-
t.signal.aborted || (f.value =
|
|
472
|
-
} catch (
|
|
473
|
-
!t.signal.aborted && !
|
|
475
|
+
const O = await N.listClients(b, t.signal);
|
|
476
|
+
t.signal.aborted || (f.value = O, u.value = "");
|
|
477
|
+
} catch (b) {
|
|
478
|
+
!t.signal.aborted && !a && (u.value = b instanceof Error ? b.message : i("connect.whatsappBot.errors.loadSessions"));
|
|
474
479
|
} finally {
|
|
475
|
-
t.signal.aborted || (
|
|
480
|
+
t.signal.aborted || (v.value = !1, _ = setTimeout(() => void W(!0), 1e4));
|
|
476
481
|
}
|
|
477
482
|
}
|
|
478
|
-
function
|
|
483
|
+
function j(a) {
|
|
479
484
|
f.value = f.value.filter(
|
|
480
|
-
(t) => t.clientId !==
|
|
485
|
+
(t) => t.clientId !== a
|
|
481
486
|
), W(!0);
|
|
482
487
|
}
|
|
483
|
-
const
|
|
484
|
-
function
|
|
485
|
-
(
|
|
488
|
+
const B = T(!1);
|
|
489
|
+
function S(a) {
|
|
490
|
+
(a === g["$connect-WHATSAPP_BOT"] || a === g["$connect-WHATSAPP_BOT_SETTINGS"] || a === g["$connect-WHATSAPP_BOT_LOGS"] || a === g["$connect-WHATSAPP_BOT_TICKETS"]) && s.push({ name: a });
|
|
486
491
|
}
|
|
487
|
-
return R(
|
|
488
|
-
|
|
492
|
+
return R(B, (a) => {
|
|
493
|
+
a || W();
|
|
489
494
|
}), R(
|
|
490
|
-
() =>
|
|
495
|
+
() => D.getBusinessId(),
|
|
491
496
|
() => {
|
|
492
|
-
|
|
497
|
+
B.value = !1, f.value = [], x.value = [], W(), p();
|
|
493
498
|
},
|
|
494
499
|
{ immediate: !0 }
|
|
495
|
-
),
|
|
496
|
-
l == null || l.abort(), clearTimeout(
|
|
497
|
-
}), (
|
|
498
|
-
const
|
|
499
|
-
return n(), m(
|
|
500
|
+
), Q(() => {
|
|
501
|
+
l == null || l.abort(), clearTimeout(_), y == null || y.abort(), clearTimeout(E);
|
|
502
|
+
}), (a, t) => {
|
|
503
|
+
const b = w("FmPill"), O = w("FmButton"), J = w("FmBadge"), ee = w("FmTab"), te = w("FmTabs"), K = w("RouterView"), oe = w("FmCircularProgress");
|
|
504
|
+
return n(), m(Z, null, [
|
|
500
505
|
o("div", ot, [
|
|
501
506
|
o("div", nt, [
|
|
502
507
|
o("div", at, [
|
|
503
508
|
o("h1", st, r(e(i)("connect.navigation.whatsappBot")), 1),
|
|
504
|
-
|
|
509
|
+
A(b, { variant: "beta" })
|
|
505
510
|
]),
|
|
506
|
-
c.value === e(
|
|
511
|
+
c.value === e(g)["$connect-WHATSAPP_BOT"] && C.value.length ? (n(), k(O, {
|
|
507
512
|
key: 0,
|
|
508
513
|
label: e(i)("connect.whatsappBot.connectAccountCta"),
|
|
509
514
|
"prepend-icon": "add",
|
|
510
|
-
onClick: t[0] || (t[0] = (
|
|
511
|
-
}, null, 8, ["label"])) :
|
|
515
|
+
onClick: t[0] || (t[0] = (H) => B.value = !0)
|
|
516
|
+
}, null, 8, ["label"])) : V("", !0)
|
|
512
517
|
]),
|
|
513
|
-
|
|
518
|
+
A(te, {
|
|
514
519
|
"model-value": c.value,
|
|
515
|
-
items:
|
|
520
|
+
items: h.value,
|
|
516
521
|
role: "tablist",
|
|
517
522
|
"aria-label": e(i)("connect.navigation.whatsappBot"),
|
|
518
523
|
class: "mt-[16px] border-b border-fm-color-neutral-gray-100"
|
|
519
524
|
}, {
|
|
520
|
-
default:
|
|
521
|
-
|
|
525
|
+
default: I(({ label: H, value: X, badge: Y, tabsProps: ne }) => [
|
|
526
|
+
A(ee, le(ne, {
|
|
522
527
|
"model-value": c.value,
|
|
523
|
-
label:
|
|
528
|
+
label: H,
|
|
524
529
|
value: X,
|
|
525
|
-
"onUpdate:modelValue":
|
|
530
|
+
"onUpdate:modelValue": S
|
|
526
531
|
}), re({ _: 2 }, [
|
|
527
532
|
Y ? {
|
|
528
533
|
name: "append",
|
|
529
|
-
fn:
|
|
530
|
-
|
|
534
|
+
fn: I(() => [
|
|
535
|
+
A(J, {
|
|
531
536
|
value: Y,
|
|
532
537
|
variant: "neutral",
|
|
533
538
|
inline: "",
|
|
@@ -542,35 +547,38 @@ const fe = { class: "flex items-center gap-[12px]" }, xe = ["src"], ve = { key:
|
|
|
542
547
|
]),
|
|
543
548
|
_: 1
|
|
544
549
|
}, 8, ["model-value", "items", "aria-label"]),
|
|
545
|
-
c.value === e(
|
|
550
|
+
c.value === e(g)["$connect-WHATSAPP_BOT_SETTINGS"] ? (n(), k(K, { key: 0 })) : c.value === e(g)["$connect-WHATSAPP_BOT_LOGS"] ? (n(), k(K, {
|
|
546
551
|
key: 1,
|
|
547
|
-
|
|
552
|
+
accounts: C.value
|
|
553
|
+
}, null, 8, ["accounts"])) : c.value === e(g)["$connect-WHATSAPP_BOT_TICKETS"] ? (n(), k(K, {
|
|
554
|
+
key: 2,
|
|
555
|
+
tickets: x.value,
|
|
548
556
|
loading: $.value,
|
|
549
|
-
error:
|
|
550
|
-
onRetry: t[1] || (t[1] = (
|
|
557
|
+
error: P.value,
|
|
558
|
+
onRetry: t[1] || (t[1] = (H) => p()),
|
|
551
559
|
onResolved: d
|
|
552
|
-
}, null, 8, ["tickets", "loading", "error"])) :
|
|
553
|
-
|
|
554
|
-
|
|
560
|
+
}, null, 8, ["tickets", "loading", "error"])) : v.value ? (n(), m("div", lt, [
|
|
561
|
+
A(oe),
|
|
562
|
+
G(" " + r(e(i)("connect.whatsappBot.loadingSessions")), 1)
|
|
555
563
|
])) : u.value ? (n(), m("div", rt, [
|
|
556
564
|
o("p", ct, r(u.value), 1),
|
|
557
|
-
|
|
565
|
+
A(O, {
|
|
558
566
|
label: e(i)("connect.whatsappBot.tryAgain"),
|
|
559
567
|
"prepend-icon": "refresh",
|
|
560
|
-
onClick: t[2] || (t[2] = (
|
|
568
|
+
onClick: t[2] || (t[2] = (H) => W())
|
|
561
569
|
}, null, 8, ["label"])
|
|
562
|
-
])) :
|
|
563
|
-
key: 4,
|
|
564
|
-
accounts: E.value,
|
|
565
|
-
onRemoved: O
|
|
566
|
-
}, null, 8, ["accounts"])) : (n(), A(tt, {
|
|
570
|
+
])) : C.value.length ? (n(), k(Pe, {
|
|
567
571
|
key: 5,
|
|
568
|
-
|
|
572
|
+
accounts: C.value,
|
|
573
|
+
onRemoved: j
|
|
574
|
+
}, null, 8, ["accounts"])) : (n(), k(tt, {
|
|
575
|
+
key: 6,
|
|
576
|
+
onConnect: t[3] || (t[3] = (H) => B.value = !0)
|
|
569
577
|
}))
|
|
570
578
|
]),
|
|
571
|
-
|
|
572
|
-
modelValue:
|
|
573
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
579
|
+
A(Xe, {
|
|
580
|
+
modelValue: B.value,
|
|
581
|
+
"onUpdate:modelValue": t[4] || (t[4] = (H) => B.value = H)
|
|
574
582
|
}, null, 8, ["modelValue"])
|
|
575
583
|
], 64);
|
|
576
584
|
};
|