xertica-ui 2.7.0 → 2.9.6

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 (480) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/README.md +20 -12
  3. package/bin/cli.ts +327 -87
  4. package/bin/generate-tokens.ts +25 -9
  5. package/bin/language-config.ts +58 -18
  6. package/components/assistant/xertica-assistant/xertica-assistant.tsx +1 -1
  7. package/components/blocks/auth/AuthPageShell.tsx +63 -18
  8. package/components/blocks/auth/SocialLoginButtons.tsx +3 -3
  9. package/components/blocks/index.ts +1 -0
  10. package/components/blocks/marketing/CTASection.tsx +73 -0
  11. package/components/blocks/marketing/ComplianceBadgeRow.tsx +49 -0
  12. package/components/blocks/marketing/EvidenceTimeline.tsx +91 -0
  13. package/components/blocks/marketing/FeatureRow.tsx +78 -0
  14. package/components/blocks/marketing/Hero.tsx +125 -0
  15. package/components/blocks/marketing/HowItWorksSteps.tsx +90 -0
  16. package/components/blocks/marketing/LogoCloud.tsx +47 -0
  17. package/components/blocks/marketing/MarketingFooter.tsx +109 -0
  18. package/components/blocks/marketing/MarketingNavbar.tsx +192 -0
  19. package/components/blocks/marketing/PillBadge.tsx +96 -0
  20. package/components/blocks/marketing/SectionHeading.tsx +82 -0
  21. package/components/blocks/marketing/ServiceCardGrid.tsx +238 -0
  22. package/components/blocks/marketing/StatBand.tsx +99 -0
  23. package/components/blocks/marketing/TopAccentCards.tsx +91 -0
  24. package/components/blocks/marketing/index.ts +41 -0
  25. package/components/brand/index.ts +1 -0
  26. package/components/brand/isotype/Isotype.tsx +64 -0
  27. package/components/brand/isotype/IsotypeDiagonal.tsx +51 -0
  28. package/components/brand/isotype/IsotypeFrames.tsx +82 -0
  29. package/components/brand/isotype/IsotypeMini.tsx +65 -0
  30. package/components/brand/isotype/IsotypeTwist.tsx +68 -0
  31. package/components/brand/isotype/frame-variants.ts +20 -0
  32. package/components/brand/isotype/index.ts +9 -0
  33. package/components/brand/isotype/isotype-diagonal.mdx +52 -0
  34. package/components/brand/isotype/isotype-diagonal.stories.tsx +44 -0
  35. package/components/brand/isotype/isotype-diagonal.test.tsx +180 -0
  36. package/components/brand/isotype/isotype-frames.mdx +50 -0
  37. package/components/brand/isotype/isotype-frames.stories.tsx +63 -0
  38. package/components/brand/isotype/isotype-frames.test.tsx +92 -0
  39. package/components/brand/isotype/isotype-mini.mdx +61 -0
  40. package/components/brand/isotype/isotype-mini.stories.tsx +75 -0
  41. package/components/brand/isotype/isotype-mini.test.tsx +45 -0
  42. package/components/brand/isotype/isotype-twist.test.tsx +71 -0
  43. package/components/brand/isotype/isotype.mdx +61 -0
  44. package/components/brand/isotype/isotype.stories.tsx +74 -0
  45. package/components/brand/isotype/isotype.test.tsx +41 -0
  46. package/components/brand/isotype/mini-patterns.ts +50 -0
  47. package/components/brand/isotype/patterns.ts +83 -0
  48. package/components/brand/isotype/twist-variants.ts +20 -0
  49. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +3 -6
  50. package/components/pages/index.ts +1 -0
  51. package/components/pages/landing-page/LandingPage.tsx +360 -0
  52. package/components/pages/landing-page/index.ts +1 -0
  53. package/components/pages/login-page/LoginPage.tsx +3 -6
  54. package/components/pages/reset-password-page/ResetPasswordPage.tsx +1 -4
  55. package/components/pages/verify-email-page/VerifyEmailPage.tsx +2 -5
  56. package/components/ui/button/button.test.tsx +3 -3
  57. package/components/ui/button/button.tsx +5 -4
  58. package/components/ui/card/card.test.tsx +12 -0
  59. package/components/ui/card/card.tsx +16 -2
  60. package/components/ui/input/input.tsx +1 -1
  61. package/components/ui/input-otp/input-otp.tsx +1 -1
  62. package/components/ui/search/search.tsx +1 -1
  63. package/components/ui/select/select.tsx +2 -2
  64. package/components/ui/switch/switch.tsx +1 -1
  65. package/components/ui/textarea/textarea.tsx +1 -1
  66. package/contexts/BrandColorsContext.tsx +59 -7
  67. package/contexts/theme-data.ts +127 -3
  68. package/dist/AssistantChart-BFBJXVcm.js +3383 -0
  69. package/dist/AssistantChart-BTnE94FR.cjs +3551 -0
  70. package/dist/AssistantChart-BU48lxL2.js +3383 -0
  71. package/dist/AssistantChart-BvccsQMx.cjs +3551 -0
  72. package/dist/AssistantChart-CkskcBVD.js +3383 -0
  73. package/dist/AssistantChart-CoN6ga6Z.js +3383 -0
  74. package/dist/AssistantChart-CrPkO9ip.js +3383 -0
  75. package/dist/AssistantChart-DIRYJ7WY.js +3383 -0
  76. package/dist/AssistantChart-DKz2O1R8.cjs +3551 -0
  77. package/dist/AssistantChart-DOnY1ZlD.cjs +3551 -0
  78. package/dist/AssistantChart-DYL6UEvo.cjs +3551 -0
  79. package/dist/AssistantChart-DjM3qnp5.cjs +3551 -0
  80. package/dist/AssistantChart-hxPyE1S9.cjs +3551 -0
  81. package/dist/AssistantChart-keo-ogKi.js +3383 -0
  82. package/dist/AudioPlayer-AoU5MTiM.cjs +1282 -0
  83. package/dist/AudioPlayer-Bx1vrblm.js +1278 -0
  84. package/dist/AudioPlayer-CpihsbaD.js +1278 -0
  85. package/dist/AudioPlayer-CvGajzMC.cjs +1282 -0
  86. package/dist/AudioPlayer-CvHpFqDG.cjs +1282 -0
  87. package/dist/AudioPlayer-D0-I6J3J.cjs +1282 -0
  88. package/dist/AudioPlayer-D4S7GQou.js +1278 -0
  89. package/dist/AudioPlayer-DIWX_Yg7.cjs +1282 -0
  90. package/dist/AudioPlayer-DrWJnS7c.js +1278 -0
  91. package/dist/AudioPlayer-_P-Z7pAK.js +1278 -0
  92. package/dist/BrandColorsContext-B25Bpr3b.cjs +819 -0
  93. package/dist/BrandColorsContext-BCieATdW.js +812 -0
  94. package/dist/BrandColorsContext-BNKLUVcU.js +829 -0
  95. package/dist/BrandColorsContext-DNZGHItQ.cjs +836 -0
  96. package/dist/BrandColorsContext-DP0DXAXS.js +824 -0
  97. package/dist/BrandColorsContext-DjpC9wR_.cjs +798 -0
  98. package/dist/BrandColorsContext-MpXFhte7.cjs +831 -0
  99. package/dist/BrandColorsContext-Ug_TZ8yn.cjs +846 -0
  100. package/dist/BrandColorsContext-V3tOc-Zw.js +791 -0
  101. package/dist/BrandColorsContext-z0O2LlZz.js +839 -0
  102. package/dist/CodeBlock-BkaZf-R8.cjs +223 -0
  103. package/dist/CodeBlock-CK4rO6lM.js +221 -0
  104. package/dist/CodeBlock-CKXamfVd.cjs +223 -0
  105. package/dist/CodeBlock-CKu8LgbP.cjs +223 -0
  106. package/dist/CodeBlock-CVmE7isS.cjs +223 -0
  107. package/dist/CodeBlock-D7i5-cMv.js +221 -0
  108. package/dist/CodeBlock-Dg56j2ut.cjs +223 -0
  109. package/dist/CodeBlock-DiLS5LLI.js +221 -0
  110. package/dist/CodeBlock-Dt6nUQoo.js +221 -0
  111. package/dist/CodeBlock-zdylBGdZ.js +221 -0
  112. package/dist/CustomTooltipContent-BAR5qCQg.js +33 -0
  113. package/dist/CustomTooltipContent-Bxynuq7T.js +33 -0
  114. package/dist/CustomTooltipContent-BzjOSA0P.cjs +54 -0
  115. package/dist/CustomTooltipContent-C-ZeCNsf.js +33 -0
  116. package/dist/CustomTooltipContent-CBLHBxX8.cjs +54 -0
  117. package/dist/CustomTooltipContent-CON_QrXm.cjs +54 -0
  118. package/dist/CustomTooltipContent-CjWm3jjV.js +33 -0
  119. package/dist/CustomTooltipContent-DTV9MN9E.cjs +54 -0
  120. package/dist/CustomTooltipContent-UR_n2QfW.js +33 -0
  121. package/dist/CustomTooltipContent-v1SXjoFn.cjs +54 -0
  122. package/dist/EvidenceTimeline-DrRk4yqb.cjs +560 -0
  123. package/dist/EvidenceTimeline-l4MaV4C7.js +546 -0
  124. package/dist/FeatureCard-4n_8a63v.cjs +497 -0
  125. package/dist/FeatureCard-BLiAWT3w.js +485 -0
  126. package/dist/FeatureCard-BXRW97Ef.cjs +497 -0
  127. package/dist/FeatureCard-CDgLlWE2.js +485 -0
  128. package/dist/FeatureCard-CIbBHqeY.cjs +497 -0
  129. package/dist/FeatureCard-CgQ8lq-I.cjs +497 -0
  130. package/dist/FeatureCard-Cp8cVC6T.cjs +497 -0
  131. package/dist/FeatureCard-D0MwrTRP.js +485 -0
  132. package/dist/FeatureCard-DtoKPSfW.cjs +497 -0
  133. package/dist/FeatureCard-P4iEpBmB.js +485 -0
  134. package/dist/FeatureCard-e3f8bnF0.js +485 -0
  135. package/dist/FeatureCard-uE5i0in_.js +485 -0
  136. package/dist/ImageWithFallback-BOh1FM3I.js +98 -0
  137. package/dist/ImageWithFallback-BQO7952C.js +98 -0
  138. package/dist/ImageWithFallback-BkMXHCvV.cjs +122 -0
  139. package/dist/ImageWithFallback-C1ww9Hg3.cjs +122 -0
  140. package/dist/ImageWithFallback-C72nwszA.cjs +122 -0
  141. package/dist/ImageWithFallback-CBrkAEo3.cjs +122 -0
  142. package/dist/ImageWithFallback-CCUMDuEC.cjs +122 -0
  143. package/dist/ImageWithFallback-CGk5zPH-.js +98 -0
  144. package/dist/ImageWithFallback-CfnoFFSP.js +98 -0
  145. package/dist/ImageWithFallback-DQD5TTlY.js +98 -0
  146. package/dist/Isotype--fRZWwS6.js +85 -0
  147. package/dist/Isotype-0dpLqetB.js +85 -0
  148. package/dist/Isotype-B8XLEXSB.cjs +92 -0
  149. package/dist/Isotype-ChKwN7e-.cjs +91 -0
  150. package/dist/IsotypeDiagonal-CuPYPP4f.js +84 -0
  151. package/dist/IsotypeDiagonal-eNcOXRAc.cjs +91 -0
  152. package/dist/IsotypeDiagonal-oiwpXZhE.js +104 -0
  153. package/dist/IsotypeDiagonal-xMFoFXkb.cjs +109 -0
  154. package/dist/IsotypeFrames-BcWtyAWp.cjs +83 -0
  155. package/dist/IsotypeFrames-BnvSJKiH.cjs +73 -0
  156. package/dist/IsotypeFrames-iDRTRuIu.js +79 -0
  157. package/dist/IsotypeFrames-qoXOvOJt.js +69 -0
  158. package/dist/IsotypeMini-CQtWVo3h.js +126 -0
  159. package/dist/IsotypeMini-Cu_sW5yN.cjs +134 -0
  160. package/dist/IsotypeTwist-BTdNL4iV.js +106 -0
  161. package/dist/IsotypeTwist-DvsUgZs_.cjs +115 -0
  162. package/dist/LanguageContext-B1aOXO-K.js +1987 -0
  163. package/dist/LanguageContext-BP0k7AzI.js +1993 -0
  164. package/dist/LanguageContext-CChcIHIG.cjs +1998 -0
  165. package/dist/LanguageContext-ubC7TSs_.cjs +1992 -0
  166. package/dist/LanguageSelector-1XhM7R1i.cjs +48 -0
  167. package/dist/LanguageSelector-B3ZVNc55.js +46 -0
  168. package/dist/LanguageSelector-BLFPXGo8.cjs +48 -0
  169. package/dist/LanguageSelector-CYRzWkRZ.cjs +48 -0
  170. package/dist/LanguageSelector-Cj6zl0CM.js +46 -0
  171. package/dist/LanguageSelector-CyHjZgC4.cjs +48 -0
  172. package/dist/LanguageSelector-DE8lIySO.js +46 -0
  173. package/dist/LanguageSelector-DK1zD4VH.cjs +48 -0
  174. package/dist/LanguageSelector-DUr1hjBW.js +46 -0
  175. package/dist/LanguageSelector-DjbWIKWC.js +46 -0
  176. package/dist/LanguageSelector-DseCAa0p.cjs +48 -0
  177. package/dist/LanguageSelector-Du09anfM.js +46 -0
  178. package/dist/LanguageSelector-PZHlFfEs.cjs +48 -0
  179. package/dist/LanguageSelector-SB-NJSmx.js +46 -0
  180. package/dist/LogoCloud-C_uMKVNg.cjs +513 -0
  181. package/dist/LogoCloud-DJsMPNPh.js +500 -0
  182. package/dist/MarketingFooter-B_ycEdTJ.cjs +727 -0
  183. package/dist/MarketingFooter-Bhx-2Vlr.cjs +727 -0
  184. package/dist/MarketingFooter-Br1MGK9e.js +699 -0
  185. package/dist/MarketingFooter-BwE1vmeX.cjs +700 -0
  186. package/dist/MarketingFooter-CsZ1_xL9.js +709 -0
  187. package/dist/MarketingFooter-DCwf78Q4.cjs +716 -0
  188. package/dist/MarketingFooter-KH2r-OOL.js +709 -0
  189. package/dist/MarketingFooter-nB7G7gQ5.js +682 -0
  190. package/dist/PasswordStrengthMeter-B3S6i_k4.cjs +179 -0
  191. package/dist/PasswordStrengthMeter-B8ky1nJI.js +173 -0
  192. package/dist/PasswordStrengthMeter-C5VEopH-.cjs +179 -0
  193. package/dist/PasswordStrengthMeter-CIm7_jNT.js +173 -0
  194. package/dist/PasswordStrengthMeter-DKSAbQzu.js +173 -0
  195. package/dist/PasswordStrengthMeter-DxLu54p-.cjs +179 -0
  196. package/dist/PasswordStrengthMeter-k-e9Pole.cjs +179 -0
  197. package/dist/PasswordStrengthMeter-pAi2viq5.js +173 -0
  198. package/dist/SectionHeading-DEeOKcAd.cjs +857 -0
  199. package/dist/SectionHeading-DMNObcwm.js +838 -0
  200. package/dist/ThemeToggle--CGJjQJv.cjs +219 -0
  201. package/dist/ThemeToggle-4pQbVkpK.js +215 -0
  202. package/dist/ThemeToggle-B6rIVLvC.cjs +219 -0
  203. package/dist/ThemeToggle-BUOTps5l.cjs +219 -0
  204. package/dist/ThemeToggle-Bn_7Pmfe.js +215 -0
  205. package/dist/ThemeToggle-CO5mPl6e.js +215 -0
  206. package/dist/ThemeToggle-CoL8Ady7.js +215 -0
  207. package/dist/ThemeToggle-D2Wzm5bn.cjs +219 -0
  208. package/dist/ThemeToggle-DbZQ0JSV.cjs +219 -0
  209. package/dist/ThemeToggle-vLXEq2TS.js +215 -0
  210. package/dist/VerifyEmailPage-90lK6pP4.js +3258 -0
  211. package/dist/VerifyEmailPage-BJX1Rter.cjs +3320 -0
  212. package/dist/VerifyEmailPage-BSWvOgry.js +3310 -0
  213. package/dist/VerifyEmailPage-BTjI2c9n.js +2954 -0
  214. package/dist/VerifyEmailPage-CDqIkhx-.js +3224 -0
  215. package/dist/VerifyEmailPage-CJGfDSOx.js +2954 -0
  216. package/dist/VerifyEmailPage-Crxje3ZB.js +3323 -0
  217. package/dist/VerifyEmailPage-D2ShbuEN.cjs +3333 -0
  218. package/dist/VerifyEmailPage-DEBZXQ7c.cjs +3310 -0
  219. package/dist/VerifyEmailPage-DGaX-jZv.cjs +3268 -0
  220. package/dist/VerifyEmailPage-DOlZUNc0.cjs +2963 -0
  221. package/dist/VerifyEmailPage-DQPRl_RJ.js +2954 -0
  222. package/dist/VerifyEmailPage-DrdqMbLC.cjs +2963 -0
  223. package/dist/VerifyEmailPage-ZtOPkgOA.cjs +3234 -0
  224. package/dist/VerifyEmailPage-hyDfeCRa.cjs +2963 -0
  225. package/dist/VerifyEmailPage-kKSXl8vu.cjs +2963 -0
  226. package/dist/VerifyEmailPage-s927GSiR.js +3300 -0
  227. package/dist/VerifyEmailPage-w4N-bDhU.js +2954 -0
  228. package/dist/XerticaOrbe-B9tegV1n.js +1925 -0
  229. package/dist/XerticaOrbe-BHex09xs.js +1925 -0
  230. package/dist/XerticaOrbe-BKW3LJEz.js +1925 -0
  231. package/dist/XerticaOrbe-BQ_NjwPS.cjs +1927 -0
  232. package/dist/XerticaOrbe-BdUX171Q.cjs +1927 -0
  233. package/dist/XerticaOrbe-BdlKXRHU.cjs +1927 -0
  234. package/dist/XerticaOrbe-Br2i99U_.cjs +1927 -0
  235. package/dist/XerticaOrbe-CByPAFE5.js +1925 -0
  236. package/dist/XerticaOrbe-Ccu9eFMu.js +1925 -0
  237. package/dist/XerticaOrbe-kjFmuyx-.cjs +1927 -0
  238. package/dist/XerticaProvider-BVid1oqn.cjs +46 -0
  239. package/dist/XerticaProvider-Bi5lKC9N.js +44 -0
  240. package/dist/XerticaProvider-BrPMVhiv.js +44 -0
  241. package/dist/XerticaProvider-Bz_YfNY4.js +44 -0
  242. package/dist/XerticaProvider-CnX5kt5W.cjs +46 -0
  243. package/dist/XerticaProvider-CtvYfRbZ.cjs +46 -0
  244. package/dist/XerticaProvider-DEKNJTlN.js +44 -0
  245. package/dist/XerticaProvider-DMiyExQS.js +44 -0
  246. package/dist/XerticaProvider-DP2lzKip.cjs +46 -0
  247. package/dist/XerticaProvider-De79hhgp.js +44 -0
  248. package/dist/XerticaProvider-Dkk1Vbsy.js +44 -0
  249. package/dist/XerticaProvider-EdzH9Nrw.cjs +46 -0
  250. package/dist/XerticaProvider-X_wavDYA.cjs +46 -0
  251. package/dist/XerticaProvider-b3n_oL8w.cjs +46 -0
  252. package/dist/alert-dialog--qdlmB5i.cjs +872 -0
  253. package/dist/alert-dialog-9XYAn5z5.js +819 -0
  254. package/dist/alert-dialog-B281hud0.cjs +872 -0
  255. package/dist/alert-dialog-BVWbrcrw.cjs +872 -0
  256. package/dist/alert-dialog-B_Ko1xpu.js +819 -0
  257. package/dist/alert-dialog-C48TOdYU.cjs +872 -0
  258. package/dist/alert-dialog-CEPpnpXt.js +819 -0
  259. package/dist/alert-dialog-CIxE8T-J.cjs +872 -0
  260. package/dist/alert-dialog-DW-_iPuf.js +819 -0
  261. package/dist/alert-dialog-NjflitDa.js +819 -0
  262. package/dist/assistant.cjs.js +2 -2
  263. package/dist/assistant.es.js +2 -2
  264. package/dist/avatar-BJwIMbZ_.js +54 -0
  265. package/dist/avatar-C4Zh5fAJ.cjs +77 -0
  266. package/dist/avatar-CTEUKZUT.js +54 -0
  267. package/dist/avatar-CtEKgg7s.cjs +77 -0
  268. package/dist/avatar-D03MNQxs.js +54 -0
  269. package/dist/avatar-D1bZhlhL.cjs +77 -0
  270. package/dist/avatar-DKIxHeKG.cjs +77 -0
  271. package/dist/avatar-Df7KgSvs.js +54 -0
  272. package/dist/avatar-Gy0_Xu9i.cjs +77 -0
  273. package/dist/avatar-v16eZC8p.js +54 -0
  274. package/dist/blocks.cjs.js +33 -18
  275. package/dist/blocks.es.js +2 -2
  276. package/dist/brand.cjs.js +110 -4
  277. package/dist/brand.es.js +98 -4
  278. package/dist/breadcrumb-B1mUiaWB.cjs +98 -0
  279. package/dist/breadcrumb-BGO5PZPG.js +90 -0
  280. package/dist/breadcrumb-BIRgmem-.js +90 -0
  281. package/dist/breadcrumb-BSng-oUf.cjs +98 -0
  282. package/dist/breadcrumb-BvGAY4ne.cjs +98 -0
  283. package/dist/breadcrumb-CES7furU.js +90 -0
  284. package/dist/breadcrumb-CP275kbF.cjs +98 -0
  285. package/dist/breadcrumb-CU-punra.js +90 -0
  286. package/dist/breadcrumb-D7hr1EvJ.js +90 -0
  287. package/dist/breadcrumb-DjV9wfX1.cjs +98 -0
  288. package/dist/button-B05czY_8.js +62 -0
  289. package/dist/button-B3SE1liJ.js +62 -0
  290. package/dist/button-BMDlWZR8.cjs +85 -0
  291. package/dist/button-BYtQygX5.cjs +85 -0
  292. package/dist/button-BnAW-a_w.js +62 -0
  293. package/dist/button-CUPDQews.js +62 -0
  294. package/dist/button-DFa-rtPy.js +62 -0
  295. package/dist/button-DV1G6XrI.cjs +85 -0
  296. package/dist/button-DVhloDtr.cjs +85 -0
  297. package/dist/button-Kd9Fj53S.cjs +85 -0
  298. package/dist/cli.js +367 -65
  299. package/dist/components/blocks/auth/AuthPageShell.d.ts +21 -5
  300. package/dist/components/blocks/index.d.ts +1 -0
  301. package/dist/components/blocks/marketing/CTASection.d.ts +28 -0
  302. package/dist/components/blocks/marketing/ComplianceBadgeRow.d.ts +23 -0
  303. package/dist/components/blocks/marketing/EvidenceTimeline.d.ts +26 -0
  304. package/dist/components/blocks/marketing/FeatureRow.d.ts +25 -0
  305. package/dist/components/blocks/marketing/Hero.d.ts +35 -0
  306. package/dist/components/blocks/marketing/HowItWorksSteps.d.ts +29 -0
  307. package/dist/components/blocks/marketing/LogoCloud.d.ts +22 -0
  308. package/dist/components/blocks/marketing/MarketingFooter.d.ts +42 -0
  309. package/dist/components/blocks/marketing/MarketingNavbar.d.ts +47 -0
  310. package/dist/components/blocks/marketing/PillBadge.d.ts +21 -0
  311. package/dist/components/blocks/marketing/SectionHeading.d.ts +23 -0
  312. package/dist/components/blocks/marketing/ServiceCardGrid.d.ts +65 -0
  313. package/dist/components/blocks/marketing/StatBand.d.ts +25 -0
  314. package/dist/components/blocks/marketing/TopAccentCards.d.ts +29 -0
  315. package/dist/components/blocks/marketing/index.d.ts +28 -0
  316. package/dist/components/brand/index.d.ts +1 -0
  317. package/dist/components/brand/isotype/Isotype.d.ts +27 -0
  318. package/dist/components/brand/isotype/IsotypeDiagonal.d.ts +19 -0
  319. package/dist/components/brand/isotype/IsotypeFrames.d.ts +21 -0
  320. package/dist/components/brand/isotype/IsotypeMini.d.ts +26 -0
  321. package/dist/components/brand/isotype/IsotypeTwist.d.ts +22 -0
  322. package/dist/components/brand/isotype/frame-variants.d.ts +11 -0
  323. package/dist/components/brand/isotype/index.d.ts +9 -0
  324. package/dist/components/brand/isotype/mini-patterns.d.ts +25 -0
  325. package/dist/components/brand/isotype/patterns.d.ts +42 -0
  326. package/dist/components/brand/isotype/twist-variants.d.ts +11 -0
  327. package/dist/components/pages/forgot-password-page/ForgotPasswordPage.d.ts +2 -2
  328. package/dist/components/pages/index.d.ts +1 -0
  329. package/dist/components/pages/landing-page/LandingPage.d.ts +18 -0
  330. package/dist/components/pages/landing-page/index.d.ts +1 -0
  331. package/dist/components/pages/login-page/LoginPage.d.ts +2 -2
  332. package/dist/components/pages/verify-email-page/VerifyEmailPage.d.ts +1 -1
  333. package/dist/components/ui/card/card.d.ts +13 -1
  334. package/dist/contexts/theme-data.d.ts +21 -1
  335. package/dist/dropdown-menu-B9wTZ0uX.cjs +225 -0
  336. package/dist/dropdown-menu-BeBtZOrs.cjs +225 -0
  337. package/dist/dropdown-menu-ChQa9zW3.cjs +225 -0
  338. package/dist/dropdown-menu-D7mRDGis.js +190 -0
  339. package/dist/dropdown-menu-D8ZmqHB7.js +190 -0
  340. package/dist/dropdown-menu-DRvnsQAt.cjs +225 -0
  341. package/dist/dropdown-menu-DUk81i5Y.js +190 -0
  342. package/dist/dropdown-menu-NlUHhVmK.js +190 -0
  343. package/dist/dropdown-menu-_AWBeOts.cjs +225 -0
  344. package/dist/dropdown-menu-qGzLO_HO.js +190 -0
  345. package/dist/hooks.cjs.js +2 -2
  346. package/dist/hooks.es.js +2 -2
  347. package/dist/index.cjs.js +57 -41
  348. package/dist/index.es.js +25 -25
  349. package/dist/input-B53E6K8G.js +65 -0
  350. package/dist/input-B7Q7vcoG.cjs +91 -0
  351. package/dist/input-BysqLMK1.js +65 -0
  352. package/dist/input-CStdFsaH.cjs +91 -0
  353. package/dist/input-CXYth6nW.cjs +91 -0
  354. package/dist/input-CX_fWE2D.cjs +91 -0
  355. package/dist/input-CitUVnEn.js +65 -0
  356. package/dist/input-Csp_Metb.cjs +91 -0
  357. package/dist/input-DVRwGVLx.js +65 -0
  358. package/dist/input-Dqyj7Hdw.cjs +91 -0
  359. package/dist/input-dOgrFQ-3.js +65 -0
  360. package/dist/input-wkBYTp-B.js +65 -0
  361. package/dist/layout.cjs.js +1 -1
  362. package/dist/layout.es.js +1 -1
  363. package/dist/media.cjs.js +1 -1
  364. package/dist/media.es.js +1 -1
  365. package/dist/pages.cjs.js +2 -1
  366. package/dist/pages.es.js +1 -1
  367. package/dist/rich-text-editor-7K7UjLJN.cjs +2968 -0
  368. package/dist/rich-text-editor-B3jLP2bm.cjs +2968 -0
  369. package/dist/rich-text-editor-BHiRUzWZ.js +2894 -0
  370. package/dist/rich-text-editor-BWMRUMJ2.js +2894 -0
  371. package/dist/rich-text-editor-BntMVQsB.js +2894 -0
  372. package/dist/rich-text-editor-BoE6Ks5x.cjs +2968 -0
  373. package/dist/rich-text-editor-BzuEwR_X.js +2894 -0
  374. package/dist/rich-text-editor-CcopGbQ-.js +2894 -0
  375. package/dist/rich-text-editor-CmxSRJIi.cjs +2968 -0
  376. package/dist/rich-text-editor-Diz_onyB.js +2894 -0
  377. package/dist/rich-text-editor-DyYAu28v.cjs +2968 -0
  378. package/dist/rich-text-editor-JS_eMQCC.cjs +2968 -0
  379. package/dist/rich-text-editor-RWvK4hd3.cjs +2968 -0
  380. package/dist/rich-text-editor-gauEkzPM.js +2894 -0
  381. package/dist/select-B6PygS38.cjs +161 -0
  382. package/dist/select-BD763J5Y.cjs +161 -0
  383. package/dist/select-BNfFJwYp.js +130 -0
  384. package/dist/select-CN8IDjGB.js +130 -0
  385. package/dist/select-CwRzQHA7.cjs +161 -0
  386. package/dist/select-CwgD3nMD.js +130 -0
  387. package/dist/select-DEHUm_AC.cjs +161 -0
  388. package/dist/select-DJDgpVm3.cjs +161 -0
  389. package/dist/select-DSLWQLmo.cjs +161 -0
  390. package/dist/select-QJDKZITN.js +130 -0
  391. package/dist/select-YFx0wCYT.js +130 -0
  392. package/dist/select-q7aDfuPn.js +130 -0
  393. package/dist/sidebar-BF7JEL7U.js +1151 -0
  394. package/dist/sidebar-Bjr2doX5.cjs +1154 -0
  395. package/dist/sidebar-Bkk1YAsD.cjs +1154 -0
  396. package/dist/sidebar-CMrNCmhb.cjs +1154 -0
  397. package/dist/sidebar-CO9x8AVn.cjs +1154 -0
  398. package/dist/sidebar-Cn_KB4c6.js +1151 -0
  399. package/dist/sidebar-CuzYeOSz.cjs +1154 -0
  400. package/dist/sidebar-CwlW3LXE.js +1151 -0
  401. package/dist/sidebar-DNkf-Ug6.js +1151 -0
  402. package/dist/sidebar-DaS3fplw.cjs +1154 -0
  403. package/dist/sidebar-Db_C30ph.cjs +1154 -0
  404. package/dist/sidebar-FDCY42oP.js +1151 -0
  405. package/dist/sidebar-miPHsRz4.js +1151 -0
  406. package/dist/sidebar-pZF8mLLu.js +1151 -0
  407. package/dist/skeleton-BX2XTjMO.cjs +87 -0
  408. package/dist/skeleton-BoLK0iV7.js +78 -0
  409. package/dist/skeleton-BtBwJ39W.js +79 -0
  410. package/dist/skeleton-Bysq8yeB.js +79 -0
  411. package/dist/skeleton-C7nspYnC.cjs +87 -0
  412. package/dist/skeleton-CJyg0eJ1.cjs +88 -0
  413. package/dist/skeleton-D8WaauK0.cjs +88 -0
  414. package/dist/skeleton-DBYtjaZW.cjs +88 -0
  415. package/dist/skeleton-DL4V5Vub.cjs +87 -0
  416. package/dist/skeleton-DSMhdqp1.js +78 -0
  417. package/dist/skeleton-DY_lSFWf.js +79 -0
  418. package/dist/skeleton-Df65Ox10.js +79 -0
  419. package/dist/skeleton-DhJswvTW.cjs +88 -0
  420. package/dist/skeleton-DicUfozA.js +78 -0
  421. package/dist/slider-77T_Eqw4.js +56 -0
  422. package/dist/slider-B6puMLXS.cjs +78 -0
  423. package/dist/slider-B785N7lZ.js +56 -0
  424. package/dist/slider-BKV_vvsh.cjs +78 -0
  425. package/dist/slider-B_lUjFNa.cjs +78 -0
  426. package/dist/slider-C6yssKyZ.cjs +78 -0
  427. package/dist/slider-CKZO9gVh.cjs +78 -0
  428. package/dist/slider-Cn-ImSze.js +56 -0
  429. package/dist/slider-CtBpIaU4.js +56 -0
  430. package/dist/slider-KgWmSJbx.js +56 -0
  431. package/dist/tooltip-BPttuPxU.js +48 -0
  432. package/dist/tooltip-BiJVGob3.cjs +72 -0
  433. package/dist/tooltip-CIKRzQqE.cjs +72 -0
  434. package/dist/tooltip-CoDByjE_.cjs +72 -0
  435. package/dist/tooltip-D2OPn-1v.cjs +72 -0
  436. package/dist/tooltip-DlCHQuh1.js +48 -0
  437. package/dist/tooltip-_MAwsiOL.js +48 -0
  438. package/dist/tooltip-fQ2Va0G8.cjs +72 -0
  439. package/dist/tooltip-oAw00FX2.js +48 -0
  440. package/dist/tooltip-u147L0wD.js +48 -0
  441. package/dist/ui.cjs.js +13 -13
  442. package/dist/ui.es.js +13 -13
  443. package/dist/xertica-assistant-B1xAl2Vn.js +2173 -0
  444. package/dist/xertica-assistant-BBUMaUXw.js +2173 -0
  445. package/dist/xertica-assistant-C2A0R94j.js +2173 -0
  446. package/dist/xertica-assistant-CSUprvTR.js +2173 -0
  447. package/dist/xertica-assistant-CWuBwfzt.cjs +2180 -0
  448. package/dist/xertica-assistant-Caubm0HR.js +2173 -0
  449. package/dist/xertica-assistant-D2hlwiEP.js +2173 -0
  450. package/dist/xertica-assistant-DEexPM2u.cjs +2180 -0
  451. package/dist/xertica-assistant-DN2J_sQQ.cjs +2180 -0
  452. package/dist/xertica-assistant-DdYS6WXT.cjs +2180 -0
  453. package/dist/xertica-assistant-Dh1dmEx3.cjs +2180 -0
  454. package/dist/xertica-assistant-GGcyHEZG.cjs +2180 -0
  455. package/dist/xertica-assistant-USefPe2L.js +2173 -0
  456. package/dist/xertica-assistant-cwSHFwfv.cjs +2180 -0
  457. package/dist/xertica-ui.css +1 -1
  458. package/llms-compact.txt +1 -1
  459. package/llms.txt +1 -1
  460. package/package.json +3 -2
  461. package/styles/xertica/base.css +46 -0
  462. package/styles/xertica/tokens.css +10 -0
  463. package/templates/package.json +1 -1
  464. package/templates/src/app/App.tsx +5 -1
  465. package/templates/src/app/components/AuthGuard.tsx +6 -0
  466. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +1 -4
  467. package/templates/src/features/auth/ui/LoginContent.tsx +1 -4
  468. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +1 -4
  469. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +1 -4
  470. package/templates/src/features/home/ui/HomeContent.tsx +12 -13
  471. package/templates/src/features/template/ui/TemplateContent.tsx +569 -26
  472. package/templates/src/locales/en/pages/landing.json +175 -0
  473. package/templates/src/locales/en/pages/templates.json +112 -4
  474. package/templates/src/locales/es/pages/landing.json +175 -0
  475. package/templates/src/locales/es/pages/templates.json +112 -4
  476. package/templates/src/locales/pt-BR/pages/landing.json +175 -0
  477. package/templates/src/locales/pt-BR/pages/templates.json +112 -4
  478. package/templates/src/pages/LandingPage.tsx +3 -0
  479. package/templates/src/styles/xertica/tokens.css +10 -0
  480. package/templates/vite.config.ts +25 -0
@@ -0,0 +1,2173 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import React__default, { useState, useRef, useMemo, useEffect, useCallback } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { toast } from 'sonner';
5
+ import { BarChart3, ImageIcon, Table, FileText, X, Plus, Radio, Search, Paperclip, Mic, Send, MessageSquare, Heart, History, Maximize2, ChevronRight, PanelRight, MoreHorizontal, ChevronLeft, ChevronUp, ChevronDown, Download, Edit, Music, Image, AlertCircle, FolderOpen, Folder, Users, ExternalLink, Clock, Loader2, ThumbsUp, ThumbsDown, Check, Copy } from 'lucide-react';
6
+ import { u as useIsMobile } from './use-mobile-Ce2cBAQe.js';
7
+ import { AnimatePresence, motion } from 'framer-motion';
8
+ import { c as ChartContainer, g as ChartTooltip, h as ChartTooltipContent, d as ChartLegend, e as ChartLegendContent, T as Table$1, N as TableCaption, V as TableHeader, W as TableRow, U as TableHead, M as TableBody, O as TableCell, S as ScrollArea, k as Dialog, n as DialogContent, q as DialogHeader, t as DialogTitle, o as DialogDescription, X as Textarea, p as DialogFooter, J as RichTextEditor } from './rich-text-editor-BzuEwR_X.js';
9
+ import { B as Button, c as cn } from './button-DFa-rtPy.js';
10
+ import { P as Popover, c as PopoverTrigger, b as PopoverContent } from './input-BysqLMK1.js';
11
+ import { X as XerticaOrbe } from './XerticaOrbe-CByPAFE5.js';
12
+ import { T as Tooltip, c as TooltipTrigger } from './tooltip-DlCHQuh1.js';
13
+ import { C as CustomTooltipContent } from './CustomTooltipContent-Bxynuq7T.js';
14
+ import { BarChart, CartesianGrid, XAxis, Bar } from 'recharts';
15
+ import { D as DropdownMenu, n as DropdownMenuTrigger, b as DropdownMenuContent, d as DropdownMenuItem } from './dropdown-menu-D7mRDGis.js';
16
+
17
+ [
18
+ {
19
+ id: "rich-1",
20
+ text: "Ver exemplo de Gráfico",
21
+ icon: React__default.createElement(BarChart3, { className: "w-4 h-4 mr-2" })
22
+ },
23
+ {
24
+ id: "rich-2",
25
+ text: "Ver exemplo de Imagem",
26
+ icon: React__default.createElement(ImageIcon, { className: "w-4 h-4 mr-2" })
27
+ },
28
+ {
29
+ id: "rich-3",
30
+ text: "Ver exemplo de Tabela",
31
+ icon: React__default.createElement(Table, { className: "w-4 h-4 mr-2" })
32
+ },
33
+ {
34
+ id: "rich-4",
35
+ text: "Ver exemplo de Documento",
36
+ icon: React__default.createElement(FileText, { className: "w-4 h-4 mr-2" })
37
+ }
38
+ ];
39
+ const gerarResposta = (mensagemUsuario, customResponses) => {
40
+ const mensagemLower = mensagemUsuario.toLowerCase();
41
+ if (customResponses && customResponses.length > 0) {
42
+ for (const mock of customResponses) {
43
+ const trigger = mock.trigger;
44
+ let match = false;
45
+ if (trigger instanceof RegExp) {
46
+ match = trigger.test(mensagemUsuario);
47
+ } else {
48
+ match = mensagemLower.includes(trigger.toLowerCase());
49
+ }
50
+ if (match) {
51
+ return mock.response;
52
+ }
53
+ }
54
+ }
55
+ const mensagemOriginal = mensagemUsuario;
56
+ if (mensagemLower.includes("o que") && (mensagemLower.includes("fazer") || mensagemLower.includes("pedir"))) {
57
+ return "Posso ajudar você com diversas tarefas! Posso:\n\n• Analisar dados e métricas dos seus projetos\n• Responder perguntas sobre performance e resultados\n• Sugerir otimizações e melhorias\n• Gerar relatórios e documentação\n• Ajudar no planejamento de sprints\n• E muito mais!\n\nQual tarefa você gostaria de realizar primeiro?";
58
+ }
59
+ if (mensagemLower.includes("o que você faz") || mensagemLower.includes("quem é você")) {
60
+ return "Olá! Sou o Assistente Xertica, uma IA desenvolvida para ajudar você a gerenciar projetos, analisar dados e otimizar processos. Estou aqui 24/7 para responder suas perguntas e auxiliar nas suas tarefas diárias.\n\nPosso processar documentos, analisar áudios e imagens, além de fornecer insights baseados nos dados da plataforma.";
61
+ }
62
+ if (mensagemLower.includes("projeto") && (mensagemLower.includes("preocupar") || mensagemLower.includes("atenção"))) {
63
+ return "Com base na análise dos seus projetos ativos, recomendo focar nos seguintes:\n\n1. **Projeto Alpha** - 15% acima do prazo, requer atenção imediata\n2. **Sistema Beta** - Performance crítica, necessita otimização\n3. **Mobile Gamma** - Aguardando aprovações há 5 dias\n\nGostaria de mais detalhes sobre algum deles?";
64
+ }
65
+ if (mensagemLower.includes("próximo projeto") || mensagemLower.includes("próxima tarefa")) {
66
+ return "Seu próximo projeto prioritário é o **Sistema de Analytics V2**.\n\n📅 Início previsto: Próxima segunda-feira\n👥 Time: 5 desenvolvedores\n⏱️ Duração estimada: 3 sprints\n\nJá preparei um roadmap inicial. Gostaria de revisar?";
67
+ }
68
+ if (mensagemLower.includes("desempenho") || mensagemLower.includes("performance") || mensagemLower.includes("melhor")) {
69
+ return "Analisando os dados de performance dos últimos 30 dias:\n\n🏆 **Melhor Performance:**\n• Projeto Dashboard 2.0: +35% eficiência\n• Sistema CRM: -40% tempo de resposta\n• App Mobile: 4.8★ rating (+0.5)\n\n📊 Todos estão acima das metas estabelecidas. Parabéns!\n\nQuer ver métricas detalhadas?";
70
+ }
71
+ if (mensagemLower.includes("olá") || mensagemLower.includes("oi") || mensagemLower.includes("bom dia") || mensagemLower.includes("boa tarde") || mensagemLower.includes("boa noite")) {
72
+ return "Olá! 👋 Como posso ajudar você hoje? Estou pronto para auxiliar com análises, relatórios ou responder suas dúvidas sobre os projetos.";
73
+ }
74
+ if (mensagemLower.includes("obrigado") || mensagemLower.includes("obrigada")) {
75
+ return "Por nada! Estou aqui sempre que precisar. 😊 Se tiver mais alguma dúvida ou precisar de ajuda, é só chamar!";
76
+ }
77
+ if (mensagemLower.includes("criar documento")) {
78
+ const tema = mensagemOriginal.replace(/📄 \[Criar documento\]/gi, "").trim() || "Novo Documento";
79
+ return {
80
+ content: `📝 Documento criado com sucesso!
81
+
82
+ Gerei um documento completo sobre "${tema}". O documento está pronto para revisão e pode ser editado conforme necessário.`,
83
+ attachmentType: "document",
84
+ attachmentName: `Documento - ${tema}.md`,
85
+ documentTitle: tema,
86
+ documentContent: `# ${tema}
87
+
88
+ ## Introdução
89
+ Este é um documento gerado automaticamente sobre ${tema}.
90
+
91
+ ## Detalhes
92
+ - Item 1
93
+ - Item 2
94
+
95
+ ## Conclusão
96
+ Documento finalizado.`
97
+ };
98
+ }
99
+ if (mensagemLower.includes("gráfico") || mensagemLower.includes("chart")) {
100
+ return {
101
+ content: "Aqui está a análise de performance solicitada:",
102
+ chartData: [
103
+ { month: "Jan", desktop: 186, mobile: 80 },
104
+ { month: "Fev", desktop: 305, mobile: 200 },
105
+ { month: "Mar", desktop: 237, mobile: 120 },
106
+ { month: "Abr", desktop: 73, mobile: 190 },
107
+ { month: "Mai", desktop: 209, mobile: 130 },
108
+ { month: "Jun", desktop: 214, mobile: 140 }
109
+ ],
110
+ chartConfig: {
111
+ desktop: { label: "Desktop", color: "hsl(var(--primary))" },
112
+ mobile: { label: "Mobile", color: "hsl(var(--destructive))" }
113
+ }
114
+ };
115
+ }
116
+ if (mensagemLower.includes("tabela") || mensagemLower.includes("table")) {
117
+ return {
118
+ content: "Aqui estão os dados estruturados conforme solicitado:",
119
+ tableData: {
120
+ caption: "Lista de Projetos Ativos",
121
+ headers: ["Projeto", "Status", "Prazo"],
122
+ rows: [
123
+ ["Alpha", "Em andamento", "15/05"],
124
+ ["Beta", "Concluido", "02/04"],
125
+ ["Gamma", "Atrasado", "10/01"]
126
+ ]
127
+ }
128
+ };
129
+ }
130
+ if (mensagemLower.includes("exemplo de documento")) {
131
+ return {
132
+ content: "Com certeza! Aqui está um exemplo de documento profissional que acabei de gerar:",
133
+ attachmentType: "document",
134
+ attachmentName: "Proposta_Comercial_Xertica.md",
135
+ documentTitle: "Proposta Comercial Xertica",
136
+ documentContent: "# Proposta Comercial\n\n## 1. Visão Geral\nNossa solução oferece o melhor desempenho para sua empresa.\n\n## 2. Investimento\nO valor total é de R$ 50.000,00."
137
+ };
138
+ }
139
+ if (mensagemLower.includes("arquivo") || mensagemLower.includes("documento")) {
140
+ return "Entendi que você deseja trabalhar com arquivos. Posso analisar diversos tipos de documentos:\n\n📄 Documentos de texto (PDF, DOCX)\n📊 Planilhas (XLSX, CSV)\n📈 Relatórios e apresentações\n\nBasta enviá-los usando o botão de anexo (📎) e terei prazer em analisá-los para você!";
141
+ }
142
+ const respostasGenericas = [
143
+ "Entendo sua questão. Com base nos dados disponíveis na plataforma Xertica, posso fornecer análises detalhadas sobre esse tema. Poderia me dar mais contexto para que eu possa ajudá-lo melhor?",
144
+ "Interessante! Deixe-me processar isso... Com base no seu histórico e nos dados do sistema, recomendo que possamos explorar essa questão em mais detalhes. O que especificamente você gostaria de saber?",
145
+ "Ótima pergunta! Para te dar a melhor resposta possível, preciso entender melhor o contexto. Você pode me fornecer mais informações sobre o que está buscando?",
146
+ "Estou analisando sua solicitação. Baseado nos dados do sistema Xertica, posso te ajudar com isso. Você gostaria de uma análise rápida ou um relatório completo?"
147
+ ];
148
+ return respostasGenericas[Math.floor(Math.random() * respostasGenericas.length)];
149
+ };
150
+
151
+ function useAssistant({
152
+ mode = "expanded",
153
+ isExpanded: controlledIsExpanded,
154
+ onToggle,
155
+ defaultTab = "chat",
156
+ demoMode = true,
157
+ customResponses = [],
158
+ initialMessages = [],
159
+ savedConversations = [],
160
+ suggestions: propSuggestions,
161
+ onSendMessage,
162
+ isProcessing = false,
163
+ responseGenerator,
164
+ richSuggestions: _richSuggestions = [],
165
+ onRichAction,
166
+ onEvaluation
167
+ } = {}) {
168
+ const { t } = useTranslation();
169
+ const isFullPage = mode === "fullPage";
170
+ const [internalIsExpanded, setInternalIsExpanded] = useState(controlledIsExpanded ?? true);
171
+ const isExpanded = controlledIsExpanded ?? internalIsExpanded;
172
+ const isMobile = useIsMobile();
173
+ const [abaSelecionada, setAbaSelecionada] = useState(defaultTab);
174
+ const [mensagens, setMensagens] = useState(initialMessages);
175
+ const [mensagem, setMensagem] = useState("");
176
+ const [conversas, setConversas] = useState(savedConversations);
177
+ const [conversaAtual, setConversaAtual] = useState(null);
178
+ const [copiedId, setCopiedId] = useState(null);
179
+ const [generatingPodcastId, setGeneratingPodcastId] = useState(null);
180
+ const [executingCommand, setExecutingCommand] = useState(null);
181
+ const [savedSearches, setSavedSearches] = useState([]);
182
+ const [editingDocument, setEditingDocument] = useState(
183
+ null
184
+ );
185
+ const [showMoreSuggestions, setShowMoreSuggestions] = useState(false);
186
+ const [evaluationState, setEvaluationState] = useState({
187
+ isOpen: false,
188
+ messageId: null,
189
+ type: null,
190
+ category: null,
191
+ reason: ""
192
+ });
193
+ const messagesEndRef = useRef(null);
194
+ const fileInputRef = useRef(null);
195
+ const audioInputRef = useRef(null);
196
+ const responseTimerRef = useRef(null);
197
+ const commandTimerRef = useRef(null);
198
+ const hydratedRef = useRef(false);
199
+ const defaultSuggestions = useMemo(
200
+ () => [
201
+ { id: "1", text: t("assistant.defaultSuggestions.createDocument") },
202
+ { id: "2", text: t("assistant.defaultSuggestions.searchFiles") },
203
+ { id: "3", text: t("assistant.defaultSuggestions.summarizeConversations") },
204
+ { id: "4", text: t("assistant.defaultSuggestions.createPodcast") }
205
+ ],
206
+ [t]
207
+ );
208
+ const sugestoes = propSuggestions ?? defaultSuggestions;
209
+ useEffect(() => {
210
+ return () => {
211
+ if (responseTimerRef.current) clearTimeout(responseTimerRef.current);
212
+ if (commandTimerRef.current) clearTimeout(commandTimerRef.current);
213
+ };
214
+ }, []);
215
+ useEffect(() => {
216
+ if (messagesEndRef.current && abaSelecionada === "chat") {
217
+ const container = messagesEndRef.current.closest(
218
+ "[data-radix-scroll-area-viewport]"
219
+ );
220
+ if (!container) return;
221
+ const distanceFromBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
222
+ if (distanceFromBottom < 120) {
223
+ messagesEndRef.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
224
+ }
225
+ }
226
+ }, [mensagens, abaSelecionada]);
227
+ useEffect(() => {
228
+ if (!hydratedRef.current && initialMessages && initialMessages.length > 0) {
229
+ setMensagens(initialMessages);
230
+ hydratedRef.current = true;
231
+ }
232
+ }, [initialMessages]);
233
+ const conversasFiltradas = useMemo(
234
+ () => conversas.filter((c) => abaSelecionada === "favoritos" ? c.isFavorite : true),
235
+ [conversas, abaSelecionada]
236
+ );
237
+ const handleToggle = useCallback(() => {
238
+ if (onToggle) {
239
+ onToggle();
240
+ } else {
241
+ setInternalIsExpanded((prev) => !prev);
242
+ }
243
+ }, [onToggle]);
244
+ const handleExpandWithTab = useCallback(
245
+ (tab) => {
246
+ setAbaSelecionada(tab);
247
+ if (onToggle) {
248
+ onToggle();
249
+ } else {
250
+ setInternalIsExpanded(true);
251
+ }
252
+ },
253
+ [onToggle]
254
+ );
255
+ const handleEnviarMensagem = useCallback(
256
+ async (arg) => {
257
+ let msgToSend = mensagem;
258
+ if (typeof arg === "string" && !["document", "podcast", "search"].includes(arg)) {
259
+ msgToSend = arg;
260
+ }
261
+ if (!msgToSend.trim() || isProcessing) return;
262
+ const novaMensagem = {
263
+ id: `msg-${Date.now()}`,
264
+ type: "user",
265
+ content: msgToSend,
266
+ timestamp: /* @__PURE__ */ new Date(),
267
+ isFavorite: false
268
+ };
269
+ setMensagens((prev) => [...prev, novaMensagem]);
270
+ if (onSendMessage) {
271
+ onSendMessage(msgToSend);
272
+ }
273
+ if (demoMode || responseGenerator) {
274
+ const mensagemAtual = msgToSend;
275
+ responseTimerRef.current = setTimeout(
276
+ async () => {
277
+ let resposta;
278
+ if (responseGenerator) {
279
+ resposta = await responseGenerator(mensagemAtual);
280
+ } else {
281
+ resposta = gerarResposta(mensagemAtual, customResponses);
282
+ }
283
+ let novaMensagemIA = {
284
+ id: `msg-${Date.now()}-ia`,
285
+ type: "assistant",
286
+ content: "",
287
+ timestamp: /* @__PURE__ */ new Date(),
288
+ isFavorite: false
289
+ };
290
+ if (typeof resposta === "string") {
291
+ novaMensagemIA.content = resposta;
292
+ } else {
293
+ novaMensagemIA = { ...novaMensagemIA, ...resposta };
294
+ }
295
+ setMensagens((prev) => [...prev, novaMensagemIA]);
296
+ },
297
+ 1e3 + Math.random() * 1e3
298
+ );
299
+ }
300
+ setMensagem("");
301
+ },
302
+ [mensagem, isProcessing, onSendMessage, demoMode, responseGenerator, customResponses]
303
+ );
304
+ const handleToggleFavorite = useCallback((messageId) => {
305
+ setMensagens(
306
+ (prev) => prev.map((msg) => msg.id === messageId ? { ...msg, isFavorite: !msg.isFavorite } : msg)
307
+ );
308
+ }, []);
309
+ const handleCopyMessage = useCallback(async (content, messageId) => {
310
+ try {
311
+ if (navigator.clipboard && navigator.clipboard.writeText) {
312
+ try {
313
+ await navigator.clipboard.writeText(content);
314
+ setCopiedId(messageId);
315
+ setTimeout(() => setCopiedId(null), 2e3);
316
+ } catch (clipboardError) {
317
+ if (clipboardError instanceof Error && (clipboardError.name === "NotAllowedError" || clipboardError.message.includes("permissions policy"))) {
318
+ throw new Error("Clipboard permission denied, falling back");
319
+ }
320
+ throw clipboardError;
321
+ }
322
+ } else {
323
+ throw new Error("Clipboard API not available");
324
+ }
325
+ } catch {
326
+ try {
327
+ const textArea = document.createElement("textarea");
328
+ textArea.value = content;
329
+ textArea.style.position = "fixed";
330
+ textArea.style.left = "-999999px";
331
+ textArea.style.top = "-999999px";
332
+ document.body.appendChild(textArea);
333
+ textArea.focus();
334
+ textArea.select();
335
+ const successful = document.execCommand("copy");
336
+ document.body.removeChild(textArea);
337
+ if (successful) {
338
+ setCopiedId(messageId);
339
+ setTimeout(() => setCopiedId(null), 2e3);
340
+ }
341
+ } catch (fallbackErr) {
342
+ console.error("Falha ao copiar:", fallbackErr);
343
+ }
344
+ }
345
+ }, []);
346
+ const handleGeneratePodcast = useCallback(async (messageId, content) => {
347
+ setGeneratingPodcastId(messageId);
348
+ setTimeout(() => {
349
+ setMensagens(
350
+ (prev) => prev.map(
351
+ (msg) => msg.id === messageId ? {
352
+ ...msg,
353
+ attachmentType: "podcast",
354
+ attachmentName: `${t("assistant.podcastName")} - ${content.substring(0, 30)}...`,
355
+ audioUrl: "data:audio/mpeg;base64,//uQx..."
356
+ } : msg
357
+ )
358
+ );
359
+ setGeneratingPodcastId(null);
360
+ }, 2e3);
361
+ }, []);
362
+ const handleDownloadDocument = useCallback((content, fileName) => {
363
+ const blob = new Blob([content], { type: "text/markdown" });
364
+ const url = URL.createObjectURL(blob);
365
+ const a = document.createElement("a");
366
+ a.href = url;
367
+ a.download = fileName.endsWith(".md") ? fileName : fileName + ".md";
368
+ document.body.appendChild(a);
369
+ a.click();
370
+ document.body.removeChild(a);
371
+ URL.revokeObjectURL(url);
372
+ }, []);
373
+ const handleDownloadPodcast = useCallback((audioUrl, fileName) => {
374
+ const a = document.createElement("a");
375
+ a.href = audioUrl;
376
+ a.download = fileName.endsWith(".mp3") ? fileName : fileName + ".mp3";
377
+ document.body.appendChild(a);
378
+ a.click();
379
+ document.body.removeChild(a);
380
+ }, []);
381
+ const handleEditDocument = useCallback((content, title) => {
382
+ setEditingDocument({ content, title });
383
+ }, []);
384
+ const handleNovaConversa = useCallback(() => {
385
+ setMensagens([]);
386
+ setConversaAtual(null);
387
+ setAbaSelecionada("chat");
388
+ }, []);
389
+ const handleSelecionarConversa = useCallback(
390
+ (conversaId) => {
391
+ const conversa = conversas.find((c) => c.id === conversaId);
392
+ if (conversa) {
393
+ setMensagens(conversa.messages);
394
+ setConversaAtual(conversaId);
395
+ setAbaSelecionada("chat");
396
+ }
397
+ },
398
+ [conversas]
399
+ );
400
+ const handleToggleFavoritaConversa = useCallback((conversaId) => {
401
+ setConversas(
402
+ (prev) => prev.map((conv) => conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv)
403
+ );
404
+ }, []);
405
+ const handleOpenSearchResult = useCallback((result) => {
406
+ console.log("Abrir resultado:", result);
407
+ }, []);
408
+ const handleExecuteSearchCommand = useCallback(
409
+ async (commandId, searchTerm, results, messageId) => {
410
+ setExecutingCommand(commandId);
411
+ commandTimerRef.current = setTimeout(() => {
412
+ if (commandId === "5") {
413
+ setSavedSearches((prev) => [...prev, messageId]);
414
+ }
415
+ setExecutingCommand(null);
416
+ }, 1500);
417
+ },
418
+ []
419
+ );
420
+ const handleRichSuggestionClick = useCallback(
421
+ (suggestion) => {
422
+ if (onRichAction) {
423
+ onRichAction(suggestion.id, suggestion.text);
424
+ } else {
425
+ handleEnviarMensagem(suggestion.text);
426
+ }
427
+ setShowMoreSuggestions(false);
428
+ },
429
+ [onRichAction, handleEnviarMensagem]
430
+ );
431
+ const handleEvaluationClick = useCallback(
432
+ (messageId, type) => {
433
+ if (type === "like") {
434
+ if (onEvaluation) onEvaluation(messageId, "like");
435
+ setMensagens(
436
+ (prev) => prev.map((m) => m.id === messageId ? { ...m, evaluation: "like" } : m)
437
+ );
438
+ toast.success(t("assistant.likeToast"));
439
+ }
440
+ },
441
+ [onEvaluation]
442
+ );
443
+ const openFeedbackDialog = useCallback((messageId, category) => {
444
+ setEvaluationState({
445
+ isOpen: true,
446
+ messageId,
447
+ type: "dislike",
448
+ category,
449
+ reason: ""
450
+ });
451
+ }, []);
452
+ const handleSubmitDislike = useCallback(() => {
453
+ if (evaluationState.messageId) {
454
+ const finalReason = evaluationState.category ? evaluationState.reason ? `${evaluationState.category}: ${evaluationState.reason}` : evaluationState.category : evaluationState.reason;
455
+ if (onEvaluation) {
456
+ onEvaluation(evaluationState.messageId, "dislike", finalReason);
457
+ }
458
+ setMensagens(
459
+ (prev) => prev.map(
460
+ (m) => m.id === evaluationState.messageId ? { ...m, evaluation: "dislike", evaluationReason: finalReason } : m
461
+ )
462
+ );
463
+ toast.success(t("assistant.feedbackToast"));
464
+ }
465
+ setEvaluationState({ isOpen: false, messageId: null, type: null, category: null, reason: "" });
466
+ }, [evaluationState, onEvaluation]);
467
+ return {
468
+ // Layout
469
+ isFullPage,
470
+ isExpanded,
471
+ isMobile,
472
+ abaSelecionada,
473
+ setAbaSelecionada,
474
+ // Messages
475
+ mensagens,
476
+ setMensagens,
477
+ mensagem,
478
+ setMensagem,
479
+ // Conversations
480
+ conversas,
481
+ conversaAtual,
482
+ conversasFiltradas,
483
+ // UI
484
+ copiedId,
485
+ generatingPodcastId,
486
+ executingCommand,
487
+ savedSearches,
488
+ editingDocument,
489
+ setEditingDocument,
490
+ showMoreSuggestions,
491
+ setShowMoreSuggestions,
492
+ evaluationState,
493
+ setEvaluationState,
494
+ // Suggestions
495
+ sugestoes,
496
+ // Refs
497
+ messagesEndRef,
498
+ fileInputRef,
499
+ audioInputRef,
500
+ // Handlers
501
+ handleToggle,
502
+ handleExpandWithTab,
503
+ handleEnviarMensagem,
504
+ handleToggleFavorite,
505
+ handleCopyMessage,
506
+ handleGeneratePodcast,
507
+ handleDownloadDocument,
508
+ handleDownloadPodcast,
509
+ handleEditDocument,
510
+ handleNovaConversa,
511
+ handleSelecionarConversa,
512
+ handleToggleFavoritaConversa,
513
+ handleOpenSearchResult,
514
+ handleExecuteSearchCommand,
515
+ handleRichSuggestionClick,
516
+ handleEvaluationClick,
517
+ openFeedbackDialog,
518
+ handleSubmitDislike
519
+ };
520
+ }
521
+
522
+ function ModernChatInput({
523
+ value,
524
+ onChange,
525
+ onSubmit,
526
+ placeholder,
527
+ disabled = false,
528
+ onFileUpload,
529
+ onAudioUpload,
530
+ onVoiceRecording,
531
+ isFullPage = false,
532
+ enableAudioInput = true,
533
+ enableFileAttachment = true,
534
+ enableDocumentCreation = true,
535
+ enablePodcastGeneration = true,
536
+ enableSearch = true
537
+ }) {
538
+ const { t } = useTranslation();
539
+ const textareaRef = useRef(null);
540
+ const [isFocused, setIsFocused] = useState(false);
541
+ const [textareaHeight, setTextareaHeight] = useState(20);
542
+ const [selectedAction, setSelectedAction] = useState(null);
543
+ const [isPopoverOpen, setIsPopoverOpen] = useState(false);
544
+ const [isRecording, setIsRecording] = useState(false);
545
+ const [recordingTime, setRecordingTime] = useState(0);
546
+ const recordingIntervalRef = useRef(null);
547
+ const resolvedPlaceholder = placeholder ?? t("assistant.inputPlaceholder");
548
+ const adjustHeight = () => {
549
+ const textarea = textareaRef.current;
550
+ if (textarea) {
551
+ textarea.style.height = "20px";
552
+ const scrollHeight = textarea.scrollHeight;
553
+ const newHeight = Math.min(Math.max(scrollHeight, 20), 100);
554
+ setTextareaHeight(newHeight);
555
+ textarea.style.height = newHeight + "px";
556
+ }
557
+ };
558
+ useEffect(() => {
559
+ const textarea = textareaRef.current;
560
+ if (textarea) {
561
+ textarea.style.height = "20px";
562
+ setTextareaHeight(20);
563
+ if (value) {
564
+ setTimeout(adjustHeight, 0);
565
+ }
566
+ }
567
+ }, []);
568
+ useEffect(() => {
569
+ if (value === "") {
570
+ const textarea = textareaRef.current;
571
+ if (textarea) {
572
+ textarea.style.height = "20px";
573
+ setTextareaHeight(20);
574
+ }
575
+ } else {
576
+ const timeoutId = setTimeout(adjustHeight, 0);
577
+ return () => clearTimeout(timeoutId);
578
+ }
579
+ }, [value]);
580
+ const handleKeyDown = (e) => {
581
+ if (e.key === "Enter" && !e.shiftKey) {
582
+ e.preventDefault();
583
+ if (value.trim() && !disabled) {
584
+ onSubmit(selectedAction);
585
+ setSelectedAction(null);
586
+ }
587
+ }
588
+ };
589
+ const handleActionSelect = (action) => {
590
+ setSelectedAction(action);
591
+ setIsPopoverOpen(false);
592
+ };
593
+ const handleRemoveAction = () => {
594
+ setSelectedAction(null);
595
+ };
596
+ const handleVoiceRecording = () => {
597
+ if (isRecording) {
598
+ if (recordingIntervalRef.current) {
599
+ clearInterval(recordingIntervalRef.current);
600
+ recordingIntervalRef.current = null;
601
+ }
602
+ const transcricoes = [
603
+ t("assistant.voiceTranscriptions.salesData"),
604
+ t("assistant.voiceTranscriptions.performanceReport"),
605
+ t("assistant.voiceTranscriptions.marketTrends"),
606
+ t("assistant.voiceTranscriptions.customerSatisfaction"),
607
+ t("assistant.voiceTranscriptions.teamProductivity"),
608
+ t("assistant.voiceTranscriptions.keyMetrics"),
609
+ t("assistant.voiceTranscriptions.digitalMarketing"),
610
+ t("assistant.voiceTranscriptions.socialEngagement")
611
+ ];
612
+ const transcricaoAleatoria = transcricoes[Math.floor(Math.random() * transcricoes.length)];
613
+ if (onVoiceRecording) {
614
+ onVoiceRecording(transcricaoAleatoria);
615
+ }
616
+ setIsRecording(false);
617
+ setRecordingTime(0);
618
+ } else {
619
+ setIsRecording(true);
620
+ setRecordingTime(0);
621
+ toast.info(t("assistant.recordingStarted"), {
622
+ description: t("assistant.recordingDescriptionFull"),
623
+ duration: 3e3
624
+ });
625
+ recordingIntervalRef.current = setInterval(() => {
626
+ setRecordingTime((prev) => prev + 1);
627
+ }, 1e3);
628
+ }
629
+ };
630
+ useEffect(() => {
631
+ if (recordingTime >= 60 && isRecording) {
632
+ handleVoiceRecording();
633
+ }
634
+ }, [recordingTime, isRecording]);
635
+ useEffect(() => {
636
+ return () => {
637
+ if (recordingIntervalRef.current) {
638
+ clearInterval(recordingIntervalRef.current);
639
+ }
640
+ };
641
+ }, []);
642
+ const getActionInfo = (action) => {
643
+ switch (action) {
644
+ case "document":
645
+ return {
646
+ label: t("assistant.actions.createDocument"),
647
+ icon: FileText,
648
+ color: "bg-[var(--chart-4)]"
649
+ };
650
+ case "podcast":
651
+ return {
652
+ label: t("assistant.actions.generatePodcast"),
653
+ icon: Radio,
654
+ color: "bg-[var(--chart-1)]"
655
+ };
656
+ case "search":
657
+ return { label: t("assistant.actions.search"), icon: Search, color: "bg-[var(--chart-2)]" };
658
+ default:
659
+ return null;
660
+ }
661
+ };
662
+ const handleFocus = () => setIsFocused(true);
663
+ const handleBlur = () => setIsFocused(false);
664
+ const hasContent = value.trim().length > 0;
665
+ return /* @__PURE__ */ jsxs("div", { className: `p-4 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`, children: [
666
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isRecording && /* @__PURE__ */ jsx(
667
+ motion.div,
668
+ {
669
+ initial: { opacity: 0, y: 10 },
670
+ animate: { opacity: 1, y: 0 },
671
+ exit: { opacity: 0, y: 10 },
672
+ className: "mb-3 p-4 bg-destructive/10 border border-destructive/30 rounded-[var(--radius-card)]",
673
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
674
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
675
+ /* @__PURE__ */ jsx(
676
+ motion.div,
677
+ {
678
+ animate: {
679
+ scale: [1, 1.2, 1],
680
+ opacity: [1, 0.7, 1]
681
+ },
682
+ transition: {
683
+ duration: 1.5,
684
+ repeat: Infinity,
685
+ ease: "easeInOut"
686
+ },
687
+ className: "w-3 h-3 bg-destructive rounded-full"
688
+ }
689
+ ),
690
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx(
691
+ motion.div,
692
+ {
693
+ animate: {
694
+ height: ["8px", "20px", "8px"]
695
+ },
696
+ transition: {
697
+ duration: 0.8,
698
+ repeat: Infinity,
699
+ ease: "easeInOut",
700
+ delay: i * 0.1
701
+ },
702
+ className: "w-1 bg-destructive rounded-full h-2"
703
+ },
704
+ i
705
+ )) }),
706
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-destructive", children: t("assistant.recordingAudio") })
707
+ ] }),
708
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
709
+ /* @__PURE__ */ jsxs("div", { className: "text-sm text-destructive font-mono tabular-nums", children: [
710
+ Math.floor(recordingTime / 60),
711
+ ":",
712
+ (recordingTime % 60).toString().padStart(2, "0")
713
+ ] }),
714
+ /* @__PURE__ */ jsx(
715
+ Button,
716
+ {
717
+ onClick: handleVoiceRecording,
718
+ size: "sm",
719
+ variant: "outline",
720
+ className: "h-7 px-3 text-xs border-destructive/30 text-destructive hover:bg-destructive/10 rounded-[var(--radius-button)]",
721
+ children: t("assistant.stopRecording")
722
+ }
723
+ )
724
+ ] })
725
+ ] })
726
+ }
727
+ ) }),
728
+ /* @__PURE__ */ jsxs(
729
+ motion.div,
730
+ {
731
+ className: `relative bg-card rounded-[var(--radius)] border shadow-sm transition-all duration-300 ${isFocused || hasContent ? "border-primary shadow-lg shadow-primary/10" : "border-border"}`,
732
+ initial: false,
733
+ animate: {
734
+ scale: isFocused ? 1.01 : 1
735
+ },
736
+ transition: { duration: 0.2, ease: "easeOut" },
737
+ children: [
738
+ /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 pt-[14px] pr-[10px] pb-[8px] pl-[10px] rounded-[var(--radius)]", children: [
739
+ /* @__PURE__ */ jsx(AnimatePresence, { children: selectedAction && /* @__PURE__ */ jsx(
740
+ motion.div,
741
+ {
742
+ initial: { opacity: 0, y: -10, height: 0 },
743
+ animate: { opacity: 1, y: 0, height: "auto" },
744
+ exit: { opacity: 0, y: -10, height: 0 },
745
+ transition: { duration: 0.2 },
746
+ className: "mb-2",
747
+ children: (() => {
748
+ const actionInfo = getActionInfo(selectedAction);
749
+ if (!actionInfo) return null;
750
+ const Icon = actionInfo.icon;
751
+ return /* @__PURE__ */ jsxs(
752
+ "div",
753
+ {
754
+ className: `inline-flex items-center gap-2 px-3 py-1.5 rounded-full ${actionInfo.color} text-white text-xs font-medium shadow-sm`,
755
+ children: [
756
+ /* @__PURE__ */ jsx(Icon, { className: "w-3.5 h-3.5" }),
757
+ /* @__PURE__ */ jsx("span", { children: actionInfo.label }),
758
+ /* @__PURE__ */ jsx(
759
+ "button",
760
+ {
761
+ onClick: handleRemoveAction,
762
+ className: "ml-1 hover:bg-white/20 rounded-full p-0.5 transition-colors",
763
+ "aria-label": t("assistant.removeAction"),
764
+ children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" })
765
+ }
766
+ )
767
+ ]
768
+ }
769
+ );
770
+ })()
771
+ }
772
+ ) }),
773
+ /* @__PURE__ */ jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsx(
774
+ "textarea",
775
+ {
776
+ ref: textareaRef,
777
+ value,
778
+ onChange: (e) => onChange(e.target.value),
779
+ onKeyDown: handleKeyDown,
780
+ onFocus: handleFocus,
781
+ onBlur: handleBlur,
782
+ placeholder: resolvedPlaceholder,
783
+ "aria-label": resolvedPlaceholder,
784
+ disabled,
785
+ className: "w-full bg-transparent border-0 outline-none resize-none text-foreground placeholder-muted-foreground text-sm leading-5 min-h-[20px] max-h-[100px] overflow-y-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",
786
+ style: {
787
+ height: `${textareaHeight}px`,
788
+ minHeight: "20px",
789
+ maxHeight: "100px"
790
+ },
791
+ rows: 1
792
+ }
793
+ ) }),
794
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
795
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
796
+ (enableDocumentCreation || enablePodcastGeneration || enableSearch) && /* @__PURE__ */ jsxs(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
797
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
798
+ Button,
799
+ {
800
+ variant: "ghost",
801
+ size: "sm",
802
+ className: "h-8 w-8 p-0 rounded-full text-muted-foreground hover:bg-accent hover:text-foreground transition-all duration-200",
803
+ "aria-label": t("assistant.viewActions"),
804
+ children: /* @__PURE__ */ jsx(
805
+ motion.div,
806
+ {
807
+ whileHover: { scale: 1.05 },
808
+ whileTap: { scale: 0.95 },
809
+ className: "flex items-center justify-center w-full h-full",
810
+ children: /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" })
811
+ }
812
+ )
813
+ }
814
+ ) }),
815
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-56 p-2", align: "start", side: "top", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
816
+ enableDocumentCreation && /* @__PURE__ */ jsxs(
817
+ "button",
818
+ {
819
+ onClick: () => handleActionSelect("document"),
820
+ className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
821
+ children: [
822
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-full bg-[var(--chart-4)]/20 flex items-center justify-center group-hover:bg-[var(--chart-4)] transition-colors", children: /* @__PURE__ */ jsx(FileText, { className: "w-4 h-4 text-[var(--chart-4)] group-hover:text-white" }) }),
823
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
824
+ /* @__PURE__ */ jsx("div", { children: t("assistant.actions.createDocument") }),
825
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: t("assistant.actions.createDocumentDesc") })
826
+ ] })
827
+ ]
828
+ }
829
+ ),
830
+ enablePodcastGeneration && /* @__PURE__ */ jsxs(
831
+ "button",
832
+ {
833
+ onClick: () => handleActionSelect("podcast"),
834
+ className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
835
+ children: [
836
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-full bg-[var(--chart-1)]/20 flex items-center justify-center group-hover:bg-[var(--chart-1)] transition-colors", children: /* @__PURE__ */ jsx(Radio, { className: "w-4 h-4 text-[var(--chart-1)] group-hover:text-white" }) }),
837
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
838
+ /* @__PURE__ */ jsx("div", { children: t("assistant.actions.generatePodcast") }),
839
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: t("assistant.actions.generatePodcastDesc") })
840
+ ] })
841
+ ]
842
+ }
843
+ ),
844
+ enableSearch && /* @__PURE__ */ jsxs(
845
+ "button",
846
+ {
847
+ onClick: () => handleActionSelect("search"),
848
+ className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
849
+ children: [
850
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-full bg-[var(--chart-2)]/20 flex items-center justify-center group-hover:bg-[var(--chart-2)] transition-colors", children: /* @__PURE__ */ jsx(Search, { className: "w-4 h-4 text-[var(--chart-2)] group-hover:text-white" }) }),
851
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
852
+ /* @__PURE__ */ jsx("div", { children: t("assistant.actions.search") }),
853
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: t("assistant.actions.searchDesc") })
854
+ ] })
855
+ ]
856
+ }
857
+ )
858
+ ] }) })
859
+ ] }),
860
+ enableFileAttachment && /* @__PURE__ */ jsx(motion.div, { whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, children: /* @__PURE__ */ jsx(
861
+ Button,
862
+ {
863
+ variant: "ghost",
864
+ size: "sm",
865
+ onClick: onFileUpload,
866
+ className: "h-8 w-8 p-0 rounded-full text-muted-foreground hover:bg-accent hover:text-foreground transition-all duration-200",
867
+ "aria-label": t("assistant.attachFile"),
868
+ children: /* @__PURE__ */ jsx(Paperclip, { className: "w-4 h-4" })
869
+ }
870
+ ) })
871
+ ] }),
872
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
873
+ enableAudioInput && /* @__PURE__ */ jsx(motion.div, { whileHover: { scale: 1.05 }, whileTap: { scale: 0.95 }, children: /* @__PURE__ */ jsx(
874
+ Button,
875
+ {
876
+ variant: "ghost",
877
+ size: "sm",
878
+ onClick: handleVoiceRecording,
879
+ className: `h-8 w-8 p-0 rounded-full transition-all duration-200 ${isRecording ? "bg-destructive hover:bg-destructive/90 text-white animate-pulse" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
880
+ "aria-label": isRecording ? t("assistant.stopRecording") : t("assistant.suggestWithVoice"),
881
+ children: /* @__PURE__ */ jsx(Mic, { className: "w-4 h-4" })
882
+ }
883
+ ) }),
884
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
885
+ motion.div,
886
+ {
887
+ initial: { scale: 0.8, opacity: 0 },
888
+ animate: { scale: 1, opacity: 1 },
889
+ exit: { scale: 0.8, opacity: 0 },
890
+ transition: { duration: 0.2, ease: "easeInOut" },
891
+ whileHover: hasContent ? { scale: 1.05 } : {},
892
+ whileTap: hasContent ? { scale: 0.95 } : {},
893
+ children: /* @__PURE__ */ jsx(
894
+ Button,
895
+ {
896
+ onClick: () => {
897
+ onSubmit(selectedAction);
898
+ setSelectedAction(null);
899
+ },
900
+ size: "sm",
901
+ disabled: !hasContent || disabled,
902
+ className: `h-8 w-8 p-0 rounded-full transition-all duration-300 ${hasContent && !disabled ? "bg-primary hover:bg-primary/90 text-primary-foreground shadow-lg shadow-primary/30 hover:shadow-primary/40" : "bg-muted text-muted-foreground cursor-not-allowed"}`,
903
+ "aria-label": t("assistant.sendMessage"),
904
+ children: /* @__PURE__ */ jsx(
905
+ motion.div,
906
+ {
907
+ animate: {
908
+ rotate: hasContent ? 0 : -45
909
+ },
910
+ transition: { duration: 0.2 },
911
+ children: /* @__PURE__ */ jsx(Send, { className: "w-4 h-4" })
912
+ }
913
+ )
914
+ }
915
+ )
916
+ },
917
+ hasContent ? "active" : "inactive"
918
+ ) })
919
+ ] })
920
+ ] })
921
+ ] }),
922
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isFocused && /* @__PURE__ */ jsx(
923
+ motion.div,
924
+ {
925
+ className: "absolute inset-0 rounded-[var(--radius)] bg-gradient-to-r from-primary/5 via-transparent to-primary/5 pointer-events-none",
926
+ initial: { opacity: 0 },
927
+ animate: { opacity: 1 },
928
+ exit: { opacity: 0 },
929
+ transition: { duration: 0.3 }
930
+ }
931
+ ) })
932
+ ]
933
+ }
934
+ ),
935
+ /* @__PURE__ */ jsx(
936
+ motion.div,
937
+ {
938
+ className: "mt-2 text-center",
939
+ initial: { opacity: 0, y: 5 },
940
+ animate: { opacity: 1, y: 0 },
941
+ transition: { delay: 0.1 },
942
+ children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("assistant.disclaimer") })
943
+ }
944
+ )
945
+ ] });
946
+ }
947
+
948
+ function AssistantCollapsedView({
949
+ showHistory,
950
+ showFavorites,
951
+ onToggle,
952
+ onExpandWithTab
953
+ }) {
954
+ const { t } = useTranslation();
955
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center p-4 space-y-4", children: [
956
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
957
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
958
+ "button",
959
+ {
960
+ onClick: onToggle,
961
+ className: "w-10 h-10 rounded-full flex items-center justify-center hover:bg-accent/50 transition-colors duration-200 cursor-pointer mx-auto",
962
+ "aria-label": t("assistant.open"),
963
+ children: /* @__PURE__ */ jsx(XerticaOrbe, { size: 32 })
964
+ }
965
+ ) }),
966
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "left", sideOffset: 8, children: /* @__PURE__ */ jsx("p", { children: t("assistant.title") }) })
967
+ ] }),
968
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
969
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
970
+ Button,
971
+ {
972
+ variant: "ghost",
973
+ size: "sm",
974
+ onClick: () => onExpandWithTab("chat"),
975
+ className: "w-8 h-8 p-0 text-muted-foreground",
976
+ children: /* @__PURE__ */ jsx(MessageSquare, { className: "w-4 h-4" })
977
+ }
978
+ ) }),
979
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "left", sideOffset: 8, children: /* @__PURE__ */ jsx("p", { children: t("assistant.tabs.chat") }) })
980
+ ] }),
981
+ showFavorites && /* @__PURE__ */ jsxs(Tooltip, { children: [
982
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
983
+ Button,
984
+ {
985
+ variant: "ghost",
986
+ size: "sm",
987
+ onClick: () => onExpandWithTab("favoritos"),
988
+ className: "w-8 h-8 p-0 text-muted-foreground",
989
+ children: /* @__PURE__ */ jsx(Heart, { className: "w-4 h-4" })
990
+ }
991
+ ) }),
992
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "left", sideOffset: 8, children: /* @__PURE__ */ jsx("p", { children: t("assistant.tabs.favorites") }) })
993
+ ] }),
994
+ showHistory && /* @__PURE__ */ jsxs(Tooltip, { children: [
995
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
996
+ Button,
997
+ {
998
+ variant: "ghost",
999
+ size: "sm",
1000
+ onClick: () => onExpandWithTab("historico"),
1001
+ className: "w-8 h-8 p-0 text-muted-foreground",
1002
+ children: /* @__PURE__ */ jsx(History, { className: "w-4 h-4" })
1003
+ }
1004
+ ) }),
1005
+ /* @__PURE__ */ jsx(CustomTooltipContent, { side: "left", sideOffset: 8, children: /* @__PURE__ */ jsx("p", { children: t("assistant.tabs.history") }) })
1006
+ ] })
1007
+ ] });
1008
+ }
1009
+
1010
+ function AssistantHeader({
1011
+ isExpanded,
1012
+ onToggle,
1013
+ onNavigateFullPage
1014
+ }) {
1015
+ const { t } = useTranslation();
1016
+ return /* @__PURE__ */ jsxs(
1017
+ "div",
1018
+ {
1019
+ className: cn(
1020
+ "border-b border-border flex items-center h-[64px]",
1021
+ isExpanded ? "justify-between px-4" : "justify-center px-0"
1022
+ ),
1023
+ children: [
1024
+ isExpanded && /* @__PURE__ */ jsxs(
1025
+ motion.div,
1026
+ {
1027
+ initial: { opacity: 0, x: -10 },
1028
+ animate: { opacity: 1, x: 0 },
1029
+ exit: { opacity: 0, x: -10 },
1030
+ className: "flex items-center gap-2 overflow-hidden",
1031
+ children: [
1032
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(XerticaOrbe, { size: 32 }) }),
1033
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium truncate", children: t("assistant.title") })
1034
+ ]
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1038
+ isExpanded && onNavigateFullPage && /* @__PURE__ */ jsx(
1039
+ Button,
1040
+ {
1041
+ variant: "ghost",
1042
+ size: "sm",
1043
+ onClick: onNavigateFullPage,
1044
+ className: "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
1045
+ title: t("assistant.expand"),
1046
+ "aria-label": t("assistant.expand"),
1047
+ children: /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" })
1048
+ }
1049
+ ),
1050
+ /* @__PURE__ */ jsx(
1051
+ Button,
1052
+ {
1053
+ variant: "ghost",
1054
+ size: "sm",
1055
+ onClick: onToggle,
1056
+ className: cn(
1057
+ "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
1058
+ !isExpanded && "w-10 h-10"
1059
+ ),
1060
+ "aria-label": isExpanded ? t("assistant.collapse") : t("assistant.expand"),
1061
+ children: isExpanded ? /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(PanelRight, { className: "w-4 h-4" })
1062
+ }
1063
+ )
1064
+ ] })
1065
+ ]
1066
+ }
1067
+ );
1068
+ }
1069
+
1070
+ function AssistantTabBar({
1071
+ activeTab,
1072
+ showHistory,
1073
+ showFavorites,
1074
+ onTabChange
1075
+ }) {
1076
+ const { t } = useTranslation();
1077
+ return /* @__PURE__ */ jsx("div", { className: "px-4 py-2 border-b border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
1078
+ /* @__PURE__ */ jsxs(
1079
+ Button,
1080
+ {
1081
+ variant: activeTab === "chat" ? "default" : "ghost",
1082
+ size: "sm",
1083
+ onClick: () => onTabChange("chat"),
1084
+ className: "flex-1 h-8",
1085
+ "aria-label": t("assistant.tabs.chatLabel"),
1086
+ children: [
1087
+ /* @__PURE__ */ jsx(MessageSquare, { className: "w-3 h-3 mr-1" }),
1088
+ t("assistant.tabs.chat")
1089
+ ]
1090
+ }
1091
+ ),
1092
+ showHistory && /* @__PURE__ */ jsxs(
1093
+ Button,
1094
+ {
1095
+ variant: activeTab === "historico" ? "default" : "ghost",
1096
+ size: "sm",
1097
+ onClick: () => onTabChange("historico"),
1098
+ className: "flex-1 h-8",
1099
+ "aria-label": t("assistant.tabs.historyLabel"),
1100
+ children: [
1101
+ /* @__PURE__ */ jsx(History, { className: "w-3 h-3 mr-1" }),
1102
+ t("assistant.tabs.history")
1103
+ ]
1104
+ }
1105
+ ),
1106
+ showFavorites && /* @__PURE__ */ jsxs(
1107
+ Button,
1108
+ {
1109
+ variant: activeTab === "favoritos" ? "default" : "ghost",
1110
+ size: "sm",
1111
+ onClick: () => onTabChange("favoritos"),
1112
+ className: "flex-1 h-8",
1113
+ "aria-label": t("assistant.tabs.favoritesLabel"),
1114
+ children: [
1115
+ /* @__PURE__ */ jsx(Heart, { className: "w-3 h-3 mr-1" }),
1116
+ t("assistant.tabs.favorites")
1117
+ ]
1118
+ }
1119
+ )
1120
+ ] }) });
1121
+ }
1122
+
1123
+ function AssistantWelcomeScreen({
1124
+ userName,
1125
+ welcomeMessage,
1126
+ suggestions,
1127
+ richSuggestions,
1128
+ showMoreSuggestions,
1129
+ onSetShowMoreSuggestions,
1130
+ onSendSuggestion,
1131
+ onRichSuggestionClick
1132
+ }) {
1133
+ const { t } = useTranslation();
1134
+ return /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto min-h-0", children: [
1135
+ /* @__PURE__ */ jsxs("div", { className: "p-6 text-center", children: [
1136
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 flex items-center justify-center", children: /* @__PURE__ */ jsx(XerticaOrbe, { size: 64 }) }),
1137
+ /* @__PURE__ */ jsx("h3", { className: "mb-2 text-foreground", children: t("assistant.greeting", { name: userName }) }),
1138
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: welcomeMessage })
1139
+ ] }),
1140
+ (suggestions.length > 0 || richSuggestions.length > 0) && /* @__PURE__ */ jsxs("div", { className: "px-4 pb-4 space-y-2", children: [
1141
+ suggestions.map((sugestao) => /* @__PURE__ */ jsx(
1142
+ "button",
1143
+ {
1144
+ onClick: () => onSendSuggestion(sugestao.text),
1145
+ className: "w-full p-3 text-left rounded-[var(--radius-card)] bg-muted text-foreground transition-colors duration-200 hover:bg-muted/80",
1146
+ children: sugestao.text
1147
+ },
1148
+ sugestao.id
1149
+ )),
1150
+ richSuggestions.length > 0 && (!showMoreSuggestions ? /* @__PURE__ */ jsxs(
1151
+ Button,
1152
+ {
1153
+ variant: "ghost",
1154
+ size: "sm",
1155
+ onClick: () => onSetShowMoreSuggestions(true),
1156
+ className: "w-full justify-start text-muted-foreground",
1157
+ children: [
1158
+ /* @__PURE__ */ jsx(MoreHorizontal, { className: "w-4 h-4 mr-2" }),
1159
+ t("assistant.moreSuggestions")
1160
+ ]
1161
+ }
1162
+ ) : /* @__PURE__ */ jsxs("div", { className: "space-y-2 pt-2 border-t border-border mt-2 animate-in slide-in-from-top-2", children: [
1163
+ richSuggestions.map((sugestao) => /* @__PURE__ */ jsx(
1164
+ "button",
1165
+ {
1166
+ onClick: () => onRichSuggestionClick(sugestao),
1167
+ className: "w-full p-3 text-left rounded-[var(--radius-card)] bg-muted/50 border border-border text-foreground transition-all duration-200 hover:bg-primary/5 hover:border-primary/50 group",
1168
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1169
+ sugestao.id.includes("chart") && /* @__PURE__ */ jsx(BarChart3, { className: "w-4 h-4 text-primary" }),
1170
+ sugestao.id.includes("table") && /* @__PURE__ */ jsx(Table, { className: "w-4 h-4 text-primary" }),
1171
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: sugestao.text })
1172
+ ] })
1173
+ },
1174
+ sugestao.id
1175
+ )),
1176
+ /* @__PURE__ */ jsxs(
1177
+ Button,
1178
+ {
1179
+ variant: "ghost",
1180
+ size: "sm",
1181
+ onClick: () => onSetShowMoreSuggestions(false),
1182
+ className: "w-full justify-center text-muted-foreground mt-2",
1183
+ children: [
1184
+ /* @__PURE__ */ jsx(ChevronLeft, { className: "w-4 h-4 mr-2" }),
1185
+ t("assistant.back")
1186
+ ]
1187
+ }
1188
+ )
1189
+ ] }))
1190
+ ] })
1191
+ ] });
1192
+ }
1193
+
1194
+ function MarkdownMessage({ content, className = "" }) {
1195
+ const convertMarkdownToHtml = (markdown) => {
1196
+ let html = markdown;
1197
+ html = html.replace(/</g, "&lt;").replace(/>/g, "&gt;");
1198
+ html = html.replace(
1199
+ /^### (.*$)/gim,
1200
+ '<h3 class="font-medium text-sm mt-2 mb-1 break-words">$1</h3>'
1201
+ );
1202
+ html = html.replace(
1203
+ /^## (.*$)/gim,
1204
+ '<h2 class="font-medium text-base mt-3 mb-1.5 break-words">$1</h2>'
1205
+ );
1206
+ html = html.replace(
1207
+ /^# (.*$)/gim,
1208
+ '<h1 class="font-medium text-lg mt-3 mb-2 break-words">$1</h1>'
1209
+ );
1210
+ html = html.replace(/\*\*(.*?)\*\*/g, '<strong class="font-medium">$1</strong>');
1211
+ html = html.replace(/\*(.*?)\*/g, '<em class="italic">$1</em>');
1212
+ html = html.replace(
1213
+ /\[([^\]]+)\]\(([^)]+)\)/g,
1214
+ '<a href="$2" class="text-[var(--chart-4)] hover:underline break-all" target="_blank" rel="noopener noreferrer">$1</a>'
1215
+ );
1216
+ html = html.replace(
1217
+ /`([^`]+)`/g,
1218
+ '<code class="px-1.5 py-0.5 rounded bg-muted text-xs font-mono break-all inline-block max-w-full">$1</code>'
1219
+ );
1220
+ html = html.replace(/((?:^[•\-] .*$(?:\n|$))+)/gim, (match) => {
1221
+ const items = match.trim().split("\n").map(
1222
+ (item) => `<li class="ml-4 mb-1 list-disc break-words">${item.replace(/^[•\-]\s+/, "")}</li>`
1223
+ ).join("");
1224
+ return `<ul class="list-disc my-2">${items}</ul>`;
1225
+ });
1226
+ html = html.replace(/((?:^\d+\. .*$(?:\n|$))+)/gim, (match) => {
1227
+ const items = match.trim().split("\n").map(
1228
+ (item) => `<li class="ml-4 mb-1 list-decimal break-words">${item.replace(/^\d+\.\s+/, "")}</li>`
1229
+ ).join("");
1230
+ return `<ol class="list-decimal my-2">${items}</ol>`;
1231
+ });
1232
+ html = html.replace(/((?:^\|.+\|[ \t]*(?:\r?\n|$))+)/gm, (match) => {
1233
+ const rows = match.trim().split(/\r?\n/).filter((line) => line.trim());
1234
+ if (rows.length < 2) return match;
1235
+ const isSeparatorRow = /^\|[\s\-:|]+\|$/.test(rows[1].trim());
1236
+ if (!isSeparatorRow) return match;
1237
+ const parseCells = (row) => row.split("|").slice(1, -1).map((cell) => cell.trim());
1238
+ const headerCells = parseCells(rows[0]).map(
1239
+ (cell) => `<th class="px-3 py-2 text-left font-medium text-xs uppercase tracking-wide border-b border-border">${cell}</th>`
1240
+ ).join("");
1241
+ const bodyRows = rows.slice(2).map(
1242
+ (row) => `<tr class="border-b border-border last:border-0 hover:bg-muted/50">${parseCells(row).map((cell) => `<td class="px-3 py-2 text-sm">${cell}</td>`).join("")}</tr>`
1243
+ ).join("");
1244
+ return `<div class="overflow-x-auto my-3 rounded-[var(--radius)] border border-border"><table class="w-full text-sm"><thead class="bg-muted/50"><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></div>`;
1245
+ });
1246
+ html = html.replace(/\n\n/g, '</p><p class="mb-2 break-words">');
1247
+ html = html.replace(/\n/g, "<br/>");
1248
+ html = '<p class="mb-2 break-words">' + html + "</p>";
1249
+ html = html.replace(/<p[^>]*>\s*<\/p>/g, "");
1250
+ return html;
1251
+ };
1252
+ const htmlContent = convertMarkdownToHtml(content);
1253
+ return /* @__PURE__ */ jsx(
1254
+ "div",
1255
+ {
1256
+ className: `text-sm leading-relaxed break-words overflow-wrap-anywhere max-w-full ${className}`,
1257
+ dangerouslySetInnerHTML: { __html: htmlContent }
1258
+ }
1259
+ );
1260
+ }
1261
+
1262
+ function FormattedDocument({
1263
+ content,
1264
+ maxPreviewLength = 500,
1265
+ className = ""
1266
+ }) {
1267
+ const [isExpanded, setIsExpanded] = useState(false);
1268
+ const { t } = useTranslation();
1269
+ const convertMarkdownToHtml = (markdown) => {
1270
+ let html = markdown;
1271
+ html = html.replace(/</g, "&lt;").replace(/>/g, "&gt;");
1272
+ html = html.replace(
1273
+ /^### (.*$)/gim,
1274
+ '<h3 class="text-base font-medium mt-2 mb-1 text-foreground">$1</h3>'
1275
+ );
1276
+ html = html.replace(
1277
+ /^## (.*$)/gim,
1278
+ '<h2 class="text-lg font-medium mt-2 mb-1 text-foreground">$1</h2>'
1279
+ );
1280
+ html = html.replace(
1281
+ /^# (.*$)/gim,
1282
+ '<h1 class="text-xl font-medium mt-3 mb-2 text-foreground">$1</h1>'
1283
+ );
1284
+ html = html.replace(
1285
+ /\*\*(.*?)\*\*/g,
1286
+ '<strong class="font-medium text-foreground">$1</strong>'
1287
+ );
1288
+ html = html.replace(/\*(.*?)\*/g, '<em class="italic">$1</em>');
1289
+ html = html.replace(
1290
+ /^[-*+] \[ \] (.*$)/gim,
1291
+ '<div class="flex items-center gap-2 ml-4 my-0.5"><input type="checkbox" disabled class="rounded w-3.5 h-3.5 accent-primary" aria-label="$1" /> <span class="text-sm">$1</span></div>'
1292
+ );
1293
+ html = html.replace(
1294
+ /^[-*+] \[x\] (.*$)/gim,
1295
+ '<div class="flex items-center gap-2 ml-4 my-0.5"><input type="checkbox" checked disabled class="rounded w-3.5 h-3.5 accent-primary" aria-label="$1" /> <span class="text-sm">$1</span></div>'
1296
+ );
1297
+ html = html.replace(/((?:^[-*+] .*$(?:\n|$))+)/gim, (match) => {
1298
+ const items = match.trim().split("\n").map((item) => `<li class="ml-6 my-0.5 list-disc">${item.replace(/^[-*+] /i, "")}</li>`).join("");
1299
+ return `<ul class="list-disc my-2">${items}</ul>`;
1300
+ });
1301
+ html = html.replace(/((?:^\d+\. .*$(?:\n|$))+)/gim, (match) => {
1302
+ const items = match.trim().split("\n").map((item) => `<li class="ml-6 my-0.5 list-decimal">${item.replace(/^\d+\. /i, "")}</li>`).join("");
1303
+ return `<ol class="list-decimal my-2">${items}</ol>`;
1304
+ });
1305
+ html = html.replace(/^---$/gim, '<hr class="my-2 border-border" />');
1306
+ html = html.replace(/\n\n+/g, '</p><p class="my-0.5">');
1307
+ html = html.replace(/\n/g, " ");
1308
+ html = '<p class="my-0.5">' + html + "</p>";
1309
+ return html;
1310
+ };
1311
+ const htmlContent = convertMarkdownToHtml(content);
1312
+ const isLong = content.length > maxPreviewLength;
1313
+ const displayContent = !isLong || isExpanded ? htmlContent : convertMarkdownToHtml(content.substring(0, maxPreviewLength) + "...");
1314
+ return /* @__PURE__ */ jsxs("div", { className, children: [
1315
+ /* @__PURE__ */ jsx(
1316
+ "div",
1317
+ {
1318
+ className: "max-w-none text-sm text-foreground leading-relaxed break-words overflow-hidden",
1319
+ dangerouslySetInnerHTML: { __html: displayContent }
1320
+ }
1321
+ ),
1322
+ isLong && /* @__PURE__ */ jsx(
1323
+ Button,
1324
+ {
1325
+ variant: "ghost",
1326
+ size: "sm",
1327
+ onClick: () => setIsExpanded(!isExpanded),
1328
+ className: "mt-2 w-full text-xs hover:bg-accent text-muted-foreground",
1329
+ children: isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
1330
+ /* @__PURE__ */ jsx(ChevronUp, { className: "w-3 h-3 mr-1" }),
1331
+ t("common.seeLess")
1332
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1333
+ /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 mr-1" }),
1334
+ t("common.seeMore")
1335
+ ] })
1336
+ }
1337
+ )
1338
+ ] });
1339
+ }
1340
+
1341
+ function AssistantMessageBubble({
1342
+ msg,
1343
+ copiedId,
1344
+ generatingPodcastId,
1345
+ executingCommand,
1346
+ savedSearches,
1347
+ enablePodcastGeneration,
1348
+ feedbackOptions,
1349
+ onCopyMessage,
1350
+ onToggleFavorite,
1351
+ onGeneratePodcast,
1352
+ onDownloadDocument,
1353
+ onDownloadPodcast,
1354
+ onEditDocument,
1355
+ onOpenSearchResult,
1356
+ onExecuteSearchCommand,
1357
+ onEvaluationClick,
1358
+ onOpenFeedbackDialog
1359
+ }) {
1360
+ const { t, i18n } = useTranslation();
1361
+ return /* @__PURE__ */ jsxs(
1362
+ motion.div,
1363
+ {
1364
+ initial: { opacity: 0, y: 10 },
1365
+ animate: { opacity: 1, y: 0 },
1366
+ className: `flex gap-2 w-full min-w-0 ${msg.type === "user" ? "justify-end" : "justify-start"}`,
1367
+ children: [
1368
+ msg.type === "assistant" && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 pt-1", children: /* @__PURE__ */ jsx(XerticaOrbe, { size: 32 }) }),
1369
+ /* @__PURE__ */ jsxs(
1370
+ "div",
1371
+ {
1372
+ className: cn(
1373
+ "flex flex-col min-w-0 transition-all duration-300",
1374
+ msg.type === "user" ? "max-w-[85%] md:max-w-[70%] items-end w-fit" : cn(
1375
+ "items-start",
1376
+ msg.tableData || msg.chartData || msg.searchResults || msg.attachmentType === "document" ? "w-full max-w-full" : "w-fit max-w-[95%] md:max-w-[90%]"
1377
+ )
1378
+ ),
1379
+ children: [
1380
+ /* @__PURE__ */ jsxs(
1381
+ "div",
1382
+ {
1383
+ className: cn(
1384
+ "px-4 py-2 break-words overflow-hidden overflow-x-hidden w-full min-w-0 rounded-2xl",
1385
+ msg.type === "user" ? "bg-primary text-primary-foreground shadow-sm" : "bg-muted text-foreground"
1386
+ ),
1387
+ children: [
1388
+ msg.attachmentType === "document" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2 pb-2 border-b border-border min-w-0 overflow-hidden", children: [
1389
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1 overflow-hidden", children: [
1390
+ /* @__PURE__ */ jsx(FileText, { className: "w-4 h-4 flex-shrink-0" }),
1391
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium break-words", children: msg.attachmentName })
1392
+ ] }),
1393
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
1394
+ /* @__PURE__ */ jsx(
1395
+ Button,
1396
+ {
1397
+ variant: "ghost",
1398
+ size: "sm",
1399
+ onClick: () => msg.documentContent && msg.attachmentName && onDownloadDocument(msg.documentContent, msg.attachmentName),
1400
+ className: "h-6 px-2",
1401
+ title: t("assistant.download"),
1402
+ children: /* @__PURE__ */ jsx(Download, { className: "w-3 h-3" })
1403
+ }
1404
+ ),
1405
+ /* @__PURE__ */ jsxs(
1406
+ Button,
1407
+ {
1408
+ variant: "ghost",
1409
+ size: "sm",
1410
+ onClick: () => msg.documentContent && msg.documentTitle && onEditDocument(msg.documentContent, msg.documentTitle),
1411
+ className: "h-6 px-2",
1412
+ children: [
1413
+ /* @__PURE__ */ jsx(Edit, { className: "w-3 h-3 mr-1" }),
1414
+ t("common.edit")
1415
+ ]
1416
+ }
1417
+ )
1418
+ ] })
1419
+ ] }),
1420
+ msg.attachmentType && msg.attachmentType !== "podcast" && msg.attachmentType !== "document" && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-border min-w-0 overflow-hidden", children: [
1421
+ msg.attachmentType === "file" && /* @__PURE__ */ jsx(FileText, { className: "w-4 h-4 flex-shrink-0" }),
1422
+ msg.attachmentType === "audio" && /* @__PURE__ */ jsx(Music, { className: "w-4 h-4 flex-shrink-0" }),
1423
+ msg.attachmentType === "image" && /* @__PURE__ */ jsx(Image, { className: "w-4 h-4 flex-shrink-0" }),
1424
+ /* @__PURE__ */ jsx("span", { className: "text-small break-words", children: msg.attachmentName })
1425
+ ] }),
1426
+ msg.type === "user" ? /* @__PURE__ */ jsx("p", { className: "whitespace-pre-wrap break-words", children: msg.content }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1427
+ (msg.content.includes("🔐") || msg.content.includes("❌")) && /* @__PURE__ */ jsx("div", { className: "mb-3 p-3 border rounded-[var(--radius)] overflow-hidden bg-[var(--toast-error-bg)]/20 border-[var(--toast-error-border)]/30", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 min-w-0", children: [
1428
+ /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-[var(--toast-error-icon)]" }),
1429
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ jsx(MarkdownMessage, { content: msg.content, className: "text-foreground" }) })
1430
+ ] }) }),
1431
+ !(msg.content.includes("🔐") || msg.content.includes("❌")) && /* @__PURE__ */ jsx(MarkdownMessage, { content: msg.content, className: "text-foreground" })
1432
+ ] }),
1433
+ msg.chartData && msg.chartConfig && /* @__PURE__ */ jsx("div", { className: "mt-4 w-full h-[300px] min-w-[300px]", children: /* @__PURE__ */ jsx(ChartContainer, { config: msg.chartConfig, className: "h-full w-full", children: /* @__PURE__ */ jsxs(BarChart, { accessibilityLayer: true, data: msg.chartData, children: [
1434
+ /* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
1435
+ /* @__PURE__ */ jsx(
1436
+ XAxis,
1437
+ {
1438
+ dataKey: "month",
1439
+ tickLine: false,
1440
+ tickMargin: 10,
1441
+ axisLine: false,
1442
+ tickFormatter: (value) => value.slice(0, 3)
1443
+ }
1444
+ ),
1445
+ /* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(ChartTooltipContent, {}) }),
1446
+ /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
1447
+ Object.keys(msg.chartConfig).map((key) => /* @__PURE__ */ jsx(Bar, { dataKey: key, fill: `var(--color-${key})`, radius: 4 }, key))
1448
+ ] }) }) }),
1449
+ msg.tableData && /* @__PURE__ */ jsx("div", { className: "mt-4 w-full max-w-full border rounded-[var(--radius)] overflow-x-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent relative", children: /* @__PURE__ */ jsxs(Table$1, { children: [
1450
+ msg.tableData.caption && /* @__PURE__ */ jsx(TableCaption, { children: msg.tableData.caption }),
1451
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: msg.tableData.headers.map((header, i) => /* @__PURE__ */ jsx(TableHead, { children: header }, i)) }) }),
1452
+ /* @__PURE__ */ jsx(TableBody, { children: msg.tableData.rows.map((row, i) => /* @__PURE__ */ jsx(TableRow, { children: row.map((cell, j) => /* @__PURE__ */ jsx(TableCell, { children: cell }, j)) }, i)) })
1453
+ ] }) }),
1454
+ msg.attachmentType === "document" && msg.documentContent && /* @__PURE__ */ jsx("div", { className: "mt-3 pt-3 border-t border-border overflow-hidden", children: /* @__PURE__ */ jsx(FormattedDocument, { content: msg.documentContent, maxPreviewLength: 250 }) }),
1455
+ msg.attachmentType === "podcast" && msg.audioUrl && /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-border overflow-hidden", children: [
1456
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3 min-w-0 overflow-hidden", children: [
1457
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1 overflow-hidden", children: [
1458
+ /* @__PURE__ */ jsx("div", { className: "w-6 h-6 flex items-center justify-center flex-shrink-0 rounded-[var(--radius-button)] bg-gradient-to-br from-[var(--chart-1)] via-[var(--chart-4)] to-[var(--chart-1)]", children: /* @__PURE__ */ jsx(Radio, { className: "w-3 h-3 text-white" }) }),
1459
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium break-words", children: msg.attachmentName })
1460
+ ] }),
1461
+ /* @__PURE__ */ jsx(
1462
+ Button,
1463
+ {
1464
+ variant: "ghost",
1465
+ size: "sm",
1466
+ onClick: () => msg.audioUrl && msg.attachmentName && onDownloadPodcast(msg.audioUrl, msg.attachmentName),
1467
+ className: "h-6 px-2 flex-shrink-0",
1468
+ title: t("assistant.download"),
1469
+ children: /* @__PURE__ */ jsx(Download, { className: "w-3 h-3" })
1470
+ }
1471
+ )
1472
+ ] }),
1473
+ /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius)] p-2 overflow-hidden bg-gradient-to-r from-[var(--chart-1)]/10 to-[var(--chart-4)]/10", children: /* @__PURE__ */ jsxs("audio", { controls: true, className: "w-full max-w-full h-10 outline-none", children: [
1474
+ /* @__PURE__ */ jsx("source", { src: msg.audioUrl, type: "audio/mpeg" }),
1475
+ t("assistant.audioNotSupported")
1476
+ ] }) })
1477
+ ] }),
1478
+ msg.attachmentType === "search" && msg.searchResults && /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-border space-y-4 overflow-hidden", children: [
1479
+ /* @__PURE__ */ jsxs("div", { className: "overflow-hidden", children: [
1480
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
1481
+ /* @__PURE__ */ jsx(Search, { className: "w-4 h-4 text-[var(--chart-4)]" }),
1482
+ /* @__PURE__ */ jsxs("h4", { className: "text-foreground", children: [
1483
+ t("assistant.searchResultsFound"),
1484
+ " (",
1485
+ msg.searchResults.length,
1486
+ ")"
1487
+ ] })
1488
+ ] }),
1489
+ /* @__PURE__ */ jsx("div", { className: "space-y-2 overflow-hidden", children: msg.searchResults.map((result) => /* @__PURE__ */ jsx(
1490
+ "div",
1491
+ {
1492
+ onClick: () => onOpenSearchResult(result),
1493
+ className: "p-3 rounded-[var(--radius)] border border-border transition-all cursor-pointer group overflow-hidden hover:bg-muted/50",
1494
+ children: /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between gap-2 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 flex-1 min-w-0 overflow-hidden", children: [
1495
+ /* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex-shrink-0", children: [
1496
+ result.type === "document" && /* @__PURE__ */ jsx(FileText, { className: "w-4 h-4 text-[var(--chart-4)]" }),
1497
+ result.type === "project" && /* @__PURE__ */ jsx(FolderOpen, { className: "w-4 h-4 text-[var(--chart-1)]" }),
1498
+ result.type === "conversation" && /* @__PURE__ */ jsx(MessageSquare, { className: "w-4 h-4 text-[var(--chart-2)]" }),
1499
+ result.type === "file" && /* @__PURE__ */ jsx(Folder, { className: "w-4 h-4 text-[var(--chart-3)]" }),
1500
+ result.type === "contact" && /* @__PURE__ */ jsx(Users, { className: "w-4 h-4 text-[var(--chart-5)]" })
1501
+ ] }),
1502
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
1503
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 min-w-0", children: [
1504
+ /* @__PURE__ */ jsx("h5", { className: "text-sm font-medium break-words flex-1 min-w-0 text-foreground", children: result.title }),
1505
+ /* @__PURE__ */ jsxs("span", { className: "px-1.5 py-0.5 rounded-sm flex-shrink-0 self-start bg-[var(--chart-4)]/10 text-[var(--chart-4)]", children: [
1506
+ result.relevance,
1507
+ "%"
1508
+ ] })
1509
+ ] }),
1510
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1 line-clamp-2 break-words", children: result.description }),
1511
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mt-2 flex-wrap min-w-0", children: [
1512
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground flex items-center gap-1 min-w-0 max-w-full", children: [
1513
+ /* @__PURE__ */ jsx(ExternalLink, { className: "w-3 h-3 flex-shrink-0" }),
1514
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: result.path })
1515
+ ] }),
1516
+ result.lastModified && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground flex items-center gap-1 flex-shrink-0", children: [
1517
+ /* @__PURE__ */ jsx(Clock, { className: "w-3 h-3" }),
1518
+ result.lastModified
1519
+ ] })
1520
+ ] })
1521
+ ] })
1522
+ ] }) })
1523
+ },
1524
+ result.id
1525
+ )) })
1526
+ ] }),
1527
+ msg.searchSources && /* @__PURE__ */ jsxs("div", { children: [
1528
+ /* @__PURE__ */ jsx("h4", { className: "mb-2 text-foreground", children: t("assistant.searchSources") }),
1529
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 overflow-hidden", children: msg.searchSources.map((source, index) => /* @__PURE__ */ jsxs(
1530
+ "div",
1531
+ {
1532
+ className: "px-3 py-1.5 border max-w-full rounded-[var(--radius-button)] bg-muted border-border",
1533
+ children: [
1534
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground break-words", children: source.name }),
1535
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground ml-1 whitespace-nowrap", children: [
1536
+ "(",
1537
+ source.count,
1538
+ ")"
1539
+ ] })
1540
+ ]
1541
+ },
1542
+ index
1543
+ )) })
1544
+ ] }),
1545
+ msg.searchCommands && msg.searchResults && /* @__PURE__ */ jsxs("div", { children: [
1546
+ /* @__PURE__ */ jsx("h4", { className: "mb-2 text-foreground", children: t("assistant.searchActions") }),
1547
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-2", children: msg.searchCommands.map((command) => /* @__PURE__ */ jsxs(
1548
+ "button",
1549
+ {
1550
+ onClick: () => onExecuteSearchCommand(
1551
+ command.id,
1552
+ msg.content.replace("🔍 Pesquisa realizada com sucesso!", "").split('"')[1] || "pesquisa",
1553
+ msg.searchResults,
1554
+ msg.id
1555
+ ),
1556
+ disabled: executingCommand === command.id,
1557
+ className: cn(
1558
+ "flex items-start gap-2 p-2 rounded-[var(--radius)] border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed",
1559
+ savedSearches.includes(msg.id) && command.id === "5" ? "border-[var(--toast-warning-border)] bg-[var(--toast-warning-bg)]/20" : "border-border bg-transparent hover:bg-muted/50"
1560
+ ),
1561
+ children: [
1562
+ executingCommand === command.id ? /* @__PURE__ */ jsx(Loader2, { className: "w-5 h-5 animate-spin flex-shrink-0 text-primary" }) : /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: command.icon }),
1563
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
1564
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-foreground break-words", children: command.id === "5" && savedSearches.includes(msg.id) ? `⭐ ${t("assistant.searchSaved")}` : command.label }),
1565
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground break-words", children: executingCommand === command.id ? t("assistant.processing") : command.description })
1566
+ ] })
1567
+ ]
1568
+ },
1569
+ command.id
1570
+ )) })
1571
+ ] })
1572
+ ] })
1573
+ ]
1574
+ }
1575
+ ),
1576
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-1 px-2", children: [
1577
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: msg.timestamp.toLocaleTimeString(i18n.language, {
1578
+ hour: "2-digit",
1579
+ minute: "2-digit"
1580
+ }) }),
1581
+ enablePodcastGeneration && msg.type === "assistant" && msg.attachmentType !== "podcast" && /* @__PURE__ */ jsx(
1582
+ Button,
1583
+ {
1584
+ variant: "ghost",
1585
+ size: "sm",
1586
+ onClick: () => onGeneratePodcast(msg.id, msg.content),
1587
+ disabled: generatingPodcastId === msg.id,
1588
+ className: "h-6 w-6 p-0 disabled:opacity-50 text-muted-foreground",
1589
+ title: t("assistant.generatePodcast"),
1590
+ "aria-label": t("assistant.generatePodcast"),
1591
+ children: generatingPodcastId === msg.id ? /* @__PURE__ */ jsx(Loader2, { className: "w-3 h-3 animate-spin" }) : /* @__PURE__ */ jsx(Radio, { className: "w-3 h-3" })
1592
+ }
1593
+ ),
1594
+ msg.type === "assistant" && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 border-l border-border pl-2 ml-1", children: [
1595
+ /* @__PURE__ */ jsx(
1596
+ Button,
1597
+ {
1598
+ variant: "ghost",
1599
+ size: "icon",
1600
+ className: cn(
1601
+ "h-6 w-6 rounded-full hover:bg-green-100 dark:hover:bg-green-900/20 hover:text-green-600",
1602
+ msg.evaluation === "like" && "text-green-600 bg-green-100 dark:bg-green-900/20"
1603
+ ),
1604
+ onClick: () => onEvaluationClick(msg.id, "like"),
1605
+ title: t("assistant.like"),
1606
+ "aria-label": t("assistant.like"),
1607
+ children: /* @__PURE__ */ jsx(ThumbsUp, { className: "h-3.5 w-3.5" })
1608
+ }
1609
+ ),
1610
+ /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1611
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
1612
+ Button,
1613
+ {
1614
+ variant: "ghost",
1615
+ size: "icon",
1616
+ className: cn(
1617
+ "h-6 w-6 rounded-full hover:bg-red-100 dark:hover:bg-red-900/20 hover:text-red-600",
1618
+ msg.evaluation === "dislike" && "text-red-600 bg-red-100 dark:bg-red-900/20"
1619
+ ),
1620
+ title: t("assistant.dislike"),
1621
+ "aria-label": t("assistant.dislike"),
1622
+ children: /* @__PURE__ */ jsx(ThumbsDown, { className: "h-3.5 w-3.5" })
1623
+ }
1624
+ ) }),
1625
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
1626
+ feedbackOptions && feedbackOptions.length > 0 ? feedbackOptions.map((option, idx) => /* @__PURE__ */ jsx(
1627
+ DropdownMenuItem,
1628
+ {
1629
+ onClick: () => onOpenFeedbackDialog(msg.id, option),
1630
+ children: option
1631
+ },
1632
+ idx
1633
+ )) : /* @__PURE__ */ jsxs(Fragment, { children: [
1634
+ /* @__PURE__ */ jsx(
1635
+ DropdownMenuItem,
1636
+ {
1637
+ onClick: () => onOpenFeedbackDialog(msg.id, t("assistant.feedback.notWhatIWanted")),
1638
+ children: t("assistant.feedback.notWhatIWanted")
1639
+ }
1640
+ ),
1641
+ /* @__PURE__ */ jsx(
1642
+ DropdownMenuItem,
1643
+ {
1644
+ onClick: () => onOpenFeedbackDialog(msg.id, t("assistant.feedback.incorrectInfo")),
1645
+ children: t("assistant.feedback.incorrectInfo")
1646
+ }
1647
+ ),
1648
+ /* @__PURE__ */ jsx(
1649
+ DropdownMenuItem,
1650
+ {
1651
+ onClick: () => onOpenFeedbackDialog(msg.id, t("assistant.feedback.incompleteAnswer")),
1652
+ children: t("assistant.feedback.incompleteAnswer")
1653
+ }
1654
+ )
1655
+ ] }),
1656
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => onOpenFeedbackDialog(msg.id, null), children: t("assistant.feedback.other") })
1657
+ ] })
1658
+ ] })
1659
+ ] }),
1660
+ /* @__PURE__ */ jsx(
1661
+ Button,
1662
+ {
1663
+ variant: "ghost",
1664
+ size: "sm",
1665
+ onClick: () => onCopyMessage(msg.content, msg.id),
1666
+ className: `h-6 w-6 p-0 ${copiedId === msg.id ? "text-[var(--toast-success-icon)]" : "text-muted-foreground"}`,
1667
+ "aria-label": copiedId === msg.id ? t("assistant.copied") : t("assistant.copyMessage"),
1668
+ children: copiedId === msg.id ? /* @__PURE__ */ jsx(Check, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx(Copy, { className: "w-3 h-3" })
1669
+ }
1670
+ )
1671
+ ] })
1672
+ ]
1673
+ }
1674
+ )
1675
+ ]
1676
+ },
1677
+ msg.id
1678
+ );
1679
+ }
1680
+
1681
+ function AssistantTypingIndicator() {
1682
+ return /* @__PURE__ */ jsxs(
1683
+ motion.div,
1684
+ {
1685
+ initial: { opacity: 0, y: 10 },
1686
+ animate: { opacity: 1, y: 0 },
1687
+ className: "flex gap-2 justify-start",
1688
+ children: [
1689
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 pt-1", children: /* @__PURE__ */ jsx(XerticaOrbe, { size: 32 }) }),
1690
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-3 bg-muted rounded-2xl", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
1691
+ /* @__PURE__ */ jsx(
1692
+ motion.div,
1693
+ {
1694
+ className: "w-2 h-2 rounded-full bg-muted-foreground",
1695
+ animate: { y: [0, -8, 0] },
1696
+ transition: { repeat: Infinity, duration: 0.6, delay: 0 }
1697
+ }
1698
+ ),
1699
+ /* @__PURE__ */ jsx(
1700
+ motion.div,
1701
+ {
1702
+ className: "w-2 h-2 rounded-full bg-muted-foreground",
1703
+ animate: { y: [0, -8, 0] },
1704
+ transition: { repeat: Infinity, duration: 0.6, delay: 0.2 }
1705
+ }
1706
+ ),
1707
+ /* @__PURE__ */ jsx(
1708
+ motion.div,
1709
+ {
1710
+ className: "w-2 h-2 rounded-full bg-muted-foreground",
1711
+ animate: { y: [0, -8, 0] },
1712
+ transition: { repeat: Infinity, duration: 0.6, delay: 0.4 }
1713
+ }
1714
+ )
1715
+ ] }) })
1716
+ ]
1717
+ }
1718
+ );
1719
+ }
1720
+
1721
+ function AssistantConversationList({
1722
+ conversations,
1723
+ currentConversationId,
1724
+ activeTab,
1725
+ isFullPage,
1726
+ onNewConversation,
1727
+ onSelectConversation,
1728
+ onToggleFavorite
1729
+ }) {
1730
+ const { t } = useTranslation();
1731
+ return /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs("div", { className: `p-4 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`, children: [
1732
+ /* @__PURE__ */ jsxs(
1733
+ Button,
1734
+ {
1735
+ variant: "outline",
1736
+ size: "sm",
1737
+ onClick: onNewConversation,
1738
+ className: "w-full mb-4 justify-start",
1739
+ children: [
1740
+ /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4 mr-2" }),
1741
+ t("assistant.newConversation")
1742
+ ]
1743
+ }
1744
+ ),
1745
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: conversations.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8", children: [
1746
+ /* @__PURE__ */ jsx(Heart, { className: "w-12 h-12 mx-auto text-muted-foreground/50 mb-2" }),
1747
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: activeTab === "favoritos" ? t("assistant.noFavorites") : t("assistant.noHistory") })
1748
+ ] }) : conversations.map((conversa) => /* @__PURE__ */ jsxs(
1749
+ "div",
1750
+ {
1751
+ onClick: () => onSelectConversation(conversa.id),
1752
+ className: cn(
1753
+ "p-3 rounded-[var(--radius)] cursor-pointer transition-colors duration-200 border",
1754
+ conversa.id === currentConversationId ? "border-primary bg-primary/10" : "border-border hover:bg-muted"
1755
+ ),
1756
+ children: [
1757
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-1", children: [
1758
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-foreground truncate flex-1", children: conversa.title }),
1759
+ /* @__PURE__ */ jsx(
1760
+ Button,
1761
+ {
1762
+ variant: "ghost",
1763
+ size: "sm",
1764
+ onClick: (e) => {
1765
+ e.stopPropagation();
1766
+ onToggleFavorite(conversa.id);
1767
+ },
1768
+ className: "h-6 w-6 p-0 flex-shrink-0 ml-1",
1769
+ children: /* @__PURE__ */ jsx(
1770
+ Heart,
1771
+ {
1772
+ className: cn(
1773
+ "w-3 h-3",
1774
+ conversa.isFavorite ? "text-destructive fill-current" : "text-muted-foreground"
1775
+ )
1776
+ }
1777
+ )
1778
+ }
1779
+ )
1780
+ ] }),
1781
+ conversa.lastMessage && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground truncate mb-1", children: conversa.lastMessage }),
1782
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: conversa.timestamp })
1783
+ ]
1784
+ },
1785
+ conversa.id
1786
+ )) })
1787
+ ] }) });
1788
+ }
1789
+
1790
+ function AssistantFeedbackDialog({
1791
+ state,
1792
+ onReasonChange,
1793
+ onClose,
1794
+ onSubmit
1795
+ }) {
1796
+ const { t } = useTranslation();
1797
+ return /* @__PURE__ */ jsx(Dialog, { open: state.isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[600px]", children: [
1798
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
1799
+ /* @__PURE__ */ jsx(DialogTitle, { className: "pr-8", children: state.category ? t("assistant.feedbackDialog.titleWithCategory", { category: state.category }) : t("assistant.feedbackDialog.title") }),
1800
+ /* @__PURE__ */ jsx(DialogDescription, { children: state.category ? t("assistant.feedbackDialog.descriptionOptional") : t("assistant.feedbackDialog.description") })
1801
+ ] }),
1802
+ /* @__PURE__ */ jsx("div", { className: "grid gap-4 py-4 px-6", children: /* @__PURE__ */ jsx(
1803
+ Textarea,
1804
+ {
1805
+ className: "min-h-[100px]",
1806
+ placeholder: state.category ? t("assistant.feedbackDialog.placeholderOptional") : t("assistant.feedbackDialog.placeholder"),
1807
+ "aria-label": state.category ? t("assistant.feedbackDialog.placeholderOptional") : t("assistant.feedbackDialog.placeholder"),
1808
+ value: state.reason,
1809
+ onChange: (e) => onReasonChange(e.target.value),
1810
+ rows: 4
1811
+ }
1812
+ ) }),
1813
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
1814
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onClose, children: t("common.cancel") }),
1815
+ /* @__PURE__ */ jsx(Button, { onClick: onSubmit, disabled: !state.category && !state.reason.trim(), children: state.category ? t("assistant.feedbackDialog.confirmAndSend") : t("assistant.feedbackDialog.send") })
1816
+ ] })
1817
+ ] }) });
1818
+ }
1819
+
1820
+ function AssistantDocumentEditor({
1821
+ document,
1822
+ isMobile,
1823
+ containerWidth,
1824
+ onClose,
1825
+ onChange
1826
+ }) {
1827
+ const { t } = useTranslation();
1828
+ return /* @__PURE__ */ jsx(
1829
+ "div",
1830
+ {
1831
+ className: cn(
1832
+ "flex flex-col border-border bg-background overflow-hidden transition-all duration-300",
1833
+ isMobile ? "fixed inset-0 z-[110] w-full h-[100dvh]" : "absolute top-0 bottom-0 right-full w-[800px] border-l border-r border-border shadow-[-25px_0_50px_-15px_rgba(0,0,0,0.15)] z-[90]"
1834
+ ),
1835
+ style: { maxWidth: isMobile ? "none" : `calc(100vw - ${containerWidth})` },
1836
+ children: /* @__PURE__ */ jsxs("div", { className: "h-full flex flex-col", children: [
1837
+ /* @__PURE__ */ jsxs("div", { className: "px-4 h-[64px] border-b border-border bg-card flex items-center justify-between", children: [
1838
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1839
+ /* @__PURE__ */ jsx("div", { className: "p-2 bg-primary/10 rounded-md", children: /* @__PURE__ */ jsx(FileText, { className: "w-4 h-4 text-primary" }) }),
1840
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-card-foreground text-sm", children: document.title })
1841
+ ] }),
1842
+ /* @__PURE__ */ jsx(
1843
+ Button,
1844
+ {
1845
+ variant: "ghost",
1846
+ size: "icon",
1847
+ className: "h-8 w-8 rounded-full",
1848
+ onClick: onClose,
1849
+ "aria-label": t("assistant.closeDocumentEditor"),
1850
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
1851
+ }
1852
+ )
1853
+ ] }),
1854
+ /* @__PURE__ */ jsx("div", { className: "flex-1 bg-muted/20 p-0 sm:p-6 overflow-hidden", children: /* @__PURE__ */ jsx(
1855
+ RichTextEditor,
1856
+ {
1857
+ value: document.content || "",
1858
+ onChange: (newVal) => onChange({ ...document, content: newVal }),
1859
+ placeholder: t("assistant.documentEditorPlaceholder"),
1860
+ className: "max-w-4xl mx-auto h-full",
1861
+ actionButton: /* @__PURE__ */ jsxs(Button, { size: "sm", className: "gap-2 h-8", children: [
1862
+ /* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5" }),
1863
+ t("common.save")
1864
+ ] })
1865
+ }
1866
+ ) })
1867
+ ] })
1868
+ }
1869
+ );
1870
+ }
1871
+
1872
+ function XerticaAssistant({
1873
+ mode = "expanded",
1874
+ isExpanded: controlledIsExpanded,
1875
+ onToggle,
1876
+ defaultTab = "chat",
1877
+ demoMode = true,
1878
+ onNavigateSettings,
1879
+ onNavigateFullPage,
1880
+ userName,
1881
+ initialMessages = [],
1882
+ savedConversations = [],
1883
+ suggestions: propSuggestions,
1884
+ onSendMessage,
1885
+ onFileAttach,
1886
+ isProcessing = false,
1887
+ width,
1888
+ height,
1889
+ className = "",
1890
+ mobileFloating = false,
1891
+ customResponses = [],
1892
+ responseGenerator,
1893
+ richSuggestions = [],
1894
+ welcomeMessage,
1895
+ onRichAction,
1896
+ onEvaluation,
1897
+ feedbackOptions,
1898
+ // Feature flags — all default to true for backward compatibility
1899
+ showHistory = true,
1900
+ showFavorites = true,
1901
+ enableAudioInput = true,
1902
+ enableFileAttachment = true,
1903
+ enableDocumentCreation = true,
1904
+ enablePodcastGeneration = true,
1905
+ enableSearch = true
1906
+ }) {
1907
+ const { t } = useTranslation();
1908
+ const resolvedUserName = userName ?? t("assistant.defaultUserName");
1909
+ const resolvedWelcomeMessage = welcomeMessage ?? t("assistant.defaultWelcomeMessage");
1910
+ const {
1911
+ isFullPage,
1912
+ isExpanded,
1913
+ isMobile,
1914
+ abaSelecionada,
1915
+ setAbaSelecionada,
1916
+ mensagens,
1917
+ mensagem,
1918
+ setMensagem,
1919
+ conversaAtual,
1920
+ conversasFiltradas,
1921
+ copiedId,
1922
+ generatingPodcastId,
1923
+ executingCommand,
1924
+ savedSearches,
1925
+ editingDocument,
1926
+ setEditingDocument,
1927
+ showMoreSuggestions,
1928
+ setShowMoreSuggestions,
1929
+ evaluationState,
1930
+ setEvaluationState,
1931
+ sugestoes,
1932
+ messagesEndRef,
1933
+ fileInputRef,
1934
+ audioInputRef,
1935
+ handleToggle,
1936
+ handleExpandWithTab,
1937
+ handleEnviarMensagem,
1938
+ handleToggleFavorite,
1939
+ handleCopyMessage,
1940
+ handleGeneratePodcast,
1941
+ handleDownloadDocument,
1942
+ handleDownloadPodcast,
1943
+ handleEditDocument,
1944
+ handleNovaConversa,
1945
+ handleSelecionarConversa,
1946
+ handleToggleFavoritaConversa,
1947
+ handleOpenSearchResult,
1948
+ handleExecuteSearchCommand,
1949
+ handleRichSuggestionClick,
1950
+ handleEvaluationClick,
1951
+ openFeedbackDialog,
1952
+ handleSubmitDislike
1953
+ } = useAssistant({
1954
+ mode,
1955
+ isExpanded: controlledIsExpanded,
1956
+ onToggle,
1957
+ defaultTab,
1958
+ demoMode,
1959
+ customResponses,
1960
+ initialMessages,
1961
+ savedConversations,
1962
+ suggestions: propSuggestions,
1963
+ onSendMessage,
1964
+ isProcessing,
1965
+ responseGenerator,
1966
+ richSuggestions,
1967
+ onRichAction,
1968
+ onEvaluation
1969
+ });
1970
+ const containerWidth = width ?? (isFullPage ? "100%" : isExpanded ? "420px" : "80px");
1971
+ const containerHeight = height ?? "h-full";
1972
+ if (isMobile && !isExpanded) {
1973
+ return /* @__PURE__ */ jsxs(
1974
+ Button,
1975
+ {
1976
+ onClick: handleToggle,
1977
+ className: cn(
1978
+ "fixed bottom-4 right-4 h-14 rounded-full shadow-lg pl-3 pr-5 gap-3 bg-white text-zinc-900 hover:bg-zinc-50 border border-zinc-200 z-50 transition-all duration-300",
1979
+ className
1980
+ ),
1981
+ children: [
1982
+ /* @__PURE__ */ jsx(XerticaOrbe, { size: 32 }),
1983
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-base tracking-wide", children: t("assistant.title") })
1984
+ ]
1985
+ }
1986
+ );
1987
+ }
1988
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1989
+ /* @__PURE__ */ jsx(
1990
+ "input",
1991
+ {
1992
+ ref: fileInputRef,
1993
+ type: "file",
1994
+ accept: ".pdf,.doc,.docx,.txt,.md",
1995
+ className: "hidden",
1996
+ onChange: (e) => {
1997
+ const file = e.target.files?.[0];
1998
+ if (file && onFileAttach) {
1999
+ onFileAttach(file);
2000
+ }
2001
+ },
2002
+ "aria-label": t("assistant.uploadDocument")
2003
+ }
2004
+ ),
2005
+ /* @__PURE__ */ jsx(
2006
+ "input",
2007
+ {
2008
+ ref: audioInputRef,
2009
+ type: "file",
2010
+ accept: "audio/*",
2011
+ className: "hidden",
2012
+ onChange: (e) => {
2013
+ const file = e.target.files?.[0];
2014
+ if (file && onFileAttach) {
2015
+ onFileAttach(file);
2016
+ }
2017
+ },
2018
+ "aria-label": t("assistant.uploadAudio")
2019
+ }
2020
+ ),
2021
+ /* @__PURE__ */ jsxs(
2022
+ "div",
2023
+ {
2024
+ className: cn(
2025
+ `${containerHeight} flex flex-col bg-card relative`,
2026
+ !isFullPage && "border-l border-border shadow-sm",
2027
+ isMobile && isExpanded && "fixed inset-0 z-[100] h-[100dvh] w-full border-l-0 shadow-2xl",
2028
+ className
2029
+ ),
2030
+ style: !(isMobile && isExpanded) ? {
2031
+ width: isFullPage ? "100%" : containerWidth
2032
+ } : void 0,
2033
+ children: [
2034
+ editingDocument && !isFullPage && /* @__PURE__ */ jsx(
2035
+ AssistantDocumentEditor,
2036
+ {
2037
+ document: editingDocument,
2038
+ isMobile,
2039
+ containerWidth,
2040
+ onClose: () => setEditingDocument(null),
2041
+ onChange: (doc) => setEditingDocument(doc)
2042
+ }
2043
+ ),
2044
+ !isFullPage && /* @__PURE__ */ jsx(
2045
+ AssistantHeader,
2046
+ {
2047
+ isExpanded,
2048
+ onToggle: handleToggle,
2049
+ onNavigateFullPage
2050
+ }
2051
+ ),
2052
+ !isExpanded && !isFullPage && /* @__PURE__ */ jsx(
2053
+ AssistantCollapsedView,
2054
+ {
2055
+ showHistory,
2056
+ showFavorites,
2057
+ onToggle: handleToggle,
2058
+ onExpandWithTab: handleExpandWithTab
2059
+ }
2060
+ ),
2061
+ /* @__PURE__ */ jsx(AnimatePresence, { children: (isExpanded || isFullPage) && /* @__PURE__ */ jsxs(
2062
+ motion.div,
2063
+ {
2064
+ initial: isFullPage ? false : { opacity: 0, x: 50 },
2065
+ animate: { opacity: 1, x: 0 },
2066
+ exit: isFullPage ? void 0 : { opacity: 0, x: 50 },
2067
+ transition: { duration: 0.2 },
2068
+ className: "flex-1 flex flex-col overflow-hidden",
2069
+ children: [
2070
+ !isFullPage && (showHistory || showFavorites) && /* @__PURE__ */ jsx(
2071
+ AssistantTabBar,
2072
+ {
2073
+ activeTab: abaSelecionada,
2074
+ showHistory,
2075
+ showFavorites,
2076
+ onTabChange: setAbaSelecionada
2077
+ }
2078
+ ),
2079
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-hidden flex flex-col", children: [
2080
+ abaSelecionada === "chat" && /* @__PURE__ */ jsx(
2081
+ "div",
2082
+ {
2083
+ className: `flex-1 flex flex-col min-h-0 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`,
2084
+ children: mensagens.length === 0 ? /* @__PURE__ */ jsx(
2085
+ AssistantWelcomeScreen,
2086
+ {
2087
+ userName: resolvedUserName,
2088
+ welcomeMessage: resolvedWelcomeMessage,
2089
+ suggestions: sugestoes,
2090
+ richSuggestions,
2091
+ showMoreSuggestions,
2092
+ onSetShowMoreSuggestions: setShowMoreSuggestions,
2093
+ onSendSuggestion: handleEnviarMensagem,
2094
+ onRichSuggestionClick: handleRichSuggestionClick
2095
+ }
2096
+ ) : /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 min-h-0 overflow-x-hidden [&_[data-radix-scroll-area-viewport]>div]:!block", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4 px-4 py-4 max-w-6xl mx-auto !block !w-full", children: [
2097
+ mensagens.map((msg) => /* @__PURE__ */ jsx(
2098
+ AssistantMessageBubble,
2099
+ {
2100
+ msg,
2101
+ copiedId,
2102
+ generatingPodcastId,
2103
+ executingCommand,
2104
+ savedSearches,
2105
+ enablePodcastGeneration,
2106
+ feedbackOptions,
2107
+ onCopyMessage: handleCopyMessage,
2108
+ onToggleFavorite: handleToggleFavorite,
2109
+ onGeneratePodcast: handleGeneratePodcast,
2110
+ onDownloadDocument: handleDownloadDocument,
2111
+ onDownloadPodcast: handleDownloadPodcast,
2112
+ onEditDocument: handleEditDocument,
2113
+ onOpenSearchResult: handleOpenSearchResult,
2114
+ onExecuteSearchCommand: handleExecuteSearchCommand,
2115
+ onEvaluationClick: handleEvaluationClick,
2116
+ onOpenFeedbackDialog: openFeedbackDialog
2117
+ },
2118
+ msg.id
2119
+ )),
2120
+ isProcessing && /* @__PURE__ */ jsx(AssistantTypingIndicator, {}),
2121
+ /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
2122
+ ] }) })
2123
+ }
2124
+ ),
2125
+ (abaSelecionada === "historico" && showHistory || abaSelecionada === "favoritos" && showFavorites) && /* @__PURE__ */ jsx(
2126
+ AssistantConversationList,
2127
+ {
2128
+ conversations: conversasFiltradas,
2129
+ currentConversationId: conversaAtual,
2130
+ activeTab: abaSelecionada,
2131
+ isFullPage,
2132
+ onNewConversation: handleNovaConversa,
2133
+ onSelectConversation: handleSelecionarConversa,
2134
+ onToggleFavorite: handleToggleFavoritaConversa
2135
+ }
2136
+ )
2137
+ ] }),
2138
+ abaSelecionada === "chat" && /* @__PURE__ */ jsx(
2139
+ ModernChatInput,
2140
+ {
2141
+ value: mensagem,
2142
+ onChange: setMensagem,
2143
+ onSubmit: handleEnviarMensagem,
2144
+ onFileUpload: enableFileAttachment ? () => fileInputRef.current?.click() : void 0,
2145
+ onAudioUpload: enableAudioInput ? () => audioInputRef.current?.click() : void 0,
2146
+ disabled: isProcessing,
2147
+ isFullPage,
2148
+ enableAudioInput,
2149
+ enableFileAttachment,
2150
+ enableDocumentCreation,
2151
+ enablePodcastGeneration,
2152
+ enableSearch
2153
+ }
2154
+ )
2155
+ ]
2156
+ }
2157
+ ) })
2158
+ ]
2159
+ }
2160
+ ),
2161
+ /* @__PURE__ */ jsx(
2162
+ AssistantFeedbackDialog,
2163
+ {
2164
+ state: evaluationState,
2165
+ onReasonChange: (reason) => setEvaluationState((prev) => ({ ...prev, reason })),
2166
+ onClose: () => setEvaluationState((prev) => ({ ...prev, isOpen: false })),
2167
+ onSubmit: handleSubmitDislike
2168
+ }
2169
+ )
2170
+ ] });
2171
+ }
2172
+
2173
+ export { FormattedDocument as F, MarkdownMessage as M, XerticaAssistant as X, ModernChatInput as a, gerarResposta as g, useAssistant as u };