@8wave/ai-elements 0.127.0-beta.15 → 0.127.0-beta.16

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 (110) hide show
  1. package/dist/_chunks/{PkFilePreview-yKT0QkEB.js → PkFilePreview-3_ZmPzQO.js} +3 -3
  2. package/dist/_chunks/{PkFilePreview-yKT0QkEB.js.map → PkFilePreview-3_ZmPzQO.js.map} +1 -1
  3. package/dist/_chunks/{PkFilePreviewDialog-B4yKQbLi.js → PkFilePreviewDialog-m3iqn0rl.js} +2 -2
  4. package/dist/_chunks/{PkFilePreviewDialog-B4yKQbLi.js.map → PkFilePreviewDialog-m3iqn0rl.js.map} +1 -1
  5. package/dist/_chunks/{PkImageEditorDialog-BF6tQvTY.js → PkImageEditorDialog-W8TCEHBJ.js} +2 -2
  6. package/dist/_chunks/{PkImageEditorDialog-BF6tQvTY.js.map → PkImageEditorDialog-W8TCEHBJ.js.map} +1 -1
  7. package/dist/_chunks/{PkSelectionActions-J1AaO8Of.js → PkSelectionActions-B14kAu8T.js} +2 -2
  8. package/dist/_chunks/{PkSelectionActions-J1AaO8Of.js.map → PkSelectionActions-B14kAu8T.js.map} +1 -1
  9. package/dist/_chunks/{PkStreamingMarkdown-CvIq4j9U.js → PkStreamingMarkdown-Df_VzmC0.js} +2 -2
  10. package/dist/_chunks/{PkStreamingMarkdown-CvIq4j9U.js.map → PkStreamingMarkdown-Df_VzmC0.js.map} +1 -1
  11. package/dist/_chunks/{PkToolChatFile-Y5CR96-B.js → PkToolChatFile-BXrgzaIj.js} +2 -2
  12. package/dist/_chunks/{PkToolChatFile-Y5CR96-B.js.map → PkToolChatFile-BXrgzaIj.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowArtifact-CBsIMKuq.js → PkToolShowArtifact-Df2ibXU_.js} +2 -2
  14. package/dist/_chunks/{PkToolShowArtifact-CBsIMKuq.js.map → PkToolShowArtifact-Df2ibXU_.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowContactForm-D8tYijcg.js → PkToolShowContactForm-CfW3f_Zs.js} +2 -2
  16. package/dist/_chunks/{PkToolShowContactForm-D8tYijcg.js.map → PkToolShowContactForm-CfW3f_Zs.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowForm-CM63L5WC.js → PkToolShowForm-Chj3bqAn.js} +3 -3
  18. package/dist/_chunks/{PkToolShowForm-CM63L5WC.js.map → PkToolShowForm-Chj3bqAn.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowSources-BoJmMb4K.js → PkToolShowSources-B9qNtyum.js} +2 -2
  20. package/dist/_chunks/{PkToolShowSources-BoJmMb4K.js.map → PkToolShowSources-B9qNtyum.js.map} +1 -1
  21. package/dist/_chunks/{utils-BYVRPDrv.js → utils-C1mMVCFZ.js} +4 -3
  22. package/dist/_chunks/utils-C1mMVCFZ.js.map +1 -0
  23. package/dist/ai-elements.es.js +604 -587
  24. package/dist/ai-elements.es.js.map +1 -1
  25. package/dist-vue/PkChatbot.js +1 -1
  26. package/dist-vue/PkChatbotEmptyState.js +1 -1
  27. package/dist-vue/PkChatbotInput.js +1 -1
  28. package/dist-vue/PkChatbotLocalFolders.js +1 -1
  29. package/dist-vue/PkChatbotMessages.js +1 -1
  30. package/dist-vue/PkChatbotStepPayload.js +1 -1
  31. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  32. package/dist-vue/PkChatbotSteps.js +1 -1
  33. package/dist-vue/PkChatbotViewChat.js +1 -1
  34. package/dist-vue/PkChatbotViewConversations.js +1 -1
  35. package/dist-vue/PkChatbotViewFiles.js +1 -1
  36. package/dist-vue/PkChatbotViewProfile.js +1 -1
  37. package/dist-vue/_chunks/{PkChatbot-CrHeZSwq.js → PkChatbot-BWgqvPsG.js} +8 -8
  38. package/dist-vue/_chunks/{PkChatbot-CrHeZSwq.js.map → PkChatbot-BWgqvPsG.js.map} +1 -1
  39. package/dist-vue/_chunks/{PkChatbotEmptyState-BSdctGUp.js → PkChatbotEmptyState-CS0l2BBa.js} +2 -2
  40. package/dist-vue/_chunks/{PkChatbotEmptyState-BSdctGUp.js.map → PkChatbotEmptyState-CS0l2BBa.js.map} +1 -1
  41. package/dist-vue/_chunks/{PkChatbotInput-Bkr2FMAR.js → PkChatbotInput-9PwloFKx.js} +29 -15
  42. package/dist-vue/_chunks/PkChatbotInput-9PwloFKx.js.map +1 -0
  43. package/dist-vue/_chunks/PkChatbotLocalFolders-D7kxpwR2.js +122 -0
  44. package/dist-vue/_chunks/PkChatbotLocalFolders-D7kxpwR2.js.map +1 -0
  45. package/dist-vue/_chunks/{PkChatbotMessages-Cf19Jak8.js → PkChatbotMessages-CU0y2j8g.js} +16 -16
  46. package/dist-vue/_chunks/{PkChatbotMessages-Cf19Jak8.js.map → PkChatbotMessages-CU0y2j8g.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkChatbotStepPayload-BWeGBOGl.js → PkChatbotStepPayload-Ds9rz4MI.js} +2 -2
  48. package/dist-vue/_chunks/{PkChatbotStepPayload-BWeGBOGl.js.map → PkChatbotStepPayload-Ds9rz4MI.js.map} +1 -1
  49. package/dist-vue/_chunks/{PkChatbotStepToolDetail-k_purHyE.js → PkChatbotStepToolDetail-C_xWXZkE.js} +3 -3
  50. package/dist-vue/_chunks/{PkChatbotStepToolDetail-k_purHyE.js.map → PkChatbotStepToolDetail-C_xWXZkE.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbotSteps-DvYhk_xP.js → PkChatbotSteps-CjX5nxsq.js} +6 -6
  52. package/dist-vue/_chunks/{PkChatbotSteps-DvYhk_xP.js.map → PkChatbotSteps-CjX5nxsq.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkChatbotViewChat-D-tjQF-v.js → PkChatbotViewChat-D5DiEgwE.js} +234 -237
  54. package/dist-vue/_chunks/PkChatbotViewChat-D5DiEgwE.js.map +1 -0
  55. package/dist-vue/_chunks/{PkChatbotViewConversations-BYn6wfoM.js → PkChatbotViewConversations-Bj77_upQ.js} +4 -4
  56. package/dist-vue/_chunks/{PkChatbotViewConversations-BYn6wfoM.js.map → PkChatbotViewConversations-Bj77_upQ.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkChatbotViewFiles-BWD7GF4M.js → PkChatbotViewFiles-nL2UGO-g.js} +2 -2
  58. package/dist-vue/_chunks/{PkChatbotViewFiles-BWD7GF4M.js.map → PkChatbotViewFiles-nL2UGO-g.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotViewProfile-D5LQ_IB6.js → PkChatbotViewProfile-B8xPFxkz.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotViewProfile-D5LQ_IB6.js.map → PkChatbotViewProfile-B8xPFxkz.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkFilePreview-CURIA-I5.js → PkFilePreview-D6VCM-tr.js} +3 -3
  62. package/dist-vue/_chunks/{PkFilePreview-CURIA-I5.js.map → PkFilePreview-D6VCM-tr.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkFilePreviewDialog-Cmic1Xl-.js → PkFilePreviewDialog-CwkET8_p.js} +2 -2
  64. package/dist-vue/_chunks/{PkFilePreviewDialog-Cmic1Xl-.js.map → PkFilePreviewDialog-CwkET8_p.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkImageEditorDialog-bt-_WXJ7.js → PkImageEditorDialog-CXSSDTtp.js} +2 -2
  66. package/dist-vue/_chunks/{PkImageEditorDialog-bt-_WXJ7.js.map → PkImageEditorDialog-CXSSDTtp.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkStreamingMarkdown-D38PPSbB.js → PkStreamingMarkdown-D5ad7uGI.js} +2 -2
  68. package/dist-vue/_chunks/{PkStreamingMarkdown-D38PPSbB.js.map → PkStreamingMarkdown-D5ad7uGI.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkToolChatFile-Dvn6Jg9n.js → PkToolChatFile-DDVwPfee.js} +2 -2
  70. package/dist-vue/_chunks/{PkToolChatFile-Dvn6Jg9n.js.map → PkToolChatFile-DDVwPfee.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkToolShowArtifact-Clkqoz26.js → PkToolShowArtifact-CdS7BNoU.js} +2 -2
  72. package/dist-vue/_chunks/{PkToolShowArtifact-Clkqoz26.js.map → PkToolShowArtifact-CdS7BNoU.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolShowChart-RLAsKQT7.js → PkToolShowChart-E2NW5ess.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolShowChart-RLAsKQT7.js.map → PkToolShowChart-E2NW5ess.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolShowContactForm-BSDtKWWD.js → PkToolShowContactForm-COu43u5z.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolShowContactForm-BSDtKWWD.js.map → PkToolShowContactForm-COu43u5z.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolShowDiagram-9EYiOJXE.js → PkToolShowDiagram-BOGh8Z0j.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolShowDiagram-9EYiOJXE.js.map → PkToolShowDiagram-BOGh8Z0j.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolShowForm-mXmiZPIW.js → PkToolShowForm-D3n6fxtt.js} +3 -3
  80. package/dist-vue/_chunks/{PkToolShowForm-mXmiZPIW.js.map → PkToolShowForm-D3n6fxtt.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowImageGallery-B2phVedq.js → PkToolShowImageGallery-D3Z5vTb0.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowImageGallery-B2phVedq.js.map → PkToolShowImageGallery-D3Z5vTb0.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowProductList-BX9D6A8k.js → PkToolShowProductList-4mkoLMOz.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowProductList-BX9D6A8k.js.map → PkToolShowProductList-4mkoLMOz.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowSources-B0Xw8RR2.js → PkToolShowSources-DkpLjqfn.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowSources-B0Xw8RR2.js.map → PkToolShowSources-DkpLjqfn.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowVideo-DyOPeNq_.js → PkToolShowVideo-DyjqJfqW.js} +2 -2
  88. package/dist-vue/_chunks/{PkToolShowVideo-DyOPeNq_.js.map → PkToolShowVideo-DyjqJfqW.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowWebPages-DajE3TAx.js → PkToolShowWebPages-BSvuIrSs.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowWebPages-DajE3TAx.js.map → PkToolShowWebPages-BSvuIrSs.js.map} +1 -1
  91. package/dist-vue/_chunks/{localFolders-D8DxM-5y.js → localFolders-Dn8jAVz4.js} +4 -3
  92. package/dist-vue/_chunks/localFolders-Dn8jAVz4.js.map +1 -0
  93. package/dist-vue/_chunks/{useChatbotStore-DCE7Ig6x.js → useChatbotStore-ZA6_oD5a.js} +2 -2
  94. package/dist-vue/_chunks/{useChatbotStore-DCE7Ig6x.js.map → useChatbotStore-ZA6_oD5a.js.map} +1 -1
  95. package/dist-vue/_chunks/{utils-SmeQuVL1.js → utils-BDXwCfXk.js} +2 -2
  96. package/dist-vue/_chunks/{utils-SmeQuVL1.js.map → utils-BDXwCfXk.js.map} +1 -1
  97. package/dist-vue/composables.js +12 -2
  98. package/dist-vue/composables.js.map +1 -1
  99. package/dist-vue/index.js +25 -25
  100. package/dist-vue/locales.js +12 -2
  101. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +10 -2
  102. package/dist-vue/packages/components/src/chat/PkChatbotLocalFolders.d.ts +12 -9
  103. package/dist-vue/style.css +1 -1
  104. package/package.json +1 -1
  105. package/dist/_chunks/utils-BYVRPDrv.js.map +0 -1
  106. package/dist-vue/_chunks/PkChatbotInput-Bkr2FMAR.js.map +0 -1
  107. package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js +0 -126
  108. package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js.map +0 -1
  109. package/dist-vue/_chunks/PkChatbotViewChat-D-tjQF-v.js.map +0 -1
  110. package/dist-vue/_chunks/localFolders-D8DxM-5y.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkChatbotInput-9PwloFKx.js","names":["_hoisted_2","_openBlock","_createElementBlock","_normalizeClass","_createVNode","_toDisplayString","$slots","$n","_useModel","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","PkStreamingMarkdown","_toDisplayString","_unref","_createElementVNode","_withModifiers","_createVNode","_createTextVNode","PkChatbotFilePreview","_renderSlot","_normalizeProps","_mergeProps","_withCtx","PkChatButton","_withKeys","_normalizeClass","VvButtonLocalized","codeExtensionsOf","chatUploadMimeType","isTouchScreen","PkStreamingMarkdown_default","PkChatbotFilePreview_default","isImeComposing","isEditableImage","e","t","o","r","n","l","a","i","s","d","c","v","_hoisted_1$1","_hoisted_2$1","PkChatButton_default","defineComponent","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","__props","createVNode","toDisplayString","createCommentVNode","MAX_EDGE","MAX_PIXELS","JPEG_QUALITY","FRAME_TIMEOUT_MS","canTakeScreenshot","policy","screenshotSize","scale","width","height","drawFrame","image","release","bitmap","track","video","stream","timer","resolve","size","canvas","context","SCREENSHOT_TYPES","encode","type","allowedTypes","blob","EXTENSIONS","pad","value","takeScreenshot","controller","error","now","stamp","name","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","PkChatbotInput_default","\"modelValue\"","\"modelModifiers\"","\"pendingAttachments\"","\"pendingAttachmentsModifiers\"","__expose","__emit","PkImageEditorDialog","defineAsyncComponent","modelValue","useModel","pendingAttachments","emit","props","$t","useI18n","textareaEl","useTemplateRef","fileInputEl","cameraInputEl","formEl","localValue","ref","syncTimer","cancelSync","flushSync","scheduleSync","onTextareaInput","nextTick","isStreaming","computed","isSubmitted","isInputDisabled","counterId","useId","currentLength","isOverLimit","isUploadingAnyFile","hasFailedAttachment","isSubmitEnabled","isQueueing","hasTabKey","suggestionHintId","shownSuggestion","describedBy","hasCaptureSupport","acceptMimeTypes","allowed","acceptImageMimeTypes","m","showCameraOption","openFilePicker","openCameraPicker","hasScreenshotSupport","showScreenshotOption","screenshotFailed","emitFiles","file","files","onFileChange","input","event","onTextareaPaste","data","removeAttachment","att","id","editingId","editing","annotating","shallowRef","annotatingScreenshot","editorFile","isEditable","closeEditor","attachScreenshot","result","onImageEdited","annotated","isDismissableNoticeVisible","closeDismissableNotice","activeNotices","notices","notice","keepKeyboardFocus","stopGeneration","handleSubmit","onTextareaEnter","onTextareaTab","suggestion","textareaWidth","useResizeObserver","entry","watch","onBeforeUnmount","_component_VvButton","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","Fragment","renderList","createBlock","unref","createElementVNode","withModifiers","_cache","createTextVNode","renderSlot","_ctx","normalizeProps","mergeProps","withCtx","init","aria","toggle","withKeys"],"sources":["../../../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js","../../../../packages/components/src/chat/PkChatButton.vue","../../../../packages/components/src/chat/screenshot.ts","../../../../packages/components/src/chat/PkChatbotInput.vue"],"sourcesContent":["var e=new Map;function t(t){var o=e.get(t);o&&o.destroy()}function o(t){var o=e.get(t);o&&o.update()}var r=null;\"undefined\"==typeof window?((r=function(e){return e}).destroy=function(e){return e},r.update=function(e){return e}):((r=function(t,o){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&\"TEXTAREA\"===t.nodeName&&!e.has(t)){var o,r=null,n=window.getComputedStyle(t),i=(o=t.value,function(){a({testForHeightReduction:\"\"===o||!t.value.startsWith(o),restoreTextAlign:null}),o=t.value}),l=function(o){t.removeEventListener(\"autosize:destroy\",l),t.removeEventListener(\"autosize:update\",s),t.removeEventListener(\"input\",i),window.removeEventListener(\"resize\",s),Object.keys(o).forEach(function(e){return t.style[e]=o[e]}),e.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener(\"autosize:destroy\",l),t.addEventListener(\"autosize:update\",s),t.addEventListener(\"input\",i),window.addEventListener(\"resize\",s),t.style.overflowX=\"hidden\",t.style.wordWrap=\"break-word\",e.set(t,{destroy:l,update:s}),s()}function a(e){var o,i,l=e.restoreTextAlign,s=void 0===l?null:l,d=e.testForHeightReduction,u=void 0===d||d,c=n.overflowY;if(0!==t.scrollHeight&&(\"vertical\"===n.resize?t.style.resize=\"none\":\"both\"===n.resize&&(t.style.resize=\"horizontal\"),u&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach(function(e){var t=e[0],o=e[1];t.style.scrollBehavior=\"auto\",t.scrollTop=o,t.style.scrollBehavior=null})}}(t),t.style.height=\"\"),i=\"content-box\"===n.boxSizing?t.scrollHeight-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):t.scrollHeight+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),\"none\"!==n.maxHeight&&i>parseFloat(n.maxHeight)?(\"hidden\"===n.overflowY&&(t.style.overflow=\"scroll\"),i=parseFloat(n.maxHeight)):\"hidden\"!==n.overflowY&&(t.style.overflow=\"hidden\"),t.style.height=i+\"px\",s&&(t.style.textAlign=s),o&&o(),r!==i&&(t.dispatchEvent(new Event(\"autosize:resized\",{bubbles:!0})),r=i),c!==n.overflow&&!s)){var v=n.textAlign;\"hidden\"===n.overflow&&(t.style.textAlign=\"start\"===v?\"end\":\"start\"),a({restoreTextAlign:v,testForHeightReduction:!0})}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(t)}),t}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],t),e},r.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e});var n=r;export default n;\n","<script lang=\"ts\" setup>\n /**\n * The icon button of the chat dock: attach, send and stop in the input,\n * mute and hang up in a live call. One component, because the call bar\n * takes the place of the input and the two must not look like two\n * different pieces of software.\n *\n * Native attributes fall through to the button, so `title`, `disabled` and\n * `aria-pressed` are written by the caller as they would be on a `<button>`.\n */\n withDefaults(\n defineProps<{\n icon: string\n /** Written next to the icon, for an action nobody should have to guess from a glyph. */\n label?: string\n type?: 'button' | 'submit'\n /** `primary` is the filled circle of send and stop, the one action the dock is for. */\n modifiers?: 'danger' | 'primary'\n }>(),\n { label: undefined, type: 'button', modifiers: undefined },\n )\n</script>\n\n<template>\n <button\n class=\"pk-chat-button\"\n :class=\"[\n modifiers ? `pk-chat-button--${modifiers}` : undefined,\n { 'pk-chat-button--labelled': label },\n ]\"\n :type=\"type\">\n <VvIcon :name=\"icon\" class=\"pk-chat-button__icon\" />\n <span v-if=\"label\" class=\"pk-chat-button__label\">{{ label }}</span>\n </button>\n</template>\n\n<style lang=\"scss\">\n .pk-chat-button {\n position: relative;\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n padding: var(--spacing-4);\n border: none;\n border-radius: var(--rounded);\n background-color: transparent;\n color: var(--color-word-1);\n cursor: pointer;\n transition: var(--transition-colors);\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n // The fields' focus ring: a 1px surface-5 line measured 1.3:1 on the\n // surface, under the 3:1 a focus indicator needs\n &:focus-visible {\n outline: var(--spacing-2) solid var(--input-focus-color);\n outline-offset: 0;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n // A finger needs 40px and the button is drawn at 28: on a touch\n // screen it answers 8px around itself, in every layout of the chat\n // (it was the fullscreen one only) and in the call bar, which mounts\n // the same button\n @media (pointer: coarse) {\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-8));\n }\n }\n\n // A toggle has to survive a glance: a crossed-out glyph alone changes\n // too few pixels to notice mid-sentence.\n &[aria-pressed='true'] {\n background-color: var(--color-surface-3);\n color: var(--color-word);\n }\n\n // A wash of the same red rather than a lighter red behind it: the\n // `lighten-5` step lands close enough to the icon to leave it at about\n // 2:1, which is a button that disappears exactly while it is being\n // pointed at. The tint composites over whatever surface is behind, so\n // it holds in the dark theme too.\n &--danger {\n // The project's text shade of danger; the fill where a host app\n // loads only the library and this package's stylesheet\n color: var(--u-danger-text, var(--color-danger));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-danger) 12%,\n transparent\n );\n }\n }\n\n // Same 28px box as the ghost buttons, so the dock keeps its height,\n // with a smaller glyph because a filled shape needs air around it.\n // Its edge is visible, so it sits on the input's padding line just as\n // the text does: a ghost glyph sat 6px further in and made the two\n // sides of the input look unequal. Empty, it turns into a grey pad\n // with the fields' disabled ink: a light arrow on that pad vanished,\n // and with it the circle's edge, which is what squares the sides.\n // The agent's color when the widget has one, like the user's bubble.\n &--primary {\n --pk-chat-button-fill: var(\n --chatbot-main-color,\n var(--color-word-1)\n );\n\n padding: var(--spacing-6);\n border-radius: var(--rounded-full);\n background-color: var(--pk-chat-button-fill);\n color: var(--chatbot-contrast-color, var(--color-surface));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--pk-chat-button-fill) 85%,\n var(--color-surface)\n );\n }\n\n // Off the disc, or a dark ring would sink into a dark fill\n &:focus-visible {\n outline-offset: var(--spacing-2);\n }\n\n &:disabled {\n opacity: 1;\n background-color: var(--color-surface-3);\n color: var(--color-word-3);\n }\n\n .pk-chat-button__icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n }\n\n &--labelled {\n gap: var(--spacing-4);\n padding-inline: var(--spacing-8);\n font-size: var(--text-12);\n }\n\n &__icon {\n display: block;\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n</style>\n","/**\n * One picture of a window or a screen the user picks, for the chat to attach\n * (spec `chat-copy-paste-screenshot.md`). The sharing the browser opens to\n * take it ends as soon as the frame is drawn: the browser's \"sharing\" bar\n * comes and goes, and the frame stays in the page until the user sends it.\n */\n\n/** Chromium's `ImageCapture`, not in the DOM typings. */\ninterface ImageCaptureLike {\n grabFrame(): Promise<ImageBitmap>\n}\ndeclare const ImageCapture:\n (new (track: MediaStreamTrack) => ImageCaptureLike) | undefined\n\n/** Chromium's Conditional Focus (Chrome and Edge 109+). */\ninterface CaptureControllerLike {\n setFocusBehavior?(\n behavior: 'focus-captured-surface' | 'focus-capturing-application',\n ): void\n}\ndeclare const CaptureController: (new () => CaptureControllerLike) | undefined\n\n/** Chromium's Permissions Policy reader, not in the DOM typings. */\ntype FeaturePolicyDocument = Document & {\n featurePolicy?: { allowsFeature(feature: string): boolean }\n}\n\n// Past this the model scales the image down anyway (1568 px on the long\n// side, about 1.15 megapixels for Claude): sent larger, it only weighs more\nconst MAX_EDGE = 1568\nconst MAX_PIXELS = 1_150_000\nconst JPEG_QUALITY = 0.85\n/** How long a still screen is waited on for a frame before drawing anyway. */\nconst FRAME_TIMEOUT_MS = 300\n\nexport type ScreenshotResult =\n { status: 'taken'; file: File } | { status: 'cancelled' | 'failed' }\n\n/**\n * Whether this page can offer a screenshot: the API exists and the page's\n * Permissions Policy does not forbid it (an embedding frame without\n * `display-capture`). A phone or a tablet has no screen to share, but the\n * caller judges that, from the pointer.\n */\nexport function canTakeScreenshot(): boolean {\n if (typeof navigator.mediaDevices?.getDisplayMedia !== 'function') {\n return false\n }\n const policy = (document as FeaturePolicyDocument).featurePolicy\n return policy ? policy.allowsFeature('display-capture') : true\n}\n\n/** The size a frame is sent at: within the limits above, never scaled up. */\nexport const screenshotSize = (width: number, height: number) => {\n const scale = Math.min(\n 1,\n MAX_EDGE / Math.max(width, height),\n Math.sqrt(MAX_PIXELS / (width * height)),\n )\n return {\n width: Math.round(width * scale),\n height: Math.round(height * scale),\n }\n}\n\n/**\n * The frame of the track, drawn on a canvas at the size above.\n * `ImageCapture` reads the track itself (Chrome, Edge); elsewhere a video\n * element plays it, and a still screen sends no new frame, so the first one\n * is waited on for a moment only.\n */\nasync function drawFrame(\n stream: MediaStream,\n track: MediaStreamTrack,\n): Promise<HTMLCanvasElement> {\n let image: CanvasImageSource\n let width: number\n let height: number\n let release: () => void\n if (typeof ImageCapture === 'function') {\n const bitmap = await new ImageCapture(track).grabFrame()\n image = bitmap\n width = bitmap.width\n height = bitmap.height\n release = () => bitmap.close()\n } else {\n const video = document.createElement('video')\n video.muted = true\n video.playsInline = true\n video.srcObject = stream\n await video.play()\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, FRAME_TIMEOUT_MS)\n video.requestVideoFrameCallback?.(() => {\n clearTimeout(timer)\n resolve()\n })\n })\n image = video\n width = video.videoWidth\n height = video.videoHeight\n release = () => {\n video.srcObject = null\n }\n }\n try {\n const size = screenshotSize(width, height)\n const canvas = document.createElement('canvas')\n canvas.width = size.width\n canvas.height = size.height\n const context = canvas.getContext('2d')\n if (!context) {\n throw new Error('No 2D context')\n }\n context.imageSmoothingQuality = 'high'\n context.drawImage(image, 0, 0, size.width, size.height)\n return canvas\n } finally {\n release()\n }\n}\n\n/**\n * The types a screenshot is written in, by preference: JPEG, as legible as\n * WebP at this size and encoded ten times faster, then WebP, then PNG.\n */\nexport const SCREENSHOT_TYPES = ['image/jpeg', 'image/webp', 'image/png']\n\n/**\n * The canvas in the first of {@link SCREENSHOT_TYPES} the agent takes. A\n * browser that cannot encode a type gives PNG instead, which is skipped\n * unless PNG is what was asked.\n */\nasync function encode(\n canvas: HTMLCanvasElement,\n allowedTypes: readonly string[],\n): Promise<Blob | undefined> {\n for (const type of SCREENSHOT_TYPES) {\n if (!allowedTypes.includes(type)) {\n continue\n }\n const blob = await new Promise<Blob | null>((resolve) =>\n canvas.toBlob(resolve, type, JPEG_QUALITY),\n )\n if (blob?.type === type) {\n return blob\n }\n }\n return undefined\n}\n\nconst EXTENSIONS: Record<string, string> = {\n 'image/jpeg': 'jpg',\n 'image/webp': 'webp',\n 'image/png': 'png',\n}\n\nconst pad = (value: number) => String(value).padStart(2, '0')\n\n/**\n * Asks the browser for a window or a screen and takes one picture of it.\n * Call it from the click: `getDisplayMedia` needs the user's gesture, and is\n * reached before any await.\n *\n * @param allowedTypes - the image types the agent accepts as uploads\n * @param name - the file name without extension, such as \"Screenshot\"\n */\nexport async function takeScreenshot(\n allowedTypes: readonly string[],\n name: string,\n): Promise<ScreenshotResult> {\n const controller =\n typeof CaptureController === 'function'\n ? new CaptureController()\n : undefined\n let stream: MediaStream\n try {\n stream = await navigator.mediaDevices.getDisplayMedia({\n video: { displaySurface: 'window' },\n audio: false,\n // Chromium hints: never the chat's own tab, and the chat keeps\n // the focus once the user has picked\n selfBrowserSurface: 'exclude',\n ...(controller && { controller }),\n } as DisplayMediaStreamOptions)\n } catch (error) {\n return {\n status:\n error instanceof DOMException &&\n error.name === 'NotAllowedError'\n ? 'cancelled'\n : 'failed',\n }\n }\n try {\n // Only in the task that resolved the capture, before any other await.\n // A whole screen has no focus to keep, and Chromium throws there\n try {\n controller?.setFocusBehavior?.('focus-capturing-application')\n } catch {\n // The picture is still to take\n }\n const track = stream.getVideoTracks()[0]\n if (!track) {\n return { status: 'failed' }\n }\n const canvas = await drawFrame(stream, track)\n const blob = await encode(canvas, allowedTypes)\n if (!blob) {\n return { status: 'failed' }\n }\n const now = new Date()\n const stamp = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}.${pad(now.getMinutes())}.${pad(now.getSeconds())}`\n const file = new File(\n [blob],\n `${name} ${stamp}.${EXTENSIONS[blob.type]}`,\n { type: blob.type, lastModified: now.getTime() },\n )\n return { status: 'taken', file }\n } catch {\n return { status: 'failed' }\n } finally {\n stream.getTracks().forEach((track) => track.stop())\n }\n}\n","<script setup lang=\"ts\">\n // @ts-expect-error - no types for autosize\n import autosize from 'autosize'\n import {\n computed,\n defineAsyncComponent,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n useId,\n useTemplateRef,\n watch,\n } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useResizeObserver } from '@vueuse/core'\n import {\n chatUploadMimeType,\n codeExtensionsOf,\n type AgentFileUpload,\n } from 'models'\n import { isTouchScreen, type PendingAttachment } from 'composables'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n import PkChatButton from './PkChatButton.vue'\n import { isEditableImage, isImeComposing } from './utils'\n import {\n canTakeScreenshot,\n SCREENSHOT_TYPES,\n takeScreenshot,\n } from './screenshot'\n\n // A chunk of its own: the widget downloads the editor on the first \"Edit\"\n const PkImageEditorDialog = defineAsyncComponent(\n () => import('./PkImageEditorDialog.vue'),\n )\n\n // --- Models & Props ---\n\n const modelValue = defineModel<string | undefined>({ default: undefined })\n const pendingAttachments = defineModel<PendingAttachment[]>(\n 'pendingAttachments',\n { default: () => [] },\n )\n\n const emit = defineEmits<{\n submit: []\n 'stop-generation': []\n 'file-select': [file: File]\n /**\n * The user took an attachment back, already out of `pendingAttachments`:\n * the store deletes its upload too.\n */\n 'remove-attachment': [attachment: PendingAttachment]\n /**\n * The user edited an image (`editableImages`): `file` takes the\n * place of `attachment`, which the store uploads and replaces.\n */\n 'replace-attachment': [attachment: PendingAttachment, file: File]\n /** The user retries a failed upload (`retryableAttachments`). */\n 'retry-attachment': [attachment: PendingAttachment]\n 'dismiss-attachment-notice': []\n 'dismiss-page-notice': []\n 'open-answer-notice': [id: string]\n 'dismiss-answer-notice': [id: string]\n 'voice-start': []\n /** Point at the page (spec `page-point-and-choose.md`, P). */\n point: []\n 'remove-pointer': []\n /** The user clicked the \"Automatic\" label: back to manual confirmations. */\n 'manual-confirmations': []\n /** \"Connect a folder\" in the \"+\" menu (`folderConnect`). */\n 'connect-folder': []\n }>()\n\n const props = defineProps<{\n placeholder?: string\n /**\n * The message the user would likely send next\n * (`interface.nextMessageSuggestion`): the empty field shows it in\n * place of the placeholder, and Tab writes it in.\n */\n suggestion?: string\n dismissableNotice?: string\n /**\n * What the agent can do on the page that embeds the chat (spec\n * `page-tools.md`). Its closing is the caller's to remember.\n */\n pageNotice?: string\n status?: 'submitted' | 'streaming' | 'ready' | 'error'\n maxMessageLength?: number\n fileUpload?: AgentFileUpload\n attachmentLimitReached?: boolean\n attachmentNotice?: string\n /** Show the talk button: the agent has voice enabled. */\n voiceEnabled?: boolean\n /**\n * What is written while the agent answers is queued and sent when the\n * answer ends (spec resumable-chat-streams, F2): sending stays open.\n */\n queueEnabled?: boolean\n /** Answers that ended in another conversation, each with its own line and its \"Open\". */\n answerNotices?: { id: string; text: string }[]\n /** The user may point at the page that embeds the chat: the button shows. */\n pointerAvailable?: boolean\n /** The user is pointing at the page now. */\n pointing?: boolean\n /** What the user pointed at for this message: the chip above the field. */\n pointer?: { kind: 'element' | 'text'; label: string }\n /**\n * The user chose automatic confirmations (spec\n * `auto-confirmations.md`): a label above the field says so, and\n * takes them back to manual.\n */\n automaticConfirmations?: boolean\n /**\n * The host replaces an edited image (`replace-attachment`): the\n * images of the composer show \"Edit\" and open the image editor.\n */\n editableImages?: boolean\n /**\n * The host uploads a failed attachment again (`retry-attachment`):\n * its chip shows \"Retry\".\n */\n retryableAttachments?: boolean\n /**\n * The user may connect a folder of the computer (spec\n * `chat-local-folders.md`): the \"+\" menu offers it, also to an agent\n * that takes no attachments, and emits `connect-folder`.\n */\n folderConnect?: boolean\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n // --- Template refs ---\n\n const textareaEl = useTemplateRef<HTMLTextAreaElement>('textareaEl')\n const fileInputEl = useTemplateRef<HTMLInputElement>('fileInputEl')\n const cameraInputEl = useTemplateRef<HTMLInputElement>('cameraInputEl')\n const formEl = useTemplateRef<HTMLFormElement>('formEl')\n\n // --- Input buffering (decouples typing from reactive model propagation) ---\n\n const localValue = ref(modelValue.value ?? '')\n let syncTimer: ReturnType<typeof setTimeout> | null = null\n\n const cancelSync = () => {\n if (syncTimer !== null) {\n clearTimeout(syncTimer)\n syncTimer = null\n }\n }\n\n const flushSync = () => {\n cancelSync()\n modelValue.value = localValue.value\n }\n\n const scheduleSync = () => {\n cancelSync()\n syncTimer = setTimeout(() => {\n modelValue.value = localValue.value\n syncTimer = null\n }, 300)\n }\n\n const onTextareaInput = () => {\n localValue.value = textareaEl.value?.value ?? ''\n scheduleSync()\n }\n\n watch(modelValue, (v) => {\n if (v !== localValue.value) {\n localValue.value = v ?? ''\n nextTick(() => {\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n })\n }\n })\n\n // --- Status computeds ---\n\n const isStreaming = computed(() => props.status === 'streaming')\n const isSubmitted = computed(() => props.status === 'submitted')\n const isInputDisabled = computed(\n () => isStreaming.value || isSubmitted.value,\n )\n\n // --- Validation ---\n\n const counterId = useId()\n const currentLength = computed(() => localValue.value.length)\n\n const isOverLimit = computed(\n () =>\n props.maxMessageLength !== undefined &&\n currentLength.value > props.maxMessageLength,\n )\n\n const isUploadingAnyFile = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'uploading'),\n )\n\n // A failed attachment would leave the message without a word: the send\n // stays off until the user retries it or takes it back\n const hasFailedAttachment = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'error'),\n )\n\n const isSubmitEnabled = computed(() => {\n if (\n (isInputDisabled.value && !props.queueEnabled) ||\n isUploadingAnyFile.value ||\n hasFailedAttachment.value ||\n isOverLimit.value\n ) {\n return false\n }\n return localValue.value.trim().length > 0\n })\n\n /** Written during an answer: the send button queues it, next to the stop. */\n const isQueueing = computed(\n () => isInputDisabled.value && isSubmitEnabled.value,\n )\n\n // --- Suggested next message ---\n\n // Taken with Tab: a touch screen has no key for it, so it is not shown\n // there.\n const hasTabKey = !isTouchScreen()\n const suggestionHintId = useId()\n const shownSuggestion = computed(() =>\n hasTabKey &&\n props.suggestion &&\n !localValue.value &&\n !isInputDisabled.value\n ? props.suggestion\n : undefined,\n )\n const describedBy = computed(\n () =>\n [\n props.maxMessageLength ? counterId : undefined,\n shownSuggestion.value ? suggestionHintId : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n )\n\n // --- File upload ---\n\n const hasCaptureSupport = 'capture' in document.createElement('input')\n\n // A browser filters the picker by type and knows few code types: their\n // extensions go along.\n const acceptMimeTypes = computed(() => {\n const allowed = props.fileUpload?.allowedMimeTypes ?? []\n return [...allowed, ...codeExtensionsOf(allowed)].join(',')\n })\n\n const acceptImageMimeTypes = computed(() =>\n (props.fileUpload?.allowedMimeTypes ?? [])\n .filter((m) => m.startsWith('image/'))\n .join(','),\n )\n\n const showCameraOption = computed(\n () => hasCaptureSupport && acceptImageMimeTypes.value.length > 0,\n )\n\n const openFilePicker = () => {\n fileInputEl.value?.click()\n }\n\n const openCameraPicker = () => {\n cameraInputEl.value?.click()\n }\n\n // A phone or a tablet has no window to share (spec\n // `chat-copy-paste-screenshot.md`)\n const hasScreenshotSupport = !isTouchScreen() && canTakeScreenshot()\n const showScreenshotOption = computed(\n () =>\n hasScreenshotSupport &&\n SCREENSHOT_TYPES.some((type) =>\n props.fileUpload?.allowedMimeTypes?.includes(type),\n ),\n )\n const screenshotFailed = ref(false)\n\n // The store owns the attachment limits and drops any overflow; the input\n // just forwards every picked/dropped file.\n const emitFiles = (files: File[]) => {\n for (const file of files) {\n emit('file-select', file)\n }\n }\n\n const onFileChange = (event: Event) => {\n const input = event.target as HTMLInputElement\n emitFiles(Array.from(input.files ?? []))\n input.value = ''\n }\n\n /**\n * A file on the clipboard joins the attachments, like a dropped one: a\n * screenshot, an image copied from a page, a file copied in the Finder\n * or the Explorer. Cells of Excel and text of Word carry a picture of the\n * selection too, next to their text and their HTML: those paste as text.\n */\n const onTextareaPaste = (event: ClipboardEvent) => {\n const data = event.clipboardData\n if (!data?.files.length || !props.fileUpload?.enabled) {\n return\n }\n // Untrimmed: blank cells of Excel are tabs and line breaks, still text\n if (data.getData('text/plain') && data.types.includes('text/html')) {\n return\n }\n const allowed = props.fileUpload.allowedMimeTypes ?? []\n const files = Array.from(data.files).filter(\n (file) =>\n !allowed.length ||\n allowed.includes(\n chatUploadMimeType(file.name, file.type, allowed),\n ),\n )\n if (!files.length || isInputDisabled.value) {\n return\n }\n event.preventDefault()\n emitFiles(files)\n }\n\n // --- Attachments ---\n\n const removeAttachment = (id: string) => {\n const att = pendingAttachments.value.find((a) => a.id === id)\n if (!att) {\n return\n }\n URL.revokeObjectURL(att.localUrl)\n pendingAttachments.value = pendingAttachments.value.filter(\n (a) => a.id !== id,\n )\n emit('remove-attachment', att)\n }\n\n // The image in the editor: an attachment of the list, which the copy\n // replaces (gone from the list, sent or taken back, the editor closes\n // with it), or an image of the conversation, whose copy joins the list\n // (\"Annota e chiedi\", spec `chat-image-editor.md`, F3)\n const editingId = ref<string>()\n const editing = computed(() =>\n pendingAttachments.value.find((a) => a.id === editingId.value),\n )\n const annotating = shallowRef<Promise<File>>()\n // A screenshot opens the same editor as its preview: it goes with \"Use\"\n // even unchanged, and nothing is uploaded before\n const annotatingScreenshot = ref(false)\n const editorFile = computed(() => editing.value?.file ?? annotating.value)\n\n const isEditable = (att: PendingAttachment) =>\n !!props.editableImages &&\n att.state !== 'uploading' &&\n isEditableImage(att.file.type)\n\n const closeEditor = () => {\n editingId.value = undefined\n annotating.value = undefined\n annotatingScreenshot.value = false\n }\n\n const attachScreenshot = async () => {\n screenshotFailed.value = false\n const result = await takeScreenshot(\n props.fileUpload?.allowedMimeTypes ?? [],\n $t('label.screenshotFileName'),\n )\n if (result.status === 'failed') {\n screenshotFailed.value = true\n return\n }\n if (result.status === 'taken') {\n editingId.value = undefined\n annotating.value = Promise.resolve(result.file)\n annotatingScreenshot.value = true\n }\n }\n\n const onImageEdited = async (file: File) => {\n const att = editing.value\n const annotated = !att && !!annotating.value\n closeEditor()\n if (att) {\n emit('replace-attachment', att, file)\n } else if (annotated) {\n emit('file-select', file)\n } else {\n return\n }\n // Once the dialog is gone: its chip is gone too, so the focus it\n // hands back on closing lands nowhere\n await nextTick()\n textareaEl.value?.focus()\n }\n\n // --- Notices (one box above the input) ---\n\n type InputNotice = {\n id: string\n text?: string\n markdown?: string\n icon?: string\n open?: () => void\n dismiss?: () => void\n }\n\n const isDismissableNoticeVisible = ref(true)\n const closeDismissableNotice = () => {\n isDismissableNoticeVisible.value = false\n }\n\n const activeNotices = computed<InputNotice[]>(() => {\n // The alert answers what the user just did, and takes the box alone\n // until it is closed.\n if (props.attachmentNotice) {\n return [\n {\n id: 'limit',\n icon: 'ri:information-line',\n text: props.attachmentNotice,\n dismiss: () => emit('dismiss-attachment-notice'),\n },\n ]\n }\n const notices: InputNotice[] = []\n // Why the send is off: it stays until the attachment is retried or\n // taken back, so it has no close\n if (hasFailedAttachment.value) {\n notices.push({\n id: 'upload-failed',\n icon: 'ri:error-warning-line',\n text: $t('message.attachmentUploadFailed'),\n })\n }\n if (screenshotFailed.value) {\n notices.push({\n id: 'screenshot-failed',\n icon: 'ri:error-warning-line',\n text: $t('message.screenshotFailed'),\n dismiss: () => {\n screenshotFailed.value = false\n },\n })\n }\n // An answer that ended where the user is not: news, so it comes\n // first, and it leaves once opened or closed.\n for (const notice of props.answerNotices ?? []) {\n notices.push({\n id: `answer-${notice.id}`,\n icon: 'ri:chat-check-line',\n text: notice.text,\n open: () => emit('open-answer-notice', notice.id),\n dismiss: () => emit('dismiss-answer-notice', notice.id),\n })\n }\n // What the agent does on this page, next: the user should read it\n // before writing. The agent's own notice stays beside it, never\n // behind it: it is where an agent states its terms, a privacy\n // policy among them.\n if (props.pageNotice) {\n notices.push({\n id: 'page',\n icon: 'ri:pages-line',\n text: props.pageNotice,\n dismiss: () => emit('dismiss-page-notice'),\n })\n }\n if (props.dismissableNotice && isDismissableNoticeVisible.value) {\n notices.push({\n id: 'dismissable',\n markdown: props.dismissableNotice,\n dismiss: closeDismissableNotice,\n })\n }\n return notices\n })\n\n // --- Submit ---\n\n /**\n * Send turns disabled and then gives way to stop, stop gives way to send:\n * a keyboard user who pressed one would be left on the page body. Hand\n * the focus to the textarea, but only after a keyboard press: a tap has no\n * focus to keep, and focusing would bring the phone keyboard back up over\n * the answer.\n */\n const keepKeyboardFocus = () => {\n if (formEl.value?.querySelector('button:focus-visible')) {\n textareaEl.value?.focus()\n }\n }\n\n const stopGeneration = () => {\n keepKeyboardFocus()\n emit('stop-generation')\n }\n\n const handleSubmit = () => {\n if (!isSubmitEnabled.value) {\n return\n }\n keepKeyboardFocus()\n flushSync()\n emit('submit')\n localValue.value = ''\n modelValue.value = ''\n nextTick(() => {\n if (textareaEl.value) {\n textareaEl.value.value = ''\n autosize.update(textareaEl.value)\n }\n })\n }\n\n /**\n * Enter sends, Shift+Enter goes to a new line. The Enter that confirms an\n * IME composition belongs to the composition.\n */\n const onTextareaEnter = (event: KeyboardEvent) => {\n if (event.shiftKey || isImeComposing(event)) {\n return\n }\n event.preventDefault()\n handleSubmit()\n }\n\n /**\n * Tab writes the suggested message into the empty field, the caret at its\n * end, for the user to send or change. Without a suggestion, or with a\n * modifier, Tab moves the focus as usual.\n */\n const onTextareaTab = (event: KeyboardEvent) => {\n const suggestion = shownSuggestion.value\n if (\n !suggestion ||\n event.shiftKey ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n isImeComposing(event)\n ) {\n return\n }\n event.preventDefault()\n localValue.value = suggestion\n flushSync()\n nextTick(() => {\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n textareaEl.value.setSelectionRange(\n suggestion.length,\n suggestion.length,\n )\n }\n })\n }\n\n // --- Lifecycle ---\n\n onMounted(() => {\n if (textareaEl.value) {\n autosize(textareaEl.value)\n }\n })\n\n // autosize measures on input and on a window resize only, and an empty\n // textarea measures its placeholder. The chat settles its layout after\n // mount: measured at a first, narrower width, the placeholder wrapped,\n // and on the chat page of a phone the field stayed 88px tall, four lines\n // with the text at their top, until the user typed. Measured again when\n // its width changes, or its placeholder.\n let textareaWidth = 0\n useResizeObserver(textareaEl, ([entry]) => {\n const width = entry?.contentRect.width ?? 0\n if (textareaEl.value && width !== textareaWidth) {\n textareaWidth = width\n autosize.update(textareaEl.value)\n }\n })\n watch(\n () => shownSuggestion.value ?? props.placeholder,\n async () => {\n await nextTick()\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n },\n )\n\n onBeforeUnmount(() => {\n cancelSync()\n if (textareaEl.value) {\n autosize.destroy(textareaEl.value)\n }\n for (const att of pendingAttachments.value) {\n URL.revokeObjectURL(att.localUrl)\n }\n })\n\n defineExpose({\n /** Move the focus to the message field */\n focus: () => textareaEl.value?.focus(),\n /**\n * Opens the editor on an image of the conversation, whose bytes are\n * on their way; the copy made of it joins the attachments.\n */\n annotateImage: (file: Promise<File>) => {\n editingId.value = undefined\n annotating.value = file\n annotatingScreenshot.value = false\n },\n })\n</script>\n\n<template>\n <div class=\"pk-chatbot-input\">\n <div\n v-if=\"activeNotices.length\"\n class=\"pk-chatbot-input__notice\"\n role=\"status\">\n <div\n v-for=\"notice in activeNotices\"\n :key=\"notice.id\"\n class=\"pk-chatbot-input__notice-item\">\n <VvIcon\n v-if=\"notice.icon\"\n :name=\"notice.icon\"\n class=\"pk-chatbot-input__notice-icon\" />\n <PkStreamingMarkdown\n v-if=\"notice.markdown\"\n :markdown=\"notice.markdown\"\n class=\"wysiwyg pk-chatbot-input__notice-text\" />\n <span v-else class=\"pk-chatbot-input__notice-text\">\n {{ notice.text }}\n </span>\n <VvButton\n v-if=\"notice.open\"\n :label=\"$t('action.open')\"\n modifiers=\"link\"\n class=\"pk-chatbot-input__notice-action\"\n @click=\"notice.open()\" />\n <VvButton\n v-if=\"notice.dismiss\"\n :title=\"$t('action.close')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"notice.dismiss()\" />\n </div>\n </div>\n <form\n ref=\"formEl\"\n class=\"pk-chatbot-input__form\"\n @submit.prevent=\"handleSubmit\">\n <button\n v-if=\"automaticConfirmations\"\n type=\"button\"\n class=\"pk-chatbot-input__mode\"\n :title=\"$t('action.manualConfirmations')\"\n @click=\"emit('manual-confirmations')\">\n <VvIcon\n name=\"ri:flashlight-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n {{ $t('label.automaticConfirmations') }}\n <VvIcon\n name=\"ri:close-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n </button>\n <div v-if=\"pointer\" class=\"pk-chatbot-input__pointer\">\n <VvIcon\n :name=\"\n pointer.kind === 'text'\n ? 'ri:double-quotes-l'\n : 'ri:focus-3-line'\n \"\n class=\"pk-chatbot-input__pointer-icon\" />\n <span class=\"pk-chatbot-input__pointer-label\">\n {{\n pointer.kind === 'text'\n ? `«${pointer.label}»`\n : pointer.label\n }}\n </span>\n <VvButton\n :title=\"$t('pagePointer.remove')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"emit('remove-pointer')\" />\n </div>\n <div\n v-if=\"pendingAttachments.length\"\n class=\"pk-chatbot-input__attachments\">\n <PkChatbotFilePreview\n v-for=\"att in pendingAttachments\"\n :key=\"att.id\"\n :media-type=\"att.mediaSource?.mimeType ?? att.file.type\"\n :url=\"att.localUrl\"\n :filename=\"att.file.name\"\n :size=\"att.file.size\"\n :loading=\"att.state === 'uploading'\"\n :error=\"att.state === 'error' ? att.error : undefined\"\n :removable=\"att.state !== 'uploading'\"\n :editable=\"isEditable(att)\"\n :retryable=\"retryableAttachments && att.state === 'error'\"\n compact\n @remove=\"removeAttachment(att.id)\"\n @edit=\"editingId = att.id\"\n @retry=\"emit('retry-attachment', att)\" />\n </div>\n <div class=\"pk-chatbot-input__fieldset\">\n <slot name=\"prepend\" />\n <VvDropdown\n v-if=\"\n (fileUpload?.enabled &&\n (showCameraOption ||\n showScreenshotOption ||\n $slots['additional-actions'])) ||\n folderConnect\n \"\n v-bind=\"{\n placement: 'top-start',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n }\">\n <template #default=\"{ init, toggle, aria }\">\n <!-- The only one still written by hand: the dropdown\n anchors itself to whatever `init` receives, and that\n has to be the element, not a component instance -->\n <button\n :ref=\"(e: any) => init(e)\"\n v-bind=\"aria\"\n class=\"pk-chat-button\"\n type=\"button\"\n :title=\"\n fileUpload?.enabled\n ? $t('action.attachFile')\n : $t('localFolders.connect')\n \"\n :disabled=\"isInputDisabled\"\n @click=\"toggle\">\n <VvIcon\n name=\"ri:add-line\"\n class=\"pk-chat-button__icon\" />\n </button>\n </template>\n <template #items>\n <VvDropdownAction\n v-if=\"fileUpload?.enabled && showCameraOption\"\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openCameraPicker\">\n <VvIcon\n name=\"ri:camera-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.takePhoto') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"fileUpload?.enabled && showScreenshotOption\"\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"attachScreenshot\">\n <VvIcon\n name=\"ri:screenshot-2-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.attachScreenshot') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"fileUpload?.enabled\"\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openFilePicker\">\n <VvIcon\n name=\"ri:attachment-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.attachFile') }}\n </VvDropdownAction>\n <!-- A source of files, as the attachments: the\n folders' box shows only once one is connected -->\n <VvDropdownAction\n v-if=\"folderConnect\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('connect-folder')\">\n <VvIcon\n name=\"ri:folder-add-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('localFolders.connect') }}\n </VvDropdownAction>\n <slot name=\"additional-actions\" />\n </template>\n </VvDropdown>\n <PkChatButton\n v-else-if=\"fileUpload && fileUpload.enabled\"\n icon=\"ri:add-line\"\n :title=\"$t('action.attachFile')\"\n :disabled=\"isInputDisabled || attachmentLimitReached\"\n @click=\"openFilePicker\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled\"\n ref=\"fileInputEl\"\n type=\"file\"\n hidden\n multiple\n :accept=\"acceptMimeTypes\"\n @change=\"onFileChange\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled && showCameraOption\"\n ref=\"cameraInputEl\"\n type=\"file\"\n capture=\"environment\"\n hidden\n :accept=\"acceptImageMimeTypes\"\n @change=\"onFileChange\" />\n <PkChatButton\n v-if=\"pointerAvailable\"\n icon=\"ri:focus-3-line\"\n :title=\"$t('pagePointer.start')\"\n :aria-pressed=\"pointing\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('point')\" />\n <div class=\"pk-chatbot-input__content\">\n <textarea\n ref=\"textareaEl\"\n :value=\"localValue\"\n class=\"pk-chatbot-input__textarea\"\n name=\"message\"\n rows=\"1\"\n enterkeyhint=\"send\"\n :aria-label=\"$t('label.message')\"\n :aria-describedby=\"describedBy\"\n :aria-invalid=\"isOverLimit || undefined\"\n :placeholder=\"shownSuggestion ?? placeholder\"\n @input=\"onTextareaInput\"\n @keydown.enter=\"onTextareaEnter\"\n @keydown.tab=\"onTextareaTab\"\n @paste=\"onTextareaPaste\"></textarea>\n </div>\n <span\n v-if=\"shownSuggestion\"\n class=\"pk-chatbot-input__suggestion-key\">\n <kbd aria-hidden=\"true\">Tab</kbd>\n <span :id=\"suggestionHintId\" class=\"u-visually-hidden\">\n {{ $t('hint.suggestedNextMessage') }}\n </span>\n </span>\n <div\n v-if=\"maxMessageLength\"\n :id=\"counterId\"\n class=\"pk-chatbot-input__counter\"\n :class=\"{ 'pk-chatbot-input__counter--over': isOverLimit }\">\n {{ $n(currentLength, 'integer') }}/<span\n class=\"opacity-60\"\n >{{ $n(maxMessageLength, 'integer') }}</span\n >\n </div>\n <PkChatButton\n v-if=\"voiceEnabled && !isStreaming\"\n icon=\"ri:mic-line\"\n :title=\"$t('action.talk')\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('voice-start')\" />\n <!-- With a message to queue the send button is the filled one,\n and the stop steps back beside it -->\n <PkChatButton\n v-if=\"isStreaming\"\n icon=\"ri:stop-fill\"\n :modifiers=\"isQueueing ? undefined : 'primary'\"\n :title=\"$t('action.stop')\"\n @click=\"stopGeneration\" />\n <PkChatButton\n v-if=\"isQueueing\"\n type=\"submit\"\n modifiers=\"primary\"\n icon=\"ri:arrow-up-line\"\n :title=\"$t('action.queueMessage')\" />\n <PkChatButton\n v-else-if=\"!isStreaming\"\n type=\"submit\"\n modifiers=\"primary\"\n :icon=\"isSubmitted ? 'loading-loop' : 'ri:arrow-up-line'\"\n :title=\"$t('action.submit')\"\n :disabled=\"!isSubmitEnabled\" />\n </div>\n </form>\n <!-- Outside the form: Enter in the editor must not send the message -->\n <PkImageEditorDialog\n v-if=\"editorFile\"\n :key=\"editing?.id ?? 'annotating'\"\n :file=\"editorFile\"\n :initial-tool=\"editing ? undefined : 'arrow'\"\n :keep-unchanged=\"annotatingScreenshot\"\n @apply=\"onImageEdited\"\n @close=\"closeEditor\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-input {\n position: relative;\n display: flex;\n flex-direction: column;\n margin-inline: var(--spacing-sm);\n margin-bottom: var(--spacing-sm);\n\n &__notice {\n position: relative;\n padding: var(--spacing-10) var(--spacing-sm);\n display: flex;\n flex-direction: column;\n gap: var(--spacing-10);\n background-color: var(--color-surface-1);\n border-top-left-radius: var(--rounded-xl);\n border-top-right-radius: var(--rounded-xl);\n transition-property: var(--transition-property-all);\n transition-duration: var(--duration-300);\n transition-timing-function: var(--ease-in-out);\n font-size: var(--text-12);\n color: var(--color-word-3);\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: calc(-1 * var(--spacing-12));\n height: var(--spacing-12);\n background-color: var(--color-surface-1);\n z-index: 1;\n }\n\n // Two notices read as two lines of one box, with a hairline\n // between them\n &-item {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-sm);\n\n & + & {\n padding-top: var(--spacing-10);\n border-top: 1px solid var(--color-surface-3);\n }\n }\n\n &-icon {\n flex-shrink: 0;\n width: var(--spacing-18);\n height: var(--spacing-18);\n }\n\n &-text {\n flex: 1;\n min-width: 0;\n }\n\n // A word of the line's size, on the line: the notice stays one\n // quiet row, not a button bar\n &-action {\n flex-shrink: 0;\n font-size: inherit;\n }\n }\n\n &__form {\n position: relative;\n display: flex;\n z-index: 1;\n flex-direction: column;\n\n // The composer is a field too: same border and focus ring as the\n // form fields, on top of the shadow and the 12px radius that make\n // it the container (12) of its 8px buttons\n border-radius: var(--rounded-xl);\n border: 1px solid var(--input-border-color);\n background-color: var(--color-surface);\n padding: var(--spacing-14);\n box-shadow: var(--shadow-lg);\n font-size: var(\n --text-16\n ); // prevent ios zoom on input focus by using a font size >= 16px\n\n gap: var(--spacing-xs);\n transition: var(--input-transition);\n\n @include media-breakpoint-up('sm', $breakpoints) {\n font-size: var(--text-14);\n padding: var(--spacing-10);\n }\n\n &:has(:focus-within) {\n border-color: var(--input-focus-color);\n box-shadow: var(--shadow-lg), var(--input-focus-ring);\n }\n }\n\n &__fieldset {\n display: flex;\n align-items: center;\n gap: var(--spacing-xs);\n flex: 1;\n\n // The buttons answer 8px around themselves on a touch screen\n // (PkChatButton): 12px apart, neither takes the other's box\n @media (pointer: coarse) {\n gap: var(--spacing-12);\n }\n }\n\n &__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n min-width: 0;\n overflow: hidden;\n }\n\n &__textarea {\n display: block;\n border: none;\n outline: none;\n resize: none;\n width: 100%;\n max-height: 200px;\n color: var(--color-word-1);\n background-color: var(--color-surface);\n\n &::placeholder {\n color: var(--color-word-3);\n }\n }\n\n // The key that takes the suggested message, beside the empty field\n &__suggestion-key {\n // Holds its visually hidden hint (`u-visually-hidden`)\n position: relative;\n flex-shrink: 0;\n align-self: center;\n\n kbd {\n display: block;\n padding-inline: var(--spacing-6);\n padding-block: var(--spacing-2);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-md);\n font-family: var(--font-mono);\n font-size: var(--text-12);\n line-height: 1;\n color: var(--color-word-3);\n background-color: var(--color-surface-1);\n }\n }\n\n &__attachments {\n display: flex;\n flex-wrap: wrap;\n\n // Roomy gap so the uniform-height chips breathe in the row.\n gap: var(--spacing-12);\n padding-bottom: var(--spacing-xs);\n border-bottom: 1px solid var(--color-surface-2);\n }\n\n // What the user pointed at on the page: one chip, the element's name\n // or the selected text, on one line\n &__pointer {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n max-width: 100%;\n padding: var(--spacing-4) var(--spacing-4) var(--spacing-4)\n var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font-size: var(--text-12);\n }\n\n &__pointer-icon {\n flex-shrink: 0;\n width: var(--spacing-14);\n height: var(--spacing-14);\n }\n\n // The automatic confirmations, while they hold: the same chip, a\n // button as a whole, since one click takes them back to manual\n &__mode {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n padding: var(--spacing-4) var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font: inherit;\n font-size: var(--text-12);\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-brand);\n outline-offset: 2px;\n }\n }\n\n &__pointer-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__counter {\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-md);\n font-size: var(--text-12);\n color: var(--color-word-3);\n line-height: 1;\n padding-inline: var(--spacing-6);\n padding-block: var(--spacing-4);\n z-index: 1;\n font-variant-numeric: tabular-nums;\n font-family: var(--font-mono);\n font-weight: var(--font-bold);\n\n &--over {\n color: var(--u-danger-text, var(--color-danger));\n border-color: var(--color-danger-lighten-5);\n font-weight: var(--font-bold);\n }\n }\n }\n</style>\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;AAAA,IAAIqC,oBAAE,IAAI,IAAE;AAAE,SAASC,GAAE,GAAE;CAAC,IAAIC,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,QAAQ;AAAC;AAAC,SAASA,EAAE,GAAE;CAAC,IAAIA,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,OAAO;AAAC;AAAC,IAAIC,IAAE;AAAkB,OAAO,SAApB,OAA4B,CAAC,IAAE,SAAS,GAAE;CAAC,OAAO;AAAC,EAAA,CAAG,UAAQ,SAAS,GAAE;CAAC,OAAO;AAAC,GAAE,EAAE,SAAO,SAAS,GAAE;CAAC,OAAO;AAAC,MAAI,CAAC,IAAE,SAAS,GAAE,GAAE;CAAC,OAAOF,KAAG,MAAM,UAAU,QAAQ,KAAKA,EAAE,SAAOA,IAAE,CAACA,CAAC,GAAE,SAAS,GAAE;EAAC,OAAO,SAAS,GAAE;GAAC,IAAGA,KAAGA,EAAE,YAAuBA,EAAE,aAAf,cAAyB,CAACD,EAAE,IAAIC,CAAC,GAAE;IAAC,IAAIC,GAAEC,IAAE,MAAKC,IAAE,OAAO,iBAAiBH,CAAC,GAAE,KAAG,IAAEA,EAAE,OAAM,WAAU;KAAC,EAAE;MAAC,wBAA4BC,MAAL,MAAQ,CAACD,EAAE,MAAM,WAAWC,CAAC;MAAE,kBAAiB;KAAI,CAAC,GAAE,IAAED,EAAE;IAAK,IAAGI,IAAE,SAAS,GAAE;KAAC,EAAE,oBAAoB,oBAAmBA,CAAC,GAAEJ,EAAE,oBAAoB,mBAAkB,CAAC,GAAEA,EAAE,oBAAoB,SAAQ,CAAC,GAAE,OAAO,oBAAoB,UAAS,CAAC,GAAE,OAAO,KAAKC,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
+ import { VvButtonGroup as t, VvDialog as n, VvIcon as r } from "@volverjs/ui-vue/components";
3
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useTemplateRef as b, withCtx as x } from "vue";
4
+ import { useI18n as S } from "vue-i18n";
5
+ // ../../packages/components/src/PkInfobox.vue
6
+ var C = /* @__PURE__ */ f({
7
+ __name: "PkInfobox",
8
+ props: {
9
+ level: { default: "info" },
10
+ icon: { default: void 0 }
11
+ },
12
+ setup(e) {
13
+ let t = e, n = a(() => t.icon ? t.icon : t.level === "warning" ? "ri:alert-line" : "ri:information-line");
14
+ return (t, i) => {
15
+ let a = r;
16
+ return m(), c("div", { class: p(["pk-infobox", `pk-infobox--${e.level}`]) }, [d(a, { name: n.value }, null, 8, ["name"]), _(t.$slots, "default")], 2);
17
+ };
18
+ }
19
+ }), w = ["aria-label"], T = { class: "pk-chatbot-local-folders__list" }, E = { class: "pk-chatbot-local-folders__text" }, D = ["title"], O = { class: "pk-chatbot-local-folders__state" }, k = { class: "pk-chatbot-local-folders__actions" }, A = { class: "text-14 text-word-2 mt-0 mb-md" }, j = /* @__PURE__ */ f({
20
+ __name: "PkChatbotLocalFolders",
21
+ props: {
22
+ folders: {},
23
+ pickerAvailable: { type: Boolean }
24
+ },
25
+ emits: [
26
+ "connect",
27
+ "connectFiles",
28
+ "allow",
29
+ "remove"
30
+ ],
31
+ setup(a, { expose: f, emit: p }) {
32
+ let _ = a, j = p, { t: M } = S({ useScope: "global" }), N = b("fileInput"), P = h(!1), F = () => {
33
+ P.value = !1, _.pickerAvailable ? j("connect") : N.value?.click();
34
+ }, I = (e) => {
35
+ let t = e.target;
36
+ t.files?.length && j("connectFiles", [...t.files]), t.value = "";
37
+ }, L = (e) => e.source === "snapshot" ? M("localFolders.state.copy") : e.permission === "granted" ? M("localFolders.state.readable") : M("localFolders.state.permission");
38
+ return f({ open: () => {
39
+ P.value = !0;
40
+ } }), (f, p) => {
41
+ let h = r, _ = e, b = t, S = n;
42
+ return m(), c(i, null, [
43
+ a.folders.length ? (m(), c("div", {
44
+ key: 0,
45
+ class: "pk-chatbot-local-folders",
46
+ role: "group",
47
+ "aria-label": y(M)("localFolders.title")
48
+ }, [l("ul", T, [(m(!0), c(i, null, g(a.folders, (e) => (m(), c("li", {
49
+ key: e.id,
50
+ class: "pk-chatbot-local-folders__row"
51
+ }, [
52
+ d(h, {
53
+ name: e.permission === "granted" ? "ri:folder-open-line" : "ri:lock-line",
54
+ class: "shrink-0 w-18 h-18"
55
+ }, null, 8, ["name"]),
56
+ l("span", E, [l("strong", {
57
+ class: "pk-chatbot-local-folders__name",
58
+ title: e.name
59
+ }, v(e.name), 9, D), l("span", O, v(L(e)), 1)]),
60
+ l("span", k, [e.permission === "granted" ? s("", !0) : (m(), o(_, {
61
+ key: 0,
62
+ modifiers: "action-small",
63
+ label: y(M)("localFolders.allow"),
64
+ "aria-label": `${y(M)("localFolders.allow")}: ${e.name}`,
65
+ onClick: (t) => j("allow", e.id)
66
+ }, null, 8, [
67
+ "label",
68
+ "aria-label",
69
+ "onClick"
70
+ ])), d(_, {
71
+ modifiers: "action-quiet",
72
+ icon: "ri:close-line",
73
+ title: y(M)("localFolders.remove", { name: e.name }),
74
+ "aria-label": y(M)("localFolders.remove", { name: e.name }),
75
+ onClick: (t) => j("remove", e.id)
76
+ }, null, 8, [
77
+ "title",
78
+ "aria-label",
79
+ "onClick"
80
+ ])])
81
+ ]))), 128))])], 8, w)) : s("", !0),
82
+ d(S, {
83
+ modelValue: P.value,
84
+ "onUpdate:modelValue": p[1] ||= (e) => P.value = e,
85
+ title: y(M)("localFolders.confirm.title"),
86
+ modifiers: "small",
87
+ role: "alertdialog"
88
+ }, {
89
+ footer: x(() => [d(b, null, {
90
+ default: x(() => [d(_, {
91
+ modifiers: "ghost",
92
+ label: y(M)("action.cancel"),
93
+ onClick: p[0] ||= (e) => P.value = !1
94
+ }, null, 8, ["label"]), d(_, {
95
+ label: y(M)("localFolders.confirm.action"),
96
+ onClick: F
97
+ }, null, 8, ["label"])]),
98
+ _: 1
99
+ })]),
100
+ default: x(() => [l("p", A, v(y(M)("localFolders.confirm.question")), 1), d(C, { class: "mb-0" }, {
101
+ default: x(() => [u(v(y(M)("localFolders.confirm.description")), 1)]),
102
+ _: 1
103
+ })]),
104
+ _: 1
105
+ }, 8, ["modelValue", "title"]),
106
+ a.pickerAvailable ? s("", !0) : (m(), c("input", {
107
+ key: 1,
108
+ ref_key: "fileInput",
109
+ ref: N,
110
+ type: "file",
111
+ webkitdirectory: "",
112
+ multiple: "",
113
+ class: "none",
114
+ onChange: I
115
+ }, null, 544))
116
+ ], 64);
117
+ };
118
+ }
119
+ });
120
+ export { C as n, j as t };
121
+
122
+ //# sourceMappingURL=PkChatbotLocalFolders-D7kxpwR2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkChatbotLocalFolders-D7kxpwR2.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createVNode","_renderSlot","_openBlock","_createElementBlock","_Fragment","_unref","_createElementVNode","_renderList","_createVNode","_toDisplayString","_createBlock","_withCtx","PkInfobox","_createTextVNode","VvButtonLocalized","PkInfobox_default","defineComponent","props","__props","iconName","computed","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","createVNode","renderSlot","_ctx","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","PkChatbotLocalFolders_default","__expose","__emit","emit","$t","useI18n","fileInput","useTemplateRef","isNoticeOpen","ref","onChoose","onFiles","input","event","stateOf","folder","_component_VvButton","_component_VvButtonGroup","VvButtonGroup","_component_VvDialog","VvDialog","Fragment","unref","createElementVNode","renderList","toDisplayString","createCommentVNode","createBlock","_cache","$event","withCtx","createTextVNode"],"sources":["../../../../packages/components/src/PkInfobox.vue","../../../../packages/components/src/chat/PkChatbotLocalFolders.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n\n const props = withDefaults(\n defineProps<{\n level?: 'info' | 'warning'\n icon?: string\n }>(),\n {\n level: 'info',\n icon: undefined,\n },\n )\n\n const iconName = computed(() => {\n if (props.icon) {\n return props.icon\n }\n return props.level === 'warning'\n ? 'ri:alert-line'\n : 'ri:information-line'\n })\n</script>\n\n<template>\n <div class=\"pk-infobox\" :class=\"`pk-infobox--${level}`\">\n <VvIcon :name=\"iconName\" />\n <slot />\n </div>\n</template>\n\n<style lang=\"scss\">\n @layer volver.components {\n .pk-infobox {\n font-size: var(--text-12);\n color: var(--color-word-3);\n line-height: var(--leading-normal);\n margin-bottom: var(--spacing-md);\n padding-block: var(--spacing-10);\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n padding-left: var(--spacing-36);\n padding-right: var(--spacing-xs);\n display: block;\n position: relative;\n border-radius: var(--rounded-lg);\n\n & > .vv-icon {\n font-size: var(--text-18);\n position: absolute;\n left: var(--spacing-8);\n }\n\n // The icon shade of the warning (DESIGN.md): the base amber\n // measures under 2:1 on the light surface\n &--warning > .vv-icon {\n color: var(--color-warning-darken-3);\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref, useTemplateRef } from 'vue'\n import { useI18n } from 'vue-i18n'\n import type { ConnectedLocalFolder } from 'composables'\n import PkInfobox from '../PkInfobox.vue'\n\n /**\n * The folders of the user's computer the agent may read (spec\n * `chat-local-folders.md`), above the input in one framed box as the\n * chat's scheduled tasks (PkChatbotWakeupBar): a row each, its name, what\n * the agent may do with it and its actions. Nothing shows until a folder\n * is connected, from the input's \"+\" menu, which calls `open`.\n *\n * A folder kept from an earlier visit waits for a click on \"Allow\": the\n * browser asks only on a gesture of the user, never on a call of the\n * model.\n */\n const props = defineProps<{\n folders: readonly ConnectedLocalFolder[]\n /** Chrome and Edge: the picker; elsewhere a copy of the folder's files. */\n pickerAvailable: boolean\n }>()\n\n const emit = defineEmits<{\n connect: []\n connectFiles: [files: File[]]\n allow: [id: string]\n remove: [id: string]\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const fileInput = useTemplateRef<HTMLInputElement>('fileInput')\n\n /**\n * The notice before the browser asks which folder: what the agent will\n * read, then, in a box of its own, who else sees it.\n */\n const isNoticeOpen = ref(false)\n\n /** The click on the notice's button is the gesture the picker needs. */\n const onChoose = () => {\n isNoticeOpen.value = false\n if (props.pickerAvailable) {\n emit('connect')\n } else {\n fileInput.value?.click()\n }\n }\n\n const onFiles = (event: Event) => {\n const input = event.target as HTMLInputElement\n if (input.files?.length) {\n emit('connectFiles', [...input.files])\n }\n input.value = ''\n }\n\n /** What the agent may do with the folder now, said on its row. */\n const stateOf = (folder: ConnectedLocalFolder) => {\n if (folder.source === 'snapshot') {\n return $t('localFolders.state.copy')\n }\n return folder.permission === 'granted'\n ? $t('localFolders.state.readable')\n : $t('localFolders.state.permission')\n }\n\n defineExpose({\n /** Starts connecting a folder: the notice first, then the browser. */\n open: () => {\n isNoticeOpen.value = true\n },\n })\n</script>\n\n<template>\n <div\n v-if=\"folders.length\"\n class=\"pk-chatbot-local-folders\"\n role=\"group\"\n :aria-label=\"$t('localFolders.title')\">\n <ul class=\"pk-chatbot-local-folders__list\">\n <li\n v-for=\"folder in folders\"\n :key=\"folder.id\"\n class=\"pk-chatbot-local-folders__row\">\n <VvIcon\n :name=\"\n folder.permission === 'granted'\n ? 'ri:folder-open-line'\n : 'ri:lock-line'\n \"\n class=\"shrink-0 w-18 h-18\" />\n <span class=\"pk-chatbot-local-folders__text\">\n <strong\n class=\"pk-chatbot-local-folders__name\"\n :title=\"folder.name\">\n {{ folder.name }}\n </strong>\n <span class=\"pk-chatbot-local-folders__state\">\n {{ stateOf(folder) }}\n </span>\n </span>\n <span class=\"pk-chatbot-local-folders__actions\">\n <!-- A framed button: a bare word beside the name did not\n read as one -->\n <VvButton\n v-if=\"folder.permission !== 'granted'\"\n modifiers=\"action-small\"\n :label=\"$t('localFolders.allow')\"\n :aria-label=\"`${$t('localFolders.allow')}: ${folder.name}`\"\n @click=\"emit('allow', folder.id)\" />\n <VvButton\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n :title=\"\n $t('localFolders.remove', { name: folder.name })\n \"\n :aria-label=\"\n $t('localFolders.remove', { name: folder.name })\n \"\n @click=\"emit('remove', folder.id)\" />\n </span>\n </li>\n </ul>\n </div>\n <VvDialog\n v-model=\"isNoticeOpen\"\n :title=\"$t('localFolders.confirm.title')\"\n modifiers=\"small\"\n role=\"alertdialog\">\n <p class=\"text-14 text-word-2 mt-0 mb-md\">\n {{ $t('localFolders.confirm.question') }}\n </p>\n <PkInfobox class=\"mb-0\">\n {{ $t('localFolders.confirm.description') }}\n </PkInfobox>\n <template #footer>\n <VvButtonGroup>\n <VvButton\n modifiers=\"ghost\"\n :label=\"$t('action.cancel')\"\n @click=\"isNoticeOpen = false\" />\n <VvButton\n :label=\"$t('localFolders.confirm.action')\"\n @click=\"onChoose\" />\n </VvButtonGroup>\n </template>\n </VvDialog>\n <!-- Firefox and Safari: the folder's files, read in the page, kept until\n it closes -->\n <input\n v-if=\"!pickerAvailable\"\n ref=\"fileInput\"\n type=\"file\"\n webkitdirectory\n multiple\n class=\"none\"\n @change=\"onFiles\" />\n</template>\n\n<style lang=\"scss\">\n // Framed as the scheduled tasks box (PkChatbotWakeupBar), in the input's\n // column and with its inset: a line across the whole chat read as\n // hanging between the answers and the field. Past three rows the list\n // scrolls rather than push the answers away.\n .pk-chatbot-local-folders {\n --pk-chatbot-local-folders-border: var(--color-surface-3);\n\n // Where the rows' icon starts and their last control ends: in the\n // column of the notice over the field below, less this box's border\n --pk-chatbot-local-folders-inset: calc(var(--spacing-sm) - 1px);\n\n margin: 0 var(--spacing-sm) var(--spacing-sm);\n overflow: hidden;\n border: 1px solid var(--pk-chatbot-local-folders-border);\n border-radius: var(--rounded-lg);\n background-color: var(--color-surface-1);\n color: var(--color-word-3);\n font-size: var(--text-12);\n\n &__list {\n display: flex;\n flex-direction: column;\n max-height: var(--spacing-192);\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n }\n\n &__row {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--spacing-sm);\n\n // The end less the 6px an icon button keeps around its icon\n padding: var(--spacing-xs)\n calc(var(--pk-chatbot-local-folders-inset) - var(--spacing-6))\n var(--spacing-xs) var(--pk-chatbot-local-folders-inset);\n }\n\n &__row + &__row {\n border-top: 1px solid var(--pk-chatbot-local-folders-border);\n }\n\n // The name, then what the agent may do with it, on one line\n &__text {\n display: flex;\n align-items: baseline;\n gap: var(--spacing-sm);\n flex: 1;\n min-width: 0;\n }\n\n &__name,\n &__state {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__name {\n flex-shrink: 0;\n max-width: 60%;\n color: var(--color-word-1);\n font-size: var(--text-14);\n font-weight: var(--font-semibold);\n }\n\n &__actions {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n flex-shrink: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;EAGI,IAAMoB,IAAQC,GAWRC,IAAWC,QACTH,EAAM,OACCA,EAAM,OAEVA,EAAM,UAAU,YACjB,kBACA,qBACT;;;GAID,OAAApB,EAAA,GAAAC,EAGM,OAAA,EAHD,OAAKC,EAAA,CAAC,cAAY,eAAwBmB,EAAA,OAAK,CAAA,E,IAChDlB,EAA2BqB,GAAA,EAAlB,MAAMF,EAAA,MAAQ,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GACvBlB,EAAQ2B,EAAA,QAAA,SAAA,C;;;;;;;;;;;;;;;;ECVZ,IAAMX,IAAQC,GAMRqB,IAAOD,GAOP,EAAE,GAAGE,MAAOC,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CC,IAAYC,EAAiC,WAAW,GAMxDC,IAAeC,EAAI,EAAK,GAGxBC,UAAiB;GAEnB,AADA,EAAa,QAAQ,IACjB7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f } from "./Media-DtudATme.js";
5
5
  import { o as p } from "./Chat-Bs3OB1ug.js";
6
6
  import { a as m, s as h, u as g } from "./ChatTask-2-ffbJFK.js";
7
- import { n as _, r as v, t as ee } from "./PkStreamingMarkdown-D38PPSbB.js";
7
+ import { n as _, r as v, t as ee } from "./PkStreamingMarkdown-D5ad7uGI.js";
8
8
  import { t as te } from "./PkChatbotError-DFZ5S5jd.js";
9
9
  import { t as ne } from "./PkChatbotFeedbackForm-Dwsln0GO.js";
10
- import { C as re, S as y, _ as b, b as ie, h as ae, m as x, x as oe, y as se } from "./localFolders-D8DxM-5y.js";
10
+ import { C as re, S as y, _ as b, b as ie, h as ae, m as x, x as oe, y as se } from "./localFolders-Dn8jAVz4.js";
11
11
  import { t as ce } from "./PkChatbotMessageFeedback-DltXugdR.js";
12
12
  import { t as le } from "./PkChatbotFilePreview-BbytSmUB.js";
13
13
  import { t as ue } from "./PkChatbotAudioTranscript-DgmuXalb.js";
14
14
  import { t as de } from "./PkRelativeTime-CZF5CYHv.js";
15
15
  import "./src-nb8MU1sh.js";
16
- import { A as fe, C as pe, I as me, L as he, N as ge, O as _e, P as ve, S as ye, W as S, _ as be, b as xe, d as Se, f as Ce, g as we, i as Te, n as Ee, r as De, t as Oe, x as ke, y as Ae, z as je } from "./utils-SmeQuVL1.js";
17
- import { n as Me, r as Ne, t as Pe } from "./PkChatbotSteps-DvYhk_xP.js";
16
+ import { A as fe, C as pe, I as me, L as he, N as ge, O as _e, P as ve, S as ye, W as S, _ as be, b as xe, d as Se, f as Ce, g as we, i as Te, n as Ee, r as De, t as Oe, x as ke, y as Ae, z as je } from "./utils-BDXwCfXk.js";
17
+ import { n as Me, r as Ne, t as Pe } from "./PkChatbotSteps-CjX5nxsq.js";
18
18
  import { t as Fe } from "./PkChatbotTaskRunMenu-CqAc_4zw.js";
19
19
  import { t as Ie } from "./PkChatbotOutlineRail-BI-DMvZi.js";
20
20
  import { n as Le } from "./useLightbox-CQ8WtQNC.js";
@@ -64,25 +64,25 @@ var W = (e) => e.state, it = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
64
64
  }, G = (e) => e?.role === "assistant" && !at(e) && ot(e), st = {
65
65
  requestOAuthConnection: j(() => import("./PkToolRequestOAuthConnection-D73L805S.js")),
66
66
  shareDocument: j(() => import("./PkToolShareDocument-CVDYH1kA.js").then((e) => e.n)),
67
- showArtifact: j(() => import("./PkToolShowArtifact-Clkqoz26.js").then((e) => e.n)),
67
+ showArtifact: j(() => import("./PkToolShowArtifact-CdS7BNoU.js").then((e) => e.n)),
68
68
  showCalendarEvent: j(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
69
- showChart: j(() => import("./PkToolShowChart-RLAsKQT7.js")),
69
+ showChart: j(() => import("./PkToolShowChart-E2NW5ess.js")),
70
70
  showComparison: j(() => import("./PkToolShowComparison-pLrUTlK6.js").then((e) => e.n)),
71
- showContactForm: j(() => import("./PkToolShowContactForm-BSDtKWWD.js").then((e) => e.n)),
72
- showDiagram: j(() => import("./PkToolShowDiagram-9EYiOJXE.js")),
71
+ showContactForm: j(() => import("./PkToolShowContactForm-COu43u5z.js").then((e) => e.n)),
72
+ showDiagram: j(() => import("./PkToolShowDiagram-BOGh8Z0j.js")),
73
73
  showEmail: j(() => import("./PkToolShowEmail-C_iJsuec.js").then((e) => e.n)),
74
- showImageGallery: j(() => import("./PkToolShowImageGallery-B2phVedq.js").then((e) => e.n)),
74
+ showImageGallery: j(() => import("./PkToolShowImageGallery-D3Z5vTb0.js").then((e) => e.n)),
75
75
  showLocation: j(() => import("./PkToolShowLocation-dTZcp7ah.js").then((e) => e.n)),
76
76
  showMessage: j(() => import("./PkToolShowMessage-2pxYXo-_.js").then((e) => e.n)),
77
- showForm: j(() => import("./PkToolShowForm-mXmiZPIW.js").then((e) => e.n)),
78
- showMultipleChoice: j(() => import("./PkToolShowForm-mXmiZPIW.js").then((e) => e.n)),
79
- showProductList: j(() => import("./PkToolShowProductList-BX9D6A8k.js").then((e) => e.n)),
77
+ showForm: j(() => import("./PkToolShowForm-D3n6fxtt.js").then((e) => e.n)),
78
+ showMultipleChoice: j(() => import("./PkToolShowForm-D3n6fxtt.js").then((e) => e.n)),
79
+ showProductList: j(() => import("./PkToolShowProductList-4mkoLMOz.js").then((e) => e.n)),
80
80
  showQrCode: j(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
81
- showSources: j(() => import("./PkToolShowSources-B0Xw8RR2.js").then((e) => e.n)),
81
+ showSources: j(() => import("./PkToolShowSources-DkpLjqfn.js").then((e) => e.n)),
82
82
  showSuggestedReply: j(() => import("./PkToolShowSuggestedReply-C4ymiiHa.js").then((e) => e.n)),
83
- showVideo: j(() => import("./PkToolShowVideo-DyOPeNq_.js")),
83
+ showVideo: j(() => import("./PkToolShowVideo-DyjqJfqW.js")),
84
84
  showWeather: j(() => import("./PkToolShowWeather-De_55i5I.js")),
85
- showWebPages: j(() => import("./PkToolShowWebPages-DajE3TAx.js").then((e) => e.n))
85
+ showWebPages: j(() => import("./PkToolShowWebPages-BSvuIrSs.js").then((e) => e.n))
86
86
  }, K = {
87
87
  key: 0,
88
88
  class: "text-12 text-word-3 m-0 mb-xs"
@@ -1147,4 +1147,4 @@ var wt = ["aria-busy"], Tt = {
1147
1147
  });
1148
1148
  export { gn as t };
1149
1149
 
1150
- //# sourceMappingURL=PkChatbotMessages-Cf19Jak8.js.map
1150
+ //# sourceMappingURL=PkChatbotMessages-CU0y2j8g.js.map