@8wave/ai-elements 0.115.0-beta.34 → 0.115.0-beta.52

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 (185) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/{Agent-Cu04vBnd.js → Agent-CJbRpoZG.js} +133 -122
  3. package/dist/_chunks/Agent-CJbRpoZG.js.map +1 -0
  4. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js +256 -0
  5. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js.map +1 -0
  6. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js +42 -0
  7. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js.map +1 -0
  8. package/dist/_chunks/{PkStreamingMarkdown-Qk9Tk_N7.js → PkStreamingMarkdown-B_qmgO9_.js} +801 -745
  9. package/dist/_chunks/PkStreamingMarkdown-B_qmgO9_.js.map +1 -0
  10. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js +41 -0
  11. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js.map +1 -0
  12. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js → PkToolRequestGeolocation-YW0ilIxN.js} +2 -2
  13. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js.map → PkToolRequestGeolocation-YW0ilIxN.js.map} +1 -1
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js → PkToolRequestOAuthConnection-Cx4aFL5g.js} +2 -2
  15. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js.map → PkToolRequestOAuthConnection-Cx4aFL5g.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js → PkToolShowArtifact-Bgj02cPe.js} +2 -2
  17. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js.map → PkToolShowArtifact-Bgj02cPe.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js → PkToolShowContactForm-Die8UpNv.js} +2 -2
  19. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js.map → PkToolShowContactForm-Die8UpNv.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js → PkToolShowForm-Dmq95u6b.js} +5 -5
  21. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js.map → PkToolShowForm-Dmq95u6b.js.map} +1 -1
  22. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js +88 -0
  23. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js.map +1 -0
  24. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js +72 -0
  25. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js.map +1 -0
  26. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js → PkToolShowSources-MJRFeqMA.js} +3 -3
  27. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js.map → PkToolShowSources-MJRFeqMA.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js → PkToolShowSuggestedReply-DPVS3C74.js} +2 -2
  29. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js.map → PkToolShowSuggestedReply-DPVS3C74.js.map} +1 -1
  30. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js +142 -0
  31. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js.map +1 -0
  32. package/dist/_chunks/{PkToolShowWebPages-BOxbTe2X.js → PkToolShowWebPages-CYbiGa7e.js} +31 -24
  33. package/dist/_chunks/PkToolShowWebPages-CYbiGa7e.js.map +1 -0
  34. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js +46 -0
  35. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js.map +1 -0
  36. package/dist/_chunks/{markdown-_p-gd9w8.js → markdown-qIVVfGoX.js} +146 -73
  37. package/dist/_chunks/markdown-qIVVfGoX.js.map +1 -0
  38. package/dist/ai-elements.es.js +2975 -3134
  39. package/dist/ai-elements.es.js.map +1 -1
  40. package/dist-vue/PkChatbot.js +1 -1
  41. package/dist-vue/PkChatbotEmptyState.js +1 -1
  42. package/dist-vue/PkChatbotFilePreview.js +1 -1
  43. package/dist-vue/PkChatbotInput.js +1 -1
  44. package/dist-vue/PkChatbotMessages.js +1 -1
  45. package/dist-vue/PkChatbotStepPayload.js +1 -1
  46. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  47. package/dist-vue/PkChatbotSteps.js +1 -1
  48. package/dist-vue/PkChatbotViewChat.js +1 -1
  49. package/dist-vue/PkChatbotViewConversations.js +1 -1
  50. package/dist-vue/PkChatbotViewFiles.js +1 -1
  51. package/dist-vue/PkChatbotViewProfile.js +1 -1
  52. package/dist-vue/_chunks/{Agent-KbZm8GvA.js → Agent---jwXeaB.js} +57 -46
  53. package/dist-vue/_chunks/Agent---jwXeaB.js.map +1 -0
  54. package/dist-vue/_chunks/{Document-DCSWwcRE.js → Document-DmBTgjd4.js} +150 -77
  55. package/dist-vue/_chunks/Document-DmBTgjd4.js.map +1 -0
  56. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js +275 -0
  57. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js → PkChatbotEmptyState-BY3f3T0T.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js.map → PkChatbotEmptyState-BY3f3T0T.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotFilePreview-CwiVQDF2.js → PkChatbotFilePreview-Dq9JBX9U.js} +5 -3
  61. package/dist-vue/_chunks/PkChatbotFilePreview-Dq9JBX9U.js.map +1 -0
  62. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js → PkChatbotInput-C5l6QDQY.js} +3 -3
  63. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js.map → PkChatbotInput-C5l6QDQY.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js +769 -0
  65. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js → PkChatbotStepPayload-C-xnhmzZ.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js.map → PkChatbotStepPayload-C-xnhmzZ.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js → PkChatbotStepToolDetail-Cko1vU0N.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js.map → PkChatbotStepToolDetail-Cko1vU0N.js.map} +1 -1
  70. package/dist-vue/_chunks/PkChatbotSteps-BkZ3Kq2M.js +191 -0
  71. package/dist-vue/_chunks/{PkChatbotSteps-Y6kQ00ui.js.map → PkChatbotSteps-BkZ3Kq2M.js.map} +1 -1
  72. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js +789 -0
  73. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js.map +1 -0
  74. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js → PkChatbotViewConversations-C6T4ZxxX.js} +2 -2
  75. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js.map → PkChatbotViewConversations-C6T4ZxxX.js.map} +1 -1
  76. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js +125 -0
  77. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js.map +1 -0
  78. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js → PkChatbotViewProfile-CDCy1LEX.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js.map → PkChatbotViewProfile-CDCy1LEX.js.map} +1 -1
  80. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js +41 -0
  81. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js.map +1 -0
  82. package/dist-vue/_chunks/{PkStreamingMarkdown-CJlfq7ub.js → PkStreamingMarkdown-DJG-aPx2.js} +792 -780
  83. package/dist-vue/_chunks/PkStreamingMarkdown-DJG-aPx2.js.map +1 -0
  84. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js → PkSvgViewer-D1y8hZRW.js} +2 -2
  85. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js.map → PkSvgViewer-D1y8hZRW.js.map} +1 -1
  86. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js +40 -0
  87. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js.map +1 -0
  88. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js → PkToolRequestGeolocation-Ccbhljmn.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js.map → PkToolRequestGeolocation-Ccbhljmn.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js → PkToolRequestOAuthConnection-BXf5ZRzR.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js.map → PkToolRequestOAuthConnection-BXf5ZRzR.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js → PkToolShowArtifact-BsfbvfVC.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js.map → PkToolShowArtifact-BsfbvfVC.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js → PkToolShowContactForm-C-YbtBlG.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js.map → PkToolShowContactForm-C-YbtBlG.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js → PkToolShowDiagram-CIHVrQ3e.js} +3 -3
  97. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js.map → PkToolShowDiagram-CIHVrQ3e.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js → PkToolShowEmail-C591LR5N.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js.map → PkToolShowEmail-C591LR5N.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js → PkToolShowForm-BwYJhEVO.js} +6 -6
  101. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js.map → PkToolShowForm-BwYJhEVO.js.map} +1 -1
  102. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js +88 -0
  103. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js.map +1 -0
  104. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js → PkToolShowMessage-CbXERPHI.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js.map → PkToolShowMessage-CbXERPHI.js.map} +1 -1
  106. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js +72 -0
  107. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js.map +1 -0
  108. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js → PkToolShowSources-BQpdJE_m.js} +4 -4
  109. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js.map → PkToolShowSources-BQpdJE_m.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js → PkToolShowSuggestedReply-D3jLsbKJ.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js.map → PkToolShowSuggestedReply-D3jLsbKJ.js.map} +1 -1
  112. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js +141 -0
  113. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js.map +1 -0
  114. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js +86 -0
  115. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js.map +1 -0
  116. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js → PkUrl-CN1kkZiH.js} +2 -2
  117. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js.map → PkUrl-CN1kkZiH.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js → createChatbotApiClient-CDrs7NwO.js} +13 -9
  119. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js.map → createChatbotApiClient-CDrs7NwO.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-DEELIJ89.js → useChatbotStore-D6YNk8Rx.js} +6 -4
  121. package/dist-vue/_chunks/useChatbotStore-D6YNk8Rx.js.map +1 -0
  122. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js +71 -0
  123. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js.map +1 -0
  124. package/dist-vue/_chunks/utils-roi6YVNC.js +199 -0
  125. package/dist-vue/_chunks/utils-roi6YVNC.js.map +1 -0
  126. package/dist-vue/api.js +1 -1
  127. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  128. package/dist-vue/composables.js +73 -13
  129. package/dist-vue/composables.js.map +1 -1
  130. package/dist-vue/index.js +3614 -3559
  131. package/dist-vue/index.js.map +1 -1
  132. package/dist-vue/locales.js +26 -14
  133. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  134. package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +5 -0
  135. package/dist-vue/packages/components/src/chat/PkHeldImage.d.ts +21 -0
  136. package/dist-vue/packages/components/src/chat/PkToolEditSpreadsheet.d.ts +14 -0
  137. package/dist-vue/packages/components/src/chat/chatImagePolicy.d.ts +55 -0
  138. package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
  139. package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +17 -1
  140. package/dist-vue/packages/components/src/chat/utils.d.ts +8 -0
  141. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +7 -1
  142. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  143. package/dist-vue/packages/composable/src/useFileRow.d.ts +21 -0
  144. package/dist-vue/packages/models/src/schema/Agent.d.ts +28 -0
  145. package/dist-vue/packages/models/src/schema/Document.d.ts +173 -0
  146. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  147. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  148. package/dist-vue/packages/models/src/schema/Tabular.d.ts +181 -0
  149. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  150. package/dist-vue/style.css +1 -1
  151. package/package.json +1 -1
  152. package/dist/_chunks/Agent-Cu04vBnd.js.map +0 -1
  153. package/dist/_chunks/PkStreamingMarkdown-Qk9Tk_N7.js.map +0 -1
  154. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js +0 -75
  155. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js.map +0 -1
  156. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js +0 -65
  157. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js.map +0 -1
  158. package/dist/_chunks/PkToolShowVideo-DClps9oP.js +0 -123
  159. package/dist/_chunks/PkToolShowVideo-DClps9oP.js.map +0 -1
  160. package/dist/_chunks/PkToolShowWebPages-BOxbTe2X.js.map +0 -1
  161. package/dist/_chunks/markdown-_p-gd9w8.js.map +0 -1
  162. package/dist-vue/_chunks/Agent-KbZm8GvA.js.map +0 -1
  163. package/dist-vue/_chunks/Document-DCSWwcRE.js.map +0 -1
  164. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js +0 -272
  165. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +0 -1
  167. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js +0 -769
  168. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js.map +0 -1
  169. package/dist-vue/_chunks/PkChatbotSteps-Y6kQ00ui.js +0 -191
  170. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js +0 -784
  171. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js.map +0 -1
  172. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js +0 -111
  173. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js.map +0 -1
  174. package/dist-vue/_chunks/PkStreamingMarkdown-CJlfq7ub.js.map +0 -1
  175. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js +0 -75
  176. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js.map +0 -1
  177. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js +0 -65
  178. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js.map +0 -1
  179. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js +0 -122
  180. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js.map +0 -1
  181. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js +0 -79
  182. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js.map +0 -1
  183. package/dist-vue/_chunks/useChatbotStore-DEELIJ89.js.map +0 -1
  184. package/dist-vue/_chunks/utils-CtD8DCrq.js +0 -184
  185. package/dist-vue/_chunks/utils-CtD8DCrq.js.map +0 -1
@@ -1,769 +0,0 @@
1
- import { O as e } from "./Agent-KbZm8GvA.js";
2
- import { t } from "./PkStreamingMarkdown-CJlfq7ub.js";
3
- import "./src-DT8FLE4_.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 { t as c } from "./PkChatbotError-CRGbK09-.js";
6
- import { t as l } from "./PkRelativeTime--1cIphlA.js";
7
- import { S as u, _ as d, b as f, c as p, d as m, f as h, i as g, n as ee, p as te, t as _, u as v, x as ne, y } from "./utils-CtD8DCrq.js";
8
- import { t as re } from "./PkChatbotFilePreview-CwiVQDF2.js";
9
- import { t as ie } from "./PkChatbotFeedbackForm-h4mjmVTG.js";
10
- import { t as ae } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
11
- import { n as b, t as x } from "./PkChatbotSteps-Y6kQ00ui.js";
12
- import { t as S } from "./PkChatbotOutlineRail-np4g6vsz.js";
13
- import { VvButton as oe, VvButtonGroup as se, VvIcon as ce } from "@volverjs/ui-vue/components";
14
- import { Fragment as C, Transition as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as le, createVNode as A, defineAsyncComponent as j, defineComponent as M, mergeProps as ue, nextTick as N, normalizeClass as P, normalizeStyle as de, onBeforeUnmount as F, onMounted as fe, openBlock as I, ref as L, renderList as pe, renderSlot as me, resolveDynamicComponent as he, toDisplayString as R, unref as z, useSlots as ge, useTemplateRef as _e, watch as B, withCtx as V, withModifiers as H } from "vue";
15
- import { useI18n as ve } from "vue-i18n";
16
- //#region ../../packages/utils/src/text.ts
17
- var U = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), ye = (e) => e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ") : "", be = (e) => e ? U(e).replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase() : "", xe = (e) => e ? U(e).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase() : "", Se = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", Ce = {
18
- requestOAuthConnection: j(() => import("./PkToolRequestOAuthConnection-rbjNi_l0.js")),
19
- showArtifact: j(() => import("./PkToolShowArtifact-hBmAAfsd.js").then((e) => e.n)),
20
- showCalendarEvent: j(() => import("./PkToolShowCalendarEvent-yttlTHiX.js").then((e) => e.n)),
21
- showComparison: j(() => import("./PkToolShowComparison-DQs3E6-k.js").then((e) => e.n)),
22
- showContactForm: j(() => import("./PkToolShowContactForm-BHsm_W2R.js").then((e) => e.n)),
23
- showDiagram: j(() => import("./PkToolShowDiagram-De2XvRnq.js")),
24
- showEmail: j(() => import("./PkToolShowEmail-D1mXZrT-.js").then((e) => e.n)),
25
- showImageGallery: j(() => import("./PkToolShowImageGallery-DmhZLnBk.js").then((e) => e.n)),
26
- showLocation: j(() => import("./PkToolShowLocation-Bv6sLN5P.js").then((e) => e.n)),
27
- showMessage: j(() => import("./PkToolShowMessage-lNPZxw2v.js").then((e) => e.n)),
28
- showForm: j(() => import("./PkToolShowForm-Ce_GpcBt.js").then((e) => e.n)),
29
- showMultipleChoice: j(() => import("./PkToolShowForm-Ce_GpcBt.js").then((e) => e.n)),
30
- showProductList: j(() => import("./PkToolShowProductList-BW5pRFe4.js").then((e) => e.n)),
31
- showQrCode: j(() => import("./PkToolShowQrCode-DEAvfLFu.js").then((e) => e.n)),
32
- showSources: j(() => import("./PkToolShowSources-B1Nhrk7O.js").then((e) => e.n)),
33
- showSuggestedReply: j(() => import("./PkToolShowSuggestedReply-Bmzygdww.js").then((e) => e.n)),
34
- showVideo: j(() => import("./PkToolShowVideo-BZOTu2Qe.js")),
35
- showWeather: j(() => import("./PkToolShowWeather-Bzqalzh8.js")),
36
- showWebPages: j(() => import("./PkToolShowWebPages-BiIBRV_n.js").then((e) => e.n))
37
- }, W = {
38
- key: 0,
39
- class: "text-12 text-word-3 m-0 mb-xs"
40
- }, G = /* @__PURE__ */ M({
41
- __name: "PkToolApprovalPreviewMessage",
42
- props: { input: {} },
43
- setup(e) {
44
- let t = e, n = T(() => {
45
- let e = t.input;
46
- return typeof e?.message == "string" ? e.message : "";
47
- });
48
- return (e, t) => n.value ? (I(), O("p", W, R(n.value), 1)) : D("", !0);
49
- }
50
- }), we = { [_]: G }, Te = {
51
- key: 0,
52
- class: "text-12 text-word-3 m-0 mb-xs"
53
- }, Ee = /* @__PURE__ */ M({
54
- __name: "PkToolApprovalCard",
55
- props: {
56
- part: {},
57
- actionable: { type: Boolean },
58
- callVerdict: { type: Boolean }
59
- },
60
- emits: ["respond"],
61
- setup(t, { emit: n }) {
62
- let r = t, i = n, { t: o } = ve({ useScope: "global" }), s = T(() => r.part), c = T(() => a(r.part)), l = T(() => c.value === _), u = T(() => l.value ? (s.value.state === "input-available" || e(s.value.output)) && r.callVerdict === void 0 : s.value.state === "approval-requested"), d = T(() => u.value && r.actionable === !0), f = T(() => u.value && r.actionable !== !0), p = T(() => l.value ? s.value.output === "confirmed" || r.callVerdict === !0 : s.value.approval?.approved === !0), m = T(() => l.value ? s.value.output === "cancelled" || r.callVerdict === !1 : s.value.approval?.approved === !1 || s.value.state === "output-denied"), h = T(() => we[c.value]), g = T(() => {
63
- if (f.value) return {
64
- icon: "ri:time-line",
65
- message: o("toolApproval.expired")
66
- };
67
- if (p.value) return {
68
- icon: "ri:check-line",
69
- message: o(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
70
- };
71
- if (m.value) return {
72
- icon: "ri:close-line",
73
- message: o(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
74
- };
75
- }), ee = T(() => !!g.value && !h.value);
76
- return (e, n) => {
77
- let r = oe, a = se, c = ce;
78
- return I(), O("div", { class: P(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !ee.value }]) }, [
79
- A(w, null, {
80
- default: V(() => [!l.value && u.value ? (I(), O("p", Te, R(z(o)("toolApproval.prompt")), 1)) : D("", !0)]),
81
- _: 1
82
- }),
83
- h.value ? (I(), E(he(h.value), {
84
- key: 0,
85
- part: t.part,
86
- input: s.value.input
87
- }, null, 8, ["part", "input"])) : D("", !0),
88
- A(w, { mode: "out-in" }, {
89
- default: V(() => [g.value ? (I(), O("p", {
90
- key: 1,
91
- class: P(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": h.value }])
92
- }, [A(c, {
93
- name: g.value.icon,
94
- class: "shrink-0"
95
- }, null, 8, ["name"]), le(" " + R(g.value.message), 1)], 2)) : (I(), E(a, { key: 0 }, {
96
- default: V(() => [A(r, {
97
- modifiers: "primary-small",
98
- disabled: !d.value,
99
- icon: "ri:check-line",
100
- label: z(o)("action.proceed"),
101
- onClick: n[0] ||= H((e) => i("respond", !0), ["stop"])
102
- }, null, 8, ["disabled", "label"]), A(r, {
103
- modifiers: "action-quiet-small",
104
- disabled: !d.value,
105
- icon: "ri:close-line",
106
- label: z(o)("action.cancel"),
107
- onClick: n[1] ||= H((e) => i("respond", !1), ["stop"])
108
- }, null, 8, ["disabled", "label"])]),
109
- _: 1
110
- }))]),
111
- _: 1
112
- })
113
- ], 2);
114
- };
115
- }
116
- }), De = 30, K = 500;
117
- function Oe(e) {
118
- let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = L(!1), u = L(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, ee = (e = "smooth") => {
119
- !t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
120
- top: t.value.scrollHeight,
121
- behavior: e
122
- }), setTimeout(() => {
123
- d = !1;
124
- }, e === "instant" ? 0 : K));
125
- }, te = (e) => {
126
- e.deltaY < 0 && (l.value = !0);
127
- }, _ = 0, v = (e) => {
128
- _ = e.touches[0]?.clientY ?? 0;
129
- }, ne = (e) => {
130
- let t = e.touches[0]?.clientY ?? 0;
131
- t > _ && (l.value = !0), _ = t;
132
- }, y = () => {
133
- if (!t.value) return;
134
- let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
135
- u.value = n - r - e < De, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
136
- }, re = () => {
137
- if (d || l.value || !t.value) return;
138
- let e = t.value, n = e.scrollHeight - e.clientHeight;
139
- n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
140
- d = !1;
141
- }));
142
- }, ie = () => {
143
- !f && t.value && (f = new MutationObserver(re), f.observe(t.value, {
144
- childList: !0,
145
- subtree: !0,
146
- characterData: !0
147
- }));
148
- }, ae = () => {
149
- f?.disconnect(), f = null;
150
- };
151
- B(n, (e, t) => {
152
- e === "streaming" || e === "submitted" ? ie() : (e !== "ready" || t !== "streaming") && ae();
153
- }), B(r, async () => {
154
- if (r() && i() !== "assistant") {
155
- S(), l.value = !1, d = !0;
156
- try {
157
- await N(), await o?.(), await N();
158
- } finally {
159
- ee();
160
- }
161
- }
162
- });
163
- let b = null, x = () => {
164
- t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, b && clearTimeout(b), b = setTimeout(S, 300)));
165
- }, S = () => {
166
- p?.disconnect(), p = null, m?.disconnect(), m = null, b &&= (clearTimeout(b), null);
167
- };
168
- return fe(() => {
169
- if (!t.value) return;
170
- t.value.addEventListener("wheel", te, { passive: !0 }), t.value.addEventListener("touchstart", v, { passive: !0 }), t.value.addEventListener("touchmove", ne, { passive: !0 });
171
- let e = n() === "submitted" || n() === "streaming";
172
- e ? ie() : (p = new ResizeObserver(x), p.observe(t.value), m = new MutationObserver(x), m.observe(t.value, {
173
- childList: !0,
174
- subtree: !0
175
- }));
176
- let r = a?.() ?? t.value.firstElementChild;
177
- r && (h = new ResizeObserver(re), h.observe(r)), e || x();
178
- }), F(() => {
179
- t.value?.removeEventListener("wheel", te), t.value?.removeEventListener("touchstart", v), t.value?.removeEventListener("touchmove", ne), h?.disconnect(), h = null, ae(), S();
180
- }), {
181
- handleScroll: y,
182
- scrollToBottom: ee,
183
- userScrolledUp: l,
184
- isAtBottom: u
185
- };
186
- }
187
- //#endregion
188
- //#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
189
- var ke = ["aria-busy"], Ae = {
190
- key: 0,
191
- class: "pk-chatbot-messages__outline"
192
- }, je = {
193
- key: 0,
194
- class: "pk-chatbot-divider"
195
- }, Me = { class: "pk-chatbot-divider__label" }, Ne = { class: "pk-chatbot-message__text" }, Pe = ["title"], Fe = {
196
- key: 0,
197
- class: "pk-chatbot-message__reaction-emoji"
198
- }, Ie = {
199
- key: 0,
200
- class: "pk-chatbot-message__loading-info"
201
- }, Le = { class: "flex gap-8 items-center" }, Re = { class: "font-mono rounded text-12" }, ze = { class: "flex gap-8 items-center" }, Be = {
202
- key: 0,
203
- class: "pk-chatbot-message__footer"
204
- }, Ve = {
205
- key: 0,
206
- class: "pk-chatbot-message__hover-meta"
207
- }, He = ["datetime", "title"], Ue = { class: "truncate" }, We = {
208
- key: 0,
209
- class: "flex items-center gap-4 min-w-0"
210
- }, Ge = { class: "truncate" }, Ke = ["title"], qe = {
211
- key: 2,
212
- class: "flex items-center gap-4 text-12 text-word-3"
213
- }, Je = { class: "truncate" }, Ye = ["datetime"], Xe = { class: "truncate" }, Ze = {
214
- key: 4,
215
- class: "flex items-center gap-4 text-12 text-word-3"
216
- }, Qe = { class: "pk-chatbot-message__loading-info" }, $e = { class: "flex gap-8 items-center" }, et = { class: "text-12" }, tt = ["title", "aria-label"], nt = /* @__PURE__ */ M({
217
- __name: "PkChatbotMessages",
218
- props: {
219
- status: {},
220
- messages: {},
221
- error: {},
222
- actions: {},
223
- mainColor: {},
224
- textColor: {},
225
- revisedAnswers: {},
226
- messageFeedbacks: {},
227
- readonlyFeedback: { type: Boolean },
228
- disableHeightAdjustment: { type: Boolean },
229
- showMessageDateTime: { type: Boolean },
230
- showMessageTokensCount: { type: Boolean },
231
- showMessageNumber: { type: Boolean },
232
- showAllMessageParts: { type: Boolean },
233
- interactive: { type: Boolean },
234
- showExtendedSteps: { type: Boolean },
235
- awaitingSpokenAnswer: { type: Boolean },
236
- confirmVerdictsOnCall: {},
237
- isDark: { type: Boolean },
238
- showScrollToBottom: { type: Boolean },
239
- feedbackMessageId: {},
240
- feedbackLoading: { type: Boolean },
241
- feedbackSubmitted: { type: Boolean },
242
- feedbackError: {}
243
- },
244
- emits: [
245
- "show-info",
246
- "regenerate",
247
- "revise",
248
- "upvote",
249
- "downvote",
250
- "feedback",
251
- "feedback-submit",
252
- "feedback-close",
253
- "scroll-up",
254
- "scroll-down",
255
- "auto-retry",
256
- "reset-chat",
257
- "approval-respond",
258
- "confirm-respond"
259
- ],
260
- setup(e, { emit: _ }) {
261
- let j = e, M = _, { t: F, d: U, n: ye } = ve({ useScope: "global" }), xe = ge(), Se = (e, t) => {
262
- if (f(e)) {
263
- let n = e.toolCallId;
264
- n && M("confirm-respond", {
265
- toolCallId: n,
266
- confirmed: t
267
- });
268
- return;
269
- }
270
- let n = h(e);
271
- n && M("approval-respond", {
272
- id: n,
273
- approved: t
274
- });
275
- }, W = _e("scrollEl"), G = _e("wrapperEl"), we = T(() => u(j.textColor, j.mainColor)), { handleScroll: Te, scrollToBottom: De, userScrolledUp: K, isAtBottom: nt } = Oe({
276
- scrollEl: W,
277
- status: () => j.status,
278
- messagesLength: () => j.messages?.length,
279
- lastMessageRole: () => j.messages?.[j.messages.length - 1]?.role,
280
- contentEl: () => G.value,
281
- beforeNewMessageScroll: () => ut(),
282
- onScrollUp: () => M("scroll-up"),
283
- onScrollDown: () => M("scroll-down")
284
- }), rt = () => {
285
- K.value = !1, De();
286
- }, q = T(() => (j.messages ?? []).filter((e) => e.role === "user").map((e) => ({
287
- id: e.id,
288
- preview: e.parts.find(o)?.text.trim().slice(0, 120) || "…"
289
- }))), it = L(), at = () => W.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], ot = () => {
290
- let e = W.value;
291
- if (!e || !j.showScrollToBottom) return;
292
- let t = e.getBoundingClientRect().top + e.clientHeight / 2, n = q.value[0]?.id;
293
- at().forEach((e, r) => {
294
- e.getBoundingClientRect().top <= t && (n = q.value[r]?.id);
295
- }), it.value = n;
296
- };
297
- B(q, async () => {
298
- await N(), ot();
299
- });
300
- let st = () => {
301
- Te(), ot();
302
- }, ct = (e) => {
303
- let t = W.value, n = q.value.findIndex((t) => t.id === e), r = at()[n];
304
- t && r && (K.value = !0, t.scrollTo({
305
- top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
306
- behavior: "smooth"
307
- }));
308
- }, J = L(0), lt = L(!1), ut = async () => {
309
- let e = j.messages;
310
- if (!e?.length || j.disableHeightAdjustment || e[e.length - 1].role !== "user" && j.status !== "submitted" && j.status !== "streaming" || (lt.value = !1, await N(), !W.value)) return;
311
- let { paddingTop: t, paddingBottom: n } = getComputedStyle(W.value), r = W.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = G.value && Number.parseFloat(getComputedStyle(G.value).rowGap) || 0, a = at(), o = r - (a[a.length - 1]?.clientHeight ?? 0) - i;
312
- r > 0 && (J.value = Math.max(o, 0)), await N();
313
- };
314
- B(() => [j.messages?.length, j.messages?.[j.messages.length - 1]?.id], () => ut()), fe(() => {
315
- (j.status === "submitted" || j.status === "streaming" || j.awaitingSpokenAnswer) && ut();
316
- }), B(() => j.status, (e) => {
317
- (e === "ready" || e === "error") && (lt.value = !0, J.value = 0);
318
- });
319
- let dt = (e) => j.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => j.messageFeedbacks?.find((t) => t.messageId === e), ft = (e, t) => !j.readonlyFeedback && At(e, t), pt = (e) => j.readonlyFeedback ? Y(e) : void 0, mt = (e) => pt(e)?.vote, ht = (e) => {
320
- let t = pt(e);
321
- if (t?.vote) return;
322
- let n = t?.metadata?.reactionEmoji;
323
- return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
324
- }, gt = (e) => !!(mt(e) || ht(e)), _t = (e) => {
325
- if (ht(e)) return "pk-chatbot-message__reaction--neutral";
326
- let t = mt(e);
327
- return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
328
- }, vt = (e) => {
329
- let t = mt(e);
330
- return F(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
331
- }, yt = (e) => {
332
- let t = St(e);
333
- for (let e = t.length - 1; e >= 0; --e) if (o(t[e])) return e;
334
- return -1;
335
- }, bt = T(() => j.messages?.[j.messages.length - 1]), X = T(() => {
336
- let e = bt.value;
337
- return e ? e.parts[e.parts.length - 1] : null;
338
- }), xt = T(() => {
339
- let e = /* @__PURE__ */ new Map();
340
- for (let t of j.messages ?? []) t.role === "assistant" && e.set(t.id, g(ne(t.parts)));
341
- return e;
342
- }), St = (e) => xt.value.get(e.id) ?? e.parts, Z = T(() => j.status === "submitted" || j.status === "streaming"), Ct = T(() => j.status === "error"), wt = T(() => j.awaitingSpokenAnswer === !0 && !Z.value), Tt = T(() => wt.value && bt.value?.role === "user" && !Ct.value), Et = T(() => {
343
- let e = X.value;
344
- return te(F, e);
345
- }), Dt = T(() => {
346
- let e = X.value;
347
- return v(e);
348
- }), Ot = (e) => j.messages?.findIndex((t) => t.id === e), Q = (e) => e === void 0 || !j.messages ? !1 : e === j.messages.length - 1, kt = (e) => Q(e) && j.status === "ready" && !!j.actions?.includes("regenerate"), At = (e, t) => (!Q(t) || j.status === "ready") && !!j.actions?.includes(e), jt = (e) => {
349
- let t = e.parts[e.parts.length - 1];
350
- return o(t);
351
- }, Mt = (e) => e.parts.some((e) => i(e) || r(e)), Nt = (e) => !!j.showExtendedSteps && $(e) && Mt(e), Pt = (e) => r(e) && !y(e) && !!(Ce[a(e)] || xe[e.type] || j.showAllMessageParts), Ft = (e) => e.parts.some((e) => o(e) && !!e.text.trim() || n(e) || d(e) && !y(e) || Pt(e)), $ = (e) => e.role === "assistant", It = (e) => e.role === "user", Lt = (e) => j.messages?.slice(0, e).reverse().find((e) => $(e)), Rt = (e) => j.messages?.slice(e + 1).find((e) => $(e)), zt = (e) => {
352
- let t = Lt(e)?.metadata?.createdAt, n = Rt(e)?.metadata?.createdAt;
353
- if (!t || !n) return;
354
- let r = new Date(t), i = new Date(n);
355
- return r.toDateString() === i.toDateString() ? void 0 : i;
356
- }, Bt = T(() => {
357
- let e = 0;
358
- return (j.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
359
- }), Vt = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(j.actions?.length || j.showMessageNumber || j.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || j.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Ht = (e) => {
360
- let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
361
- return U(t, n ? "time" : "date-time");
362
- }, Ut = (e) => {
363
- let { createdAt: t, completedAt: n } = e.metadata ?? {};
364
- if (t && n) return p(ye, n - t);
365
- }, Wt = _e("feedbackMessageEl");
366
- return B(() => j.feedbackMessageId, async () => {
367
- if (await N(), !j.feedbackMessageId) return;
368
- let e = Wt.value?.[0]?.$el;
369
- e && (Q(Ot(j.feedbackMessageId)) ? De() : e.scrollIntoView({
370
- behavior: "smooth",
371
- block: "center"
372
- }));
373
- }), (r, i) => {
374
- let u = ce, p = oe, h = se;
375
- return I(), O("div", {
376
- ref_key: "scrollEl",
377
- ref: W,
378
- class: P(["pk-chatbot-messages", { "pk-chatbot-messages--settling": lt.value }]),
379
- role: "log",
380
- "aria-live": "polite",
381
- "aria-relevant": "additions text",
382
- "aria-busy": Z.value,
383
- style: de({
384
- "--chatbot-main-color": e.mainColor,
385
- "--chatbot-contrast-color": we.value
386
- }),
387
- onScroll: st
388
- }, [
389
- e.showScrollToBottom && q.value.length > 1 ? (I(), O("div", Ae, [A(S, {
390
- items: q.value,
391
- "active-id": it.value,
392
- onSelect: ct
393
- }, null, 8, ["items", "active-id"])])) : D("", !0),
394
- k("div", {
395
- ref_key: "wrapperEl",
396
- ref: G,
397
- class: "pk-chatbot-messages__wrapper"
398
- }, [
399
- (I(!0), O(C, null, pe(e.messages, (c, g) => (I(), O(C, { key: c.id }, [It(c) && zt(g) ? (I(), O("div", je, [k("span", Me, R(z(U)(zt(g), "short")), 1)])) : D("", !0), c.parts.length || Q(g) && Z.value && $(c) ? (I(), O("div", {
400
- key: 1,
401
- class: P(["pk-chatbot-message", [`pk-chatbot-message--${c.role}`, { "pk-chatbot-message--loading": Z.value && Q(g) && $(c) }]]),
402
- style: de({ minHeight: Q(g) && $(c) && !Ct.value ? `${J.value}px` : void 0 })
403
- }, [
404
- A(w, {
405
- appear: "",
406
- name: "pk-chatbot-part"
407
- }, {
408
- default: V(() => [Nt(c) ? (I(), E(x, {
409
- key: 0,
410
- message: c,
411
- "is-streaming": Z.value && Q(g),
412
- "has-content": Ft(c),
413
- "is-dark": e.isDark
414
- }, null, 8, [
415
- "message",
416
- "is-streaming",
417
- "has-content",
418
- "is-dark"
419
- ])) : D("", !0)]),
420
- _: 2
421
- }, 1024),
422
- (I(!0), O(C, null, pe(St(c), (i, l) => (I(), O(C, { key: l }, [z(o)(i) && i.text.trim() ? (I(), E(w, {
423
- key: 0,
424
- appear: "",
425
- name: "pk-chatbot-part"
426
- }, {
427
- default: V(() => [k("div", Ne, [me(r.$slots, "text", ue({ ref_for: !0 }, {
428
- message: c,
429
- part: i,
430
- index: g,
431
- isLoading: Z.value
432
- }), () => [$(c) ? (I(), E(t, {
433
- key: 0,
434
- class: "wysiwyg",
435
- markdown: i.text,
436
- "is-dark": e.isDark,
437
- loading: Q(g) && e.status === "streaming"
438
- }, null, 8, [
439
- "markdown",
440
- "is-dark",
441
- "loading"
442
- ])) : (I(), O(C, { key: 1 }, [le(R(i.text), 1)], 64))]), gt(c.id) && !Y(c.id)?.comment && l === yt(c) ? (I(), O("span", {
443
- key: 0,
444
- class: P(["pk-chatbot-message__reaction", _t(c.id)]),
445
- title: vt(c.id)
446
- }, [ht(c.id) ? (I(), O("span", Fe, R(ht(c.id)), 1)) : (I(), E(u, {
447
- key: 1,
448
- name: mt(c.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
449
- }, null, 8, ["name"]))], 10, Pe)) : D("", !0)])]),
450
- _: 2
451
- }, 1024)) : z(n)(i) ? (I(), E(w, {
452
- key: 1,
453
- appear: "",
454
- name: "pk-chatbot-part"
455
- }, {
456
- default: V(() => [A(re, {
457
- "media-type": i.mediaType,
458
- url: i.url,
459
- filename: i.filename,
460
- size: z(s)(i)?.bytesCount
461
- }, null, 8, [
462
- "media-type",
463
- "url",
464
- "filename",
465
- "size"
466
- ])]),
467
- _: 2
468
- }, 1024)) : z(d)(i) && !z(y)(i) ? (I(), E(w, {
469
- key: 2,
470
- appear: "",
471
- name: "pk-chatbot-part"
472
- }, {
473
- default: V(() => [(I(), E(Ee, {
474
- key: `approval-${l}`,
475
- part: i,
476
- actionable: e.interactive === !0 && (z(f)(i) || Q(g)),
477
- "call-verdict": e.confirmVerdictsOnCall?.get(i.toolCallId ?? ""),
478
- onRespond: (e) => Se(i, e)
479
- }, null, 8, [
480
- "part",
481
- "actionable",
482
- "call-verdict",
483
- "onRespond"
484
- ]))]),
485
- _: 2
486
- }, 1024)) : Pt(i) ? (I(), E(w, {
487
- key: 3,
488
- appear: "",
489
- name: "pk-chatbot-part"
490
- }, {
491
- default: V(() => [!z(xe)[i.type] && z(Ce)[z(a)(i)] ? (I(), E(he(z(Ce)[z(a)(i)]), {
492
- key: `component-${l}-${z(m)(i)}`,
493
- part: i
494
- }, null, 8, ["part"])) : me(r.$slots, i.type, ue({ ref_for: !0 }, {
495
- message: c,
496
- part: i,
497
- index: g,
498
- isLoading: Z.value
499
- }), () => [e.showAllMessageParts ? (I(), O("div", Ie, [k("div", Le, [z(v)(i) ? (I(), E(u, {
500
- key: 0,
501
- name: z(v)(i),
502
- class: "shrink-0"
503
- }, null, 8, ["name"])) : D("", !0), k("code", Re, R(z(be)(i.type)), 1)])])) : D("", !0)], void 0, 1)]),
504
- _: 2
505
- }, 1024)) : D("", !0), A(w, { mode: "out-in" }, {
506
- default: V(() => [l === yt(c) && e.readonlyFeedback && Y(c.id)?.comment ? (I(), E(ae, {
507
- key: 0,
508
- feedback: Y(c.id)
509
- }, null, 8, ["feedback"])) : D("", !0)]),
510
- _: 2
511
- }, 1024)], 64))), 128)),
512
- A(w, {
513
- name: "fade-in",
514
- mode: "out-in"
515
- }, {
516
- default: V(() => [Z.value && Q(g) && !jt(c) && $(c) && (!Nt(c) || Ft(c)) ? (I(), O("div", {
517
- key: `loading-info-${c.id}`,
518
- class: "pk-chatbot-message__loading-info"
519
- }, [k("div", ze, [
520
- A(u, {
521
- name: "loading-loop",
522
- class: "shrink-0"
523
- }),
524
- A(w, { mode: "out-in" }, {
525
- default: V(() => [Dt.value ? (I(), E(u, {
526
- key: Dt.value,
527
- class: "shrink-0",
528
- name: Dt.value
529
- }, null, 8, ["name"])) : D("", !0)]),
530
- _: 1
531
- }),
532
- A(w, { mode: "out-in" }, {
533
- default: V(() => [Et.value ? (I(), O("span", {
534
- key: Et.value,
535
- class: "text-12"
536
- }, R(Et.value), 1)) : D("", !0)]),
537
- _: 1
538
- })
539
- ]), A(w, {
540
- name: "fade-in",
541
- mode: "out-in"
542
- }, {
543
- default: V(() => [!Nt(c) && X.value && "text" in X.value && X.value.text.trim() ? (I(), E(b, {
544
- key: 0,
545
- markdown: X.value.text,
546
- "is-dark": e.isDark,
547
- "tail-length": z(ee),
548
- "inner-class": "wysiwyg",
549
- class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
550
- }, null, 8, [
551
- "markdown",
552
- "is-dark",
553
- "tail-length"
554
- ])) : D("", !0)]),
555
- _: 2
556
- }, 1024)])) : D("", !0)]),
557
- _: 2
558
- }, 1024),
559
- A(w, { mode: "out-in" }, {
560
- default: V(() => [Vt(c, g) ? (I(), O("div", Be, [
561
- A(h, {
562
- modifiers: "compact",
563
- class: "mr-auto shrink-0"
564
- }, {
565
- default: V(() => [
566
- A(w, { mode: "out-in" }, {
567
- default: V(() => [kt(g) ? (I(), E(p, {
568
- key: 0,
569
- icon: "ri:reset-right-line",
570
- modifiers: "action-quiet-small",
571
- title: z(F)("action.regenerate"),
572
- "aria-label": z(F)("action.regenerate"),
573
- onClick: i[0] ||= H((e) => r.$emit("regenerate"), ["stop"])
574
- }, null, 8, ["title", "aria-label"])) : D("", !0)]),
575
- _: 2
576
- }, 1024),
577
- A(w, { mode: "out-in" }, {
578
- default: V(() => [At("show-info", g) ? (I(), E(p, {
579
- key: 0,
580
- icon: "ri:information-line",
581
- title: z(F)("action.getMoreInfo"),
582
- "aria-label": z(F)("action.getMoreInfo"),
583
- modifiers: "action-quiet-small",
584
- onClick: H((e) => r.$emit("show-info", c), ["stop"])
585
- }, null, 8, [
586
- "title",
587
- "aria-label",
588
- "onClick"
589
- ])) : D("", !0)]),
590
- _: 2
591
- }, 1024),
592
- A(w, { mode: "out-in" }, {
593
- default: V(() => [At("revise", g) ? (I(), E(p, {
594
- key: 0,
595
- icon: dt(c.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
596
- title: dt(c.id) ? z(F)("action.editRevise") : z(F)("action.createRevise"),
597
- "aria-label": dt(c.id) ? z(F)("action.editRevise") : z(F)("action.createRevise"),
598
- modifiers: "action-quiet-small",
599
- class: P({ "text-brand": dt(c.id) }),
600
- onClick: H((e) => r.$emit("revise", c), ["stop"])
601
- }, null, 8, [
602
- "icon",
603
- "title",
604
- "aria-label",
605
- "class",
606
- "onClick"
607
- ])) : D("", !0)]),
608
- _: 2
609
- }, 1024),
610
- A(w, { mode: "out-in" }, {
611
- default: V(() => [ft("upvote", g) ? (I(), E(p, {
612
- key: 0,
613
- icon: Y(c.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
614
- title: z(F)("action.upvote"),
615
- "aria-label": z(F)("action.upvote"),
616
- modifiers: "action-quiet-small",
617
- onClick: H((e) => r.$emit("upvote", c), ["stop"])
618
- }, null, 8, [
619
- "icon",
620
- "title",
621
- "aria-label",
622
- "onClick"
623
- ])) : D("", !0)]),
624
- _: 2
625
- }, 1024),
626
- A(w, { mode: "out-in" }, {
627
- default: V(() => [ft("downvote", g) ? (I(), E(p, {
628
- key: 0,
629
- icon: Y(c.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
630
- title: z(F)("action.downvote"),
631
- "aria-label": z(F)("action.downvote"),
632
- modifiers: "action-quiet-small",
633
- onClick: H((e) => r.$emit("downvote", c), ["stop"])
634
- }, null, 8, [
635
- "icon",
636
- "title",
637
- "aria-label",
638
- "onClick"
639
- ])) : D("", !0)]),
640
- _: 2
641
- }, 1024),
642
- A(w, { mode: "out-in" }, {
643
- default: V(() => [ft("feedback", g) ? (I(), E(p, {
644
- key: 0,
645
- icon: Y(c.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
646
- title: z(F)("action.feedback"),
647
- "aria-label": z(F)("action.feedback"),
648
- modifiers: "action-quiet-small",
649
- onClick: H((e) => r.$emit("feedback", c), ["stop"])
650
- }, null, 8, [
651
- "icon",
652
- "title",
653
- "aria-label",
654
- "onClick"
655
- ])) : D("", !0)]),
656
- _: 2
657
- }, 1024)
658
- ]),
659
- _: 2
660
- }, 1024),
661
- !e.showMessageDateTime && c.metadata?.createdAt && c.metadata?.completedAt ? (I(), O("div", Ve, [k("time", {
662
- datetime: new Date(c.metadata.createdAt).toISOString(),
663
- title: z(U)(new Date(c.metadata.createdAt), "date-time"),
664
- class: "flex items-center gap-4 min-w-0"
665
- }, [A(u, {
666
- name: "ri:time-line",
667
- class: "shrink-0"
668
- }), k("span", Ue, R(Ht(c.metadata.createdAt)), 1)], 8, He), Ut(c) ? (I(), O("span", We, [A(u, {
669
- name: "ri:hourglass-line",
670
- class: "shrink-0"
671
- }), k("span", Ge, R(Ut(c)), 1)])) : D("", !0)])) : D("", !0),
672
- e.showMessageNumber ? (I(), O("span", {
673
- key: 1,
674
- title: z(F)("label.messageNumber", { n: Bt.value[g] }),
675
- class: "text-12 text-word-3 tabular-nums"
676
- }, " #" + R(Bt.value[g]), 9, Ke)) : D("", !0),
677
- e.showMessageTokensCount && c.metadata?.totalTokens ? (I(), O("span", qe, [A(u, {
678
- name: "ri:ai-generate-2-line",
679
- class: "shrink-0"
680
- }), k("span", Je, R(z(ye)(c.metadata.totalTokens, "integer")) + " " + R(z(F)("label.tokens")), 1)])) : D("", !0),
681
- e.showMessageDateTime && c.metadata?.createdAt ? (I(), O("time", {
682
- key: 3,
683
- datetime: new Date(c.metadata?.createdAt).toISOString(),
684
- class: "flex items-center gap-4 text-12 text-word-3"
685
- }, [A(u, {
686
- name: "ri:time-line",
687
- class: "shrink-0"
688
- }), k("span", Xe, R(z(U)(new Date(c.metadata?.createdAt), "date-time")), 1)], 8, Ye)) : D("", !0),
689
- e.showMessageDateTime && c?.metadata?.completedAt && c?.metadata?.createdAt ? (I(), O("div", Ze, [A(u, {
690
- name: "ri:hourglass-line",
691
- class: "shrink-0"
692
- }), A(l, {
693
- class: "truncate",
694
- date: c.metadata?.createdAt,
695
- "end-date": c.metadata?.completedAt
696
- }, null, 8, ["date", "end-date"])])) : D("", !0)
697
- ])) : D("", !0)]),
698
- _: 2
699
- }, 1024),
700
- A(w, { mode: "out-in" }, {
701
- default: V(() => [c.id === e.feedbackMessageId ? (I(), E(ie, {
702
- key: 0,
703
- ref_for: !0,
704
- ref_key: "feedbackMessageEl",
705
- ref: Wt,
706
- loading: e.feedbackLoading,
707
- submitted: e.feedbackSubmitted,
708
- error: e.feedbackError,
709
- onSubmit: i[1] ||= (e) => r.$emit("feedback-submit", e),
710
- onClose: i[2] ||= (e) => r.$emit("feedback-close")
711
- }, null, 8, [
712
- "loading",
713
- "submitted",
714
- "error"
715
- ])) : D("", !0)]),
716
- _: 2
717
- }, 1024)
718
- ], 6)) : D("", !0)], 64))), 128)),
719
- A(w, {
720
- appear: "",
721
- name: "pk-chatbot-part"
722
- }, {
723
- default: V(() => [wt.value ? (I(), O("div", {
724
- key: 0,
725
- class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
726
- style: de({ minHeight: Tt.value ? `${J.value}px` : void 0 })
727
- }, [k("div", Qe, [k("div", $e, [A(u, {
728
- name: "loading-loop",
729
- class: "shrink-0"
730
- }), k("span", et, R(z(F)("label.answeringOnTheCall")), 1)])])], 4)) : D("", !0)]),
731
- _: 1
732
- }),
733
- A(w, {
734
- appear: "",
735
- name: "pk-chatbot-part"
736
- }, {
737
- default: V(() => [Ct.value ? (I(), E(c, {
738
- key: 0,
739
- error: e.error,
740
- onRetry: i[3] ||= (e) => r.$emit("auto-retry"),
741
- onReset: i[4] ||= (e) => r.$emit("reset-chat")
742
- }, null, 8, ["error"])) : D("", !0)]),
743
- _: 1
744
- }),
745
- bt.value?.role === "user" && !Tt.value || Ct.value ? (I(), O("div", {
746
- key: 0,
747
- class: "pk-chatbot-messages__spacer",
748
- style: de({ minHeight: `${J.value}px` })
749
- }, null, 4)) : D("", !0)
750
- ], 512),
751
- A(w, { name: "pk-chatbot-messages-fab" }, {
752
- default: V(() => [e.showScrollToBottom && (z(K) || !z(nt)) ? (I(), O("button", {
753
- key: 0,
754
- type: "button",
755
- class: "pk-chatbot-messages__scroll-to-bottom",
756
- title: z(F)("action.scrollToBottom"),
757
- "aria-label": z(F)("action.scrollToBottom"),
758
- onClick: rt
759
- }, [A(u, { name: "ri:arrow-down-line" })], 8, tt)) : D("", !0)]),
760
- _: 1
761
- })
762
- ], 46, ke);
763
- };
764
- }
765
- });
766
- //#endregion
767
- export { xe as a, be as i, Se as n, ye as r, nt as t };
768
-
769
- //# sourceMappingURL=PkChatbotMessages-UT72KC_z.js.map