@8wave/ai-elements 0.121.0-beta.15 → 0.121.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +125 -54
  2. package/dist/_chunks/{Agent-7rbrjWzu.js → Agent-wt8Vi99H.js} +7 -5
  3. package/dist/_chunks/Agent-wt8Vi99H.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown-BnClGp-3.js → PkStreamingMarkdown-Br7Z60Vm.js} +787 -777
  5. package/dist/_chunks/PkStreamingMarkdown-Br7Z60Vm.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js → PkToolEditSpreadsheet-Di9czFTy.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js.map → PkToolEditSpreadsheet-Di9czFTy.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js → PkToolRequestGeolocation-dUTqHsV-.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js.map → PkToolRequestGeolocation-dUTqHsV-.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js → PkToolRequestOAuthConnection-cNDld72U.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js.map → PkToolRequestOAuthConnection-cNDld72U.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js → PkToolShowArtifact-DtstlRsL.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js.map → PkToolShowArtifact-DtstlRsL.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js → PkToolShowContactForm-BKaKlYGJ.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js.map → PkToolShowContactForm-BKaKlYGJ.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js → PkToolShowForm-OxANKx0g.js} +3 -3
  17. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js.map → PkToolShowForm-OxANKx0g.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js → PkToolShowImageGallery-DRePOmUx.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js.map → PkToolShowImageGallery-DRePOmUx.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js → PkToolShowProductList-Y9HR_RJ4.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js.map → PkToolShowProductList-Y9HR_RJ4.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js → PkToolShowSources-BQnaaL2a.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js.map → PkToolShowSources-BQnaaL2a.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js → PkToolShowSuggestedReply-ghiXQuDz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js.map → PkToolShowSuggestedReply-ghiXQuDz.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js → PkToolShowVideo-BcNWgJD7.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js.map → PkToolShowVideo-BcNWgJD7.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js → PkToolShowWebPages-Ba6DkV0V.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js.map → PkToolShowWebPages-Ba6DkV0V.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js → chatImagePolicy-P0TZW1on.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js.map → chatImagePolicy-P0TZW1on.js.map} +1 -1
  32. package/dist/_chunks/{markdown-EqEd3eyd.js → markdown-DLplFIBU.js} +2 -2
  33. package/dist/_chunks/{markdown-EqEd3eyd.js.map → markdown-DLplFIBU.js.map} +1 -1
  34. package/dist/ai-elements.es.js +4051 -3492
  35. package/dist/ai-elements.es.js.map +1 -1
  36. package/dist-vue/PkChatbot.js +1 -1
  37. package/dist-vue/PkChatbotEmptyState.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/PkChatbotViewFiles.js +1 -1
  46. package/dist-vue/PkChatbotViewProfile.js +1 -1
  47. package/dist-vue/_chunks/{Agent-SH2vEFKs.js → Agent-DcoF75y8.js} +7 -5
  48. package/dist-vue/_chunks/Agent-DcoF75y8.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-fmCxsccF.js → Document-C1bD6VNU.js} +2 -2
  50. package/dist-vue/_chunks/{Document-fmCxsccF.js.map → Document-C1bD6VNU.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-DlIEIjKJ.js → PkChatbot-wyaH2IgV.js} +9 -9
  52. package/dist-vue/_chunks/PkChatbot-wyaH2IgV.js.map +1 -0
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js → PkChatbotEmptyState-h2qZ0JOD.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js.map → PkChatbotEmptyState-h2qZ0JOD.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkChatbotInput-DQVpDLNp.js → PkChatbotInput-C-bMNHC-.js} +87 -80
  56. package/dist-vue/_chunks/PkChatbotInput-C-bMNHC-.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js → PkChatbotMessages-DU8qnlVX.js} +17 -17
  58. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js.map → PkChatbotMessages-DU8qnlVX.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js → PkChatbotStepPayload-BOxfKD1b.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js.map → PkChatbotStepPayload-BOxfKD1b.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js → PkChatbotStepToolDetail-Df6EOYxj.js} +3 -3
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js.map → PkChatbotStepToolDetail-Df6EOYxj.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js → PkChatbotSteps-DnDtN4Q7.js} +5 -5
  64. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js.map → PkChatbotSteps-DnDtN4Q7.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js → PkChatbotViewChat-D4iupq1A.js} +7 -7
  66. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js.map → PkChatbotViewChat-D4iupq1A.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js → PkChatbotViewConversations-dKZScKD9.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js.map → PkChatbotViewConversations-dKZScKD9.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js → PkChatbotViewFiles-CQC3rInD.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js.map → PkChatbotViewFiles-CQC3rInD.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js → PkChatbotViewProfile-CkZyWh4V.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js.map → PkChatbotViewProfile-CkZyWh4V.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js → PkStreamingMarkdown-BYV68skc.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js.map → PkStreamingMarkdown-BYV68skc.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js → PkToolEditSpreadsheet-DQxJQIY0.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js.map → PkToolEditSpreadsheet-DQxJQIY0.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js → PkToolRequestGeolocation-BpjglRbg.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js.map → PkToolRequestGeolocation-BpjglRbg.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js → PkToolRequestOAuthConnection-CD3M5DWj.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js.map → PkToolRequestOAuthConnection-CD3M5DWj.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js → PkToolShowArtifact-Bm5VBF_n.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js.map → PkToolShowArtifact-Bm5VBF_n.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js → PkToolShowContactForm-CMQTQsU-.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js.map → PkToolShowContactForm-CMQTQsU-.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js → PkToolShowDiagram-adGuj4AF.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js.map → PkToolShowDiagram-adGuj4AF.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js → PkToolShowForm-Cx5KdTlZ.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js.map → PkToolShowForm-Cx5KdTlZ.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js → PkToolShowImageGallery-BtQ0gnGB.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js.map → PkToolShowImageGallery-BtQ0gnGB.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js → PkToolShowProductList-Dvatk6p-.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js.map → PkToolShowProductList-Dvatk6p-.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js → PkToolShowSources-DKkIYQ9r.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js.map → PkToolShowSources-DKkIYQ9r.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js → PkToolShowSuggestedReply-BbAfjJP9.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js.map → PkToolShowSuggestedReply-BbAfjJP9.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js → PkToolShowVideo-DTNszfdU.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js.map → PkToolShowVideo-DTNszfdU.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js → PkToolShowWebPages-euov57FB.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js.map → PkToolShowWebPages-euov57FB.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js → createChatbotApiClient-qHjpFqPL.js} +8 -8
  102. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js.map → createChatbotApiClient-qHjpFqPL.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js → useChatbotStore-CBjfSN69.js} +3 -3
  104. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js.map → useChatbotStore-CBjfSN69.js.map} +1 -1
  105. package/dist-vue/_chunks/{utils-B9-Vt10H.js → utils-BCGK2AFl.js} +2 -2
  106. package/dist-vue/_chunks/utils-BCGK2AFl.js.map +1 -0
  107. package/dist-vue/api.js +1 -1
  108. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +12 -4
  109. package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +4 -3
  110. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +11 -5
  111. package/dist-vue/apps/web-component/src/composables/useChatbotProfileProvider.d.ts +3 -2
  112. package/dist-vue/apps/web-component/src/composables/useCopilotPageCss.d.ts +12 -4
  113. package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +19 -0
  114. package/dist-vue/apps/web-component/src/lib.d.ts +10 -3
  115. package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +33 -0
  116. package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +27 -0
  117. package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +18 -2
  118. package/dist-vue/apps/web-component/src/utils/emitWidgetEvent.d.ts +8 -0
  119. package/dist-vue/apps/web-component/src/utils/layout.d.ts +3 -3
  120. package/dist-vue/composables.js +41 -19
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +342 -323
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +40 -14
  125. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +8 -5
  126. package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +19 -0
  127. package/dist-vue/packages/components/src/chat/utils.d.ts +5 -0
  128. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +13 -7
  129. package/dist-vue/packages/models/src/schema/Agent.d.ts +31 -18
  130. package/dist-vue/packages/models/src/schema/Member.d.ts +11 -0
  131. package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +8 -2
  132. package/dist-vue/packages/models/src/schema/OrganizationIdentityProvider.d.ts +4 -1
  133. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -3
  134. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +5 -3
  135. package/dist-vue/style.css +1 -1
  136. package/package.json +1 -1
  137. package/dist/_chunks/Agent-7rbrjWzu.js.map +0 -1
  138. package/dist/_chunks/PkStreamingMarkdown-BnClGp-3.js.map +0 -1
  139. package/dist-vue/_chunks/Agent-SH2vEFKs.js.map +0 -1
  140. package/dist-vue/_chunks/PkChatbot-DlIEIjKJ.js.map +0 -1
  141. package/dist-vue/_chunks/PkChatbotInput-DQVpDLNp.js.map +0 -1
  142. package/dist-vue/_chunks/utils-B9-Vt10H.js.map +0 -1
  143. package/dist-vue/apps/web-component/src/composables/useCopilotPush.d.ts +0 -25
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkChatbot-wyaH2IgV.js","names":["_useModel","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","__unplugin_components_5","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_unref","_Fragment","_createVNode","_mergeProps","_createBlock","PkAvatar","_createCommentVNode","_toDisplayString","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","PkChatbotViewChat","_createSlots","_renderList","PkChatbotViewConversations","PkChatbotViewFiles","PkChatbotViewProfile","PkStreamingMarkdown","_sfc_main","VvButtonLocalized","provideChatImagePolicy","PkStreamingMarkdown_default","useChatbotStore","resolveContrastColor","agentThemeStyle","PkChatbotViewConversations_default","PkChatbotViewChat_default","provideShortUrlResolver","PkChatbotViewFiles_default","useLocalizedString","PkAvatar_default","ChatbotProfileContextKey","PkChatbotViewProfile_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","PkChatbot_default","defineComponent","\"chatId\"","\"chatIdModifiers\"","__expose","__emit","slots","useSlots","$t","useI18n","props","__props","emit","chatId","useModel","store","hashes","storeToRefs","storeAgentId","toRef","profile","inject","canManageProfile","computed","canSignIn","watch","canManage","activeView","navigate","watchEffect","id","localChatId","chatError","error","parsedError","isFullscreen","isPanel","chatbotEl","useTemplateRef","chatbotWidth","useElementSize","isPhoneWidth","isTightWidth","isWideWidth","isReasoningAgent","showReasoningNotice","messages","message","useColorsForAgentHeader","showHeaderMenu","pageAccessAvailable","themeClass","isDark","mainColor","contrastColor","themeStyle","footerMessage","title","isReady","chat","activeMessage","newAgentId","newChatId","newView","_component_VvButton","_component_VvIcon","VvIcon","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","_component_VvAlert","VvAlert","openBlock","createElementBlock","normalizeClass","normalizeStyle","createCommentVNode","createElementVNode","unref","createBlock","Fragment","createVNode","mergeProps","_cache","toDisplayString","withCtx","renderSlot","_ctx","normalizeProps","guardReactiveProps","startNewChat","stopGeneration","createTextVNode","setPageAccessOff","pageAccessOff","$event","createSlots","renderList","slotName","slotData"],"sources":["../../../../packages/components/src/chat/PkChatbot.vue","../../../../packages/components/src/chat/PkChatbot.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {\n computed,\n inject,\n toRef,\n useTemplateRef,\n watch,\n watchEffect,\n useSlots,\n } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type {\n AgentInterface,\n AgentModel,\n AgentFileUpload,\n AgentGatewayOptions,\n AgentVoiceCapability,\n ChatMessageActions,\n RevisedAnswer,\n UIChatMessage,\n AgentTools,\n HostToolsCapability,\n PageAccessCapability,\n } from 'models'\n import {\n type RegisteredHostTool,\n useChatbotStore,\n useLocalizedString,\n provideShortUrlResolver,\n } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import PkChatbotViewChat from './PkChatbotViewChat.vue'\n import PkChatbotViewConversations from './PkChatbotViewConversations.vue'\n import PkChatbotViewFiles from './PkChatbotViewFiles.vue'\n import PkChatbotViewProfile from './PkChatbotViewProfile.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n import { provideChatImagePolicy } from './chatImagePolicy'\n import { agentThemeStyle, resolveContrastColor } from './utils'\n\n // Captured in script setup to avoid TS7022 circular inference in template\n const slots = useSlots()\n\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n const props = defineProps<{\n baseUrl: string\n basePath?: string\n agentId: string\n agentType?: 'reasoning' | 'chat'\n userId?: string\n name?: string\n model?: string\n agentModel?: AgentModel\n agentTools?: AgentTools\n agentInterface?: AgentInterface\n actions?: ChatMessageActions[]\n revisedAnswers?: RevisedAnswer[]\n headers?: Record<string, string>\n systemTheme?: 'light' | 'dark'\n agentFileUpload?: AgentFileUpload\n /** Voice configuration from the agent settings: enables the talk button. */\n voice?: AgentVoiceCapability\n fallbackModels?: string[]\n gatewayOptions?: Partial<AgentGatewayOptions>\n externalContext?: Record<string, unknown>\n /** Host tools as the agent allows them (`capabilities.hostTools` of the public agent). */\n hostTools?: HostToolsCapability\n /** Tools the embedding app registered, with the function that runs each (spec `host-tools.md`). */\n hostToolRegistry?: RegisteredHostTool[]\n /** Page access as the agent allows it (`capabilities.pageAccess`, spec `page-tools.md`). */\n pageAccess?: PageAccessCapability\n /** The widget's page tools: only the web component provides them. */\n pageToolRegistry?: RegisteredHostTool[]\n /** The tools of the forms annotated on the page now, read on every request. */\n pageForms?: () => RegisteredHostTool[]\n /** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome), `panel` keeps the header but slims it down for a docked side panel (the host provides background and border) */\n modifier?: 'widget' | 'fullscreen' | 'panel'\n /** Display name of the current user, used for the `{name}` placeholder in the fullscreen greeting */\n userName?: string\n /** Show the \"Files in this chat\" menu for hosts that don't provide the\n * profile context but whose user is authenticated (e.g. the backoffice\n * playground). The widget host relies on `canManageProfile` instead. */\n userFilesEnabled?: boolean\n }>()\n const emit = defineEmits<{\n 'message-update': [message: UIChatMessage]\n 'show-info': [message: UIChatMessage]\n revise: [message: UIChatMessage]\n error: [error: { type: string; title: string; status: number }]\n /** That conversation is loaded: a message sent now lands in it. */\n loaded: [chatId: string]\n }>()\n\n const chatId = defineModel<string | undefined>('chatId', {\n type: String,\n default: undefined,\n })\n\n const store = useChatbotStore(props.agentId)\n\n // Resolve backend short-urls (`/api/r/<hash>`) back to their real target\n // for display in tool components. Batched + cached across the chat tree.\n provideShortUrlResolver((hashes) =>\n store.apiClient.resolveShortUrls(hashes),\n )\n\n const {\n messages,\n chat,\n localChatId,\n activeView,\n chatError,\n isDark,\n pageAccessAvailable,\n pageAccessOff,\n } = storeToRefs(store)\n\n // Ref to store.agentId for watchers (avoids duplicate-key with agentId prop)\n const storeAgentId = toRef(store, 'agentId')\n\n const {\n startNewChat,\n stopGeneration,\n regenerate,\n navigate,\n sendMessage,\n setPageAccessOff,\n } = store\n\n // Images in the answers and the tool cards load by themselves only from\n // the backend this chat talks to and from the hosts the agent lists.\n provideChatImagePolicy(\n () => props.agentInterface?.imageHosts,\n () => props.baseUrl,\n )\n\n // Optional profile-management context provided by the host widget.\n // Present only for authenticated, non-anonymous sessions.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canManageProfile = computed(\n () => profile?.canManageProfile.value ?? false,\n )\n // Anonymous users get a \"Sign in\" entry instead of the profile one,\n // provided the host filled the `view-auth` slot and the agent has at\n // least one auth method enabled.\n const canSignIn = computed(\n () =>\n !canManageProfile.value &&\n (profile?.canSignIn?.value ?? false) &&\n slots['view-auth'] !== undefined,\n )\n\n // Once the sign-in completes (the session becomes non-anonymous) leave\n // the auth view and return to the conversation.\n watch(canManageProfile, (canManage) => {\n if (canManage && activeView.value === 'auth') {\n navigate('chat')\n }\n })\n\n // Sync props → store reactively\n watchEffect(() => {\n store.baseUrl = props.baseUrl\n store.basePath = props.basePath\n store.name = props.name\n store.agentType = props.agentType\n store.userId = props.userId\n store.agentInterface = props.agentInterface\n store.agentModel = props.agentModel\n store.agentTools = props.agentTools\n store.headers = props.headers\n store.revisedAnswers = props.revisedAnswers\n store.model = props.model\n store.actionsInput = props.actions\n store.agentFileUpload = props.agentFileUpload\n store.agentVoice = props.voice\n store.fallbackModels = props.fallbackModels\n store.gatewayOptions = props.gatewayOptions\n store.externalContext = props.externalContext\n store.agentHostTools = props.hostTools\n store.hostToolRegistry = props.hostToolRegistry\n store.agentPageAccess = props.pageAccess\n store.pageToolRegistry = props.pageToolRegistry\n store.pageFormsProvider = props.pageForms\n store.systemTheme = props.systemTheme\n store.hideWelcomeMessage = props.modifier === 'fullscreen'\n })\n\n // Sync chatId v-model ↔ store (bidirectional)\n // Parent → store: if the parent provides an external chatId, push it into\n // the store so the Chat instance picks it up.\n watch(\n () => chatId.value,\n (id) => {\n if (id && id !== store.localChatId) {\n store.localChatId = id\n }\n },\n { immediate: true },\n )\n // Store → parent: keep the v-model in sync whenever the store changes\n // the chatId internally (e.g. startNewChat).\n watch(localChatId, (id) => {\n chatId.value = id\n })\n\n // Emit structured errors from chat to the parent component\n watch(chatError, (error) => {\n if (!error) {\n return\n }\n try {\n const parsedError = JSON.parse(error.message) as {\n type: string\n title: string\n status: number\n }\n emit('error', parsedError)\n } catch {\n // ignore non-JSON errors\n }\n })\n\n // ui\n const isFullscreen = computed(() => props.modifier === 'fullscreen')\n const isPanel = computed(() => props.modifier === 'panel')\n\n /**\n * How much room the chat has, measured on the chat and not on the window.\n *\n * The same chat renders in a phone page, in a 408px widget, in a docked\n * panel and in a preview frame that the side panels squeeze to phone width\n * on a desktop screen, so the viewport says nothing about the space the\n * layout actually has. A CSS container query would read the same number\n * with no JavaScript, but `container-type` makes the element a containing\n * block for `position: fixed` descendants on every engine except Chrome\n * 129 and later, which displaces every dropdown in the chat: see\n * docs/agents/gotchas.md, \"The chat measures its own width, and not with a\n * container query\".\n *\n * The thresholds carry the modifiers, so the CSS stays declarative:\n * `--phone` has as much room as a phone page, `--tight` is too tight for\n * the agent chip beside the field, `--wide` has room for the outline rail\n * beside the reading column. Before the first measurement the width is 0\n * and no modifier applies, which is the roomy layout the base CSS writes.\n */\n const chatbotEl = useTemplateRef<HTMLDivElement>('chatbotEl')\n const { width: chatbotWidth } = useElementSize(chatbotEl)\n const isPhoneWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 576,\n )\n const isTightWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 640,\n )\n const isWideWidth = computed(() => chatbotWidth.value >= 848)\n const isReasoningAgent = computed(() => props.agentType === 'reasoning')\n // The notice says how a reasoning agent reads a message: it stands before\n // the first one, then leaves the room to the answers (pinned, it took a\n // third of a phone screen in the reasoning playground)\n const showReasoningNotice = computed(\n () =>\n isReasoningAgent.value &&\n !messages.value.some((message) => message.role === 'user'),\n )\n // A docked panel keeps a neutral header whatever the agent asks: it sits\n // beside the site or the app as part of the frame, and a colored band\n // made it read as a second site next to the first one.\n const useColorsForAgentHeader = computed(\n () => !isPanel.value && props.agentInterface?.useColorsForAgentHeader,\n )\n // Panel mode promotes the everyday actions (new chat, history) from the\n // dropdown to direct header buttons: the dropdown then only remains for\n // the secondary entries (files, profile, sign-in) and disappears when\n // none of them applies.\n const showHeaderMenu = computed(\n () =>\n !isPanel.value ||\n canManageProfile.value ||\n canSignIn.value ||\n pageAccessAvailable.value ||\n (!!props.userFilesEnabled && !!localChatId.value),\n )\n const themeClass = computed(() => [\n 'theme',\n `theme--${isDark.value ? 'dark' : 'light'}`,\n ])\n const mainColor = computed(() => props.agentInterface?.mainColor)\n const contrastColor = computed(() =>\n resolveContrastColor(props.agentInterface?.textColor, mainColor.value),\n )\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n const footerMessage = useLocalizedString(\n () => props.agentInterface?.footerMessage,\n )\n const title = computed(() => {\n if (activeView.value === 'conversations') {\n return $t('label.conversations')\n }\n if (activeView.value === 'profile') {\n return $t('label.profile')\n }\n if (activeView.value === 'auth') {\n return $t('label.authentication')\n }\n if (activeView.value === 'files') {\n return $t('userFiles.chatFilesTitle')\n }\n return props.name\n })\n\n // state\n const isReady = computed(() => chat.value.status === 'ready')\n const activeMessage = computed(() => {\n return messages.value?.[messages.value.length - 1]\n })\n\n // expose\n defineExpose({\n startNewChat,\n regenerate,\n stopGeneration,\n sendMessage,\n })\n\n // load chat, conversations and feedbacks on agent or chat change\n watch(\n [storeAgentId, localChatId],\n async ([newAgentId, newChatId]) => {\n await store.initialize(newAgentId, newChatId)\n emit('loaded', newChatId)\n },\n {\n immediate: true,\n },\n )\n // load conversations when navigating to conversations view\n watch(activeView, (newView) => {\n if (newView === 'conversations') {\n store.loadConversations(storeAgentId.value)\n } else if (newView === 'files') {\n store.loadChatFiles()\n }\n })\n // emit message updates for up-to-date context in parent components\n watch(\n activeMessage,\n (message) => {\n if (message) {\n emit('message-update', message)\n }\n },\n {\n deep: true,\n immediate: true,\n },\n )\n</script>\n\n<template>\n <div\n ref=\"chatbotEl\"\n class=\"pk-chatbot\"\n :class=\"[\n themeClass,\n {\n 'pk-chatbot--fullscreen': isFullscreen,\n 'pk-chatbot--panel': isPanel,\n 'pk-chatbot--phone': isPhoneWidth,\n 'pk-chatbot--tight': isTightWidth,\n 'pk-chatbot--wide': isWideWidth,\n },\n ]\"\n :style=\"themeStyle\">\n <!-- #region title -->\n <div\n v-if=\"!isFullscreen\"\n class=\"pk-chatbot__header\"\n :style=\"\n useColorsForAgentHeader\n ? {\n backgroundColor: mainColor,\n }\n : undefined\n \">\n <div class=\"pk-chatbot__header-start\">\n <template v-if=\"activeView !== 'chat'\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:arrow-left-s-line',\n title: $t('action.goBack'),\n }\"\n @click=\"navigate('chat')\" />\n <VvIcon\n :name=\"\n activeView === 'conversations'\n ? 'ri:history-line'\n : activeView === 'files'\n ? 'ri:attachment-2'\n : 'ri:user-line'\n \"\n class=\"pk-chatbot__nav-icon\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \" />\n </template>\n <!-- Panel mode: no avatar, the docked panel identifies the\n agent with the title alone -->\n <PkAvatar\n v-else-if=\"!isPanel\"\n modifiers=\"surface ring shrink-0\"\n class=\"pk-chatbot__avatar\"\n :name\n :img-src=\"agentInterface?.logo\" />\n <strong\n class=\"pk-chatbot__title\"\n :title=\"title\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \">\n {{ title }}\n </strong>\n </div>\n <VvButtonGroup class=\"pk-chatbot__header-end\" modifiers=\"compact\">\n <slot\n name=\"header-actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n <template v-if=\"isPanel\">\n <VvButton\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:edit-box-line\"\n :disabled=\"!isReady\"\n :title=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n <VvButton\n v-if=\"!isReasoningAgent\"\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:history-line\"\n :disabled=\"!isReady\"\n :title=\"$t('action.viewRecentChats')\"\n @click=\"navigate('conversations')\" />\n </template>\n <VvDropdown\n v-if=\"showHeaderMenu\"\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:more-2-fill',\n disabled: !isReady,\n title: $t('action.moreActions'),\n }\" />\n <template #items>\n <VvDropdownAction\n v-if=\"!isPanel\"\n @click=\"startNewChat()\">\n <VvIcon name=\"ri:edit-box-line\" />\n {{ $t('action.startNewChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"!isReasoningAgent && !isPanel\"\n @click=\"navigate('conversations')\">\n <VvIcon name=\"ri:history-line\" />\n {{ $t('action.viewRecentChats') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"\n (canManageProfile || userFilesEnabled) &&\n localChatId\n \"\n @click=\"navigate('files')\">\n <VvIcon name=\"ri:attachment-2\" />\n {{ $t('userFiles.chatFilesTitle') }}\n </VvDropdownAction>\n <!-- The user's own switch for the page tools, for\n this tab (spec page-tools.md) -->\n <VvDropdownAction\n v-if=\"pageAccessAvailable\"\n @click=\"setPageAccessOff(!pageAccessOff)\">\n <VvIcon\n :name=\"\n pageAccessOff\n ? 'ri:pages-line'\n : 'ri:forbid-line'\n \" />\n {{\n pageAccessOff\n ? $t('action.enablePageAccess')\n : $t('action.disablePageAccess')\n }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"canManageProfile\"\n @click=\"navigate('profile')\">\n <VvIcon name=\"ri:user-line\" />\n {{ $t('label.profile') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-else-if=\"canSignIn\"\n @click=\"navigate('auth')\">\n <VvIcon name=\"ri:account-circle-line\" />\n {{ $t('action.signIn') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n <slot\n name=\"actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n </VvButtonGroup>\n </div>\n <!-- #endregion -->\n\n <div v-if=\"showReasoningNotice\">\n <div class=\"pk-chatbot__warning-body\">\n <VvAlert modifiers=\"callout\">\n <div class=\"pk-chatbot__warning-header\">\n <VvIcon\n name=\"ri:alert-line\"\n class=\"pk-chatbot__warning-icon\" />\n <strong class=\"pk-chatbot__warning-title\">\n {{ $t('message.warning') }}\n </strong>\n </div>\n <p class=\"pk-chatbot__warning-text\">\n {{ $t('message.reasoningAgent') }}\n </p>\n </VvAlert>\n </div>\n </div>\n\n <!-- #region views -->\n <PkChatbotViewChat\n v-if=\"activeView === 'chat'\"\n :agent-id\n :modifier\n :user-name\n @show-info=\"emit('show-info', $event)\"\n @revise=\"emit('revise', $event)\">\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewChat>\n <PkChatbotViewConversations\n v-else-if=\"activeView === 'conversations'\"\n :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewConversations>\n <PkChatbotViewFiles v-else-if=\"activeView === 'files'\" :agent-id />\n <div\n v-else-if=\"activeView === 'auth'\"\n class=\"pk-chatbot__view-auth flex-1 min-h-0 overflow-y-auto\">\n <!-- Sign-in form provided by the host widget (owns the auth client) -->\n <slot name=\"view-auth\" />\n </div>\n <PkChatbotViewProfile v-else :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewProfile>\n <!-- #endregion -->\n\n <!-- #region footer -->\n <div v-if=\"footerMessage\" class=\"pk-chatbot__footer\">\n <PkStreamingMarkdown :markdown=\"footerMessage\" class=\"wysiwyg\" />\n </div>\n <!-- #endregion -->\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot {\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n background-color: var(--color-surface);\n\n &__header {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n justify-content: space-between;\n gap: var(--spacing-14);\n background-color: var(--color-surface-1);\n padding: var(--spacing-14);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__header-start {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n min-width: 0;\n }\n\n &__nav-icon {\n font-size: var(--text-18);\n }\n\n &__avatar {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &__title {\n font-size: var(--text-16);\n font-weight: var(--font-semibold);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__header-end {\n flex-shrink: 0;\n }\n\n &__warning-body {\n padding: var(--spacing-md);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__warning-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-4);\n margin-bottom: var(--spacing-4);\n }\n\n &__warning-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n\n &__warning-title {\n font-weight: 600;\n font-size: var(--text-14);\n }\n\n &__warning-text {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__footer {\n padding: var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n text-align: center;\n font-size: var(--text-12);\n color: var(--color-word-2);\n }\n\n // Modifier: fullscreen — layout full-page (Gemini-style): nessun\n // header interno, sfondo trasparente, input pill centrato.\n // Il chrome (sidebar, navigazione) è gestito dalla pagina ospite.\n &--fullscreen {\n // The dock, 60px. Declared rather than taken from the agent chip,\n // which the tight layout hides: the pill fell to 54px there and\n // the call bar that takes its place stayed at 60. There is no 60\n // in the spacing scale and a raw `60px` would stop following the\n // root font size, which the labels inside do follow.\n --pk-chat-fullscreen-dock-height: calc(\n var(--spacing-56) + var(--spacing-4)\n );\n // The pill, the notice that tucks into its top corners and the\n // call bar all round their ends on half of it.\n --pk-chat-dock-radius: calc(\n var(--pk-chat-fullscreen-dock-height) / 2\n );\n\n background-color: transparent;\n\n .pk-chatbot__footer {\n border-top: none;\n padding: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);\n }\n\n // Reading column aligned with the input (Gemini-style). The\n // constraint lives on the inner wrapper so the scroll container\n // spans the page and the scrollbar sits at its edge.\n .pk-chatbot-messages {\n // Symmetric gutters: a visible scrollbar would otherwise\n // shrink the content box on one side only, shifting the\n // column off the input axis\n scrollbar-gutter: stable both-edges;\n // Dissolve the content at both edges (works on any page\n // background, dots included — a surface-colored fade band\n // would cut through the pattern instead)\n mask-image: linear-gradient(\n to bottom,\n transparent 0,\n #000 var(--spacing-40),\n #000 calc(100% - var(--spacing-40)),\n transparent 100%\n );\n // Resting clearance so the first/last lines sit inside the\n // fully opaque zone\n padding-block: var(--spacing-48);\n }\n\n .pk-chatbot-messages__wrapper {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n\n // Outline rail: wide chats only, measured on the chat and not on\n // the viewport, so a preview frame squeezed by side panels loses\n // it like a phone does. The rail sits at the edge of the scroll\n // area beside the reading column: below the `--wide` threshold\n // (768px column plus a 40px rail on each side) it would cover the\n // messages instead.\n .pk-chatbot-messages__outline {\n display: none;\n }\n\n &.pk-chatbot--wide .pk-chatbot-messages__outline {\n display: block;\n }\n\n .pk-chatbot-file-preview {\n background-color: var(--color-surface);\n }\n\n .pk-chatbot-input__notice {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-3);\n border-top: 1px solid var(--color-surface-2);\n padding: var(--spacing-10) var(--spacing-16);\n\n // As deep as the pill's corners, or the page shows through\n // where their curve leaves the side\n &::after {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-2);\n bottom: calc(-1 * var(--pk-chat-dock-radius));\n height: var(--pk-chat-dock-radius);\n left: -1px;\n right: -1px;\n }\n }\n\n .pk-chatbot-input {\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n\n &__form {\n // True semicircles at rest, concentric with the send\n // button, whose center sits 30px in. Not `rounded-full`:\n // once Shift+Enter grows the field the ends would swell\n // with it and cut into the first and last line.\n border-radius: var(--pk-chat-dock-radius);\n min-height: var(--pk-chat-fullscreen-dock-height);\n padding: var(--spacing-12) var(--spacing-16);\n background-color: var(--color-surface-1);\n border-color: var(--color-surface-2);\n box-shadow: none;\n transition:\n border-color var(--duration-200) var(--ease-in-out),\n box-shadow var(--duration-200) var(--ease-in-out);\n\n &:has(:focus-within) {\n border-color: var(--color-surface-4);\n box-shadow: var(--shadow-sm);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &__textarea {\n background-color: transparent;\n }\n }\n\n // A live call takes the place of the input, so it takes its shape,\n // its column and its height: full-bleed here would break the\n // reading axis, and a different height would make the dock jump\n // the moment the call starts.\n .pk-voice-session {\n --pk-chat-dock-height: var(--pk-chat-fullscreen-dock-height);\n --pk-voice-orb-size: var(--spacing-40);\n --pk-voice-orb-bars-height: var(--spacing-20);\n --pk-voice-session-surface: var(--color-surface-1);\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n padding-inline: var(--spacing-16);\n border-color: var(--color-surface-2);\n border-radius: var(--pk-chat-dock-radius);\n box-shadow: none;\n\n &__timer {\n font-size: var(--text-14);\n }\n }\n }\n\n // Modifier: panel — compact chrome for a docked side panel: the host\n // container owns background and border, the header slims down and\n // drops its own surface so the chat blends into the panel.\n &--panel {\n background-color: transparent;\n\n .pk-chatbot__header {\n background-color: transparent;\n\n // Fixed height so the panel header lines up with the host's\n // own chrome. Custom properties inherit through the shadow\n // root: an embedding host can override it to match its\n // header (the default matches the platform header, 50px).\n height: var(--pk-chatbot-panel-header-height, 50px);\n align-items: center;\n padding-block: 0;\n padding-inline: var(--spacing-10);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n .pk-chatbot__title {\n font-size: var(--text-14);\n }\n\n .pk-chatbot__footer {\n border-top: none;\n padding: var(--spacing-6) var(--spacing-md);\n }\n }\n\n // A chat given a whole page without the fullscreen layout (the page\n // an iframe embeds, a widget its host lets fill the screen) keeps the\n // reading column of the fullscreen one: at 1440px an answer ran\n // 1408px wide, some two hundred characters a line. Measured on the\n // chat, like `--wide` itself, so a narrow frame is left alone.\n &--wide:not(.pk-chatbot--fullscreen) {\n .pk-chatbot-messages__wrapper,\n .pk-chatbot-input {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import {\n computed,\n inject,\n toRef,\n useTemplateRef,\n watch,\n watchEffect,\n useSlots,\n } from 'vue'\n import { useElementSize } from '@vueuse/core'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type {\n AgentInterface,\n AgentModel,\n AgentFileUpload,\n AgentGatewayOptions,\n AgentVoiceCapability,\n ChatMessageActions,\n RevisedAnswer,\n UIChatMessage,\n AgentTools,\n HostToolsCapability,\n PageAccessCapability,\n } from 'models'\n import {\n type RegisteredHostTool,\n useChatbotStore,\n useLocalizedString,\n provideShortUrlResolver,\n } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import PkChatbotViewChat from './PkChatbotViewChat.vue'\n import PkChatbotViewConversations from './PkChatbotViewConversations.vue'\n import PkChatbotViewFiles from './PkChatbotViewFiles.vue'\n import PkChatbotViewProfile from './PkChatbotViewProfile.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n import { provideChatImagePolicy } from './chatImagePolicy'\n import { agentThemeStyle, resolveContrastColor } from './utils'\n\n // Captured in script setup to avoid TS7022 circular inference in template\n const slots = useSlots()\n\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n const props = defineProps<{\n baseUrl: string\n basePath?: string\n agentId: string\n agentType?: 'reasoning' | 'chat'\n userId?: string\n name?: string\n model?: string\n agentModel?: AgentModel\n agentTools?: AgentTools\n agentInterface?: AgentInterface\n actions?: ChatMessageActions[]\n revisedAnswers?: RevisedAnswer[]\n headers?: Record<string, string>\n systemTheme?: 'light' | 'dark'\n agentFileUpload?: AgentFileUpload\n /** Voice configuration from the agent settings: enables the talk button. */\n voice?: AgentVoiceCapability\n fallbackModels?: string[]\n gatewayOptions?: Partial<AgentGatewayOptions>\n externalContext?: Record<string, unknown>\n /** Host tools as the agent allows them (`capabilities.hostTools` of the public agent). */\n hostTools?: HostToolsCapability\n /** Tools the embedding app registered, with the function that runs each (spec `host-tools.md`). */\n hostToolRegistry?: RegisteredHostTool[]\n /** Page access as the agent allows it (`capabilities.pageAccess`, spec `page-tools.md`). */\n pageAccess?: PageAccessCapability\n /** The widget's page tools: only the web component provides them. */\n pageToolRegistry?: RegisteredHostTool[]\n /** The tools of the forms annotated on the page now, read on every request. */\n pageForms?: () => RegisteredHostTool[]\n /** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome), `panel` keeps the header but slims it down for a docked side panel (the host provides background and border) */\n modifier?: 'widget' | 'fullscreen' | 'panel'\n /** Display name of the current user, used for the `{name}` placeholder in the fullscreen greeting */\n userName?: string\n /** Show the \"Files in this chat\" menu for hosts that don't provide the\n * profile context but whose user is authenticated (e.g. the backoffice\n * playground). The widget host relies on `canManageProfile` instead. */\n userFilesEnabled?: boolean\n }>()\n const emit = defineEmits<{\n 'message-update': [message: UIChatMessage]\n 'show-info': [message: UIChatMessage]\n revise: [message: UIChatMessage]\n error: [error: { type: string; title: string; status: number }]\n /** That conversation is loaded: a message sent now lands in it. */\n loaded: [chatId: string]\n }>()\n\n const chatId = defineModel<string | undefined>('chatId', {\n type: String,\n default: undefined,\n })\n\n const store = useChatbotStore(props.agentId)\n\n // Resolve backend short-urls (`/api/r/<hash>`) back to their real target\n // for display in tool components. Batched + cached across the chat tree.\n provideShortUrlResolver((hashes) =>\n store.apiClient.resolveShortUrls(hashes),\n )\n\n const {\n messages,\n chat,\n localChatId,\n activeView,\n chatError,\n isDark,\n pageAccessAvailable,\n pageAccessOff,\n } = storeToRefs(store)\n\n // Ref to store.agentId for watchers (avoids duplicate-key with agentId prop)\n const storeAgentId = toRef(store, 'agentId')\n\n const {\n startNewChat,\n stopGeneration,\n regenerate,\n navigate,\n sendMessage,\n setPageAccessOff,\n } = store\n\n // Images in the answers and the tool cards load by themselves only from\n // the backend this chat talks to and from the hosts the agent lists.\n provideChatImagePolicy(\n () => props.agentInterface?.imageHosts,\n () => props.baseUrl,\n )\n\n // Optional profile-management context provided by the host widget.\n // Present only for authenticated, non-anonymous sessions.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canManageProfile = computed(\n () => profile?.canManageProfile.value ?? false,\n )\n // Anonymous users get a \"Sign in\" entry instead of the profile one,\n // provided the host filled the `view-auth` slot and the agent has at\n // least one auth method enabled.\n const canSignIn = computed(\n () =>\n !canManageProfile.value &&\n (profile?.canSignIn?.value ?? false) &&\n slots['view-auth'] !== undefined,\n )\n\n // Once the sign-in completes (the session becomes non-anonymous) leave\n // the auth view and return to the conversation.\n watch(canManageProfile, (canManage) => {\n if (canManage && activeView.value === 'auth') {\n navigate('chat')\n }\n })\n\n // Sync props → store reactively\n watchEffect(() => {\n store.baseUrl = props.baseUrl\n store.basePath = props.basePath\n store.name = props.name\n store.agentType = props.agentType\n store.userId = props.userId\n store.agentInterface = props.agentInterface\n store.agentModel = props.agentModel\n store.agentTools = props.agentTools\n store.headers = props.headers\n store.revisedAnswers = props.revisedAnswers\n store.model = props.model\n store.actionsInput = props.actions\n store.agentFileUpload = props.agentFileUpload\n store.agentVoice = props.voice\n store.fallbackModels = props.fallbackModels\n store.gatewayOptions = props.gatewayOptions\n store.externalContext = props.externalContext\n store.agentHostTools = props.hostTools\n store.hostToolRegistry = props.hostToolRegistry\n store.agentPageAccess = props.pageAccess\n store.pageToolRegistry = props.pageToolRegistry\n store.pageFormsProvider = props.pageForms\n store.systemTheme = props.systemTheme\n store.hideWelcomeMessage = props.modifier === 'fullscreen'\n })\n\n // Sync chatId v-model ↔ store (bidirectional)\n // Parent → store: if the parent provides an external chatId, push it into\n // the store so the Chat instance picks it up.\n watch(\n () => chatId.value,\n (id) => {\n if (id && id !== store.localChatId) {\n store.localChatId = id\n }\n },\n { immediate: true },\n )\n // Store → parent: keep the v-model in sync whenever the store changes\n // the chatId internally (e.g. startNewChat).\n watch(localChatId, (id) => {\n chatId.value = id\n })\n\n // Emit structured errors from chat to the parent component\n watch(chatError, (error) => {\n if (!error) {\n return\n }\n try {\n const parsedError = JSON.parse(error.message) as {\n type: string\n title: string\n status: number\n }\n emit('error', parsedError)\n } catch {\n // ignore non-JSON errors\n }\n })\n\n // ui\n const isFullscreen = computed(() => props.modifier === 'fullscreen')\n const isPanel = computed(() => props.modifier === 'panel')\n\n /**\n * How much room the chat has, measured on the chat and not on the window.\n *\n * The same chat renders in a phone page, in a 408px widget, in a docked\n * panel and in a preview frame that the side panels squeeze to phone width\n * on a desktop screen, so the viewport says nothing about the space the\n * layout actually has. A CSS container query would read the same number\n * with no JavaScript, but `container-type` makes the element a containing\n * block for `position: fixed` descendants on every engine except Chrome\n * 129 and later, which displaces every dropdown in the chat: see\n * docs/agents/gotchas.md, \"The chat measures its own width, and not with a\n * container query\".\n *\n * The thresholds carry the modifiers, so the CSS stays declarative:\n * `--phone` has as much room as a phone page, `--tight` is too tight for\n * the agent chip beside the field, `--wide` has room for the outline rail\n * beside the reading column. Before the first measurement the width is 0\n * and no modifier applies, which is the roomy layout the base CSS writes.\n */\n const chatbotEl = useTemplateRef<HTMLDivElement>('chatbotEl')\n const { width: chatbotWidth } = useElementSize(chatbotEl)\n const isPhoneWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 576,\n )\n const isTightWidth = computed(\n () => chatbotWidth.value > 0 && chatbotWidth.value < 640,\n )\n const isWideWidth = computed(() => chatbotWidth.value >= 848)\n const isReasoningAgent = computed(() => props.agentType === 'reasoning')\n // The notice says how a reasoning agent reads a message: it stands before\n // the first one, then leaves the room to the answers (pinned, it took a\n // third of a phone screen in the reasoning playground)\n const showReasoningNotice = computed(\n () =>\n isReasoningAgent.value &&\n !messages.value.some((message) => message.role === 'user'),\n )\n // A docked panel keeps a neutral header whatever the agent asks: it sits\n // beside the site or the app as part of the frame, and a colored band\n // made it read as a second site next to the first one.\n const useColorsForAgentHeader = computed(\n () => !isPanel.value && props.agentInterface?.useColorsForAgentHeader,\n )\n // Panel mode promotes the everyday actions (new chat, history) from the\n // dropdown to direct header buttons: the dropdown then only remains for\n // the secondary entries (files, profile, sign-in) and disappears when\n // none of them applies.\n const showHeaderMenu = computed(\n () =>\n !isPanel.value ||\n canManageProfile.value ||\n canSignIn.value ||\n pageAccessAvailable.value ||\n (!!props.userFilesEnabled && !!localChatId.value),\n )\n const themeClass = computed(() => [\n 'theme',\n `theme--${isDark.value ? 'dark' : 'light'}`,\n ])\n const mainColor = computed(() => props.agentInterface?.mainColor)\n const contrastColor = computed(() =>\n resolveContrastColor(props.agentInterface?.textColor, mainColor.value),\n )\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n const footerMessage = useLocalizedString(\n () => props.agentInterface?.footerMessage,\n )\n const title = computed(() => {\n if (activeView.value === 'conversations') {\n return $t('label.conversations')\n }\n if (activeView.value === 'profile') {\n return $t('label.profile')\n }\n if (activeView.value === 'auth') {\n return $t('label.authentication')\n }\n if (activeView.value === 'files') {\n return $t('userFiles.chatFilesTitle')\n }\n return props.name\n })\n\n // state\n const isReady = computed(() => chat.value.status === 'ready')\n const activeMessage = computed(() => {\n return messages.value?.[messages.value.length - 1]\n })\n\n // expose\n defineExpose({\n startNewChat,\n regenerate,\n stopGeneration,\n sendMessage,\n })\n\n // load chat, conversations and feedbacks on agent or chat change\n watch(\n [storeAgentId, localChatId],\n async ([newAgentId, newChatId]) => {\n await store.initialize(newAgentId, newChatId)\n emit('loaded', newChatId)\n },\n {\n immediate: true,\n },\n )\n // load conversations when navigating to conversations view\n watch(activeView, (newView) => {\n if (newView === 'conversations') {\n store.loadConversations(storeAgentId.value)\n } else if (newView === 'files') {\n store.loadChatFiles()\n }\n })\n // emit message updates for up-to-date context in parent components\n watch(\n activeMessage,\n (message) => {\n if (message) {\n emit('message-update', message)\n }\n },\n {\n deep: true,\n immediate: true,\n },\n )\n</script>\n\n<template>\n <div\n ref=\"chatbotEl\"\n class=\"pk-chatbot\"\n :class=\"[\n themeClass,\n {\n 'pk-chatbot--fullscreen': isFullscreen,\n 'pk-chatbot--panel': isPanel,\n 'pk-chatbot--phone': isPhoneWidth,\n 'pk-chatbot--tight': isTightWidth,\n 'pk-chatbot--wide': isWideWidth,\n },\n ]\"\n :style=\"themeStyle\">\n <!-- #region title -->\n <div\n v-if=\"!isFullscreen\"\n class=\"pk-chatbot__header\"\n :style=\"\n useColorsForAgentHeader\n ? {\n backgroundColor: mainColor,\n }\n : undefined\n \">\n <div class=\"pk-chatbot__header-start\">\n <template v-if=\"activeView !== 'chat'\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:arrow-left-s-line',\n title: $t('action.goBack'),\n }\"\n @click=\"navigate('chat')\" />\n <VvIcon\n :name=\"\n activeView === 'conversations'\n ? 'ri:history-line'\n : activeView === 'files'\n ? 'ri:attachment-2'\n : 'ri:user-line'\n \"\n class=\"pk-chatbot__nav-icon\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \" />\n </template>\n <!-- Panel mode: no avatar, the docked panel identifies the\n agent with the title alone -->\n <PkAvatar\n v-else-if=\"!isPanel\"\n modifiers=\"surface ring shrink-0\"\n class=\"pk-chatbot__avatar\"\n :name\n :img-src=\"agentInterface?.logo\" />\n <strong\n class=\"pk-chatbot__title\"\n :title=\"title\"\n :style=\"\n useColorsForAgentHeader\n ? {\n color: contrastColor,\n }\n : undefined\n \">\n {{ title }}\n </strong>\n </div>\n <VvButtonGroup class=\"pk-chatbot__header-end\" modifiers=\"compact\">\n <slot\n name=\"header-actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n <template v-if=\"isPanel\">\n <VvButton\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:edit-box-line\"\n :disabled=\"!isReady\"\n :title=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n <VvButton\n v-if=\"!isReasoningAgent\"\n :modifiers=\"\n useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet'\n \"\n icon=\"ri:history-line\"\n :disabled=\"!isReady\"\n :title=\"$t('action.viewRecentChats')\"\n @click=\"navigate('conversations')\" />\n </template>\n <VvDropdown\n v-if=\"showHeaderMenu\"\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n v-bind=\"{\n modifiers: useColorsForAgentHeader\n ? `action-quiet-${contrastColor}`\n : 'action-quiet',\n icon: 'ri:more-2-fill',\n disabled: !isReady,\n title: $t('action.moreActions'),\n }\" />\n <template #items>\n <VvDropdownAction\n v-if=\"!isPanel\"\n @click=\"startNewChat()\">\n <VvIcon name=\"ri:edit-box-line\" />\n {{ $t('action.startNewChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"!isReasoningAgent && !isPanel\"\n @click=\"navigate('conversations')\">\n <VvIcon name=\"ri:history-line\" />\n {{ $t('action.viewRecentChats') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"\n (canManageProfile || userFilesEnabled) &&\n localChatId\n \"\n @click=\"navigate('files')\">\n <VvIcon name=\"ri:attachment-2\" />\n {{ $t('userFiles.chatFilesTitle') }}\n </VvDropdownAction>\n <!-- The user's own switch for the page tools, for\n this tab (spec page-tools.md) -->\n <VvDropdownAction\n v-if=\"pageAccessAvailable\"\n @click=\"setPageAccessOff(!pageAccessOff)\">\n <VvIcon\n :name=\"\n pageAccessOff\n ? 'ri:pages-line'\n : 'ri:forbid-line'\n \" />\n {{\n pageAccessOff\n ? $t('action.enablePageAccess')\n : $t('action.disablePageAccess')\n }}\n </VvDropdownAction>\n <VvDropdownAction\n v-if=\"canManageProfile\"\n @click=\"navigate('profile')\">\n <VvIcon name=\"ri:user-line\" />\n {{ $t('label.profile') }}\n </VvDropdownAction>\n <VvDropdownAction\n v-else-if=\"canSignIn\"\n @click=\"navigate('auth')\">\n <VvIcon name=\"ri:account-circle-line\" />\n {{ $t('action.signIn') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n <slot\n name=\"actions\"\n v-bind=\"{\n mainColor,\n useColorsForAgentHeader,\n contrastColor,\n startNewChat,\n stopGeneration,\n }\" />\n </VvButtonGroup>\n </div>\n <!-- #endregion -->\n\n <div v-if=\"showReasoningNotice\">\n <div class=\"pk-chatbot__warning-body\">\n <VvAlert modifiers=\"callout\">\n <div class=\"pk-chatbot__warning-header\">\n <VvIcon\n name=\"ri:alert-line\"\n class=\"pk-chatbot__warning-icon\" />\n <strong class=\"pk-chatbot__warning-title\">\n {{ $t('message.warning') }}\n </strong>\n </div>\n <p class=\"pk-chatbot__warning-text\">\n {{ $t('message.reasoningAgent') }}\n </p>\n </VvAlert>\n </div>\n </div>\n\n <!-- #region views -->\n <PkChatbotViewChat\n v-if=\"activeView === 'chat'\"\n :agent-id\n :modifier\n :user-name\n @show-info=\"emit('show-info', $event)\"\n @revise=\"emit('revise', $event)\">\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewChat>\n <PkChatbotViewConversations\n v-else-if=\"activeView === 'conversations'\"\n :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewConversations>\n <PkChatbotViewFiles v-else-if=\"activeView === 'files'\" :agent-id />\n <div\n v-else-if=\"activeView === 'auth'\"\n class=\"pk-chatbot__view-auth flex-1 min-h-0 overflow-y-auto\">\n <!-- Sign-in form provided by the host widget (owns the auth client) -->\n <slot name=\"view-auth\" />\n </div>\n <PkChatbotViewProfile v-else :agent-id>\n <template\n v-for=\"slotName in Object.keys(slots)\"\n #[slotName]=\"slotData\"\n ><slot :name=\"slotName\" v-bind=\"slotData\"\n /></template>\n </PkChatbotViewProfile>\n <!-- #endregion -->\n\n <!-- #region footer -->\n <div v-if=\"footerMessage\" class=\"pk-chatbot__footer\">\n <PkStreamingMarkdown :markdown=\"footerMessage\" class=\"wysiwyg\" />\n </div>\n <!-- #endregion -->\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot {\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n background-color: var(--color-surface);\n\n &__header {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n justify-content: space-between;\n gap: var(--spacing-14);\n background-color: var(--color-surface-1);\n padding: var(--spacing-14);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__header-start {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n min-width: 0;\n }\n\n &__nav-icon {\n font-size: var(--text-18);\n }\n\n &__avatar {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &__title {\n font-size: var(--text-16);\n font-weight: var(--font-semibold);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__header-end {\n flex-shrink: 0;\n }\n\n &__warning-body {\n padding: var(--spacing-md);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n &__warning-header {\n display: flex;\n align-items: center;\n gap: var(--spacing-4);\n margin-bottom: var(--spacing-4);\n }\n\n &__warning-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n\n &__warning-title {\n font-weight: 600;\n font-size: var(--text-14);\n }\n\n &__warning-text {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__footer {\n padding: var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n text-align: center;\n font-size: var(--text-12);\n color: var(--color-word-2);\n }\n\n // Modifier: fullscreen — layout full-page (Gemini-style): nessun\n // header interno, sfondo trasparente, input pill centrato.\n // Il chrome (sidebar, navigazione) è gestito dalla pagina ospite.\n &--fullscreen {\n // The dock, 60px. Declared rather than taken from the agent chip,\n // which the tight layout hides: the pill fell to 54px there and\n // the call bar that takes its place stayed at 60. There is no 60\n // in the spacing scale and a raw `60px` would stop following the\n // root font size, which the labels inside do follow.\n --pk-chat-fullscreen-dock-height: calc(\n var(--spacing-56) + var(--spacing-4)\n );\n // The pill, the notice that tucks into its top corners and the\n // call bar all round their ends on half of it.\n --pk-chat-dock-radius: calc(\n var(--pk-chat-fullscreen-dock-height) / 2\n );\n\n background-color: transparent;\n\n .pk-chatbot__footer {\n border-top: none;\n padding: 0 var(--spacing-md) var(--spacing-sm) var(--spacing-md);\n }\n\n // Reading column aligned with the input (Gemini-style). The\n // constraint lives on the inner wrapper so the scroll container\n // spans the page and the scrollbar sits at its edge.\n .pk-chatbot-messages {\n // Symmetric gutters: a visible scrollbar would otherwise\n // shrink the content box on one side only, shifting the\n // column off the input axis\n scrollbar-gutter: stable both-edges;\n // Dissolve the content at both edges (works on any page\n // background, dots included — a surface-colored fade band\n // would cut through the pattern instead)\n mask-image: linear-gradient(\n to bottom,\n transparent 0,\n #000 var(--spacing-40),\n #000 calc(100% - var(--spacing-40)),\n transparent 100%\n );\n // Resting clearance so the first/last lines sit inside the\n // fully opaque zone\n padding-block: var(--spacing-48);\n }\n\n .pk-chatbot-messages__wrapper {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n\n // Outline rail: wide chats only, measured on the chat and not on\n // the viewport, so a preview frame squeezed by side panels loses\n // it like a phone does. The rail sits at the edge of the scroll\n // area beside the reading column: below the `--wide` threshold\n // (768px column plus a 40px rail on each side) it would cover the\n // messages instead.\n .pk-chatbot-messages__outline {\n display: none;\n }\n\n &.pk-chatbot--wide .pk-chatbot-messages__outline {\n display: block;\n }\n\n .pk-chatbot-file-preview {\n background-color: var(--color-surface);\n }\n\n .pk-chatbot-input__notice {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-3);\n border-top: 1px solid var(--color-surface-2);\n padding: var(--spacing-10) var(--spacing-16);\n\n // As deep as the pill's corners, or the page shows through\n // where their curve leaves the side\n &::after {\n background-color: var(--color-surface);\n border-inline: 1px solid var(--color-surface-2);\n bottom: calc(-1 * var(--pk-chat-dock-radius));\n height: var(--pk-chat-dock-radius);\n left: -1px;\n right: -1px;\n }\n }\n\n .pk-chatbot-input {\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n\n &__form {\n // True semicircles at rest, concentric with the send\n // button, whose center sits 30px in. Not `rounded-full`:\n // once Shift+Enter grows the field the ends would swell\n // with it and cut into the first and last line.\n border-radius: var(--pk-chat-dock-radius);\n min-height: var(--pk-chat-fullscreen-dock-height);\n padding: var(--spacing-12) var(--spacing-16);\n background-color: var(--color-surface-1);\n border-color: var(--color-surface-2);\n box-shadow: none;\n transition:\n border-color var(--duration-200) var(--ease-in-out),\n box-shadow var(--duration-200) var(--ease-in-out);\n\n &:has(:focus-within) {\n border-color: var(--color-surface-4);\n box-shadow: var(--shadow-sm);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &__textarea {\n background-color: transparent;\n }\n }\n\n // A live call takes the place of the input, so it takes its shape,\n // its column and its height: full-bleed here would break the\n // reading axis, and a different height would make the dock jump\n // the moment the call starts.\n .pk-voice-session {\n --pk-chat-dock-height: var(--pk-chat-fullscreen-dock-height);\n --pk-voice-orb-size: var(--spacing-40);\n --pk-voice-orb-bars-height: var(--spacing-20);\n --pk-voice-session-surface: var(--color-surface-1);\n width: calc(100% - var(--spacing-sm) * 2);\n max-width: 768px;\n margin-inline: auto;\n padding-inline: var(--spacing-16);\n border-color: var(--color-surface-2);\n border-radius: var(--pk-chat-dock-radius);\n box-shadow: none;\n\n &__timer {\n font-size: var(--text-14);\n }\n }\n }\n\n // Modifier: panel — compact chrome for a docked side panel: the host\n // container owns background and border, the header slims down and\n // drops its own surface so the chat blends into the panel.\n &--panel {\n background-color: transparent;\n\n .pk-chatbot__header {\n background-color: transparent;\n\n // Fixed height so the panel header lines up with the host's\n // own chrome. Custom properties inherit through the shadow\n // root: an embedding host can override it to match its\n // header (the default matches the platform header, 50px).\n height: var(--pk-chatbot-panel-header-height, 50px);\n align-items: center;\n padding-block: 0;\n padding-inline: var(--spacing-10);\n border-bottom: 1px solid var(--color-surface-3);\n }\n\n .pk-chatbot__title {\n font-size: var(--text-14);\n }\n\n .pk-chatbot__footer {\n border-top: none;\n padding: var(--spacing-6) var(--spacing-md);\n }\n }\n\n // A chat given a whole page without the fullscreen layout (the page\n // an iframe embeds, a widget its host lets fill the screen) keeps the\n // reading column of the fullscreen one: at 1440px an answer ran\n // 1408px wide, some two hundred characters a line. Measured on the\n // chat, like `--wide` itself, so a narrow frame is left alone.\n &--wide:not(.pk-chatbot--fullscreen) {\n .pk-chatbot-messages__wrapper,\n .pk-chatbot-input {\n width: 100%;\n max-width: 768px;\n margin-inline: auto;\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CI,IAAM8D,IAAQC,GAAS,GAEjB,EAAE,GAAGC,MAAOC,GAAQ,EACtB,UAAU,SACd,CAAC,GAEKC,IAAQC,GAwCRC,IAAOP,GASPQ,KAASrE,GAA+BmE,GAAC,QAG9C,GAEKI,IAAQnC,EAAgB8B,EAAM,OAAO;EAI3C,GAAyB,MACrBK,EAAM,UAAU,iBAAiBC,CAAM,CAC3C;EAEA,IAAM,EACF,aACA,UACA,gBACA,eACA,eACA,YACA,wBACA,qBACAC,GAAYF,CAAK,GAGfG,IAAeC,GAAMJ,GAAO,SAAS,GAErC,EACF,iBACA,mBACA,gBACA,aACA,iBACA,yBACAA;EAIJ,QACUL,EAAM,gBAAgB,kBACtBA,EAAM,OAChB;EAIA,IAAMU,IAAUC,GA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AM"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "./PkStreamingMarkdown-DLKEIMcZ.js";
1
+ import { t as e } from "./PkStreamingMarkdown-BYV68skc.js";
2
2
  import { t } from "./PkAvatar-BTqu8tn9.js";
3
3
  import { createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, openBlock as o } from "vue";
4
4
  //#region ../../packages/components/src/chat/PkChatbotEmptyState.vue?vue&type=script&setup=true&lang.ts
@@ -27,4 +27,4 @@ var s = { class: "pk-chatbot-empty-state" }, c = /* @__PURE__ */ a({
27
27
  //#endregion
28
28
  export { c as t };
29
29
 
30
- //# sourceMappingURL=PkChatbotEmptyState-Bcozn56E.js.map
30
+ //# sourceMappingURL=PkChatbotEmptyState-h2qZ0JOD.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkChatbotEmptyState-Bcozn56E.js","names":["_openBlock","_createElementBlock","_createBlock","PkAvatar","_createCommentVNode","PkStreamingMarkdown","_sfc_main","PkStreamingMarkdown_default","_hoisted_1","PkChatbotEmptyState_default","defineComponent","openBlock","createElementBlock","__props","createBlock","PkAvatar_default","createCommentVNode"],"sources":["../../../../packages/components/src/chat/PkChatbotEmptyState.vue","../../../../packages/components/src/chat/PkChatbotEmptyState.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import PkAvatar from './PkAvatar.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n greeting?: string\n /** Agent avatar shown above the greeting where the input chip is hidden (mobile) */\n logo?: string | null\n name?: string\n }>()\n</script>\n\n<template>\n <div class=\"pk-chatbot-empty-state\">\n <PkAvatar\n v-if=\"logo || name\"\n class=\"pk-chatbot-empty-state__avatar\"\n modifiers=\"surface\"\n :img-src=\"logo\"\n :name=\"name\" />\n <PkStreamingMarkdown\n v-if=\"greeting\"\n :markdown=\"greeting\"\n :animation=\"null\"\n class=\"wysiwyg pk-chatbot-empty-state__greeting\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-empty-state {\n // Above the fullscreen ambient glow\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-md);\n text-align: center;\n\n // Let the greeting wrap on a couple of lines (Gemini-like). Keyed on\n // the chat's own width (`--phone`, measured in PkChatbot): a narrow\n // preview frame on a desktop screen wraps like a phone\n .pk-chatbot--phone & {\n padding-inline: var(--spacing-56);\n }\n\n &__avatar {\n width: var(--spacing-64);\n height: var(--spacing-64);\n font-size: var(--text-20);\n border-radius: var(--rounded-full);\n\n // The agent identity lives in the input chip when that is\n // visible: the chip hides itself at `--tight`, so keying the\n // avatar on the absence of that modifier shows exactly one of\n // the two\n .pk-chatbot:not(.pk-chatbot--tight) & {\n display: none;\n }\n }\n\n &__greeting {\n font-size: var(--text-28);\n font-weight: var(--font-light);\n color: var(--color-word-1);\n text-wrap: balance;\n\n // Render the greeting markdown inline as a single heading line\n :first-child {\n margin-top: 0;\n }\n\n :last-child {\n margin-bottom: 0;\n }\n }\n\n // Enters fading in from below, in sync with the glow ignition\n &__avatar,\n &__greeting {\n animation: pk-chatbot-greeting-enter 600ms var(--ease-out) both;\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n }\n }\n\n @keyframes pk-chatbot-greeting-enter {\n from {\n opacity: 0;\n transform: translateY(var(--spacing-16));\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import PkAvatar from './PkAvatar.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n greeting?: string\n /** Agent avatar shown above the greeting where the input chip is hidden (mobile) */\n logo?: string | null\n name?: string\n }>()\n</script>\n\n<template>\n <div class=\"pk-chatbot-empty-state\">\n <PkAvatar\n v-if=\"logo || name\"\n class=\"pk-chatbot-empty-state__avatar\"\n modifiers=\"surface\"\n :img-src=\"logo\"\n :name=\"name\" />\n <PkStreamingMarkdown\n v-if=\"greeting\"\n :markdown=\"greeting\"\n :animation=\"null\"\n class=\"wysiwyg pk-chatbot-empty-state__greeting\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-empty-state {\n // Above the fullscreen ambient glow\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-md);\n text-align: center;\n\n // Let the greeting wrap on a couple of lines (Gemini-like). Keyed on\n // the chat's own width (`--phone`, measured in PkChatbot): a narrow\n // preview frame on a desktop screen wraps like a phone\n .pk-chatbot--phone & {\n padding-inline: var(--spacing-56);\n }\n\n &__avatar {\n width: var(--spacing-64);\n height: var(--spacing-64);\n font-size: var(--text-20);\n border-radius: var(--rounded-full);\n\n // The agent identity lives in the input chip when that is\n // visible: the chip hides itself at `--tight`, so keying the\n // avatar on the absence of that modifier shows exactly one of\n // the two\n .pk-chatbot:not(.pk-chatbot--tight) & {\n display: none;\n }\n }\n\n &__greeting {\n font-size: var(--text-28);\n font-weight: var(--font-light);\n color: var(--color-word-1);\n text-wrap: balance;\n\n // Render the greeting markdown inline as a single heading line\n :first-child {\n margin-top: 0;\n }\n\n :last-child {\n margin-bottom: 0;\n }\n }\n\n // Enters fading in from below, in sync with the glow ignition\n &__avatar,\n &__greeting {\n animation: pk-chatbot-greeting-enter 600ms var(--ease-out) both;\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n }\n }\n\n @keyframes pk-chatbot-greeting-enter {\n from {\n opacity: 0;\n transform: translateY(var(--spacing-16));\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;oBAaIA,EAAA,GAAAC,EAYM,OAZNO,GAYM,CAVQK,EAAA,QAAQA,EAAA,QADlBb,EAAA,GAAAE,EAKmBC,GAAA;;GAHf,OAAM;GACN,WAAU;GACT,WAASU,EAAA;GACT,MAAMA,EAAA;EAED,GAAA,MAAA,GAAA,CAAA,WAAA,MAAA,CAAA,KAAAG,EAAA,IAAA,EAAA,GAAAH,EAAA,YADVb,EAAA,GAAAE,EAIuDG,GAAA;;GAFlD,UAAUQ,EAAA;GACV,WAAW;GACZ,OAAM"}
1
+ {"version":3,"file":"PkChatbotEmptyState-h2qZ0JOD.js","names":["_openBlock","_createElementBlock","_createBlock","PkAvatar","_createCommentVNode","PkStreamingMarkdown","_sfc_main","PkStreamingMarkdown_default","_hoisted_1","PkChatbotEmptyState_default","defineComponent","openBlock","createElementBlock","__props","createBlock","PkAvatar_default","createCommentVNode"],"sources":["../../../../packages/components/src/chat/PkChatbotEmptyState.vue","../../../../packages/components/src/chat/PkChatbotEmptyState.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import PkAvatar from './PkAvatar.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n greeting?: string\n /** Agent avatar shown above the greeting where the input chip is hidden (mobile) */\n logo?: string | null\n name?: string\n }>()\n</script>\n\n<template>\n <div class=\"pk-chatbot-empty-state\">\n <PkAvatar\n v-if=\"logo || name\"\n class=\"pk-chatbot-empty-state__avatar\"\n modifiers=\"surface\"\n :img-src=\"logo\"\n :name=\"name\" />\n <PkStreamingMarkdown\n v-if=\"greeting\"\n :markdown=\"greeting\"\n :animation=\"null\"\n class=\"wysiwyg pk-chatbot-empty-state__greeting\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-empty-state {\n // Above the fullscreen ambient glow\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-md);\n text-align: center;\n\n // Let the greeting wrap on a couple of lines (Gemini-like). Keyed on\n // the chat's own width (`--phone`, measured in PkChatbot): a narrow\n // preview frame on a desktop screen wraps like a phone\n .pk-chatbot--phone & {\n padding-inline: var(--spacing-56);\n }\n\n &__avatar {\n width: var(--spacing-64);\n height: var(--spacing-64);\n font-size: var(--text-20);\n border-radius: var(--rounded-full);\n\n // The agent identity lives in the input chip when that is\n // visible: the chip hides itself at `--tight`, so keying the\n // avatar on the absence of that modifier shows exactly one of\n // the two\n .pk-chatbot:not(.pk-chatbot--tight) & {\n display: none;\n }\n }\n\n &__greeting {\n font-size: var(--text-28);\n font-weight: var(--font-light);\n color: var(--color-word-1);\n text-wrap: balance;\n\n // Render the greeting markdown inline as a single heading line\n :first-child {\n margin-top: 0;\n }\n\n :last-child {\n margin-bottom: 0;\n }\n }\n\n // Enters fading in from below, in sync with the glow ignition\n &__avatar,\n &__greeting {\n animation: pk-chatbot-greeting-enter 600ms var(--ease-out) both;\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n }\n }\n\n @keyframes pk-chatbot-greeting-enter {\n from {\n opacity: 0;\n transform: translateY(var(--spacing-16));\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import PkAvatar from './PkAvatar.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n defineProps<{\n greeting?: string\n /** Agent avatar shown above the greeting where the input chip is hidden (mobile) */\n logo?: string | null\n name?: string\n }>()\n</script>\n\n<template>\n <div class=\"pk-chatbot-empty-state\">\n <PkAvatar\n v-if=\"logo || name\"\n class=\"pk-chatbot-empty-state__avatar\"\n modifiers=\"surface\"\n :img-src=\"logo\"\n :name=\"name\" />\n <PkStreamingMarkdown\n v-if=\"greeting\"\n :markdown=\"greeting\"\n :animation=\"null\"\n class=\"wysiwyg pk-chatbot-empty-state__greeting\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-empty-state {\n // Above the fullscreen ambient glow\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-md);\n text-align: center;\n\n // Let the greeting wrap on a couple of lines (Gemini-like). Keyed on\n // the chat's own width (`--phone`, measured in PkChatbot): a narrow\n // preview frame on a desktop screen wraps like a phone\n .pk-chatbot--phone & {\n padding-inline: var(--spacing-56);\n }\n\n &__avatar {\n width: var(--spacing-64);\n height: var(--spacing-64);\n font-size: var(--text-20);\n border-radius: var(--rounded-full);\n\n // The agent identity lives in the input chip when that is\n // visible: the chip hides itself at `--tight`, so keying the\n // avatar on the absence of that modifier shows exactly one of\n // the two\n .pk-chatbot:not(.pk-chatbot--tight) & {\n display: none;\n }\n }\n\n &__greeting {\n font-size: var(--text-28);\n font-weight: var(--font-light);\n color: var(--color-word-1);\n text-wrap: balance;\n\n // Render the greeting markdown inline as a single heading line\n :first-child {\n margin-top: 0;\n }\n\n :last-child {\n margin-bottom: 0;\n }\n }\n\n // Enters fading in from below, in sync with the glow ignition\n &__avatar,\n &__greeting {\n animation: pk-chatbot-greeting-enter 600ms var(--ease-out) both;\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n }\n }\n\n @keyframes pk-chatbot-greeting-enter {\n from {\n opacity: 0;\n transform: translateY(var(--spacing-16));\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;oBAaIA,EAAA,GAAAC,EAYM,OAZNO,GAYM,CAVQK,EAAA,QAAQA,EAAA,QADlBb,EAAA,GAAAE,EAKmBC,GAAA;;GAHf,OAAM;GACN,WAAU;GACT,WAASU,EAAA;GACT,MAAMA,EAAA;EAED,GAAA,MAAA,GAAA,CAAA,WAAA,MAAA,CAAA,KAAAG,EAAA,IAAA,EAAA,GAAAH,EAAA,YADVb,EAAA,GAAAE,EAIuDG,GAAA;;GAFlD,UAAUQ,EAAA;GACV,WAAW;GACZ,OAAM"}
@@ -1,6 +1,6 @@
1
1
  import { s as e } from "./Media-D-UGzdcW.js";
2
2
  import { t } from "./VvButtonLocalized-BuzLsXp3.js";
3
- import { t as n } from "./PkStreamingMarkdown-DLKEIMcZ.js";
3
+ import { t as n } from "./PkStreamingMarkdown-BYV68skc.js";
4
4
  import { t as r } from "./PkChatbotFilePreview-D8XyjDPJ.js";
5
5
  import { VvDropdown as i, VvDropdownAction as a, VvIcon as o } from "@volverjs/ui-vue/components";
6
6
  import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as ee, onBeforeUnmount as b, onMounted as x, openBlock as S, ref as C, renderList as te, renderSlot as ne, toDisplayString as w, unref as T, useId as re, useModel as E, useTemplateRef as D, watch as O, withCtx as k, withKeys as ie, withModifiers as ae } from "vue";
@@ -103,22 +103,26 @@ var P = N, F = ["type"], I = {
103
103
  };
104
104
  }
105
105
  }), se = { class: "pk-chatbot-input" }, ce = {
106
+ key: 0,
107
+ class: "pk-chatbot-input__notice",
108
+ role: "status"
109
+ }, le = {
106
110
  key: 2,
107
111
  class: "pk-chatbot-input__notice-text"
108
- }, le = {
112
+ }, ue = {
109
113
  key: 0,
110
114
  class: "pk-chatbot-input__attachments"
111
- }, ue = { class: "pk-chatbot-input__fieldset" }, de = [
115
+ }, de = { class: "pk-chatbot-input__fieldset" }, fe = [
112
116
  "title",
113
117
  "disabled",
114
118
  "onClick"
115
- ], fe = ["accept"], pe = ["accept"], me = { class: "pk-chatbot-input__content" }, he = [
119
+ ], pe = ["accept"], me = ["accept"], he = { class: "pk-chatbot-input__content" }, ge = [
116
120
  "value",
117
121
  "aria-label",
118
122
  "aria-describedby",
119
123
  "aria-invalid",
120
124
  "placeholder"
121
- ], ge = ["id"], _e = { class: "opacity-60" }, R = /* @__PURE__ */ h({
125
+ ], _e = ["id"], ve = { class: "opacity-60" }, R = /* @__PURE__ */ h({
122
126
  __name: "PkChatbotInput",
123
127
  props: /*@__PURE__*/ g({
124
128
  placeholder: {},
@@ -147,24 +151,24 @@ var P = N, F = ["type"], I = {
147
151
  setup(h, { emit: g }) {
148
152
  let A = E(h, "modelValue"), j = E(h, "pendingAttachments"), M = g, N = h, F = D("textareaEl"), I = D("fileInputEl"), R = D("cameraInputEl"), z = D("formEl"), B = C(A.value ?? ""), V = null, H = () => {
149
153
  V !== null && (clearTimeout(V), V = null);
150
- }, ve = () => {
151
- H(), A.value = B.value;
152
154
  }, ye = () => {
155
+ H(), A.value = B.value;
156
+ }, be = () => {
153
157
  H(), V = setTimeout(() => {
154
158
  A.value = B.value, V = null;
155
159
  }, 300);
156
- }, be = () => {
157
- B.value = F.value?.value ?? "", ye();
160
+ }, xe = () => {
161
+ B.value = F.value?.value ?? "", be();
158
162
  };
159
163
  O(A, (e) => {
160
164
  e !== B.value && (B.value = e ?? "", v(() => {
161
165
  F.value && P.update(F.value);
162
166
  }));
163
167
  });
164
- let U = c(() => N.status === "streaming"), xe = c(() => N.status === "submitted"), W = c(() => U.value || xe.value), G = re(), K = c(() => B.value.length), q = c(() => N.maxMessageLength !== void 0 && K.value > N.maxMessageLength), Se = c(() => j.value.some((e) => e.state === "uploading")), J = c(() => W.value || Se.value || q.value ? !1 : B.value.trim().length > 0), Ce = "capture" in document.createElement("input"), we = c(() => {
168
+ let U = c(() => N.status === "streaming"), W = c(() => N.status === "submitted"), G = c(() => U.value || W.value), K = re(), q = c(() => B.value.length), J = c(() => N.maxMessageLength !== void 0 && q.value > N.maxMessageLength), Se = c(() => j.value.some((e) => e.state === "uploading")), Y = c(() => G.value || Se.value || J.value ? !1 : B.value.trim().length > 0), Ce = "capture" in document.createElement("input"), we = c(() => {
165
169
  let t = N.fileUpload?.allowedMimeTypes ?? [];
166
170
  return [...t, ...e(t)].join(",");
167
- }), Y = c(() => (N.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), X = c(() => Ce && Y.value.length > 0), Z = () => {
171
+ }), X = c(() => (N.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), Z = c(() => Ce && X.value.length > 0), Q = () => {
168
172
  I.value?.click();
169
173
  }, Te = () => {
170
174
  R.value?.click();
@@ -176,40 +180,44 @@ var P = N, F = ["type"], I = {
176
180
  }, Oe = (e) => {
177
181
  let t = j.value.find((t) => t.id === e);
178
182
  t && URL.revokeObjectURL(t.localUrl), j.value = j.value.filter((t) => t.id !== e);
179
- }, Q = C(!0), ke = () => {
180
- Q.value = !1;
181
- }, $ = c(() => N.attachmentNotice ? {
182
- id: "limit",
183
- icon: "ri:information-line",
184
- text: N.attachmentNotice,
185
- dismiss: () => M("dismiss-attachment-notice")
186
- } : N.pageNotice ? {
187
- id: "page",
188
- icon: "ri:pages-line",
189
- text: N.pageNotice,
190
- dismiss: () => M("dismiss-page-notice")
191
- } : N.dismissableNotice && Q.value ? {
192
- id: "dismissable",
193
- markdown: N.dismissableNotice,
194
- dismiss: ke
195
- } : null), Ae = () => {
183
+ }, ke = C(!0), Ae = () => {
184
+ ke.value = !1;
185
+ }, je = c(() => {
186
+ if (N.attachmentNotice) return [{
187
+ id: "limit",
188
+ icon: "ri:information-line",
189
+ text: N.attachmentNotice,
190
+ dismiss: () => M("dismiss-attachment-notice")
191
+ }];
192
+ let e = [];
193
+ return N.pageNotice && e.push({
194
+ id: "page",
195
+ icon: "ri:pages-line",
196
+ text: N.pageNotice,
197
+ dismiss: () => M("dismiss-page-notice")
198
+ }), N.dismissableNotice && ke.value && e.push({
199
+ id: "dismissable",
200
+ markdown: N.dismissableNotice,
201
+ dismiss: Ae
202
+ }), e;
203
+ }), Me = () => {
196
204
  z.value?.querySelector("button:focus-visible") && F.value?.focus();
197
- }, je = () => {
198
- Ae(), M("stop-generation");
199
- }, Me = () => {
200
- J.value && (Ae(), ve(), M("submit"), B.value = "", A.value = "", v(() => {
205
+ }, Ne = () => {
206
+ Me(), M("stop-generation");
207
+ }, Pe = () => {
208
+ Y.value && (Me(), ye(), M("submit"), B.value = "", A.value = "", v(() => {
201
209
  F.value && (F.value.value = "", P.update(F.value));
202
210
  }));
203
- }, Ne = (e) => {
204
- e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Me());
211
+ }, Fe = (e) => {
212
+ e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Pe());
205
213
  };
206
214
  x(() => {
207
215
  F.value && P(F.value);
208
216
  });
209
- let Pe = 0;
217
+ let $ = 0;
210
218
  return oe(F, ([e]) => {
211
219
  let t = e?.contentRect.width ?? 0;
212
- F.value && t !== Pe && (Pe = t, P.update(F.value));
220
+ F.value && t !== $ && ($ = t, P.update(F.value));
213
221
  }), O(() => N.placeholder, async () => {
214
222
  await v(), F.value && P.update(F.value);
215
223
  }), b(() => {
@@ -217,35 +225,34 @@ var P = N, F = ["type"], I = {
217
225
  for (let e of j.value) URL.revokeObjectURL(e.localUrl);
218
226
  }), (e, c) => {
219
227
  let g = o, v = t, b = a, x = i;
220
- return S(), d("div", se, [$.value ? (S(), d("div", {
221
- key: $.value.id,
222
- class: "pk-chatbot-input__notice",
223
- role: "status"
228
+ return S(), d("div", se, [je.value.length ? (S(), d("div", ce, [(S(!0), d(s, null, te(je.value, (t) => (S(), d("div", {
229
+ key: t.id,
230
+ class: "pk-chatbot-input__notice-item"
224
231
  }, [
225
- $.value.icon ? (S(), l(g, {
232
+ t.icon ? (S(), l(g, {
226
233
  key: 0,
227
- name: $.value.icon,
234
+ name: t.icon,
228
235
  class: "pk-chatbot-input__notice-icon"
229
236
  }, null, 8, ["name"])) : u("", !0),
230
- $.value.markdown ? (S(), l(n, {
237
+ t.markdown ? (S(), l(n, {
231
238
  key: 1,
232
- markdown: $.value.markdown,
239
+ markdown: t.markdown,
233
240
  class: "wysiwyg pk-chatbot-input__notice-text"
234
- }, null, 8, ["markdown"])) : (S(), d("span", ce, w($.value.text), 1)),
235
- $.value.dismiss ? (S(), l(v, {
241
+ }, null, 8, ["markdown"])) : (S(), d("span", le, w(t.text), 1)),
242
+ t.dismiss ? (S(), l(v, {
236
243
  key: 3,
237
244
  title: e.$t("action.close"),
238
245
  modifiers: "action-quiet",
239
246
  icon: "ri:close-line",
240
247
  class: "w-18 h-18",
241
- onClick: c[0] ||= (e) => $.value.dismiss()
242
- }, null, 8, ["title"])) : u("", !0)
243
- ])) : u("", !0), f("form", {
248
+ onClick: (e) => t.dismiss()
249
+ }, null, 8, ["title", "onClick"])) : u("", !0)
250
+ ]))), 128))])) : u("", !0), f("form", {
244
251
  ref_key: "formEl",
245
252
  ref: z,
246
253
  class: "pk-chatbot-input__form",
247
- onSubmit: ae(Me, ["prevent"])
248
- }, [j.value.length ? (S(), d("div", le, [(S(!0), d(s, null, te(j.value, (e) => (S(), l(r, {
254
+ onSubmit: ae(Pe, ["prevent"])
255
+ }, [j.value.length ? (S(), d("div", ue, [(S(!0), d(s, null, te(j.value, (e) => (S(), l(r, {
249
256
  key: e.id,
250
257
  "media-type": e.mediaSource?.mimeType ?? e.file.type,
251
258
  url: e.localUrl,
@@ -265,9 +272,9 @@ var P = N, F = ["type"], I = {
265
272
  "error",
266
273
  "removable",
267
274
  "onRemove"
268
- ]))), 128))])) : u("", !0), f("div", ue, [
275
+ ]))), 128))])) : u("", !0), f("div", de, [
269
276
  ne(e.$slots, "prepend"),
270
- h.fileUpload && h.fileUpload.enabled && (X.value || e.$slots["additional-actions"]) ? (S(), l(x, ee(_({ key: 0 }, {
277
+ h.fileUpload && h.fileUpload.enabled && (Z.value || e.$slots["additional-actions"]) ? (S(), l(x, ee(_({ key: 0 }, {
271
278
  placement: "top-start",
272
279
  modifiers: "menu",
273
280
  flip: !0,
@@ -277,16 +284,16 @@ var P = N, F = ["type"], I = {
277
284
  class: "pk-chat-button",
278
285
  type: "button",
279
286
  title: e.$t("action.attachFile"),
280
- disabled: W.value,
287
+ disabled: G.value,
281
288
  onClick: n
282
289
  }), [m(g, {
283
290
  name: "ri:add-line",
284
291
  class: "pk-chat-button__icon"
285
- })], 16, de)]),
292
+ })], 16, fe)]),
286
293
  items: k(() => [
287
- X.value ? (S(), l(b, {
294
+ Z.value ? (S(), l(b, {
288
295
  key: 0,
289
- disabled: W.value || h.attachmentLimitReached,
296
+ disabled: G.value || h.attachmentLimitReached,
290
297
  onClick: Te
291
298
  }, {
292
299
  default: k(() => [m(g, {
@@ -296,8 +303,8 @@ var P = N, F = ["type"], I = {
296
303
  _: 1
297
304
  }, 8, ["disabled"])) : u("", !0),
298
305
  m(b, {
299
- disabled: W.value || h.attachmentLimitReached,
300
- onClick: Z
306
+ disabled: G.value || h.attachmentLimitReached,
307
+ onClick: Q
301
308
  }, {
302
309
  default: k(() => [m(g, {
303
310
  name: "ri:attachment-line",
@@ -312,8 +319,8 @@ var P = N, F = ["type"], I = {
312
319
  key: 1,
313
320
  icon: "ri:add-line",
314
321
  title: e.$t("action.attachFile"),
315
- disabled: W.value || h.attachmentLimitReached,
316
- onClick: Z
322
+ disabled: G.value || h.attachmentLimitReached,
323
+ onClick: Q
317
324
  }, null, 8, ["title", "disabled"])) : u("", !0),
318
325
  h.fileUpload && h.fileUpload.enabled ? (S(), d("input", {
319
326
  key: 2,
@@ -324,18 +331,18 @@ var P = N, F = ["type"], I = {
324
331
  multiple: "",
325
332
  accept: we.value,
326
333
  onChange: De
327
- }, null, 40, fe)) : u("", !0),
328
- h.fileUpload && h.fileUpload.enabled && X.value ? (S(), d("input", {
334
+ }, null, 40, pe)) : u("", !0),
335
+ h.fileUpload && h.fileUpload.enabled && Z.value ? (S(), d("input", {
329
336
  key: 3,
330
337
  ref_key: "cameraInputEl",
331
338
  ref: R,
332
339
  type: "file",
333
340
  capture: "environment",
334
341
  hidden: "",
335
- accept: Y.value,
342
+ accept: X.value,
336
343
  onChange: De
337
- }, null, 40, pe)) : u("", !0),
338
- f("div", me, [f("textarea", {
344
+ }, null, 40, me)) : u("", !0),
345
+ f("div", he, [f("textarea", {
339
346
  ref_key: "textareaEl",
340
347
  ref: F,
341
348
  value: B.value,
@@ -344,37 +351,37 @@ var P = N, F = ["type"], I = {
344
351
  rows: "1",
345
352
  enterkeyhint: "send",
346
353
  "aria-label": e.$t("label.message"),
347
- "aria-describedby": h.maxMessageLength ? T(G) : void 0,
348
- "aria-invalid": q.value || void 0,
354
+ "aria-describedby": h.maxMessageLength ? T(K) : void 0,
355
+ "aria-invalid": J.value || void 0,
349
356
  placeholder: h.placeholder,
350
- onInput: be,
351
- onKeydown: ie(Ne, ["enter"])
352
- }, null, 40, he)]),
357
+ onInput: xe,
358
+ onKeydown: ie(Fe, ["enter"])
359
+ }, null, 40, ge)]),
353
360
  h.maxMessageLength ? (S(), d("div", {
354
361
  key: 4,
355
- id: T(G),
356
- class: y(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": q.value }])
357
- }, [p(w(e.$n(K.value, "integer")) + "/", 1), f("span", _e, w(e.$n(h.maxMessageLength, "integer")), 1)], 10, ge)) : u("", !0),
362
+ id: T(K),
363
+ class: y(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": J.value }])
364
+ }, [p(w(e.$n(q.value, "integer")) + "/", 1), f("span", ve, w(e.$n(h.maxMessageLength, "integer")), 1)], 10, _e)) : u("", !0),
358
365
  h.voiceEnabled && !U.value ? (S(), l(L, {
359
366
  key: 5,
360
367
  icon: "ri:mic-line",
361
368
  title: e.$t("action.talk"),
362
- disabled: W.value,
363
- onClick: c[1] ||= (e) => M("voice-start")
369
+ disabled: G.value,
370
+ onClick: c[0] ||= (e) => M("voice-start")
364
371
  }, null, 8, ["title", "disabled"])) : u("", !0),
365
372
  U.value ? (S(), l(L, {
366
373
  key: 6,
367
374
  icon: "ri:stop-fill",
368
375
  modifiers: "primary",
369
376
  title: e.$t("action.stop"),
370
- onClick: je
377
+ onClick: Ne
371
378
  }, null, 8, ["title"])) : (S(), l(L, {
372
379
  key: 7,
373
380
  type: "submit",
374
381
  modifiers: "primary",
375
- icon: xe.value ? "loading-loop" : "ri:arrow-up-line",
382
+ icon: W.value ? "loading-loop" : "ri:arrow-up-line",
376
383
  title: e.$t("action.submit"),
377
- disabled: !J.value
384
+ disabled: !Y.value
378
385
  }, null, 8, [
379
386
  "icon",
380
387
  "title",
@@ -387,4 +394,4 @@ var P = N, F = ["type"], I = {
387
394
  //#endregion
388
395
  export { L as n, R as t };
389
396
 
390
- //# sourceMappingURL=PkChatbotInput-DQVpDLNp.js.map
397
+ //# sourceMappingURL=PkChatbotInput-C-bMNHC-.js.map