@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
@@ -0,0 +1,394 @@
1
+ import { defineComponent as W, mergeModels as U, useModel as O, resolveComponent as w, openBlock as d, createElementBlock as c, createElementVNode as i, toDisplayString as u, unref as e, createVNode as b, computed as F, Fragment as L, renderList as Q, normalizeClass as M, createTextVNode as P, createCommentVNode as S, withDirectives as oe, vModelRadio as le, ref as g, watch as j, onBeforeUnmount as ae, createBlock as se } from "vue";
2
+ import { u as D } from "./vue-i18n-DOpMPUHr.js";
3
+ import { F as Y, a as C, b as ne, c as re, d as ie, e as N, f as de } from "./index-DopAV1p0.js";
4
+ import { S as ce } from "./index-DiuFB2hK.js";
5
+ import { w as J } from "./index-DS__Cknq.js";
6
+ const pe = { class: "flex flex-col gap-[16px]" }, ue = { class: "flex flex-col gap-[4px]" }, me = { class: "text-[16px] leading-[24px] font-semibold" }, ve = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, xe = /* @__PURE__ */ W({
7
+ __name: "BotInstructions",
8
+ props: /* @__PURE__ */ U({
9
+ disabled: { type: Boolean }
10
+ }, {
11
+ modelValue: { required: !0 },
12
+ modelModifiers: {}
13
+ }),
14
+ emits: ["update:modelValue"],
15
+ setup(p) {
16
+ const s = O(p, "modelValue"), { t } = D();
17
+ return (l, a) => {
18
+ const r = w("FmTextarea");
19
+ return d(), c("div", pe, [
20
+ i("div", ue, [
21
+ i("h2", me, u(e(t)("connect.whatsappBot.botSettings.instructions")), 1),
22
+ i("p", ve, u(e(t)("connect.whatsappBot.botSettings.description")), 1)
23
+ ]),
24
+ b(r, {
25
+ modelValue: s.value,
26
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => s.value = m),
27
+ "aria-label": e(t)("connect.whatsappBot.botSettings.instructions"),
28
+ placeholder: e(t)("connect.whatsappBot.botSettings.placeholder"),
29
+ "max-length": e(Y),
30
+ disabled: p.disabled,
31
+ "show-word-count": "",
32
+ class: "bot-instructions-textarea"
33
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
34
+ ]);
35
+ };
36
+ }
37
+ }), be = {
38
+ "aria-labelledby": "knowledge-base-title",
39
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
40
+ }, ge = { class: "flex flex-col gap-[4px]" }, fe = {
41
+ id: "knowledge-base-title",
42
+ class: "text-[16px] leading-[24px] font-semibold"
43
+ }, he = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, _e = { class: "flex flex-wrap gap-[8px]" }, ye = ["title", "aria-expanded", "disabled", "onClick"], we = ["disabled"], Se = {
44
+ key: 0,
45
+ class: "text-[14px] text-fm-color-typo-tertiary"
46
+ }, Be = {
47
+ key: 1,
48
+ class: "text-[14px] text-fm-color-typo-secondary"
49
+ }, ke = /* @__PURE__ */ W({
50
+ __name: "KnowledgeBase",
51
+ props: /* @__PURE__ */ U({
52
+ disabled: { type: Boolean }
53
+ }, {
54
+ modelValue: {
55
+ required: !0
56
+ },
57
+ modelModifiers: {},
58
+ activeTopicIndex: {
59
+ required: !0
60
+ },
61
+ activeTopicIndexModifiers: {}
62
+ }),
63
+ emits: ["update:modelValue", "update:activeTopicIndex"],
64
+ setup(p) {
65
+ const s = p, t = O(p, "modelValue"), l = O(p, "activeTopicIndex"), { t: a } = D(), r = F(
66
+ () => l.value === null ? null : t.value[l.value]
67
+ );
68
+ function m() {
69
+ s.disabled || t.value.length >= C || (t.value.push({ title: "", description: "" }), l.value = t.value.length - 1);
70
+ }
71
+ function f() {
72
+ s.disabled || l.value === null || (t.value.splice(l.value, 1), l.value = null);
73
+ }
74
+ return ($, v) => {
75
+ const V = w("FmIcon"), I = w("FmTextField"), k = w("FmTextarea"), _ = w("FmButton");
76
+ return d(), c("section", be, [
77
+ i("div", ge, [
78
+ i("h2", fe, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
79
+ i("p", he, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
80
+ ]),
81
+ i("div", _e, [
82
+ (d(!0), c(L, null, Q(t.value, (x, y) => (d(), c("button", {
83
+ key: y,
84
+ type: "button",
85
+ title: x.title.trim() || e(a)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
86
+ "aria-expanded": l.value === y,
87
+ "aria-controls": "knowledge-topic-editor",
88
+ disabled: p.disabled,
89
+ class: M(["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", [
90
+ l.value === y ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
91
+ p.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
92
+ ]]),
93
+ onClick: (H) => l.value = l.value === y ? null : y
94
+ }, u(x.title.trim() || e(a)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, ye))), 128)),
95
+ i("button", {
96
+ type: "button",
97
+ disabled: p.disabled || t.value.length >= e(C),
98
+ 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",
99
+ onClick: m
100
+ }, [
101
+ b(V, {
102
+ name: "add",
103
+ size: "sm"
104
+ }),
105
+ P(" " + u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
106
+ ], 8, we)
107
+ ]),
108
+ t.value.length === 0 ? (d(), c("p", Se, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : S("", !0),
109
+ t.value.length >= e(C) ? (d(), c("p", Be, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
110
+ count: e(C)
111
+ })), 1)) : S("", !0),
112
+ r.value ? (d(), c("div", {
113
+ id: "knowledge-topic-editor",
114
+ key: l.value ?? void 0,
115
+ class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[12px]"
116
+ }, [
117
+ b(I, {
118
+ modelValue: r.value.title,
119
+ "onUpdate:modelValue": v[0] || (v[0] = (x) => r.value.title = x),
120
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
121
+ placeholder: e(a)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
122
+ "max-length": e(ne),
123
+ disabled: p.disabled
124
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
125
+ b(k, {
126
+ modelValue: r.value.description,
127
+ "onUpdate:modelValue": v[1] || (v[1] = (x) => r.value.description = x),
128
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel"),
129
+ placeholder: e(a)(
130
+ "connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
131
+ ),
132
+ "max-length": e(re),
133
+ disabled: p.disabled,
134
+ "show-word-count": "",
135
+ class: "bot-instructions-textarea"
136
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
137
+ b(_, {
138
+ variant: "plain",
139
+ size: "sm",
140
+ "prepend-icon": "delete",
141
+ "text-color": "typo-error",
142
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
143
+ disabled: p.disabled,
144
+ class: "self-start",
145
+ onClick: f
146
+ }, null, 8, ["label", "disabled"])
147
+ ])) : S("", !0)
148
+ ]);
149
+ };
150
+ }
151
+ }), Te = {
152
+ "aria-labelledby": "response-speed-title",
153
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
154
+ }, Ve = { class: "flex flex-col gap-[4px]" }, Fe = {
155
+ id: "response-speed-title",
156
+ class: "text-[16px] leading-[24px] font-semibold"
157
+ }, Ie = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ee = {
158
+ role: "radiogroup",
159
+ "aria-labelledby": "response-speed-title",
160
+ "aria-describedby": "response-speed-detail",
161
+ class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
162
+ }, Pe = ["value", "disabled"], $e = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ae = {
163
+ key: 0,
164
+ class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
165
+ }, Ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Ne = {
166
+ id: "response-speed-detail",
167
+ "aria-live": "polite",
168
+ class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
169
+ }, Oe = {
170
+ key: 0,
171
+ class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
172
+ }, Le = /* @__PURE__ */ W({
173
+ __name: "ResponseSpeed",
174
+ props: /* @__PURE__ */ U({
175
+ disabled: { type: Boolean }
176
+ }, {
177
+ modelValue: {
178
+ required: !0
179
+ },
180
+ modelModifiers: {}
181
+ }),
182
+ emits: ["update:modelValue"],
183
+ setup(p) {
184
+ const s = O(p, "modelValue"), { t } = D();
185
+ return (l, a) => {
186
+ const r = w("FmIcon");
187
+ return d(), c("section", Te, [
188
+ i("div", Ve, [
189
+ i("h2", Fe, u(e(t)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
190
+ i("p", Ie, u(e(t)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
191
+ ]),
192
+ i("div", Ee, [
193
+ (d(!0), c(L, null, Q(e(ie), (m) => (d(), c("label", { key: m }, [
194
+ oe(i("input", {
195
+ "onUpdate:modelValue": a[0] || (a[0] = (f) => s.value = f),
196
+ type: "radio",
197
+ name: "response-speed",
198
+ value: m,
199
+ disabled: p.disabled,
200
+ class: "sr-only peer"
201
+ }, null, 8, Pe), [
202
+ [le, s.value]
203
+ ]),
204
+ i("span", {
205
+ class: M(["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", [
206
+ s.value === m ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
207
+ p.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
208
+ ]])
209
+ }, [
210
+ i("span", $e, [
211
+ i("span", {
212
+ "aria-hidden": "true",
213
+ class: M([
214
+ "w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
215
+ s.value === m ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
216
+ ])
217
+ }, [
218
+ s.value === m ? (d(), c("span", Ae)) : S("", !0)
219
+ ], 2),
220
+ P(" " + u(e(t)(`connect.whatsappBot.botSettings.responseSpeed.${m}.label`)), 1)
221
+ ]),
222
+ i("span", Ce, u(e(t)(`connect.whatsappBot.botSettings.responseSpeed.${m}.hint`)), 1)
223
+ ], 2)
224
+ ]))), 128))
225
+ ]),
226
+ i("p", Ne, u(e(t)(
227
+ `connect.whatsappBot.botSettings.responseSpeed.${s.value}.detail`
228
+ )), 1),
229
+ s.value === "immediate" ? (d(), c("div", Oe, [
230
+ b(r, {
231
+ name: "warning",
232
+ size: "sm",
233
+ class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
234
+ }),
235
+ P(" " + u(e(t)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
236
+ ])) : S("", !0)
237
+ ]);
238
+ };
239
+ }
240
+ }), We = { class: "mt-[24px] w-full flex flex-col gap-[20px]" }, De = {
241
+ key: 0,
242
+ role: "status",
243
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
244
+ }, Me = {
245
+ key: 1,
246
+ role: "alert",
247
+ class: "text-[14px] text-fm-color-typo-error"
248
+ }, Ue = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, He = {
249
+ key: 0,
250
+ role: "status",
251
+ class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
252
+ }, je = /* @__PURE__ */ W({
253
+ __name: "WhatsappBotSettings",
254
+ setup(p) {
255
+ const { t: s } = D(), t = F(() => ce.getBusinessId() ?? ""), l = g(""), a = g(""), r = g([]), m = g([]), f = g(null), $ = F(
256
+ () => r.value.filter(
257
+ (o) => o.title.trim() || o.description.trim()
258
+ )
259
+ ), v = g(
260
+ N
261
+ ), V = g(
262
+ N
263
+ ), I = g(!0), k = g(!1), _ = g(!1), x = g(""), y = g(!1), H = Y, Z = F(
264
+ () => l.value !== a.value || v.value !== V.value || JSON.stringify(r.value) !== JSON.stringify(m.value)
265
+ ), R = F(
266
+ () => !k.value || _.value || !Z.value
267
+ ), G = F(
268
+ () => R.value || l.value.length > H || !de.safeParse($.value).success
269
+ );
270
+ let h, K;
271
+ function E() {
272
+ clearTimeout(K), y.value = !1;
273
+ }
274
+ function z(o) {
275
+ l.value = o.botInstructions, a.value = o.botInstructions, v.value = o.responseSpeed, V.value = o.responseSpeed, r.value = o.knowledgeBase.map((n) => ({ ...n })), m.value = o.knowledgeBase.map((n) => ({
276
+ ...n
277
+ }));
278
+ }
279
+ async function X() {
280
+ h == null || h.abort(), E();
281
+ const o = new AbortController();
282
+ h = o, I.value = !0, k.value = !1, _.value = !1, x.value = "", l.value = "", a.value = "", v.value = N, V.value = N, r.value = [], m.value = [], f.value = null;
283
+ try {
284
+ if (!t.value)
285
+ throw new Error(s("connect.whatsappBot.errors.selectBusiness"));
286
+ const n = await J.getSettings(
287
+ t.value,
288
+ o.signal
289
+ );
290
+ if (o.signal.aborted) return;
291
+ z(n), k.value = !0;
292
+ } catch (n) {
293
+ o.signal.aborted || (x.value = n instanceof Error ? n.message : s("connect.whatsappBot.errors.loadSettings"));
294
+ } finally {
295
+ o.signal.aborted || (I.value = !1);
296
+ }
297
+ }
298
+ async function q() {
299
+ if (G.value) return;
300
+ h == null || h.abort();
301
+ const o = new AbortController();
302
+ h = o, _.value = !0, x.value = "", E();
303
+ const n = f.value === null ? void 0 : r.value[f.value], A = n ? $.value.indexOf(n) : -1;
304
+ try {
305
+ const B = await J.saveSettings(
306
+ t.value,
307
+ {
308
+ botInstructions: l.value,
309
+ responseSpeed: v.value,
310
+ knowledgeBase: $.value
311
+ },
312
+ o.signal
313
+ );
314
+ if (o.signal.aborted) return;
315
+ z(B), f.value = A < 0 ? null : A, y.value = !0, K = setTimeout(() => {
316
+ y.value = !1;
317
+ }, 2500);
318
+ } catch (B) {
319
+ o.signal.aborted || (x.value = B instanceof Error ? B.message : s("connect.whatsappBot.errors.saveSettings"));
320
+ } finally {
321
+ o.signal.aborted || (_.value = !1);
322
+ }
323
+ }
324
+ function ee() {
325
+ l.value = a.value, v.value = V.value, r.value = m.value.map((o) => ({ ...o })), f.value = null, E();
326
+ }
327
+ return j([l, v, r], E, {
328
+ flush: "sync",
329
+ deep: !0
330
+ }), j(t, X, { immediate: !0 }), ae(() => {
331
+ h == null || h.abort(), E();
332
+ }), (o, n) => {
333
+ const A = w("FmCircularProgress"), B = w("FmButton"), te = w("FmIcon");
334
+ return d(), c("div", We, [
335
+ I.value ? (d(), c("div", De, [
336
+ b(A),
337
+ P(" " + u(e(s)("connect.whatsappBot.botSettings.loading")), 1)
338
+ ])) : (d(), c(L, { key: 1 }, [
339
+ k.value ? (d(), c(L, { key: 0 }, [
340
+ b(xe, {
341
+ modelValue: l.value,
342
+ "onUpdate:modelValue": n[0] || (n[0] = (T) => l.value = T),
343
+ disabled: _.value
344
+ }, null, 8, ["modelValue", "disabled"]),
345
+ b(ke, {
346
+ modelValue: r.value,
347
+ "onUpdate:modelValue": n[1] || (n[1] = (T) => r.value = T),
348
+ "active-topic-index": f.value,
349
+ "onUpdate:activeTopicIndex": n[2] || (n[2] = (T) => f.value = T),
350
+ disabled: _.value
351
+ }, null, 8, ["modelValue", "active-topic-index", "disabled"]),
352
+ b(Le, {
353
+ modelValue: v.value,
354
+ "onUpdate:modelValue": n[3] || (n[3] = (T) => v.value = T),
355
+ disabled: _.value
356
+ }, null, 8, ["modelValue", "disabled"])
357
+ ], 64)) : S("", !0),
358
+ x.value ? (d(), c("p", Me, u(x.value), 1)) : S("", !0),
359
+ k.value ? S("", !0) : (d(), se(B, {
360
+ key: 2,
361
+ class: "self-start",
362
+ label: e(s)("connect.whatsappBot.tryAgain"),
363
+ "prepend-icon": "refresh",
364
+ onClick: X
365
+ }, null, 8, ["label"])),
366
+ i("div", Ue, [
367
+ y.value ? (d(), c("span", He, [
368
+ b(te, {
369
+ name: "check",
370
+ size: "sm"
371
+ }),
372
+ P(" " + u(e(s)("connect.whatsappBot.botSettings.saved")), 1)
373
+ ])) : S("", !0),
374
+ b(B, {
375
+ variant: "secondary",
376
+ label: e(s)("connect.common.cancel"),
377
+ disabled: R.value,
378
+ onClick: ee
379
+ }, null, 8, ["label", "disabled"]),
380
+ b(B, {
381
+ label: e(s)("connect.common.save"),
382
+ disabled: G.value,
383
+ loading: _.value,
384
+ onClick: q
385
+ }, null, 8, ["label", "disabled", "loading"])
386
+ ])
387
+ ], 64))
388
+ ]);
389
+ };
390
+ }
391
+ });
392
+ export {
393
+ je as default
394
+ };
@@ -0,0 +1,153 @@
1
+ import { defineComponent as U, ref as v, computed as j, watch as L, onBeforeUnmount as P, resolveComponent as _, openBlock as l, createElementBlock as c, createElementVNode as o, toDisplayString as s, unref as n, createVNode as h, createTextVNode as w, createCommentVNode as b, Fragment as T, renderList as R } from "vue";
2
+ import { u as $ } from "./vue-i18n-DOpMPUHr.js";
3
+ import { S as I } from "./index-DiuFB2hK.js";
4
+ import { w as z } from "./index-DS__Cknq.js";
5
+ const M = { class: "mt-[20px] max-w-[880px] flex flex-col gap-[16px]" }, W = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, G = {
6
+ key: 0,
7
+ role: "status",
8
+ class: "flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
9
+ }, H = {
10
+ key: 1,
11
+ role: "status",
12
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
13
+ }, J = {
14
+ key: 0,
15
+ class: "flex items-center gap-[12px] flex-wrap"
16
+ }, K = {
17
+ role: "alert",
18
+ class: "text-[14px] text-fm-color-typo-error"
19
+ }, O = {
20
+ key: 1,
21
+ role: "alert",
22
+ class: "text-[14px] text-fm-color-typo-error"
23
+ }, Q = {
24
+ key: 2,
25
+ class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
26
+ }, X = { class: "text-[20px] font-semibold" }, Y = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Z = {
27
+ key: 3,
28
+ class: "flex flex-col gap-[12px]"
29
+ }, q = {
30
+ "aria-hidden": "true",
31
+ class: "w-[40px] h-[40px] rounded-full bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary text-[14px] font-semibold flex items-center justify-center flex-shrink-0 self-start"
32
+ }, ee = { class: "flex-1 min-w-[200px] flex flex-col gap-[2px]" }, te = { class: "flex items-center gap-[8px] flex-wrap" }, oe = { class: "text-[14px] leading-[20px] font-semibold break-words" }, se = { class: "flex items-center gap-[6px] rounded-[6px] px-[8px] py-[2px] text-[12px] font-semibold bg-fm-color-system-warning-100 text-fm-color-typo-warning" }, ae = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, re = { class: "mt-[6px] text-[14px] leading-[20px] text-fm-color-typo-secondary whitespace-pre-wrap break-words" }, ne = { class: "flex items-center gap-[16px] ml-auto flex-wrap" }, le = ["datetime"], xe = /* @__PURE__ */ U({
33
+ __name: "WhatsappBotTickets",
34
+ props: {
35
+ tickets: {},
36
+ loading: { type: Boolean },
37
+ error: {}
38
+ },
39
+ emits: ["retry", "resolved"],
40
+ setup(m, { emit: A }) {
41
+ const F = m, B = A, { t, locale: S } = $(), i = v(""), x = v(""), d = v("");
42
+ let u, y;
43
+ const k = j(
44
+ () => [...F.tickets].sort((e, a) => a.updatedAt.localeCompare(e.updatedAt))
45
+ );
46
+ function g(e) {
47
+ return e.customerName || e.phoneNumber || e.customerLid;
48
+ }
49
+ function E(e) {
50
+ return e.customerName ? e.customerName.trim().split(/\s+/).slice(0, 2).map((a) => Array.from(a)[0]).join("").toUpperCase() : "?";
51
+ }
52
+ function D(e) {
53
+ return new Intl.DateTimeFormat(S.value, {
54
+ dateStyle: "medium",
55
+ timeStyle: "short"
56
+ }).format(new Date(e));
57
+ }
58
+ async function V(e) {
59
+ if (i.value) return;
60
+ const a = I.getBusinessId();
61
+ if (!a || e.businessId !== a) return;
62
+ const p = new AbortController();
63
+ u = p, i.value = e.id, x.value = "", d.value = "", clearTimeout(y);
64
+ try {
65
+ if (await z.resolveTicket(a, e.id, p.signal), p.signal.aborted) return;
66
+ B("resolved", e.id), d.value = t("connect.whatsappBot.tickets.resolvedMessage", {
67
+ name: g(e)
68
+ }), y = setTimeout(() => d.value = "", 3e3);
69
+ } catch (f) {
70
+ p.signal.aborted || (x.value = f instanceof Error ? f.message : t("connect.whatsappBot.tickets.resolveError"));
71
+ } finally {
72
+ p.signal.aborted || (i.value = "");
73
+ }
74
+ }
75
+ function C() {
76
+ u == null || u.abort(), clearTimeout(y), i.value = "", x.value = "", d.value = "";
77
+ }
78
+ return L(() => I.getBusinessId(), C), P(C), (e, a) => {
79
+ const p = _("FmIcon"), f = _("FmCircularProgress"), N = _("FmButton");
80
+ return l(), c("section", M, [
81
+ o("p", W, s(n(t)("connect.whatsappBot.tickets.description")), 1),
82
+ d.value ? (l(), c("p", G, [
83
+ h(p, {
84
+ name: "check",
85
+ size: "sm"
86
+ }),
87
+ w(" " + s(d.value), 1)
88
+ ])) : b("", !0),
89
+ m.loading ? (l(), c("div", H, [
90
+ h(f),
91
+ w(" " + s(n(t)("connect.whatsappBot.tickets.loading")), 1)
92
+ ])) : (l(), c(T, { key: 2 }, [
93
+ m.error ? (l(), c("div", J, [
94
+ o("p", K, s(m.error), 1),
95
+ h(N, {
96
+ variant: "secondary",
97
+ label: n(t)("connect.whatsappBot.tryAgain"),
98
+ "prepend-icon": "refresh",
99
+ onClick: a[0] || (a[0] = (r) => B("retry"))
100
+ }, null, 8, ["label"])
101
+ ])) : b("", !0),
102
+ x.value ? (l(), c("p", O, s(x.value), 1)) : b("", !0),
103
+ !k.value.length && !m.error ? (l(), c("div", Q, [
104
+ o("h2", X, s(n(t)("connect.whatsappBot.tickets.empty.open.title")), 1),
105
+ o("p", Y, s(n(t)("connect.whatsappBot.tickets.empty.open.description")), 1)
106
+ ])) : (l(), c("ul", Z, [
107
+ (l(!0), c(T, null, R(k.value, (r) => (l(), c("li", {
108
+ key: r.id,
109
+ class: "border border-fm-color-neutral-gray-100 rounded-[16px] bg-fm-color-neutral-white p-[16px] flex items-center gap-[12px] flex-wrap"
110
+ }, [
111
+ o("div", q, s(E(r)), 1),
112
+ o("div", ee, [
113
+ o("div", te, [
114
+ o("span", oe, s(g(r)), 1),
115
+ o("span", se, [
116
+ a[1] || (a[1] = o("span", { class: "w-[6px] h-[6px] rounded-full bg-current" }, null, -1)),
117
+ w(" " + s(n(t)("connect.whatsappBot.tickets.paused")), 1)
118
+ ])
119
+ ]),
120
+ o("p", ae, s(r.phoneNumber || n(t)("connect.whatsappBot.phoneUnavailable")), 1),
121
+ o("p", re, s(r.source === "staff" ? n(t)("connect.whatsappBot.tickets.staffReason") : n(t)("connect.whatsappBot.tickets.botReason", {
122
+ reason: r.reason
123
+ })), 1)
124
+ ]),
125
+ o("div", ne, [
126
+ o("time", {
127
+ datetime: r.updatedAt,
128
+ class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
129
+ }, s(n(t)("connect.whatsappBot.tickets.pausedSince", {
130
+ date: D(r.updatedAt)
131
+ })), 9, le),
132
+ h(N, {
133
+ variant: "secondary",
134
+ "prepend-icon": "check",
135
+ label: n(t)("connect.whatsappBot.tickets.resolve"),
136
+ "aria-label": n(t)("connect.whatsappBot.tickets.resolveCustomer", {
137
+ name: g(r)
138
+ }),
139
+ loading: i.value === r.id,
140
+ disabled: !!i.value,
141
+ onClick: (ce) => V(r)
142
+ }, null, 8, ["label", "aria-label", "loading", "disabled", "onClick"])
143
+ ])
144
+ ]))), 128))
145
+ ]))
146
+ ], 64))
147
+ ]);
148
+ };
149
+ }
150
+ });
151
+ export {
152
+ xe as default
153
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, useAttrs as y, resolveComponent as b, openBlock as l, createBlock as v, mergeProps as x, unref as t, createSlots as g, withCtx as h, createElementVNode as a, toDisplayString as n, renderSlot as k, createElementBlock as F, createCommentVNode as S } from "vue";
2
- import { Z as d } from "./zod-CGVrMcDl.js";
3
- import { u as V } from "./vue-i18n-Dpic36zz.js";
2
+ import { Z as d } from "./zod-Jw_6SDXB.js";
3
+ import { u as V } from "./vue-i18n-DOpMPUHr.js";
4
4
  const B = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, C = {
5
5
  key: 0,
6
6
  class: "text-fm-color-typo-tertiary"