@8wave/ai-elements 0.119.0-beta.1 → 0.119.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkStreamingMarkdown-kpEBZA4d.js → PkStreamingMarkdown-Bry3y6Ru.js} +3 -3
- package/dist/_chunks/PkStreamingMarkdown-Bry3y6Ru.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-B8TOTS6A.js → PkToolShowArtifact-CfJLe8vD.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-B8TOTS6A.js.map → PkToolShowArtifact-CfJLe8vD.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-B89p05XM.js → PkToolShowContactForm-CQQ6p4bJ.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-B89p05XM.js.map → PkToolShowContactForm-CQQ6p4bJ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DTKQtFij.js → PkToolShowForm-CGAc1O6K.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-DTKQtFij.js.map → PkToolShowForm-CGAc1O6K.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CbwixpOb.js → PkToolShowSources-BJ-XFrLD.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-CbwixpOb.js.map → PkToolShowSources-BJ-XFrLD.js.map} +1 -1
- package/dist/_chunks/{markdown-c59ir6tw.js → markdown-DpoAzJSk.js} +64 -61
- package/dist/_chunks/markdown-DpoAzJSk.js.map +1 -0
- package/dist/ai-elements.es.js +64 -10
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/_chunks/{Document-B-oyVh7v.js → Document-CV-RJu_p.js} +64 -61
- package/dist-vue/_chunks/Document-CV-RJu_p.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-C_OzxC0s.js → PkChatbot-CcNC2r_E.js} +5 -5
- package/dist-vue/_chunks/{PkChatbot-C_OzxC0s.js.map → PkChatbot-CcNC2r_E.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-BEQCnqui.js → PkChatbotEmptyState-Toj4CqXV.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BEQCnqui.js.map → PkChatbotEmptyState-Toj4CqXV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-KJxWrDIT.js → PkChatbotInput-BfZqRpQ2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-KJxWrDIT.js.map → PkChatbotInput-BfZqRpQ2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-Zhuxom46.js → PkChatbotMessages-B6qYZsMZ.js} +14 -14
- package/dist-vue/_chunks/{PkChatbotMessages-Zhuxom46.js.map → PkChatbotMessages-B6qYZsMZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-Da4N5CKa.js → PkChatbotStepPayload-D0eoPBQ8.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-Da4N5CKa.js.map → PkChatbotStepPayload-D0eoPBQ8.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-rrtImvq5.js → PkChatbotStepToolDetail-CMx4cw1D.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-rrtImvq5.js.map → PkChatbotStepToolDetail-CMx4cw1D.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-LEfOolAc.js → PkChatbotSteps-DeZQhGRU.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-LEfOolAc.js.map → PkChatbotSteps-DeZQhGRU.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-BJ0YHCvA.js → PkChatbotViewChat--Q90F_Kg.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-BJ0YHCvA.js.map → PkChatbotViewChat--Q90F_Kg.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-gqCumfod.js → PkChatbotViewFiles-CA20TBFY.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-gqCumfod.js.map → PkChatbotViewFiles-CA20TBFY.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BWEvuFZm.js → PkStreamingMarkdown-C55Fi0Pd.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-BWEvuFZm.js.map → PkStreamingMarkdown-C55Fi0Pd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-tNEG6-r_.js → PkToolShowArtifact-z1qTnFkA.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-tNEG6-r_.js.map → PkToolShowArtifact-z1qTnFkA.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DBC6f9gR.js → PkToolShowContactForm-BjNpnv6y.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DBC6f9gR.js.map → PkToolShowContactForm-BjNpnv6y.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-Bbq0ETt1.js → PkToolShowDiagram-CqkabP0e.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-Bbq0ETt1.js.map → PkToolShowDiagram-CqkabP0e.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BG-8aTHy.js → PkToolShowForm-CZFWZub7.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-BG-8aTHy.js.map → PkToolShowForm-CZFWZub7.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DXn-bxHv.js → PkToolShowImageGallery-CkfXP_lD.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DXn-bxHv.js.map → PkToolShowImageGallery-CkfXP_lD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BZ_fDRCq.js → PkToolShowProductList-De-PtmD-.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BZ_fDRCq.js.map → PkToolShowProductList-De-PtmD-.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CUURb0PG.js → PkToolShowSources-CSN7S0zo.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-CUURb0PG.js.map → PkToolShowSources-CSN7S0zo.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-FNlPjswi.js → PkToolShowVideo-B_Q93E2y.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-FNlPjswi.js.map → PkToolShowVideo-B_Q93E2y.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CWV79tsb.js → PkToolShowWebPages-D3CdjJUc.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CWV79tsb.js.map → PkToolShowWebPages-D3CdjJUc.js.map} +1 -1
- package/dist-vue/_chunks/{utils-Dk2jFXR_.js → utils-CwIMEuAv.js} +3 -3
- package/dist-vue/_chunks/{utils-Dk2jFXR_.js.map → utils-CwIMEuAv.js.map} +1 -1
- package/dist-vue/composables.js +57 -3
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4006 -3981
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +4 -0
- package/dist-vue/packages/models/src/schema/Document.d.ts +25 -0
- package/dist-vue/packages/models/src/schema/Notification.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Platform.d.ts +72 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkStreamingMarkdown-kpEBZA4d.js.map +0 -1
- package/dist/_chunks/markdown-c59ir6tw.js.map +0 -1
- package/dist-vue/_chunks/Document-B-oyVh7v.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, n as t, o as n } from "./Document-
|
|
1
|
+
import { a as e, n as t, o as n } from "./Document-CV-RJu_p.js";
|
|
2
2
|
import { n as r } from "./useChatbotStore-rtl-oKqU.js";
|
|
3
3
|
import { t as i } from "./useDialogConfirm-BxhvsnRr.js";
|
|
4
4
|
import { t as a } from "./useImageFallback-5vQIO0pC.js";
|
|
@@ -122,4 +122,4 @@ var w = { class: "flex flex-col flex-1 min-h-0 relative" }, T = {
|
|
|
122
122
|
//#endregion
|
|
123
123
|
export { V as t };
|
|
124
124
|
|
|
125
|
-
//# sourceMappingURL=PkChatbotViewFiles-
|
|
125
|
+
//# sourceMappingURL=PkChatbotViewFiles-CA20TBFY.js.map
|
package/dist-vue/_chunks/{PkChatbotViewFiles-gqCumfod.js.map → PkChatbotViewFiles-CA20TBFY.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkChatbotViewFiles-gqCumfod.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_unref","_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString","_createBlock","_sfc_main","isImageMime","fileIconForMime","isInlineViewable","useChatbotStore","useDialogConfirm","useImageFallback","useFileRow","useI18n","thumbUrl","urls","file","canShowImage","inline","download","iso","locale","useUserFileKind","isSpreadsheet","t","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","PkChatbotViewFiles_default","defineComponent","props","__props","$t","store","storeToRefs","deletingId","ref","handleExclude","openDialogConfirm","removeConfirm","_component_VvIcon","VvIcon","_component_VvButton","VvButton","openBlock","createElementBlock","unref","isLoadingChatFiles","chatFiles","createElementVNode","Fragment","renderList","i","_cache","normalizeClass","createVNode","toDisplayString","openFile","showThumb","onThumbError","createBlock","formatDate","kindNote","removeLabel"],"sources":["../../../../packages/composable/src/useFileRow.ts","../../../../packages/components/src/chat/PkChatbotViewFiles.vue","../../../../packages/components/src/chat/PkChatbotViewFiles.vue"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport { isImageMime, isInlineViewable } from 'models'\nimport { useImageFallback } from './useImageFallback'\n\n/** Minimal shape a file-list row needs for the shared display helpers. */\nexport interface FileRowLike {\n documentId: string\n mimeType: string | null\n}\n\n/**\n * Shared display logic for the user-files list rows, used by both the in-app\n * table (PjUserFilesTable) and the embedded widget (PkChatbotViewFiles). The two\n * surfaces differ only in how they build URLs (authenticated store vs widget API\n * client), so the URL builders are injected.\n *\n * - `view(id, inline)` → opens/downloads the original file.\n * - `preview(id)` → small resized blob for the row thumbnail.\n */\nexport function useFileRow(urls: {\n view: (documentId: string, inline: boolean) => string\n preview: (documentId: string) => string\n}) {\n const { locale } = useI18n({ useScope: 'global' })\n\n // Image rows show a thumbnail; if it fails to load (auth/redirect, or the\n // preview isn't generated yet) we fall back to the file-type icon.\n const { canShowImage, onImageError } = useImageFallback()\n const thumbUrl = (file: FileRowLike): string =>\n urls.preview(file.documentId)\n const showThumb = (file: FileRowLike): boolean =>\n isImageMime(file.mimeType) && canShowImage(thumbUrl(file))\n const onThumbError = (file: FileRowLike): void => {\n onImageError(thumbUrl(file))\n }\n\n // Name click previews images/PDF inline; an explicit download forces an\n // attachment (inline=false → download SAS).\n const openFile = (file: FileRowLike, download = false): void => {\n const inline = !download && isInlineViewable(file.mimeType)\n window.open(urls.view(file.documentId, inline), '_blank', 'noopener')\n }\n\n const formatDate = (iso: string): string =>\n new Date(iso).toLocaleDateString(locale.value, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n\n return { showThumb, thumbUrl, onThumbError, openFile, formatDate }\n}\n\n/** What tells a spreadsheet row apart from a KB document. */\nexport interface FileKindLike {\n kind?: 'document' | 'spreadsheet'\n sourceAttachmentId?: string | null\n}\n\n/**\n * The wording that depends on what a \"My files\" row is. A KB document is a\n * copy of the upload: removing it only takes it out of the assistant's reach.\n * A spreadsheet is the chat attachment itself and never enters the KB: its row\n * says so, and removing it deletes it from its chat with every version the\n * assistant wrote of it.\n */\nexport function useUserFileKind() {\n const { t } = useI18n({ useScope: 'global' })\n\n const isSpreadsheet = (file: FileKindLike): boolean =>\n file.kind === 'spreadsheet'\n\n /** A short note for the row; undefined for a KB document. */\n const kindNote = (file: FileKindLike): string | undefined => {\n if (!isSpreadsheet(file)) {\n return undefined\n }\n return file.sourceAttachmentId\n ? t('userFiles.spreadsheetVersion')\n : t('userFiles.spreadsheetInChatOnly')\n }\n\n const removeLabel = (file: FileKindLike): string =>\n isSpreadsheet(file)\n ? t('userFiles.deleteSpreadsheet')\n : t('userFiles.exclude')\n\n /** The options of the confirmation dialog before removing the file. */\n const removeConfirm = (file: FileKindLike) =>\n isSpreadsheet(file)\n ? {\n title: t('confirmTitle.deleteSpreadsheet'),\n questionLabel: t('userFiles.deleteSpreadsheetConfirm'),\n }\n : {\n title: t('confirmTitle.excludeUserFile'),\n questionLabel: t('userFiles.excludeConfirm'),\n }\n\n return { isSpreadsheet, kindNote, removeLabel, removeConfirm }\n}\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__actions {\n gap: var(--spacing-2);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__actions {\n gap: var(--spacing-2);\n }\n }\n</style>\n"],"mappings":";;;;;;;;;AAmBA,SAAgBmB,EAAW,GAGxB;CACC,IAAM,EAAE,cAAWC,EAAQ,EAAE,UAAU,SAAS,CAAC,GAI3C,EAAE,iBAAc,oBAAiBF,EAAiB,GAClDG,KAAY,MACdC,EAAK,QAAQC,EAAK,UAAU;CAqBhC,OAAO;EAAE,YApBU,MACfV,EAAYU,EAAK,QAAQ,KAAKC,EAAaH,EAASE,CAAI,CAAC;EAmBzC;EAAU,eAlBR,MAA4B;GAC9C,EAAaF,EAASE,CAAI,CAAC;EAC/B;EAgB4C,WAZ1B,GAAmB,IAAW,OAAgB;GAC5D,IAAME,IAAS,CAACC,KAAYX,EAAiBQ,EAAK,QAAQ;GAC1D,OAAO,KAAKD,EAAK,KAAKC,EAAK,YAAYE,CAAM,GAAG,UAAU,UAAU;EACxE;EASsD,aAPlC,MAChB,IAAI,KAAKE,CAAG,CAAC,CAAC,mBAAmBC,EAAO,OAAO;GAC3C,MAAM;GACN,OAAO;GACP,KAAK;EACT,CAAC;CAE4D;AACrE;AAeA,SAAgBC,IAAkB;CAC9B,IAAM,EAAE,SAAMT,EAAQ,EAAE,UAAU,SAAS,CAAC,GAEtCU,KAAiB,MACnBP,EAAK,SAAS;CA6BlB,OAAO;EAAE;EAAe,WA1BN,MAA2C;GACzD,IAAKO,EAAcP,CAAI,GAGvB,OAAOA,EAAK,qBACNQ,EA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ASiC,EAAA,UAAejC,EAAK;IAC7B,UAAUiC,EAAA,UAAejC,EAAK;IAC9B,UAAK,MAAEmC,EAAcnC,CAAI"}
|
|
1
|
+
{"version":3,"file":"PkChatbotViewFiles-CA20TBFY.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_unref","_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString","_createBlock","_sfc_main","isImageMime","fileIconForMime","isInlineViewable","useChatbotStore","useDialogConfirm","useImageFallback","useFileRow","useI18n","thumbUrl","urls","file","canShowImage","inline","download","iso","locale","useUserFileKind","isSpreadsheet","t","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","PkChatbotViewFiles_default","defineComponent","props","__props","$t","store","storeToRefs","deletingId","ref","handleExclude","openDialogConfirm","removeConfirm","_component_VvIcon","VvIcon","_component_VvButton","VvButton","openBlock","createElementBlock","unref","isLoadingChatFiles","chatFiles","createElementVNode","Fragment","renderList","i","_cache","normalizeClass","createVNode","toDisplayString","openFile","showThumb","onThumbError","createBlock","formatDate","kindNote","removeLabel"],"sources":["../../../../packages/composable/src/useFileRow.ts","../../../../packages/components/src/chat/PkChatbotViewFiles.vue","../../../../packages/components/src/chat/PkChatbotViewFiles.vue"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport { isImageMime, isInlineViewable } from 'models'\nimport { useImageFallback } from './useImageFallback'\n\n/** Minimal shape a file-list row needs for the shared display helpers. */\nexport interface FileRowLike {\n documentId: string\n mimeType: string | null\n}\n\n/**\n * Shared display logic for the user-files list rows, used by both the in-app\n * table (PjUserFilesTable) and the embedded widget (PkChatbotViewFiles). The two\n * surfaces differ only in how they build URLs (authenticated store vs widget API\n * client), so the URL builders are injected.\n *\n * - `view(id, inline)` → opens/downloads the original file.\n * - `preview(id)` → small resized blob for the row thumbnail.\n */\nexport function useFileRow(urls: {\n view: (documentId: string, inline: boolean) => string\n preview: (documentId: string) => string\n}) {\n const { locale } = useI18n({ useScope: 'global' })\n\n // Image rows show a thumbnail; if it fails to load (auth/redirect, or the\n // preview isn't generated yet) we fall back to the file-type icon.\n const { canShowImage, onImageError } = useImageFallback()\n const thumbUrl = (file: FileRowLike): string =>\n urls.preview(file.documentId)\n const showThumb = (file: FileRowLike): boolean =>\n isImageMime(file.mimeType) && canShowImage(thumbUrl(file))\n const onThumbError = (file: FileRowLike): void => {\n onImageError(thumbUrl(file))\n }\n\n // Name click previews images/PDF inline; an explicit download forces an\n // attachment (inline=false → download SAS).\n const openFile = (file: FileRowLike, download = false): void => {\n const inline = !download && isInlineViewable(file.mimeType)\n window.open(urls.view(file.documentId, inline), '_blank', 'noopener')\n }\n\n const formatDate = (iso: string): string =>\n new Date(iso).toLocaleDateString(locale.value, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n\n return { showThumb, thumbUrl, onThumbError, openFile, formatDate }\n}\n\n/** What tells a spreadsheet row apart from a KB document. */\nexport interface FileKindLike {\n kind?: 'document' | 'spreadsheet'\n sourceAttachmentId?: string | null\n}\n\n/**\n * The wording that depends on what a \"My files\" row is. A KB document is a\n * copy of the upload: removing it only takes it out of the assistant's reach.\n * A spreadsheet is the chat attachment itself and never enters the KB: its row\n * says so, and removing it deletes it from its chat with every version the\n * assistant wrote of it.\n */\nexport function useUserFileKind() {\n const { t } = useI18n({ useScope: 'global' })\n\n const isSpreadsheet = (file: FileKindLike): boolean =>\n file.kind === 'spreadsheet'\n\n /** A short note for the row; undefined for a KB document. */\n const kindNote = (file: FileKindLike): string | undefined => {\n if (!isSpreadsheet(file)) {\n return undefined\n }\n return file.sourceAttachmentId\n ? t('userFiles.spreadsheetVersion')\n : t('userFiles.spreadsheetInChatOnly')\n }\n\n const removeLabel = (file: FileKindLike): string =>\n isSpreadsheet(file)\n ? t('userFiles.deleteSpreadsheet')\n : t('userFiles.exclude')\n\n /** The options of the confirmation dialog before removing the file. */\n const removeConfirm = (file: FileKindLike) =>\n isSpreadsheet(file)\n ? {\n title: t('confirmTitle.deleteSpreadsheet'),\n questionLabel: t('userFiles.deleteSpreadsheetConfirm'),\n }\n : {\n title: t('confirmTitle.excludeUserFile'),\n questionLabel: t('userFiles.excludeConfirm'),\n }\n\n return { isSpreadsheet, kindNote, removeLabel, removeConfirm }\n}\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__actions {\n gap: var(--spacing-2);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__actions {\n gap: var(--spacing-2);\n }\n }\n</style>\n"],"mappings":";;;;;;;;;AAmBA,SAAgBmB,EAAW,GAGxB;CACC,IAAM,EAAE,cAAWC,EAAQ,EAAE,UAAU,SAAS,CA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,MAAAA,CAAAA,EAAAA,CAAAA,GAAAA,EAWO,QAXPwC,GAWO,CAVHxC,EAEO,QAFPyC,GAEOpC,EADAa,EAAK,QAAQnB,EAAAiD,CAAA,CAAE,CAAA,oBAAA,CAAA,GAAA,CAAA,GAEtBhD,EAMO,QANP0C,GAMOrC,EAAA,CAJEN,EAAA8E,CAAA,CAAU,CAAC3D,EAAK,SAAS,GAAGnB,EAAA+E,CAAA,CAAQ,CAAC5D,CAAI,CAAA,CAAA,CAA4C,OAAO,OAAO,CAAA,CAA2C,KAAI,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAAmB,CAAA,GAOnKrC,EAaM,OAbN2C,GAaM,CAZFvC,EAIoCsD,GAAA;IAHhC,WAAU;IACV,MAAK;IACJ,OAAO3D,EAAAiD,CAAA,CAAE,CAAA,iBAAA;IACT,UAAK,MAAEjD,EAAA0E,CAAA,CAAQ,CAACvD,GAAI,EAAA;GACzBd,GAAAA,MAAAA,GAAAA,CAAAA,SAAAA,SAAAA,CAAAA,GAAAA,EAMmCsD,GAAA;IAL/B,WAAU;IACV,MAAK;IACJ,OAAO3D,EAAAgF,CAAA,CAAW,CAAC7D,CAAI;IACvB,SAASiC,EAAA,UAAejC,EAAK;IAC7B,UAAUiC,EAAA,UAAejC,EAAK;IAC9B,UAAK,MAAEmC,EAAcnC,CAAI"}
|
package/dist-vue/_chunks/{PkStreamingMarkdown-BWEvuFZm.js → PkStreamingMarkdown-C55Fi0Pd.js}
RENAMED
|
@@ -3,7 +3,7 @@ import { n as t, t as n } from "./cdn-css-JUUNhyQ6.js";
|
|
|
3
3
|
import "./src-DCfvejyT.js";
|
|
4
4
|
import { i as r, n as i } from "./url-validation-9DstIfq2.js";
|
|
5
5
|
import { n as a } from "./useShortUrlResolver-DI8ycJiO.js";
|
|
6
|
-
import { d as o } from "./utils-
|
|
6
|
+
import { d as o } from "./utils-CwIMEuAv.js";
|
|
7
7
|
import { computed as s, createElementBlock as c, defineComponent as l, inject as u, nextTick as d, onBeforeUnmount as f, onMounted as p, openBlock as ee, provide as m, ref as h, toRef as te, useTemplateRef as ne, watch as g } from "vue";
|
|
8
8
|
import { useI18n as re } from "vue-i18n";
|
|
9
9
|
import { refThrottled as ie } from "@vueuse/core";
|
|
@@ -3401,4 +3401,4 @@ var ka = ["innerHTML"], Aa = 100, ja = /* @__PURE__ */ l({
|
|
|
3401
3401
|
//#endregion
|
|
3402
3402
|
export { wa as n, Oa as r, ja as t };
|
|
3403
3403
|
|
|
3404
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3404
|
+
//# sourceMappingURL=PkStreamingMarkdown-C55Fi0Pd.js.map
|