@feedmepos/mf-connect 0.1.117-prod → 0.1.118-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 (154) hide show
  1. package/README.md +68 -1
  2. package/dist/{App-CAo1izHr.js → App-CBFNBDb2.js} +435 -418
  3. package/dist/AuditLogs-BtSA8b08.js +2016 -0
  4. package/dist/{Bin-DDDfjisJ.js → Bin-CjmS_Tfn.js} +8 -8
  5. package/dist/{Broadcast-BsCulZhE.js → Broadcast-BeePmZa1.js} +22 -21
  6. package/dist/{CampaignAnalytic-CnVYFSkT.js → CampaignAnalytic-CZlnyvOi.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZTHyZ_0y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Du3Ah4HP.js} +9 -9
  8. package/dist/{Card-DPyQH9qZ.js → Card-C8SzQQ0z.js} +25 -24
  9. package/dist/{Collections-CZCVA969.js → Collections-BXNWTSZH.js} +197 -185
  10. package/dist/{Credit-BTg364-i.js → Credit-CK0-0yD1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BJx8K6Ja.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BXYpYC7Y.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CdpnNDzR.js +4439 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js → EffectSheet.vue_vue_type_style_index_0_lang--Oyj3KYg.js} +32 -32
  14. package/dist/{Experience-Bk_eUcSX.js → Experience-CWJaj62g.js} +32 -31
  15. package/dist/{FileSaver.min-CXFiZAp7.js → FileSaver.min-lV9H82L5.js} +1 -1
  16. package/dist/{Game-CBnKpFdl.js → Game-zBV1LYAg.js} +19 -18
  17. package/dist/{GiftCardSetup-q75wNV_F.js → GiftCardSetup-Cnq9353j.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Cga0Th2O.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CdgSBdrX.js} +7 -7
  19. package/dist/{Goals-Bbbgurfd.js → Goals-Utk08egN.js} +4 -4
  20. package/dist/Grab-DwMmWmbT.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CZS05h1r.js → ImageInput.vue_vue_type_script_setup_true_lang-CNPeU9xm.js} +1 -1
  22. package/dist/{Index-C8_OWllb.js → Index-Bjgs18xf.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BlCg-jI7.js → LocationPicker.vue_vue_type_script_setup_true_lang-DWnf4lXH.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CACxChIo.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dy_oWJaZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-DJlE0371.js → LoyaltyDashboard-DmUfujX_.js} +15 -15
  26. package/dist/MainLayout-DlDZQJfy.js +4 -0
  27. package/dist/{MainLayout-Bs2UPvFx.js → MainLayout.vue_vue_type_script_setup_true_lang-yAflY70k.js} +5 -4
  28. package/dist/Marketing-B0iKlHP-.js +269 -0
  29. package/dist/MarketingMaterialEdit-BNHxVb8A.js +1037 -0
  30. package/dist/{Member-C4yqwsMH.js → Member-Bcm3_pWB.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbumjyC_.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CPp4OpOx.js} +43 -50
  32. package/dist/{MemberImportHistory-CbuXCdxC.js → MemberImportHistory-AQgLzB3g.js} +7 -7
  33. package/dist/{MemberList-CpAepPBe.js → MemberList-CkMTo2uD.js} +103 -105
  34. package/dist/{MemberTransactions-BbpXvsSk.js → MemberTransactions-CxLCVjvw.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BaWgxbad.js → MessageInput.vue_vue_type_script_setup_true_lang-4N20f8Sj.js} +14 -14
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CEgMElLo.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DghbYpSQ.js} +1 -1
  37. package/dist/{Mission-Bdb9KVeP.js → Mission-CQS1CoDN.js} +22 -21
  38. package/dist/{Overview-CEiyGMcf.js → Overview-NQ287sgq.js} +23 -22
  39. package/dist/{Overview-D_9JwnFU.js → Overview-UG1IjY7-.js} +145 -144
  40. package/dist/{Point-Bd5cMXQx.js → Point-krMa_mb1.js} +22 -21
  41. package/dist/{Promotion-D9gZDvgR.js → Promotion-vFBmJSti.js} +137 -131
  42. package/dist/{Queue-BnAOL_rp.js → Queue-BusxSPt-.js} +46 -45
  43. package/dist/{Record-D6TWFKe0.js → Record-DjKqn0za.js} +9 -9
  44. package/dist/{Review-DLEgvnc-.js → Review-CqLp8l7U.js} +2 -2
  45. package/dist/ReviewFacebookCallback-D2kMSVFC.js +225 -0
  46. package/dist/{ReviewGoogleCallback-BgAbO3pI.js → ReviewGoogleCallback-B1cHR-o2.js} +5 -5
  47. package/dist/Reward-FeSxgzuS.js +444 -0
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt-EqsiH.js → RewardGroup.vue_vue_type_script_setup_true_lang-CCxVjBsO.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-U403emCF.js +1923 -0
  50. package/dist/{Segment-B9Se5FFw.js → Segment-Nj59F9Nr.js} +304 -305
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-f7AS5vwv.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Kg9m-0DS.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-3BKA0UFI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLbDApPL.js} +4 -4
  53. package/dist/Setting-CCIzNxv-.js +574 -0
  54. package/dist/{SettingAdvertisements-CLw-dqiA.js → SettingAdvertisements-CkPyAg5y.js} +12 -12
  55. package/dist/Settings-CYjKGCpa.js +286 -0
  56. package/dist/{Store-B5PPP5zM.js → Store-Bp8Zkzi2.js} +31 -30
  57. package/dist/{StoreRewards-DllyaVBY.js → StoreRewards-DXW5nVyW.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYVezFI2.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CS6b1cM3.js +7007 -0
  60. package/dist/{Tier-M_TApfju.js → Tier-B8Utn9Qb.js} +2576 -687
  61. package/dist/{Title-Cpltm-I2.js → Title-CwaNSFer.js} +94 -92
  62. package/dist/{Transaction-BYfAYRpv.js → Transaction-ieciAdXP.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BOhfGxVj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CMwZl4E6.js} +26 -26
  64. package/dist/{Voucher-DHoyg0YZ.js → Voucher-BKfujj6r.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CkH-rNqZ.js} +16 -16
  66. package/dist/WhatsappAccount-D73WDP7a.js +161 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C3L7vWZE.js +39 -0
  68. package/dist/WhatsappBot-DTWZAXhi.js +878 -0
  69. package/dist/WhatsappBotLogs-DtDcrjs9.js +372 -0
  70. package/dist/WhatsappBotSettings-7_mH9U4y.js +704 -0
  71. package/dist/WhatsappLayout-BVpaFJ8H.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CMeaNKJt.js +261 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js → ZodTextField.vue_vue_type_script_setup_true_lang-BO1zA9AR.js} +2 -2
  74. package/dist/{app-B_doYklh.js → app-DX7OWVY2.js} +9159 -7383
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-DmbnT_bp.js → base.export-bamzzexi.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-DdVGtTvx.js → business-D3U9HSu9.js} +1 -1
  79. package/dist/{campaign-jEhKmpKg.js → campaign-BqRf2VUO.js} +121 -94
  80. package/dist/{campaign-CVkA08zl.js → campaign-CKfeN2xN.js} +31 -25
  81. package/dist/{campaign.enum-DWu6-kOo.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/{campaign.fn-BlgEyeFz.js → campaign.fn-DQe5LZuT.js} +82 -82
  83. package/dist/{collectible.enum-CVLkXKml.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-DLNGTrPf.js → collection.fn-BcGqExuE.js} +2 -2
  85. package/dist/{currency-DKS1md4e.js → currency-sjMYWoI8.js} +1 -1
  86. package/dist/duplicateCampaign-CJF3ZLNd.js +51 -0
  87. package/dist/{effect-Bk-zYexf.js → effect-Cv8ugBR3.js} +1 -1
  88. package/dist/{email-addresses-I9A5iLzf.js → email-addresses-CWqtseTn.js} +2 -2
  89. package/dist/{feature-flag-DQti61iR.js → feature-flag-BIh6MM4i.js} +152 -136
  90. package/dist/google-BQK68wbe.js +5 -0
  91. package/dist/{helper-9cPlo6ae.js → helper-WnxOxoRK.js} +1 -1
  92. package/dist/{index-DuvnRxeo.js → index-5TTGGDnF.js} +1 -1
  93. package/dist/{index-CuyzSc1l.js → index-B3CkAr-6.js} +1 -1
  94. package/dist/{index-cgtAlOl9.js → index-B9XVyhtC.js} +8028 -10767
  95. package/dist/{index-ClYX4COd.js → index-BGguMtc0.js} +4 -3
  96. package/dist/{index-CNUXbXvG.js → index-Bdg48Cus.js} +19 -6
  97. package/dist/{index-fHiFL1dW.js → index-BoAmM8QH.js} +29 -15
  98. package/dist/{index-C-OnJpT8.js → index-BtmVXdRR.js} +1 -1
  99. package/dist/{index-1Cdj34z1.js → index-CDTETsXQ.js} +1 -1
  100. package/dist/index-C_H8jFYf.js +2743 -0
  101. package/dist/{index-BxpbI0GH.js → index-CeafUn1o.js} +7 -7
  102. package/dist/{index-Dj51vqab.js → index-CiSTQhs9.js} +4 -4
  103. package/dist/{index-CIwdXphn.js → index-ClvaVYkG.js} +2700 -2613
  104. package/dist/{index-Cj6oxbl0.js → index-CnsSd5Dg.js} +11 -10
  105. package/dist/{index-oNMFyOGe.js → index-D3yYjyaj.js} +8 -7
  106. package/dist/{index-BRm0LMTo.js → index-DDzi_-Lu.js} +611 -252
  107. package/dist/{index-3V8E9GaZ.js → index-DOgDR_QH.js} +2 -2
  108. package/dist/{index-DOE2VR99.js → index-DqZX-A6e.js} +198 -198
  109. package/dist/{index-vKvGJ4Ve.js → index-DxhNNZ-a.js} +2 -2
  110. package/dist/index-DzYFQGSw.js +74 -0
  111. package/dist/index-I9lmcd2w.js +109 -0
  112. package/dist/{index-728mP6kW.js → index-iiWxryxo.js} +683 -581
  113. package/dist/{index-DWkuIfHy.js → index-qI1yx02a.js} +390 -232
  114. package/dist/{index.esm2017-CsF37oA-.js → index.esm2017-GI2alVO5.js} +177 -177
  115. package/dist/{loading-BJJmTFoe.js → loading-Qx5K2WL0.js} +1 -1
  116. package/dist/{lodash-BMJ6_hsa.js → lodash-CeSjJptg.js} +1 -1
  117. package/dist/{member-import-DrGxVJt9.js → member-import-Cq8G7SsW.js} +6 -5
  118. package/dist/{membership-CAqKihwy.js → membership-BbeavSNs.js} +3 -3
  119. package/dist/{money-Bf9d2ZUH.js → money-D8YIFaGA.js} +1 -1
  120. package/dist/{number-CWXlGZa5.js → number-DAubZ5bt.js} +1 -1
  121. package/dist/objectid-DeXFWDMh.js +145 -0
  122. package/dist/{onboarding-Dn9O7r3a.js → onboarding-SyFxaTJY.js} +25 -25
  123. package/dist/{onboardingSetup-BMkDoGy-.js → onboardingSetup-CLpHlBn8.js} +2 -2
  124. package/dist/{plugins-KDgceFWV.js → plugins-BHuaMEYA.js} +3 -3
  125. package/dist/{MarketingMaterialEdit-o88sdvTM.js → remy-icon-BhUGu2NI.js} +2 -1031
  126. package/dist/{reward-eilGRaXi.js → reward-dYWnmAC8.js} +1 -1
  127. package/dist/{rule-Dr9Zjg_o.js → rule-BVsfOP2h.js} +572 -492
  128. package/dist/style.css +1 -1
  129. package/dist/template-BcdtbhUJ.js +188 -0
  130. package/dist/{timezone-C5CIfvHs.js → timezone-CUc7q5Ii.js} +1 -1
  131. package/dist/{transaction.fn-Cr-FLjh0.js → transaction.fn-jF9u_cBy.js} +2 -2
  132. package/dist/{trigger-B0Fv6wbN.js → trigger-COlbQlaB.js} +8 -8
  133. package/dist/useMarketingMaterialActions-Dq6-gsOW.js +125 -0
  134. package/dist/{usePagination-BcA-imTr.js → usePagination-BYZB6ORK.js} +1 -1
  135. package/dist/{user-DRvLwlBE.js → user-DK7L8VFR.js} +1 -1
  136. package/dist/vue-i18n-CDSTH7g5.js +2365 -0
  137. package/dist/{xlsx-CBObn76o.js → xlsx-CKxXlDzD.js} +224 -224
  138. package/dist/{zod-DWU5EdQV.js → zod-DjtAaF0U.js} +1 -1
  139. package/package.json +6 -2
  140. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ijya9Cho.js +0 -3494
  141. package/dist/Marketing-BvRYzFV8.js +0 -236
  142. package/dist/ReviewFacebookCallback-jVlm2O8f.js +0 -238
  143. package/dist/Reward-DBheQiFu.js +0 -442
  144. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CKL8MEld.js +0 -1883
  145. package/dist/Setting-B92JT_Y4.js +0 -2037
  146. package/dist/Settings-BmmM8ZnR.js +0 -179
  147. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3Vvqf6_H.js +0 -1264
  148. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-7ZZ0e5tQ.js +0 -142
  149. package/dist/google-C3S8u0mT.js +0 -4
  150. package/dist/objectid-2DN5a9sY.js +0 -145
  151. package/dist/rule-builder-cz6Dy-no.js +0 -102
  152. package/dist/template-DwbazO8p.js +0 -236
  153. package/dist/useMarketingMaterialActions-CNk3LR9M.js +0 -96
  154. package/dist/vue-i18n-y7bHQpNx.js +0 -2365
@@ -0,0 +1,704 @@
1
+ import { defineComponent as O, 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 L, 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-CDSTH7g5.js";
3
+ import { useSnackbar as de } from "@feedmepos/ui-library";
4
+ import { F as J, a as W, b as be, c as se, d as ve, e as z, f as ge } from "./index-I9lmcd2w.js";
5
+ import { S as Q } from "./index-CeafUn1o.js";
6
+ import { w as Y } from "./index-DzYFQGSw.js";
7
+ import { p as he } from "./plugins-BHuaMEYA.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__ */ O({
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] = (b) => n.value = b),
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]" }, Le = { class: "py-[8px] pl-[16px] pr-[8px] font-medium" }, Oe = ["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__ */ O({
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 b(f) {
72
+ return f.customerName || f.phoneNumber || f.customerLid;
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(L, 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", Le, [
109
+ e("span", {
110
+ class: "block truncate",
111
+ title: b(r)
112
+ }, l(b(r)), 9, Oe)
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: b(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__ */ O({
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(), b = de(), u = y(""), f = y(""), h = y(!1);
194
+ let w;
195
+ const r = E(
196
+ () => [...m.accounts].sort((x, v) => v.updatedAt.localeCompare(x.updatedAt))
197
+ ), T = E(() => r.value.slice(0, 3));
198
+ async function C(x) {
199
+ if (u.value) return;
200
+ const v = Q.getBusinessId();
201
+ if (!v || x.businessId !== v) return;
202
+ const B = new AbortController();
203
+ w = B, u.value = x.id, f.value = "";
204
+ try {
205
+ if (await Y.removeExcludedAccount(
206
+ v,
207
+ x.id,
208
+ B.signal
209
+ ), B.signal.aborted) return;
210
+ s("removed", x.id), b.open({
211
+ type: "success",
212
+ message: o("connect.whatsappBot.excludedAccounts.removed", {
213
+ name: x.customerName || x.phoneNumber || x.customerLid
214
+ })
215
+ });
216
+ } catch (I) {
217
+ B.signal.aborted || (f.value = I instanceof Error ? I.message : o("connect.whatsappBot.excludedAccounts.removeError"), b.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, v) => {
226
+ const B = $("FmCircularProgress"), I = $("FmButton"), G = $("FmIcon"), K = $("FmDialog");
227
+ return a(), i(L, 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(L, { 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: v[0] || (v[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: v[1] || (v[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": v[2] || (v[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"], bt = ["disabled"], vt = {
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__ */ O({
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(), b = 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(L, 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: (v) => 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, bt)
380
+ ]),
381
+ m.value.length === 0 ? (a(), i("p", vt, 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
+ b.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: b.value.title,
392
+ "onUpdate:modelValue": w[0] || (w[0] = (g) => b.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(be),
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) => b.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, b.value.description]
413
+ ]),
414
+ e("p", wt, l(b.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__ */ O({
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 b = $("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(L, null, ee(t(ve), (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(b, {
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]" }, Lt = {
520
+ key: 0,
521
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
522
+ }, Ot = { 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__ */ O({
527
+ __name: "WhatsappBotSettings",
528
+ setup(p) {
529
+ const { t: n } = U(), m = de(), s = E(() => Q.getBusinessId() ?? ""), o = y(""), b = 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), v = y(""), B = y([]), I = y(""), G = J, K = E(
538
+ () => o.value !== b.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, b.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 : v.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, v.value = "", o.value = "", b.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, v.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 || (v.value = D instanceof Error ? D.message : n("connect.whatsappBot.errors.saveSettings"), m.open({ type: "error", message: v.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 = b.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", Lt, [
625
+ S(k),
626
+ N(" " + l(t(n)("connect.whatsappBot.botSettings.loading")), 1)
627
+ ])) : (a(), i(L, { 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", Ot, [
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
+ v.value ? (a(), i("p", Wt, l(v.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
+ };