@feedmepos/mf-connect 0.1.111-prod → 0.1.113-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -1
- package/dist/{App-D3pYl3WL.js → App-YfpYV7C0.js} +738 -689
- package/dist/AuditLogs-kD0_HO_p.js +2016 -0
- package/dist/{Bin-DOZqpbYH.js → Bin-Dr-Xp3pn.js} +8 -8
- package/dist/Broadcast-CEbHu2xA.js +306 -0
- package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +49 -32
- package/dist/Card-BUnwg0eM.js +1086 -0
- package/dist/{Collections-9QK5hbLo.js → Collections-CKyBkKq2.js} +197 -185
- package/dist/{Credit-8Ouy4O9a.js → Credit-CJOXWLV1.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
- package/dist/{Experience-DMh4hR1S.js → Experience-C_Am5CTY.js} +32 -31
- package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-CueAGbjq.js} +1 -1
- package/dist/{Game-CL0TZvg1.js → Game-B6GO_LVU.js} +19 -18
- package/dist/GiftCardSetup-CVLDDpI2.js +748 -0
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
- package/dist/{Goals-Dz5Vp-lj.js → Goals-BX-sMV2V.js} +4 -4
- package/dist/Grab-Bh335Srh.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
- package/dist/{Index-kH8aAegB.js → Index-CyXRbwcm.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
- package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
- package/dist/MainLayout-KbKkpX5n.js +4 -0
- package/dist/{MainLayout-2BLwDyHQ.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
- package/dist/{Marketing-C4OnSV-c.js → Marketing-DQT1MWQg.js} +4 -4
- package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
- package/dist/{Member-CT9WwxP0.js → Member-DwDUCzlv.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -49
- package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
- package/dist/{MemberList-DgLI4wty.js → MemberList-DFieV7Qk.js} +103 -105
- package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BPOXyAuC.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4821 -4690
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
- package/dist/{Mission-CawzGzDu.js → Mission-nErb05Es.js} +22 -21
- package/dist/{Overview-D19oSo24.js → Overview-7G31a7B-.js} +58 -56
- package/dist/{Overview-CAtTlEVa.js → Overview-DuJr_hAg.js} +145 -144
- package/dist/{Point-BPAGmKAj.js → Point-PWDLemD4.js} +22 -21
- package/dist/{Promotion-B0Uf9vjL.js → Promotion-N80Tj8M6.js} +137 -131
- package/dist/{Queue-CJEAFss_.js → Queue-M7ZpgiMT.js} +49 -47
- package/dist/{Record-s6hSQG2P.js → Record-NhxrdvWv.js} +9 -9
- package/dist/{Review-DhNCbAOm.js → Review-DiAaAzIG.js} +2 -2
- package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
- package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
- package/dist/{Reward-BT00QsXL.js → Reward-yTaOqOT8.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +26 -24
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
- package/dist/{Segment-BuGhX9zg.js → Segment-DE9Bcd6R.js} +287 -287
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +37 -35
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
- package/dist/Setting-C0JAxIRT.js +574 -0
- package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-DxueyKU8.js} +12 -12
- package/dist/Settings-Cs46AcxZ.js +286 -0
- package/dist/Store-DqQae9nE.js +2629 -0
- package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-JxSUsOzJ.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
- package/dist/{Tier-OyE8oH2r.js → Tier-DWhgWush.js} +2576 -686
- package/dist/{Title-DAl7CKL_.js → Title-DUNeMdz8.js} +104 -101
- package/dist/Transaction-DAv-LVhC.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
- package/dist/{Voucher-D2QGWSxs.js → Voucher-uLTq9RSK.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
- package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
- package/dist/WhatsappBot-DB4NRZMd.js +589 -0
- package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
- package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
- package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
- package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
- package/dist/{app-QxosLNkH.js → app-Devzv4gO.js} +12854 -9732
- package/dist/app.js +4 -3
- package/dist/base.export-CCSMkvAm.js +75 -0
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-CbqG6NXr.js → business-BjAmUqNA.js} +1 -1
- package/dist/campaign-C5c47GqT.js +400 -0
- package/dist/{campaign-Rj7oDBnN.js → campaign-CTe-T5Gd.js} +31 -25
- package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/campaign.fn-DxAO8A5b.js +776 -0
- package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-EbUIyB1X.js → collection.fn-C9l-OtNt.js} +2 -2
- package/dist/currency-mwm4AWXK.js +7 -0
- package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
- package/dist/{effect-B_91OlcX.js → effect-D8ba9z0K.js} +1 -1
- package/dist/{email-addresses-DXnYZG-e.js → email-addresses-BR5J6_Jz.js} +2 -2
- package/dist/feature-flag-C-5NdFW8.js +868 -0
- package/dist/feature-flag-CNcU4_3r.js +50 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-_uhiXya1.js → helper-D9cEaMIv.js} +1 -1
- package/dist/index-0H82-X0n.js +80 -0
- package/dist/{index-Cp7oHMm3.js → index-B1jP-_Z_.js} +691 -229
- package/dist/{index-BZ2b0Pk6.js → index-B7HH6vKF.js} +8 -7
- package/dist/{index-tbo0pMIu.js → index-BFaZp6Et.js} +29 -15
- package/dist/index-B_gzo75q.js +53 -0
- package/dist/{index-DlQJZNwD.js → index-BfoDdVQS.js} +22 -6
- package/dist/{index-CDm0BWa3.js → index-BvY2hQac.js} +1 -1
- package/dist/index-Byg4ztr-.js +902 -0
- package/dist/{index-BWgc2-Qz.js → index-CZfqqrVu.js} +4 -3
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-xuFTeVrb.js → index-CmzjBrHR.js} +11 -9
- package/dist/{index-BBihP1s2.js → index-Ct6YjTIW.js} +2 -2
- package/dist/{index-Df4l6y-S.js → index-D34iYRdc.js} +1900 -2121
- package/dist/{index-DuhRCI0L.js → index-D4k1G2oE.js} +4 -4
- package/dist/{index-uuNGb1nv.js → index-DnepoNWn.js} +8028 -10766
- package/dist/index-Drmh0FT-.js +14571 -0
- package/dist/{index-DlGnYR5y.js → index-DtcUCknS.js} +2700 -2613
- package/dist/{index-C_1iqF1Q.js → index-DwTBiVts.js} +1 -1
- package/dist/{index-CWUmrVo_.js → index-OvnHt5x5.js} +800 -793
- package/dist/index-RwNlbTO8.js +115 -0
- package/dist/{index-CzYxnDWP.js → index-VqAbYyHH.js} +11 -6
- package/dist/{index-DzBzClHP.js → index-yGSko6Eq.js} +1 -1
- package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-DLb2VyCT.js} +156 -156
- package/dist/{loading-rIhCiB_S.js → loading-CUNk5u1d.js} +1 -1
- package/dist/{lodash-B6fOjfjd.js → lodash-BJXravls.js} +1 -1
- package/dist/{member-import-CbHn7zss.js → member-import-DjYoddBi.js} +6 -5
- package/dist/{membership-DkJN7jyQ.js → membership-ByJUFP8f.js} +3 -3
- package/dist/{money-ChbDx6Nq.js → money-Bf2IEMJJ.js} +1 -1
- package/dist/{number-9TEd27Ku.js → number-CRBHrRUL.js} +1 -1
- package/dist/objectid-58gyOvdR.js +145 -0
- package/dist/{onboarding-BN3MKVRs.js → onboarding-CQ3lw7eY.js} +25 -25
- package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-CsdZKGFk.js} +2 -2
- package/dist/{plugins-CCibSJZa.js → plugins-iTZLbJGy.js} +3 -3
- package/dist/{MarketingMaterialEdit-DFhpsI2-.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-DjasF-NL.js → reward-DTN6JpEd.js} +1 -1
- package/dist/{rule-DqeChj0e.js → rule-BYACNQOL.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template--Vr0PCjB.js +188 -0
- package/dist/{timezone-D0nC1LDx.js → timezone-DwzjOED-.js} +1 -1
- package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-DapYe3n7.js} +2 -2
- package/dist/{trigger-CxpXoQJO.js → trigger-D8r76yb0.js} +18 -18
- package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
- package/dist/{usePagination-CrC-1v4L.js → usePagination-BRcQJkO1.js} +1 -1
- package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
- package/dist/{user-CrylHgF1.js → user-vBZFKqXQ.js} +1 -1
- package/dist/vue-i18n-Cw6fF11e.js +2365 -0
- package/dist/{xlsx-CJNYF7-l.js → xlsx-Muy_Rjhk.js} +440 -440
- package/dist/{zod-Dzn9S95S.js → zod-CCPTOeUz.js} +1 -1
- package/package.json +12 -3
- package/dist/Broadcast-DZ4SP99P.js +0 -271
- package/dist/Card-B5ni027Q.js +0 -911
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js +0 -2430
- package/dist/ReviewFacebookCallback-DeZqcpJo.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js +0 -1882
- package/dist/Setting-BOWPp05N.js +0 -2036
- package/dist/Settings-DekXvE-R.js +0 -179
- package/dist/Store-DpVlMuau.js +0 -1998
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js +0 -142
- package/dist/Transaction-mvKzTgLx.js +0 -39
- package/dist/campaign-Co4Lq-Wz.js +0 -228
- package/dist/campaign.fn-DolD3lYJ.js +0 -776
- package/dist/export-D0hWZSfH.js +0 -97
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-aCuOvuEC.js +0 -45
- package/dist/objectid-CGol1NeA.js +0 -145
- package/dist/rule-builder-DT854ycI.js +0 -102
- package/dist/template-BeCVA0-N.js +0 -236
- package/dist/vue-i18n-BjtkXdmG.js +0 -2365
|
@@ -0,0 +1,589 @@
|
|
|
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-Cw6fF11e.js";
|
|
3
|
+
import { useRouter as ce } from "vue-router";
|
|
4
|
+
import { S as D, a as ie } from "./index-OvnHt5x5.js";
|
|
5
|
+
import { w as N } from "./index-0H82-X0n.js";
|
|
6
|
+
import { u as ue, w as pe } from "./useWhatsappAccount-BOJ8fz84.js";
|
|
7
|
+
import { R as g } from "./app-Devzv4gO.js";
|
|
8
|
+
import { _ as de } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js";
|
|
9
|
+
import { b as me } from "./browser-BSAOEeIM.js";
|
|
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 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "text-[12px] text-fm-color-typo-secondary"
|
|
13
|
+
}, ke = {
|
|
14
|
+
key: 0,
|
|
15
|
+
role: "alert",
|
|
16
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
17
|
+
}, Ae = /* @__PURE__ */ M({
|
|
18
|
+
__name: "WhatsappAccountCard",
|
|
19
|
+
props: {
|
|
20
|
+
account: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["removed"],
|
|
23
|
+
setup(F, { emit: i }) {
|
|
24
|
+
const s = F, f = i, { t: v, locale: u } = z(), l = T(!1), _ = T("");
|
|
25
|
+
let x;
|
|
26
|
+
const {
|
|
27
|
+
name: $,
|
|
28
|
+
phoneNumber: P,
|
|
29
|
+
initials: y,
|
|
30
|
+
state: E,
|
|
31
|
+
avatarColor: C,
|
|
32
|
+
profilePictureUrl: h,
|
|
33
|
+
profilePictureFailed: c
|
|
34
|
+
} = ue(() => s.account), p = L(() => E.value === "connected"), d = L(() => ({
|
|
35
|
+
name: g["$connect-WHATSAPP_ACCOUNT"],
|
|
36
|
+
params: { clientId: s.account.clientId }
|
|
37
|
+
}));
|
|
38
|
+
function W(S) {
|
|
39
|
+
return new Intl.DateTimeFormat(u.value, {
|
|
40
|
+
year: "numeric",
|
|
41
|
+
month: "short",
|
|
42
|
+
day: "numeric"
|
|
43
|
+
}).format(new Date(S));
|
|
44
|
+
}
|
|
45
|
+
async function j() {
|
|
46
|
+
if (l.value) return;
|
|
47
|
+
const S = D.getBusinessId();
|
|
48
|
+
if (!S) {
|
|
49
|
+
_.value = v("connect.whatsappBot.errors.selectBusiness");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const a = s.account.clientId, t = new AbortController();
|
|
53
|
+
x = t, l.value = !0, _.value = "";
|
|
54
|
+
try {
|
|
55
|
+
await N.deleteClient(S, a, t.signal), t.signal.aborted || f("removed", a);
|
|
56
|
+
} catch {
|
|
57
|
+
t.signal.aborted || (_.value = v("connect.whatsappBot.errors.removeAccount"));
|
|
58
|
+
} finally {
|
|
59
|
+
x === t && (x = void 0, l.value = !1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function B() {
|
|
63
|
+
x == null || x.abort(), x = void 0, l.value = !1, _.value = "";
|
|
64
|
+
}
|
|
65
|
+
return R(() => D.getBusinessId(), B), Q(B), (S, a) => {
|
|
66
|
+
const t = w("RouterLink"), b = w("FmIcon"), O = w("FmCircularProgress");
|
|
67
|
+
return n(), m("li", null, [
|
|
68
|
+
o("div", {
|
|
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", {
|
|
70
|
+
"cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100": p.value
|
|
71
|
+
}])
|
|
72
|
+
}, [
|
|
73
|
+
o("div", fe, [
|
|
74
|
+
o("div", {
|
|
75
|
+
"aria-hidden": "true",
|
|
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)])
|
|
77
|
+
}, [
|
|
78
|
+
e(h) && !e(c) ? (n(), m("img", {
|
|
79
|
+
key: 0,
|
|
80
|
+
src: e(h),
|
|
81
|
+
alt: "",
|
|
82
|
+
class: "w-full h-full object-cover",
|
|
83
|
+
referrerpolicy: "no-referrer",
|
|
84
|
+
onError: a[0] || (a[0] = (J) => c.value = !0)
|
|
85
|
+
}, null, 40, ve)) : (n(), m("span", xe, r(e(y)), 1))
|
|
86
|
+
], 2),
|
|
87
|
+
o("div", _e, [
|
|
88
|
+
o("h2", {
|
|
89
|
+
class: "text-[16px] leading-[24px] font-semibold truncate",
|
|
90
|
+
title: e($)
|
|
91
|
+
}, [
|
|
92
|
+
p.value ? (n(), k(t, {
|
|
93
|
+
key: 0,
|
|
94
|
+
to: d.value,
|
|
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]"
|
|
96
|
+
}, {
|
|
97
|
+
default: I(() => [
|
|
98
|
+
G(r(e($)), 1)
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["to"])) : (n(), m("span", ge, r(e($)), 1))
|
|
102
|
+
], 8, he),
|
|
103
|
+
o("p", ye, r(e(P)), 1)
|
|
104
|
+
]),
|
|
105
|
+
o("div", be, [
|
|
106
|
+
p.value ? (n(), k(t, {
|
|
107
|
+
key: 0,
|
|
108
|
+
to: d.value,
|
|
109
|
+
"aria-label": e(v)("connect.common.edit"),
|
|
110
|
+
title: e(v)("connect.common.edit"),
|
|
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"
|
|
112
|
+
}, {
|
|
113
|
+
default: I(() => [
|
|
114
|
+
A(b, {
|
|
115
|
+
name: "edit",
|
|
116
|
+
size: "sm",
|
|
117
|
+
outline: "",
|
|
118
|
+
"aria-hidden": "true"
|
|
119
|
+
})
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["to", "aria-label", "title"])) : V("", !0),
|
|
123
|
+
o("button", {
|
|
124
|
+
type: "button",
|
|
125
|
+
"aria-label": e(v)("connect.common.remove"),
|
|
126
|
+
title: e(v)("connect.common.remove"),
|
|
127
|
+
disabled: l.value,
|
|
128
|
+
"aria-busy": l.value,
|
|
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",
|
|
130
|
+
onClick: ae(j, ["stop"])
|
|
131
|
+
}, [
|
|
132
|
+
l.value ? (n(), k(O, {
|
|
133
|
+
key: 0,
|
|
134
|
+
size: "md",
|
|
135
|
+
"aria-hidden": "true"
|
|
136
|
+
})) : (n(), k(b, {
|
|
137
|
+
key: 1,
|
|
138
|
+
name: "delete",
|
|
139
|
+
size: "sm",
|
|
140
|
+
outline: "",
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
}))
|
|
143
|
+
], 8, we)
|
|
144
|
+
])
|
|
145
|
+
]),
|
|
146
|
+
o("div", Be, [
|
|
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)
|
|
151
|
+
]),
|
|
152
|
+
_.value ? (n(), m("p", ke, r(_.value), 1)) : V("", !0)
|
|
153
|
+
], 2)
|
|
154
|
+
]);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}), $e = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, Pe = /* @__PURE__ */ M({
|
|
158
|
+
__name: "WhatsappAccountList",
|
|
159
|
+
props: {
|
|
160
|
+
accounts: {}
|
|
161
|
+
},
|
|
162
|
+
emits: ["removed"],
|
|
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, {
|
|
167
|
+
key: u.clientId,
|
|
168
|
+
account: u,
|
|
169
|
+
onRemoved: v[0] || (v[0] = (l) => s("removed", l))
|
|
170
|
+
}, null, 8, ["account"]))), 128))
|
|
171
|
+
]));
|
|
172
|
+
}
|
|
173
|
+
}), Ce = { class: "text-[18px] font-semibold" }, Se = {
|
|
174
|
+
key: 0,
|
|
175
|
+
role: "status",
|
|
176
|
+
class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
|
|
177
|
+
}, Ie = { class: "text-[18px] font-semibold" }, Fe = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, Ee = {
|
|
178
|
+
key: 1,
|
|
179
|
+
class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
|
|
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 = {
|
|
181
|
+
key: 0,
|
|
182
|
+
role: "status",
|
|
183
|
+
class: "flex flex-col items-center gap-[12px] text-[13px]"
|
|
184
|
+
}, Ke = {
|
|
185
|
+
key: 1,
|
|
186
|
+
class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
|
|
187
|
+
}, Qe = {
|
|
188
|
+
role: "alert",
|
|
189
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
190
|
+
}, Ze = ["src", "alt"], Je = {
|
|
191
|
+
key: 3,
|
|
192
|
+
role: "status",
|
|
193
|
+
"aria-live": "polite",
|
|
194
|
+
class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
|
|
195
|
+
}, Xe = /* @__PURE__ */ M({
|
|
196
|
+
__name: "WhatsappConnectDialog",
|
|
197
|
+
props: {
|
|
198
|
+
modelValue: { type: Boolean, required: !0 },
|
|
199
|
+
modelModifiers: {}
|
|
200
|
+
},
|
|
201
|
+
emits: ["update:modelValue"],
|
|
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;
|
|
207
|
+
}
|
|
208
|
+
async function E(h, c, p) {
|
|
209
|
+
if (!p.aborted) {
|
|
210
|
+
try {
|
|
211
|
+
const d = await N.getClient(h, c, p);
|
|
212
|
+
if (p.aborted) return;
|
|
213
|
+
if (l.value = d.status === "connected" || d.status === "connecting" && d.connectedAt !== null, d.status === "connected" && d.connectedAt !== null && d.profileStatus === "ready") {
|
|
214
|
+
y(), l.value = !1, _.value = d, P = setTimeout(() => {
|
|
215
|
+
i.value = !1;
|
|
216
|
+
}, 1800);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (d.status === "disconnected") {
|
|
220
|
+
y(), l.value = !1, f.value = "", u.value = s("connect.whatsappBot.errors.qrExpired");
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
} catch (d) {
|
|
224
|
+
if (p.aborted) return;
|
|
225
|
+
if (d instanceof ie && d.status === 409) {
|
|
226
|
+
y(), l.value = !1, f.value = "", u.value = s("connect.whatsappBot.errors.accountAlreadyLinked");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
p.aborted || ($ = setTimeout(() => {
|
|
231
|
+
E(h, c, p);
|
|
232
|
+
}, 2e3));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
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;
|
|
239
|
+
try {
|
|
240
|
+
const c = D.getBusinessId();
|
|
241
|
+
if (!c)
|
|
242
|
+
throw new Error(s("connect.whatsappBot.errors.selectBusiness"));
|
|
243
|
+
const p = await N.createClient(
|
|
244
|
+
c,
|
|
245
|
+
h.signal
|
|
246
|
+
), d = await me.toDataURL(p.qr, {
|
|
247
|
+
width: 224,
|
|
248
|
+
margin: 2,
|
|
249
|
+
errorCorrectionLevel: "M"
|
|
250
|
+
});
|
|
251
|
+
h.signal.aborted || (f.value = d, E(c, p.clientId, h.signal));
|
|
252
|
+
} catch (c) {
|
|
253
|
+
h.signal.aborted || (u.value = c instanceof Error ? c.message : s("connect.whatsappBot.errors.loadQr"));
|
|
254
|
+
} finally {
|
|
255
|
+
h.signal.aborted || (v.value = !1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return R(
|
|
259
|
+
i,
|
|
260
|
+
(h) => {
|
|
261
|
+
h ? C() : y();
|
|
262
|
+
},
|
|
263
|
+
{ immediate: !0 }
|
|
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, {
|
|
267
|
+
modelValue: i.value,
|
|
268
|
+
"onUpdate:modelValue": c[0] || (c[0] = (B) => i.value = B),
|
|
269
|
+
"min-width": "min(720px, calc(100% - 32px))",
|
|
270
|
+
"max-width": "720px",
|
|
271
|
+
"max-height": "90vh",
|
|
272
|
+
"dismiss-away": ""
|
|
273
|
+
}, {
|
|
274
|
+
"dialog-header": I(() => [
|
|
275
|
+
o("h2", Ce, r(e(s)("connect.whatsappBot.connectAccount")), 1)
|
|
276
|
+
]),
|
|
277
|
+
default: I(() => {
|
|
278
|
+
var B, S, a;
|
|
279
|
+
return [
|
|
280
|
+
_.value ? (n(), m("div", Se, [
|
|
281
|
+
c[1] || (c[1] = o("div", {
|
|
282
|
+
"aria-hidden": "true",
|
|
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]"
|
|
284
|
+
}, [
|
|
285
|
+
o("svg", {
|
|
286
|
+
width: "32",
|
|
287
|
+
height: "32",
|
|
288
|
+
viewBox: "0 0 24 24",
|
|
289
|
+
fill: "none",
|
|
290
|
+
stroke: "currentColor",
|
|
291
|
+
"stroke-width": "2.2",
|
|
292
|
+
"stroke-linecap": "round",
|
|
293
|
+
"stroke-linejoin": "round"
|
|
294
|
+
}, [
|
|
295
|
+
o("path", { d: "M20 6 9 17l-5-5" })
|
|
296
|
+
])
|
|
297
|
+
], -1)),
|
|
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)
|
|
300
|
+
])) : (n(), m("div", Ee, [
|
|
301
|
+
o("div", We, [
|
|
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", {
|
|
305
|
+
key: t,
|
|
306
|
+
class: "flex gap-[12px]"
|
|
307
|
+
}, [
|
|
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, {
|
|
310
|
+
key: 1,
|
|
311
|
+
keypath: "connect.whatsappBot.steps.openSettings",
|
|
312
|
+
tag: "span",
|
|
313
|
+
scope: "global"
|
|
314
|
+
}, {
|
|
315
|
+
menu: I(() => [
|
|
316
|
+
o("b", je, r(e(s)("connect.whatsappBot.menu")), 1)
|
|
317
|
+
]),
|
|
318
|
+
settings: I(() => [
|
|
319
|
+
o("b", Le, r(e(s)("connect.whatsappBot.settings")), 1)
|
|
320
|
+
]),
|
|
321
|
+
_: 1
|
|
322
|
+
})) : t === 3 ? (n(), k(p, {
|
|
323
|
+
key: 2,
|
|
324
|
+
keypath: "connect.whatsappBot.steps.linkDevice",
|
|
325
|
+
tag: "span",
|
|
326
|
+
scope: "global"
|
|
327
|
+
}, {
|
|
328
|
+
linkedDevices: I(() => [
|
|
329
|
+
o("b", Ne, r(e(s)("connect.whatsappBot.linkedDevices")), 1)
|
|
330
|
+
]),
|
|
331
|
+
linkDevice: I(() => [
|
|
332
|
+
o("b", Me, r(e(s)("connect.whatsappBot.linkDevice")), 1)
|
|
333
|
+
]),
|
|
334
|
+
_: 1
|
|
335
|
+
})) : (n(), m("span", Re, r(e(s)("connect.whatsappBot.steps.scanQr")), 1))
|
|
336
|
+
])), 64))
|
|
337
|
+
]),
|
|
338
|
+
o("p", Ue, r(e(s)("connect.whatsappBot.connectionNote")), 1)
|
|
339
|
+
]),
|
|
340
|
+
o("div", Ge, [
|
|
341
|
+
v.value ? (n(), m("div", ze, [
|
|
342
|
+
A(d),
|
|
343
|
+
G(r(e(s)("connect.whatsappBot.generatingQr")), 1)
|
|
344
|
+
])) : u.value ? (n(), m("div", Ke, [
|
|
345
|
+
o("p", Qe, r(u.value), 1),
|
|
346
|
+
A(W, {
|
|
347
|
+
label: e(s)("connect.whatsappBot.tryAgain"),
|
|
348
|
+
"prepend-icon": "refresh",
|
|
349
|
+
onClick: C
|
|
350
|
+
}, null, 8, ["label"])
|
|
351
|
+
])) : f.value ? (n(), m("img", {
|
|
352
|
+
key: 2,
|
|
353
|
+
src: f.value,
|
|
354
|
+
alt: e(s)("connect.whatsappBot.qrAlt"),
|
|
355
|
+
width: "224",
|
|
356
|
+
height: "224",
|
|
357
|
+
class: U({ "opacity-20": l.value })
|
|
358
|
+
}, null, 10, Ze)) : V("", !0),
|
|
359
|
+
l.value ? (n(), m("div", Je, [
|
|
360
|
+
A(d),
|
|
361
|
+
G(" " + r(e(s)("connect.whatsappBot.connecting")), 1)
|
|
362
|
+
])) : V("", !0)
|
|
363
|
+
])
|
|
364
|
+
]))
|
|
365
|
+
];
|
|
366
|
+
}),
|
|
367
|
+
_: 1
|
|
368
|
+
}, 8, ["modelValue"]);
|
|
369
|
+
};
|
|
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({
|
|
372
|
+
__name: "WhatsappEmptyState",
|
|
373
|
+
emits: ["connect"],
|
|
374
|
+
setup(F, { emit: i }) {
|
|
375
|
+
const s = i, { t: f } = z();
|
|
376
|
+
return (v, u) => {
|
|
377
|
+
const l = w("FmButton");
|
|
378
|
+
return n(), m("div", Ye, [
|
|
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]" }, [
|
|
380
|
+
o("svg", {
|
|
381
|
+
width: "34",
|
|
382
|
+
height: "34",
|
|
383
|
+
viewBox: "0 0 24 24",
|
|
384
|
+
fill: "none",
|
|
385
|
+
stroke: "currentColor",
|
|
386
|
+
"stroke-width": "1.6",
|
|
387
|
+
"stroke-linecap": "round",
|
|
388
|
+
"stroke-linejoin": "round",
|
|
389
|
+
"aria-hidden": "true"
|
|
390
|
+
}, [
|
|
391
|
+
o("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
|
|
392
|
+
o("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
|
|
393
|
+
])
|
|
394
|
+
], -1)),
|
|
395
|
+
o("h2", qe, r(e(f)("connect.whatsappBot.emptyTitle")), 1),
|
|
396
|
+
o("p", et, r(e(f)("connect.whatsappBot.emptyDescription")), 1),
|
|
397
|
+
A(l, {
|
|
398
|
+
class: "mt-[16px]",
|
|
399
|
+
label: e(f)("connect.whatsappBot.connectAccountCta"),
|
|
400
|
+
"prepend-icon": "add",
|
|
401
|
+
onClick: u[0] || (u[0] = (_) => s("connect"))
|
|
402
|
+
}, null, 8, ["label"])
|
|
403
|
+
]);
|
|
404
|
+
};
|
|
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 = {
|
|
407
|
+
key: 3,
|
|
408
|
+
role: "status",
|
|
409
|
+
class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
410
|
+
}, rt = {
|
|
411
|
+
key: 4,
|
|
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]"
|
|
413
|
+
}, ct = {
|
|
414
|
+
role: "alert",
|
|
415
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
416
|
+
}, ht = /* @__PURE__ */ M({
|
|
417
|
+
__name: "WhatsappBot",
|
|
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(() => [
|
|
426
|
+
{
|
|
427
|
+
label: i("connect.whatsappBot.accounts"),
|
|
428
|
+
value: g["$connect-WHATSAPP_BOT"],
|
|
429
|
+
badge: C.value.length
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
label: i("connect.whatsappBot.settings"),
|
|
433
|
+
value: g["$connect-WHATSAPP_BOT_SETTINGS"]
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
label: i("connect.whatsappBot.logs.title"),
|
|
437
|
+
value: g["$connect-WHATSAPP_BOT_LOGS"]
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
label: i("connect.whatsappBot.tickets.title"),
|
|
441
|
+
value: g["$connect-WHATSAPP_BOT_TICKETS"],
|
|
442
|
+
badge: x.value.length
|
|
443
|
+
}
|
|
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"];
|
|
447
|
+
});
|
|
448
|
+
async function p(a = !1) {
|
|
449
|
+
clearTimeout(E), y == null || y.abort();
|
|
450
|
+
const t = new AbortController();
|
|
451
|
+
y = t, a || ($.value = !0, P.value = "");
|
|
452
|
+
try {
|
|
453
|
+
const b = D.getBusinessId();
|
|
454
|
+
if (!b)
|
|
455
|
+
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
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"));
|
|
460
|
+
} finally {
|
|
461
|
+
t.signal.aborted || ($.value = !1, E = setTimeout(() => void p(!0), 1e4));
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function d(a) {
|
|
465
|
+
x.value = x.value.filter((t) => t.id !== a), p(!0);
|
|
466
|
+
}
|
|
467
|
+
async function W(a = !1) {
|
|
468
|
+
clearTimeout(_), l == null || l.abort();
|
|
469
|
+
const t = new AbortController();
|
|
470
|
+
l = t, a || (v.value = !0, u.value = "");
|
|
471
|
+
try {
|
|
472
|
+
const b = D.getBusinessId();
|
|
473
|
+
if (!b)
|
|
474
|
+
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
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"));
|
|
479
|
+
} finally {
|
|
480
|
+
t.signal.aborted || (v.value = !1, _ = setTimeout(() => void W(!0), 1e4));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function j(a) {
|
|
484
|
+
f.value = f.value.filter(
|
|
485
|
+
(t) => t.clientId !== a
|
|
486
|
+
), W(!0);
|
|
487
|
+
}
|
|
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 });
|
|
491
|
+
}
|
|
492
|
+
return R(B, (a) => {
|
|
493
|
+
a || W();
|
|
494
|
+
}), R(
|
|
495
|
+
() => D.getBusinessId(),
|
|
496
|
+
() => {
|
|
497
|
+
B.value = !1, f.value = [], x.value = [], W(), p();
|
|
498
|
+
},
|
|
499
|
+
{ immediate: !0 }
|
|
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, [
|
|
505
|
+
o("div", ot, [
|
|
506
|
+
o("div", nt, [
|
|
507
|
+
o("div", at, [
|
|
508
|
+
o("h1", st, r(e(i)("connect.navigation.whatsappBot")), 1),
|
|
509
|
+
A(b, { variant: "beta" })
|
|
510
|
+
]),
|
|
511
|
+
c.value === e(g)["$connect-WHATSAPP_BOT"] && C.value.length ? (n(), k(O, {
|
|
512
|
+
key: 0,
|
|
513
|
+
label: e(i)("connect.whatsappBot.connectAccountCta"),
|
|
514
|
+
"prepend-icon": "add",
|
|
515
|
+
onClick: t[0] || (t[0] = (H) => B.value = !0)
|
|
516
|
+
}, null, 8, ["label"])) : V("", !0)
|
|
517
|
+
]),
|
|
518
|
+
A(te, {
|
|
519
|
+
"model-value": c.value,
|
|
520
|
+
items: h.value,
|
|
521
|
+
role: "tablist",
|
|
522
|
+
"aria-label": e(i)("connect.navigation.whatsappBot"),
|
|
523
|
+
class: "mt-[16px] border-b border-fm-color-neutral-gray-100"
|
|
524
|
+
}, {
|
|
525
|
+
default: I(({ label: H, value: X, badge: Y, tabsProps: ne }) => [
|
|
526
|
+
A(ee, le(ne, {
|
|
527
|
+
"model-value": c.value,
|
|
528
|
+
label: H,
|
|
529
|
+
value: X,
|
|
530
|
+
"onUpdate:modelValue": S
|
|
531
|
+
}), re({ _: 2 }, [
|
|
532
|
+
Y ? {
|
|
533
|
+
name: "append",
|
|
534
|
+
fn: I(() => [
|
|
535
|
+
A(J, {
|
|
536
|
+
value: Y,
|
|
537
|
+
variant: "neutral",
|
|
538
|
+
inline: "",
|
|
539
|
+
class: U(
|
|
540
|
+
c.value === X ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
541
|
+
)
|
|
542
|
+
}, null, 8, ["value", "class"])
|
|
543
|
+
]),
|
|
544
|
+
key: "0"
|
|
545
|
+
} : void 0
|
|
546
|
+
]), 1040, ["model-value", "label", "value"])
|
|
547
|
+
]),
|
|
548
|
+
_: 1
|
|
549
|
+
}, 8, ["model-value", "items", "aria-label"]),
|
|
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, {
|
|
551
|
+
key: 1,
|
|
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,
|
|
556
|
+
loading: $.value,
|
|
557
|
+
error: P.value,
|
|
558
|
+
onRetry: t[1] || (t[1] = (H) => p()),
|
|
559
|
+
onResolved: d
|
|
560
|
+
}, null, 8, ["tickets", "loading", "error"])) : v.value ? (n(), m("div", lt, [
|
|
561
|
+
A(oe),
|
|
562
|
+
G(" " + r(e(i)("connect.whatsappBot.loadingSessions")), 1)
|
|
563
|
+
])) : u.value ? (n(), m("div", rt, [
|
|
564
|
+
o("p", ct, r(u.value), 1),
|
|
565
|
+
A(O, {
|
|
566
|
+
label: e(i)("connect.whatsappBot.tryAgain"),
|
|
567
|
+
"prepend-icon": "refresh",
|
|
568
|
+
onClick: t[2] || (t[2] = (H) => W())
|
|
569
|
+
}, null, 8, ["label"])
|
|
570
|
+
])) : C.value.length ? (n(), k(Pe, {
|
|
571
|
+
key: 5,
|
|
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)
|
|
577
|
+
}))
|
|
578
|
+
]),
|
|
579
|
+
A(Xe, {
|
|
580
|
+
modelValue: B.value,
|
|
581
|
+
"onUpdate:modelValue": t[4] || (t[4] = (H) => B.value = H)
|
|
582
|
+
}, null, 8, ["modelValue"])
|
|
583
|
+
], 64);
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
export {
|
|
588
|
+
ht as default
|
|
589
|
+
};
|