@feedmepos/mf-connect 0.1.98-beta.80 → 0.1.98-beta.82

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.
Files changed (135) hide show
  1. package/dist/{App-DievprEi.js → App-DIWPN6WH.js} +9 -9
  2. package/dist/{AuditLogs-DrdqOhZL.js → AuditLogs-BTZKJs5f.js} +13 -13
  3. package/dist/{Bin-Ci2k3z77.js → Bin-DJXuzg5t.js} +8 -8
  4. package/dist/{Broadcast-CpDMAG1o.js → Broadcast-DtG0edQa.js} +12 -12
  5. package/dist/{CampaignAnalytic-uRyGaLaN.js → CampaignAnalytic-DbLBzibb.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C1yg2-DE.js} +8 -8
  7. package/dist/{Card-tb98Kyr-.js → Card-bcNLznin.js} +23 -23
  8. package/dist/{Collections-P1S5WjnJ.js → Collections-DCq-oxmB.js} +8 -8
  9. package/dist/{Credit-DwK7JYf-.js → Credit-EwMv7P6u.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js → DateRangeChip.vue_vue_type_script_setup_true_lang-EhwxqiPf.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkkO_gn1.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js → EffectSheet.vue_vue_type_style_index_0_lang-BirRksYU.js} +6 -6
  13. package/dist/{Experience-BejtRlOj.js → Experience-QuulWZ2l.js} +13 -13
  14. package/dist/{FileSaver.min-C-hmBaHm.js → FileSaver.min-RTo5UlWI.js} +1 -1
  15. package/dist/{Game-n8qL896g.js → Game-BGGe7pFk.js} +13 -13
  16. package/dist/{GiftCardSetup-Bgsfcu7N.js → GiftCardSetup-CNPP7HtQ.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-yBUVNHEP.js} +7 -7
  18. package/dist/{Goals-BB8LJlq3.js → Goals-D-Q-ht66.js} +4 -4
  19. package/dist/{Grab-COq3Ujst.js → Grab-D2jS-RCL.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js → ImageInput.vue_vue_type_script_setup_true_lang-Byemh4AD.js} +1 -1
  21. package/dist/{Index-BdkIinaE.js → Index-QP8P79Tu.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js → LocationPicker.vue_vue_type_script_setup_true_lang-CrYa6Vek.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BGxbglj5.js} +1 -1
  24. package/dist/{LoyaltyDashboard-D4Jtpw0n.js → LoyaltyDashboard-Bkquum-3.js} +15 -15
  25. package/dist/{MainLayout-Ca-Xm3eZ.js → MainLayout-BQ_PiBqS.js} +3 -3
  26. package/dist/{Marketing-Cpe4s7NZ.js → Marketing-CHTPSOIj.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-nTeS9VVx.js → MarketingMaterialEdit-BAYHnYKe.js} +6 -6
  28. package/dist/{Member-DgGZ4Cdg.js → Member-D7xDe5Rt.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-B3074-er.js} +24 -24
  30. package/dist/{MemberImportHistory-rdlbDVWU.js → MemberImportHistory-BndvQb_w.js} +7 -7
  31. package/dist/{MemberList-BC4aRJTt.js → MemberList-Ctxdpre8.js} +14 -14
  32. package/dist/{MemberTransactions-BFfdTttp.js → MemberTransactions-qQXjqnUy.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js → MessageInput.vue_vue_type_script_setup_true_lang-Bzc0IePL.js} +10 -10
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1fr2pugZ.js} +1 -1
  35. package/dist/{Mission-BWCNKTjU.js → Mission-B4wOanDj.js} +14 -14
  36. package/dist/{Overview-i02Wnyjn.js → Overview-D8-Xzdh4.js} +21 -21
  37. package/dist/{Overview--Q7vzhNK.js → Overview-Dg8Uoyo3.js} +4 -4
  38. package/dist/{Point-CiWxqny5.js → Point-CS4mzCm5.js} +14 -14
  39. package/dist/{Promotion-B0G9qfBm.js → Promotion-Ccuo6zoT.js} +14 -14
  40. package/dist/{Queue-YfwgYmzH.js → Queue-ChNawIta.js} +13 -13
  41. package/dist/{Record-CCuwrPKW.js → Record-DmH2pbgo.js} +9 -9
  42. package/dist/{Review-ymsfdh7Q.js → Review-vhLtZ7y7.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-DyDExWvP.js → ReviewFacebookCallback-TgdFbPrW.js} +5 -5
  44. package/dist/{ReviewGoogleCallback-DNyg3n2S.js → ReviewGoogleCallback-CpK6sWqa.js} +5 -5
  45. package/dist/{Reward-BKIb0ezH.js → Reward-645jqAha.js} +16 -16
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js → RewardGroup.vue_vue_type_script_setup_true_lang-G_iME05g.js} +14 -14
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js → RuleGroup.vue_vue_type_script_setup_true_lang-e3CagrVZ.js} +15 -15
  48. package/dist/{Segment-D5_pp7fh.js → Segment-fj3Nqtpv.js} +26 -26
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D_yFLAc4.js} +15 -15
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D3JDTWXp.js} +4 -4
  51. package/dist/{Setting-CD78gIMU.js → Setting-CBVP-Mpb.js} +14 -14
  52. package/dist/{SettingAdvertisements-C2AIT4s4.js → SettingAdvertisements-BdPPUvDC.js} +12 -12
  53. package/dist/{Settings-DI_tryQV.js → Settings-BT6OdqEM.js} +5 -5
  54. package/dist/{Store-BV2JTRNZ.js → Store-nlIBDj84.js} +27 -27
  55. package/dist/{StoreRewards-Bk55YXyO.js → StoreRewards-DaMOOzw0.js} +15 -15
  56. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-UyV-RU5E.js +1319 -0
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dnr-6tzT.js} +2 -2
  58. package/dist/{Tier-CO2K30Ew.js → Tier-DUvEF-Ns.js} +27 -27
  59. package/dist/{Title-qProQh3T.js → Title-C3FZriO7.js} +23 -23
  60. package/dist/{Transaction-qL5L-fE_.js → Transaction-Ctd7qzJI.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CI8jF-Vn.js} +6 -6
  62. package/dist/{Voucher-VFD1LY9Y.js → Voucher-IoMmmYh2.js} +18 -18
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CdBrD2bP.js} +12 -12
  64. package/dist/{WhatsappAccount-CxSGqm7H.js → WhatsappAccount-D1a0ABEK.js} +5 -5
  65. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DUdFMygT.js +80 -0
  66. package/dist/WhatsappBot-CVirkYvU.js +561 -0
  67. package/dist/WhatsappBotSettings-BV_HgL-p.js +394 -0
  68. package/dist/WhatsappBotTickets-Ca_c5_B2.js +153 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js → ZodTextField.vue_vue_type_script_setup_true_lang-Z4TFGdcH.js} +2 -2
  70. package/dist/{app-BEYzXWZO.js → app-Cj6OWO36.js} +4063 -3708
  71. package/dist/app.js +1 -1
  72. package/dist/{base.export-S_82Elmg.js → base.export-7wLpz1Vu.js} +2 -2
  73. package/dist/{business-DH7djUl8.js → business-COKUtA0N.js} +1 -1
  74. package/dist/{campaign-k_WHxsOR.js → campaign-B2HD3DRn.js} +8 -8
  75. package/dist/{campaign-DlHDgoFX.js → campaign-CIyWTu9f.js} +2 -2
  76. package/dist/{campaign.fn-B-4JRzft.js → campaign.fn-DJzUFP-T.js} +2 -2
  77. package/dist/{collection.fn-zQwWDzZT.js → collection.fn-LB9uKdHM.js} +2 -2
  78. package/dist/{currency-CQVHXBFe.js → currency-B3pBZiCD.js} +1 -1
  79. package/dist/{duplicateCampaign-YTXMbJTj.js → duplicateCampaign-CiIDQH1W.js} +2 -2
  80. package/dist/{effect-CQkVLHWi.js → effect-Bp0w1Vly.js} +1 -1
  81. package/dist/{email-addresses-BIoVbPGC.js → email-addresses-qxmP-ghm.js} +2 -2
  82. package/dist/{helper-BCkTvF4m.js → helper-PRIAnsXY.js} +1 -1
  83. package/dist/{index-BFIHEBnX.js → index-BId5mHYh.js} +3 -3
  84. package/dist/{index-BAJOC43K.js → index-BLH6nPs9.js} +3 -3
  85. package/dist/{index-B-bQnb0_.js → index-BV4bWZM1.js} +576 -551
  86. package/dist/{index-BYvnqARr.js → index-BZ42-wj6.js} +9 -9
  87. package/dist/{index-CTrcdIkt.js → index-B_fZHfs-.js} +2 -2
  88. package/dist/{index-BRPajAkE.js → index-C6jzfbh8.js} +7 -7
  89. package/dist/{index-BJkRTH5T.js → index-CA5-wXVF.js} +1 -1
  90. package/dist/{index-BTkxgos0.js → index-DA-OPM4v.js} +2 -2
  91. package/dist/{index-CDIe15AY.js → index-DMRdy2Kz.js} +2 -2
  92. package/dist/index-DPF_QE13.js +69 -0
  93. package/dist/index-DS__Cknq.js +74 -0
  94. package/dist/{index-Dvqguh2B.js → index-DbdZvsUQ.js} +2 -2
  95. package/dist/{index-BJIQe3QJ.js → index-DgR5Yphl.js} +1 -1
  96. package/dist/{index-BUP4aHq8.js → index-DiuFB2hK.js} +2 -2
  97. package/dist/index-DopAV1p0.js +68 -0
  98. package/dist/{index-CpnchVe1.js → index-F3o5W57q.js} +9 -9
  99. package/dist/{index-D5AR7A5e.js → index-TRXyLWUu.js} +2 -2
  100. package/dist/{index-DdOj8Hew.js → index-XzWyheJy.js} +1 -1
  101. package/dist/{index-C6mOI2Pp.js → index-aTCNe4X_.js} +1 -1
  102. package/dist/{index-Bonq819P.js → index-fjrIMEy7.js} +1 -1
  103. package/dist/{index-BOJogkKQ.js → index-nyzNkE9r.js} +1 -1
  104. package/dist/{index.esm2017-D0fhMMPG.js → index.esm2017-DZIDjb2C.js} +1 -1
  105. package/dist/{loading-C686AMVG.js → loading-CSdKEjY5.js} +1 -1
  106. package/dist/{lodash-CANlWUWW.js → lodash-BIB2o8LD.js} +1 -1
  107. package/dist/{member-import-UzJ6ByIS.js → member-import-PcGNpuqH.js} +1 -1
  108. package/dist/{membership-DCVzFaFy.js → membership-ivTpKFxy.js} +2 -2
  109. package/dist/{money-DuazwoX7.js → money-BSDhQ-zg.js} +1 -1
  110. package/dist/{number-B2HFiV0g.js → number-ByYnVDwR.js} +1 -1
  111. package/dist/{objectid-Bq-oVMdP.js → objectid-BJu8QMfW.js} +10 -10
  112. package/dist/{onboarding-BxvNxz-9.js → onboarding-Cr2iuJY2.js} +3 -3
  113. package/dist/{onboardingSetup-CcvKmyx8.js → onboardingSetup-D6I4p209.js} +2 -2
  114. package/dist/{plugins-C39O5j42.js → plugins-D3BYIk9P.js} +3 -3
  115. package/dist/{reward-HYt-2nxt.js → reward-UplovmpX.js} +1 -1
  116. package/dist/{rule-3xNIYM7z.js → rule-CI8Gfa0f.js} +10 -10
  117. package/dist/style.css +1 -1
  118. package/dist/{template-D37Z_b0m.js → template-Bepdb4Vy.js} +6 -6
  119. package/dist/{timezone-JwnQgpaU.js → timezone-CdDDjOpp.js} +1 -1
  120. package/dist/{transaction.fn-C5vswLI_.js → transaction.fn-DiRDf20s.js} +2 -2
  121. package/dist/{trigger-Bc6s2cvq.js → trigger-B9BqJ3WQ.js} +5 -5
  122. package/dist/{useMarketingMaterialActions-DMGyAXcy.js → useMarketingMaterialActions-Do9xLe-A.js} +3 -3
  123. package/dist/{usePagination-DLOOwiiY.js → usePagination-CuHuUThw.js} +1 -1
  124. package/dist/{user-CTIGugVF.js → user-CX4hU-xf.js} +1 -1
  125. package/dist/{vue-i18n-Dpic36zz.js → vue-i18n-DOpMPUHr.js} +109 -109
  126. package/dist/{xlsx-CT9_1SFr.js → xlsx-BQVBwvzT.js} +166 -166
  127. package/dist/{zod-CGVrMcDl.js → zod-Jw_6SDXB.js} +1 -1
  128. package/package.json +1 -1
  129. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +0 -1331
  130. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +0 -96
  131. package/dist/WhatsappBot-C4Oz7Xwv.js +0 -441
  132. package/dist/WhatsappBotSettings-CKqaWzwE.js +0 -136
  133. package/dist/index-D7-Q86HI.js +0 -54
  134. package/dist/index-hAKRfE-4.js +0 -67
  135. package/dist/index-o2Ga_qaX.js +0 -39
@@ -1,96 +0,0 @@
1
- import { computed as n, toValue as h, defineComponent as x, openBlock as w, createElementBlock as A, normalizeClass as b, createElementVNode as B, createTextVNode as _, toDisplayString as C, unref as N } from "vue";
2
- import { u as f } from "./vue-i18n-Dpic36zz.js";
3
- function O(a) {
4
- const o = a.connectedAt !== null;
5
- switch (a.status) {
6
- case "connected":
7
- return "connected";
8
- case "disconnected":
9
- return "disconnected";
10
- case "connecting":
11
- return o ? "connecting" : void 0;
12
- case "not_found":
13
- return o ? "loggedOut" : void 0;
14
- case "unavailable":
15
- return o ? "unavailable" : void 0;
16
- case "pairing":
17
- return;
18
- }
19
- }
20
- const g = [
21
- "bg-fm-color-primary",
22
- "bg-fm-color-secondary-plum",
23
- "bg-fm-color-system-success-400"
24
- ];
25
- function I(a) {
26
- const { t: o, locale: l } = f(), t = n(() => h(a)), c = n(
27
- () => {
28
- var e, s, p, i, m, d;
29
- return ((s = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : s.businessName) || ((i = (p = t.value) == null ? void 0 : p.account) == null ? void 0 : i.name) || ((d = (m = t.value) == null ? void 0 : m.account) == null ? void 0 : d.phoneNumber) || o("connect.whatsappBot.unnamedAccount");
30
- }
31
- ), r = n(
32
- () => {
33
- var e, s;
34
- return ((s = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : s.phoneNumber) || o("connect.whatsappBot.phoneUnavailable");
35
- }
36
- ), u = n(
37
- () => c.value.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]).join("").toLocaleUpperCase(l.value)
38
- ), v = n(
39
- () => t.value ? O(t.value) ?? "unavailable" : "unavailable"
40
- ), y = n(
41
- () => {
42
- var e;
43
- return g[parseInt(((e = t.value) == null ? void 0 : e.clientId.slice(-6)) ?? "0", 16) % g.length];
44
- }
45
- );
46
- return { name: c, phoneNumber: r, initials: u, state: v, avatarColor: y };
47
- }
48
- const L = /* @__PURE__ */ x({
49
- __name: "WhatsappAccountStatusLabel",
50
- props: {
51
- state: {}
52
- },
53
- setup(a) {
54
- const o = a, { t: l } = f(), t = {
55
- connected: {
56
- label: "connect.whatsappBot.connected",
57
- pill: "text-fm-color-typo-success bg-fm-color-system-success-100",
58
- dot: "bg-fm-color-system-success-400"
59
- },
60
- connecting: {
61
- label: "connect.whatsappBot.statusConnecting",
62
- pill: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
63
- dot: "bg-fm-color-system-warning-400"
64
- },
65
- disconnected: {
66
- label: "connect.whatsappBot.disconnected",
67
- pill: "text-fm-color-typo-error bg-fm-color-system-error-100",
68
- dot: "bg-fm-color-system-error-400"
69
- },
70
- loggedOut: {
71
- label: "connect.whatsappBot.loggedOut",
72
- pill: "text-fm-color-typo-error bg-fm-color-system-error-100",
73
- dot: "bg-fm-color-system-error-400"
74
- },
75
- unavailable: {
76
- label: "connect.whatsappBot.statusUnavailable",
77
- pill: "text-fm-color-typo-secondary bg-fm-color-neutral-gray-100",
78
- dot: "bg-fm-color-neutral-gray-400"
79
- }
80
- }, c = n(() => t[o.state]);
81
- return (r, u) => (w(), A("span", {
82
- class: b(["flex items-center gap-[6px] text-[12px] font-semibold px-[8px] py-[3px] rounded-[6px]", c.value.pill])
83
- }, [
84
- B("span", {
85
- "aria-hidden": "true",
86
- class: b(["w-[6px] h-[6px] rounded-full", c.value.dot])
87
- }, null, 2),
88
- _(" " + C(N(l)(c.value.label)), 1)
89
- ], 2));
90
- }
91
- });
92
- export {
93
- L as _,
94
- I as u,
95
- O as w
96
- };
@@ -1,441 +0,0 @@
1
- import { defineComponent as F, computed as W, resolveComponent as _, openBlock as a, createElementBlock as d, createVNode as h, unref as t, withCtx as k, createElementVNode as e, normalizeClass as G, toDisplayString as s, createCommentVNode as D, Fragment as U, renderList as Q, createBlock as $, useModel as J, ref as A, watch as O, onBeforeUnmount as q, createTextVNode as H, mergeProps as K, createSlots as X } from "vue";
2
- import { u as I } from "./vue-i18n-Dpic36zz.js";
3
- import { useRouter as Y } from "vue-router";
4
- import { S as M } from "./index-BUP4aHq8.js";
5
- import { w as L } from "./index-D7-Q86HI.js";
6
- import { u as ee, _ as te, w as oe } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js";
7
- import { R as T } from "./app-BEYzXWZO.js";
8
- import { b as ne } from "./browser-BSAOEeIM.js";
9
- const se = { class: "flex items-center gap-[12px]" }, ae = { class: "min-w-0 flex-1" }, ce = ["title"], le = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, re = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, ie = {
10
- key: 0,
11
- class: "text-[12px] text-fm-color-typo-secondary"
12
- }, pe = /* @__PURE__ */ F({
13
- __name: "WhatsappAccountCard",
14
- props: {
15
- account: {}
16
- },
17
- setup(b) {
18
- const l = b, { t: n, locale: i } = I(), { name: g, phoneNumber: p, initials: u, state: x, avatarColor: y } = ee(
19
- () => l.account
20
- ), C = W(
21
- () => x.value === "connected" || x.value === "connecting"
22
- );
23
- function w(f) {
24
- return new Intl.DateTimeFormat(i.value, {
25
- year: "numeric",
26
- month: "short",
27
- day: "numeric"
28
- }).format(new Date(f));
29
- }
30
- return (f, B) => {
31
- const S = _("RouterLink");
32
- return a(), d("li", null, [
33
- h(S, {
34
- to: {
35
- name: t(T)["$connect-WHATSAPP_ACCOUNT"],
36
- params: { clientId: b.account.clientId }
37
- },
38
- class: "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 no-underline cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary focus-visible:ring-offset-[2px]"
39
- }, {
40
- default: k(() => [
41
- e("div", se, [
42
- e("div", {
43
- "aria-hidden": "true",
44
- class: G(["w-[48px] h-[48px] rounded-full shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", t(y)])
45
- }, s(t(u)), 3),
46
- e("div", ae, [
47
- e("h2", {
48
- class: "text-[16px] leading-[24px] font-semibold truncate",
49
- title: t(g)
50
- }, s(t(g)), 9, ce),
51
- e("p", le, s(t(p)), 1)
52
- ])
53
- ]),
54
- e("div", re, [
55
- h(te, { state: t(x) }, null, 8, ["state"]),
56
- C.value && b.account.connectedAt ? (a(), d("span", ie, s(t(n)("connect.whatsappBot.connectedSince", {
57
- date: w(b.account.connectedAt)
58
- })), 1)) : D("", !0)
59
- ])
60
- ]),
61
- _: 1
62
- }, 8, ["to"])
63
- ]);
64
- };
65
- }
66
- }), ue = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, de = /* @__PURE__ */ F({
67
- __name: "WhatsappAccountList",
68
- props: {
69
- accounts: {}
70
- },
71
- setup(b) {
72
- return (l, n) => (a(), d("ul", ue, [
73
- (a(!0), d(U, null, Q(b.accounts, (i) => (a(), $(pe, {
74
- key: i.clientId,
75
- account: i
76
- }, null, 8, ["account"]))), 128))
77
- ]));
78
- }
79
- }), me = { class: "text-[18px] font-semibold" }, xe = {
80
- key: 0,
81
- role: "status",
82
- class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
83
- }, fe = { class: "text-[18px] font-semibold" }, _e = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, he = {
84
- key: 1,
85
- class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
86
- }, ve = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, ge = { class: "text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-[14px]" }, be = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, we = { key: 0 }, Be = { class: "font-semibold" }, Te = { class: "font-semibold" }, ke = { class: "font-semibold" }, Ae = { class: "font-semibold" }, $e = { key: 3 }, Ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Se = { 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" }, Pe = {
87
- key: 0,
88
- role: "status",
89
- class: "flex flex-col items-center gap-[12px] text-[13px]"
90
- }, Fe = {
91
- key: 1,
92
- class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
93
- }, Ee = {
94
- role: "alert",
95
- class: "text-[14px] text-fm-color-typo-error"
96
- }, Ve = ["src", "alt"], We = {
97
- key: 3,
98
- role: "status",
99
- "aria-live": "polite",
100
- class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
101
- }, De = /* @__PURE__ */ F({
102
- __name: "WhatsappConnectDialog",
103
- props: {
104
- modelValue: { type: Boolean, required: !0 },
105
- modelModifiers: {}
106
- },
107
- emits: ["update:modelValue"],
108
- setup(b) {
109
- const l = J(b, "modelValue"), { t: n } = I(), i = A(""), g = A(!1), p = A(""), u = A(!1), x = A();
110
- let y, C, w;
111
- function f() {
112
- y == null || y.abort(), clearTimeout(C), C = void 0, clearTimeout(w), w = void 0;
113
- }
114
- async function B(c, o, r) {
115
- if (!r.aborted) {
116
- try {
117
- const m = await L.getClient(c, o, r);
118
- if (r.aborted) return;
119
- if ((m.status === "connecting" || m.status === "connected") && (u.value = !0), m.status === "connected" && m.profileStatus === "ready") {
120
- f(), u.value = !1, x.value = m, w = setTimeout(() => {
121
- l.value = !1;
122
- }, 1800);
123
- return;
124
- }
125
- if (m.status === "not_found") {
126
- f(), u.value = !1, i.value = "", p.value = n("connect.whatsappBot.errors.qrExpired");
127
- return;
128
- }
129
- } catch {
130
- }
131
- r.aborted || (C = setTimeout(() => {
132
- B(c, o, r);
133
- }, 2e3));
134
- }
135
- }
136
- async function S() {
137
- f();
138
- const c = new AbortController();
139
- y = c, i.value = "", p.value = "", u.value = !1, x.value = void 0, g.value = !0;
140
- try {
141
- const o = M.getBusinessId();
142
- if (!o)
143
- throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
144
- const r = await L.createClient(
145
- o,
146
- c.signal
147
- ), m = await ne.toDataURL(r.qr, {
148
- width: 224,
149
- margin: 2,
150
- errorCorrectionLevel: "M"
151
- });
152
- c.signal.aborted || (i.value = m, B(o, r.clientId, c.signal));
153
- } catch (o) {
154
- c.signal.aborted || (p.value = o instanceof Error ? o.message : n("connect.whatsappBot.errors.loadQr"));
155
- } finally {
156
- c.signal.aborted || (g.value = !1);
157
- }
158
- }
159
- return O(
160
- l,
161
- (c) => {
162
- c ? S() : f();
163
- },
164
- { immediate: !0 }
165
- ), q(f), (c, o) => {
166
- const r = _("i18n-t"), m = _("FmCircularProgress"), N = _("FmButton"), j = _("FmDialog");
167
- return a(), $(j, {
168
- modelValue: l.value,
169
- "onUpdate:modelValue": o[0] || (o[0] = (P) => l.value = P),
170
- "min-width": "min(720px, calc(100% - 32px))",
171
- "max-width": "720px",
172
- "max-height": "90vh",
173
- "dismiss-away": ""
174
- }, {
175
- "dialog-header": k(() => [
176
- e("h2", me, s(t(n)("connect.whatsappBot.connectAccount")), 1)
177
- ]),
178
- default: k(() => {
179
- var P, E, V;
180
- return [
181
- x.value ? (a(), d("div", xe, [
182
- o[1] || (o[1] = e("div", {
183
- "aria-hidden": "true",
184
- 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]"
185
- }, [
186
- e("svg", {
187
- width: "32",
188
- height: "32",
189
- viewBox: "0 0 24 24",
190
- fill: "none",
191
- stroke: "currentColor",
192
- "stroke-width": "2.2",
193
- "stroke-linecap": "round",
194
- "stroke-linejoin": "round"
195
- }, [
196
- e("path", { d: "M20 6 9 17l-5-5" })
197
- ])
198
- ], -1)),
199
- e("h3", fe, s(t(n)("connect.whatsappBot.accountConnected")), 1),
200
- e("p", _e, s(((P = x.value.account) == null ? void 0 : P.businessName) || ((E = x.value.account) == null ? void 0 : E.name) || t(n)("connect.whatsappBot.unnamedAccount")) + " · " + s(((V = x.value.account) == null ? void 0 : V.phoneNumber) || t(n)("connect.whatsappBot.phoneUnavailable")), 1)
201
- ])) : (a(), d("div", he, [
202
- e("div", ve, [
203
- e("p", ge, s(t(n)("connect.whatsappBot.scanDescription")), 1),
204
- e("ol", ye, [
205
- (a(), d(U, null, Q(4, (v) => e("li", {
206
- key: v,
207
- class: "flex gap-[12px]"
208
- }, [
209
- e("span", be, s(v), 1),
210
- v === 1 ? (a(), d("span", we, s(t(n)("connect.whatsappBot.steps.openApp")), 1)) : v === 2 ? (a(), $(r, {
211
- key: 1,
212
- keypath: "connect.whatsappBot.steps.openSettings",
213
- tag: "span",
214
- scope: "global"
215
- }, {
216
- menu: k(() => [
217
- e("b", Be, s(t(n)("connect.whatsappBot.menu")), 1)
218
- ]),
219
- settings: k(() => [
220
- e("b", Te, s(t(n)("connect.whatsappBot.settings")), 1)
221
- ]),
222
- _: 1
223
- })) : v === 3 ? (a(), $(r, {
224
- key: 2,
225
- keypath: "connect.whatsappBot.steps.linkDevice",
226
- tag: "span",
227
- scope: "global"
228
- }, {
229
- linkedDevices: k(() => [
230
- e("b", ke, s(t(n)("connect.whatsappBot.linkedDevices")), 1)
231
- ]),
232
- linkDevice: k(() => [
233
- e("b", Ae, s(t(n)("connect.whatsappBot.linkDevice")), 1)
234
- ]),
235
- _: 1
236
- })) : (a(), d("span", $e, s(t(n)("connect.whatsappBot.steps.scanQr")), 1))
237
- ])), 64))
238
- ]),
239
- e("p", Ce, s(t(n)("connect.whatsappBot.connectionNote")), 1)
240
- ]),
241
- e("div", Se, [
242
- g.value ? (a(), d("div", Pe, [
243
- h(m),
244
- H(s(t(n)("connect.whatsappBot.generatingQr")), 1)
245
- ])) : p.value ? (a(), d("div", Fe, [
246
- e("p", Ee, s(p.value), 1),
247
- h(N, {
248
- label: t(n)("connect.whatsappBot.tryAgain"),
249
- "prepend-icon": "refresh",
250
- onClick: S
251
- }, null, 8, ["label"])
252
- ])) : i.value ? (a(), d("img", {
253
- key: 2,
254
- src: i.value,
255
- alt: t(n)("connect.whatsappBot.qrAlt"),
256
- width: "224",
257
- height: "224",
258
- class: G({ "opacity-20": u.value })
259
- }, null, 10, Ve)) : D("", !0),
260
- u.value ? (a(), d("div", We, [
261
- h(m),
262
- H(" " + s(t(n)("connect.whatsappBot.connecting")), 1)
263
- ])) : D("", !0)
264
- ])
265
- ]))
266
- ];
267
- }),
268
- _: 1
269
- }, 8, ["modelValue"]);
270
- };
271
- }
272
- }), Ie = { 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]" }, Ne = { class: "text-[20px] leading-[28px] font-bold" }, je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px]" }, Oe = /* @__PURE__ */ F({
273
- __name: "WhatsappEmptyState",
274
- emits: ["connect"],
275
- setup(b, { emit: l }) {
276
- const n = l, { t: i } = I();
277
- return (g, p) => {
278
- const u = _("FmButton");
279
- return a(), d("div", Ie, [
280
- p[1] || (p[1] = e("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
281
- e("svg", {
282
- width: "34",
283
- height: "34",
284
- viewBox: "0 0 24 24",
285
- fill: "none",
286
- stroke: "currentColor",
287
- "stroke-width": "1.6",
288
- "stroke-linecap": "round",
289
- "stroke-linejoin": "round",
290
- "aria-hidden": "true"
291
- }, [
292
- e("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
293
- e("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
294
- ])
295
- ], -1)),
296
- e("h2", Ne, s(t(i)("connect.whatsappBot.emptyTitle")), 1),
297
- e("p", je, s(t(i)("connect.whatsappBot.emptyDescription")), 1),
298
- h(u, {
299
- class: "mt-[16px]",
300
- label: t(i)("connect.whatsappBot.connectAccountCta"),
301
- "prepend-icon": "add",
302
- onClick: p[0] || (p[0] = (x) => n("connect"))
303
- }, null, 8, ["label"])
304
- ]);
305
- };
306
- }
307
- }), He = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, Me = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, Le = { class: "flex items-center gap-8" }, Ue = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, Re = {
308
- key: 1,
309
- role: "status",
310
- class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
311
- }, Ge = {
312
- key: 2,
313
- 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]"
314
- }, Qe = {
315
- role: "alert",
316
- class: "text-[14px] text-fm-color-typo-error"
317
- }, tt = /* @__PURE__ */ F({
318
- __name: "WhatsappBot",
319
- setup(b) {
320
- const { t: l } = I(), n = Y(), i = A([]), g = A(!0), p = A("");
321
- let u, x;
322
- const y = W(
323
- () => i.value.filter((c) => oe(c) !== void 0)
324
- ), C = W(() => [
325
- {
326
- label: l("connect.whatsappBot.accounts"),
327
- value: T["$connect-WHATSAPP_BOT"],
328
- badge: y.value.length
329
- },
330
- {
331
- label: l("connect.whatsappBot.settings"),
332
- value: T["$connect-WHATSAPP_BOT_SETTINGS"]
333
- }
334
- ]), w = W(
335
- () => n.currentRoute.value.name === T["$connect-WHATSAPP_BOT_SETTINGS"] ? T["$connect-WHATSAPP_BOT_SETTINGS"] : T["$connect-WHATSAPP_BOT"]
336
- );
337
- async function f(c = !1) {
338
- clearTimeout(x), u == null || u.abort();
339
- const o = new AbortController();
340
- u = o, c || (g.value = !0, p.value = "");
341
- try {
342
- const r = M.getBusinessId();
343
- if (!r)
344
- throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
345
- const m = await L.listClients(r, o.signal);
346
- o.signal.aborted || (i.value = m, p.value = "");
347
- } catch (r) {
348
- !o.signal.aborted && !c && (p.value = r instanceof Error ? r.message : l("connect.whatsappBot.errors.loadSessions"));
349
- } finally {
350
- o.signal.aborted || (g.value = !1, x = setTimeout(() => void f(!0), 1e4));
351
- }
352
- }
353
- const B = A(!1);
354
- function S(c) {
355
- (c === T["$connect-WHATSAPP_BOT"] || c === T["$connect-WHATSAPP_BOT_SETTINGS"]) && n.push({ name: c });
356
- }
357
- return O(B, (c) => {
358
- c || f();
359
- }), O(
360
- () => M.getBusinessId(),
361
- () => {
362
- B.value = !1, i.value = [], f();
363
- },
364
- { immediate: !0 }
365
- ), q(() => {
366
- u == null || u.abort(), clearTimeout(x);
367
- }), (c, o) => {
368
- const r = _("FmPill"), m = _("FmButton"), N = _("FmBadge"), j = _("FmTab"), P = _("FmTabs"), E = _("RouterView"), V = _("FmCircularProgress");
369
- return a(), d(U, null, [
370
- e("div", He, [
371
- e("div", Me, [
372
- e("div", Le, [
373
- e("h1", Ue, s(t(l)("connect.navigation.whatsappBot")), 1),
374
- h(r, { variant: "beta" })
375
- ]),
376
- w.value === t(T)["$connect-WHATSAPP_BOT"] && y.value.length ? (a(), $(m, {
377
- key: 0,
378
- label: t(l)("connect.whatsappBot.connectAccountCta"),
379
- "prepend-icon": "add",
380
- onClick: o[0] || (o[0] = (v) => B.value = !0)
381
- }, null, 8, ["label"])) : D("", !0)
382
- ]),
383
- h(P, {
384
- "model-value": w.value,
385
- items: C.value,
386
- role: "tablist",
387
- "aria-label": t(l)("connect.navigation.whatsappBot"),
388
- class: "mt-[16px] border-b border-fm-color-neutral-gray-100"
389
- }, {
390
- default: k(({ label: v, value: z, badge: R, tabsProps: Z }) => [
391
- h(j, K(Z, {
392
- "model-value": w.value,
393
- label: v,
394
- value: z,
395
- "onUpdate:modelValue": S
396
- }), X({ _: 2 }, [
397
- R ? {
398
- name: "append",
399
- fn: k(() => [
400
- h(N, {
401
- value: R,
402
- variant: "neutral",
403
- inline: "",
404
- class: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
405
- }, null, 8, ["value"])
406
- ]),
407
- key: "0"
408
- } : void 0
409
- ]), 1040, ["model-value", "label", "value"])
410
- ]),
411
- _: 1
412
- }, 8, ["model-value", "items", "aria-label"]),
413
- w.value === t(T)["$connect-WHATSAPP_BOT_SETTINGS"] ? (a(), $(E, { key: 0 })) : g.value ? (a(), d("div", Re, [
414
- h(V),
415
- H(" " + s(t(l)("connect.whatsappBot.loadingSessions")), 1)
416
- ])) : p.value ? (a(), d("div", Ge, [
417
- e("p", Qe, s(p.value), 1),
418
- h(m, {
419
- label: t(l)("connect.whatsappBot.tryAgain"),
420
- "prepend-icon": "refresh",
421
- onClick: o[1] || (o[1] = (v) => f())
422
- }, null, 8, ["label"])
423
- ])) : y.value.length ? (a(), $(de, {
424
- key: 3,
425
- accounts: y.value
426
- }, null, 8, ["accounts"])) : (a(), $(Oe, {
427
- key: 4,
428
- onConnect: o[2] || (o[2] = (v) => B.value = !0)
429
- }))
430
- ]),
431
- h(De, {
432
- modelValue: B.value,
433
- "onUpdate:modelValue": o[3] || (o[3] = (v) => B.value = v)
434
- }, null, 8, ["modelValue"])
435
- ], 64);
436
- };
437
- }
438
- });
439
- export {
440
- tt as default
441
- };
@@ -1,136 +0,0 @@
1
- import { defineComponent as j, computed as C, ref as l, watch as F, onBeforeUnmount as D, resolveComponent as b, openBlock as c, createElementBlock as u, createVNode as v, createTextVNode as T, toDisplayString as f, unref as n, Fragment as H, createElementVNode as _, createCommentVNode as h, createBlock as L } from "vue";
2
- import { u as O } from "./vue-i18n-Dpic36zz.js";
3
- import { F as z } from "./index-o2Ga_qaX.js";
4
- import { S as G } from "./index-BUP4aHq8.js";
5
- import { w as A } from "./index-D7-Q86HI.js";
6
- import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const R = { class: "mt-[24px] max-w-[720px] flex flex-col gap-[20px]" }, X = {
8
- key: 0,
9
- role: "status",
10
- class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
11
- }, J = {
12
- key: 0,
13
- class: "border-[1px] border-fm-color-neutral-gray-100 rounded-[16px] p-[24px] flex flex-col gap-[16px]"
14
- }, K = { class: "flex flex-col gap-[4px]" }, Q = { class: "text-[16px] leading-[24px] font-semibold" }, Y = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Z = {
15
- key: 1,
16
- role: "alert",
17
- class: "text-[14px] text-fm-color-typo-error"
18
- }, $ = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, q = {
19
- key: 0,
20
- role: "status",
21
- class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
22
- }, ee = /* @__PURE__ */ j({
23
- __name: "WhatsappBotSettings",
24
- setup(te) {
25
- const { t } = O(), g = C(() => G.getBusinessId() ?? ""), s = l(""), p = l(""), y = l(!0), d = l(!1), r = l(!1), i = l(""), x = l(!1), B = z, w = C(
26
- () => !d.value || r.value || s.value === p.value || s.value.length > B
27
- );
28
- let o, I;
29
- function m() {
30
- clearTimeout(I), x.value = !1;
31
- }
32
- async function k() {
33
- o == null || o.abort(), m();
34
- const a = new AbortController();
35
- o = a, y.value = !0, d.value = !1, r.value = !1, i.value = "", s.value = "", p.value = "";
36
- try {
37
- if (!g.value)
38
- throw new Error(t("connect.whatsappBot.errors.selectBusiness"));
39
- const e = await A.getSettings(
40
- g.value,
41
- a.signal
42
- );
43
- if (a.signal.aborted) return;
44
- s.value = e.botInstructions, p.value = e.botInstructions, d.value = !0;
45
- } catch (e) {
46
- a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.loadSettings"));
47
- } finally {
48
- a.signal.aborted || (y.value = !1);
49
- }
50
- }
51
- async function N() {
52
- if (w.value) return;
53
- o == null || o.abort();
54
- const a = new AbortController();
55
- o = a, r.value = !0, i.value = "", m();
56
- try {
57
- const e = await A.saveSettings(
58
- g.value,
59
- { botInstructions: s.value },
60
- a.signal
61
- );
62
- if (a.signal.aborted) return;
63
- p.value = e.botInstructions, s.value = e.botInstructions, x.value = !0, I = setTimeout(() => {
64
- x.value = !1;
65
- }, 2500);
66
- } catch (e) {
67
- a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.saveSettings"));
68
- } finally {
69
- a.signal.aborted || (r.value = !1);
70
- }
71
- }
72
- function V() {
73
- s.value = p.value, m();
74
- }
75
- return F(s, m, { flush: "sync" }), F(g, k, { immediate: !0 }), D(() => {
76
- o == null || o.abort(), m();
77
- }), (a, e) => {
78
- const E = b("FmCircularProgress"), P = b("FmTextarea"), S = b("FmButton"), U = b("FmIcon");
79
- return c(), u("div", R, [
80
- y.value ? (c(), u("div", X, [
81
- v(E),
82
- T(" " + f(n(t)("connect.whatsappBot.botSettings.loading")), 1)
83
- ])) : (c(), u(H, { key: 1 }, [
84
- d.value ? (c(), u("div", J, [
85
- _("div", K, [
86
- _("h2", Q, f(n(t)("connect.whatsappBot.botSettings.instructions")), 1),
87
- _("p", Y, f(n(t)("connect.whatsappBot.botSettings.description")), 1)
88
- ]),
89
- v(P, {
90
- modelValue: s.value,
91
- "onUpdate:modelValue": e[0] || (e[0] = (W) => s.value = W),
92
- "aria-label": n(t)("connect.whatsappBot.botSettings.instructions"),
93
- placeholder: n(t)("connect.whatsappBot.botSettings.placeholder"),
94
- "max-length": n(B),
95
- disabled: r.value,
96
- "show-word-count": "",
97
- class: "bot-instructions-textarea"
98
- }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
99
- ])) : h("", !0),
100
- i.value ? (c(), u("p", Z, f(i.value), 1)) : h("", !0),
101
- d.value ? h("", !0) : (c(), L(S, {
102
- key: 2,
103
- class: "self-start",
104
- label: n(t)("connect.whatsappBot.tryAgain"),
105
- "prepend-icon": "refresh",
106
- onClick: k
107
- }, null, 8, ["label"])),
108
- _("div", $, [
109
- x.value ? (c(), u("span", q, [
110
- v(U, {
111
- name: "check",
112
- size: "sm"
113
- }),
114
- T(" " + f(n(t)("connect.whatsappBot.botSettings.saved")), 1)
115
- ])) : h("", !0),
116
- v(S, {
117
- variant: "secondary",
118
- label: n(t)("connect.common.cancel"),
119
- disabled: w.value,
120
- onClick: V
121
- }, null, 8, ["label", "disabled"]),
122
- v(S, {
123
- label: n(t)("connect.common.save"),
124
- disabled: w.value,
125
- loading: r.value,
126
- onClick: N
127
- }, null, 8, ["label", "disabled", "loading"])
128
- ])
129
- ], 64))
130
- ]);
131
- };
132
- }
133
- }), re = /* @__PURE__ */ M(ee, [["__scopeId", "data-v-b989ed03"]]);
134
- export {
135
- re as default
136
- };