@feedmepos/mf-connect 0.1.125-dev → 0.1.126-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/{App-lOnYYWzx.js → App-B_Yp6cvN.js} +10 -10
  2. package/dist/{AuditLogs-C5aMzrhF.js → AuditLogs-C1U17evK.js} +13 -13
  3. package/dist/{Bin-Dk0rAESN.js → Bin-CmIpEIwe.js} +8 -8
  4. package/dist/{Broadcast-BBNpuceo.js → Broadcast-DkV4BdU_.js} +12 -12
  5. package/dist/{CampaignAnalytic-BgROt0Yu.js → CampaignAnalytic-Dkwo_lpB.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CrgCuB45.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js} +9 -9
  7. package/dist/{Card-fSEJaQmL.js → Card-DXCkG34M.js} +23 -23
  8. package/dist/{Collections-DVM1dOOo.js → Collections-CybPfSO4.js} +8 -8
  9. package/dist/{Credit-CNDYRDiK.js → Credit-B-KUzWsX.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cup-EvR6.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CJ90EwzB.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js} +36 -36
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-JQmGeS__.js → EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js} +6 -6
  13. package/dist/{Experience-Bqfx1Gjq.js → Experience-Q2NHpa-V.js} +13 -13
  14. package/dist/{FileSaver.min-B4Jv2-PR.js → FileSaver.min-CKw2rn-J.js} +1 -1
  15. package/dist/{Game-DmbJYYaC.js → Game-lZvkg04z.js} +13 -13
  16. package/dist/{GiftCardSetup-DHxDI5hU.js → GiftCardSetup-CPRju80_.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BfrjE7gE.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js} +7 -7
  18. package/dist/{Goals-B-3PoUlx.js → Goals-asGsUeVv.js} +4 -4
  19. package/dist/{Grab-BRfVvqAr.js → Grab-BjFLSMpE.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-TUlgTblc.js → ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js} +1 -1
  21. package/dist/{Index-vfYiu7G1.js → Index-DIasPS4Y.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BKdq7bw2.js → LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DUAKzHgZ.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js} +1 -1
  24. package/dist/{LoyaltyDashboard-CHEIpAHw.js → LoyaltyDashboard-DlCsZ3YX.js} +15 -15
  25. package/dist/{MainLayout-Cf1lEoHL.js → MainLayout-DLObnTAA.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DwNxuVHy.js → MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js} +3 -3
  27. package/dist/{Marketing-BBF8mHSo.js → Marketing-JflPW-w9.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-COTHaH08.js → MarketingMaterialEdit-fSAB3YVb.js} +6 -6
  29. package/dist/{Member-BEyxcsNI.js → Member-CzNahXTj.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DLSsOeLt.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js} +24 -24
  31. package/dist/{MemberImportHistory-zs8VJsoI.js → MemberImportHistory--r_A_2Es.js} +7 -7
  32. package/dist/{MemberList-2-qKmm5p.js → MemberList-CQZQ4sN8.js} +14 -14
  33. package/dist/{MemberTransactions-DOsMBs30.js → MemberTransactions-BPg9JaUA.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DBl4cf8X.js → MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CtqBL-Ky.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js} +1 -1
  36. package/dist/{Mission-Bo7tuR13.js → Mission-CYCB3YQc.js} +14 -14
  37. package/dist/{Overview-CnoidK6U.js → Overview-B5ylMBHT.js} +4 -4
  38. package/dist/{Overview-BrGVMqE1.js → Overview-DuNuUYYq.js} +21 -21
  39. package/dist/{Point-DJ2-HEmx.js → Point-DG-Uwj25.js} +14 -14
  40. package/dist/{Promotion-D7Q3EY3d.js → Promotion-DqxBQ1yO.js} +14 -14
  41. package/dist/{Queue-CLXhXQeU.js → Queue-Cy8LGt_Y.js} +13 -13
  42. package/dist/{Record-CCF7K-pJ.js → Record-CzXbu41w.js} +9 -9
  43. package/dist/{Review-BZH_tGDe.js → Review-7VL6gIqp.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-Bs-oiDMC.js → ReviewFacebookCallback-BwzuPmrz.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-eHLJko2f.js → ReviewGoogleCallback-1JXR_f5O.js} +5 -5
  46. package/dist/{Reward-ea05o2qi.js → Reward-BKhUDEu3.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Csa8UPMS.js → RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js} +14 -14
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DW3NDgHq.js → RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js} +15 -15
  49. package/dist/{Segment-z3BAGTqr.js → Segment-DdHDJhaS.js} +26 -26
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D4H86p3o.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-x8dMt8PF.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js} +4 -4
  52. package/dist/{Setting-D0nKTgej.js → Setting-DZKGXw-i.js} +15 -15
  53. package/dist/{SettingAdvertisements-BUGsMAdi.js → SettingAdvertisements-BBNs8tCw.js} +12 -12
  54. package/dist/{Settings-C2loJXla.js → Settings-9v0hnBJZ.js} +5 -5
  55. package/dist/{Store-CbhAyr1j.js → Store-C8IlE4IH.js} +27 -27
  56. package/dist/{StoreRewards-DHt64JEN.js → StoreRewards-DWygRLR1.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CQ7I8Zli.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js} +25 -25
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ylUyqix_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js} +2 -2
  59. package/dist/{Tier-CH5DwMYW.js → Tier-7RoxGHsP.js} +27 -27
  60. package/dist/{Title-DNLw_rOp.js → Title-0q2Z4HIe.js} +23 -23
  61. package/dist/{Transaction-DCuU6B7G.js → Transaction-CFasERdg.js} +2 -2
  62. package/dist/{Upselling-DBsfEEvV.js → Upselling-DM9R6pYw.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-f-j87AZA.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js} +6 -6
  64. package/dist/{Voucher-BVztDyI0.js → Voucher-BkzW2hVV.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CrYrxFVi.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js} +12 -12
  66. package/dist/{WhatsappAccount-CobyTNkp.js → WhatsappAccount-C3WpDF9O.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C-pbY0Zv.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js} +1 -1
  68. package/dist/{WhatsappBot-xc4QD061.js → WhatsappBot-DZb-Dn3s.js} +6 -6
  69. package/dist/{WhatsappBotLogs-eiDWJkN7.js → WhatsappBotLogs--KskC32Z.js} +6 -6
  70. package/dist/WhatsappBotSettings-Dns_PqVE.js +945 -0
  71. package/dist/{WhatsappLayout-C8DejCWo.js → WhatsappLayout-NIrFGbId.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CZNpggfQ.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C6TJ4hxh.js → ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js} +2 -2
  74. package/dist/{app-Bik4hlr7.js → app-B9nLnoBt.js} +282 -242
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-BRw8QzdM.js → base.export-CBzNea0v.js} +2 -2
  77. package/dist/{business-Dv2S3X12.js → business-aT2zslwu.js} +1 -1
  78. package/dist/{campaign-witQNfmZ.js → campaign-B6nTwt17.js} +8 -8
  79. package/dist/{campaign-CNDBsfeQ.js → campaign-BDCLKFwN.js} +2 -2
  80. package/dist/{campaign.fn-Dr4w5BrO.js → campaign.fn-Ck1t5C1T.js} +103 -103
  81. package/dist/{collection.fn-C0Dx5_1j.js → collection.fn-CDna_VLD.js} +2 -2
  82. package/dist/{currency-lP50Csky.js → currency-Baum67Wz.js} +1 -1
  83. package/dist/{duplicateCampaign-BfLxdQWg.js → duplicateCampaign-BwrMZgaV.js} +2 -2
  84. package/dist/{effect-6bi20cxS.js → effect-CeJbflOK.js} +1 -1
  85. package/dist/{email-addresses-BmujKG-l.js → email-addresses-Y3vF73J0.js} +2 -2
  86. package/dist/{feature-flag-DdxBiP1p.js → feature-flag-zn6Ql9tv.js} +1 -1
  87. package/dist/{helper-DSmzzBjW.js → helper-DZvnn-yx.js} +1 -1
  88. package/dist/{index-BTud0ICl.js → index-B20FfbEE.js} +1 -1
  89. package/dist/{index-CdQGmMRo.js → index-B22ojkMy.js} +2 -2
  90. package/dist/{index-CH-uRaZH.js → index-B3LCTMwV.js} +52 -41
  91. package/dist/{index-BNdhRCyN.js → index-B5H4znfe.js} +1 -1
  92. package/dist/{index-DMT5xoCz.js → index-BL2zQnXK.js} +3 -3
  93. package/dist/{index-DGctCMca.js → index-BYUEPfbP.js} +2 -2
  94. package/dist/{index-B0Ddw1na.js → index-BqniSMV6.js} +3 -3
  95. package/dist/{index-CRd8uD-d.js → index-CDRTiAEu.js} +1 -1
  96. package/dist/{index-CCVnmv0l.js → index-CMs3aIA6.js} +2 -2
  97. package/dist/{index-CEscBR6G.js → index-CPi3Qwmj.js} +2 -2
  98. package/dist/{index-Cei8qPkg.js → index-DCR1GFCA.js} +4 -4
  99. package/dist/{index-D-Ln1G1Y.js → index-DHNhIloU.js} +1 -1
  100. package/dist/{index-DjlmY7Od.js → index-DJIt5tXC.js} +2 -2
  101. package/dist/{index-BD3HIAoL.js → index-DXKJsqgW.js} +31 -13
  102. package/dist/{index-373LDTQ7.js → index-DXyOBtgF.js} +1 -1
  103. package/dist/{index-2JiR1s6M.js → index-Da0-7h2j.js} +1 -1
  104. package/dist/{index-83SeIfhc.js → index-DkBOM8za.js} +7 -7
  105. package/dist/{index-DGz2Y25B.js → index-FgM7b2Sw.js} +2 -2
  106. package/dist/{index-CFhazRum.js → index-juXxYQ_a.js} +4 -4
  107. package/dist/{index-CH1MpmvS.js → index-njg4JLa-.js} +9 -9
  108. package/dist/{index-BYlnybS9.js → index-r_T5o_hF.js} +2 -2
  109. package/dist/{index.esm2017-BcULj0z4.js → index.esm2017-Dtk7BscN.js} +1 -1
  110. package/dist/{loading-DmCJ1FiL.js → loading-PoODMkQD.js} +1 -1
  111. package/dist/{lodash-FEhiisF1.js → lodash-TthNgH98.js} +1 -1
  112. package/dist/{member-import-BLxPVKon.js → member-import-D7zs0Jvh.js} +1 -1
  113. package/dist/{membership-Dq3LSd35.js → membership-Cab-iWQ1.js} +2 -2
  114. package/dist/{money-D2RIG9zm.js → money-9Q306M3g.js} +1 -1
  115. package/dist/{number-D87ngEVu.js → number-D9M3D435.js} +1 -1
  116. package/dist/{objectid-CuPXVpKE.js → objectid-DKvQl6FD.js} +9 -9
  117. package/dist/{onboarding-YlSAcar0.js → onboarding-D5LKUHVI.js} +3 -3
  118. package/dist/{onboardingSetup-qgS6ktSi.js → onboardingSetup-D0jsS6w5.js} +2 -2
  119. package/dist/{plugins-B3B_2EiB.js → plugins-CDTKQ1Pg.js} +3 -3
  120. package/dist/{reward-BtEe_1ZU.js → reward-De3e9vYS.js} +1 -1
  121. package/dist/{rule-PmdBF8Cb.js → rule-trVJgEOe.js} +10 -10
  122. package/dist/{template-D6wO9_aV.js → template-Bj3Tb6bP.js} +6 -6
  123. package/dist/{timezone-DPnmvzUK.js → timezone-DkuByUmb.js} +1 -1
  124. package/dist/{transaction.fn-BavSYDYI.js → transaction.fn-CPE-oQhA.js} +2 -2
  125. package/dist/{trigger-CsIScoNI.js → trigger-C6oM-8pe.js} +5 -5
  126. package/dist/{useMarketingMaterialActions-CHBfA7iR.js → useMarketingMaterialActions-C5scdJQp.js} +4 -4
  127. package/dist/{usePagination-DXPBbII4.js → usePagination-CIuTHSSG.js} +1 -1
  128. package/dist/{user-B8js0aIx.js → user-Bdlgn2yo.js} +1 -1
  129. package/dist/{vue-i18n-R6DAeTzc.js → vue-i18n-DEpDI-dt.js} +157 -157
  130. package/dist/{xlsx-CYugHPG9.js → xlsx-CvecxUOG.js} +1 -1
  131. package/dist/{zod-BEFViLGC.js → zod-bniyeWdY.js} +1 -1
  132. package/package.json +1 -1
  133. package/dist/WhatsappBotSettings-D4cMFn3z.js +0 -704
@@ -1,704 +0,0 @@
1
- import { defineComponent as L, mergeModels as Z, useModel as H, openBlock as a, createElementBlock as i, createElementVNode as e, toDisplayString as l, unref as t, withDirectives as q, vModelText as re, resolveComponent as $, Fragment as O, renderList as ee, createBlock as P, ref as y, computed as E, watch as ce, onBeforeUnmount as ie, createCommentVNode as _, createVNode as S, createTextVNode as N, withCtx as ae, normalizeClass as X, vModelRadio as fe } from "vue";
2
- import { u as U } from "./vue-i18n-R6DAeTzc.js";
3
- import { useSnackbar as de } from "@feedmepos/ui-library";
4
- import { F as J, a as W, b as ve, c as se, d as be, e as z, f as ge } from "./index-CH-uRaZH.js";
5
- import { S as Q } from "./index-DjlmY7Od.js";
6
- import { w as Y } from "./index-BD3HIAoL.js";
7
- import { p as he } from "./plugins-B3B_2EiB.js";
8
- const ye = { class: "flex flex-col gap-[10px]" }, _e = { class: "flex flex-col gap-[2px]" }, we = {
9
- id: "whatsapp-bot-instructions-title",
10
- class: "text-[16px] leading-[24px] font-semibold"
11
- }, Be = {
12
- id: "whatsapp-bot-instructions-description",
13
- class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
14
- }, ke = { class: "flex flex-col gap-[6px]" }, Se = ["placeholder", "maxlength", "disabled"], $e = {
15
- id: "whatsapp-bot-instructions-count",
16
- class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
17
- }, Ae = /* @__PURE__ */ L({
18
- __name: "BotInstructions",
19
- props: /* @__PURE__ */ Z({
20
- disabled: { type: Boolean }
21
- }, {
22
- modelValue: { required: !0 },
23
- modelModifiers: {}
24
- }),
25
- emits: ["update:modelValue"],
26
- setup(p) {
27
- const n = H(p, "modelValue"), { t: m } = U();
28
- return (s, o) => (a(), i("div", ye, [
29
- e("div", _e, [
30
- e("h2", we, l(t(m)("connect.whatsappBot.botSettings.instructions")), 1),
31
- e("p", Be, l(t(m)("connect.whatsappBot.botSettings.description")), 1)
32
- ]),
33
- e("div", ke, [
34
- q(e("textarea", {
35
- "onUpdate:modelValue": o[0] || (o[0] = (v) => n.value = v),
36
- "aria-labelledby": "whatsapp-bot-instructions-title",
37
- "aria-describedby": "whatsapp-bot-instructions-description whatsapp-bot-instructions-count",
38
- placeholder: t(m)("connect.whatsappBot.botSettings.placeholder"),
39
- maxlength: t(J),
40
- disabled: p.disabled,
41
- rows: "6",
42
- class: "block w-full min-h-[136px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white p-[12px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
43
- }, null, 8, Se), [
44
- [re, n.value]
45
- ]),
46
- e("p", $e, l(n.value.length) + " / " + l(t(J)), 1)
47
- ])
48
- ]));
49
- }
50
- }), Te = { class: "overflow-x-auto" }, Ie = ["aria-label"], Fe = { class: "border-b border-fm-color-neutral-gray-100 bg-fm-color-neutral-gray-100/30 text-[12px] leading-[16px] text-fm-color-typo-tertiary" }, Ce = {
51
- scope: "col",
52
- class: "py-[10px] pl-[16px] pr-[8px] font-semibold"
53
- }, Ee = {
54
- scope: "col",
55
- class: "px-[8px] py-[10px] font-semibold"
56
- }, Ve = {
57
- scope: "col",
58
- class: "px-[8px] py-[10px] font-semibold"
59
- }, Pe = {
60
- scope: "col",
61
- class: "py-[10px] pl-[8px] pr-[16px]"
62
- }, Ne = { class: "sr-only" }, De = { class: "text-[14px] leading-[20px]" }, Oe = { class: "py-[8px] pl-[16px] pr-[8px] font-medium" }, Le = ["title"], Ue = { class: "px-[8px] py-[8px] text-fm-color-typo-secondary tabular-nums" }, Me = ["title"], Re = { class: "px-[8px] py-[8px] text-fm-color-typo-tertiary tabular-nums" }, We = ["datetime", "title"], ze = { class: "py-[8px] pl-[8px] pr-[16px]" }, He = ["aria-label", "disabled", "aria-busy", "onClick"], Ge = { key: 1 }, ne = /* @__PURE__ */ L({
63
- __name: "ExcludedAccountsTable",
64
- props: {
65
- accounts: {},
66
- removingId: {}
67
- },
68
- emits: ["remove"],
69
- setup(p, { emit: n }) {
70
- const m = n, { t: s, locale: o } = U();
71
- function v(f) {
72
- return f.customerName || f.phoneNumber || f.conversationId;
73
- }
74
- function u(f) {
75
- return new Intl.DateTimeFormat(o.value, {
76
- dateStyle: "medium",
77
- timeStyle: "short"
78
- }).format(new Date(f));
79
- }
80
- return (f, h) => {
81
- const w = $("FmCircularProgress");
82
- return a(), i("div", Te, [
83
- e("table", {
84
- "aria-label": t(s)("connect.whatsappBot.excludedAccounts.title"),
85
- class: "w-full min-w-[600px] table-fixed border-collapse text-left"
86
- }, [
87
- h[0] || (h[0] = e("colgroup", null, [
88
- e("col", { class: "w-[30%]" }),
89
- e("col", { class: "w-[25%]" }),
90
- e("col"),
91
- e("col", { class: "w-[116px]" })
92
- ], -1)),
93
- e("thead", Fe, [
94
- e("tr", null, [
95
- e("th", Ce, l(t(s)("connect.whatsappBot.excludedAccounts.name")), 1),
96
- e("th", Ee, l(t(s)("connect.whatsappBot.excludedAccounts.phoneNumber")), 1),
97
- e("th", Ve, l(t(s)("connect.whatsappBot.excludedAccounts.excludedOn")), 1),
98
- e("th", Pe, [
99
- e("span", Ne, l(t(s)("connect.whatsappBot.excludedAccounts.actions")), 1)
100
- ])
101
- ])
102
- ]),
103
- e("tbody", De, [
104
- (a(!0), i(O, null, ee(p.accounts, (r) => (a(), i("tr", {
105
- key: r.id,
106
- class: "border-b border-fm-color-neutral-gray-100 last:border-b-0"
107
- }, [
108
- e("td", Oe, [
109
- e("span", {
110
- class: "block truncate",
111
- title: v(r)
112
- }, l(v(r)), 9, Le)
113
- ]),
114
- e("td", Ue, [
115
- e("span", {
116
- class: "block truncate",
117
- title: r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")
118
- }, l(r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")), 9, Me)
119
- ]),
120
- e("td", Re, [
121
- e("time", {
122
- datetime: r.updatedAt,
123
- title: u(r.updatedAt),
124
- class: "block truncate"
125
- }, l(u(r.updatedAt)), 9, We)
126
- ]),
127
- e("td", ze, [
128
- e("button", {
129
- type: "button",
130
- "aria-label": t(s)("connect.whatsappBot.excludedAccounts.removeAccount", {
131
- name: v(r)
132
- }),
133
- disabled: !!p.removingId,
134
- "aria-busy": p.removingId === r.id,
135
- class: "flex h-[32px] w-[84px] items-center justify-center rounded-[8px] text-[14px] font-semibold text-fm-color-typo-secondary 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",
136
- onClick: (T) => m("remove", r)
137
- }, [
138
- p.removingId === r.id ? (a(), P(w, {
139
- key: 0,
140
- size: "md",
141
- "aria-hidden": "true"
142
- })) : (a(), i("span", Ge, l(t(s)("connect.common.remove")), 1))
143
- ], 8, He)
144
- ])
145
- ]))), 128))
146
- ])
147
- ], 8, Ie)
148
- ]);
149
- };
150
- }
151
- }), Ke = {
152
- id: "whatsapp-excluded-accounts",
153
- "aria-labelledby": "whatsapp-excluded-accounts-title",
154
- class: "flex min-w-0 flex-col gap-[12px]"
155
- }, je = { class: "flex flex-col gap-[2px]" }, Xe = {
156
- id: "whatsapp-excluded-accounts-title",
157
- class: "text-[16px] leading-[24px] font-semibold"
158
- }, Je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Qe = {
159
- key: 0,
160
- role: "alert",
161
- class: "text-[14px] text-fm-color-typo-error"
162
- }, Ye = {
163
- key: 1,
164
- class: "flex flex-col items-center gap-[12px] py-[32px] text-[14px] text-fm-color-typo-secondary"
165
- }, Ze = {
166
- key: 0,
167
- class: "flex flex-wrap items-center gap-[12px]"
168
- }, qe = {
169
- role: "alert",
170
- class: "text-[14px] text-fm-color-typo-error"
171
- }, et = {
172
- key: 1,
173
- class: "flex flex-col items-center gap-[6px] rounded-[16px] border border-fm-color-neutral-gray-200 px-[24px] py-[32px] text-center"
174
- }, tt = { class: "text-[16px] leading-[24px] font-semibold" }, ot = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, lt = {
175
- key: 2,
176
- class: "overflow-hidden rounded-[16px] border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white"
177
- }, at = { class: "flex min-w-0 flex-col" }, st = { class: "text-[18px] leading-[24px] font-semibold" }, nt = { class: "text-[14px] leading-[20px] text-fm-color-typo-tertiary" }, rt = {
178
- key: 0,
179
- role: "alert",
180
- class: "mb-[12px] text-[14px] text-fm-color-typo-error"
181
- }, ct = {
182
- key: 1,
183
- class: "px-[24px] py-[40px] text-center text-[14px] text-fm-color-typo-secondary"
184
- }, it = /* @__PURE__ */ L({
185
- __name: "ExcludedAccounts",
186
- props: {
187
- accounts: {},
188
- loading: { type: Boolean },
189
- error: {}
190
- },
191
- emits: ["retry", "removed"],
192
- setup(p, { emit: n }) {
193
- const m = p, s = n, { t: o } = U(), v = de(), u = y(""), f = y(""), h = y(!1);
194
- let w;
195
- const r = E(
196
- () => [...m.accounts].sort((x, b) => b.updatedAt.localeCompare(x.updatedAt))
197
- ), T = E(() => r.value.slice(0, 3));
198
- async function C(x) {
199
- if (u.value) return;
200
- const b = Q.getBusinessId();
201
- if (!b || x.businessId !== b) return;
202
- const B = new AbortController();
203
- w = B, u.value = x.id, f.value = "";
204
- try {
205
- if (await Y.removeExcludedAccount(
206
- b,
207
- x.id,
208
- B.signal
209
- ), B.signal.aborted) return;
210
- s("removed", x.id), v.open({
211
- type: "success",
212
- message: o("connect.whatsappBot.excludedAccounts.removed", {
213
- name: x.customerName || x.phoneNumber || x.conversationId
214
- })
215
- });
216
- } catch (I) {
217
- B.signal.aborted || (f.value = I instanceof Error ? I.message : o("connect.whatsappBot.excludedAccounts.removeError"), v.open({ type: "error", message: f.value }));
218
- } finally {
219
- B.signal.aborted || (u.value = "");
220
- }
221
- }
222
- function g() {
223
- w == null || w.abort(), u.value = "", f.value = "", h.value = !1;
224
- }
225
- return ce(() => Q.getBusinessId(), g), ie(g), (x, b) => {
226
- const B = $("FmCircularProgress"), I = $("FmButton"), G = $("FmIcon"), K = $("FmDialog");
227
- return a(), i(O, null, [
228
- e("section", Ke, [
229
- e("div", je, [
230
- e("h2", Xe, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
231
- e("p", Je, l(t(o)("connect.whatsappBot.excludedAccounts.description")), 1)
232
- ]),
233
- f.value ? (a(), i("p", Qe, l(f.value), 1)) : _("", !0),
234
- p.loading ? (a(), i("output", Ye, [
235
- S(B),
236
- N(" " + l(t(o)("connect.whatsappBot.excludedAccounts.loading")), 1)
237
- ])) : (a(), i(O, { key: 2 }, [
238
- p.error ? (a(), i("div", Ze, [
239
- e("p", qe, l(p.error), 1),
240
- S(I, {
241
- variant: "secondary",
242
- "border-color": "neutral-gray-200",
243
- label: t(o)("connect.whatsappBot.tryAgain"),
244
- "prepend-icon": "refresh",
245
- class: "!rounded-full [&_.label]:text-[14px]",
246
- onClick: b[0] || (b[0] = (V) => s("retry"))
247
- }, null, 8, ["label"])
248
- ])) : _("", !0),
249
- !r.value.length && !p.error ? (a(), i("div", et, [
250
- e("h3", tt, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1),
251
- e("p", ot, l(t(o)("connect.whatsappBot.excludedAccounts.emptyDescription")), 1)
252
- ])) : r.value.length ? (a(), i("div", lt, [
253
- S(ne, {
254
- accounts: T.value,
255
- "removing-id": u.value,
256
- onRemove: C
257
- }, null, 8, ["accounts", "removing-id"]),
258
- r.value.length > T.value.length ? (a(), i("button", {
259
- key: 0,
260
- type: "button",
261
- class: "flex min-h-[44px] w-full items-center justify-center gap-[6px] border-t border-fm-color-neutral-gray-100 px-[16px] py-[8px] text-[14px] font-semibold text-fm-color-primary transition-colors hover:bg-fm-color-primary-oats focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-fm-color-primary",
262
- onClick: b[1] || (b[1] = (V) => h.value = !0)
263
- }, [
264
- N(l(t(o)("connect.whatsappBot.excludedAccounts.showAll", {
265
- count: r.value.length
266
- })) + " ", 1),
267
- S(G, {
268
- name: "chevron_right",
269
- size: "sm",
270
- "aria-hidden": "true"
271
- })
272
- ])) : _("", !0)
273
- ])) : _("", !0)
274
- ], 64))
275
- ]),
276
- S(K, {
277
- modelValue: h.value,
278
- "onUpdate:modelValue": b[2] || (b[2] = (V) => h.value = V),
279
- "min-width": "min(720px, calc(100% - 32px))",
280
- "max-width": "720px",
281
- "max-height": "90vh",
282
- "dismiss-away": ""
283
- }, {
284
- "dialog-header": ae(() => [
285
- e("div", at, [
286
- e("h2", st, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
287
- e("p", nt, l(t(o)("connect.whatsappBot.accountCount", r.value.length)), 1)
288
- ])
289
- ]),
290
- default: ae(() => [
291
- f.value ? (a(), i("p", rt, l(f.value), 1)) : _("", !0),
292
- r.value.length ? (a(), P(ne, {
293
- key: 2,
294
- accounts: r.value,
295
- "removing-id": u.value,
296
- onRemove: C
297
- }, null, 8, ["accounts", "removing-id"])) : (a(), i("p", ct, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1))
298
- ]),
299
- _: 1
300
- }, 8, ["modelValue"])
301
- ], 64);
302
- };
303
- }
304
- }), dt = {
305
- "aria-labelledby": "knowledge-base-title",
306
- class: "flex flex-col gap-[10px]"
307
- }, pt = { class: "flex flex-col gap-[2px]" }, ut = {
308
- id: "knowledge-base-title",
309
- class: "text-[16px] leading-[24px] font-semibold"
310
- }, mt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, xt = { class: "flex flex-wrap gap-[8px]" }, ft = ["title", "aria-expanded", "disabled", "onClick"], vt = ["disabled"], bt = {
311
- key: 0,
312
- class: "text-[14px] text-fm-color-typo-tertiary"
313
- }, gt = {
314
- key: 1,
315
- class: "text-[14px] text-fm-color-typo-secondary"
316
- }, ht = { class: "flex flex-col gap-[6px]" }, yt = {
317
- for: "whatsapp-knowledge-topic-description",
318
- class: "text-[14px] leading-[20px] font-medium text-fm-color-typo-secondary"
319
- }, _t = ["placeholder", "maxlength", "disabled"], wt = {
320
- id: "whatsapp-knowledge-topic-description-count",
321
- class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
322
- }, Bt = /* @__PURE__ */ L({
323
- __name: "KnowledgeBase",
324
- props: /* @__PURE__ */ Z({
325
- disabled: { type: Boolean }
326
- }, {
327
- modelValue: {
328
- required: !0
329
- },
330
- modelModifiers: {},
331
- activeTopicIndex: {
332
- required: !0
333
- },
334
- activeTopicIndexModifiers: {}
335
- }),
336
- emits: ["update:modelValue", "update:activeTopicIndex"],
337
- setup(p) {
338
- const n = p, m = H(p, "modelValue"), s = H(p, "activeTopicIndex"), { t: o } = U(), v = E(
339
- () => s.value === null ? null : m.value[s.value]
340
- );
341
- function u() {
342
- n.disabled || m.value.length >= W || (m.value.push({ title: "", description: "" }), s.value = m.value.length - 1);
343
- }
344
- function f() {
345
- n.disabled || s.value === null || (m.value.splice(s.value, 1), s.value = null);
346
- }
347
- return (h, w) => {
348
- const r = $("FmIcon"), T = $("FmTextField"), C = $("FmButton");
349
- return a(), i("section", dt, [
350
- e("div", pt, [
351
- e("h2", ut, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
352
- e("p", mt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
353
- ]),
354
- e("div", xt, [
355
- (a(!0), i(O, null, ee(m.value, (g, x) => (a(), i("button", {
356
- key: x,
357
- type: "button",
358
- title: g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
359
- "aria-expanded": s.value === x,
360
- "aria-controls": "knowledge-topic-editor",
361
- disabled: p.disabled,
362
- class: X(["h-[32px] max-w-[240px] rounded-[8px] border-[1px] px-[12px] truncate text-[14px] font-medium transition-colors focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60", [
363
- s.value === x ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
364
- p.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
365
- ]]),
366
- onClick: (b) => s.value = s.value === x ? null : x
367
- }, l(g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, ft))), 128)),
368
- e("button", {
369
- type: "button",
370
- disabled: p.disabled || m.value.length >= t(W),
371
- class: "h-[32px] rounded-[8px] border-[1px] border-dashed border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] flex items-center gap-[6px] text-[14px] font-semibold text-fm-color-primary hover:border-fm-color-primary focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60 disabled:cursor-default",
372
- onClick: u
373
- }, [
374
- S(r, {
375
- name: "add",
376
- size: "sm"
377
- }),
378
- N(" " + l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
379
- ], 8, vt)
380
- ]),
381
- m.value.length === 0 ? (a(), i("p", bt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : _("", !0),
382
- m.value.length >= t(W) ? (a(), i("p", gt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
383
- count: t(W)
384
- })), 1)) : _("", !0),
385
- v.value ? (a(), i("div", {
386
- id: "knowledge-topic-editor",
387
- key: s.value ?? void 0,
388
- class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[10px]"
389
- }, [
390
- S(T, {
391
- modelValue: v.value.title,
392
- "onUpdate:modelValue": w[0] || (w[0] = (g) => v.value.title = g),
393
- label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
394
- placeholder: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
395
- "max-length": t(ve),
396
- disabled: p.disabled
397
- }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
398
- e("div", ht, [
399
- e("label", yt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel")), 1),
400
- q(e("textarea", {
401
- id: "whatsapp-knowledge-topic-description",
402
- "onUpdate:modelValue": w[1] || (w[1] = (g) => v.value.description = g),
403
- "aria-describedby": "whatsapp-knowledge-topic-description-count",
404
- placeholder: t(o)(
405
- "connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
406
- ),
407
- maxlength: t(se),
408
- disabled: p.disabled,
409
- rows: "5",
410
- class: "block w-full min-h-[116px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] py-[8px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
411
- }, null, 8, _t), [
412
- [re, v.value.description]
413
- ]),
414
- e("p", wt, l(v.value.description.length) + " / " + l(t(se)), 1)
415
- ]),
416
- S(C, {
417
- variant: "plain",
418
- size: "sm",
419
- "prepend-icon": "delete",
420
- "text-color": "typo-error",
421
- label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
422
- disabled: p.disabled,
423
- class: "self-start",
424
- onClick: f
425
- }, null, 8, ["label", "disabled"])
426
- ])) : _("", !0)
427
- ]);
428
- };
429
- }
430
- }), kt = {
431
- "aria-labelledby": "response-speed-title",
432
- class: "flex flex-col gap-[12px]"
433
- }, St = { class: "flex flex-col gap-[2px]" }, $t = {
434
- id: "response-speed-title",
435
- class: "text-[16px] leading-[24px] font-semibold"
436
- }, At = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Tt = {
437
- role: "radiogroup",
438
- "aria-labelledby": "response-speed-title",
439
- "aria-describedby": "response-speed-detail",
440
- class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
441
- }, It = ["value", "disabled"], Ft = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ct = {
442
- key: 0,
443
- class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
444
- }, Et = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Vt = {
445
- id: "response-speed-detail",
446
- "aria-live": "polite",
447
- class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
448
- }, Pt = {
449
- key: 0,
450
- class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
451
- }, Nt = /* @__PURE__ */ L({
452
- __name: "ResponseSpeed",
453
- props: /* @__PURE__ */ Z({
454
- disabled: { type: Boolean }
455
- }, {
456
- modelValue: {
457
- required: !0
458
- },
459
- modelModifiers: {}
460
- }),
461
- emits: ["update:modelValue"],
462
- setup(p) {
463
- const n = H(p, "modelValue"), { t: m } = U();
464
- return (s, o) => {
465
- const v = $("FmIcon");
466
- return a(), i("section", kt, [
467
- e("div", St, [
468
- e("h2", $t, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
469
- e("p", At, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
470
- ]),
471
- e("div", Tt, [
472
- (a(!0), i(O, null, ee(t(be), (u) => (a(), i("label", { key: u }, [
473
- q(e("input", {
474
- "onUpdate:modelValue": o[0] || (o[0] = (f) => n.value = f),
475
- type: "radio",
476
- name: "response-speed",
477
- value: u,
478
- disabled: p.disabled,
479
- class: "sr-only peer"
480
- }, null, 8, It), [
481
- [fe, n.value]
482
- ]),
483
- e("span", {
484
- class: X(["h-full border-[1px] rounded-[8px] p-[12px] flex flex-col gap-[4px] transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-fm-color-primary", [
485
- n.value === u ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
486
- p.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
487
- ]])
488
- }, [
489
- e("span", Ft, [
490
- e("span", {
491
- "aria-hidden": "true",
492
- class: X([
493
- "w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
494
- n.value === u ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
495
- ])
496
- }, [
497
- n.value === u ? (a(), i("span", Ct)) : _("", !0)
498
- ], 2),
499
- N(" " + l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.label`)), 1)
500
- ]),
501
- e("span", Et, l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.hint`)), 1)
502
- ], 2)
503
- ]))), 128))
504
- ]),
505
- e("p", Vt, l(t(m)(
506
- `connect.whatsappBot.botSettings.responseSpeed.${n.value}.detail`
507
- )), 1),
508
- n.value === "immediate" ? (a(), i("div", Pt, [
509
- S(v, {
510
- name: "warning",
511
- size: "sm",
512
- class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
513
- }),
514
- N(" " + l(t(m)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
515
- ])) : _("", !0)
516
- ]);
517
- };
518
- }
519
- }), Dt = { class: "mt-[20px] mx-auto w-full min-w-0 flex flex-col gap-[20px]" }, Ot = {
520
- key: 0,
521
- class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
522
- }, Lt = { class: "border-t border-fm-color-neutral-gray-100 pt-[20px]" }, Ut = { class: "group border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Mt = { class: "flex h-[36px] w-fit cursor-pointer list-none items-center gap-[8px] rounded-[8px] px-[8px] -ml-[8px] text-[16px] font-semibold transition-colors hover:bg-fm-color-neutral-gray-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary [&::-webkit-details-marker]:hidden" }, Rt = { class: "mt-[20px] flex flex-col gap-[20px]" }, Wt = {
523
- key: 1,
524
- role: "alert",
525
- class: "text-[14px] text-fm-color-typo-error"
526
- }, zt = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, Yt = /* @__PURE__ */ L({
527
- __name: "WhatsappBotSettings",
528
- setup(p) {
529
- const { t: n } = U(), m = de(), s = E(() => Q.getBusinessId() ?? ""), o = y(""), v = y(""), u = y([]), f = y([]), h = y(null), w = E(
530
- () => u.value.filter(
531
- (d) => d.title.trim() || d.description.trim()
532
- )
533
- ), r = y(
534
- z
535
- ), T = y(
536
- z
537
- ), C = y(!0), g = y(!1), x = y(!1), b = y(""), B = y([]), I = y(""), G = J, K = E(
538
- () => o.value !== v.value || r.value !== T.value || JSON.stringify(u.value) !== JSON.stringify(f.value)
539
- ), V = E(
540
- () => !g.value || x.value || !K.value
541
- ), te = E(
542
- () => !g.value || x.value || o.value.length > G || !ge.safeParse(w.value).success
543
- );
544
- let A, M;
545
- function oe(d) {
546
- B.value = d.excludedAccounts, o.value = d.botInstructions, v.value = d.botInstructions, r.value = d.responseSpeed, T.value = d.responseSpeed, u.value = d.knowledgeBase.map((c) => ({ ...c })), f.value = d.knowledgeBase.map((c) => ({
547
- ...c
548
- }));
549
- }
550
- function pe(d, c) {
551
- const k = d instanceof Error ? d.message : n("connect.whatsappBot.errors.loadSettings");
552
- c ? I.value = k : b.value = k;
553
- }
554
- async function R(d = !1) {
555
- if (d && x.value) return;
556
- clearTimeout(M), A == null || A.abort();
557
- const c = new AbortController();
558
- A = c, d || (C.value = !0, g.value = !1, x.value = !1, b.value = "", o.value = "", v.value = "", r.value = z, T.value = z, u.value = [], f.value = [], h.value = null, B.value = [], I.value = "");
559
- try {
560
- if (!s.value)
561
- throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
562
- const k = await Y.getSettings(
563
- s.value,
564
- c.signal
565
- );
566
- if (c.signal.aborted) return;
567
- B.value = k.excludedAccounts, I.value = "", d || (oe(k), g.value = !0);
568
- } catch (k) {
569
- c.signal.aborted || pe(k, d);
570
- } finally {
571
- c.signal.aborted || (C.value = !1, g.value && le());
572
- }
573
- }
574
- function le() {
575
- clearTimeout(M), M = setTimeout(() => void R(!0), 1e4);
576
- }
577
- function ue(d) {
578
- B.value = B.value.filter(
579
- (c) => c.id !== d
580
- ), R(!0);
581
- }
582
- async function me() {
583
- if (te.value) return;
584
- clearTimeout(M), A == null || A.abort();
585
- const d = new AbortController();
586
- A = d, x.value = !0, b.value = "";
587
- const c = h.value === null ? void 0 : u.value[h.value], k = c ? w.value.indexOf(c) : -1;
588
- try {
589
- const D = await Y.saveSettings(
590
- s.value,
591
- {
592
- botInstructions: o.value,
593
- responseSpeed: r.value,
594
- knowledgeBase: w.value
595
- },
596
- d.signal
597
- );
598
- if (d.signal.aborted) return;
599
- oe(D), h.value = k < 0 ? null : k, m.open({
600
- type: "success",
601
- message: n("connect.whatsappBot.botSettings.saved")
602
- });
603
- } catch (D) {
604
- d.signal.aborted || (b.value = D instanceof Error ? D.message : n("connect.whatsappBot.errors.saveSettings"), m.open({ type: "error", message: b.value }));
605
- } finally {
606
- d.signal.aborted || (x.value = !1, le());
607
- }
608
- }
609
- async function xe() {
610
- if (V.value) return;
611
- const d = s.value;
612
- !await he.confirm(
613
- n("connect.whatsappBot.botSettings.discardChangesMessage"),
614
- n("connect.whatsappBot.botSettings.discardChangesTitle"),
615
- n("connect.common.confirm"),
616
- n("connect.common.cancel")
617
- ) || V.value || s.value !== d || (o.value = v.value, r.value = T.value, u.value = f.value.map((k) => ({ ...k })), h.value = null);
618
- }
619
- return ce(s, () => void R(), { immediate: !0 }), ie(() => {
620
- A == null || A.abort(), clearTimeout(M);
621
- }), (d, c) => {
622
- const k = $("FmCircularProgress"), D = $("FmIcon"), j = $("FmButton");
623
- return a(), i("div", Dt, [
624
- C.value ? (a(), i("output", Ot, [
625
- S(k),
626
- N(" " + l(t(n)("connect.whatsappBot.botSettings.loading")), 1)
627
- ])) : (a(), i(O, { key: 1 }, [
628
- g.value ? (a(), P(Ae, {
629
- key: 0,
630
- modelValue: o.value,
631
- "onUpdate:modelValue": c[0] || (c[0] = (F) => o.value = F),
632
- disabled: x.value
633
- }, null, 8, ["modelValue", "disabled"])) : _("", !0),
634
- e("div", Lt, [
635
- g.value ? (a(), P(it, {
636
- key: 0,
637
- accounts: B.value,
638
- loading: !1,
639
- error: I.value,
640
- onRetry: c[1] || (c[1] = (F) => R(!0)),
641
- onRemoved: ue
642
- }, null, 8, ["accounts", "error"])) : _("", !0)
643
- ]),
644
- e("details", Ut, [
645
- e("summary", Mt, [
646
- N(l(t(n)("connect.whatsappBot.botSettings.advancedSettings")) + " ", 1),
647
- S(D, {
648
- name: "keyboard_arrow_down",
649
- size: "sm",
650
- class: "transition-transform group-open:rotate-180 motion-reduce:transition-none",
651
- "aria-hidden": "true"
652
- })
653
- ]),
654
- e("div", Rt, [
655
- g.value ? (a(), P(Bt, {
656
- key: 0,
657
- modelValue: u.value,
658
- "onUpdate:modelValue": c[2] || (c[2] = (F) => u.value = F),
659
- "active-topic-index": h.value,
660
- "onUpdate:activeTopicIndex": c[3] || (c[3] = (F) => h.value = F),
661
- disabled: x.value
662
- }, null, 8, ["modelValue", "active-topic-index", "disabled"])) : _("", !0),
663
- g.value ? (a(), P(Nt, {
664
- key: 1,
665
- modelValue: r.value,
666
- "onUpdate:modelValue": c[4] || (c[4] = (F) => r.value = F),
667
- disabled: x.value,
668
- class: "border-t border-fm-color-neutral-gray-100 pt-[20px]"
669
- }, null, 8, ["modelValue", "disabled"])) : _("", !0)
670
- ])
671
- ]),
672
- b.value ? (a(), i("p", Wt, l(b.value), 1)) : _("", !0),
673
- g.value ? _("", !0) : (a(), P(j, {
674
- key: 2,
675
- class: "self-start !rounded-full [&_.label]:text-[14px]",
676
- label: t(n)("connect.whatsappBot.tryAgain"),
677
- "prepend-icon": "refresh",
678
- onClick: c[5] || (c[5] = (F) => R())
679
- }, null, 8, ["label"])),
680
- e("div", zt, [
681
- S(j, {
682
- variant: "secondary",
683
- "border-color": "neutral-gray-200",
684
- label: t(n)("connect.common.cancel"),
685
- disabled: V.value,
686
- class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
687
- onClick: xe
688
- }, null, 8, ["label", "disabled"]),
689
- S(j, {
690
- label: t(n)("connect.common.save"),
691
- disabled: te.value,
692
- loading: x.value,
693
- class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
694
- onClick: me
695
- }, null, 8, ["label", "disabled", "loading"])
696
- ])
697
- ], 64))
698
- ]);
699
- };
700
- }
701
- });
702
- export {
703
- Yt as default
704
- };