@8wave/ai-elements 0.127.0-beta.1 → 0.127.0-beta.3
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.
- package/dist/_chunks/{Agent-DytagI8S.js → Agent-nB9V45mr.js} +354 -276
- package/dist/_chunks/Agent-nB9V45mr.js.map +1 -0
- package/dist/_chunks/{Document-BdWEd1tb.js → Document-Dm5GM40t.js} +7 -7
- package/dist/_chunks/{Document-BdWEd1tb.js.map → Document-Dm5GM40t.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js → PkFilePreview-qTCDbut0.js} +3 -3
- package/dist/_chunks/{PkFilePreview-C3BxAdui.js.map → PkFilePreview-qTCDbut0.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js → PkFilePreviewDialog-m5d4zZDi.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-WAm7QSvT.js.map → PkFilePreviewDialog-m5d4zZDi.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js → PkImageEditorDialog-aekpEqWD.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-DM-d0hCD.js.map → PkImageEditorDialog-aekpEqWD.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js → PkSelectionActions-DDhRX6cs.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-Bl1KbGOj.js.map → PkSelectionActions-DDhRX6cs.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js → PkStreamingMarkdown-5WfFCjFv.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-CU1ZUUCf.js.map → PkStreamingMarkdown-5WfFCjFv.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js → PkToolChatFile-C3B9q2OL.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-B-Y47Q_K.js.map → PkToolChatFile-C3B9q2OL.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js → PkToolRequestGeolocation-D4pYnCW5.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-B41xrF8k.js.map → PkToolRequestGeolocation-D4pYnCW5.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js → PkToolRequestOAuthConnection-DnnRY2rt.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-BuCGuHwd.js.map → PkToolRequestOAuthConnection-DnnRY2rt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js → PkToolShowArtifact-DQln7TsF.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-Bjm6uhOK.js.map → PkToolShowArtifact-DQln7TsF.js.map} +1 -1
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js → PkToolShowChart-DfDB9BeZ.js} +2 -2
- package/dist/_chunks/{PkToolShowChart-B6TKQ3aT.js.map → PkToolShowChart-DfDB9BeZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js → PkToolShowContactForm-Dkb8AiqL.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-5tg4xbrh.js.map → PkToolShowContactForm-Dkb8AiqL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js → PkToolShowDiagram-B2dBogUW.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-CiNtS-vX.js.map → PkToolShowDiagram-B2dBogUW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js → PkToolShowForm-CtDcwJs4.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-eh8mXr6u.js.map → PkToolShowForm-CtDcwJs4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js → PkToolShowImageGallery-dLMI3SM7.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-DedpXD-b.js.map → PkToolShowImageGallery-dLMI3SM7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js → PkToolShowProductList-DE6BEdr_.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-D24EIc4v.js.map → PkToolShowProductList-DE6BEdr_.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js → PkToolShowSources-vSr080EU.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Dnw1x7dT.js.map → PkToolShowSources-vSr080EU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js → PkToolShowSuggestedReply-HuKn3loC.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CxNx1Uf6.js.map → PkToolShowSuggestedReply-HuKn3loC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js → PkToolShowVideo-BL-9CiYe.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-CDcJiprr.js.map → PkToolShowVideo-BL-9CiYe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js → PkToolShowWebPages-DQfODZdD.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-UXqb0XEJ.js.map → PkToolShowWebPages-DQfODZdD.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js → chatImagePolicy-Cj5lkTVq.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DJAB0Bgw.js.map → chatImagePolicy-Cj5lkTVq.js.map} +1 -1
- package/dist/_chunks/text-CCurUhdH.js +13 -0
- package/dist/_chunks/text-CCurUhdH.js.map +1 -0
- package/dist/_chunks/{utils-78zQeKDO.js → utils-CRy3kzE3.js} +458 -160
- package/dist/_chunks/utils-CRy3kzE3.js.map +1 -0
- package/dist/ai-elements.es.js +5973 -5638
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotLocalFolders.d.ts +2 -0
- package/dist-vue/PkChatbotLocalFolders.js +1 -0
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/PkChatbotWakeupBar.js +1 -1
- package/dist-vue/_chunks/{Agent-Da4XChe8.js → Agent-DKefaJeG.js} +445 -377
- package/dist-vue/_chunks/Agent-DKefaJeG.js.map +1 -0
- package/dist-vue/_chunks/{Document-CsQsUQYa.js → Document-B49E_gxT.js} +18 -18
- package/dist-vue/_chunks/{Document-CsQsUQYa.js.map → Document-B49E_gxT.js.map} +1 -1
- package/dist-vue/_chunks/{Media-CMiWEpdQ.js → Media-DtudATme.js} +12 -2
- package/dist-vue/_chunks/Media-DtudATme.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-CITKd3qD.js → PkChatbot-B2SwBImk.js} +10 -9
- package/dist-vue/_chunks/PkChatbot-B2SwBImk.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js → PkChatbotAuth-CIK2CFy-.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-SfTyFbq1.js.map → PkChatbotAuth-CIK2CFy-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js → PkChatbotEmptyState-C_htXOSW.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DI_8T5a4.js.map → PkChatbotEmptyState-C_htXOSW.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js +658 -0
- package/dist-vue/_chunks/PkChatbotInput-CJ5lPtpH.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js +126 -0
- package/dist-vue/_chunks/PkChatbotLocalFolders-CSvqh_Cx.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js → PkChatbotMessages-DY8r4UKe.js} +49 -49
- package/dist-vue/_chunks/{PkChatbotMessages-BWdINCAX.js.map → PkChatbotMessages-DY8r4UKe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js → PkChatbotStepPayload-BLjH1pkP.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CTwsRpkv.js.map → PkChatbotStepPayload-BLjH1pkP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js → PkChatbotStepToolDetail-wIZmkvr-.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C9xeMg-k.js.map → PkChatbotStepToolDetail-wIZmkvr-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js → PkChatbotSteps-DG09GyCb.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotSteps-DsubpIKa.js.map → PkChatbotSteps-DG09GyCb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DW1a9ZNl.js → PkChatbotViewChat-DPk9LjX-.js} +685 -667
- package/dist-vue/_chunks/PkChatbotViewChat-DPk9LjX-.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js → PkChatbotViewConversations-NA_PCvZR.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewConversations-DdniYy1b.js.map → PkChatbotViewConversations-NA_PCvZR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js → PkChatbotViewFiles-D8_Khdu2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CMoromsf.js.map → PkChatbotViewFiles-D8_Khdu2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js → PkChatbotViewProfile-iTBiQVsZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BT7I3GhB.js.map → PkChatbotViewProfile-iTBiQVsZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotWakeupBar-Bx1zqFAX.js → PkChatbotWakeupBar-IoQJdUjI.js} +11 -11
- package/dist-vue/_chunks/PkChatbotWakeupBar-IoQJdUjI.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js → PkFilePreview-DLJ2wTHk.js} +4 -4
- package/dist-vue/_chunks/{PkFilePreview-Dxp-U8QU.js.map → PkFilePreview-DLJ2wTHk.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js → PkFilePreviewDialog-CDPZ3QIk.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-BE-NpN18.js.map → PkFilePreviewDialog-CDPZ3QIk.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js → PkImageEditorDialog-CrjpCier.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-BiuOD6Hr.js.map → PkImageEditorDialog-CrjpCier.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js → PkStreamingMarkdown-CgKFdzCI.js} +23 -23
- package/dist-vue/_chunks/{PkStreamingMarkdown-DMmt35Mq.js.map → PkStreamingMarkdown-CgKFdzCI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js → PkToolChatFile-IEQxfzjM.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-BdNron14.js.map → PkToolChatFile-IEQxfzjM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js → PkToolRequestGeolocation-BmrbMPke.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DeI7kLlR.js.map → PkToolRequestGeolocation-BmrbMPke.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js → PkToolRequestOAuthConnection-yKgXyOUN.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C0lE3Qbk.js.map → PkToolRequestOAuthConnection-yKgXyOUN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js → PkToolShowArtifact-CF90yFCe.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C0Gb-LW2.js.map → PkToolShowArtifact-CF90yFCe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js → PkToolShowChart-CDR8ag4q.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-oJmzU10F.js.map → PkToolShowChart-CDR8ag4q.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js → PkToolShowContactForm-DAdKUU4X.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-D4IAna-K.js.map → PkToolShowContactForm-DAdKUU4X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js → PkToolShowDiagram-Do20AvFb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-ClGpv5Cr.js.map → PkToolShowDiagram-Do20AvFb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js → PkToolShowForm-DfFmPOt6.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-ByfNodNh.js.map → PkToolShowForm-DfFmPOt6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js → PkToolShowImageGallery-DA6KW2g_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DJ9JNDWK.js.map → PkToolShowImageGallery-DA6KW2g_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js → PkToolShowProductList-FcDDabPI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CcFseg28.js.map → PkToolShowProductList-FcDDabPI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js → PkToolShowSources-afCYBONq.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DznWqWK3.js.map → PkToolShowSources-afCYBONq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js → PkToolShowSuggestedReply-C863wgtU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BZqnfpwO.js.map → PkToolShowSuggestedReply-C863wgtU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js → PkToolShowVideo-kUiwxRlz.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-niwkzqTN.js.map → PkToolShowVideo-kUiwxRlz.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js → PkToolShowWebPages-Dw9D1__u.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BsMVJ6c7.js.map → PkToolShowWebPages-Dw9D1__u.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-Cd_2UI_O.js → createChatbotApiClient-DzrHp52e.js} +66 -65
- package/dist-vue/_chunks/createChatbotApiClient-DzrHp52e.js.map +1 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js +353 -0
- package/dist-vue/_chunks/localFolders-ChZp8dLu.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-Dir9Rc7K.js → useChatbotStore-DZlc7dzK.js} +1289 -1152
- package/dist-vue/_chunks/useChatbotStore-DZlc7dzK.js.map +1 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js +55 -0
- package/dist-vue/_chunks/useSettledSelection-1bfM1fzx.js.map +1 -0
- package/dist-vue/_chunks/{utils-CibsowVe.js → utils-CY0jFRnG.js} +126 -107
- package/dist-vue/_chunks/utils-CY0jFRnG.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
- package/dist-vue/composables.js +62 -10
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4100 -4086
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +32 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +7 -1
- package/dist-vue/packages/components/src/chat/PkChatbotLocalFolders.d.ts +31 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +3 -2
- package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +1 -1
- package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
- package/dist-vue/packages/composable/src/chatbot/localFolders.d.ts +137 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +46 -3
- package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/HostTool.d.ts +5 -2
- package/dist-vue/packages/models/src/schema/LocalFolder.d.ts +78 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/PageAccess.d.ts +4 -1
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DytagI8S.js.map +0 -1
- package/dist/_chunks/text-5F7L8EHi.js +0 -5
- package/dist/_chunks/text-5F7L8EHi.js.map +0 -1
- package/dist/_chunks/utils-78zQeKDO.js.map +0 -1
- package/dist-vue/_chunks/Agent-Da4XChe8.js.map +0 -1
- package/dist-vue/_chunks/Media-CMiWEpdQ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CITKd3qD.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js +0 -708
- package/dist-vue/_chunks/PkChatbotInput-UqcSEi8l.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DW1a9ZNl.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotWakeupBar-Bx1zqFAX.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-Cd_2UI_O.js.map +0 -1
- package/dist-vue/_chunks/message-DuibQyHy.js +0 -61
- package/dist-vue/_chunks/message-DuibQyHy.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Dir9Rc7K.js.map +0 -1
- package/dist-vue/_chunks/utils-CibsowVe.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotInput-CJ5lPtpH.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 }>()\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\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 &&\n fileUpload.enabled &&\n (showCameraOption ||\n showScreenshotOption ||\n $slots['additional-actions'])\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=\"$t('action.attachFile')\"\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=\"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=\"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 :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 <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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AiH,CAAA,CAAE,CAAA,aAAA;OACT,SAAOuE;;MAEF7C,GAAA,SADVlJ,EAAA,GAAAI,EAKyCa,GAAA;;OAHrC,MAAK;OACL,WAAU;OACV,MAAK;OACJ,OAAOV,EAAAiH,CAAA,CAAE,CAAA,qBAAA;M,0BAEEe,EAAA,Q,aADhBvI,EAAA,GAAAI,EAMmCa,GAAA;;OAJ/B,MAAK;OACL,WAAU;OACT,MAAMwH,GAAA,QAAW,iBAAA;OACjB,OAAOlI,EAAAiH,CAAA,CAAE,CAAA,eAAA;OACT,UAAQ,CAAGyB,EAAA;;;;;;;;IAKdiC,GAAA,SADVlL,EAAA,GAAAI,EAO2BG,EAAA0G,EAAA,GAAA;KALtB,KAAK6D,EAAA,OAAS,MAAE;KAChB,MAAMI,GAAA;KACN,gBAAcJ,EAAA,QAAU,KAAA,IAAS;KACjC,kBAAgBG,EAAA;KAChB,SAAOM;KACP,SAAOH"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
|
|
2
|
+
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__name" }, D = { class: "text-14 text-word-2 mt-0 mb-md" }, O = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "pk-chatbot-local-folders__refused",
|
|
22
|
+
role: "status"
|
|
23
|
+
}, k = /* @__PURE__ */ f({
|
|
24
|
+
__name: "PkChatbotLocalFolders",
|
|
25
|
+
props: {
|
|
26
|
+
folders: {},
|
|
27
|
+
pickerAvailable: { type: Boolean },
|
|
28
|
+
canConnect: { type: Boolean },
|
|
29
|
+
refused: {}
|
|
30
|
+
},
|
|
31
|
+
emits: [
|
|
32
|
+
"connect",
|
|
33
|
+
"connectFiles",
|
|
34
|
+
"allow",
|
|
35
|
+
"remove"
|
|
36
|
+
],
|
|
37
|
+
setup(a, { emit: f }) {
|
|
38
|
+
let p = a, _ = f, { t: k } = S({ useScope: "global" }), A = b("fileInput"), j = h(!1), M = () => {
|
|
39
|
+
j.value = !1, p.pickerAvailable ? _("connect") : A.value?.click();
|
|
40
|
+
}, N = (e) => {
|
|
41
|
+
let t = e.target;
|
|
42
|
+
t.files?.length && _("connectFiles", [...t.files]), t.value = "";
|
|
43
|
+
};
|
|
44
|
+
return (f, p) => {
|
|
45
|
+
let h = r, b = e, S = t, P = n;
|
|
46
|
+
return m(), c("div", {
|
|
47
|
+
class: "pk-chatbot-local-folders",
|
|
48
|
+
role: "group",
|
|
49
|
+
"aria-label": y(k)("localFolders.title")
|
|
50
|
+
}, [
|
|
51
|
+
d(h, {
|
|
52
|
+
name: "ri:folder-open-line",
|
|
53
|
+
class: "shrink-0 w-18 h-18"
|
|
54
|
+
}),
|
|
55
|
+
l("ul", T, [(m(!0), c(i, null, g(a.folders, (e) => (m(), c("li", {
|
|
56
|
+
key: e.id,
|
|
57
|
+
class: "pk-chatbot-local-folders__item"
|
|
58
|
+
}, [
|
|
59
|
+
l("span", E, v(e.name), 1),
|
|
60
|
+
e.permission === "granted" ? s("", !0) : (m(), o(b, {
|
|
61
|
+
key: 0,
|
|
62
|
+
modifiers: "action-quiet",
|
|
63
|
+
label: y(k)("localFolders.allow"),
|
|
64
|
+
onClick: (t) => _("allow", e.id)
|
|
65
|
+
}, null, 8, ["label", "onClick"])),
|
|
66
|
+
d(b, {
|
|
67
|
+
modifiers: "action-quiet",
|
|
68
|
+
icon: "ri:close-line",
|
|
69
|
+
title: y(k)("localFolders.remove", { name: e.name }),
|
|
70
|
+
"aria-label": y(k)("localFolders.remove", { name: e.name }),
|
|
71
|
+
onClick: (t) => _("remove", e.id)
|
|
72
|
+
}, null, 8, [
|
|
73
|
+
"title",
|
|
74
|
+
"aria-label",
|
|
75
|
+
"onClick"
|
|
76
|
+
])
|
|
77
|
+
]))), 128))]),
|
|
78
|
+
a.canConnect ? (m(), o(b, {
|
|
79
|
+
key: 0,
|
|
80
|
+
modifiers: "action-quiet",
|
|
81
|
+
icon: "ri:folder-add-line",
|
|
82
|
+
label: y(k)("localFolders.connect"),
|
|
83
|
+
onClick: p[0] ||= (e) => j.value = !0
|
|
84
|
+
}, null, 8, ["label"])) : s("", !0),
|
|
85
|
+
d(P, {
|
|
86
|
+
modelValue: j.value,
|
|
87
|
+
"onUpdate:modelValue": p[2] ||= (e) => j.value = e,
|
|
88
|
+
title: y(k)("localFolders.confirm.title"),
|
|
89
|
+
modifiers: "small",
|
|
90
|
+
role: "alertdialog"
|
|
91
|
+
}, {
|
|
92
|
+
footer: x(() => [d(S, null, {
|
|
93
|
+
default: x(() => [d(b, {
|
|
94
|
+
modifiers: "ghost",
|
|
95
|
+
label: y(k)("action.cancel"),
|
|
96
|
+
onClick: p[1] ||= (e) => j.value = !1
|
|
97
|
+
}, null, 8, ["label"]), d(b, {
|
|
98
|
+
label: y(k)("localFolders.confirm.action"),
|
|
99
|
+
onClick: M
|
|
100
|
+
}, null, 8, ["label"])]),
|
|
101
|
+
_: 1
|
|
102
|
+
})]),
|
|
103
|
+
default: x(() => [l("p", D, v(y(k)("localFolders.confirm.question")), 1), d(C, { class: "mb-0" }, {
|
|
104
|
+
default: x(() => [u(v(y(k)("localFolders.confirm.description")), 1)]),
|
|
105
|
+
_: 1
|
|
106
|
+
})]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["modelValue", "title"]),
|
|
109
|
+
a.refused ? (m(), c("p", O, v(y(k)("localFolders.refused", { name: a.refused })), 1)) : s("", !0),
|
|
110
|
+
a.pickerAvailable ? s("", !0) : (m(), c("input", {
|
|
111
|
+
key: 2,
|
|
112
|
+
ref_key: "fileInput",
|
|
113
|
+
ref: A,
|
|
114
|
+
type: "file",
|
|
115
|
+
webkitdirectory: "",
|
|
116
|
+
multiple: "",
|
|
117
|
+
class: "none",
|
|
118
|
+
onChange: N
|
|
119
|
+
}, null, 544))
|
|
120
|
+
], 8, w);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export { C as n, k as t };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=PkChatbotLocalFolders-CSvqh_Cx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotLocalFolders-CSvqh_Cx.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createVNode","_renderSlot","_openBlock","_createElementBlock","_unref","_createVNode","_createElementVNode","_Fragment","_renderList","_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","PkChatbotLocalFolders_default","__emit","emit","$t","useI18n","fileInput","useTemplateRef","isNoticeOpen","ref","onChoose","onFiles","input","event","_component_VvButton","_component_VvButtonGroup","VvButtonGroup","_component_VvDialog","VvDialog","unref","createElementVNode","Fragment","renderList","folder","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, as the wakeup bar, because they\n * are what the next answer can open. A folder kept from an earlier visit\n * waits for a click on \"Allow\": the browser asks only on a gesture of the\n * user, never on a call of the 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 /** Below the cap of connected folders: past it the button goes away. */\n canConnect: boolean\n /** A folder the chat would never read, picked as a whole: said here. */\n refused?: string\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</script>\n\n<template>\n <div\n class=\"pk-chatbot-local-folders\"\n role=\"group\"\n :aria-label=\"$t('localFolders.title')\">\n <VvIcon name=\"ri:folder-open-line\" class=\"shrink-0 w-18 h-18\" />\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__item\">\n <span class=\"pk-chatbot-local-folders__name\">\n {{ folder.name }}\n </span>\n <VvButton\n v-if=\"folder.permission !== 'granted'\"\n modifiers=\"action-quiet\"\n :label=\"$t('localFolders.allow')\"\n @click=\"emit('allow', folder.id)\" />\n <VvButton\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n :title=\"$t('localFolders.remove', { name: folder.name })\"\n :aria-label=\"\n $t('localFolders.remove', { name: folder.name })\n \"\n @click=\"emit('remove', folder.id)\" />\n </li>\n </ul>\n <VvButton\n v-if=\"canConnect\"\n modifiers=\"action-quiet\"\n icon=\"ri:folder-add-line\"\n :label=\"$t('localFolders.connect')\"\n @click=\"isNoticeOpen = true\" />\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 <p\n v-if=\"refused\"\n class=\"pk-chatbot-local-folders__refused\"\n role=\"status\">\n {{ $t('localFolders.refused', { name: refused }) }}\n </p>\n <!-- Firefox and Safari: the folder's files, read in the page, kept\n until 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 </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-local-folders {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-xs) var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n color: var(--color-word-3);\n font-size: var(--text-12);\n\n &__list {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n gap: var(--spacing-xs);\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n &__item {\n display: flex;\n align-items: center;\n gap: var(--spacing-xs);\n min-width: 0;\n }\n\n &__refused {\n flex-basis: 100%;\n margin: 0;\n }\n\n &__name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--color-word-2);\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;EAGI,IAAMoB,IAAQC,GAWRC,IAAWC,QACTH,EAAM,OACCA,EAAM,OAEV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,KALJ8B,GAKIxB,EADGL,EAAAiC,CAAA,CAAE,CAAA,wBAAA,EAAA,MAAiCnB,EAAA,QAAO,CAAA,CAAA,GAAA,CAAA,K;IAKtCA,EAAA,kB,aADXhB,EAAA,GAAAC,EAOwB,SAAA;;KALhB,SAAA;KAAJ,KAAIoC;KACJ,MAAK;KACL,iBAAA;KACA,UAAA;KACA,OAAM;KACL,UAAQK"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { S as e, T as t, _ as n, i as r, s as i, x as a } from "./schemas-CfXaKVGu.js";
|
|
2
2
|
import { t as o } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
-
import { A as s, H as c, _ as l, k as u, r as d } from "./Agent-
|
|
4
|
-
import {
|
|
3
|
+
import { A as s, H as c, _ as l, k as u, r as d } from "./Agent-DKefaJeG.js";
|
|
4
|
+
import { u as f } from "./Media-DtudATme.js";
|
|
5
5
|
import { a as p, s as m, u as h } from "./ChatTask-2-ffbJFK.js";
|
|
6
|
-
import { n as g, r as _, t as v } from "./PkStreamingMarkdown-
|
|
6
|
+
import { n as g, r as _, t as v } from "./PkStreamingMarkdown-CgKFdzCI.js";
|
|
7
7
|
import { t as ee } from "./PkChatbotError-DFZ5S5jd.js";
|
|
8
8
|
import { t as te } from "./PkChatbotFeedbackForm-DmpoOuoW.js";
|
|
9
|
-
import {
|
|
9
|
+
import { C as y, S as b, _ as x, b as ne, h as re, m as ie, x as S, y as ae } from "./localFolders-ChZp8dLu.js";
|
|
10
10
|
import { t as oe } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
11
11
|
import { t as se } from "./PkChatbotFilePreview-BbytSmUB.js";
|
|
12
12
|
import { t as ce } from "./PkChatbotAudioTranscript-DgmuXalb.js";
|
|
13
13
|
import { t as le } from "./PkRelativeTime-CZF5CYHv.js";
|
|
14
14
|
import "./src-nb8MU1sh.js";
|
|
15
|
-
import { A as ue, C as de, I as fe, L as pe, N as me, O as he, P as ge, S as _e, W as C, _ as w, b as ve, d as ye, f as be, g as xe, i as Se, n as Ce, r as we, t as Te, x as Ee, y as De, z as Oe } from "./utils-
|
|
16
|
-
import { n as ke, r as Ae, t as je } from "./PkChatbotSteps-
|
|
15
|
+
import { A as ue, C as de, I as fe, L as pe, N as me, O as he, P as ge, S as _e, W as C, _ as w, b as ve, d as ye, f as be, g as xe, i as Se, n as Ce, r as we, t as Te, x as Ee, y as De, z as Oe } from "./utils-CY0jFRnG.js";
|
|
16
|
+
import { n as ke, r as Ae, t as je } from "./PkChatbotSteps-DG09GyCb.js";
|
|
17
17
|
import { t as Me } from "./PkChatbotTaskRunMenu-CqAc_4zw.js";
|
|
18
18
|
import { t as Ne } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
19
19
|
import { n as Pe } from "./useLightbox-CQ8WtQNC.js";
|
|
@@ -61,27 +61,27 @@ var nt = (e) => e.state, rt = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
61
61
|
for (let n of e.parts) (n.type === "tool-scheduleWakeup" || n.type === "tool-reportTaskRun") && (t = nt(n) === "output-available" && n.input?.noop === !0);
|
|
62
62
|
return t;
|
|
63
63
|
}, G = (e) => e?.role === "assistant" && !it(e) && at(e), ot = {
|
|
64
|
-
requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-
|
|
64
|
+
requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-yKgXyOUN.js")),
|
|
65
65
|
shareDocument: N(() => import("./PkToolShareDocument-CVDYH1kA.js").then((e) => e.n)),
|
|
66
|
-
showArtifact: N(() => import("./PkToolShowArtifact-
|
|
66
|
+
showArtifact: N(() => import("./PkToolShowArtifact-CF90yFCe.js").then((e) => e.n)),
|
|
67
67
|
showCalendarEvent: N(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
|
|
68
|
-
showChart: N(() => import("./PkToolShowChart-
|
|
68
|
+
showChart: N(() => import("./PkToolShowChart-CDR8ag4q.js")),
|
|
69
69
|
showComparison: N(() => import("./PkToolShowComparison-pLrUTlK6.js").then((e) => e.n)),
|
|
70
|
-
showContactForm: N(() => import("./PkToolShowContactForm-
|
|
71
|
-
showDiagram: N(() => import("./PkToolShowDiagram-
|
|
70
|
+
showContactForm: N(() => import("./PkToolShowContactForm-DAdKUU4X.js").then((e) => e.n)),
|
|
71
|
+
showDiagram: N(() => import("./PkToolShowDiagram-Do20AvFb.js")),
|
|
72
72
|
showEmail: N(() => import("./PkToolShowEmail-C_iJsuec.js").then((e) => e.n)),
|
|
73
|
-
showImageGallery: N(() => import("./PkToolShowImageGallery-
|
|
73
|
+
showImageGallery: N(() => import("./PkToolShowImageGallery-DA6KW2g_.js").then((e) => e.n)),
|
|
74
74
|
showLocation: N(() => import("./PkToolShowLocation-dTZcp7ah.js").then((e) => e.n)),
|
|
75
75
|
showMessage: N(() => import("./PkToolShowMessage-2pxYXo-_.js").then((e) => e.n)),
|
|
76
|
-
showForm: N(() => import("./PkToolShowForm-
|
|
77
|
-
showMultipleChoice: N(() => import("./PkToolShowForm-
|
|
78
|
-
showProductList: N(() => import("./PkToolShowProductList-
|
|
76
|
+
showForm: N(() => import("./PkToolShowForm-DfFmPOt6.js").then((e) => e.n)),
|
|
77
|
+
showMultipleChoice: N(() => import("./PkToolShowForm-DfFmPOt6.js").then((e) => e.n)),
|
|
78
|
+
showProductList: N(() => import("./PkToolShowProductList-FcDDabPI.js").then((e) => e.n)),
|
|
79
79
|
showQrCode: N(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
|
|
80
|
-
showSources: N(() => import("./PkToolShowSources-
|
|
81
|
-
showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-
|
|
82
|
-
showVideo: N(() => import("./PkToolShowVideo-
|
|
80
|
+
showSources: N(() => import("./PkToolShowSources-afCYBONq.js").then((e) => e.n)),
|
|
81
|
+
showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-C863wgtU.js").then((e) => e.n)),
|
|
82
|
+
showVideo: N(() => import("./PkToolShowVideo-kUiwxRlz.js")),
|
|
83
83
|
showWeather: N(() => import("./PkToolShowWeather-De_55i5I.js")),
|
|
84
|
-
showWebPages: N(() => import("./PkToolShowWebPages-
|
|
84
|
+
showWebPages: N(() => import("./PkToolShowWebPages-Dw9D1__u.js").then((e) => e.n))
|
|
85
85
|
}, K = {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
@@ -107,7 +107,7 @@ var nt = (e) => e.state, rt = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
107
107
|
},
|
|
108
108
|
emits: ["respond"],
|
|
109
109
|
setup(e, { emit: t }) {
|
|
110
|
-
let n = e, r = t, { t: i, te: a } = Xe({ useScope: "global" }), s = D(() => n.part), l = D(() =>
|
|
110
|
+
let n = e, r = t, { t: i, te: a } = Xe({ useScope: "global" }), s = D(() => n.part), l = D(() => x(n.part)), u = D(() => l.value === Te), d = D(() => u.value ? (s.value.state === "input-available" || c(s.value.output)) && n.callVerdict === void 0 : s.value.state === "approval-requested"), f = D(() => d.value && n.actionable === !0), p = D(() => d.value && n.actionable !== !0), m = D(() => u.value ? s.value.output === "confirmed" || n.callVerdict === !0 : s.value.approval?.approved === !0), h = D(() => u.value ? s.value.output === "cancelled" || n.callVerdict === !1 : s.value.approval?.approved === !1 || s.value.state === "output-denied"), g = D(() => ct[l.value]), _ = D(() => g.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: C(l.value, {
|
|
111
111
|
t: i,
|
|
112
112
|
te: a
|
|
113
113
|
}) })), v = D(() => {
|
|
@@ -229,32 +229,32 @@ function xt(e) {
|
|
|
229
229
|
}, e === "instant" ? 0 : bt));
|
|
230
230
|
}, ee = (e) => {
|
|
231
231
|
e.deltaY < 0 && (l.value = !0);
|
|
232
|
-
}, te = 0,
|
|
232
|
+
}, te = 0, y = (e) => {
|
|
233
233
|
te = e.touches[0]?.clientY ?? 0;
|
|
234
|
-
},
|
|
234
|
+
}, b = (e) => {
|
|
235
235
|
let t = e.touches[0]?.clientY ?? 0;
|
|
236
236
|
t > te && (l.value = !0), te = t;
|
|
237
|
-
},
|
|
237
|
+
}, x = () => {
|
|
238
238
|
if (!t.value) return;
|
|
239
239
|
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
240
240
|
u.value = n - r - e < yt, d || (e < _ && s?.(), e > _ && (u.value && (l.value = !1), c?.())), _ = e;
|
|
241
|
-
},
|
|
241
|
+
}, ne = () => {
|
|
242
242
|
if (d || l.value || !t.value) return;
|
|
243
243
|
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
244
244
|
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
245
245
|
d = !1;
|
|
246
246
|
}));
|
|
247
|
-
},
|
|
248
|
-
!f && t.value && (f = new MutationObserver(
|
|
247
|
+
}, re = () => {
|
|
248
|
+
!f && t.value && (f = new MutationObserver(ne), f.observe(t.value, {
|
|
249
249
|
childList: !0,
|
|
250
250
|
subtree: !0,
|
|
251
251
|
characterData: !0
|
|
252
252
|
}));
|
|
253
|
-
},
|
|
253
|
+
}, ie = () => {
|
|
254
254
|
f?.disconnect(), f = null;
|
|
255
255
|
};
|
|
256
256
|
V(n, (e, t) => {
|
|
257
|
-
e === "streaming" || e === "submitted" ?
|
|
257
|
+
e === "streaming" || e === "submitted" ? re() : (e !== "ready" || t !== "streaming") && ie();
|
|
258
258
|
}), V(r, async () => {
|
|
259
259
|
if (r() && i() !== "assistant") {
|
|
260
260
|
oe(), l.value = !1, d = !0;
|
|
@@ -265,27 +265,27 @@ function xt(e) {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
|
-
let
|
|
269
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight,
|
|
268
|
+
let S = null, ae = () => {
|
|
269
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(oe, 300)));
|
|
270
270
|
}, oe = () => {
|
|
271
|
-
p?.disconnect(), p = null, m?.disconnect(), m = null,
|
|
271
|
+
p?.disconnect(), p = null, m?.disconnect(), m = null, S &&= (clearTimeout(S), null);
|
|
272
272
|
};
|
|
273
273
|
return Ue(() => {
|
|
274
274
|
if (!t.value) return;
|
|
275
|
-
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart",
|
|
275
|
+
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", y, { passive: !0 }), t.value.addEventListener("touchmove", b, { passive: !0 });
|
|
276
276
|
let e = n() === "submitted" || n() === "streaming";
|
|
277
|
-
e ?
|
|
277
|
+
e ? re() : (p = new ResizeObserver(ae), p.observe(t.value), m = new MutationObserver(ae), m.observe(t.value, {
|
|
278
278
|
childList: !0,
|
|
279
279
|
subtree: !0
|
|
280
280
|
}));
|
|
281
281
|
let r = a?.() ?? t.value.firstElementChild;
|
|
282
|
-
r && (h = new ResizeObserver(
|
|
283
|
-
u.value &&
|
|
284
|
-
}), g.observe(t.value), e ||
|
|
282
|
+
r && (h = new ResizeObserver(ne), h.observe(r)), g = new ResizeObserver(() => {
|
|
283
|
+
u.value && ne();
|
|
284
|
+
}), g.observe(t.value), e || ae();
|
|
285
285
|
}), He(() => {
|
|
286
|
-
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart",
|
|
286
|
+
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", y), t.value?.removeEventListener("touchmove", b), h?.disconnect(), h = null, g?.disconnect(), g = null, ie(), oe();
|
|
287
287
|
}), {
|
|
288
|
-
handleScroll:
|
|
288
|
+
handleScroll: x,
|
|
289
289
|
scrollToBottom: v,
|
|
290
290
|
userScrolledUp: l,
|
|
291
291
|
isAtBottom: u
|
|
@@ -491,7 +491,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
491
491
|
"showDiagram",
|
|
492
492
|
"showLocation"
|
|
493
493
|
]), _t = (e) => {
|
|
494
|
-
let t =
|
|
494
|
+
let t = x(e);
|
|
495
495
|
return {
|
|
496
496
|
...!n.interactive && ht.has(t) ? { record: !0 } : {},
|
|
497
497
|
...gt.has(t) ? { isDark: n.isDark } : {}
|
|
@@ -538,14 +538,14 @@ var Ct = ["aria-busy"], wt = {
|
|
|
538
538
|
let Nn = (e) => {
|
|
539
539
|
let t = e.parts[e.parts.length - 1];
|
|
540
540
|
return b(t);
|
|
541
|
-
}, Pn = (e) => e.parts.some((e) =>
|
|
541
|
+
}, Pn = (e) => e.parts.some((e) => S(e) || y(e) || !!w(e)), Fn = (e) => !!n.showExtendedSteps && Z(e) && Pn(e), In = (e) => n.hostConfirmation !== void 0 && w(e) !== void 0 && e.toolCallId === n.hostConfirmation.toolCallId, Ln = D(() => n.hostConfirmation !== void 0 && !n.messages?.some((e) => e.parts.some(In))), Rn = (e, t) => G.value && X(e) && w(t)?.state === "input-available", zn = (e, t, n, r) => {
|
|
542
542
|
if (!w(n) || Fn(e)) return !1;
|
|
543
543
|
let i = Rn(t, n);
|
|
544
|
-
return i && r === bn(e).length - 1 ? !1 : i || ue(n) || !
|
|
544
|
+
return i && r === bn(e).length - 1 ? !1 : i || ue(n) || !ae(e);
|
|
545
545
|
}, Bn = (e, t) => {
|
|
546
546
|
let n = w(t);
|
|
547
547
|
return n?.state === "output-error" ? i(n.errorText === "The user refused this call. Do not repeat it unless the user asks." ? "toolApproval.denied" : "messagePart.hostToolFailed") : n?.state === "input-available" && !Rn(e, t) ? i("messagePart.hostToolNoAnswer") : void 0;
|
|
548
|
-
}, Vn = (e) =>
|
|
548
|
+
}, Vn = (e) => y(e) && !me(e) && !!(ot[x(e)] || p[e.type] || n.showAllMessageParts), Hn = (e) => e.parts.some((e) => b(e) && !!e.text.trim() || ne(e) || he(e) && !me(e) || Vn(e)), Z = (e) => e.role === "assistant", Un = (e) => e.role === "user", Wn = (e) => n.messages?.slice(0, e).reverse().find((e) => Z(e)), Gn = (e) => n.messages?.slice(e + 1).find((e) => Z(e)), Kn = (e) => {
|
|
549
549
|
let t = Wn(e)?.metadata?.createdAt, n = Gn(e)?.metadata?.createdAt;
|
|
550
550
|
if (!t || !n) return;
|
|
551
551
|
let r = new Date(t), i = new Date(n);
|
|
@@ -583,7 +583,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
583
583
|
block: "center"
|
|
584
584
|
}));
|
|
585
585
|
}), (t, n) => {
|
|
586
|
-
let u = Le, g = Fe, _ = o,
|
|
586
|
+
let u = Le, g = Fe, _ = o, y = Ie;
|
|
587
587
|
return L(), A("div", {
|
|
588
588
|
ref_key: "scrollEl",
|
|
589
589
|
ref: h,
|
|
@@ -704,7 +704,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
704
704
|
name: J(o.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
705
705
|
}, null, 8, ["name"]))], 10, Pt)) : k("", !0)])]),
|
|
706
706
|
_: 2
|
|
707
|
-
}, 1024)) : B(
|
|
707
|
+
}, 1024)) : B(ne)(s) ? (L(), O(E, {
|
|
708
708
|
key: 1,
|
|
709
709
|
appear: "",
|
|
710
710
|
name: "pk-chatbot-part"
|
|
@@ -713,7 +713,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
713
713
|
"media-type": s.mediaType,
|
|
714
714
|
url: s.url,
|
|
715
715
|
filename: s.filename,
|
|
716
|
-
size: B(
|
|
716
|
+
size: B(ie)(s)?.bytesCount
|
|
717
717
|
}, null, 8, [
|
|
718
718
|
"media-type",
|
|
719
719
|
"url",
|
|
@@ -732,7 +732,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
732
732
|
"media-type": s.mediaType,
|
|
733
733
|
url: s.url,
|
|
734
734
|
filename: s.filename,
|
|
735
|
-
size: B(
|
|
735
|
+
size: B(ie)(s)?.bytesCount
|
|
736
736
|
}, null, 8, [
|
|
737
737
|
"media-type",
|
|
738
738
|
"url",
|
|
@@ -801,7 +801,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
801
801
|
appear: "",
|
|
802
802
|
name: "pk-chatbot-part"
|
|
803
803
|
}, {
|
|
804
|
-
default: H(() => [!B(p)[s.type] && B(ot)[B(
|
|
804
|
+
default: H(() => [!B(p)[s.type] && B(ot)[B(x)(s)] ? (L(), O(Ke(B(ot)[B(x)(s)]), Be({
|
|
805
805
|
key: `component-${c}-${B(ve)(s)}`,
|
|
806
806
|
part: s
|
|
807
807
|
}, { ref_for: !0 }, _t(s)), null, 16, ["part"])) : Ge(t.$slots, s.type, Be({ ref_for: !0 }, {
|
|
@@ -889,7 +889,7 @@ var Ct = ["aria-busy"], wt = {
|
|
|
889
889
|
}, 1024),
|
|
890
890
|
M(E, { mode: "out-in" }, {
|
|
891
891
|
default: H(() => [tr(o, h) ? (L(), A("div", Yt, [
|
|
892
|
-
M(
|
|
892
|
+
M(y, {
|
|
893
893
|
modifiers: "compact",
|
|
894
894
|
class: "mr-auto shrink-0"
|
|
895
895
|
}, {
|
|
@@ -1131,4 +1131,4 @@ var Ct = ["aria-busy"], wt = {
|
|
|
1131
1131
|
});
|
|
1132
1132
|
export { pn as t };
|
|
1133
1133
|
|
|
1134
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
1134
|
+
//# sourceMappingURL=PkChatbotMessages-DY8r4UKe.js.map
|