@8wave/ai-elements 0.98.0 → 0.99.0-beta.2

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 (178) hide show
  1. package/README.md +24 -5
  2. package/{dist-vue/_chunks/PkStreamingMarkdown-DEhbK-3c.js → dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js} +379 -362
  3. package/dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js.map +1 -0
  4. package/dist/_chunks/{PkToolRequestGeolocation-BJ9NJZIg.js → PkToolRequestGeolocation-B73evGBg.js} +2 -2
  5. package/dist/_chunks/{PkToolRequestGeolocation-BJ9NJZIg.js.map → PkToolRequestGeolocation-B73evGBg.js.map} +1 -1
  6. package/dist/_chunks/{PkToolRequestOAuthConnection-DdvJ6n1K.js → PkToolRequestOAuthConnection-BWP5dsK_.js} +3 -3
  7. package/dist/_chunks/{PkToolRequestOAuthConnection-DdvJ6n1K.js.map → PkToolRequestOAuthConnection-BWP5dsK_.js.map} +1 -1
  8. package/dist/_chunks/{PkToolShowArtifact-BaGEr7O9.js → PkToolShowArtifact-bYYaMGxq.js} +7 -7
  9. package/dist/_chunks/{PkToolShowArtifact-BaGEr7O9.js.map → PkToolShowArtifact-bYYaMGxq.js.map} +1 -1
  10. package/dist/_chunks/{PkToolShowCalendarEvent-BYnhl2er.js → PkToolShowCalendarEvent-DdEWaTj-.js} +4 -4
  11. package/dist/_chunks/{PkToolShowCalendarEvent-BYnhl2er.js.map → PkToolShowCalendarEvent-DdEWaTj-.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowComparison-DahL5vHr.js → PkToolShowComparison-Dcar7HPW.js} +4 -4
  13. package/dist/_chunks/{PkToolShowComparison-DahL5vHr.js.map → PkToolShowComparison-Dcar7HPW.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-upUNZtId.js → PkToolShowContactForm-DtjVW-n6.js} +13 -13
  15. package/dist/_chunks/{PkToolShowContactForm-upUNZtId.js.map → PkToolShowContactForm-DtjVW-n6.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowDiagram-Jq_4KWiK.js → PkToolShowDiagram-X35nsoIY.js} +8 -8
  17. package/dist/_chunks/{PkToolShowDiagram-Jq_4KWiK.js.map → PkToolShowDiagram-X35nsoIY.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowEmail-CtmpDS1B.js → PkToolShowEmail-jVoK8qEh.js} +4 -4
  19. package/dist/_chunks/{PkToolShowEmail-CtmpDS1B.js.map → PkToolShowEmail-jVoK8qEh.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-BNV4Ja6g.js → PkToolShowForm-BP8asXtz.js} +123 -97
  21. package/dist/_chunks/PkToolShowForm-BP8asXtz.js.map +1 -0
  22. package/dist/_chunks/{PkToolShowImageGallery-mLq2p3aH.js → PkToolShowImageGallery-WQL3T4Hr.js} +2 -2
  23. package/dist/_chunks/{PkToolShowImageGallery-mLq2p3aH.js.map → PkToolShowImageGallery-WQL3T4Hr.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowLocation-SbgTbuGu.js → PkToolShowLocation-w2t7lKpb.js} +4 -4
  25. package/dist/_chunks/{PkToolShowLocation-SbgTbuGu.js.map → PkToolShowLocation-w2t7lKpb.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowMessage-CAVpDTzd.js → PkToolShowMessage-BPo7WPim.js} +4 -4
  27. package/dist/_chunks/{PkToolShowMessage-CAVpDTzd.js.map → PkToolShowMessage-BPo7WPim.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowProductList-puiPFItN.js → PkToolShowProductList-BbY4ni7Y.js} +2 -2
  29. package/dist/_chunks/{PkToolShowProductList-puiPFItN.js.map → PkToolShowProductList-BbY4ni7Y.js.map} +1 -1
  30. package/dist/_chunks/{PkToolShowQrCode-CctXvRyG.js → PkToolShowQrCode-CN0ms27N.js} +4 -4
  31. package/dist/_chunks/{PkToolShowQrCode-CctXvRyG.js.map → PkToolShowQrCode-CN0ms27N.js.map} +1 -1
  32. package/dist/_chunks/{PkToolShowSources-DwB6VXrK.js → PkToolShowSources-D2tBcx7n.js} +18 -18
  33. package/dist/_chunks/{PkToolShowSources-DwB6VXrK.js.map → PkToolShowSources-D2tBcx7n.js.map} +1 -1
  34. package/dist/_chunks/{PkToolShowSuggestedReply-QEcIhSxa.js → PkToolShowSuggestedReply-Cdh_elSh.js} +2 -2
  35. package/dist/_chunks/{PkToolShowSuggestedReply-QEcIhSxa.js.map → PkToolShowSuggestedReply-Cdh_elSh.js.map} +1 -1
  36. package/dist/_chunks/{PkToolShowVideo-DoLoI8_N.js → PkToolShowVideo-D3aU5FMO.js} +2 -2
  37. package/dist/_chunks/{PkToolShowVideo-DoLoI8_N.js.map → PkToolShowVideo-D3aU5FMO.js.map} +1 -1
  38. package/dist/_chunks/{PkToolShowWeather-C2rPCQ_K.js → PkToolShowWeather-CzanXIJp.js} +3 -3
  39. package/dist/_chunks/{PkToolShowWeather-C2rPCQ_K.js.map → PkToolShowWeather-CzanXIJp.js.map} +1 -1
  40. package/dist/_chunks/{PkToolShowWebPages-BBJYzF8V.js → PkToolShowWebPages-DkMJrWmT.js} +2 -2
  41. package/dist/_chunks/{PkToolShowWebPages-BBJYzF8V.js.map → PkToolShowWebPages-DkMJrWmT.js.map} +1 -1
  42. package/dist/_chunks/{VvCheckbox.es-D5d8k9yP.js → VvCheckbox.es-CRhIKQNR.js} +2 -2
  43. package/dist/_chunks/{VvCheckbox.es-D5d8k9yP.js.map → VvCheckbox.es-CRhIKQNR.js.map} +1 -1
  44. package/dist/_chunks/{VvCheckboxGroup.es-DVnsOjX0.js → VvCheckboxGroup.es-gOy2kM1Y.js} +5 -5
  45. package/dist/_chunks/{VvCheckboxGroup.es-DVnsOjX0.js.map → VvCheckboxGroup.es-gOy2kM1Y.js.map} +1 -1
  46. package/dist/_chunks/{VvCombobox.es-CFA-K-cQ.js → VvCombobox.es-BOwH3LmO.js} +9 -9
  47. package/dist/_chunks/VvCombobox.es-BOwH3LmO.js.map +1 -0
  48. package/dist/_chunks/{VvInputText.es-csEQ-bSG.js → VvInputText.es-D8nXroKO.js} +536 -513
  49. package/dist/_chunks/VvInputText.es-D8nXroKO.js.map +1 -0
  50. package/dist/_chunks/{VvRadio.es-BpymhC73.js → VvRadio.es-Djy5J33A.js} +2 -2
  51. package/dist/_chunks/{VvRadio.es-BpymhC73.js.map → VvRadio.es-Djy5J33A.js.map} +1 -1
  52. package/dist/_chunks/{VvRadioGroup.es-CSNzOJKx.js → VvRadioGroup.es-DQq3JYCR.js} +5 -5
  53. package/dist/_chunks/VvRadioGroup.es-DQq3JYCR.js.map +1 -0
  54. package/dist/_chunks/{VvSelect.es-CjKMd0nH.js → VvSelect.es-CE4x1ww0.js} +4 -4
  55. package/dist/_chunks/{VvSelect.es-CjKMd0nH.js.map → VvSelect.es-CE4x1ww0.js.map} +1 -1
  56. package/dist/_chunks/VvTextarea.es-BU2vqdEQ.js +1129 -0
  57. package/dist/_chunks/VvTextarea.es-BU2vqdEQ.js.map +1 -0
  58. package/dist/_chunks/{dist-BNET2z7b.js → dist-CvMCBce7.js} +39 -21
  59. package/dist/_chunks/dist-CvMCBce7.js.map +1 -0
  60. package/dist/_chunks/dot-prop-CObyt75F.js +141 -0
  61. package/dist/_chunks/dot-prop-CObyt75F.js.map +1 -0
  62. package/dist/_chunks/{floating-ui.vue-CIKvCpTA.js → floating-ui.vue-BacoFpVq.js} +278 -305
  63. package/dist/_chunks/floating-ui.vue-BacoFpVq.js.map +1 -0
  64. package/dist/_chunks/{index.es-u1dF1xg2.js → index.es-DpqfagWZ.js} +12 -12
  65. package/dist/_chunks/{index.es-u1dF1xg2.js.map → index.es-DpqfagWZ.js.map} +1 -1
  66. package/dist/_chunks/{index.es-BYny0uhz.js → index.es-_oXVRjHy.js} +2352 -2329
  67. package/dist/_chunks/index.es-_oXVRjHy.js.map +1 -0
  68. package/dist/ai-elements.es.js +4818 -5765
  69. package/dist/ai-elements.es.js.map +1 -1
  70. package/dist-vue/PkChatbot.js +1 -1
  71. package/dist-vue/PkChatbotAuth.js +1 -1
  72. package/dist-vue/PkChatbotEmptyState.js +1 -1
  73. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  74. package/dist-vue/PkChatbotInput.js +1 -1
  75. package/dist-vue/PkChatbotMessages.js +1 -1
  76. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  77. package/dist-vue/PkChatbotSteps.js +1 -1
  78. package/dist-vue/PkChatbotViewChat.js +1 -1
  79. package/dist-vue/PkChatbotViewConversations.js +1 -1
  80. package/dist-vue/PkChatbotViewFiles.js +1 -1
  81. package/dist-vue/PkChatbotViewProfile.js +1 -1
  82. package/dist-vue/_chunks/PkChatbot-Bf5uY3cO.js +236 -0
  83. package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js.map → PkChatbot-Bf5uY3cO.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkChatbotAuth-C_L2xWuD.js → PkChatbotAuth-BGn2MDYD.js} +2 -2
  85. package/dist-vue/_chunks/{PkChatbotAuth-C_L2xWuD.js.map → PkChatbotAuth-BGn2MDYD.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkChatbotEmptyState-BGOC6vxr.js → PkChatbotEmptyState-CPqLqXek.js} +2 -2
  87. package/dist-vue/_chunks/{PkChatbotEmptyState-BGOC6vxr.js.map → PkChatbotEmptyState-CPqLqXek.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkChatbotFeedbackForm-BSe40qlc.js → PkChatbotFeedbackForm-C_y__RH8.js} +2 -2
  89. package/dist-vue/_chunks/{PkChatbotFeedbackForm-BSe40qlc.js.map → PkChatbotFeedbackForm-C_y__RH8.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkChatbotInput-DTazYlPd.js → PkChatbotInput-jvb0vuak.js} +2 -2
  91. package/dist-vue/_chunks/{PkChatbotInput-DTazYlPd.js.map → PkChatbotInput-jvb0vuak.js.map} +1 -1
  92. package/dist-vue/_chunks/PkChatbotMessages-B3G12zah.js +752 -0
  93. package/dist-vue/_chunks/PkChatbotMessages-B3G12zah.js.map +1 -0
  94. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js → PkChatbotStepToolDetail-BVI72gyx.js} +2 -2
  95. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js.map → PkChatbotStepToolDetail-BVI72gyx.js.map} +1 -1
  96. package/dist-vue/_chunks/PkChatbotSteps-BdU6YC_N.js +172 -0
  97. package/dist-vue/_chunks/{PkChatbotSteps-BpqdFhsG.js.map → PkChatbotSteps-BdU6YC_N.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkChatbotViewChat-C08TsXiL.js → PkChatbotViewChat-c0Ecpzoc.js} +68 -68
  99. package/dist-vue/_chunks/PkChatbotViewChat-c0Ecpzoc.js.map +1 -0
  100. package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js → PkChatbotViewConversations-BfhRCA_1.js} +2 -2
  101. package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js.map → PkChatbotViewConversations-BfhRCA_1.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js → PkChatbotViewFiles-BipRoidH.js} +2 -2
  103. package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js.map → PkChatbotViewFiles-BipRoidH.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js → PkChatbotViewProfile-DuLwYpGZ.js} +2 -2
  105. package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js.map → PkChatbotViewProfile-DuLwYpGZ.js.map} +1 -1
  106. package/{dist/_chunks/PkStreamingMarkdown-Djw604Ny.js → dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js} +344 -347
  107. package/dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js.map +1 -0
  108. package/dist-vue/_chunks/{PkToolShowArtifact-CTBwt4DN.js → PkToolShowArtifact-COwSXmF4.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowArtifact-CTBwt4DN.js.map → PkToolShowArtifact-COwSXmF4.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowContactForm-B6-MsExL.js → PkToolShowContactForm-DRRtCCxB.js} +10 -10
  111. package/dist-vue/_chunks/{PkToolShowContactForm-B6-MsExL.js.map → PkToolShowContactForm-DRRtCCxB.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowForm-C-mWyeka.js → PkToolShowForm-j7Ha-0X3.js} +128 -102
  113. package/dist-vue/_chunks/PkToolShowForm-j7Ha-0X3.js.map +1 -0
  114. package/dist-vue/_chunks/{PkToolShowSources-CFh-i60o.js → PkToolShowSources-BVLw4W5l.js} +43 -43
  115. package/dist-vue/_chunks/{PkToolShowSources-CFh-i60o.js.map → PkToolShowSources-BVLw4W5l.js.map} +1 -1
  116. package/dist-vue/_chunks/{createChatbotApiClient-BOBdBxmf.js → createChatbotApiClient-IH6wBh4s.js} +148 -160
  117. package/dist-vue/_chunks/createChatbotApiClient-IH6wBh4s.js.map +1 -0
  118. package/dist-vue/_chunks/{index.es-XfWQ82pb.js → index.es-Bk1O0p8N.js} +166 -156
  119. package/dist-vue/_chunks/index.es-Bk1O0p8N.js.map +1 -0
  120. package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js → useChatbotStore-C3uKi2FS.js} +114 -106
  121. package/dist-vue/_chunks/useChatbotStore-C3uKi2FS.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-BMa8jwJS.js → utils-Cru8TJxe.js} +48 -30
  123. package/dist-vue/_chunks/utils-Cru8TJxe.js.map +1 -0
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/composables.js +3 -3
  126. package/dist-vue/index.js +3732 -3213
  127. package/dist-vue/index.js.map +1 -1
  128. package/dist-vue/locales.js +43 -7
  129. package/dist-vue/packages/components/src/PkCheckboxField.d.ts +45 -0
  130. package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
  131. package/dist-vue/packages/components/src/{chat/PkToolRequestConfirm.d.ts → PkOfflineScreen.d.ts} +10 -3
  132. package/dist-vue/packages/components/src/PkPwaNotices.d.ts +19 -0
  133. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +18 -3
  134. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +24 -2
  135. package/dist-vue/packages/components/src/chat/PkToolApprovalBadge.d.ts +4 -0
  136. package/dist-vue/packages/components/src/chat/PkToolApprovalCard.d.ts +35 -0
  137. package/dist-vue/packages/components/src/chat/PkToolApprovalPreviewMessage.d.ts +11 -0
  138. package/dist-vue/packages/components/src/chat/index.d.ts +2 -1
  139. package/dist-vue/packages/components/src/chat/toolApprovalPreviews.d.ts +12 -0
  140. package/dist-vue/packages/components/src/chat/toolComponentMap.d.ts +5 -3
  141. package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +6 -0
  142. package/dist-vue/packages/components/src/chat/utils.d.ts +13 -0
  143. package/dist-vue/packages/components/src/index.d.ts +4 -1
  144. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +70 -1
  145. package/dist-vue/packages/composable/src/index.d.ts +1 -0
  146. package/dist-vue/packages/composable/src/useConnectivity.d.ts +28 -0
  147. package/dist-vue/packages/models/src/schema/Agent.d.ts +129 -0
  148. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +30 -0
  149. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +30 -0
  150. package/dist-vue/style.css +1 -1
  151. package/package.json +3 -3
  152. package/dist/_chunks/PkStreamingMarkdown-Djw604Ny.js.map +0 -1
  153. package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js +0 -48
  154. package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js.map +0 -1
  155. package/dist/_chunks/PkToolShowForm-BNV4Ja6g.js.map +0 -1
  156. package/dist/_chunks/VvCombobox.es-CFA-K-cQ.js.map +0 -1
  157. package/dist/_chunks/VvInputText.es-csEQ-bSG.js.map +0 -1
  158. package/dist/_chunks/VvRadioGroup.es-CSNzOJKx.js.map +0 -1
  159. package/dist/_chunks/VvTextarea.es-eEyRRpuT.js +0 -1109
  160. package/dist/_chunks/VvTextarea.es-eEyRRpuT.js.map +0 -1
  161. package/dist/_chunks/dist-BNET2z7b.js.map +0 -1
  162. package/dist/_chunks/dot-prop-BXrC9bAX.js +0 -131
  163. package/dist/_chunks/dot-prop-BXrC9bAX.js.map +0 -1
  164. package/dist/_chunks/floating-ui.vue-CIKvCpTA.js.map +0 -1
  165. package/dist/_chunks/index.es-BYny0uhz.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbot-DHkhT0Jf.js +0 -236
  167. package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js +0 -630
  168. package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js.map +0 -1
  169. package/dist-vue/_chunks/PkChatbotSteps-BpqdFhsG.js +0 -172
  170. package/dist-vue/_chunks/PkChatbotViewChat-C08TsXiL.js.map +0 -1
  171. package/dist-vue/_chunks/PkStreamingMarkdown-DEhbK-3c.js.map +0 -1
  172. package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js +0 -48
  173. package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js.map +0 -1
  174. package/dist-vue/_chunks/PkToolShowForm-C-mWyeka.js.map +0 -1
  175. package/dist-vue/_chunks/createChatbotApiClient-BOBdBxmf.js.map +0 -1
  176. package/dist-vue/_chunks/index.es-XfWQ82pb.js.map +0 -1
  177. package/dist-vue/_chunks/useChatbotStore-BJ-EDmND.js.map +0 -1
  178. package/dist-vue/_chunks/utils-BMa8jwJS.js.map +0 -1
@@ -0,0 +1,752 @@
1
+ import { t as e } from "./PkChatbotError-B2iob9cQ.js";
2
+ import { t } from "./PkStreamingMarkdown-CjBMQ18U.js";
3
+ import "./src-8QXYVWIx.js";
4
+ import { a as n, c as r, o as i, r as a, s as o, t as s } from "./message-RohfrdWS.js";
5
+ import { r as c } from "./text-CeT0hpJK.js";
6
+ import { t as l } from "./PkRelativeTime-C9zd1ffO.js";
7
+ import { t as u } from "./PkChatbotFeedbackForm-C_y__RH8.js";
8
+ import { t as d } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
9
+ import { t as f } from "./PkChatbotFilePreview-DyrszALJ.js";
10
+ import { a as p, f as m, h, i as g, m as _, o as v, p as y, r as ee, s as b, t as x, u as te } from "./utils-Cru8TJxe.js";
11
+ import { n as ne, t as re } from "./PkChatbotSteps-BdU6YC_N.js";
12
+ import { t as S } from "./PkChatbotOutlineRail-np4g6vsz.js";
13
+ import { VvButton as C, VvButtonGroup as w, VvIcon as ie } from "@volverjs/ui-vue/components";
14
+ import { Fragment as T, Transition as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createTextVNode as ae, createVNode as M, defineAsyncComponent as N, defineComponent as P, mergeProps as oe, nextTick as F, normalizeClass as I, normalizeStyle as se, onBeforeUnmount as ce, onMounted as le, openBlock as L, ref as R, renderList as ue, renderSlot as de, resolveDynamicComponent as fe, toDisplayString as z, unref as B, useSlots as pe, useTemplateRef as me, watch as V, withCtx as H, withModifiers as U } from "vue";
15
+ import { useI18n as he } from "vue-i18n";
16
+ //#region ../../packages/components/src/chat/toolComponentMap.ts
17
+ var ge = {
18
+ requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-lo7hCSBC.js")),
19
+ showArtifact: N(() => import("./PkToolShowArtifact-COwSXmF4.js").then((e) => e.n)),
20
+ showCalendarEvent: N(() => import("./PkToolShowCalendarEvent-BmheHwOM.js").then((e) => e.n)),
21
+ showComparison: N(() => import("./PkToolShowComparison-XJuKPuK2.js").then((e) => e.n)),
22
+ showContactForm: N(() => import("./PkToolShowContactForm-DRRtCCxB.js").then((e) => e.n)),
23
+ showDiagram: N(() => import("./PkToolShowDiagram-G0hdi_Vf.js")),
24
+ showEmail: N(() => import("./PkToolShowEmail-C591LR5N.js").then((e) => e.n)),
25
+ showImageGallery: N(() => import("./PkToolShowImageGallery-Bj7YlqbP.js").then((e) => e.n)),
26
+ showLocation: N(() => import("./PkToolShowLocation-5G8p9mED.js").then((e) => e.n)),
27
+ showMessage: N(() => import("./PkToolShowMessage-CbXERPHI.js").then((e) => e.n)),
28
+ showForm: N(() => import("./PkToolShowForm-j7Ha-0X3.js").then((e) => e.n)),
29
+ showMultipleChoice: N(() => import("./PkToolShowForm-j7Ha-0X3.js").then((e) => e.n)),
30
+ showProductList: N(() => import("./PkToolShowProductList-DXMN2UuE.js").then((e) => e.n)),
31
+ showQrCode: N(() => import("./PkToolShowQrCode-DEAvfLFu.js").then((e) => e.n)),
32
+ showSources: N(() => import("./PkToolShowSources-BVLw4W5l.js").then((e) => e.n)),
33
+ showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-DoCHIEzz.js").then((e) => e.n)),
34
+ showVideo: N(() => import("./PkToolShowVideo-Ox8rFd7j.js")),
35
+ showWeather: N(() => import("./PkToolShowWeather-CxDO_5ni.js")),
36
+ showWebPages: N(() => import("./PkToolShowWebPages-CsACREOH.js").then((e) => e.n))
37
+ }, W = {
38
+ key: 0,
39
+ class: "text-12 text-word-3 m-0 mb-xs"
40
+ }, G = /* @__PURE__ */ P({
41
+ __name: "PkToolApprovalPreviewMessage",
42
+ props: { input: {} },
43
+ setup(e) {
44
+ let t = e, n = D(() => {
45
+ let e = t.input;
46
+ return typeof e?.message == "string" ? e.message : "";
47
+ });
48
+ return (e, t) => n.value ? (L(), A("p", W, z(n.value), 1)) : k("", !0);
49
+ }
50
+ }), _e = { [x]: G }, ve = {
51
+ key: 0,
52
+ class: "text-12 text-word-3 m-0 mb-xs"
53
+ }, ye = /* @__PURE__ */ P({
54
+ __name: "PkToolApprovalCard",
55
+ props: {
56
+ part: {},
57
+ actionable: { type: Boolean }
58
+ },
59
+ emits: ["respond"],
60
+ setup(e, { emit: t }) {
61
+ let n = e, r = t, { t: i } = he({ useScope: "global" }), o = D(() => n.part), s = D(() => a(n.part)), c = D(() => s.value === x), l = D(() => c.value ? o.value.state === "input-available" : o.value.state === "approval-requested"), u = D(() => l.value && n.actionable === !0), d = D(() => l.value && n.actionable !== !0), f = D(() => c.value ? o.value.output === "confirmed" : o.value.approval?.approved === !0), p = D(() => c.value ? o.value.output === "cancelled" : o.value.approval?.approved === !1 || o.value.state === "output-denied"), m = D(() => _e[s.value]), h = D(() => {
62
+ if (d.value) return {
63
+ icon: "ri:time-line",
64
+ message: i("toolApproval.expired")
65
+ };
66
+ if (f.value) return {
67
+ icon: "ri:check-line",
68
+ message: i(c.value ? "toolApproval.confirmed" : "toolApproval.approved")
69
+ };
70
+ if (p.value) return {
71
+ icon: "ri:close-line",
72
+ message: i(c.value ? "toolApproval.cancelled" : "toolApproval.denied")
73
+ };
74
+ }), g = D(() => !!h.value && !m.value);
75
+ return (t, n) => {
76
+ let a = C, s = w, d = ie;
77
+ return L(), A("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !g.value }]) }, [
78
+ M(E, null, {
79
+ default: H(() => [!c.value && l.value ? (L(), A("p", ve, z(B(i)("toolApproval.prompt")), 1)) : k("", !0)]),
80
+ _: 1
81
+ }),
82
+ m.value ? (L(), O(fe(m.value), {
83
+ key: 0,
84
+ part: e.part,
85
+ input: o.value.input
86
+ }, null, 8, ["part", "input"])) : k("", !0),
87
+ M(E, { mode: "out-in" }, {
88
+ default: H(() => [h.value ? (L(), A("p", {
89
+ key: 1,
90
+ class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": m.value }])
91
+ }, [M(d, {
92
+ name: h.value.icon,
93
+ class: "shrink-0"
94
+ }, null, 8, ["name"]), ae(" " + z(h.value.message), 1)], 2)) : (L(), O(s, { key: 0 }, {
95
+ default: H(() => [M(a, {
96
+ modifiers: "primary-small",
97
+ disabled: !u.value,
98
+ icon: "ri:check-line",
99
+ label: B(i)("action.proceed"),
100
+ onClick: n[0] ||= U((e) => r("respond", !0), ["stop"])
101
+ }, null, 8, ["disabled", "label"]), M(a, {
102
+ modifiers: "action-quiet-small",
103
+ disabled: !u.value,
104
+ icon: "ri:close-line",
105
+ label: B(i)("action.cancel"),
106
+ onClick: n[1] ||= U((e) => r("respond", !1), ["stop"])
107
+ }, null, 8, ["disabled", "label"])]),
108
+ _: 1
109
+ }))]),
110
+ _: 1
111
+ })
112
+ ], 2);
113
+ };
114
+ }
115
+ }), be = 30, K = 500;
116
+ function xe(e) {
117
+ let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = R(!1), u = R(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
118
+ if (!t.value || l.value) {
119
+ d = !1;
120
+ return;
121
+ }
122
+ d = !0, t.value.scrollTo({
123
+ top: t.value.scrollHeight,
124
+ behavior: e
125
+ }), setTimeout(() => {
126
+ d = !1;
127
+ }, e === "instant" ? 0 : K);
128
+ }, v = (e) => {
129
+ e.deltaY < 0 && (l.value = !0);
130
+ }, y = 0, ee = (e) => {
131
+ y = e.touches[0]?.clientY ?? 0;
132
+ }, b = (e) => {
133
+ let t = e.touches[0]?.clientY ?? 0;
134
+ t > y && (l.value = !0), y = t;
135
+ }, x = () => {
136
+ if (!t.value) return;
137
+ let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
138
+ if (u.value = n - r - e < be, d) {
139
+ g = e;
140
+ return;
141
+ }
142
+ e < g && s?.(), e > g && (u.value && (l.value = !1), c?.()), g = e;
143
+ }, te = () => {
144
+ if (d || l.value || !t.value) return;
145
+ let e = t.value, n = e.scrollHeight - e.clientHeight;
146
+ n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
147
+ d = !1;
148
+ }));
149
+ }, ne = () => {
150
+ f || !t.value || (f = new MutationObserver(te), f.observe(t.value, {
151
+ childList: !0,
152
+ subtree: !0,
153
+ characterData: !0
154
+ }));
155
+ }, re = () => {
156
+ f?.disconnect(), f = null;
157
+ };
158
+ V(n, (e, t) => {
159
+ if (e === "streaming" || e === "submitted") {
160
+ ne();
161
+ return;
162
+ }
163
+ e === "ready" && t === "streaming" || re();
164
+ }), V(r, async () => {
165
+ if (r() && i() !== "assistant") {
166
+ w(), l.value = !1, d = !0;
167
+ try {
168
+ await F(), await o?.(), await F();
169
+ } finally {
170
+ _();
171
+ }
172
+ }
173
+ });
174
+ let S = null, C = () => {
175
+ t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(w, 300)));
176
+ }, w = () => {
177
+ p?.disconnect(), p = null, m?.disconnect(), m = null, S &&= (clearTimeout(S), null);
178
+ };
179
+ return le(() => {
180
+ if (!t.value) return;
181
+ t.value.addEventListener("wheel", v, { passive: !0 }), t.value.addEventListener("touchstart", ee, { passive: !0 }), t.value.addEventListener("touchmove", b, { passive: !0 });
182
+ let e = n() === "submitted" || n() === "streaming";
183
+ e ? ne() : (p = new ResizeObserver(C), p.observe(t.value), m = new MutationObserver(C), m.observe(t.value, {
184
+ childList: !0,
185
+ subtree: !0
186
+ }));
187
+ let r = a?.() ?? t.value.firstElementChild;
188
+ r && (h = new ResizeObserver(te), h.observe(r)), e || C();
189
+ }), ce(() => {
190
+ t.value?.removeEventListener("wheel", v), t.value?.removeEventListener("touchstart", ee), t.value?.removeEventListener("touchmove", b), h?.disconnect(), h = null, re(), w();
191
+ }), {
192
+ handleScroll: x,
193
+ scrollToBottom: _,
194
+ userScrolledUp: l,
195
+ isAtBottom: u
196
+ };
197
+ }
198
+ //#endregion
199
+ //#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
200
+ var Se = ["aria-busy"], Ce = {
201
+ key: 0,
202
+ class: "pk-chatbot-messages__outline"
203
+ }, we = {
204
+ key: 0,
205
+ class: "pk-chatbot-divider"
206
+ }, Te = { class: "pk-chatbot-divider__label" }, Ee = { class: "pk-chatbot-message__text" }, De = ["title"], Oe = {
207
+ key: 0,
208
+ class: "pk-chatbot-message__reaction-emoji"
209
+ }, ke = {
210
+ key: 0,
211
+ class: "pk-chatbot-message__loading-info"
212
+ }, Ae = { class: "flex gap-8 items-center" }, je = { class: "font-mono rounded text-12" }, Me = { class: "flex gap-8 items-center" }, Ne = {
213
+ key: 0,
214
+ class: "pk-chatbot-message__footer"
215
+ }, Pe = {
216
+ key: 0,
217
+ class: "pk-chatbot-message__hover-meta"
218
+ }, Fe = ["datetime", "title"], Ie = { class: "truncate" }, Le = {
219
+ key: 0,
220
+ class: "flex items-center gap-4 min-w-0"
221
+ }, Re = { class: "truncate" }, ze = {
222
+ key: 1,
223
+ class: "flex items-center gap-4 text-12 text-word-3"
224
+ }, Be = { class: "truncate" }, Ve = ["datetime"], He = { class: "truncate" }, Ue = {
225
+ key: 3,
226
+ class: "flex items-center gap-4 text-12 text-word-3"
227
+ }, We = ["title", "aria-label"], q = /* @__PURE__ */ P({
228
+ __name: "PkChatbotMessages",
229
+ props: {
230
+ status: {},
231
+ messages: {},
232
+ error: {},
233
+ actions: {},
234
+ mainColor: {},
235
+ textColor: {},
236
+ revisedAnswers: {},
237
+ messageFeedbacks: {},
238
+ readonlyFeedback: { type: Boolean },
239
+ disableHeightAdjustment: { type: Boolean },
240
+ showMessageDateTime: { type: Boolean },
241
+ showMessageTokensCount: { type: Boolean },
242
+ showAllMessageParts: { type: Boolean },
243
+ interactive: { type: Boolean },
244
+ showExtendedSteps: { type: Boolean },
245
+ isDark: { type: Boolean },
246
+ showScrollToBottom: { type: Boolean },
247
+ feedbackMessageId: {},
248
+ feedbackLoading: { type: Boolean },
249
+ feedbackSubmitted: { type: Boolean },
250
+ feedbackError: {}
251
+ },
252
+ emits: [
253
+ "show-info",
254
+ "regenerate",
255
+ "revise",
256
+ "upvote",
257
+ "downvote",
258
+ "feedback",
259
+ "feedback-submit",
260
+ "feedback-close",
261
+ "scroll-up",
262
+ "scroll-down",
263
+ "auto-retry",
264
+ "reset-chat",
265
+ "approval-respond",
266
+ "confirm-respond"
267
+ ],
268
+ setup(x, { emit: N }) {
269
+ let P = x, ce = N, { t: W, d: G, n: _e } = he({ useScope: "global" }), ve = pe(), be = (e, t) => {
270
+ if (y(e)) {
271
+ let n = e.toolCallId;
272
+ n && ce("confirm-respond", {
273
+ toolCallId: n,
274
+ confirmed: t
275
+ });
276
+ return;
277
+ }
278
+ let n = v(e);
279
+ n && ce("approval-respond", {
280
+ id: n,
281
+ approved: t
282
+ });
283
+ }, K = me("scrollEl"), q = me("wrapperEl"), Ge = D(() => h(P.textColor, P.mainColor)), { handleScroll: Ke, scrollToBottom: qe, userScrolledUp: Je, isAtBottom: Ye } = xe({
284
+ scrollEl: K,
285
+ status: () => P.status,
286
+ messagesLength: () => P.messages?.length,
287
+ lastMessageRole: () => P.messages?.[P.messages.length - 1]?.role,
288
+ contentEl: () => q.value,
289
+ beforeNewMessageScroll: () => it(),
290
+ onScrollUp: () => ce("scroll-up"),
291
+ onScrollDown: () => ce("scroll-down")
292
+ }), Xe = () => {
293
+ Je.value = !1, qe();
294
+ }, J = D(() => (P.messages ?? []).filter((e) => e.role === "user").map((e) => ({
295
+ id: e.id,
296
+ preview: e.parts.find(o)?.text.trim().slice(0, 120) || "…"
297
+ }))), Ze = R(), Qe = () => K.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], $e = () => {
298
+ let e = K.value;
299
+ if (!e || !P.showScrollToBottom) return;
300
+ let t = e.getBoundingClientRect().top + e.clientHeight / 2, n = J.value[0]?.id;
301
+ Qe().forEach((e, r) => {
302
+ e.getBoundingClientRect().top <= t && (n = J.value[r]?.id);
303
+ }), Ze.value = n;
304
+ };
305
+ V(J, async () => {
306
+ await F(), $e();
307
+ });
308
+ let et = () => {
309
+ Ke(), $e();
310
+ }, tt = (e) => {
311
+ let t = K.value, n = J.value.findIndex((t) => t.id === e), r = Qe()[n];
312
+ !t || !r || (Je.value = !0, t.scrollTo({
313
+ top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
314
+ behavior: "smooth"
315
+ }));
316
+ }, nt = R(0), rt = R(!1), it = async () => {
317
+ let e = P.messages;
318
+ if (!e?.length || P.disableHeightAdjustment || !(e[e.length - 1].role === "user" || P.status === "submitted" || P.status === "streaming") || (rt.value = !1, await F(), !K.value)) return;
319
+ let { paddingTop: t, paddingBottom: n } = getComputedStyle(K.value), r = K.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = q.value && Number.parseFloat(getComputedStyle(q.value).rowGap) || 0, a = Qe(), o = r - (a[a.length - 1]?.clientHeight ?? 0) - i;
320
+ o > 0 && (nt.value = o), await F();
321
+ };
322
+ V(() => [P.messages?.length, P.messages?.[P.messages.length - 1]?.id], () => it()), le(() => {
323
+ (P.status === "submitted" || P.status === "streaming") && it();
324
+ }), V(() => P.status, (e) => {
325
+ (e === "ready" || e === "error") && (rt.value = !0, nt.value = 0);
326
+ });
327
+ let at = (e) => P.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => P.messageFeedbacks?.find((t) => t.messageId === e), ot = (e, t) => !P.readonlyFeedback && St(e, t), st = (e) => P.readonlyFeedback ? Y(e) : void 0, ct = (e) => st(e)?.vote, lt = (e) => {
328
+ let t = st(e);
329
+ if (t?.vote) return;
330
+ let n = t?.metadata?.reactionEmoji;
331
+ return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
332
+ }, ut = (e) => !!(ct(e) || lt(e)), dt = (e) => {
333
+ if (lt(e)) return "pk-chatbot-message__reaction--neutral";
334
+ let t = ct(e);
335
+ return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
336
+ }, ft = (e) => {
337
+ let t = ct(e);
338
+ return W(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
339
+ }, pt = (e) => {
340
+ let t = gt(e);
341
+ for (let e = t.length - 1; e >= 0; --e) if (o(t[e])) return e;
342
+ return -1;
343
+ }, mt = D(() => P.messages?.[P.messages.length - 1]), X = D(() => {
344
+ let e = mt.value;
345
+ return e ? e.parts[e.parts.length - 1] : null;
346
+ }), ht = D(() => {
347
+ let e = /* @__PURE__ */ new Map();
348
+ for (let t of P.messages ?? []) t.role === "assistant" && e.set(t.id, _(t.parts));
349
+ return e;
350
+ }), gt = (e) => ht.value.get(e.id) ?? e.parts, Z = D(() => P.status === "submitted" || P.status === "streaming"), _t = D(() => P.status === "error"), vt = D(() => {
351
+ let e = X.value;
352
+ return b(W, e);
353
+ }), yt = D(() => {
354
+ let e = X.value;
355
+ return g(e);
356
+ }), bt = (e) => P.messages?.findIndex((t) => t.id === e), Q = (e) => e === void 0 || !P.messages ? !1 : e === P.messages.length - 1, xt = (e) => Q(e) && P.status === "ready" && !!P.actions?.includes("regenerate"), St = (e, t) => (!Q(t) || P.status === "ready") && !!P.actions?.includes(e), Ct = (e) => {
357
+ let t = e.parts[e.parts.length - 1];
358
+ return o(t);
359
+ }, wt = (e) => e.parts.some((e) => i(e) || r(e)), Tt = (e) => !!P.showExtendedSteps && $(e) && wt(e), $ = (e) => e.role === "assistant", Et = (e) => e.role === "user", Dt = (e) => P.messages?.slice(0, e).reverse().find((e) => $(e)), Ot = (e) => P.messages?.slice(e + 1).find((e) => $(e)), kt = (e) => {
360
+ let t = Dt(e)?.metadata?.createdAt, n = Ot(e)?.metadata?.createdAt;
361
+ if (!t || !n) return;
362
+ let r = new Date(t), i = new Date(n);
363
+ return r.toDateString() === i.toDateString() ? void 0 : i;
364
+ }, At = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(P.actions?.length || P.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || P.showMessageTokensCount && e.metadata?.totalTokens !== void 0), jt = (e) => {
365
+ let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
366
+ return G(t, n ? "time" : "date-time");
367
+ }, Mt = (e) => {
368
+ let { createdAt: t, completedAt: n } = e.metadata ?? {};
369
+ if (!(!t || !n)) return ee(_e, n - t);
370
+ }, Nt = me("feedbackMessageEl");
371
+ return V(() => P.feedbackMessageId, async () => {
372
+ if (await F(), !P.feedbackMessageId) return;
373
+ let e = Nt.value?.[0]?.$el;
374
+ if (e) {
375
+ if (Q(bt(P.feedbackMessageId))) {
376
+ qe();
377
+ return;
378
+ }
379
+ e.scrollIntoView({
380
+ behavior: "smooth",
381
+ block: "center"
382
+ });
383
+ }
384
+ }), (i, h) => {
385
+ let _ = ie, v = C, ee = w;
386
+ return L(), A("div", {
387
+ ref_key: "scrollEl",
388
+ ref: K,
389
+ class: I(["pk-chatbot-messages", { "pk-chatbot-messages--settling": rt.value }]),
390
+ role: "log",
391
+ "aria-live": "polite",
392
+ "aria-relevant": "additions text",
393
+ "aria-busy": Z.value,
394
+ style: se({
395
+ "--chatbot-main-color": x.mainColor,
396
+ "--chatbot-contrast-color": Ge.value
397
+ }),
398
+ onScroll: et
399
+ }, [
400
+ x.showScrollToBottom && J.value.length > 1 ? (L(), A("div", Ce, [M(S, {
401
+ items: J.value,
402
+ "active-id": Ze.value,
403
+ onSelect: tt
404
+ }, null, 8, ["items", "active-id"])])) : k("", !0),
405
+ j("div", {
406
+ ref_key: "wrapperEl",
407
+ ref: q,
408
+ class: "pk-chatbot-messages__wrapper"
409
+ }, [
410
+ (L(!0), A(T, null, ue(x.messages, (e, b) => (L(), A(T, { key: e.id }, [Et(e) && kt(b) ? (L(), A("div", we, [j("span", Te, z(B(G)(kt(b), "short")), 1)])) : k("", !0), e.parts.length || Q(b) && Z.value && $(e) ? (L(), A("div", {
411
+ key: 1,
412
+ class: I(["pk-chatbot-message", [`pk-chatbot-message--${e.role}`, { "pk-chatbot-message--loading": Z.value && Q(b) && $(e) }]]),
413
+ style: se({ minHeight: Q(b) && $(e) && !_t.value ? `${nt.value}px` : void 0 })
414
+ }, [
415
+ M(E, {
416
+ appear: "",
417
+ name: "pk-chatbot-part"
418
+ }, {
419
+ default: H(() => [Tt(e) ? (L(), O(re, {
420
+ key: 0,
421
+ message: e,
422
+ "is-streaming": Z.value && Q(b),
423
+ "is-dark": x.isDark
424
+ }, null, 8, [
425
+ "message",
426
+ "is-streaming",
427
+ "is-dark"
428
+ ])) : k("", !0)]),
429
+ _: 2
430
+ }, 1024),
431
+ (L(!0), A(T, null, ue(gt(e), (l, u) => (L(), A(T, { key: u }, [B(o)(l) && l.text.trim() ? (L(), O(E, {
432
+ key: 0,
433
+ appear: "",
434
+ name: "pk-chatbot-part"
435
+ }, {
436
+ default: H(() => [j("div", Ee, [de(i.$slots, "text", oe({ ref_for: !0 }, {
437
+ message: e,
438
+ part: l,
439
+ index: b,
440
+ isLoading: Z.value
441
+ }), () => [$(e) ? (L(), O(t, {
442
+ key: 0,
443
+ class: "wysiwyg",
444
+ markdown: l.text,
445
+ "is-dark": x.isDark,
446
+ loading: Q(b) && x.status === "streaming"
447
+ }, null, 8, [
448
+ "markdown",
449
+ "is-dark",
450
+ "loading"
451
+ ])) : (L(), A(T, { key: 1 }, [ae(z(l.text), 1)], 64))]), ut(e.id) && !Y(e.id)?.comment && u === pt(e) ? (L(), A("span", {
452
+ key: 0,
453
+ class: I(["pk-chatbot-message__reaction", dt(e.id)]),
454
+ title: ft(e.id)
455
+ }, [lt(e.id) ? (L(), A("span", Oe, z(lt(e.id)), 1)) : (L(), O(_, {
456
+ key: 1,
457
+ name: ct(e.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
458
+ }, null, 8, ["name"]))], 10, De)) : k("", !0)])]),
459
+ _: 2
460
+ }, 1024)) : B(n)(l) ? (L(), O(E, {
461
+ key: 1,
462
+ appear: "",
463
+ name: "pk-chatbot-part"
464
+ }, {
465
+ default: H(() => [M(f, {
466
+ "media-type": l.mediaType,
467
+ url: l.url,
468
+ filename: l.filename,
469
+ size: B(s)(l)?.bytesCount
470
+ }, null, 8, [
471
+ "media-type",
472
+ "url",
473
+ "filename",
474
+ "size"
475
+ ])]),
476
+ _: 2
477
+ }, 1024)) : B(te)(l) && !B(m)(l) ? (L(), O(E, {
478
+ key: 2,
479
+ appear: "",
480
+ name: "pk-chatbot-part"
481
+ }, {
482
+ default: H(() => [(L(), O(ye, {
483
+ key: `approval-${u}`,
484
+ part: l,
485
+ actionable: x.interactive === !0 && (B(y)(l) || Q(b)),
486
+ onRespond: (e) => be(l, e)
487
+ }, null, 8, [
488
+ "part",
489
+ "actionable",
490
+ "onRespond"
491
+ ]))]),
492
+ _: 2
493
+ }, 1024)) : B(r)(l) && !B(m)(l) && (B(ge)[B(a)(l)] || B(ve)[l.type] || x.showAllMessageParts) ? (L(), O(E, {
494
+ key: 3,
495
+ appear: "",
496
+ name: "pk-chatbot-part"
497
+ }, {
498
+ default: H(() => [!B(ve)[l.type] && B(ge)[B(a)(l)] ? (L(), O(fe(B(ge)[B(a)(l)]), {
499
+ key: `component-${u}-${B(p)(l)}`,
500
+ part: l
501
+ }, null, 8, ["part"])) : de(i.$slots, l.type, oe({ ref_for: !0 }, {
502
+ message: e,
503
+ part: l,
504
+ index: b,
505
+ isLoading: Z.value
506
+ }), () => [x.showAllMessageParts ? (L(), A("div", ke, [j("div", Ae, [B(g)(l) ? (L(), O(_, {
507
+ key: 0,
508
+ name: B(g)(l),
509
+ class: "shrink-0"
510
+ }, null, 8, ["name"])) : k("", !0), j("code", je, z(B(c)(l.type)), 1)])])) : k("", !0)], void 0, 1)]),
511
+ _: 2
512
+ }, 1024)) : k("", !0), M(E, { mode: "out-in" }, {
513
+ default: H(() => [u === pt(e) && x.readonlyFeedback && Y(e.id)?.comment ? (L(), O(d, {
514
+ key: 0,
515
+ feedback: Y(e.id)
516
+ }, null, 8, ["feedback"])) : k("", !0)]),
517
+ _: 2
518
+ }, 1024)], 64))), 128)),
519
+ M(E, {
520
+ name: "fade-in",
521
+ mode: "out-in"
522
+ }, {
523
+ default: H(() => [Z.value && Q(b) && !Ct(e) && $(e) && !Tt(e) ? (L(), A("div", {
524
+ key: `loading-info-${e.id}`,
525
+ class: "pk-chatbot-message__loading-info"
526
+ }, [j("div", Me, [
527
+ M(_, {
528
+ name: "line-md:loading-loop",
529
+ class: "shrink-0"
530
+ }),
531
+ M(E, { mode: "out-in" }, {
532
+ default: H(() => [yt.value ? (L(), O(_, {
533
+ key: yt.value,
534
+ class: "shrink-0",
535
+ name: yt.value
536
+ }, null, 8, ["name"])) : k("", !0)]),
537
+ _: 1
538
+ }),
539
+ M(E, { mode: "out-in" }, {
540
+ default: H(() => [vt.value ? (L(), A("span", {
541
+ key: vt.value,
542
+ class: "text-12"
543
+ }, z(vt.value), 1)) : k("", !0)]),
544
+ _: 1
545
+ })
546
+ ]), M(E, {
547
+ name: "fade-in",
548
+ mode: "out-in"
549
+ }, {
550
+ default: H(() => [X.value && "text" in X.value && X.value.text.trim() ? (L(), O(ne, {
551
+ key: 0,
552
+ markdown: X.value.text,
553
+ "is-dark": x.isDark,
554
+ "inner-class": "wysiwyg",
555
+ class: "border border-surface-4 rounded p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
556
+ }, null, 8, ["markdown", "is-dark"])) : k("", !0)]),
557
+ _: 1
558
+ })])) : k("", !0)]),
559
+ _: 2
560
+ }, 1024),
561
+ M(E, { mode: "out-in" }, {
562
+ default: H(() => [At(e, b) ? (L(), A("div", Ne, [
563
+ M(ee, {
564
+ modifiers: "compact",
565
+ class: "mr-auto shrink-0"
566
+ }, {
567
+ default: H(() => [
568
+ M(E, { mode: "out-in" }, {
569
+ default: H(() => [xt(b) ? (L(), O(v, {
570
+ key: 0,
571
+ icon: "ri:reset-right-line",
572
+ modifiers: "action-quiet-small",
573
+ title: B(W)("action.regenerate"),
574
+ "aria-label": B(W)("action.regenerate"),
575
+ onClick: h[0] ||= U((e) => i.$emit("regenerate"), ["stop"])
576
+ }, null, 8, ["title", "aria-label"])) : k("", !0)]),
577
+ _: 2
578
+ }, 1024),
579
+ M(E, { mode: "out-in" }, {
580
+ default: H(() => [St("show-info", b) ? (L(), O(v, {
581
+ key: 0,
582
+ icon: "ri:information-line",
583
+ title: B(W)("action.getMoreInfo"),
584
+ "aria-label": B(W)("action.getMoreInfo"),
585
+ modifiers: "action-quiet-small",
586
+ onClick: U((t) => i.$emit("show-info", e), ["stop"])
587
+ }, null, 8, [
588
+ "title",
589
+ "aria-label",
590
+ "onClick"
591
+ ])) : k("", !0)]),
592
+ _: 2
593
+ }, 1024),
594
+ M(E, { mode: "out-in" }, {
595
+ default: H(() => [St("revise", b) ? (L(), O(v, {
596
+ key: 0,
597
+ icon: at(e.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
598
+ title: at(e.id) ? B(W)("action.editRevise") : B(W)("action.createRevise"),
599
+ "aria-label": at(e.id) ? B(W)("action.editRevise") : B(W)("action.createRevise"),
600
+ modifiers: "action-quiet-small",
601
+ class: I({ "text-brand": at(e.id) }),
602
+ onClick: U((t) => i.$emit("revise", e), ["stop"])
603
+ }, null, 8, [
604
+ "icon",
605
+ "title",
606
+ "aria-label",
607
+ "class",
608
+ "onClick"
609
+ ])) : k("", !0)]),
610
+ _: 2
611
+ }, 1024),
612
+ M(E, { mode: "out-in" }, {
613
+ default: H(() => [ot("upvote", b) ? (L(), O(v, {
614
+ key: 0,
615
+ icon: Y(e.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
616
+ title: B(W)("action.upvote"),
617
+ "aria-label": B(W)("action.upvote"),
618
+ modifiers: "action-quiet-small",
619
+ onClick: U((t) => i.$emit("upvote", e), ["stop"])
620
+ }, null, 8, [
621
+ "icon",
622
+ "title",
623
+ "aria-label",
624
+ "onClick"
625
+ ])) : k("", !0)]),
626
+ _: 2
627
+ }, 1024),
628
+ M(E, { mode: "out-in" }, {
629
+ default: H(() => [ot("downvote", b) ? (L(), O(v, {
630
+ key: 0,
631
+ icon: Y(e.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
632
+ title: B(W)("action.downvote"),
633
+ "aria-label": B(W)("action.downvote"),
634
+ modifiers: "action-quiet-small",
635
+ onClick: U((t) => i.$emit("downvote", e), ["stop"])
636
+ }, null, 8, [
637
+ "icon",
638
+ "title",
639
+ "aria-label",
640
+ "onClick"
641
+ ])) : k("", !0)]),
642
+ _: 2
643
+ }, 1024),
644
+ M(E, { mode: "out-in" }, {
645
+ default: H(() => [ot("feedback", b) ? (L(), O(v, {
646
+ key: 0,
647
+ icon: Y(e.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
648
+ title: B(W)("action.feedback"),
649
+ "aria-label": B(W)("action.feedback"),
650
+ modifiers: "action-quiet-small",
651
+ onClick: U((t) => i.$emit("feedback", e), ["stop"])
652
+ }, null, 8, [
653
+ "icon",
654
+ "title",
655
+ "aria-label",
656
+ "onClick"
657
+ ])) : k("", !0)]),
658
+ _: 2
659
+ }, 1024)
660
+ ]),
661
+ _: 2
662
+ }, 1024),
663
+ !x.showMessageDateTime && e.metadata?.createdAt && e.metadata?.completedAt ? (L(), A("div", Pe, [j("time", {
664
+ datetime: new Date(e.metadata.createdAt).toISOString(),
665
+ title: B(G)(new Date(e.metadata.createdAt), "date-time"),
666
+ class: "flex items-center gap-4 min-w-0"
667
+ }, [M(_, {
668
+ name: "ri:time-line",
669
+ class: "shrink-0"
670
+ }), j("span", Ie, z(jt(e.metadata.createdAt)), 1)], 8, Fe), Mt(e) ? (L(), A("span", Le, [M(_, {
671
+ name: "ri:hourglass-line",
672
+ class: "shrink-0"
673
+ }), j("span", Re, z(Mt(e)), 1)])) : k("", !0)])) : k("", !0),
674
+ x.showMessageTokensCount && e.metadata?.totalTokens ? (L(), A("span", ze, [M(_, {
675
+ name: "ri:ai-generate-2-line",
676
+ class: "shrink-0"
677
+ }), j("span", Be, z(B(_e)(e.metadata.totalTokens, "integer")) + " " + z(B(W)("label.tokens")), 1)])) : k("", !0),
678
+ x.showMessageDateTime && e.metadata?.createdAt ? (L(), A("time", {
679
+ key: 2,
680
+ datetime: new Date(e.metadata?.createdAt).toISOString(),
681
+ class: "flex items-center gap-4 text-12 text-word-3"
682
+ }, [M(_, {
683
+ name: "ri:time-line",
684
+ class: "shrink-0"
685
+ }), j("span", He, z(B(G)(new Date(e.metadata?.createdAt), "date-time")), 1)], 8, Ve)) : k("", !0),
686
+ x.showMessageDateTime && e?.metadata?.completedAt && e?.metadata?.createdAt ? (L(), A("div", Ue, [M(_, {
687
+ name: "ri:hourglass-line",
688
+ class: "shrink-0"
689
+ }), M(l, {
690
+ class: "truncate",
691
+ date: e.metadata?.createdAt,
692
+ "end-date": e.metadata?.completedAt
693
+ }, null, 8, ["date", "end-date"])])) : k("", !0)
694
+ ])) : k("", !0)]),
695
+ _: 2
696
+ }, 1024),
697
+ M(E, { mode: "out-in" }, {
698
+ default: H(() => [e.id === x.feedbackMessageId ? (L(), O(u, {
699
+ key: 0,
700
+ ref_for: !0,
701
+ ref_key: "feedbackMessageEl",
702
+ ref: Nt,
703
+ loading: x.feedbackLoading,
704
+ submitted: x.feedbackSubmitted,
705
+ error: x.feedbackError,
706
+ onSubmit: h[1] ||= (e) => i.$emit("feedback-submit", e),
707
+ onClose: h[2] ||= (e) => i.$emit("feedback-close")
708
+ }, null, 8, [
709
+ "loading",
710
+ "submitted",
711
+ "error"
712
+ ])) : k("", !0)]),
713
+ _: 2
714
+ }, 1024)
715
+ ], 6)) : k("", !0)], 64))), 128)),
716
+ M(E, {
717
+ appear: "",
718
+ name: "pk-chatbot-part"
719
+ }, {
720
+ default: H(() => [_t.value ? (L(), O(e, {
721
+ key: 0,
722
+ error: x.error,
723
+ onRetry: h[3] ||= (e) => i.$emit("auto-retry"),
724
+ onReset: h[4] ||= (e) => i.$emit("reset-chat")
725
+ }, null, 8, ["error"])) : k("", !0)]),
726
+ _: 1
727
+ }),
728
+ mt.value?.role === "user" || _t.value ? (L(), A("div", {
729
+ key: 0,
730
+ class: "pk-chatbot-messages__spacer",
731
+ style: se({ minHeight: `${nt.value}px` })
732
+ }, null, 4)) : k("", !0)
733
+ ], 512),
734
+ M(E, { name: "pk-chatbot-messages-fab" }, {
735
+ default: H(() => [x.showScrollToBottom && (B(Je) || !B(Ye)) ? (L(), A("button", {
736
+ key: 0,
737
+ type: "button",
738
+ class: "pk-chatbot-messages__scroll-to-bottom",
739
+ title: B(W)("action.scrollToBottom"),
740
+ "aria-label": B(W)("action.scrollToBottom"),
741
+ onClick: Xe
742
+ }, [M(_, { name: "ri:arrow-down-line" })], 8, We)) : k("", !0)]),
743
+ _: 1
744
+ })
745
+ ], 46, Se);
746
+ };
747
+ }
748
+ });
749
+ //#endregion
750
+ export { q as t };
751
+
752
+ //# sourceMappingURL=PkChatbotMessages-B3G12zah.js.map