xertica-ui 2.5.3 → 2.7.0

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 (635) hide show
  1. package/CHANGELOG.md +705 -664
  2. package/README.md +482 -482
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +1293 -1256
  6. package/bin/generate-tokens.ts +256 -262
  7. package/bin/language-config.test.ts +32 -0
  8. package/bin/language-config.ts +384 -359
  9. package/components/Introduction.mdx +121 -121
  10. package/components/assistant/code-block/CodeBlock.tsx +7 -6
  11. package/components/assistant/code-block/code-block.mdx +38 -38
  12. package/components/assistant/code-block/code-block.test.tsx +2 -1
  13. package/components/assistant/formatted-document/FormattedDocument.tsx +3 -0
  14. package/components/assistant/formatted-document/formatted-document.mdx +31 -31
  15. package/components/assistant/formatted-document/formatted-document.test.tsx +5 -4
  16. package/components/assistant/markdown-message/MarkdownMessage.tsx +1 -1
  17. package/components/assistant/markdown-message/markdown-message.mdx +44 -44
  18. package/components/assistant/modern-chat-input/modern-chat-input.mdx +71 -71
  19. package/components/assistant/modern-chat-input/modern-chat-input.test.tsx +3 -2
  20. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +1 -1
  21. package/components/assistant/xertica-assistant/types.ts +3 -2
  22. package/components/assistant/xertica-assistant/use-assistant.ts +10 -10
  23. package/components/assistant/xertica-assistant/xertica-assistant.mdx +66 -66
  24. package/components/assistant/xertica-assistant/xertica-assistant.test.tsx +2 -1
  25. package/{templates/src/features/auth/ui → components/blocks/auth}/AuthPageShell.tsx +37 -32
  26. package/components/blocks/auth/PasswordStrengthMeter.tsx +41 -0
  27. package/components/blocks/auth/SocialLoginButtons.tsx +95 -0
  28. package/components/blocks/auth/index.ts +11 -0
  29. package/components/blocks/auth/usePasswordStrength.ts +13 -0
  30. package/components/blocks/card-patterns/card-patterns.mdx +123 -123
  31. package/components/blocks/index.ts +1 -0
  32. package/components/brand/branding/branding.mdx +27 -27
  33. package/components/brand/language-selector/language-selector.mdx +126 -126
  34. package/components/brand/theme-toggle/theme-toggle.mdx +47 -47
  35. package/components/brand/theme-toggle/theme-toggle.test.tsx +6 -2
  36. package/components/brand/xertica-logo/xertica-logo.mdx +56 -56
  37. package/components/brand/xertica-orbe/xertica-orbe.mdx +38 -38
  38. package/components/brand/xertica-provider/XerticaProvider.tsx +112 -112
  39. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  40. package/components/brand/xertica-provider/xertica-provider.test.tsx +25 -13
  41. package/components/brand/xertica-xlogo/xertica-xlogo.mdx +55 -55
  42. package/components/examples/DrawingMapExample.tsx +1 -4
  43. package/components/layout/header/header.mdx +117 -117
  44. package/components/layout/header/header.test.tsx +2 -1
  45. package/components/layout/sidebar/sidebar.mdx +99 -99
  46. package/components/layout/sidebar/sidebar.stories.tsx +1033 -1033
  47. package/components/layout/sidebar/sidebar.test.tsx +2 -1
  48. package/components/layout/sidebar/sidebar.tsx +1509 -1506
  49. package/components/media/audio-player/AudioPlayer.mdx +67 -67
  50. package/components/media/audio-player/AudioPlayer.test.tsx +2 -1
  51. package/components/media/floating-media-wrapper.mdx +74 -74
  52. package/components/media/video-player/VideoPlayer.mdx +102 -102
  53. package/components/media/video-player/VideoPlayer.test.tsx +3 -2
  54. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +94 -188
  55. package/components/pages/forgot-password-page/forgot-password-page.mdx +60 -60
  56. package/components/pages/forgot-password-page/forgot-password-page.test.tsx +2 -1
  57. package/components/pages/home-content/HomeContent.tsx +119 -119
  58. package/components/pages/home-content/home-content.mdx +62 -62
  59. package/components/pages/home-page/HomePage.stories.tsx +8 -15
  60. package/components/pages/home-page/home-page.mdx +53 -53
  61. package/components/pages/home-page/home-page.test.tsx +2 -1
  62. package/components/pages/login-page/LoginPage.mdx +31 -31
  63. package/components/pages/login-page/LoginPage.tsx +125 -218
  64. package/components/pages/login-page/login-page.test.tsx +2 -1
  65. package/components/pages/reset-password-page/ResetPasswordPage.tsx +153 -243
  66. package/components/pages/reset-password-page/reset-password-page.mdx +63 -63
  67. package/components/pages/template-content/TemplateContent.tsx +1353 -1353
  68. package/components/pages/template-content/template-content.mdx +61 -61
  69. package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
  70. package/components/pages/template-page/template-page.mdx +53 -53
  71. package/components/pages/template-page/template-page.test.tsx +2 -1
  72. package/components/pages/verify-email-page/VerifyEmailPage.tsx +104 -206
  73. package/components/pages/verify-email-page/verify-email-page.mdx +55 -55
  74. package/components/public-api-smoke.test.tsx +10 -6
  75. package/components/shared/assistant-utils.ts +3 -2
  76. package/components/shared/navigation.ts +2 -2
  77. package/components/ui/accordion/accordion.mdx +29 -29
  78. package/components/ui/alert/alert.mdx +29 -29
  79. package/components/ui/alert-dialog/alert-dialog.mdx +26 -26
  80. package/components/ui/aspect-ratio/aspect-ratio.mdx +25 -25
  81. package/components/ui/assistant-chart/AssistantChart.tsx +8 -2
  82. package/components/ui/assistant-chart/assistant-chart.mdx +25 -25
  83. package/components/ui/avatar/avatar.mdx +26 -26
  84. package/components/ui/badge/badge.mdx +28 -28
  85. package/components/ui/breadcrumb/breadcrumb.mdx +26 -26
  86. package/components/ui/button/button.mdx +29 -29
  87. package/components/ui/calendar/calendar.mdx +26 -26
  88. package/components/ui/card/card.mdx +26 -26
  89. package/components/ui/carousel/carousel.mdx +26 -26
  90. package/components/ui/chart/chart.mdx +26 -26
  91. package/components/ui/chart/chart.test.tsx +178 -178
  92. package/components/ui/chart/chart.tsx +2252 -2245
  93. package/components/ui/checkbox/checkbox.mdx +26 -26
  94. package/components/ui/collapsible/collapsible.mdx +25 -25
  95. package/components/ui/command/command.mdx +26 -26
  96. package/components/ui/context-menu/context-menu.mdx +26 -26
  97. package/components/ui/dialog/dialog.mdx +26 -26
  98. package/components/ui/drawer/drawer.mdx +26 -26
  99. package/components/ui/dropdown-menu/dropdown-menu.mdx +26 -26
  100. package/components/ui/empty/empty.mdx +26 -26
  101. package/components/ui/file-upload/file-upload.mdx +26 -26
  102. package/components/ui/form/form.mdx +20 -20
  103. package/components/ui/google-maps-loader/google-maps-loader.mdx +68 -68
  104. package/components/ui/hover-card/hover-card.mdx +26 -26
  105. package/components/ui/input/input.mdx +29 -29
  106. package/components/ui/input-otp/input-otp.mdx +26 -26
  107. package/components/ui/label/label.mdx +25 -25
  108. package/components/ui/map/map.mdx +26 -26
  109. package/components/ui/map/map.tsx +6 -1
  110. package/components/ui/menubar/menubar.mdx +26 -26
  111. package/components/ui/navigation-menu/navigation-menu.mdx +26 -26
  112. package/components/ui/notification-badge/notification-badge.mdx +26 -26
  113. package/components/ui/page-header/page-header.mdx +44 -44
  114. package/components/ui/pagination/pagination.mdx +26 -26
  115. package/components/ui/popover/popover.mdx +26 -26
  116. package/components/ui/progress/progress.mdx +25 -25
  117. package/components/ui/radio-group/radio-group.mdx +26 -26
  118. package/components/ui/rating/rating.mdx +26 -26
  119. package/components/ui/resizable/resizable.mdx +26 -26
  120. package/components/ui/resizable/resizable.tsx +13 -8
  121. package/components/ui/rich-text-editor/rich-text-editor.mdx +47 -47
  122. package/components/ui/route-map/route-map.mdx +26 -26
  123. package/components/ui/scroll-area/scroll-area.mdx +25 -25
  124. package/components/ui/search/search.mdx +27 -27
  125. package/components/ui/select/select.mdx +26 -26
  126. package/components/ui/separator/separator.mdx +25 -25
  127. package/components/ui/sheet/sheet.mdx +26 -26
  128. package/components/ui/simple-map/simple-map.mdx +25 -25
  129. package/components/ui/skeleton/skeleton.mdx +25 -25
  130. package/components/ui/slider/slider.mdx +26 -26
  131. package/components/ui/sonner/sonner.mdx +26 -26
  132. package/components/ui/stats-card/stats-card.mdx +26 -26
  133. package/components/ui/stats-card/stats-card.stories.tsx +117 -117
  134. package/components/ui/stats-card/stats-card.tsx +109 -109
  135. package/components/ui/stepper/stepper.mdx +26 -26
  136. package/components/ui/switch/switch.mdx +25 -25
  137. package/components/ui/table/table.mdx +27 -27
  138. package/components/ui/tabs/tabs.mdx +26 -26
  139. package/components/ui/textarea/textarea.mdx +25 -25
  140. package/components/ui/timeline/timeline.mdx +26 -26
  141. package/components/ui/toggle/toggle.mdx +26 -26
  142. package/components/ui/toggle-group/toggle-group.mdx +26 -26
  143. package/components/ui/tooltip/tooltip.mdx +26 -26
  144. package/components/ui/tree-view/tree-view.mdx +26 -26
  145. package/components.json +511 -511
  146. package/contexts/BrandColorsContext.tsx +282 -282
  147. package/contexts/i18n-singleton.test.tsx +57 -0
  148. package/contexts/theme-data.ts +391 -391
  149. package/dist/{AssistantChart-DNdwuS-t.js → AssistantChart-BMNSA_Pk.js} +4 -4
  150. package/dist/{AssistantChart-COGiOV-g.cjs → AssistantChart-BzM7plyc.cjs} +31 -21
  151. package/dist/{AssistantChart-CWX1OWNM.js → AssistantChart-C842evTi.js} +31 -21
  152. package/dist/{AssistantChart-D0A1FPYt.cjs → AssistantChart-CImCNLfD.cjs} +150 -114
  153. package/dist/{AssistantChart-BW9JK6jw.cjs → AssistantChart-CVF2uh37.cjs} +4 -4
  154. package/dist/{AssistantChart-BXU1ACnh.js → AssistantChart-DfdIfmQr.js} +134 -240
  155. package/dist/{AssistantChart-BZTPJ5dP.cjs → AssistantChart-JooMdVQU.cjs} +5 -5
  156. package/dist/{AssistantChart-DMJJ_Amf.js → AssistantChart-KHS-tp-L.js} +5 -5
  157. package/dist/{BrandColorsContext-BwY-b6M4.cjs → BrandColorsContext-B4_81eas.cjs} +2 -2
  158. package/dist/{BrandColorsContext-BMRJ04Wf.js → BrandColorsContext-DbK5LnQ_.js} +2 -2
  159. package/dist/{CodeBlock-CjeFavqV.js → CodeBlock-DiKO8ocT.js} +11 -11
  160. package/dist/{CodeBlock-CV6dtsTM.cjs → CodeBlock-ZYThr7Kn.cjs} +12 -9
  161. package/dist/{FeatureCard-Cfs6Ishq.js → FeatureCard-BhpfmPPx.js} +20 -20
  162. package/dist/{FeatureCard-ie3L8Fpr.cjs → FeatureCard-D-5yS_OD.cjs} +31 -18
  163. package/dist/{progress-DDeuWPZw.cjs → ImageWithFallback-CfkAkctC.cjs} +34 -9
  164. package/dist/{progress-Cs9i4DPx.js → ImageWithFallback-bw-CxxDc.js} +27 -10
  165. package/dist/LanguageContext-CX_zdxre.js +1912 -0
  166. package/dist/LanguageContext-CjhSSqJT.cjs +1917 -0
  167. package/dist/LanguageSelector-BR3Ss0k_.js +46 -0
  168. package/dist/LanguageSelector-CHOLPmHr.cjs +48 -0
  169. package/dist/{XerticaXLogo-mqjoBiLI.js → LanguageSelector-CmTj3lWq.js} +85 -82
  170. package/dist/{XerticaXLogo-BX3ueACh.js → LanguageSelector-DxW6o7bt.js} +81 -81
  171. package/dist/{XerticaXLogo-uQgwns_E.cjs → LanguageSelector-Sw73qvWV.cjs} +84 -81
  172. package/dist/PasswordStrengthMeter-C8irs0G1.js +173 -0
  173. package/dist/PasswordStrengthMeter-MLzhax-d.cjs +179 -0
  174. package/dist/{ThemeContext-BgclCB35.js → ThemeContext-BGeh_Kdr.js} +290 -212
  175. package/dist/{ThemeContext-bSzuOit2.cjs → ThemeContext-CEY9pCn-.cjs} +15 -10
  176. package/dist/{ThemeContext-BblcjQup.cjs → ThemeContext-D50irx5T.cjs} +291 -205
  177. package/dist/{ThemeContext-RTy1m2Uq.js → ThemeContext-Dk3tH7Ym.js} +14 -13
  178. package/dist/{XerticaXLogo-CFuIlYFH.js → ThemeToggle-BpM_iHh8.js} +56 -93
  179. package/dist/{XerticaXLogo-CziKMQil.cjs → ThemeToggle-CZRlv0d4.cjs} +62 -85
  180. package/dist/{VerifyEmailPage-C_Zk6Gen.cjs → VerifyEmailPage-B6bOrybJ.cjs} +17 -17
  181. package/dist/VerifyEmailPage-BKiaw2YK.js +2954 -0
  182. package/dist/{VerifyEmailPage-B31mCrMc.js → VerifyEmailPage-BRE5Fz59.js} +8 -8
  183. package/dist/{VerifyEmailPage-Cyl55sJb.js → VerifyEmailPage-BcCluouh.js} +135 -65
  184. package/dist/VerifyEmailPage-Beaicc6V.cjs +2963 -0
  185. package/dist/VerifyEmailPage-BehPBp0F.cjs +2963 -0
  186. package/dist/VerifyEmailPage-Bx1sr0uQ.cjs +3298 -0
  187. package/dist/{VerifyEmailPage-Bci0bA-P.js → VerifyEmailPage-DUYyXCX9.js} +3 -3
  188. package/dist/VerifyEmailPage-DXXMHbzq.js +3289 -0
  189. package/dist/VerifyEmailPage-Djb6hthM.js +2954 -0
  190. package/dist/{VerifyEmailPage-u_Dn7t1U.cjs → VerifyEmailPage-DpYtFk35.cjs} +21 -21
  191. package/dist/{VerifyEmailPage-X14vhdyl.js → VerifyEmailPage-NXKWW3Dk.js} +12 -12
  192. package/dist/{VerifyEmailPage-C7KiYXrm.cjs → VerifyEmailPage-QrCz4Wqr.cjs} +11 -11
  193. package/dist/{VerifyEmailPage-Bv8Ah_TK.cjs → VerifyEmailPage-ZmQra0Wi.cjs} +144 -74
  194. package/dist/{XerticaProvider-BErr83Bg.js → XerticaProvider-BF3q_myt.js} +5 -4
  195. package/dist/{XerticaProvider-B8CaV7xu.cjs → XerticaProvider-BijpC_py.cjs} +18 -11
  196. package/dist/{XerticaProvider-DQtvJU7m.js → XerticaProvider-C2wDRQhT.js} +17 -13
  197. package/dist/{XerticaProvider-CeS5G_n5.cjs → XerticaProvider-C_JSOz1U.cjs} +2 -2
  198. package/dist/{XerticaProvider-CwOkHxiT.cjs → XerticaProvider-D5zjrqZq.cjs} +5 -4
  199. package/dist/{XerticaProvider-ra2NciRq.js → XerticaProvider-KTGl4Cn1.js} +2 -2
  200. package/dist/{alert-dialog-DqlRW_An.js → alert-dialog-BrpwXKwS.js} +3 -3
  201. package/dist/{alert-dialog-yckpaOpy.cjs → alert-dialog-BzIcTKn_.cjs} +173 -166
  202. package/dist/{alert-dialog-DhwPioBa.cjs → alert-dialog-CZU1Zase.cjs} +3 -3
  203. package/dist/{alert-dialog-KpoabzJb.js → alert-dialog-ClRoLH7l.js} +40 -56
  204. package/dist/{alert-dialog-B4M3vQKS.cjs → alert-dialog-DBBqvU-V.cjs} +53 -38
  205. package/dist/{alert-dialog-iDe5VE5o.js → alert-dialog-kty5pxQp.js} +160 -183
  206. package/dist/assistant.cjs.js +2 -2
  207. package/dist/assistant.es.js +2 -2
  208. package/dist/blocks.cjs.js +7 -3
  209. package/dist/blocks.es.js +2 -2
  210. package/dist/brand.cjs.js +7 -6
  211. package/dist/brand.es.js +3 -2
  212. package/dist/cli.js +63 -21
  213. package/dist/components/assistant/code-block/CodeBlock.d.ts +2 -1
  214. package/dist/components/assistant/formatted-document/FormattedDocument.d.ts +2 -1
  215. package/dist/components/assistant/markdown-message/MarkdownMessage.d.ts +2 -1
  216. package/dist/components/assistant/modern-chat-input/ModernChatInput.d.ts +2 -1
  217. package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +2 -1
  218. package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +2 -1
  219. package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +2 -1
  220. package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +2 -1
  221. package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +2 -1
  222. package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +2 -1
  223. package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +2 -1
  224. package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +2 -1
  225. package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +2 -1
  226. package/dist/components/assistant/xertica-assistant/types.d.ts +3 -2
  227. package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +1 -1
  228. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +2 -1
  229. package/dist/components/blocks/auth/AuthPageShell.d.ts +12 -0
  230. package/dist/components/blocks/auth/PasswordStrengthMeter.d.ts +7 -0
  231. package/dist/components/blocks/auth/SocialLoginButtons.d.ts +8 -0
  232. package/dist/components/blocks/auth/index.d.ts +8 -0
  233. package/dist/components/blocks/auth/usePasswordStrength.d.ts +3 -0
  234. package/dist/components/blocks/card-patterns/ActivityCard.d.ts +1 -1
  235. package/dist/components/blocks/card-patterns/ActivityCardSkeleton.d.ts +1 -1
  236. package/dist/components/blocks/card-patterns/FeatureCard.d.ts +1 -1
  237. package/dist/components/blocks/card-patterns/FeatureCardSkeleton.d.ts +1 -1
  238. package/dist/components/blocks/card-patterns/NotificationCard.d.ts +1 -1
  239. package/dist/components/blocks/card-patterns/NotificationCardSkeleton.d.ts +1 -1
  240. package/dist/components/blocks/card-patterns/ProfileCard.d.ts +1 -1
  241. package/dist/components/blocks/card-patterns/ProfileCardSkeleton.d.ts +1 -1
  242. package/dist/components/blocks/card-patterns/ProjectCard.d.ts +1 -1
  243. package/dist/components/blocks/card-patterns/ProjectCardSkeleton.d.ts +1 -1
  244. package/dist/components/blocks/card-patterns/QuickActionCard.d.ts +1 -1
  245. package/dist/components/blocks/card-patterns/QuickActionCardSkeleton.d.ts +1 -1
  246. package/dist/components/blocks/index.d.ts +1 -0
  247. package/dist/components/brand/language-selector/LanguageSelector.d.ts +2 -1
  248. package/dist/components/brand/theme-toggle/ThemeToggle.d.ts +2 -1
  249. package/dist/components/brand/xertica-logo/XerticaLogo.d.ts +2 -1
  250. package/dist/components/brand/xertica-orbe/XerticaOrbe.d.ts +2 -1
  251. package/dist/components/brand/xertica-provider/XerticaProvider.d.ts +1 -1
  252. package/dist/components/brand/xertica-xlogo/XerticaXLogo.d.ts +2 -1
  253. package/dist/components/examples/DrawingMapExample.d.ts +2 -1
  254. package/dist/components/examples/FilterableMapExample.d.ts +1 -1
  255. package/dist/components/examples/MapShowcase.d.ts +2 -1
  256. package/dist/components/examples/SimpleFilterableMap.d.ts +2 -1
  257. package/dist/components/figma/ImageWithFallback.d.ts +1 -1
  258. package/dist/components/layout/header/header.d.ts +1 -1
  259. package/dist/components/layout/sidebar/sidebar.d.ts +25 -13
  260. package/dist/components/media/FloatingMediaWrapper.d.ts +1 -1
  261. package/dist/components/media/audio-player/AudioPlayer.d.ts +2 -1
  262. package/dist/components/media/video-player/VideoPlayer.d.ts +2 -1
  263. package/dist/components/pages/forgot-password-page/ForgotPasswordPage.d.ts +2 -1
  264. package/dist/components/pages/home-content/HomeContent.d.ts +2 -1
  265. package/dist/components/pages/home-page/HomePage.d.ts +2 -1
  266. package/dist/components/pages/login-page/LoginPage.d.ts +2 -1
  267. package/dist/components/pages/reset-password-page/ResetPasswordPage.d.ts +3 -2
  268. package/dist/components/pages/template-content/TemplateContent.d.ts +2 -1
  269. package/dist/components/pages/template-page/TemplatePage.d.ts +2 -1
  270. package/dist/components/pages/verify-email-page/VerifyEmailPage.d.ts +2 -1
  271. package/dist/components/shared/CustomTooltipContent.d.ts +1 -1
  272. package/dist/components/shared/assistant-utils.d.ts +3 -2
  273. package/dist/components/shared/error-boundary.d.ts +4 -4
  274. package/dist/components/shared/error-fallbacks.d.ts +4 -3
  275. package/dist/components/shared/navigation.d.ts +6 -2
  276. package/dist/components/ui/accordion/accordion.d.ts +4 -4
  277. package/dist/components/ui/alert/alert.d.ts +3 -3
  278. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +10 -10
  279. package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts +1 -1
  280. package/dist/components/ui/assistant-chart/AssistantChart.d.ts +4 -3
  281. package/dist/components/ui/avatar/avatar.d.ts +3 -3
  282. package/dist/components/ui/badge/badge.d.ts +1 -1
  283. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +7 -7
  284. package/dist/components/ui/calendar/calendar.d.ts +2 -2
  285. package/dist/components/ui/card/card.d.ts +7 -7
  286. package/dist/components/ui/carousel/carousel.d.ts +5 -5
  287. package/dist/components/ui/chart/chart.d.ts +16 -16
  288. package/dist/components/ui/collapsible/collapsible.d.ts +3 -3
  289. package/dist/components/ui/command/command.d.ts +9 -9
  290. package/dist/components/ui/context-menu/context-menu.d.ts +15 -15
  291. package/dist/components/ui/dialog/dialog.d.ts +9 -9
  292. package/dist/components/ui/drawer/drawer.d.ts +10 -10
  293. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +15 -15
  294. package/dist/components/ui/form/form.d.ts +7 -7
  295. package/dist/components/ui/google-maps-loader/google-maps-loader.d.ts +3 -3
  296. package/dist/components/ui/hover-card/hover-card.d.ts +3 -3
  297. package/dist/components/ui/input-otp/input-otp.d.ts +4 -4
  298. package/dist/components/ui/label/label.d.ts +1 -1
  299. package/dist/components/ui/menubar/menubar.d.ts +16 -16
  300. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +8 -8
  301. package/dist/components/ui/page-header/page-header.d.ts +3 -3
  302. package/dist/components/ui/pagination/pagination.d.ts +7 -7
  303. package/dist/components/ui/popover/popover.d.ts +4 -4
  304. package/dist/components/ui/progress/progress.d.ts +1 -1
  305. package/dist/components/ui/resizable/resizable.d.ts +11 -7
  306. package/dist/components/ui/rich-text-editor/rich-text-editor.d.ts +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.d.ts +2 -2
  308. package/dist/components/ui/separator/separator.d.ts +1 -1
  309. package/dist/components/ui/sheet/sheet.d.ts +10 -10
  310. package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
  311. package/dist/components/ui/sonner/sonner.d.ts +2 -1
  312. package/dist/components/ui/stats-card/stats-card-skeleton.d.ts +1 -1
  313. package/dist/components/ui/table/table.d.ts +8 -8
  314. package/dist/components/ui/tabs/tabs.d.ts +4 -4
  315. package/dist/components/ui/tooltip/tooltip.d.ts +4 -4
  316. package/dist/contexts/ApiKeyContext.d.ts +2 -2
  317. package/dist/contexts/AssistenteContext.d.ts +1 -1
  318. package/dist/contexts/AuthContext.d.ts +1 -1
  319. package/dist/contexts/LanguageContext.d.ts +2 -2
  320. package/dist/contexts/LayoutContext.d.ts +2 -2
  321. package/dist/contexts/ThemeContext.d.ts +1 -1
  322. package/dist/features/assistant/hooks/useAssistantConfig.d.ts +1 -1
  323. package/dist/features/home/hooks/useDashboardStats.d.ts +1 -1
  324. package/dist/features/home/hooks/useFeatureCards.d.ts +1 -1
  325. package/dist/features/home/hooks/useTeamMembers.d.ts +1 -1
  326. package/dist/{google-maps-loader-BCe58h9D.js → google-maps-loader-BOug999f.js} +0 -4
  327. package/dist/{google-maps-loader-casMyxlo.cjs → google-maps-loader-DfeBRI8Q.cjs} +0 -5
  328. package/dist/hooks.cjs.js +6 -5
  329. package/dist/hooks.es.js +3 -2
  330. package/dist/{index-9GWd0qxq.cjs → index-BQjx1Mdf.cjs} +1 -1
  331. package/dist/index-Bei5DzAL.js +6 -0
  332. package/dist/index.cjs.js +32 -27
  333. package/dist/index.es.js +15 -14
  334. package/dist/layout.cjs.js +1 -1
  335. package/dist/layout.es.js +1 -1
  336. package/dist/pages.cjs.js +1 -1
  337. package/dist/pages.es.js +1 -1
  338. package/dist/{rich-text-editor-B2CKz7nx.cjs → rich-text-editor-BuqSu718.cjs} +68 -3
  339. package/dist/{rich-text-editor-DloeW0wc.js → rich-text-editor-CV8FtA_l.js} +66 -4
  340. package/dist/{sidebar-B4ZWaMrE.js → sidebar-B7YzwAp3.js} +365 -6
  341. package/dist/{sidebar-CLmIjgNd.cjs → sidebar-BGJ0j567.cjs} +84 -67
  342. package/dist/{sidebar-Duermn32.js → sidebar-BI6mZlC8.js} +81 -64
  343. package/dist/{sidebar-BS1p2V7t.cjs → sidebar-BtmotOg-.cjs} +367 -9
  344. package/dist/{sidebar-DyYvgyBj.cjs → sidebar-Cb0U7NsV.cjs} +368 -9
  345. package/dist/{sidebar-QwCoeoZ_.js → sidebar-D3EgGVxF.js} +1 -1
  346. package/dist/{sidebar-CQn_rwxP.cjs → sidebar-DDTqMGnR.cjs} +4 -4
  347. package/dist/{sidebar-3XyzjVBw.js → sidebar-I7EXyf5D.js} +364 -6
  348. package/dist/ui.cjs.js +9 -9
  349. package/dist/ui.es.js +5 -5
  350. package/dist/{xertica-assistant-BbgzsgsG.js → xertica-assistant-8fh8KA2K.js} +60 -51
  351. package/dist/{xertica-assistant-d2qs2Vd9.cjs → xertica-assistant-BjfG3zyL.cjs} +63 -46
  352. package/dist/{xertica-assistant-B687qEPU.js → xertica-assistant-CJVnvMqU.js} +17 -8
  353. package/dist/{xertica-assistant-sOHwTgIP.cjs → xertica-assistant-CKPtc1z5.cjs} +19 -10
  354. package/dist/{xertica-assistant-QFUnv5I2.cjs → xertica-assistant-DER0brPQ.cjs} +6 -5
  355. package/dist/{xertica-assistant-CyikE3N_.js → xertica-assistant-DQCjpk5M.js} +4 -3
  356. package/dist/{xertica-assistant-B1NaSFFj.js → xertica-assistant-Dk-9AJzw.js} +6 -5
  357. package/dist/{xertica-assistant-CIaUlbIt.cjs → xertica-assistant-DxhIKvuY.cjs} +8 -7
  358. package/dist/xertica-ui.css +2 -2
  359. package/docs/components/audio-player.md +1 -1
  360. package/docs/components/sidebar.md +331 -331
  361. package/docs/components/stats-card.md +138 -138
  362. package/docs/components/toggle.md +12 -0
  363. package/docs/doc-audit.md +35 -229
  364. package/docs/i18n.md +33 -10
  365. package/docs/llms.md +6 -4
  366. package/llms-compact.txt +444 -444
  367. package/llms-full.txt +12144 -12144
  368. package/llms.txt +187 -187
  369. package/package.json +223 -219
  370. package/scripts/a11y-audit.mjs +162 -162
  371. package/scripts/fix-stories.cjs +19 -19
  372. package/styles/globals.css +0 -1
  373. package/styles/xertica/base.css +8 -0
  374. package/styles/xertica/tokens.css +240 -240
  375. package/templates/.env.example +2 -2
  376. package/templates/.prettierignore +4 -4
  377. package/templates/.prettierrc +10 -10
  378. package/templates/guidelines/Guidelines.md +865 -865
  379. package/templates/index.html +13 -13
  380. package/templates/package.json +69 -69
  381. package/templates/src/app/components/AuthGuard.tsx +11 -0
  382. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +1 -2
  383. package/templates/src/features/auth/ui/LoginContent.tsx +1 -2
  384. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +3 -57
  385. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +1 -2
  386. package/templates/src/features/home/index.ts +0 -10
  387. package/templates/src/features/home/ui/HomeContent.tsx +62 -116
  388. package/templates/src/features/settings/index.ts +2 -0
  389. package/templates/src/features/settings/ui/SettingsContent.tsx +134 -0
  390. package/templates/src/features/template/index.ts +0 -4
  391. package/templates/src/features/template/ui/TemplateContent.tsx +68 -1321
  392. package/templates/src/i18n.ts +36 -13
  393. package/templates/src/locales/en/pages/settings.json +15 -0
  394. package/templates/src/locales/en/pages/templates.json +5 -313
  395. package/templates/src/locales/es/pages/settings.json +15 -0
  396. package/templates/src/locales/es/pages/templates.json +5 -313
  397. package/templates/src/locales/pt-BR/pages/settings.json +15 -0
  398. package/templates/src/locales/pt-BR/pages/templates.json +5 -313
  399. package/templates/src/pages/SettingsPage.tsx +28 -0
  400. package/templates/src/shared/config/navigation.ts +2 -2
  401. package/templates/src/styles/xertica/tokens.css +240 -240
  402. package/utils/gemini.ts +2 -2
  403. package/dist/AssistantChart-9w31gdAb.cjs +0 -3363
  404. package/dist/AssistantChart-BAudAfne.cjs +0 -3591
  405. package/dist/AssistantChart-BAx9VQvb.cjs +0 -3374
  406. package/dist/AssistantChart-BP8upjMk.js +0 -3565
  407. package/dist/AssistantChart-CVko2A1W.js +0 -3348
  408. package/dist/AssistantChart-CVzmmhx4.js +0 -3337
  409. package/dist/AssistantChart-CeU2dIb6.js +0 -3469
  410. package/dist/AssistantChart-DO5UuX4J.cjs +0 -3495
  411. package/dist/AudioPlayer-1ypwE2Wh.cjs +0 -936
  412. package/dist/AudioPlayer-BJ2IuRQW.cjs +0 -1275
  413. package/dist/AudioPlayer-BWDW6TN9.cjs +0 -1279
  414. package/dist/AudioPlayer-CM962GEh.js +0 -1280
  415. package/dist/AudioPlayer-CbZId7cj.cjs +0 -998
  416. package/dist/AudioPlayer-DU8zt8-z.js +0 -999
  417. package/dist/AudioPlayer-DuKXrCfy.js +0 -937
  418. package/dist/AudioPlayer-Xxma6_-H.js +0 -1276
  419. package/dist/BrandColorsContext-DLVJgtmH.js +0 -666
  420. package/dist/BrandColorsContext-DZT7JjeD.js +0 -659
  421. package/dist/BrandColorsContext-GUyFmkX0.cjs +0 -665
  422. package/dist/BrandColorsContext-awnBCmC4.cjs +0 -666
  423. package/dist/CodeBlock-C2ZUXt8V.js +0 -219
  424. package/dist/CodeBlock-C5oYnLQp.cjs +0 -218
  425. package/dist/CodeBlock-DuxdtN-l.js +0 -219
  426. package/dist/CodeBlock-POVYONvC.cjs +0 -218
  427. package/dist/CustomTooltipContent-BT6brkVJ.cjs +0 -49
  428. package/dist/CustomTooltipContent-CfOfikhq.js +0 -33
  429. package/dist/CustomTooltipContent-DHjkY0ww.js +0 -40
  430. package/dist/CustomTooltipContent-c_K-DWRr.cjs +0 -56
  431. package/dist/FeatureCard-9GhnlgL3.js +0 -336
  432. package/dist/FeatureCard-Bcb3Zi54.js +0 -302
  433. package/dist/FeatureCard-CkPd2psQ.cjs +0 -301
  434. package/dist/FeatureCard-Dkp-xmzM.cjs +0 -335
  435. package/dist/FeatureCardSkeleton-CAgu8stE.js +0 -27
  436. package/dist/FeatureCardSkeleton-mO3Bdm_V.cjs +0 -26
  437. package/dist/LanguageContext-BwhwC3G2.js +0 -657
  438. package/dist/LanguageContext-DvUt5jBg.cjs +0 -656
  439. package/dist/LayoutContext-BDmcZfMH.cjs +0 -84
  440. package/dist/LayoutContext-C4kKN9RV.cjs +0 -93
  441. package/dist/LayoutContext-CGEe1oPq.js +0 -94
  442. package/dist/LayoutContext-CwT5KLiW.cjs +0 -104
  443. package/dist/LayoutContext-DVLCsoQn.js +0 -105
  444. package/dist/LayoutContext-dbQvdC4O.js +0 -85
  445. package/dist/ThemeContext-BbBNoFTG.js +0 -735
  446. package/dist/ThemeContext-Bo-W2WZH.js +0 -1856
  447. package/dist/ThemeContext-CP3a0jxy.cjs +0 -1855
  448. package/dist/ThemeContext-Cmr8Ex8H.cjs +0 -734
  449. package/dist/ThemeContext-CpqYShLq.cjs +0 -324
  450. package/dist/ThemeContext-D3LzacmG.js +0 -188
  451. package/dist/ThemeContext-DQUOeziy.cjs +0 -1855
  452. package/dist/ThemeContext-Du2nE1PL.js +0 -325
  453. package/dist/ThemeContext-GeEBTJ3q.cjs +0 -1621
  454. package/dist/ThemeContext-JyLK9B1o.js +0 -1622
  455. package/dist/ThemeContext-U4dEYc6C.cjs +0 -187
  456. package/dist/ThemeContext-ept8jhXI.js +0 -1856
  457. package/dist/VerifyEmailPage-BE-L9mB7.js +0 -2828
  458. package/dist/VerifyEmailPage-BIBOKV7Z.js +0 -3214
  459. package/dist/VerifyEmailPage-BJjAMUTW.js +0 -3223
  460. package/dist/VerifyEmailPage-BRSP-Pwt.cjs +0 -3196
  461. package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
  462. package/dist/VerifyEmailPage-BiRm7Nh4.cjs +0 -3213
  463. package/dist/VerifyEmailPage-Bvfv8HVQ.js +0 -3214
  464. package/dist/VerifyEmailPage-CR7kb5df.cjs +0 -2827
  465. package/dist/VerifyEmailPage-C_ihbcth.js +0 -2828
  466. package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
  467. package/dist/VerifyEmailPage-CdYPSJoO.js +0 -2828
  468. package/dist/VerifyEmailPage-CkBYfsNy.cjs +0 -3232
  469. package/dist/VerifyEmailPage-D-FRj5TU.cjs +0 -3213
  470. package/dist/VerifyEmailPage-DF2ilhum.cjs +0 -3210
  471. package/dist/VerifyEmailPage-DMBh4NM9.cjs +0 -2827
  472. package/dist/VerifyEmailPage-DTtFfC-J.js +0 -3197
  473. package/dist/VerifyEmailPage-Dt7zgA4w.cjs +0 -2827
  474. package/dist/VerifyEmailPage-EhudUdqF.js +0 -3211
  475. package/dist/VerifyEmailPage-RrUApqBN.js +0 -3214
  476. package/dist/VerifyEmailPage-VoMI7MYH.cjs +0 -3213
  477. package/dist/VerifyEmailPage-hdB8JQGv.cjs +0 -3213
  478. package/dist/VerifyEmailPage-vYHbYK3q.js +0 -3214
  479. package/dist/XerticaOrbe-BCUVSPPB.cjs +0 -1924
  480. package/dist/XerticaOrbe-BGIB1CTK.js +0 -1355
  481. package/dist/XerticaOrbe-By8eEvR-.js +0 -1925
  482. package/dist/XerticaOrbe-FWGjBj0U.cjs +0 -1354
  483. package/dist/XerticaProvider-AChwphCO.cjs +0 -48
  484. package/dist/XerticaProvider-AbWlr7Af.cjs +0 -48
  485. package/dist/XerticaProvider-BITjgC5p.js +0 -39
  486. package/dist/XerticaProvider-BSyFrmC0.js +0 -49
  487. package/dist/XerticaProvider-By8q3Roe.cjs +0 -38
  488. package/dist/XerticaProvider-CUYJZc32.js +0 -49
  489. package/dist/XerticaProvider-CW9hpCdF.cjs +0 -39
  490. package/dist/XerticaProvider-CWgby5mY.js +0 -49
  491. package/dist/XerticaProvider-CWs6EwNa.js +0 -49
  492. package/dist/XerticaProvider-CiNKjMx1.cjs +0 -48
  493. package/dist/XerticaProvider-CjQAQPcn.cjs +0 -48
  494. package/dist/XerticaProvider-D5lLumH-.js +0 -49
  495. package/dist/XerticaProvider-DUOJg9iX.js +0 -49
  496. package/dist/XerticaProvider-Dl_b72_l.cjs +0 -51
  497. package/dist/XerticaProvider-qQUDop71.cjs +0 -48
  498. package/dist/XerticaProvider-siSt9uG2.js +0 -40
  499. package/dist/XerticaXLogo-8TTzBjHw.cjs +0 -251
  500. package/dist/XerticaXLogo-B2svDGZh.cjs +0 -251
  501. package/dist/XerticaXLogo-BWaag64t.js +0 -252
  502. package/dist/XerticaXLogo-CU-U-GP4.cjs +0 -251
  503. package/dist/XerticaXLogo-ChryA6xj.js +0 -252
  504. package/dist/XerticaXLogo-CowGv7BC.js +0 -252
  505. package/dist/XerticaXLogo-D8jf0SNv.cjs +0 -214
  506. package/dist/XerticaXLogo-DHz5SugF.js +0 -252
  507. package/dist/XerticaXLogo-DTee_y8X.cjs +0 -251
  508. package/dist/XerticaXLogo-DfUvz-lD.js +0 -243
  509. package/dist/XerticaXLogo-DzXKZBtG.js +0 -231
  510. package/dist/XerticaXLogo-fAJMy3H4.js +0 -215
  511. package/dist/XerticaXLogo-kslQ8Tk_.cjs +0 -251
  512. package/dist/XerticaXLogo-xWbElCZj.cjs +0 -230
  513. package/dist/avatar-Cq5_E8r9.cjs +0 -78
  514. package/dist/avatar-CuYu2MKt.cjs +0 -72
  515. package/dist/avatar-Cxyofu1H.js +0 -56
  516. package/dist/avatar-DSBfJMRJ.js +0 -62
  517. package/dist/breadcrumb-CVzzzqfo.js +0 -103
  518. package/dist/breadcrumb-DIJ0X3Ot.js +0 -96
  519. package/dist/breadcrumb-DjSxkjlQ.cjs +0 -95
  520. package/dist/breadcrumb-DnDlQFg2.cjs +0 -102
  521. package/dist/button-0CXwCRTm.cjs +0 -85
  522. package/dist/button-Bnv9SvYK.cjs +0 -79
  523. package/dist/button-C6uvh0rV.js +0 -63
  524. package/dist/button-qkz7Icqf.js +0 -69
  525. package/dist/card-B8-Gl5DL.js +0 -73
  526. package/dist/card-Bv_c57KU.cjs +0 -72
  527. package/dist/card-DJTsYhLL.cjs +0 -89
  528. package/dist/card-fi8zAN-I.js +0 -90
  529. package/dist/dropdown-menu-B_uEXNc4.cjs +0 -220
  530. package/dist/dropdown-menu-CFuCssWA.js +0 -204
  531. package/dist/dropdown-menu-Ze1YZFyc.cjs +0 -247
  532. package/dist/dropdown-menu-nc_Lvg-u.js +0 -231
  533. package/dist/google-maps-loader-BVoVhUwA.js +0 -316
  534. package/dist/google-maps-loader-BqsYL48U.cjs +0 -285
  535. package/dist/google-maps-loader-DjJaYhV6.cjs +0 -316
  536. package/dist/google-maps-loader-t2IlYBzw.js +0 -286
  537. package/dist/index-B7A523O_.js +0 -8
  538. package/dist/index-BabBx2pa.js +0 -6
  539. package/dist/index-CkTUgOwX.js +0 -8
  540. package/dist/index-D3RLKRAs.cjs +0 -7
  541. package/dist/index-DmHhnb7a.cjs +0 -7
  542. package/dist/index.umd.js +0 -13712
  543. package/dist/input-CNFHVKvo.cjs +0 -145
  544. package/dist/input-CPl84zAx.cjs +0 -151
  545. package/dist/input-C_UiS2Py.cjs +0 -152
  546. package/dist/input-D-6IsAca.js +0 -133
  547. package/dist/input-cc-PTD4R.js +0 -123
  548. package/dist/input-wPYg0d0P.js +0 -127
  549. package/dist/progress-BLwqortq.cjs +0 -105
  550. package/dist/progress-D9mtsf6j.js +0 -89
  551. package/dist/rich-text-editor-1UW3Y2JK.js +0 -2891
  552. package/dist/rich-text-editor-BM-LPpTh.js +0 -2902
  553. package/dist/rich-text-editor-BmsjY03B.js +0 -2949
  554. package/dist/rich-text-editor-BrdC5evx.js +0 -2244
  555. package/dist/rich-text-editor-CyggTOLQ.cjs +0 -2908
  556. package/dist/rich-text-editor-DbV-S7Fi.cjs +0 -2261
  557. package/dist/rich-text-editor-DoCkKhzk.cjs +0 -2919
  558. package/dist/rich-text-editor-DqLICivI.js +0 -2832
  559. package/dist/rich-text-editor-DxO1Hz3a.cjs +0 -2903
  560. package/dist/rich-text-editor-GS2kpTAK.cjs +0 -2966
  561. package/dist/routes.d.ts +0 -10
  562. package/dist/select-Cmb8zF7w.cjs +0 -156
  563. package/dist/select-CprSNX0z.js +0 -139
  564. package/dist/select-DT7Zjn42.cjs +0 -162
  565. package/dist/select-En8DkoaQ.js +0 -145
  566. package/dist/sidebar-B3EYhli0.cjs +0 -800
  567. package/dist/sidebar-B9NR0lCe.cjs +0 -800
  568. package/dist/sidebar-BcJ6LxvX.cjs +0 -733
  569. package/dist/sidebar-BvF5I2Ue.cjs +0 -800
  570. package/dist/sidebar-C5B_LHek.cjs +0 -795
  571. package/dist/sidebar-CA6_ek3f.js +0 -801
  572. package/dist/sidebar-CRMiBtAi.js +0 -801
  573. package/dist/sidebar-CVUGHOS_.cjs +0 -756
  574. package/dist/sidebar-CZ2mWaMM.cjs +0 -800
  575. package/dist/sidebar-CmvwjnVb.js +0 -757
  576. package/dist/sidebar-CplprZpM.js +0 -801
  577. package/dist/sidebar-Dz7bd3zP.js +0 -796
  578. package/dist/sidebar-KIS0C2JH.js +0 -801
  579. package/dist/sidebar-OTO_up7Z.js +0 -801
  580. package/dist/sidebar-WoKvFWCN.js +0 -717
  581. package/dist/sidebar-zowjejT2.cjs +0 -800
  582. package/dist/skeleton-4zoHiFJ_.cjs +0 -83
  583. package/dist/skeleton-C4bHqUBf.js +0 -84
  584. package/dist/slider-C0JKA9k3.js +0 -56
  585. package/dist/slider-CPmwzm_3.cjs +0 -73
  586. package/dist/slider-DcJharR9.cjs +0 -73
  587. package/dist/slider-Pay3fka2.js +0 -56
  588. package/dist/sonner-DeUIj0Zg.cjs +0 -63
  589. package/dist/sonner-g9RIfi35.js +0 -47
  590. package/dist/tooltip-CNtsL5cB.cjs +0 -71
  591. package/dist/tooltip-CTyZCD8h.js +0 -55
  592. package/dist/tooltip-CwgSdy3h.cjs +0 -67
  593. package/dist/tooltip-D-OrYnKO.js +0 -51
  594. package/dist/use-audio-player-BJFV24XW.js +0 -188
  595. package/dist/use-audio-player-Bkh23vQ3.js +0 -177
  596. package/dist/use-audio-player-Dn1NR9xN.cjs +0 -176
  597. package/dist/use-audio-player-DyVYlOnR.cjs +0 -187
  598. package/dist/use-mobile-BB4M_4Ru.cjs +0 -47
  599. package/dist/use-mobile-CLu9nqGL.js +0 -31
  600. package/dist/use-mobile-CNwiBNxu.js +0 -33
  601. package/dist/use-mobile-Dlf74ufz.cjs +0 -49
  602. package/dist/xertica-assistant-B1IaHXnB.cjs +0 -1894
  603. package/dist/xertica-assistant-BMqdyRVi.js +0 -2082
  604. package/dist/xertica-assistant-Bj3vBCq_.cjs +0 -2081
  605. package/dist/xertica-assistant-CfBCo21g.js +0 -2148
  606. package/dist/xertica-assistant-DIM_Do1k.js +0 -1866
  607. package/dist/xertica-assistant-DPsESB6t.js +0 -1878
  608. package/dist/xertica-assistant-DrsRwla1.cjs +0 -2147
  609. package/dist/xertica-assistant-Qp3ydksa.cjs +0 -1882
  610. package/dist/xertica-assistant-gnCJdcZY.js +0 -1866
  611. package/dist/xertica-assistant-yyrR0JKl.cjs +0 -1882
  612. package/styles/xertica/app-overrides/scrollbar.css +0 -33
  613. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +0 -78
  614. package/templates/src/features/home/data/mock.ts +0 -41
  615. package/templates/src/features/home/hooks/useFeatureCards.ts +0 -20
  616. package/templates/src/features/home/store/dashboardStore.ts +0 -25
  617. package/templates/src/features/template/ui/CrudTemplate.tsx +0 -112
  618. package/templates/src/features/template/ui/DashboardTemplate.tsx +0 -110
  619. package/templates/src/features/template/ui/FormTemplate.tsx +0 -117
  620. package/templates/src/features/template/ui/LoginTemplate.tsx +0 -59
  621. package/templates/src/locales/en/pages/crudTemplate.json +0 -25
  622. package/templates/src/locales/en/pages/dashboardTemplate.json +0 -20
  623. package/templates/src/locales/en/pages/formTemplate.json +0 -16
  624. package/templates/src/locales/en/pages/loginTemplate.json +0 -9
  625. package/templates/src/locales/es/pages/crudTemplate.json +0 -25
  626. package/templates/src/locales/es/pages/dashboardTemplate.json +0 -20
  627. package/templates/src/locales/es/pages/formTemplate.json +0 -16
  628. package/templates/src/locales/es/pages/loginTemplate.json +0 -9
  629. package/templates/src/locales/pt-BR/pages/crudTemplate.json +0 -25
  630. package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +0 -20
  631. package/templates/src/locales/pt-BR/pages/formTemplate.json +0 -16
  632. package/templates/src/locales/pt-BR/pages/loginTemplate.json +0 -9
  633. package/templates/vite.config.d.ts +0 -2
  634. package/templates/vite.config.js +0 -20
  635. package/dist/{XerticaXLogo-qBPhwK3g.cjs → LanguageSelector-1cINLJ23.cjs} +80 -80
@@ -1,1894 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const React = require("react");
4
- const framerMotion = require("framer-motion");
5
- const lucideReact = require("lucide-react");
6
- const RechartsPrimitive = require("recharts");
7
- const richTextEditor = require("./rich-text-editor-DbV-S7Fi.cjs");
8
- const dropdownMenu = require("./dropdown-menu-Ze1YZFyc.cjs");
9
- const button = require("./button-0CXwCRTm.cjs");
10
- const input = require("./input-CPl84zAx.cjs");
11
- const sonner = require("sonner");
12
- const XerticaOrbe = require("./XerticaOrbe-FWGjBj0U.cjs");
13
- const tooltip = require("./tooltip-CNtsL5cB.cjs");
14
- const TooltipPrimitive = require("@radix-ui/react-tooltip");
15
- function _interopNamespaceDefault(e) {
16
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
17
- if (e) {
18
- for (const k in e) {
19
- if (k !== "default") {
20
- const d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: () => e[k]
24
- });
25
- }
26
- }
27
- }
28
- n.default = e;
29
- return Object.freeze(n);
30
- }
31
- const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
32
- function MarkdownMessage({ content, className = "" }) {
33
- const convertMarkdownToHtml = (markdown) => {
34
- let html = markdown;
35
- html = html.replace(/</g, "<").replace(/>/g, ">");
36
- html = html.replace(/^### (.*$)/gim, '<h3 class="font-medium text-sm mt-2 mb-1 break-words">$1</h3>');
37
- html = html.replace(/^## (.*$)/gim, '<h2 class="font-medium text-base mt-3 mb-1.5 break-words">$1</h2>');
38
- html = html.replace(/^# (.*$)/gim, '<h1 class="font-medium text-lg mt-3 mb-2 break-words">$1</h1>');
39
- html = html.replace(/\*\*(.*?)\*\*/g, '<strong class="font-medium">$1</strong>');
40
- html = html.replace(/\*(.*?)\*/g, '<em class="italic">$1</em>');
41
- html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" class="text-[var(--chart-4)] hover:underline break-all" target="_blank" rel="noopener noreferrer">$1</a>');
42
- html = html.replace(/`([^`]+)`/g, '<code class="px-1.5 py-0.5 rounded bg-muted text-xs font-mono break-all inline-block max-w-full">$1</code>');
43
- html = html.replace(/((?:^[•\-] .*$(?:\n|$))+)/gim, (match) => {
44
- const items = match.trim().split("\n").map(
45
- (item) => `<li class="ml-4 mb-1 list-disc break-words">${item.replace(/^[•\-]\s+/, "")}</li>`
46
- ).join("");
47
- return `<ul class="list-disc my-2">${items}</ul>`;
48
- });
49
- html = html.replace(/((?:^\d+\. .*$(?:\n|$))+)/gim, (match) => {
50
- const items = match.trim().split("\n").map(
51
- (item) => `<li class="ml-4 mb-1 list-decimal break-words">${item.replace(/^\d+\.\s+/, "")}</li>`
52
- ).join("");
53
- return `<ol class="list-decimal my-2">${items}</ol>`;
54
- });
55
- html = html.replace(/((?:^\|.+\|[ \t]*(?:\r?\n|$))+)/gm, (match) => {
56
- const rows = match.trim().split(/\r?\n/).filter((line) => line.trim());
57
- if (rows.length < 2) return match;
58
- const isSeparatorRow = /^\|[\s\-:|]+\|$/.test(rows[1].trim());
59
- if (!isSeparatorRow) return match;
60
- const parseCells = (row) => row.split("|").slice(1, -1).map((cell) => cell.trim());
61
- const headerCells = parseCells(rows[0]).map((cell) => `<th class="px-3 py-2 text-left font-medium text-xs uppercase tracking-wide border-b border-border">${cell}</th>`).join("");
62
- const bodyRows = rows.slice(2).map(
63
- (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>`
64
- ).join("");
65
- 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>`;
66
- });
67
- html = html.replace(/\n\n/g, '</p><p class="mb-2 break-words">');
68
- html = html.replace(/\n/g, "<br/>");
69
- html = '<p class="mb-2 break-words">' + html + "</p>";
70
- html = html.replace(/<p[^>]*>\s*<\/p>/g, "");
71
- return html;
72
- };
73
- const htmlContent = convertMarkdownToHtml(content);
74
- return /* @__PURE__ */ jsxRuntime.jsx(
75
- "div",
76
- {
77
- className: `text-sm leading-relaxed break-words overflow-wrap-anywhere max-w-full ${className}`,
78
- dangerouslySetInnerHTML: { __html: htmlContent }
79
- }
80
- );
81
- }
82
- function FormattedDocument({ content, maxPreviewLength = 500, className = "" }) {
83
- const [isExpanded, setIsExpanded] = React.useState(false);
84
- const convertMarkdownToHtml = (markdown) => {
85
- let html = markdown;
86
- html = html.replace(/^### (.*$)/gim, '<h3 class="text-base font-medium mt-2 mb-1 text-foreground">$1</h3>');
87
- html = html.replace(/^## (.*$)/gim, '<h2 class="text-lg font-medium mt-2 mb-1 text-foreground">$1</h2>');
88
- html = html.replace(/^# (.*$)/gim, '<h1 class="text-xl font-medium mt-3 mb-2 text-foreground">$1</h1>');
89
- html = html.replace(/\*\*(.*?)\*\*/g, '<strong class="font-medium text-foreground">$1</strong>');
90
- html = html.replace(/\*(.*?)\*/g, '<em class="italic">$1</em>');
91
- html = html.replace(/^[-*+] \[ \] (.*$)/gim, '<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>');
92
- html = html.replace(/^[-*+] \[x\] (.*$)/gim, '<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>');
93
- html = html.replace(/((?:^[-*+] .*$(?:\n|$))+)/gim, (match) => {
94
- const items = match.trim().split("\n").map(
95
- (item) => `<li class="ml-6 my-0.5 list-disc">${item.replace(/^[-*+] /i, "")}</li>`
96
- ).join("");
97
- return `<ul class="list-disc my-2">${items}</ul>`;
98
- });
99
- html = html.replace(/((?:^\d+\. .*$(?:\n|$))+)/gim, (match) => {
100
- const items = match.trim().split("\n").map(
101
- (item) => `<li class="ml-6 my-0.5 list-decimal">${item.replace(/^\d+\. /i, "")}</li>`
102
- ).join("");
103
- return `<ol class="list-decimal my-2">${items}</ol>`;
104
- });
105
- html = html.replace(/^---$/gim, '<hr class="my-2 border-border" />');
106
- html = html.replace(/\n\n+/g, '</p><p class="my-0.5">');
107
- html = html.replace(/\n/g, " ");
108
- html = '<p class="my-0.5">' + html + "</p>";
109
- return html;
110
- };
111
- const htmlContent = convertMarkdownToHtml(content);
112
- const isLong = content.length > maxPreviewLength;
113
- const displayContent = !isLong || isExpanded ? htmlContent : convertMarkdownToHtml(content.substring(0, maxPreviewLength) + "...");
114
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
115
- /* @__PURE__ */ jsxRuntime.jsx(
116
- "div",
117
- {
118
- className: "max-w-none text-sm text-foreground leading-relaxed break-words overflow-hidden",
119
- dangerouslySetInnerHTML: { __html: displayContent }
120
- }
121
- ),
122
- isLong && /* @__PURE__ */ jsxRuntime.jsx(
123
- button.Button,
124
- {
125
- variant: "ghost",
126
- size: "sm",
127
- onClick: () => setIsExpanded(!isExpanded),
128
- className: "mt-2 w-full text-xs hover:bg-accent text-muted-foreground",
129
- children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
130
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "w-3 h-3 mr-1" }),
131
- "See less"
132
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
133
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 mr-1" }),
134
- "See more"
135
- ] })
136
- }
137
- )
138
- ] });
139
- }
140
- function ModernChatInput({
141
- value,
142
- onChange,
143
- onSubmit,
144
- placeholder = "Mande uma mensagem para o Xertica",
145
- disabled = false,
146
- onFileUpload,
147
- onAudioUpload,
148
- onVoiceRecording,
149
- isFullPage = false,
150
- enableAudioInput = true,
151
- enableFileAttachment = true,
152
- enableDocumentCreation = true,
153
- enablePodcastGeneration = true,
154
- enableSearch = true
155
- }) {
156
- const textareaRef = React.useRef(null);
157
- const [isFocused, setIsFocused] = React.useState(false);
158
- const [textareaHeight, setTextareaHeight] = React.useState(20);
159
- const [selectedAction, setSelectedAction] = React.useState(null);
160
- const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);
161
- const [isRecording, setIsRecording] = React.useState(false);
162
- const [recordingTime, setRecordingTime] = React.useState(0);
163
- const recordingIntervalRef = React.useRef(null);
164
- const adjustHeight = () => {
165
- const textarea = textareaRef.current;
166
- if (textarea) {
167
- textarea.style.height = "20px";
168
- const scrollHeight = textarea.scrollHeight;
169
- const newHeight = Math.min(Math.max(scrollHeight, 20), 100);
170
- setTextareaHeight(newHeight);
171
- textarea.style.height = newHeight + "px";
172
- }
173
- };
174
- React.useEffect(() => {
175
- const textarea = textareaRef.current;
176
- if (textarea) {
177
- textarea.style.height = "20px";
178
- setTextareaHeight(20);
179
- if (value) {
180
- setTimeout(adjustHeight, 0);
181
- }
182
- }
183
- }, []);
184
- React.useEffect(() => {
185
- if (value === "") {
186
- const textarea = textareaRef.current;
187
- if (textarea) {
188
- textarea.style.height = "20px";
189
- setTextareaHeight(20);
190
- }
191
- } else {
192
- const timeoutId = setTimeout(adjustHeight, 0);
193
- return () => clearTimeout(timeoutId);
194
- }
195
- }, [value]);
196
- const handleKeyDown = (e) => {
197
- if (e.key === "Enter" && !e.shiftKey) {
198
- e.preventDefault();
199
- if (value.trim() && !disabled) {
200
- onSubmit(selectedAction);
201
- setSelectedAction(null);
202
- }
203
- }
204
- };
205
- const handleActionSelect = (action) => {
206
- setSelectedAction(action);
207
- setIsPopoverOpen(false);
208
- };
209
- const handleRemoveAction = () => {
210
- setSelectedAction(null);
211
- };
212
- const handleVoiceRecording = () => {
213
- if (isRecording) {
214
- if (recordingIntervalRef.current) {
215
- clearInterval(recordingIntervalRef.current);
216
- recordingIntervalRef.current = null;
217
- }
218
- const transcricoes = [
219
- "Como posso analisar os dados de vendas do último trimestre?",
220
- "Me ajude a criar um relatório de performance do time",
221
- "Quais são as principais tendências do mercado atual?",
222
- "Preciso de insights sobre a satisfação dos clientes",
223
- "Como posso melhorar a produtividade da minha equipe?",
224
- "Me mostre um resumo das métricas mais importantes",
225
- "Crie um documento sobre técnicas de marketing digital",
226
- "Analise os dados de engajamento das redes sociais"
227
- ];
228
- const transcricaoAleatoria = transcricoes[Math.floor(Math.random() * transcricoes.length)];
229
- if (onVoiceRecording) {
230
- onVoiceRecording(transcricaoAleatoria);
231
- }
232
- setIsRecording(false);
233
- setRecordingTime(0);
234
- } else {
235
- setIsRecording(true);
236
- setRecordingTime(0);
237
- sonner.toast.info("Gravação iniciada", {
238
- description: "Fale sua dúvida ou comando. A gravação parará automaticamente em 60s.",
239
- duration: 3e3
240
- });
241
- recordingIntervalRef.current = setInterval(() => {
242
- setRecordingTime((prev) => prev + 1);
243
- }, 1e3);
244
- }
245
- };
246
- React.useEffect(() => {
247
- if (recordingTime >= 60 && isRecording) {
248
- handleVoiceRecording();
249
- }
250
- }, [recordingTime, isRecording]);
251
- React.useEffect(() => {
252
- return () => {
253
- if (recordingIntervalRef.current) {
254
- clearInterval(recordingIntervalRef.current);
255
- }
256
- };
257
- }, []);
258
- const getActionInfo = (action) => {
259
- switch (action) {
260
- case "document":
261
- return { label: "Criar documento", icon: lucideReact.FileText, color: "bg-[var(--chart-4)]" };
262
- case "podcast":
263
- return { label: "Gerar podcast", icon: lucideReact.Radio, color: "bg-[var(--chart-1)]" };
264
- case "search":
265
- return { label: "Pesquisar", icon: lucideReact.Search, color: "bg-[var(--chart-2)]" };
266
- default:
267
- return null;
268
- }
269
- };
270
- const handleFocus = () => setIsFocused(true);
271
- const handleBlur = () => setIsFocused(false);
272
- const hasContent = value.trim().length > 0;
273
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `p-4 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`, children: [
274
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isRecording && /* @__PURE__ */ jsxRuntime.jsx(
275
- framerMotion.motion.div,
276
- {
277
- initial: { opacity: 0, y: 10 },
278
- animate: { opacity: 1, y: 0 },
279
- exit: { opacity: 0, y: 10 },
280
- className: "mb-3 p-4 bg-destructive/10 border border-destructive/30 rounded-[var(--radius-card)]",
281
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
282
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
283
- /* @__PURE__ */ jsxRuntime.jsx(
284
- framerMotion.motion.div,
285
- {
286
- animate: {
287
- scale: [1, 1.2, 1],
288
- opacity: [1, 0.7, 1]
289
- },
290
- transition: {
291
- duration: 1.5,
292
- repeat: Infinity,
293
- ease: "easeInOut"
294
- },
295
- className: "w-3 h-3 bg-destructive rounded-full"
296
- }
297
- ),
298
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
299
- framerMotion.motion.div,
300
- {
301
- animate: {
302
- height: ["8px", "20px", "8px"]
303
- },
304
- transition: {
305
- duration: 0.8,
306
- repeat: Infinity,
307
- ease: "easeInOut",
308
- delay: i * 0.1
309
- },
310
- className: "w-1 bg-destructive rounded-full h-2"
311
- },
312
- i
313
- )) }),
314
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-destructive", children: "Gravando áudio" })
315
- ] }),
316
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
317
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-destructive font-mono tabular-nums", children: [
318
- Math.floor(recordingTime / 60),
319
- ":",
320
- (recordingTime % 60).toString().padStart(2, "0")
321
- ] }),
322
- /* @__PURE__ */ jsxRuntime.jsx(
323
- button.Button,
324
- {
325
- onClick: handleVoiceRecording,
326
- size: "sm",
327
- variant: "outline",
328
- className: "h-7 px-3 text-xs border-destructive/30 text-destructive hover:bg-destructive/10 rounded-[var(--radius-button)]",
329
- children: "Parar gravação"
330
- }
331
- )
332
- ] })
333
- ] })
334
- }
335
- ) }),
336
- /* @__PURE__ */ jsxRuntime.jsxs(
337
- framerMotion.motion.div,
338
- {
339
- 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"}`,
340
- initial: false,
341
- animate: {
342
- scale: isFocused ? 1.01 : 1
343
- },
344
- transition: { duration: 0.2, ease: "easeOut" },
345
- children: [
346
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 pt-[14px] pr-[10px] pb-[8px] pl-[10px] rounded-[var(--radius)]", children: [
347
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: selectedAction && /* @__PURE__ */ jsxRuntime.jsx(
348
- framerMotion.motion.div,
349
- {
350
- initial: { opacity: 0, y: -10, height: 0 },
351
- animate: { opacity: 1, y: 0, height: "auto" },
352
- exit: { opacity: 0, y: -10, height: 0 },
353
- transition: { duration: 0.2 },
354
- className: "mb-2",
355
- children: (() => {
356
- const actionInfo = getActionInfo(selectedAction);
357
- if (!actionInfo) return null;
358
- const Icon = actionInfo.icon;
359
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `inline-flex items-center gap-2 px-3 py-1.5 rounded-full ${actionInfo.color} text-white text-xs font-medium shadow-sm`, children: [
360
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-3.5 h-3.5" }),
361
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: actionInfo.label }),
362
- /* @__PURE__ */ jsxRuntime.jsx(
363
- "button",
364
- {
365
- onClick: handleRemoveAction,
366
- className: "ml-1 hover:bg-white/20 rounded-full p-0.5 transition-colors",
367
- "aria-label": "Remover ação",
368
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
369
- }
370
- )
371
- ] });
372
- })()
373
- }
374
- ) }),
375
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntime.jsx(
376
- "textarea",
377
- {
378
- ref: textareaRef,
379
- value,
380
- onChange: (e) => onChange(e.target.value),
381
- onKeyDown: handleKeyDown,
382
- onFocus: handleFocus,
383
- onBlur: handleBlur,
384
- placeholder,
385
- "aria-label": placeholder || "Mensagem para o Xertica",
386
- disabled,
387
- 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",
388
- style: {
389
- height: `${textareaHeight}px`,
390
- minHeight: "20px",
391
- maxHeight: "100px"
392
- },
393
- rows: 1
394
- }
395
- ) }),
396
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
397
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
398
- (enableDocumentCreation || enablePodcastGeneration || enableSearch) && /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
399
- /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
400
- button.Button,
401
- {
402
- variant: "ghost",
403
- size: "sm",
404
- className: "h-8 w-8 p-0 rounded-full text-muted-foreground hover:bg-accent hover:text-foreground transition-all duration-200",
405
- "aria-label": "Ver ações",
406
- children: /* @__PURE__ */ jsxRuntime.jsx(
407
- framerMotion.motion.div,
408
- {
409
- whileHover: { scale: 1.05 },
410
- whileTap: { scale: 0.95 },
411
- className: "flex items-center justify-center w-full h-full",
412
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "w-4 h-4" })
413
- }
414
- )
415
- }
416
- ) }),
417
- /* @__PURE__ */ jsxRuntime.jsx(
418
- input.PopoverContent,
419
- {
420
- className: "w-56 p-2",
421
- align: "start",
422
- side: "top",
423
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
424
- enableDocumentCreation && /* @__PURE__ */ jsxRuntime.jsxs(
425
- "button",
426
- {
427
- onClick: () => handleActionSelect("document"),
428
- className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
429
- children: [
430
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-4 h-4 text-[var(--chart-4)] group-hover:text-white" }) }),
431
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
432
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Criar documento" }),
433
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: "Gere um documento completo" })
434
- ] })
435
- ]
436
- }
437
- ),
438
- enablePodcastGeneration && /* @__PURE__ */ jsxRuntime.jsxs(
439
- "button",
440
- {
441
- onClick: () => handleActionSelect("podcast"),
442
- className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
443
- children: [
444
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(lucideReact.Radio, { className: "w-4 h-4 text-[var(--chart-1)] group-hover:text-white" }) }),
445
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
446
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Gerar podcast" }),
447
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: "Crie um podcast de áudio" })
448
- ] })
449
- ]
450
- }
451
- ),
452
- enableSearch && /* @__PURE__ */ jsxRuntime.jsxs(
453
- "button",
454
- {
455
- onClick: () => handleActionSelect("search"),
456
- className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group",
457
- children: [
458
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4 text-[var(--chart-2)] group-hover:text-white" }) }),
459
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
460
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Pesquisar" }),
461
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: "Busque por informações relevantes" })
462
- ] })
463
- ]
464
- }
465
- )
466
- ] })
467
- }
468
- )
469
- ] }),
470
- enableFileAttachment && /* @__PURE__ */ jsxRuntime.jsx(
471
- framerMotion.motion.div,
472
- {
473
- whileHover: { scale: 1.05 },
474
- whileTap: { scale: 0.95 },
475
- children: /* @__PURE__ */ jsxRuntime.jsx(
476
- button.Button,
477
- {
478
- variant: "ghost",
479
- size: "sm",
480
- onClick: onFileUpload,
481
- className: "h-8 w-8 p-0 rounded-full text-muted-foreground hover:bg-accent hover:text-foreground transition-all duration-200",
482
- "aria-label": "Anexar arquivo",
483
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { className: "w-4 h-4" })
484
- }
485
- )
486
- }
487
- )
488
- ] }),
489
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
490
- enableAudioInput && /* @__PURE__ */ jsxRuntime.jsx(
491
- framerMotion.motion.div,
492
- {
493
- whileHover: { scale: 1.05 },
494
- whileTap: { scale: 0.95 },
495
- children: /* @__PURE__ */ jsxRuntime.jsx(
496
- button.Button,
497
- {
498
- variant: "ghost",
499
- size: "sm",
500
- onClick: handleVoiceRecording,
501
- 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"}`,
502
- "aria-label": isRecording ? "Parar gravação" : "Sugerir com voz",
503
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mic, { className: "w-4 h-4" })
504
- }
505
- )
506
- }
507
- ),
508
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsx(
509
- framerMotion.motion.div,
510
- {
511
- initial: { scale: 0.8, opacity: 0 },
512
- animate: { scale: 1, opacity: 1 },
513
- exit: { scale: 0.8, opacity: 0 },
514
- transition: { duration: 0.2, ease: "easeInOut" },
515
- whileHover: hasContent ? { scale: 1.05 } : {},
516
- whileTap: hasContent ? { scale: 0.95 } : {},
517
- children: /* @__PURE__ */ jsxRuntime.jsx(
518
- button.Button,
519
- {
520
- onClick: () => {
521
- onSubmit(selectedAction);
522
- setSelectedAction(null);
523
- },
524
- size: "sm",
525
- disabled: !hasContent || disabled,
526
- 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"}`,
527
- "aria-label": "Enviar mensagem",
528
- children: /* @__PURE__ */ jsxRuntime.jsx(
529
- framerMotion.motion.div,
530
- {
531
- animate: {
532
- rotate: hasContent ? 0 : -45
533
- },
534
- transition: { duration: 0.2 },
535
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "w-4 h-4" })
536
- }
537
- )
538
- }
539
- )
540
- },
541
- hasContent ? "active" : "inactive"
542
- ) })
543
- ] })
544
- ] })
545
- ] }),
546
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isFocused && /* @__PURE__ */ jsxRuntime.jsx(
547
- framerMotion.motion.div,
548
- {
549
- className: "absolute inset-0 rounded-[var(--radius)] bg-gradient-to-r from-primary/5 via-transparent to-primary/5 pointer-events-none",
550
- initial: { opacity: 0 },
551
- animate: { opacity: 1 },
552
- exit: { opacity: 0 },
553
- transition: { duration: 0.3 }
554
- }
555
- ) })
556
- ]
557
- }
558
- ),
559
- /* @__PURE__ */ jsxRuntime.jsx(
560
- framerMotion.motion.div,
561
- {
562
- className: "mt-2 text-center",
563
- initial: { opacity: 0, y: 5 },
564
- animate: { opacity: 1, y: 0 },
565
- transition: { delay: 0.1 },
566
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "O assistente Xertica pode cometer erros. Considere verificar informações importantes." })
567
- }
568
- )
569
- ] });
570
- }
571
- [
572
- { id: "rich-1", text: "Ver exemplo de Gráfico", icon: React.createElement(lucideReact.BarChart3, { className: "w-4 h-4 mr-2" }) },
573
- { id: "rich-2", text: "Ver exemplo de Imagem", icon: React.createElement(lucideReact.ImageIcon, { className: "w-4 h-4 mr-2" }) },
574
- { id: "rich-3", text: "Ver exemplo de Tabela", icon: React.createElement(lucideReact.Table, { className: "w-4 h-4 mr-2" }) },
575
- { id: "rich-4", text: "Ver exemplo de Documento", icon: React.createElement(lucideReact.FileText, { className: "w-4 h-4 mr-2" }) }
576
- ];
577
- const gerarResposta = (mensagemUsuario, customResponses) => {
578
- const mensagemLower = mensagemUsuario.toLowerCase();
579
- if (customResponses && customResponses.length > 0) {
580
- for (const mock of customResponses) {
581
- const trigger = mock.trigger;
582
- let match = false;
583
- if (trigger instanceof RegExp) {
584
- match = trigger.test(mensagemUsuario);
585
- } else {
586
- match = mensagemLower.includes(trigger.toLowerCase());
587
- }
588
- if (match) {
589
- return mock.response;
590
- }
591
- }
592
- }
593
- const mensagemOriginal = mensagemUsuario;
594
- if (mensagemLower.includes("o que") && (mensagemLower.includes("fazer") || mensagemLower.includes("pedir"))) {
595
- 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?";
596
- }
597
- if (mensagemLower.includes("o que você faz") || mensagemLower.includes("quem é você")) {
598
- 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.";
599
- }
600
- if (mensagemLower.includes("projeto") && (mensagemLower.includes("preocupar") || mensagemLower.includes("atenção"))) {
601
- 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?";
602
- }
603
- if (mensagemLower.includes("próximo projeto") || mensagemLower.includes("próxima tarefa")) {
604
- 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?";
605
- }
606
- if (mensagemLower.includes("desempenho") || mensagemLower.includes("performance") || mensagemLower.includes("melhor")) {
607
- 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?";
608
- }
609
- if (mensagemLower.includes("olá") || mensagemLower.includes("oi") || mensagemLower.includes("bom dia") || mensagemLower.includes("boa tarde") || mensagemLower.includes("boa noite")) {
610
- return "Olá! 👋 Como posso ajudar você hoje? Estou pronto para auxiliar com análises, relatórios ou responder suas dúvidas sobre os projetos.";
611
- }
612
- if (mensagemLower.includes("obrigado") || mensagemLower.includes("obrigada")) {
613
- return "Por nada! Estou aqui sempre que precisar. 😊 Se tiver mais alguma dúvida ou precisar de ajuda, é só chamar!";
614
- }
615
- if (mensagemLower.includes("criar documento")) {
616
- const tema = mensagemOriginal.replace(/📄 \[Criar documento\]/gi, "").trim() || "Novo Documento";
617
- return {
618
- content: `📝 Documento criado com sucesso!
619
-
620
- Gerei um documento completo sobre "${tema}". O documento está pronto para revisão e pode ser editado conforme necessário.`,
621
- attachmentType: "document",
622
- attachmentName: `Documento - ${tema}.md`,
623
- documentTitle: tema,
624
- documentContent: `# ${tema}
625
-
626
- ## Introdução
627
- Este é um documento gerado automaticamente sobre ${tema}.
628
-
629
- ## Detalhes
630
- - Item 1
631
- - Item 2
632
-
633
- ## Conclusão
634
- Documento finalizado.`
635
- };
636
- }
637
- if (mensagemLower.includes("gráfico") || mensagemLower.includes("chart")) {
638
- return {
639
- content: "Aqui está a análise de performance solicitada:",
640
- chartData: [
641
- { month: "Jan", desktop: 186, mobile: 80 },
642
- { month: "Fev", desktop: 305, mobile: 200 },
643
- { month: "Mar", desktop: 237, mobile: 120 },
644
- { month: "Abr", desktop: 73, mobile: 190 },
645
- { month: "Mai", desktop: 209, mobile: 130 },
646
- { month: "Jun", desktop: 214, mobile: 140 }
647
- ],
648
- chartConfig: {
649
- desktop: { label: "Desktop", color: "hsl(var(--primary))" },
650
- mobile: { label: "Mobile", color: "hsl(var(--destructive))" }
651
- }
652
- };
653
- }
654
- if (mensagemLower.includes("tabela") || mensagemLower.includes("table")) {
655
- return {
656
- content: "Aqui estão os dados estruturados conforme solicitado:",
657
- tableData: {
658
- caption: "Lista de Projetos Ativos",
659
- headers: ["Projeto", "Status", "Prazo"],
660
- rows: [
661
- ["Alpha", "Em andamento", "15/05"],
662
- ["Beta", "Concluido", "02/04"],
663
- ["Gamma", "Atrasado", "10/01"]
664
- ]
665
- }
666
- };
667
- }
668
- if (mensagemLower.includes("exemplo de documento")) {
669
- return {
670
- content: "Com certeza! Aqui está um exemplo de documento profissional que acabei de gerar:",
671
- attachmentType: "document",
672
- attachmentName: "Proposta_Comercial_Xertica.md",
673
- documentTitle: "Proposta Comercial Xertica",
674
- 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."
675
- };
676
- }
677
- if (mensagemLower.includes("arquivo") || mensagemLower.includes("documento")) {
678
- 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ê!";
679
- }
680
- const respostasGenericas = [
681
- "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?",
682
- "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?",
683
- "Ó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?",
684
- "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?"
685
- ];
686
- return respostasGenericas[Math.floor(Math.random() * respostasGenericas.length)];
687
- };
688
- function AssistantTooltipContent({
689
- className,
690
- sideOffset = 0,
691
- children,
692
- ...props
693
- }) {
694
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
695
- TooltipPrimitive__namespace.Content,
696
- {
697
- "data-slot": "tooltip-content",
698
- sideOffset,
699
- className: button.cn(
700
- "bg-popover text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
701
- className
702
- ),
703
- ...props,
704
- children: [
705
- children,
706
- /* @__PURE__ */ jsxRuntime.jsx(
707
- TooltipPrimitive__namespace.Arrow,
708
- {
709
- className: "fill-popover z-50 drop-shadow-sm",
710
- width: 8,
711
- height: 4
712
- }
713
- )
714
- ]
715
- }
716
- ) });
717
- }
718
- function XerticaAssistant({
719
- mode = "expanded",
720
- isExpanded: controlledIsExpanded,
721
- onToggle,
722
- defaultTab = "chat",
723
- demoMode = true,
724
- onNavigateSettings,
725
- onNavigateFullPage,
726
- userName = "Usuário",
727
- initialMessages = [],
728
- savedConversations = [],
729
- suggestions: propSuggestions,
730
- onSendMessage,
731
- onFileAttach,
732
- isProcessing = false,
733
- width,
734
- height,
735
- className = "",
736
- mobileFloating = false,
737
- customResponses = [],
738
- responseGenerator,
739
- richSuggestions = [],
740
- onRichAction,
741
- onEvaluation,
742
- feedbackOptions,
743
- // Feature flags — all default to true for backward compatibility
744
- showHistory = true,
745
- showFavorites = true,
746
- enableAudioInput = true,
747
- enableFileAttachment = true,
748
- enableDocumentCreation = true,
749
- enablePodcastGeneration = true,
750
- enableSearch = true
751
- }) {
752
- const isFullPage = mode === "fullPage";
753
- const [internalIsExpanded, setInternalIsExpanded] = React.useState(controlledIsExpanded ?? true);
754
- const isExpanded = controlledIsExpanded ?? internalIsExpanded;
755
- const [isMobile, setIsMobile] = React.useState(false);
756
- React.useEffect(() => {
757
- const handleResize = () => setIsMobile(window.innerWidth < 768);
758
- handleResize();
759
- window.addEventListener("resize", handleResize);
760
- return () => window.removeEventListener("resize", handleResize);
761
- }, []);
762
- const [abaSelecionada, setAbaSelecionada] = React.useState(defaultTab);
763
- const [mensagens, setMensagens] = React.useState(initialMessages);
764
- const [mensagem, setMensagem] = React.useState("");
765
- const [conversas, setConversas] = React.useState(savedConversations);
766
- const [conversaAtual, setConversaAtual] = React.useState(null);
767
- const [copiedId, setCopiedId] = React.useState(null);
768
- const [generatingPodcastId, setGeneratingPodcastId] = React.useState(null);
769
- const [executingCommand, setExecutingCommand] = React.useState(null);
770
- const [savedSearches, setSavedSearches] = React.useState([]);
771
- const [editingDocument, setEditingDocument] = React.useState(null);
772
- const [showMoreSuggestions, setShowMoreSuggestions] = React.useState(false);
773
- const [evaluationState, setEvaluationState] = React.useState({
774
- isOpen: false,
775
- messageId: null,
776
- type: null,
777
- category: null,
778
- reason: ""
779
- });
780
- const messagesEndRef = React.useRef(null);
781
- const fileInputRef = React.useRef(null);
782
- const audioInputRef = React.useRef(null);
783
- const defaultSuggestions = [
784
- { id: "1", text: "Me ajude a criar um documento profissional" },
785
- { id: "2", text: 'Buscar nos meus arquivos por "relatório"' },
786
- { id: "3", text: "Resuma as conversas importantes desta semana" },
787
- { id: "4", text: "Crie um podcast sobre o último projeto" }
788
- ];
789
- const sugestoes = propSuggestions ?? defaultSuggestions;
790
- React.useEffect(() => {
791
- if (messagesEndRef.current && abaSelecionada === "chat") {
792
- messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
793
- }
794
- }, [mensagens, abaSelecionada]);
795
- React.useEffect(() => {
796
- if (initialMessages && initialMessages.length > 0) {
797
- setMensagens(initialMessages);
798
- }
799
- }, [initialMessages]);
800
- const handleToggle = () => {
801
- if (onToggle) {
802
- onToggle();
803
- } else {
804
- setInternalIsExpanded(!internalIsExpanded);
805
- }
806
- };
807
- const handleExpandWithTab = (tab) => {
808
- setAbaSelecionada(tab);
809
- if (onToggle) {
810
- onToggle();
811
- } else {
812
- setInternalIsExpanded(true);
813
- }
814
- };
815
- const handleEnviarMensagem = async (arg) => {
816
- let msgToSend = mensagem;
817
- if (typeof arg === "string" && !["document", "podcast", "search"].includes(arg)) {
818
- msgToSend = arg;
819
- }
820
- if (!msgToSend.trim() || isProcessing) return;
821
- const novaMensagem = {
822
- id: `msg-${Date.now()}`,
823
- type: "user",
824
- content: msgToSend,
825
- timestamp: /* @__PURE__ */ new Date(),
826
- isFavorite: false
827
- };
828
- setMensagens((prev) => [...prev, novaMensagem]);
829
- if (onSendMessage) {
830
- onSendMessage(msgToSend);
831
- }
832
- if (demoMode || responseGenerator) {
833
- const mensagemAtual = msgToSend;
834
- setTimeout(async () => {
835
- let resposta;
836
- if (responseGenerator) {
837
- resposta = await responseGenerator(mensagemAtual);
838
- } else {
839
- resposta = gerarResposta(mensagemAtual, customResponses);
840
- }
841
- let novaMensagemIA = {
842
- id: `msg-${Date.now()}-ia`,
843
- type: "assistant",
844
- content: "",
845
- timestamp: /* @__PURE__ */ new Date(),
846
- isFavorite: false
847
- };
848
- if (typeof resposta === "string") {
849
- novaMensagemIA.content = resposta;
850
- } else {
851
- novaMensagemIA = { ...novaMensagemIA, ...resposta };
852
- }
853
- setMensagens((prev) => [...prev, novaMensagemIA]);
854
- }, 1e3 + Math.random() * 1e3);
855
- }
856
- setMensagem("");
857
- };
858
- const handleCopyMessage = async (content, messageId) => {
859
- try {
860
- if (navigator.clipboard && navigator.clipboard.writeText) {
861
- try {
862
- await navigator.clipboard.writeText(content);
863
- setCopiedId(messageId);
864
- setTimeout(() => setCopiedId(null), 2e3);
865
- } catch (clipboardError) {
866
- if (clipboardError.name === "NotAllowedError" || clipboardError.message.includes("permissions policy")) {
867
- throw new Error("Clipboard permission denied, falling back");
868
- }
869
- throw clipboardError;
870
- }
871
- } else {
872
- throw new Error("Clipboard API not available");
873
- }
874
- } catch (err) {
875
- try {
876
- const textArea = document.createElement("textarea");
877
- textArea.value = content;
878
- textArea.style.position = "fixed";
879
- textArea.style.left = "-999999px";
880
- textArea.style.top = "-999999px";
881
- document.body.appendChild(textArea);
882
- textArea.focus();
883
- textArea.select();
884
- const successful = document.execCommand("copy");
885
- document.body.removeChild(textArea);
886
- if (successful) {
887
- setCopiedId(messageId);
888
- setTimeout(() => setCopiedId(null), 2e3);
889
- } else {
890
- console.error("Falha ao copiar: execCommand returned false");
891
- }
892
- } catch (fallbackErr) {
893
- console.error("Falha ao copiar:", fallbackErr);
894
- }
895
- }
896
- };
897
- const handleGeneratePodcast = async (messageId, content) => {
898
- setGeneratingPodcastId(messageId);
899
- setTimeout(() => {
900
- setMensagens(
901
- (prev) => prev.map(
902
- (msg) => msg.id === messageId ? {
903
- ...msg,
904
- attachmentType: "podcast",
905
- attachmentName: "Podcast - " + content.substring(0, 30) + "...",
906
- audioUrl: "data:audio/mpeg;base64,//uQx..."
907
- // Mock
908
- } : msg
909
- )
910
- );
911
- setGeneratingPodcastId(null);
912
- }, 2e3);
913
- };
914
- const handleDownloadDocument = (content, fileName) => {
915
- const blob = new Blob([content], { type: "text/markdown" });
916
- const url = URL.createObjectURL(blob);
917
- const a = document.createElement("a");
918
- a.href = url;
919
- a.download = fileName.endsWith(".md") ? fileName : fileName + ".md";
920
- document.body.appendChild(a);
921
- a.click();
922
- document.body.removeChild(a);
923
- URL.revokeObjectURL(url);
924
- };
925
- const handleDownloadPodcast = (audioUrl, fileName) => {
926
- const a = document.createElement("a");
927
- a.href = audioUrl;
928
- a.download = fileName.endsWith(".mp3") ? fileName : fileName + ".mp3";
929
- document.body.appendChild(a);
930
- a.click();
931
- document.body.removeChild(a);
932
- };
933
- const handleEditDocument = (content, title) => {
934
- setEditingDocument({ content, title });
935
- };
936
- const handleNovaConversa = () => {
937
- setMensagens([]);
938
- setConversaAtual(null);
939
- setAbaSelecionada("chat");
940
- };
941
- const handleSelecionarConversa = (conversaId) => {
942
- const conversa = conversas.find((c) => c.id === conversaId);
943
- if (conversa) {
944
- setMensagens(conversa.messages);
945
- setConversaAtual(conversaId);
946
- setAbaSelecionada("chat");
947
- }
948
- };
949
- const handleToggleFavoritaConversa = (conversaId) => {
950
- setConversas(
951
- (prev) => prev.map(
952
- (conv) => conv.id === conversaId ? { ...conv, isFavorite: !conv.isFavorite } : conv
953
- )
954
- );
955
- };
956
- const handleOpenSearchResult = (result) => {
957
- console.log("Abrir resultado:", result);
958
- };
959
- const handleExecuteSearchCommand = async (commandId, searchTerm, results, messageId) => {
960
- setExecutingCommand(commandId);
961
- setTimeout(() => {
962
- if (commandId === "5") {
963
- setSavedSearches((prev) => [...prev, messageId]);
964
- }
965
- setExecutingCommand(null);
966
- }, 1500);
967
- };
968
- const handleRichSuggestionClick = (suggestion) => {
969
- if (onRichAction) {
970
- onRichAction(suggestion.id, suggestion.text);
971
- } else {
972
- handleEnviarMensagem(suggestion.text);
973
- }
974
- setShowMoreSuggestions(false);
975
- };
976
- const handleEvaluationClick = (messageId, type) => {
977
- {
978
- if (onEvaluation) onEvaluation(messageId, "like");
979
- setMensagens((prev) => prev.map((m) => m.id === messageId ? { ...m, evaluation: "like" } : m));
980
- sonner.toast.success("Obrigado por avaliar positivamente!");
981
- }
982
- };
983
- const openFeedbackDialog = (messageId, category) => {
984
- setEvaluationState({
985
- isOpen: true,
986
- messageId,
987
- type: "dislike",
988
- category,
989
- reason: ""
990
- });
991
- };
992
- const handleSubmitDislike = () => {
993
- if (evaluationState.messageId) {
994
- const finalReason = evaluationState.category ? evaluationState.reason ? `${evaluationState.category}: ${evaluationState.reason}` : evaluationState.category : evaluationState.reason;
995
- if (onEvaluation) {
996
- onEvaluation(evaluationState.messageId, "dislike", finalReason);
997
- }
998
- setMensagens((prev) => prev.map((m) => m.id === evaluationState.messageId ? { ...m, evaluation: "dislike", evaluationReason: finalReason } : m));
999
- sonner.toast.success("Obrigado pelo seu feedback. Vamos melhorar.");
1000
- }
1001
- setEvaluationState({ isOpen: false, messageId: null, type: null, category: null, reason: "" });
1002
- };
1003
- const conversasFiltradas = conversas.filter((conversa) => {
1004
- if (abaSelecionada === "favoritos") {
1005
- return conversa.isFavorite;
1006
- }
1007
- return true;
1008
- });
1009
- const containerWidth = width ?? (isFullPage ? "100%" : isExpanded ? editingDocument ? "420px" : "420px" : "80px");
1010
- const containerHeight = height ?? "h-full";
1011
- if (isMobile && !isExpanded) {
1012
- return /* @__PURE__ */ jsxRuntime.jsxs(
1013
- button.Button,
1014
- {
1015
- onClick: handleToggle,
1016
- className: button.cn(
1017
- "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",
1018
- className
1019
- ),
1020
- children: [
1021
- /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 32 }),
1022
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-base tracking-wide", children: "Assistente" })
1023
- ]
1024
- }
1025
- );
1026
- }
1027
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1028
- /* @__PURE__ */ jsxRuntime.jsx(
1029
- "input",
1030
- {
1031
- ref: fileInputRef,
1032
- type: "file",
1033
- accept: ".pdf,.doc,.docx,.txt,.md",
1034
- className: "hidden",
1035
- onChange: (e) => {
1036
- var _a;
1037
- const file = (_a = e.target.files) == null ? void 0 : _a[0];
1038
- if (file && onFileAttach) {
1039
- onFileAttach(file);
1040
- }
1041
- },
1042
- "aria-label": "Upload de documento"
1043
- }
1044
- ),
1045
- /* @__PURE__ */ jsxRuntime.jsx(
1046
- "input",
1047
- {
1048
- ref: audioInputRef,
1049
- type: "file",
1050
- accept: "audio/*",
1051
- className: "hidden",
1052
- onChange: (e) => {
1053
- var _a;
1054
- const file = (_a = e.target.files) == null ? void 0 : _a[0];
1055
- if (file && onFileAttach) {
1056
- onFileAttach(file);
1057
- }
1058
- },
1059
- "aria-label": "Upload de áudio"
1060
- }
1061
- ),
1062
- /* @__PURE__ */ jsxRuntime.jsxs(
1063
- "div",
1064
- {
1065
- className: button.cn(
1066
- `${containerHeight} flex flex-col bg-background relative`,
1067
- !isFullPage && "border-l border-border shadow-sm",
1068
- isMobile && isExpanded && "fixed inset-0 z-[100] h-[100dvh] w-full border-l-0 shadow-2xl",
1069
- className
1070
- ),
1071
- style: !(isMobile && isExpanded) ? {
1072
- width: isFullPage ? "100%" : containerWidth
1073
- } : void 0,
1074
- children: [
1075
- editingDocument && !isFullPage && /* @__PURE__ */ jsxRuntime.jsx(
1076
- "div",
1077
- {
1078
- className: button.cn(
1079
- "flex flex-col border-border bg-background overflow-hidden transition-all duration-300",
1080
- 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]"
1081
- ),
1082
- style: { maxWidth: isMobile ? "none" : `calc(100vw - ${containerWidth})` },
1083
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full flex flex-col", children: [
1084
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 h-[64px] border-b border-border bg-card flex items-center justify-between", children: [
1085
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
1086
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 bg-primary/10 rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-4 h-4 text-primary" }) }),
1087
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-card-foreground text-sm", children: editingDocument.title })
1088
- ] }),
1089
- /* @__PURE__ */ jsxRuntime.jsx(
1090
- button.Button,
1091
- {
1092
- variant: "ghost",
1093
- size: "icon",
1094
- className: "h-8 w-8 rounded-full",
1095
- onClick: () => setEditingDocument(null),
1096
- "aria-label": "Fechar editor de documento",
1097
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
1098
- }
1099
- )
1100
- ] }),
1101
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 bg-muted/20 p-0 sm:p-6 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
1102
- richTextEditor.RichTextEditor,
1103
- {
1104
- value: editingDocument.content || "",
1105
- onChange: (newVal) => setEditingDocument((prev) => prev ? { ...prev, content: newVal } : null),
1106
- placeholder: "Comece a digitar o conteúdo do seu documento aqui...",
1107
- className: "max-w-4xl mx-auto h-full",
1108
- actionButton: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", className: "gap-2 h-8", children: [
1109
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-3.5 h-3.5" }),
1110
- "Salvar"
1111
- ] })
1112
- }
1113
- ) })
1114
- ] })
1115
- }
1116
- ),
1117
- !isFullPage && /* @__PURE__ */ jsxRuntime.jsxs(
1118
- "div",
1119
- {
1120
- className: button.cn(
1121
- "border-b border-border flex items-center h-[64px]",
1122
- isExpanded ? "justify-between px-4" : "justify-center px-0"
1123
- ),
1124
- children: [
1125
- isExpanded && /* @__PURE__ */ jsxRuntime.jsxs(
1126
- framerMotion.motion.div,
1127
- {
1128
- initial: { opacity: 0, x: -10 },
1129
- animate: { opacity: 1, x: 0 },
1130
- exit: { opacity: 0, x: -10 },
1131
- className: "flex items-center gap-2 overflow-hidden",
1132
- children: [
1133
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 32 }) }),
1134
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-medium truncate", children: "Assistente Xertica" })
1135
- ]
1136
- }
1137
- ),
1138
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
1139
- isExpanded && onNavigateFullPage && /* @__PURE__ */ jsxRuntime.jsx(
1140
- button.Button,
1141
- {
1142
- variant: "ghost",
1143
- size: "sm",
1144
- onClick: onNavigateFullPage,
1145
- className: "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
1146
- title: "Expandir assistente",
1147
- "aria-label": "Expandir assistente",
1148
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "w-4 h-4" })
1149
- }
1150
- ),
1151
- /* @__PURE__ */ jsxRuntime.jsx(
1152
- button.Button,
1153
- {
1154
- variant: "ghost",
1155
- size: "sm",
1156
- onClick: handleToggle,
1157
- className: button.cn(
1158
- "h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-full",
1159
- !isExpanded && "w-10 h-10"
1160
- // Slightly larger touch target when collapsed if desired, or keep consistent
1161
- ),
1162
- "aria-label": isExpanded ? "Recolher assistente" : "Expandir assistente",
1163
- children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRight, { className: "w-4 h-4" })
1164
- }
1165
- )
1166
- ] })
1167
- ]
1168
- }
1169
- ),
1170
- !isExpanded && !isFullPage && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center p-4 space-y-4", children: [
1171
- /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1172
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1173
- "button",
1174
- {
1175
- onClick: handleToggle,
1176
- className: "w-10 h-10 rounded-full flex items-center justify-center hover:bg-accent/50 transition-colors duration-200 cursor-pointer mx-auto",
1177
- "aria-label": "Abrir assistente",
1178
- children: /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 32 })
1179
- }
1180
- ) }),
1181
- /* @__PURE__ */ jsxRuntime.jsx(
1182
- AssistantTooltipContent,
1183
- {
1184
- side: "left",
1185
- sideOffset: 8,
1186
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Assistente Xertica" })
1187
- }
1188
- )
1189
- ] }),
1190
- /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1191
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1192
- button.Button,
1193
- {
1194
- variant: "ghost",
1195
- size: "sm",
1196
- onClick: () => handleExpandWithTab("chat"),
1197
- className: "w-8 h-8 p-0 text-muted-foreground",
1198
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "w-4 h-4" })
1199
- }
1200
- ) }),
1201
- /* @__PURE__ */ jsxRuntime.jsx(
1202
- AssistantTooltipContent,
1203
- {
1204
- side: "left",
1205
- sideOffset: 8,
1206
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Chat" })
1207
- }
1208
- )
1209
- ] }),
1210
- showFavorites && /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1211
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1212
- button.Button,
1213
- {
1214
- variant: "ghost",
1215
- size: "sm",
1216
- onClick: () => handleExpandWithTab("favoritos"),
1217
- className: "w-8 h-8 p-0 text-muted-foreground",
1218
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heart, { className: "w-4 h-4" })
1219
- }
1220
- ) }),
1221
- /* @__PURE__ */ jsxRuntime.jsx(
1222
- AssistantTooltipContent,
1223
- {
1224
- side: "left",
1225
- sideOffset: 8,
1226
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Favoritos" })
1227
- }
1228
- )
1229
- ] }),
1230
- showHistory && /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
1231
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1232
- button.Button,
1233
- {
1234
- variant: "ghost",
1235
- size: "sm",
1236
- onClick: () => handleExpandWithTab("historico"),
1237
- className: "w-8 h-8 p-0 text-muted-foreground",
1238
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "w-4 h-4" })
1239
- }
1240
- ) }),
1241
- /* @__PURE__ */ jsxRuntime.jsx(
1242
- AssistantTooltipContent,
1243
- {
1244
- side: "left",
1245
- sideOffset: 8,
1246
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Histórico" })
1247
- }
1248
- )
1249
- ] })
1250
- ] }),
1251
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: (isExpanded || isFullPage) && /* @__PURE__ */ jsxRuntime.jsxs(
1252
- framerMotion.motion.div,
1253
- {
1254
- initial: isFullPage ? false : { opacity: 0, x: 50 },
1255
- animate: { opacity: 1, x: 0 },
1256
- exit: isFullPage ? void 0 : { opacity: 0, x: 50 },
1257
- transition: { duration: 0.2 },
1258
- className: "flex-1 flex flex-col overflow-hidden",
1259
- children: [
1260
- !isFullPage && (showHistory || showFavorites) && /* @__PURE__ */ jsxRuntime.jsx(
1261
- "div",
1262
- {
1263
- className: "px-4 py-2 border-b border-border",
1264
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
1265
- /* @__PURE__ */ jsxRuntime.jsxs(
1266
- button.Button,
1267
- {
1268
- variant: abaSelecionada === "chat" ? "default" : "ghost",
1269
- size: "sm",
1270
- onClick: () => setAbaSelecionada("chat"),
1271
- className: "flex-1 h-8",
1272
- "aria-label": "Ver chat",
1273
- children: [
1274
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "w-3 h-3 mr-1" }),
1275
- "Chat"
1276
- ]
1277
- }
1278
- ),
1279
- showHistory && /* @__PURE__ */ jsxRuntime.jsxs(
1280
- button.Button,
1281
- {
1282
- variant: abaSelecionada === "historico" ? "default" : "ghost",
1283
- size: "sm",
1284
- onClick: () => setAbaSelecionada("historico"),
1285
- className: "flex-1 h-8",
1286
- "aria-label": "Ver histórico de conversas",
1287
- children: [
1288
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "w-3 h-3 mr-1" }),
1289
- "Histórico"
1290
- ]
1291
- }
1292
- ),
1293
- showFavorites && /* @__PURE__ */ jsxRuntime.jsxs(
1294
- button.Button,
1295
- {
1296
- variant: abaSelecionada === "favoritos" ? "default" : "ghost",
1297
- size: "sm",
1298
- onClick: () => setAbaSelecionada("favoritos"),
1299
- className: "flex-1 h-8",
1300
- "aria-label": "Ver mensagens favoritas",
1301
- children: [
1302
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heart, { className: "w-3 h-3 mr-1" }),
1303
- "Favoritos"
1304
- ]
1305
- }
1306
- )
1307
- ] })
1308
- }
1309
- ),
1310
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-hidden flex flex-col", children: [
1311
- abaSelecionada === "chat" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 flex flex-col min-h-0 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`, children: mensagens.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto min-h-0", children: [
1312
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 text-center", children: [
1313
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mb-4 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 64 }) }),
1314
- /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "mb-2 text-foreground", children: [
1315
- "Olá, ",
1316
- userName
1317
- ] }),
1318
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: "Como posso ajudar?" })
1319
- ] }),
1320
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pb-4 space-y-2", children: [
1321
- sugestoes.map((sugestao) => /* @__PURE__ */ jsxRuntime.jsx(
1322
- "button",
1323
- {
1324
- onClick: () => handleEnviarMensagem(sugestao.text),
1325
- className: "w-full p-3 text-left rounded-[var(--radius-card)] bg-muted text-foreground transition-colors duration-200 hover:bg-muted/80",
1326
- children: sugestao.text
1327
- },
1328
- sugestao.id
1329
- )),
1330
- !showMoreSuggestions ? /* @__PURE__ */ jsxRuntime.jsxs(
1331
- button.Button,
1332
- {
1333
- variant: "ghost",
1334
- size: "sm",
1335
- onClick: () => setShowMoreSuggestions(true),
1336
- className: "w-full justify-start text-muted-foreground",
1337
- children: [
1338
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "w-4 h-4 mr-2" }),
1339
- "Mais sugestões"
1340
- ]
1341
- }
1342
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 pt-2 border-t border-border mt-2 animate-in slide-in-from-top-2", children: [
1343
- richSuggestions.length > 0 ? richSuggestions.map((sugestao) => /* @__PURE__ */ jsxRuntime.jsx(
1344
- "button",
1345
- {
1346
- onClick: () => handleRichSuggestionClick(sugestao),
1347
- 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",
1348
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1349
- sugestao.id.includes("chart") && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BarChart3, { className: "w-4 h-4 text-primary" }),
1350
- sugestao.id.includes("table") && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table, { className: "w-4 h-4 text-primary" }),
1351
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: sugestao.text })
1352
- ] })
1353
- },
1354
- sugestao.id
1355
- )) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground text-center py-2", children: "Nenhuma sugestão extra." }),
1356
- /* @__PURE__ */ jsxRuntime.jsxs(
1357
- button.Button,
1358
- {
1359
- variant: "ghost",
1360
- size: "sm",
1361
- onClick: () => setShowMoreSuggestions(false),
1362
- className: "w-full justify-center text-muted-foreground mt-2",
1363
- children: [
1364
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "w-4 h-4 mr-2" }),
1365
- "Voltar"
1366
- ]
1367
- }
1368
- )
1369
- ] })
1370
- ] })
1371
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(input.ScrollArea, { className: "flex-1 min-h-0 overflow-x-hidden [&_[data-radix-scroll-area-viewport]>div]:!block", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 px-4 py-4 max-w-6xl mx-auto !block !w-full", children: [
1372
- mensagens.map((msg) => /* @__PURE__ */ jsxRuntime.jsxs(
1373
- framerMotion.motion.div,
1374
- {
1375
- initial: { opacity: 0, y: 10 },
1376
- animate: { opacity: 1, y: 0 },
1377
- className: `flex gap-2 w-full min-w-0 ${msg.type === "user" ? "justify-end" : "justify-start"}`,
1378
- children: [
1379
- msg.type === "assistant" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 32 }) }),
1380
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn(
1381
- "flex flex-col min-w-0 transition-all duration-300",
1382
- msg.type === "user" ? "max-w-[85%] md:max-w-[70%] items-end w-fit" : button.cn(
1383
- "items-start",
1384
- msg.tableData || msg.chartData || msg.searchResults || msg.attachmentType === "document" ? "w-full max-w-full" : "w-fit max-w-[95%] md:max-w-[90%]"
1385
- )
1386
- ), children: [
1387
- /* @__PURE__ */ jsxRuntime.jsxs(
1388
- "div",
1389
- {
1390
- className: button.cn(
1391
- "px-4 py-2 break-words overflow-hidden overflow-x-hidden w-full min-w-0 rounded-2xl",
1392
- msg.type === "user" ? "bg-primary text-primary-foreground shadow-sm" : "bg-muted text-foreground"
1393
- ),
1394
- children: [
1395
- msg.attachmentType === "document" && /* @__PURE__ */ jsxRuntime.jsxs(
1396
- "div",
1397
- {
1398
- className: "flex items-center justify-between mb-2 pb-2 border-b border-border min-w-0 overflow-hidden",
1399
- children: [
1400
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1 overflow-hidden", children: [
1401
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-4 h-4 flex-shrink-0" }),
1402
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium break-words", children: msg.attachmentName })
1403
- ] }),
1404
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
1405
- /* @__PURE__ */ jsxRuntime.jsx(
1406
- button.Button,
1407
- {
1408
- variant: "ghost",
1409
- size: "sm",
1410
- onClick: () => msg.documentContent && msg.attachmentName && handleDownloadDocument(msg.documentContent, msg.attachmentName),
1411
- className: "h-6 px-2",
1412
- title: "Baixar",
1413
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "w-3 h-3" })
1414
- }
1415
- ),
1416
- /* @__PURE__ */ jsxRuntime.jsxs(
1417
- button.Button,
1418
- {
1419
- variant: "ghost",
1420
- size: "sm",
1421
- onClick: () => msg.documentContent && msg.documentTitle && handleEditDocument(msg.documentContent, msg.documentTitle),
1422
- className: "h-6 px-2",
1423
- children: [
1424
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "w-3 h-3 mr-1" }),
1425
- "Editar"
1426
- ]
1427
- }
1428
- )
1429
- ] })
1430
- ]
1431
- }
1432
- ),
1433
- msg.attachmentType && msg.attachmentType !== "podcast" && msg.attachmentType !== "document" && /* @__PURE__ */ jsxRuntime.jsxs(
1434
- "div",
1435
- {
1436
- className: "flex items-center gap-2 mb-2 pb-2 border-b border-border min-w-0 overflow-hidden",
1437
- children: [
1438
- msg.attachmentType === "file" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-4 h-4 flex-shrink-0" }),
1439
- msg.attachmentType === "audio" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Music, { className: "w-4 h-4 flex-shrink-0" }),
1440
- msg.attachmentType === "image" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "w-4 h-4 flex-shrink-0" }),
1441
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-small break-words", children: msg.attachmentName })
1442
- ]
1443
- }
1444
- ),
1445
- msg.type === "user" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap break-words", children: msg.content }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1446
- (msg.content.includes("🔐") || msg.content.includes("❌")) && /* @__PURE__ */ jsxRuntime.jsx(
1447
- "div",
1448
- {
1449
- className: "mb-3 p-3 border rounded-[var(--radius)] overflow-hidden bg-[var(--toast-error-bg)]/20 border-[var(--toast-error-border)]/30",
1450
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 min-w-0", children: [
1451
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-[var(--toast-error-icon)]" }),
1452
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
1453
- MarkdownMessage,
1454
- {
1455
- content: msg.content,
1456
- className: "text-foreground"
1457
- }
1458
- ) })
1459
- ] })
1460
- }
1461
- ),
1462
- !(msg.content.includes("🔐") || msg.content.includes("❌")) && /* @__PURE__ */ jsxRuntime.jsx(
1463
- MarkdownMessage,
1464
- {
1465
- content: msg.content,
1466
- className: "text-foreground"
1467
- }
1468
- )
1469
- ] }),
1470
- msg.chartData && msg.chartConfig && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 w-full h-[300px] min-w-[300px]", children: /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartContainer, { config: msg.chartConfig, className: "h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.BarChart, { accessibilityLayer: true, data: msg.chartData, children: [
1471
- /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.CartesianGrid, { vertical: false }),
1472
- /* @__PURE__ */ jsxRuntime.jsx(
1473
- RechartsPrimitive.XAxis,
1474
- {
1475
- dataKey: "month",
1476
- tickLine: false,
1477
- tickMargin: 10,
1478
- axisLine: false,
1479
- tickFormatter: (value) => value.slice(0, 3)
1480
- }
1481
- ),
1482
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartTooltipContent, {}) }),
1483
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartLegendContent, {}) }),
1484
- Object.keys(msg.chartConfig).map((key) => /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.Bar, { dataKey: key, fill: `var(--color-${key})`, radius: 4 }, key))
1485
- ] }) }) }),
1486
- msg.tableData && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 w-full max-w-full border rounded-[var(--radius)] overflow-x-auto custom-scrollbar relative", children: /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.Table, { children: [
1487
- msg.tableData.caption && /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableCaption, { children: msg.tableData.caption }),
1488
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableRow, { children: msg.tableData.headers.map((header, i) => /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableHead, { children: header }, i)) }) }),
1489
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableBody, { children: msg.tableData.rows.map((row, i) => /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableRow, { children: row.map((cell, j) => /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.TableCell, { children: cell }, j)) }, i)) })
1490
- ] }) }),
1491
- msg.attachmentType === "document" && msg.documentContent && /* @__PURE__ */ jsxRuntime.jsx(
1492
- "div",
1493
- {
1494
- className: "mt-3 pt-3 border-t border-border overflow-hidden",
1495
- children: /* @__PURE__ */ jsxRuntime.jsx(
1496
- FormattedDocument,
1497
- {
1498
- content: msg.documentContent,
1499
- maxPreviewLength: 250
1500
- }
1501
- )
1502
- }
1503
- ),
1504
- msg.attachmentType === "podcast" && msg.audioUrl && /* @__PURE__ */ jsxRuntime.jsxs(
1505
- "div",
1506
- {
1507
- className: "mt-3 pt-3 border-t border-border overflow-hidden",
1508
- children: [
1509
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3 min-w-0 overflow-hidden", children: [
1510
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1 overflow-hidden", children: [
1511
- /* @__PURE__ */ jsxRuntime.jsx(
1512
- "div",
1513
- {
1514
- 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)]",
1515
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Radio, { className: "w-3 h-3 text-white" })
1516
- }
1517
- ),
1518
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium break-words", children: msg.attachmentName })
1519
- ] }),
1520
- /* @__PURE__ */ jsxRuntime.jsx(
1521
- button.Button,
1522
- {
1523
- variant: "ghost",
1524
- size: "sm",
1525
- onClick: () => msg.audioUrl && msg.attachmentName && handleDownloadPodcast(msg.audioUrl, msg.attachmentName),
1526
- className: "h-6 px-2 flex-shrink-0",
1527
- title: "Baixar",
1528
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "w-3 h-3" })
1529
- }
1530
- )
1531
- ] }),
1532
- /* @__PURE__ */ jsxRuntime.jsx(
1533
- "div",
1534
- {
1535
- className: "rounded-[var(--radius)] p-2 overflow-hidden bg-gradient-to-r from-[var(--chart-1)]/10 to-[var(--chart-4)]/10",
1536
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1537
- "audio",
1538
- {
1539
- controls: true,
1540
- className: "w-full max-w-full h-10 outline-none",
1541
- children: [
1542
- /* @__PURE__ */ jsxRuntime.jsx("source", { src: msg.audioUrl, type: "audio/mpeg" }),
1543
- "Seu navegador não suporta o elemento de áudio."
1544
- ]
1545
- }
1546
- )
1547
- }
1548
- )
1549
- ]
1550
- }
1551
- ),
1552
- msg.attachmentType === "search" && msg.searchResults && /* @__PURE__ */ jsxRuntime.jsxs(
1553
- "div",
1554
- {
1555
- className: "mt-3 pt-3 border-t border-border space-y-4 overflow-hidden",
1556
- children: [
1557
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden", children: [
1558
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
1559
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4 text-[var(--chart-4)]" }),
1560
- /* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "text-foreground", children: [
1561
- "Resultados Encontrados (",
1562
- msg.searchResults.length,
1563
- ")"
1564
- ] })
1565
- ] }),
1566
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 overflow-hidden", children: msg.searchResults.map((result) => /* @__PURE__ */ jsxRuntime.jsx(
1567
- "div",
1568
- {
1569
- onClick: () => handleOpenSearchResult(result),
1570
- className: "p-3 rounded-[var(--radius)] border border-border transition-all cursor-pointer group overflow-hidden hover:bg-muted/50",
1571
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start justify-between gap-2 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 flex-1 min-w-0 overflow-hidden", children: [
1572
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-0.5 flex-shrink-0", children: [
1573
- result.type === "document" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-4 h-4 text-[var(--chart-4)]" }),
1574
- result.type === "project" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "w-4 h-4 text-[var(--chart-1)]" }),
1575
- result.type === "conversation" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "w-4 h-4 text-[var(--chart-2)]" }),
1576
- result.type === "file" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Folder, { className: "w-4 h-4 text-[var(--chart-3)]" }),
1577
- result.type === "contact" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "w-4 h-4 text-[var(--chart-5)]" })
1578
- ] }),
1579
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
1580
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 min-w-0", children: [
1581
- /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "text-sm font-medium break-words flex-1 min-w-0 text-foreground", children: result.title }),
1582
- /* @__PURE__ */ jsxRuntime.jsxs(
1583
- "span",
1584
- {
1585
- className: "px-1.5 py-0.5 rounded-sm flex-shrink-0 self-start bg-[var(--chart-4)]/10 text-[var(--chart-4)]",
1586
- children: [
1587
- result.relevance,
1588
- "%"
1589
- ]
1590
- }
1591
- )
1592
- ] }),
1593
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1 line-clamp-2 break-words", children: result.description }),
1594
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mt-2 flex-wrap min-w-0", children: [
1595
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground flex items-center gap-1 min-w-0 max-w-full", children: [
1596
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "w-3 h-3 flex-shrink-0" }),
1597
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: result.path })
1598
- ] }),
1599
- result.lastModified && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground flex items-center gap-1 flex-shrink-0", children: [
1600
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3 h-3" }),
1601
- result.lastModified
1602
- ] })
1603
- ] })
1604
- ] })
1605
- ] }) })
1606
- },
1607
- result.id
1608
- )) })
1609
- ] }),
1610
- msg.searchSources && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1611
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-2 text-foreground", children: "Fontes Consultadas" }),
1612
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2 overflow-hidden", children: msg.searchSources.map((source, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1613
- "div",
1614
- {
1615
- className: "px-3 py-1.5 border max-w-full rounded-[var(--radius-button)] bg-muted border-border",
1616
- children: [
1617
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground break-words", children: source.name }),
1618
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground ml-1 whitespace-nowrap", children: [
1619
- "(",
1620
- source.count,
1621
- ")"
1622
- ] })
1623
- ]
1624
- },
1625
- index
1626
- )) })
1627
- ] }),
1628
- msg.searchCommands && msg.searchResults && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1629
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-2 text-foreground", children: "O que você pode fazer com estes resultados" }),
1630
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-2", children: msg.searchCommands.map((command) => /* @__PURE__ */ jsxRuntime.jsxs(
1631
- "button",
1632
- {
1633
- onClick: () => handleExecuteSearchCommand(
1634
- command.id,
1635
- msg.content.replace("🔍 Pesquisa realizada com sucesso!", "").split('"')[1] || "pesquisa",
1636
- msg.searchResults,
1637
- msg.id
1638
- ),
1639
- disabled: executingCommand === command.id,
1640
- className: button.cn(
1641
- "flex items-start gap-2 p-2 rounded-[var(--radius)] border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed",
1642
- 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"
1643
- ),
1644
- children: [
1645
- executingCommand === command.id ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-5 h-5 animate-spin flex-shrink-0 text-primary" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: command.icon }),
1646
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
1647
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground break-words", children: command.id === "5" && savedSearches.includes(msg.id) ? "⭐ Pesquisa salva" : command.label }),
1648
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground break-words", children: executingCommand === command.id ? "Processando..." : command.description })
1649
- ] })
1650
- ]
1651
- },
1652
- command.id
1653
- )) })
1654
- ] })
1655
- ]
1656
- }
1657
- )
1658
- ]
1659
- }
1660
- ),
1661
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-1 px-2", children: [
1662
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: msg.timestamp.toLocaleTimeString("pt-BR", { hour: "2-digit", minute: "2-digit" }) }),
1663
- enablePodcastGeneration && msg.type === "assistant" && msg.attachmentType !== "podcast" && /* @__PURE__ */ jsxRuntime.jsx(
1664
- button.Button,
1665
- {
1666
- variant: "ghost",
1667
- size: "sm",
1668
- onClick: () => handleGeneratePodcast(msg.id, msg.content),
1669
- disabled: generatingPodcastId === msg.id,
1670
- className: "h-6 w-6 p-0 disabled:opacity-50 text-muted-foreground",
1671
- title: "Gerar Podcast",
1672
- "aria-label": "Gerar Podcast",
1673
- children: generatingPodcastId === msg.id ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-3 h-3 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Radio, { className: "w-3 h-3" })
1674
- }
1675
- ),
1676
- msg.type === "assistant" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 border-l border-border pl-2 ml-1", children: [
1677
- /* @__PURE__ */ jsxRuntime.jsx(
1678
- button.Button,
1679
- {
1680
- variant: "ghost",
1681
- size: "icon",
1682
- className: button.cn(
1683
- "h-6 w-6 rounded-full hover:bg-green-100 dark:hover:bg-green-900/20 hover:text-green-600",
1684
- msg.evaluation === "like" && "text-green-600 bg-green-100 dark:bg-green-900/20"
1685
- ),
1686
- onClick: () => handleEvaluationClick(msg.id),
1687
- title: "Gostei",
1688
- "aria-label": "Gostei",
1689
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ThumbsUp, { className: "h-3.5 w-3.5" })
1690
- }
1691
- ),
1692
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
1693
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1694
- button.Button,
1695
- {
1696
- variant: "ghost",
1697
- size: "icon",
1698
- className: button.cn(
1699
- "h-6 w-6 rounded-full hover:bg-red-100 dark:hover:bg-red-900/20 hover:text-red-600",
1700
- msg.evaluation === "dislike" && "text-red-600 bg-red-100 dark:bg-red-900/20"
1701
- ),
1702
- title: "Não gostei",
1703
- "aria-label": "Não gostei",
1704
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ThumbsDown, { className: "h-3.5 w-3.5" })
1705
- }
1706
- ) }),
1707
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "start", children: [
1708
- feedbackOptions && feedbackOptions.length > 0 ? feedbackOptions.map((option, idx) => /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onClick: () => openFeedbackDialog(msg.id, option), children: option }, idx)) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1709
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onClick: () => openFeedbackDialog(msg.id, "Não era o que eu procurava"), children: "Não era o que eu procurava" }),
1710
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onClick: () => openFeedbackDialog(msg.id, "Informação incorreta"), children: "Informação incorreta" }),
1711
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onClick: () => openFeedbackDialog(msg.id, "Resposta incompleta"), children: "Resposta incompleta" })
1712
- ] }),
1713
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onClick: () => openFeedbackDialog(msg.id, null), children: "Outros..." })
1714
- ] })
1715
- ] })
1716
- ] }),
1717
- /* @__PURE__ */ jsxRuntime.jsx(
1718
- button.Button,
1719
- {
1720
- variant: "ghost",
1721
- size: "sm",
1722
- onClick: () => handleCopyMessage(msg.content, msg.id),
1723
- className: `h-6 w-6 p-0 ${copiedId === msg.id ? "text-[var(--toast-success-icon)]" : "text-muted-foreground"}`,
1724
- "aria-label": copiedId === msg.id ? "Copiado" : "Copiar mensagem",
1725
- children: copiedId === msg.id ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-3 h-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-3 h-3" })
1726
- }
1727
- )
1728
- ] })
1729
- ] })
1730
- ]
1731
- },
1732
- msg.id
1733
- )),
1734
- isProcessing && /* @__PURE__ */ jsxRuntime.jsxs(
1735
- framerMotion.motion.div,
1736
- {
1737
- initial: { opacity: 0, y: 10 },
1738
- animate: { opacity: 1, y: 0 },
1739
- className: "flex gap-2 justify-start",
1740
- children: [
1741
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(XerticaOrbe.XerticaOrbe, { size: 32 }) }),
1742
- /* @__PURE__ */ jsxRuntime.jsx(
1743
- "div",
1744
- {
1745
- className: "px-4 py-3 bg-muted rounded-2xl",
1746
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
1747
- /* @__PURE__ */ jsxRuntime.jsx(
1748
- framerMotion.motion.div,
1749
- {
1750
- className: "w-2 h-2 rounded-full bg-muted-foreground",
1751
- animate: { y: [0, -8, 0] },
1752
- transition: { repeat: Infinity, duration: 0.6, delay: 0 }
1753
- }
1754
- ),
1755
- /* @__PURE__ */ jsxRuntime.jsx(
1756
- framerMotion.motion.div,
1757
- {
1758
- className: "w-2 h-2 rounded-full bg-muted-foreground",
1759
- animate: { y: [0, -8, 0] },
1760
- transition: { repeat: Infinity, duration: 0.6, delay: 0.2 }
1761
- }
1762
- ),
1763
- /* @__PURE__ */ jsxRuntime.jsx(
1764
- framerMotion.motion.div,
1765
- {
1766
- className: "w-2 h-2 rounded-full bg-muted-foreground",
1767
- animate: { y: [0, -8, 0] },
1768
- transition: { repeat: Infinity, duration: 0.6, delay: 0.4 }
1769
- }
1770
- )
1771
- ] })
1772
- }
1773
- )
1774
- ]
1775
- }
1776
- ),
1777
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: messagesEndRef })
1778
- ] }) }) }),
1779
- (abaSelecionada === "historico" && showHistory || abaSelecionada === "favoritos" && showFavorites) && /* @__PURE__ */ jsxRuntime.jsx(input.ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `p-4 ${isFullPage ? "mx-auto w-full max-w-6xl" : ""}`, children: [
1780
- /* @__PURE__ */ jsxRuntime.jsxs(
1781
- button.Button,
1782
- {
1783
- variant: "outline",
1784
- size: "sm",
1785
- onClick: handleNovaConversa,
1786
- className: "w-full mb-4 justify-start",
1787
- children: [
1788
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "w-4 h-4 mr-2" }),
1789
- "Nova Conversa"
1790
- ]
1791
- }
1792
- ),
1793
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: conversasFiltradas.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
1794
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heart, { className: "w-12 h-12 mx-auto text-muted-foreground/50 mb-2" }),
1795
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: abaSelecionada === "favoritos" ? "Nenhuma conversa favorita ainda" : "Nenhuma conversa no histórico" })
1796
- ] }) : conversasFiltradas.map((conversa) => /* @__PURE__ */ jsxRuntime.jsxs(
1797
- "div",
1798
- {
1799
- onClick: () => handleSelecionarConversa(conversa.id),
1800
- className: button.cn(
1801
- "p-3 rounded-[var(--radius)] cursor-pointer transition-colors duration-200 border",
1802
- conversa.id === conversaAtual ? "border-primary bg-primary/10" : "border-border hover:bg-muted"
1803
- ),
1804
- children: [
1805
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-1", children: [
1806
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground truncate flex-1", children: conversa.title }),
1807
- /* @__PURE__ */ jsxRuntime.jsx(
1808
- button.Button,
1809
- {
1810
- variant: "ghost",
1811
- size: "sm",
1812
- onClick: (e) => {
1813
- e.stopPropagation();
1814
- handleToggleFavoritaConversa(conversa.id);
1815
- },
1816
- className: "h-6 w-6 p-0 flex-shrink-0 ml-1",
1817
- children: /* @__PURE__ */ jsxRuntime.jsx(
1818
- lucideReact.Heart,
1819
- {
1820
- className: button.cn(
1821
- "w-3 h-3",
1822
- conversa.isFavorite ? "text-destructive fill-current" : "text-muted-foreground"
1823
- )
1824
- }
1825
- )
1826
- }
1827
- )
1828
- ] }),
1829
- conversa.lastMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground truncate mb-1", children: conversa.lastMessage }),
1830
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: conversa.timestamp })
1831
- ]
1832
- },
1833
- conversa.id
1834
- )) })
1835
- ] }) })
1836
- ] }),
1837
- abaSelecionada === "chat" && /* @__PURE__ */ jsxRuntime.jsx(
1838
- ModernChatInput,
1839
- {
1840
- value: mensagem,
1841
- onChange: setMensagem,
1842
- onSubmit: handleEnviarMensagem,
1843
- onFileUpload: enableFileAttachment ? () => {
1844
- var _a;
1845
- return (_a = fileInputRef.current) == null ? void 0 : _a.click();
1846
- } : void 0,
1847
- onAudioUpload: enableAudioInput ? () => {
1848
- var _a;
1849
- return (_a = audioInputRef.current) == null ? void 0 : _a.click();
1850
- } : void 0,
1851
- placeholder: "Envie uma mensagem para Xertica",
1852
- disabled: isProcessing,
1853
- isFullPage,
1854
- enableAudioInput,
1855
- enableFileAttachment,
1856
- enableDocumentCreation,
1857
- enablePodcastGeneration,
1858
- enableSearch
1859
- }
1860
- )
1861
- ]
1862
- }
1863
- ) })
1864
- ]
1865
- }
1866
- ),
1867
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.Dialog, { open: evaluationState.isOpen, onOpenChange: (open) => !open && setEvaluationState((prev) => ({ ...prev, isOpen: false })), children: /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.DialogContent, { className: "sm:max-w-[600px]", children: [
1868
- /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.DialogHeader, { children: [
1869
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.DialogTitle, { className: "pr-8", children: evaluationState.category ? `Enviar feedback: ${evaluationState.category}` : "Enviar feedback" }),
1870
- /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.DialogDescription, { children: evaluationState.category ? "Gostaria de adicionar algum comentário? (Opcional)" : "Conte-nos por que essa resposta não foi útil para que possamos melhorar." })
1871
- ] }),
1872
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 py-4 px-6", children: /* @__PURE__ */ jsxRuntime.jsx(
1873
- richTextEditor.Textarea,
1874
- {
1875
- className: "min-h-[100px]",
1876
- placeholder: evaluationState.category ? "Comentário adicional..." : "Descreva o motivo...",
1877
- "aria-label": evaluationState.category ? "Comentário adicional" : "Descreva o motivo",
1878
- value: evaluationState.reason,
1879
- onChange: (e) => setEvaluationState((prev) => ({ ...prev, reason: e.target.value })),
1880
- rows: 4
1881
- }
1882
- ) }),
1883
- /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.DialogFooter, { children: [
1884
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", onClick: () => setEvaluationState((prev) => ({ ...prev, isOpen: false })), children: "Cancelar" }),
1885
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: handleSubmitDislike, disabled: !evaluationState.category && !evaluationState.reason.trim(), children: evaluationState.category ? "Confirmar e Enviar" : "Enviar Feedback" })
1886
- ] })
1887
- ] }) })
1888
- ] });
1889
- }
1890
- exports.FormattedDocument = FormattedDocument;
1891
- exports.MarkdownMessage = MarkdownMessage;
1892
- exports.ModernChatInput = ModernChatInput;
1893
- exports.XerticaAssistant = XerticaAssistant;
1894
- exports.gerarResposta = gerarResposta;