@atom8n/n8n-editor-ui 2.2.0
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/.stylelintcache +1 -0
- package/README.md +59 -0
- package/biome.jsonc +8 -0
- package/build.log +55 -0
- package/data/node-popularity.json +3998 -0
- package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
- package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
- package/dist/assets/Alert-Dy86dyOr.js +102 -0
- package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
- package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
- package/dist/assets/AuthView-D2LWHrMp.js +106 -0
- package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
- package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
- package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
- package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
- package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
- package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
- package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
- package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
- package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
- package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
- package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
- package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
- package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
- package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
- package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
- package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
- package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
- package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
- package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
- package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
- package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
- package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
- package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
- package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
- package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
- package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
- package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
- package/dist/assets/ErrorView-zT9cX76a.js +61 -0
- package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
- package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
- package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
- package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
- package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
- package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
- package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
- package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
- package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
- package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
- package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
- package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
- package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
- package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
- package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
- package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
- package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
- package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
- package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
- package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
- package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
- package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
- package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
- package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
- package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
- package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
- package/dist/assets/Modal-CIzXlZdZ.js +204 -0
- package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
- package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
- package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
- package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
- package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
- package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
- package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
- package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
- package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
- package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
- package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
- package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
- package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
- package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
- package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
- package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
- package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
- package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
- package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
- package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
- package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
- package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
- package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
- package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
- package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
- package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
- package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
- package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
- package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
- package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
- package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
- package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
- package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
- package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
- package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
- package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
- package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
- package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
- package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
- package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
- package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
- package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
- package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
- package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
- package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
- package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
- package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
- package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
- package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
- package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
- package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
- package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
- package/dist/assets/SetupView-VORZ-L_u.js +112 -0
- package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
- package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
- package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
- package/dist/assets/SigninView-D9_Pm16j.js +358 -0
- package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
- package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
- package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
- package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
- package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
- package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
- package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
- package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
- package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
- package/dist/assets/TemplatesView-025CcmIY.js +57 -0
- package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
- package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
- package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
- package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
- package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
- package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
- package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
- package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
- package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
- package/dist/assets/WorkerView-Caznsljo.js +563 -0
- package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
- package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
- package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
- package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
- package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
- package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
- package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
- package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
- package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
- package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
- package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
- package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
- package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
- package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
- package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
- package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
- package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
- package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
- package/dist/assets/assistant.store-CNywgN4S.js +518 -0
- package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
- package/dist/assets/banners.store-CGEcBTDn.js +195 -0
- package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
- package/dist/assets/buttons.esm-yintpW2E.js +364 -0
- package/dist/assets/chart-CNvyywtJ.js +10958 -0
- package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
- package/dist/assets/chat.store-290YeyrQ.js +865 -0
- package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
- package/dist/assets/chunk-6z4oVpB-.js +36 -0
- package/dist/assets/col-Cmt4cmuS.js +158 -0
- package/dist/assets/constants-C8OH4tTq.js +106256 -0
- package/dist/assets/constants-DMrsrpD7.js +32 -0
- package/dist/assets/core-B9gt_4yk.js +4 -0
- package/dist/assets/core-CP5FY4aX.js +1202 -0
- package/dist/assets/core-CRbPymLT.js +9741 -0
- package/dist/assets/dataTable.store-DmipQsol.js +207 -0
- package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
- package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
- package/dist/assets/dateformat-hG8NERse.js +181 -0
- package/dist/assets/dialog-lMho1TD8.js +425 -0
- package/dist/assets/dist-Cw46Is-h.js +151 -0
- package/dist/assets/doppler-B__k0MeW.webp +0 -0
- package/dist/assets/element-icons-B-tDfklg.woff +0 -0
- package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
- package/dist/assets/empty-BuGRxzl4.js +2210 -0
- package/dist/assets/en-CF30SCh2.js +95 -0
- package/dist/assets/en-DyO2pPiC.js +2 -0
- package/dist/assets/es-BkUFJVtD.js +43338 -0
- package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
- package/dist/assets/executions.store-B9uRYwgv.js +205 -0
- package/dist/assets/exports-Crx_gvt_.js +1799 -0
- package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
- package/dist/assets/fileUtils-CRWqOQje.js +20 -0
- package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
- package/dist/assets/get-BcEmeOxn.js +2781 -0
- package/dist/assets/index-SL8542zQ.js +28372 -0
- package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
- package/dist/assets/insights.store-BFc3kDUo.js +61 -0
- package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
- package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
- package/dist/assets/languageModules-9LyndCqU.js +13862 -0
- package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
- package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
- package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
- package/dist/assets/merge-DhuTk1HM.js +564 -0
- package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
- package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
- package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
- package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
- package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
- package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
- package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
- package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
- package/dist/assets/radio-CSce3UT0.js +262 -0
- package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
- package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
- package/dist/assets/retry-BgHaYzbB.js +23 -0
- package/dist/assets/roles.store-CRf_zJTb.js +51 -0
- package/dist/assets/router-DNpzz3GH.js +2631 -0
- package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
- package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
- package/dist/assets/semver-Bk6DGseV.js +1306 -0
- package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
- package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
- package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
- package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
- package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
- package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
- package/dist/assets/src-jviYSG25.js +55454 -0
- package/dist/assets/sso.store-DyApJwhx.js +139 -0
- package/dist/assets/style-E3CrYFV8.css +111829 -0
- package/dist/assets/table-we1DjFMV.js +3944 -0
- package/dist/assets/templateActions-bEDSARw2.js +65 -0
- package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
- package/dist/assets/truncate-C0KYt7i3.js +4176 -0
- package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
- package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
- package/dist/assets/usage.store-CU5J_nGm.js +100 -0
- package/dist/assets/useActions-B1JckIRj.js +255 -0
- package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
- package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
- package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
- package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
- package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
- package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
- package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
- package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
- package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
- package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
- package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
- package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
- package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
- package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
- package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
- package/dist/assets/useMcp-DoMOIfqT.js +27 -0
- package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
- package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
- package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
- package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
- package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
- package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
- package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
- package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
- package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
- package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
- package/dist/assets/utils-DI7dLldp.js +54 -0
- package/dist/assets/versions.store-B1z2OrLE.js +191 -0
- package/dist/assets/vue-CydWIhxN.js +4378 -0
- package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
- package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
- package/dist/assets/xml-B_oj6Mle.js +2060 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +157 -0
- package/dist/static/base-path.js +1 -0
- package/dist/static/community_package_tooltip_img.png +0 -0
- package/dist/static/data-mapping-gif.gif +0 -0
- package/dist/static/form-grey.svg +1 -0
- package/dist/static/google-auth/disabled.dark.png +0 -0
- package/dist/static/google-auth/disabled.png +0 -0
- package/dist/static/google-auth/focus.dark.png +0 -0
- package/dist/static/google-auth/focus.png +0 -0
- package/dist/static/google-auth/normal.dark.png +0 -0
- package/dist/static/google-auth/normal.png +0 -0
- package/dist/static/google-auth/pressed.dark.png +0 -0
- package/dist/static/google-auth/pressed.png +0 -0
- package/dist/static/n8n-logo.png +0 -0
- package/dist/static/og_image.png +0 -0
- package/dist/static/open-ai.svg +1 -0
- package/dist/static/openChat.png +0 -0
- package/dist/static/posthog.init.js +41 -0
- package/dist/static/prefers-color-scheme.css +5 -0
- package/dist/static/webhook-icon.svg +1 -0
- package/dist/tree-sitter-bash.wasm +0 -0
- package/dist/tree-sitter.wasm +0 -0
- package/eslint.config.mjs +59 -0
- package/index.html +45 -0
- package/index.js +0 -0
- package/package.json +147 -0
- package/postcss.config.cjs +6 -0
- package/scripts/fetch-node-popularity.mjs +102 -0
- package/stylelint.config.mjs +9 -0
- package/tailwind.config.js +8 -0
- package/tsconfig.json +36 -0
- package/vite/i18n-locales-hmr-helpers.ts +19 -0
- package/vite/source-map-js-shim.ts +1 -0
- package/vite/vite-plugin-node-popularity.mts +32 -0
- package/vite.config.mts +304 -0
|
@@ -0,0 +1,1559 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./es-BkUFJVtD.js","./core-CP5FY4aX.js","./chunk-6z4oVpB-.js","./languageModules-9LyndCqU.js","./xml-B_oj6Mle.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { o as __toESM } from "./chunk-6z4oVpB-.js";
|
|
3
|
+
import { C as computed, Cn as toDisplayString, D as createElementBlock, E as createCommentVNode, G as nextTick, Gt as unref, It as ref, M as createVNode, P as defineComponent, T as createBlock, _ as Fragment, _t as watch, b as Teleport, bn as normalizeStyle, bt as withCtx, c as useCssModule, et as openBlock, h as withModifiers, it as renderList, j as createTextVNode, mt as useTemplateRef, q as onBeforeMount, vn as normalizeClass, w as createBaseVNode } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
4
|
+
import { C as useSpeechRecognition, it as I18nT, p as useElementSize, rt as useI18n, v as useLocalStorage, w as useSpeechSynthesis, x as useScroll, y as useMediaQuery } from "./core-CRbPymLT.js";
|
|
5
|
+
import { Cn as N8nIcon_default, bn as N8nText_default, ct as useDeviceSupport, gt as require_markdown_it_link_attributes, ht as N8nTooltip_default, mt as N8nLink_default, s as N8nScrollArea_default, vn as N8nHeading_default, xn as N8nButton_default, xt as N8nIconButton_default, yt as N8nInput_default } from "./src-jviYSG25.js";
|
|
6
|
+
import "./en-CF30SCh2.js";
|
|
7
|
+
import { t as __vitePreload } from "./preload-helper-dyVz7ck7.js";
|
|
8
|
+
import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BwBpWJRZ.js";
|
|
9
|
+
import "./truncate-C0KYt7i3.js";
|
|
10
|
+
import { Er as useUsersStore, P as useWorkflowsStore, Xn as useDocumentTitle, aa as useUIStore, ms as useSettingsStore, us as v4_default, y as useToast } from "./builder.store-Czk2ipDE.js";
|
|
11
|
+
import "./empty-BuGRxzl4.js";
|
|
12
|
+
import { _ as useRoute, v as useRouter } from "./get-BcEmeOxn.js";
|
|
13
|
+
import "./sanitize-html-CbW56HUN.js";
|
|
14
|
+
import "./CalendarDate-DgQUMbNo.js";
|
|
15
|
+
import "./path-browserify-RUt2u7iT.js";
|
|
16
|
+
import "./_MapCache-CcdIl4Ae.js";
|
|
17
|
+
import { Es as LOCAL_STORAGE_CHAT_HUB_SELECTED_TOOLS, Ro as VIEWS, Ts as LOCAL_STORAGE_CHAT_HUB_SELECTED_MODEL, Yr as PROVIDER_CREDENTIAL_TYPE_MAP, Zr as chatHubConversationModelSchema, pi as INodesSchema } from "./constants-C8OH4tTq.js";
|
|
18
|
+
import "./merge-DhuTk1HM.js";
|
|
19
|
+
import { r as useRootStore } from "./_baseOrderBy-N8Be_6z6.js";
|
|
20
|
+
import "./dateformat-hG8NERse.js";
|
|
21
|
+
import "./useDebounce-Br5_1ug-.js";
|
|
22
|
+
import "./retry-BgHaYzbB.js";
|
|
23
|
+
import "./nodeIcon-D6X-ENYt.js";
|
|
24
|
+
import { t as useClipboard } from "./useClipboard-DvjhVHqJ.js";
|
|
25
|
+
import "./NodeIcon-B9VW6tX6.js";
|
|
26
|
+
import "./CredentialIcon-8YdTTFZ1.js";
|
|
27
|
+
import { t as VueMarkdown_default } from "./VueMarkdown-CQqJL9vK.js";
|
|
28
|
+
import { f as MOBILE_MEDIA_QUERY, m as providerDisplayNames, n as CHAT_CONVERSATION_VIEW, p as TOOLS_SELECTOR_MODAL_KEY, t as AGENT_EDITOR_MODAL_KEY, u as CHAT_VIEW } from "./constants-DMrsrpD7.js";
|
|
29
|
+
import { h as buildChatAttachmentUrl, i as findOneFromModelsResponse, l as isLlmProvider, n as createMimeTypes, p as unflattenModel, t as useChatStore, u as isLlmProviderModel } from "./chat.store-290YeyrQ.js";
|
|
30
|
+
import "./fileUtils-CRWqOQje.js";
|
|
31
|
+
import { n as ToolsSelector_default, r as ModelSelector_default, t as useCustomAgent } from "./useCustomAgent-DpILEt5e.js";
|
|
32
|
+
import { t as ChatAgentAvatar_default } from "./ChatAgentAvatar-50YBnv3N.js";
|
|
33
|
+
import { n as useChatCredentials, r as chatHubConversationModelWithCachedDisplayNameSchema, t as ChatLayout_default } from "./ChatLayout-CTE_5SiM.js";
|
|
34
|
+
import { t as ChatFile_default } from "./ChatFile-xZxmc2nV.js";
|
|
35
|
+
var ChatConversationHeader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
36
|
+
__name: "ChatConversationHeader",
|
|
37
|
+
props: {
|
|
38
|
+
selectedModel: {},
|
|
39
|
+
credentials: {},
|
|
40
|
+
readyToShowModelSelector: { type: Boolean }
|
|
41
|
+
},
|
|
42
|
+
emits: [
|
|
43
|
+
"selectModel",
|
|
44
|
+
"renameConversation",
|
|
45
|
+
"editCustomAgent",
|
|
46
|
+
"createCustomAgent",
|
|
47
|
+
"selectCredential",
|
|
48
|
+
"openWorkflow"
|
|
49
|
+
],
|
|
50
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
51
|
+
const emit = __emit;
|
|
52
|
+
const modelSelectorRef = useTemplateRef("modelSelectorRef");
|
|
53
|
+
const i18n = useI18n();
|
|
54
|
+
const chatStore = useChatStore();
|
|
55
|
+
const isLoadingAgents = ref(false);
|
|
56
|
+
const showOpenWorkflow = computed(() => {
|
|
57
|
+
return __props.selectedModel?.model.provider === "n8n" && __props.selectedModel.metadata.scopes?.includes("workflow:read");
|
|
58
|
+
});
|
|
59
|
+
function onOpenWorkflow() {
|
|
60
|
+
if (__props.selectedModel?.model.provider === "n8n") emit("openWorkflow", __props.selectedModel.model.workflowId);
|
|
61
|
+
}
|
|
62
|
+
function onModelChange(selection) {
|
|
63
|
+
emit("selectModel", selection);
|
|
64
|
+
}
|
|
65
|
+
watch(() => __props.credentials, async (creds) => {
|
|
66
|
+
if (creds) {
|
|
67
|
+
isLoadingAgents.value = true;
|
|
68
|
+
try {
|
|
69
|
+
await chatStore.fetchAgents(creds);
|
|
70
|
+
} finally {
|
|
71
|
+
isLoadingAgents.value = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, { immediate: true });
|
|
75
|
+
__expose({
|
|
76
|
+
openModelSelector: () => modelSelectorRef.value?.open(),
|
|
77
|
+
openCredentialSelector: (provider) => modelSelectorRef.value?.openCredentialSelector(provider)
|
|
78
|
+
});
|
|
79
|
+
return (_ctx, _cache) => {
|
|
80
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.$style.component) }, [
|
|
81
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.grow) }, [_ctx.readyToShowModelSelector ? (openBlock(), createBlock(ModelSelector_default, {
|
|
82
|
+
key: 0,
|
|
83
|
+
ref_key: "modelSelectorRef",
|
|
84
|
+
ref: modelSelectorRef,
|
|
85
|
+
"selected-agent": _ctx.selectedModel,
|
|
86
|
+
credentials: _ctx.credentials,
|
|
87
|
+
text: "",
|
|
88
|
+
agents: unref(chatStore).agents,
|
|
89
|
+
"is-loading": isLoadingAgents.value,
|
|
90
|
+
onChange: onModelChange,
|
|
91
|
+
onCreateCustomAgent: _cache[0] || (_cache[0] = ($event) => emit("createCustomAgent")),
|
|
92
|
+
onSelectCredential: _cache[1] || (_cache[1] = (provider, credentialId) => emit("selectCredential", provider, credentialId))
|
|
93
|
+
}, null, 8, [
|
|
94
|
+
"selected-agent",
|
|
95
|
+
"credentials",
|
|
96
|
+
"agents",
|
|
97
|
+
"is-loading"
|
|
98
|
+
])) : createCommentVNode("", true)], 2),
|
|
99
|
+
_ctx.selectedModel?.model.provider === "custom-agent" ? (openBlock(), createBlock(unref(N8nButton_default), {
|
|
100
|
+
key: 0,
|
|
101
|
+
class: normalizeClass(_ctx.$style.editAgent),
|
|
102
|
+
type: "secondary",
|
|
103
|
+
size: "small",
|
|
104
|
+
icon: "settings",
|
|
105
|
+
label: unref(i18n).baseText("chatHub.chat.header.button.editAgent"),
|
|
106
|
+
onClick: _cache[2] || (_cache[2] = ($event) => emit("editCustomAgent", _ctx.selectedModel.model.agentId))
|
|
107
|
+
}, null, 8, ["class", "label"])) : createCommentVNode("", true),
|
|
108
|
+
showOpenWorkflow.value ? (openBlock(), createBlock(unref(N8nButton_default), {
|
|
109
|
+
key: 1,
|
|
110
|
+
class: normalizeClass(_ctx.$style.editAgent),
|
|
111
|
+
type: "secondary",
|
|
112
|
+
size: "small",
|
|
113
|
+
icon: "settings",
|
|
114
|
+
label: unref(i18n).baseText("chatHub.chat.header.button.openWorkflow"),
|
|
115
|
+
onClick: onOpenWorkflow
|
|
116
|
+
}, null, 8, ["class", "label"])) : createCommentVNode("", true)
|
|
117
|
+
], 2);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var ChatConversationHeader_vue_vue_type_style_index_0_lang_module_default = {
|
|
122
|
+
component: "_component_1rkfw_123",
|
|
123
|
+
menuButton: "_menuButton_1rkfw_133",
|
|
124
|
+
grow: "_grow_1rkfw_137",
|
|
125
|
+
title: "_title_1rkfw_144",
|
|
126
|
+
editAgent: "_editAgent_1rkfw_148"
|
|
127
|
+
};
|
|
128
|
+
var ChatConversationHeader_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatConversationHeader_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatConversationHeader_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
129
|
+
var ChatTypingIndicator_vue_vue_type_style_index_0_lang_module_default = {
|
|
130
|
+
typing: "_typing_9qr9t_123",
|
|
131
|
+
blink: "_blink_9qr9t_1"
|
|
132
|
+
};
|
|
133
|
+
var _sfc_main = {};
|
|
134
|
+
function _sfc_render(_ctx, _cache) {
|
|
135
|
+
return openBlock(), createElementBlock("span", {
|
|
136
|
+
class: normalizeClass(_ctx.$style.typing),
|
|
137
|
+
"data-test-id": "chat-typing-indicator"
|
|
138
|
+
}, _cache[0] || (_cache[0] = [
|
|
139
|
+
createBaseVNode("i", null, null, -1),
|
|
140
|
+
createBaseVNode("i", null, null, -1),
|
|
141
|
+
createBaseVNode("i", null, null, -1)
|
|
142
|
+
]), 2);
|
|
143
|
+
}
|
|
144
|
+
var ChatTypingIndicator_default = /* @__PURE__ */ __plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render], ["__cssModules", { "$style": ChatTypingIndicator_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
145
|
+
var import_markdown_it_link_attributes = /* @__PURE__ */ __toESM(require_markdown_it_link_attributes());
|
|
146
|
+
var hljsInstance;
|
|
147
|
+
var asyncImport = { status: "uninitialized" };
|
|
148
|
+
function useChatHubMarkdownOptions(codeBlockActionsClassName, tableContainerClassName) {
|
|
149
|
+
const forceReRenderKey = ref(0);
|
|
150
|
+
const codeBlockContents = ref();
|
|
151
|
+
const options = { highlight(str, lang) {
|
|
152
|
+
if (!lang) return "";
|
|
153
|
+
const normalizedLang = lang.toLowerCase();
|
|
154
|
+
if (hljsInstance?.getLanguage(normalizedLang)) try {
|
|
155
|
+
return hljsInstance.highlight(str, { language: normalizedLang }).value;
|
|
156
|
+
} catch {}
|
|
157
|
+
loadLanguageModules();
|
|
158
|
+
return "";
|
|
159
|
+
} };
|
|
160
|
+
async function loadLanguageModules() {
|
|
161
|
+
if (asyncImport.status === "done") return;
|
|
162
|
+
if (asyncImport.status === "inProgress") {
|
|
163
|
+
await asyncImport.promise;
|
|
164
|
+
forceReRenderKey.value++;
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
asyncImport = {
|
|
169
|
+
status: "inProgress",
|
|
170
|
+
promise: Promise.all([__vitePreload(() => import("./es-BkUFJVtD.js"), __vite__mapDeps([0,1,2]), import.meta.url), __vitePreload(() => import("./languageModules-9LyndCqU.js"), __vite__mapDeps([3,4]), import.meta.url)])
|
|
171
|
+
};
|
|
172
|
+
const [hljs, languages] = await asyncImport.promise;
|
|
173
|
+
asyncImport = { status: "done" };
|
|
174
|
+
hljsInstance = hljs.default.newInstance();
|
|
175
|
+
for (const [lang, module] of Object.entries(languages)) hljsInstance.registerLanguage(lang, module);
|
|
176
|
+
forceReRenderKey.value++;
|
|
177
|
+
} catch (error) {
|
|
178
|
+
console.warn("Failed to load syntax highlighting modules", error);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
options,
|
|
183
|
+
forceReRenderKey,
|
|
184
|
+
plugins: computed(() => {
|
|
185
|
+
const linksNewTabPlugin = (vueMarkdownItInstance) => {
|
|
186
|
+
vueMarkdownItInstance.use(import_markdown_it_link_attributes.default, { attrs: {
|
|
187
|
+
target: "_blank",
|
|
188
|
+
rel: "noopener"
|
|
189
|
+
} });
|
|
190
|
+
};
|
|
191
|
+
const codeBlockPlugin = (vueMarkdownItInstance) => {
|
|
192
|
+
const defaultFenceRenderer = vueMarkdownItInstance.renderer.rules.fence;
|
|
193
|
+
codeBlockContents.value = /* @__PURE__ */ new Map();
|
|
194
|
+
vueMarkdownItInstance.renderer.rules.fence = (tokens, idx, options$1, env, self) => {
|
|
195
|
+
const defaultRendered = defaultFenceRenderer?.(tokens, idx, options$1, env, self) ?? self.renderToken(tokens, idx, options$1);
|
|
196
|
+
const content$1 = tokens[idx]?.content.trim();
|
|
197
|
+
if (content$1) codeBlockContents.value?.set(String(idx), content$1);
|
|
198
|
+
return defaultRendered.replace("</pre>", `<div data-markdown-token-idx="${idx}" class="${codeBlockActionsClassName}"></div></pre>`);
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
const tablePlugin = (vueMarkdownItInstance) => {
|
|
202
|
+
const defaultTableOpenRenderer = vueMarkdownItInstance.renderer.rules.table_open;
|
|
203
|
+
const defaultTableCloseRenderer = vueMarkdownItInstance.renderer.rules.table_close;
|
|
204
|
+
vueMarkdownItInstance.renderer.rules.table_open = (tokens, idx, options$1, env, self) => {
|
|
205
|
+
return (defaultTableOpenRenderer?.(tokens, idx, options$1, env, self) ?? self.renderToken(tokens, idx, options$1)).replace("<table", `<div class="${tableContainerClassName}"><table`);
|
|
206
|
+
};
|
|
207
|
+
vueMarkdownItInstance.renderer.rules.table_close = (tokens, idx, options$1, env, self) => {
|
|
208
|
+
return (defaultTableCloseRenderer?.(tokens, idx, options$1, env, self) ?? self.renderToken(tokens, idx, options$1)).replace("</table>", "</table></div>");
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
return [
|
|
212
|
+
linksNewTabPlugin,
|
|
213
|
+
codeBlockPlugin,
|
|
214
|
+
tablePlugin
|
|
215
|
+
];
|
|
216
|
+
}),
|
|
217
|
+
codeBlockContents
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
var CopyButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
221
|
+
__name: "CopyButton",
|
|
222
|
+
props: { content: {} },
|
|
223
|
+
setup(__props) {
|
|
224
|
+
const i18n = useI18n();
|
|
225
|
+
const clipboard = useClipboard();
|
|
226
|
+
const justCopied = ref(false);
|
|
227
|
+
const copyTooltip = computed(() => {
|
|
228
|
+
return justCopied.value ? i18n.baseText("generic.copied") : i18n.baseText("generic.copy");
|
|
229
|
+
});
|
|
230
|
+
async function handleCopy() {
|
|
231
|
+
await clipboard.copy(__props.content);
|
|
232
|
+
justCopied.value = true;
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
justCopied.value = false;
|
|
235
|
+
}, 1e3);
|
|
236
|
+
}
|
|
237
|
+
return (_ctx, _cache) => {
|
|
238
|
+
return openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
239
|
+
placement: "bottom",
|
|
240
|
+
"show-after": 300
|
|
241
|
+
}, {
|
|
242
|
+
content: withCtx(() => [createTextVNode(toDisplayString(copyTooltip.value), 1)]),
|
|
243
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
244
|
+
icon: justCopied.value ? "check" : "copy",
|
|
245
|
+
type: "tertiary",
|
|
246
|
+
size: "medium",
|
|
247
|
+
text: "",
|
|
248
|
+
class: normalizeClass(_ctx.$style.button),
|
|
249
|
+
tabindex: "0",
|
|
250
|
+
onClick: handleCopy
|
|
251
|
+
}, null, 8, ["icon", "class"])]),
|
|
252
|
+
_: 1
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
var CopyButton_vue_vue_type_style_index_0_lang_module_default = { button: "_button_9m8dh_123" };
|
|
258
|
+
var CopyButton_default = /* @__PURE__ */ __plugin_vue_export_helper_default(CopyButton_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": CopyButton_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
259
|
+
var ChatMessageActions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
260
|
+
__name: "ChatMessageActions",
|
|
261
|
+
props: {
|
|
262
|
+
message: {},
|
|
263
|
+
isSpeechSynthesisAvailable: { type: Boolean },
|
|
264
|
+
isSpeaking: { type: Boolean },
|
|
265
|
+
hasSessionStreaming: { type: Boolean }
|
|
266
|
+
},
|
|
267
|
+
emits: [
|
|
268
|
+
"edit",
|
|
269
|
+
"regenerate",
|
|
270
|
+
"switchAlternative",
|
|
271
|
+
"readAloud"
|
|
272
|
+
],
|
|
273
|
+
setup(__props, { emit: __emit }) {
|
|
274
|
+
const i18n = useI18n();
|
|
275
|
+
const router = useRouter();
|
|
276
|
+
const workflowsStore = useWorkflowsStore();
|
|
277
|
+
const emit = __emit;
|
|
278
|
+
const currentAlternativeIndex = computed(() => {
|
|
279
|
+
return __props.message.alternatives.findIndex((id) => id === __props.message.id);
|
|
280
|
+
});
|
|
281
|
+
const executionUrl = computed(() => {
|
|
282
|
+
if (workflowsStore.canViewWorkflows && __props.message.type === "ai" && __props.message.provider === "n8n" && __props.message.executionId) return router.resolve({
|
|
283
|
+
name: VIEWS.EXECUTION_PREVIEW,
|
|
284
|
+
params: {
|
|
285
|
+
name: __props.message.workflowId,
|
|
286
|
+
executionId: __props.message.executionId
|
|
287
|
+
}
|
|
288
|
+
}).href;
|
|
289
|
+
});
|
|
290
|
+
function handleEdit() {
|
|
291
|
+
emit("edit");
|
|
292
|
+
}
|
|
293
|
+
function handleRegenerate() {
|
|
294
|
+
emit("regenerate");
|
|
295
|
+
}
|
|
296
|
+
function handleReadAloud() {
|
|
297
|
+
emit("readAloud");
|
|
298
|
+
}
|
|
299
|
+
return (_ctx, _cache) => {
|
|
300
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.$style.actions) }, [
|
|
301
|
+
createVNode(CopyButton_default, {
|
|
302
|
+
content: _ctx.message.content,
|
|
303
|
+
"data-test-id": "chat-message-copy"
|
|
304
|
+
}, null, 8, ["content"]),
|
|
305
|
+
_ctx.isSpeechSynthesisAvailable && _ctx.message.type === "ai" ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
306
|
+
key: 0,
|
|
307
|
+
placement: "bottom",
|
|
308
|
+
"show-after": 300
|
|
309
|
+
}, {
|
|
310
|
+
content: withCtx(() => [createTextVNode(toDisplayString(_ctx.isSpeaking ? unref(i18n).baseText("chatHub.message.actions.stopReading") : unref(i18n).baseText("chatHub.message.actions.readAloud")), 1)]),
|
|
311
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
312
|
+
icon: _ctx.isSpeaking ? "volume-x" : "volume-2",
|
|
313
|
+
type: "tertiary",
|
|
314
|
+
size: "medium",
|
|
315
|
+
text: "",
|
|
316
|
+
onClick: handleReadAloud
|
|
317
|
+
}, null, 8, ["icon"])]),
|
|
318
|
+
_: 1
|
|
319
|
+
})) : createCommentVNode("", true),
|
|
320
|
+
_ctx.message.status === "success" ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
321
|
+
key: 1,
|
|
322
|
+
placement: "bottom",
|
|
323
|
+
"show-after": 300
|
|
324
|
+
}, {
|
|
325
|
+
content: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.message.actions.edit")), 1)]),
|
|
326
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
327
|
+
icon: "pen",
|
|
328
|
+
type: "tertiary",
|
|
329
|
+
size: "medium",
|
|
330
|
+
text: "",
|
|
331
|
+
"data-test-id": "chat-message-edit",
|
|
332
|
+
disabled: _ctx.hasSessionStreaming,
|
|
333
|
+
onClick: handleEdit
|
|
334
|
+
}, null, 8, ["disabled"])]),
|
|
335
|
+
_: 1
|
|
336
|
+
})) : createCommentVNode("", true),
|
|
337
|
+
_ctx.message.type === "ai" ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
338
|
+
key: 2,
|
|
339
|
+
placement: "bottom",
|
|
340
|
+
"show-after": 300
|
|
341
|
+
}, {
|
|
342
|
+
content: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.message.actions.regenerate")), 1)]),
|
|
343
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
344
|
+
icon: "refresh-cw",
|
|
345
|
+
type: "tertiary",
|
|
346
|
+
size: "medium",
|
|
347
|
+
text: "",
|
|
348
|
+
"data-test-id": "chat-message-regenerate",
|
|
349
|
+
disabled: _ctx.hasSessionStreaming,
|
|
350
|
+
onClick: handleRegenerate
|
|
351
|
+
}, null, 8, ["disabled"])]),
|
|
352
|
+
_: 1
|
|
353
|
+
})) : createCommentVNode("", true),
|
|
354
|
+
executionUrl.value ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
355
|
+
key: 3,
|
|
356
|
+
placement: "bottom",
|
|
357
|
+
"show-after": 300
|
|
358
|
+
}, {
|
|
359
|
+
content: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.message.actions.executionId")) + ": ", 1), createVNode(unref(N8nLink_default), {
|
|
360
|
+
to: executionUrl.value,
|
|
361
|
+
"new-window": true
|
|
362
|
+
}, {
|
|
363
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.message.executionId), 1)]),
|
|
364
|
+
_: 1
|
|
365
|
+
}, 8, ["to"])]),
|
|
366
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
367
|
+
icon: "info",
|
|
368
|
+
type: "tertiary",
|
|
369
|
+
size: "medium",
|
|
370
|
+
text: "",
|
|
371
|
+
"data-test-id": "chat-message-info"
|
|
372
|
+
})]),
|
|
373
|
+
_: 1
|
|
374
|
+
})) : createCommentVNode("", true),
|
|
375
|
+
_ctx.message.alternatives.length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
376
|
+
createVNode(unref(N8nIconButton_default), {
|
|
377
|
+
icon: "chevron-left",
|
|
378
|
+
type: "tertiary",
|
|
379
|
+
size: "medium",
|
|
380
|
+
text: "",
|
|
381
|
+
disabled: _ctx.hasSessionStreaming || currentAlternativeIndex.value === 0,
|
|
382
|
+
"data-test-id": "chat-message-prev-alternative",
|
|
383
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("switchAlternative", _ctx.message.alternatives[currentAlternativeIndex.value - 1]))
|
|
384
|
+
}, null, 8, ["disabled"]),
|
|
385
|
+
createVNode(unref(N8nText_default), {
|
|
386
|
+
size: "medium",
|
|
387
|
+
color: "text-base"
|
|
388
|
+
}, {
|
|
389
|
+
default: withCtx(() => [createTextVNode(toDisplayString(`${currentAlternativeIndex.value + 1}/${_ctx.message.alternatives.length}`), 1)]),
|
|
390
|
+
_: 1
|
|
391
|
+
}),
|
|
392
|
+
createVNode(unref(N8nIconButton_default), {
|
|
393
|
+
icon: "chevron-right",
|
|
394
|
+
type: "tertiary",
|
|
395
|
+
size: "medium",
|
|
396
|
+
text: "",
|
|
397
|
+
disabled: _ctx.hasSessionStreaming || currentAlternativeIndex.value === _ctx.message.alternatives.length - 1,
|
|
398
|
+
"data-test-id": "chat-message-next-alternative",
|
|
399
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("switchAlternative", _ctx.message.alternatives[currentAlternativeIndex.value + 1]))
|
|
400
|
+
}, null, 8, ["disabled"])
|
|
401
|
+
], 64)) : createCommentVNode("", true)
|
|
402
|
+
], 2);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
var ChatMessageActions_vue_vue_type_style_index_0_lang_module_default = { actions: "_actions_1sizk_123" };
|
|
407
|
+
var ChatMessageActions_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatMessageActions_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatMessageActions_vue_vue_type_style_index_0_lang_module_default }], ["__scopeId", "data-v-28c70984"]]);
|
|
408
|
+
var _hoisted_1$1 = ["data-message-id", "data-test-id"];
|
|
409
|
+
var _hoisted_2 = { key: 2 };
|
|
410
|
+
var _hoisted_3 = { key: 1 };
|
|
411
|
+
var ChatMessage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
412
|
+
__name: "ChatMessage",
|
|
413
|
+
props: {
|
|
414
|
+
message: {},
|
|
415
|
+
compact: { type: Boolean },
|
|
416
|
+
isEditing: { type: Boolean },
|
|
417
|
+
isEditSubmitting: { type: Boolean },
|
|
418
|
+
hasSessionStreaming: { type: Boolean },
|
|
419
|
+
cachedAgentDisplayName: {},
|
|
420
|
+
cachedAgentIcon: {},
|
|
421
|
+
minHeight: {},
|
|
422
|
+
containerWidth: {}
|
|
423
|
+
},
|
|
424
|
+
emits: [
|
|
425
|
+
"startEdit",
|
|
426
|
+
"cancelEdit",
|
|
427
|
+
"update",
|
|
428
|
+
"regenerate",
|
|
429
|
+
"switchAlternative"
|
|
430
|
+
],
|
|
431
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
432
|
+
const emit = __emit;
|
|
433
|
+
const chatStore = useChatStore();
|
|
434
|
+
const rootStore = useRootStore();
|
|
435
|
+
const { isCtrlKeyPressed } = useDeviceSupport();
|
|
436
|
+
const i18n = useI18n();
|
|
437
|
+
const styles = useCssModule();
|
|
438
|
+
const editedText = ref("");
|
|
439
|
+
const newFiles = ref([]);
|
|
440
|
+
const removedExistingIndices = ref(/* @__PURE__ */ new Set());
|
|
441
|
+
const fileInputRef = useTemplateRef("fileInputRef");
|
|
442
|
+
const hoveredCodeBlockActions = ref(null);
|
|
443
|
+
const textareaRef = useTemplateRef("textarea");
|
|
444
|
+
const markdown = useChatHubMarkdownOptions(styles.codeBlockActions, styles.tableContainer);
|
|
445
|
+
const speech = useSpeechSynthesis(computed(() => __props.message.content), {
|
|
446
|
+
pitch: 1,
|
|
447
|
+
rate: 1,
|
|
448
|
+
volume: 1
|
|
449
|
+
});
|
|
450
|
+
const agent = computed(() => {
|
|
451
|
+
const model = unflattenModel(__props.message);
|
|
452
|
+
if (!model) return null;
|
|
453
|
+
return chatStore.getAgent(model, {
|
|
454
|
+
name: __props.cachedAgentDisplayName,
|
|
455
|
+
icon: __props.cachedAgentIcon
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
const attachments$2 = computed(() => __props.message.attachments.map(({ fileName, mimeType }, index) => ({
|
|
459
|
+
file: new File([], fileName ?? "file", { type: mimeType }),
|
|
460
|
+
downloadUrl: buildChatAttachmentUrl(rootStore.restApiContext, __props.message.sessionId, __props.message.id, index)
|
|
461
|
+
})));
|
|
462
|
+
const mergedAttachments = computed(() => [...attachments$2.value.flatMap(({ downloadUrl, file }, idx) => removedExistingIndices.value.has(idx) ? [] : [{
|
|
463
|
+
isNew: false,
|
|
464
|
+
file,
|
|
465
|
+
index: idx,
|
|
466
|
+
downloadUrl
|
|
467
|
+
}]), ...newFiles.value.map((file, index) => ({
|
|
468
|
+
isNew: true,
|
|
469
|
+
file,
|
|
470
|
+
index
|
|
471
|
+
}))]);
|
|
472
|
+
const hideMessage = computed(() => {
|
|
473
|
+
return __props.message.status === "success" && __props.message.content === "";
|
|
474
|
+
});
|
|
475
|
+
const hoveredCodeBlockContent = computed(() => {
|
|
476
|
+
const idx = hoveredCodeBlockActions.value?.getAttribute("data-markdown-token-idx");
|
|
477
|
+
return idx ? markdown.codeBlockContents.value?.get(idx) : void 0;
|
|
478
|
+
});
|
|
479
|
+
function handleEdit() {
|
|
480
|
+
emit("startEdit");
|
|
481
|
+
}
|
|
482
|
+
function handleCancelEdit() {
|
|
483
|
+
emit("cancelEdit");
|
|
484
|
+
}
|
|
485
|
+
function handleConfirmEdit() {
|
|
486
|
+
if (!editedText.value.trim()) return;
|
|
487
|
+
const keptAttachmentIndices = __props.message.attachments.map((_, idx) => idx).filter((idx) => !removedExistingIndices.value.has(idx));
|
|
488
|
+
emit("update", editedText.value, keptAttachmentIndices, newFiles.value);
|
|
489
|
+
}
|
|
490
|
+
function handleAttachClick() {
|
|
491
|
+
fileInputRef.value?.click();
|
|
492
|
+
}
|
|
493
|
+
function handleFileSelect(e) {
|
|
494
|
+
const target = e.target;
|
|
495
|
+
const files = target.files;
|
|
496
|
+
if (!files || files.length === 0) return;
|
|
497
|
+
for (const file of Array.from(files)) newFiles.value.push(file);
|
|
498
|
+
if (target) target.value = "";
|
|
499
|
+
}
|
|
500
|
+
function handleRemoveFile(file) {
|
|
501
|
+
if (file.isNew) {
|
|
502
|
+
newFiles.value = newFiles.value.filter((_, idx) => idx !== file.index);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
removedExistingIndices.value.add(file.index);
|
|
506
|
+
}
|
|
507
|
+
function addFiles(files) {
|
|
508
|
+
for (const file of files) newFiles.value.push(file);
|
|
509
|
+
}
|
|
510
|
+
__expose({ addFiles });
|
|
511
|
+
function handleKeydownTextarea(e) {
|
|
512
|
+
if (e.key === "Escape") {
|
|
513
|
+
emit("cancelEdit");
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const trimmed = editedText.value.trim();
|
|
517
|
+
if (e.key === "Enter" && isCtrlKeyPressed(e) && !e.isComposing && trimmed) {
|
|
518
|
+
e.preventDefault();
|
|
519
|
+
handleConfirmEdit();
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
function handleRegenerate() {
|
|
523
|
+
emit("regenerate", __props.message);
|
|
524
|
+
}
|
|
525
|
+
function handleReadAloud() {
|
|
526
|
+
if (speech.isSupported.value) if (speech.isPlaying.value) speech.stop();
|
|
527
|
+
else speech.speak();
|
|
528
|
+
}
|
|
529
|
+
function handleSwitchAlternative(messageId) {
|
|
530
|
+
emit("switchAlternative", messageId);
|
|
531
|
+
}
|
|
532
|
+
function handleMouseMove(e) {
|
|
533
|
+
const container = e.target instanceof HTMLElement || e.target instanceof SVGElement ? e.target.closest("pre")?.querySelector(`.${styles.codeBlockActions}`) : null;
|
|
534
|
+
hoveredCodeBlockActions.value = container instanceof HTMLElement ? container : null;
|
|
535
|
+
}
|
|
536
|
+
function handleMouseLeave() {
|
|
537
|
+
hoveredCodeBlockActions.value = null;
|
|
538
|
+
}
|
|
539
|
+
watch(() => __props.isEditing, (editing) => {
|
|
540
|
+
editedText.value = editing ? __props.message.content : "";
|
|
541
|
+
newFiles.value = [];
|
|
542
|
+
removedExistingIndices.value = /* @__PURE__ */ new Set();
|
|
543
|
+
}, { immediate: true });
|
|
544
|
+
watch(textareaRef, async (textarea$1) => {
|
|
545
|
+
if (textarea$1) {
|
|
546
|
+
await new Promise((r) => setTimeout(r, 0));
|
|
547
|
+
textarea$1.focus();
|
|
548
|
+
textarea$1.$el.scrollIntoView({ block: "nearest" });
|
|
549
|
+
}
|
|
550
|
+
}, {
|
|
551
|
+
immediate: true,
|
|
552
|
+
flush: "post"
|
|
553
|
+
});
|
|
554
|
+
onBeforeMount(() => {
|
|
555
|
+
speech.stop();
|
|
556
|
+
});
|
|
557
|
+
return (_ctx, _cache) => {
|
|
558
|
+
return !hideMessage.value ? (openBlock(), createElementBlock("div", {
|
|
559
|
+
key: 0,
|
|
560
|
+
class: normalizeClass([
|
|
561
|
+
_ctx.$style.message,
|
|
562
|
+
_ctx.message.type === "human" ? _ctx.$style.user : _ctx.$style.assistant,
|
|
563
|
+
{ [_ctx.$style.compact]: _ctx.compact }
|
|
564
|
+
]),
|
|
565
|
+
style: normalizeStyle({
|
|
566
|
+
minHeight: _ctx.minHeight ? `${_ctx.minHeight}px` : void 0,
|
|
567
|
+
"--container--width": `${_ctx.containerWidth}px`
|
|
568
|
+
}),
|
|
569
|
+
"data-message-id": _ctx.message.id,
|
|
570
|
+
"data-test-id": `chat-message-${_ctx.message.id}`
|
|
571
|
+
}, [
|
|
572
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.avatar) }, [_ctx.message.type === "human" ? (openBlock(), createBlock(unref(N8nIcon_default), {
|
|
573
|
+
key: 0,
|
|
574
|
+
icon: "user",
|
|
575
|
+
width: "20",
|
|
576
|
+
height: "20"
|
|
577
|
+
})) : (openBlock(), createBlock(ChatAgentAvatar_default, {
|
|
578
|
+
key: 1,
|
|
579
|
+
agent: agent.value,
|
|
580
|
+
size: "md",
|
|
581
|
+
tooltip: ""
|
|
582
|
+
}, null, 8, ["agent"]))], 2),
|
|
583
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.content) }, [_ctx.message.type === "human" ? (openBlock(), createElementBlock("input", {
|
|
584
|
+
key: 0,
|
|
585
|
+
ref_key: "fileInputRef",
|
|
586
|
+
ref: fileInputRef,
|
|
587
|
+
type: "file",
|
|
588
|
+
"data-test-id": "message-edit-file-input",
|
|
589
|
+
class: normalizeClass(_ctx.$style.fileInput),
|
|
590
|
+
multiple: "",
|
|
591
|
+
onChange: handleFileSelect
|
|
592
|
+
}, null, 34)) : createCommentVNode("", true), _ctx.isEditing ? (openBlock(), createElementBlock("div", {
|
|
593
|
+
key: 1,
|
|
594
|
+
class: normalizeClass(_ctx.$style.editContainer)
|
|
595
|
+
}, [
|
|
596
|
+
_ctx.message.type === "human" && mergedAttachments.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
597
|
+
key: 0,
|
|
598
|
+
class: normalizeClass(_ctx.$style.attachments)
|
|
599
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(mergedAttachments.value, (attachment, index) => {
|
|
600
|
+
return openBlock(), createBlock(ChatFile_default, {
|
|
601
|
+
key: index,
|
|
602
|
+
file: attachment.file,
|
|
603
|
+
"is-removable": "",
|
|
604
|
+
href: attachment.isNew ? void 0 : attachment.downloadUrl,
|
|
605
|
+
onRemove: ($event) => handleRemoveFile(attachment)
|
|
606
|
+
}, null, 8, [
|
|
607
|
+
"file",
|
|
608
|
+
"href",
|
|
609
|
+
"onRemove"
|
|
610
|
+
]);
|
|
611
|
+
}), 128))], 2)) : createCommentVNode("", true),
|
|
612
|
+
createVNode(unref(N8nInput_default), {
|
|
613
|
+
ref: "textarea",
|
|
614
|
+
modelValue: editedText.value,
|
|
615
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => editedText.value = $event),
|
|
616
|
+
type: "textarea",
|
|
617
|
+
autosize: {
|
|
618
|
+
minRows: 1,
|
|
619
|
+
maxRows: 20
|
|
620
|
+
},
|
|
621
|
+
class: normalizeClass(_ctx.$style.textarea),
|
|
622
|
+
onKeydown: handleKeydownTextarea
|
|
623
|
+
}, null, 8, ["modelValue", "class"]),
|
|
624
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.editFooter) }, [_ctx.message.type === "human" ? (openBlock(), createBlock(unref(N8nIconButton_default), {
|
|
625
|
+
key: 0,
|
|
626
|
+
"native-type": "button",
|
|
627
|
+
type: "secondary",
|
|
628
|
+
icon: "paperclip",
|
|
629
|
+
text: "",
|
|
630
|
+
onClick: withModifiers(handleAttachClick, ["stop"])
|
|
631
|
+
})) : createCommentVNode("", true), createBaseVNode("div", { class: normalizeClass(_ctx.$style.editActions) }, [createVNode(unref(N8nButton_default), {
|
|
632
|
+
type: "secondary",
|
|
633
|
+
size: "small",
|
|
634
|
+
onClick: handleCancelEdit
|
|
635
|
+
}, {
|
|
636
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.message.edit.cancel")), 1)]),
|
|
637
|
+
_: 1
|
|
638
|
+
}), createVNode(unref(N8nButton_default), {
|
|
639
|
+
type: "primary",
|
|
640
|
+
size: "small",
|
|
641
|
+
disabled: !editedText.value.trim() || _ctx.isEditSubmitting,
|
|
642
|
+
loading: _ctx.isEditSubmitting,
|
|
643
|
+
onClick: handleConfirmEdit
|
|
644
|
+
}, {
|
|
645
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.message.edit.send")), 1)]),
|
|
646
|
+
_: 1
|
|
647
|
+
}, 8, ["disabled", "loading"])], 2)], 2)
|
|
648
|
+
], 2)) : (openBlock(), createElementBlock("div", _hoisted_2, [createBaseVNode("div", {
|
|
649
|
+
class: normalizeClass([_ctx.$style.chatMessage, { [_ctx.$style.errorMessage]: _ctx.message.status === "error" }]),
|
|
650
|
+
onMousemove: handleMouseMove,
|
|
651
|
+
onMouseleave: handleMouseLeave
|
|
652
|
+
}, [attachments$2.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
653
|
+
key: 0,
|
|
654
|
+
class: normalizeClass(_ctx.$style.attachments)
|
|
655
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(attachments$2.value, (attachment, index) => {
|
|
656
|
+
return openBlock(), createBlock(ChatFile_default, {
|
|
657
|
+
key: index,
|
|
658
|
+
file: attachment.file,
|
|
659
|
+
"is-removable": false,
|
|
660
|
+
href: attachment.downloadUrl
|
|
661
|
+
}, null, 8, ["file", "href"]);
|
|
662
|
+
}), 128))], 2)) : createCommentVNode("", true), _ctx.message.type === "human" ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(_ctx.message.content), 1)) : (openBlock(), createBlock(unref(VueMarkdown_default), {
|
|
663
|
+
key: unref(markdown).forceReRenderKey.value,
|
|
664
|
+
class: normalizeClass([_ctx.$style.chatMessageMarkdown, "chat-message-markdown"]),
|
|
665
|
+
source: _ctx.message.status === "error" && !_ctx.message.content ? unref(i18n).baseText("chatHub.message.error.unknown") : _ctx.message.content,
|
|
666
|
+
options: unref(markdown).options,
|
|
667
|
+
plugins: unref(markdown).plugins.value
|
|
668
|
+
}, null, 8, [
|
|
669
|
+
"class",
|
|
670
|
+
"source",
|
|
671
|
+
"options",
|
|
672
|
+
"plugins"
|
|
673
|
+
]))], 34), _ctx.message.status === "running" ? (openBlock(), createBlock(ChatTypingIndicator_default, {
|
|
674
|
+
key: 0,
|
|
675
|
+
class: normalizeClass(_ctx.$style.typingIndicator)
|
|
676
|
+
}, null, 8, ["class"])) : (openBlock(), createBlock(ChatMessageActions_default, {
|
|
677
|
+
key: 1,
|
|
678
|
+
"is-speech-synthesis-available": unref(speech).isSupported.value,
|
|
679
|
+
"is-speaking": unref(speech).isPlaying.value,
|
|
680
|
+
class: normalizeClass(_ctx.$style.actions),
|
|
681
|
+
message: _ctx.message,
|
|
682
|
+
"has-session-streaming": _ctx.hasSessionStreaming,
|
|
683
|
+
onEdit: handleEdit,
|
|
684
|
+
onRegenerate: handleRegenerate,
|
|
685
|
+
onReadAloud: handleReadAloud,
|
|
686
|
+
onSwitchAlternative: handleSwitchAlternative
|
|
687
|
+
}, null, 8, [
|
|
688
|
+
"is-speech-synthesis-available",
|
|
689
|
+
"is-speaking",
|
|
690
|
+
"class",
|
|
691
|
+
"message",
|
|
692
|
+
"has-session-streaming"
|
|
693
|
+
]))]))], 2),
|
|
694
|
+
hoveredCodeBlockActions.value && hoveredCodeBlockContent.value ? (openBlock(), createBlock(Teleport, {
|
|
695
|
+
key: 0,
|
|
696
|
+
to: hoveredCodeBlockActions.value
|
|
697
|
+
}, [createVNode(CopyButton_default, { content: hoveredCodeBlockContent.value }, null, 8, ["content"])], 8, ["to"])) : createCommentVNode("", true)
|
|
698
|
+
], 14, _hoisted_1$1)) : createCommentVNode("", true);
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
var ChatMessage_vue_vue_type_style_index_0_lang_module_default = {
|
|
703
|
+
message: "_message_o9qnd_123",
|
|
704
|
+
avatar: "_avatar_o9qnd_128",
|
|
705
|
+
compact: "_compact_o9qnd_141",
|
|
706
|
+
content: "_content_o9qnd_146",
|
|
707
|
+
attachments: "_attachments_o9qnd_151",
|
|
708
|
+
chatMessage: "_chatMessage_o9qnd_156",
|
|
709
|
+
user: "_user_o9qnd_170",
|
|
710
|
+
errorMessage: "_errorMessage_o9qnd_177",
|
|
711
|
+
chatMessageMarkdown: "_chatMessageMarkdown_o9qnd_185",
|
|
712
|
+
codeBlockActions: "_codeBlockActions_o9qnd_250",
|
|
713
|
+
tableContainer: "_tableContainer_o9qnd_259",
|
|
714
|
+
actions: "_actions_o9qnd_288",
|
|
715
|
+
editContainer: "_editContainer_o9qnd_292",
|
|
716
|
+
textarea: "_textarea_o9qnd_307",
|
|
717
|
+
fileInput: "_fileInput_o9qnd_320",
|
|
718
|
+
editFooter: "_editFooter_o9qnd_324",
|
|
719
|
+
editActions: "_editActions_o9qnd_330",
|
|
720
|
+
typingIndicator: "_typingIndicator_o9qnd_336"
|
|
721
|
+
};
|
|
722
|
+
var ChatMessage_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatMessage_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatMessage_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
723
|
+
var _hoisted_1 = ["accept"];
|
|
724
|
+
var ChatPrompt_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
725
|
+
__name: "ChatPrompt",
|
|
726
|
+
props: {
|
|
727
|
+
messagingState: {},
|
|
728
|
+
isNewSession: { type: Boolean },
|
|
729
|
+
isToolsSelectable: { type: Boolean },
|
|
730
|
+
selectedModel: {},
|
|
731
|
+
selectedTools: {}
|
|
732
|
+
},
|
|
733
|
+
emits: [
|
|
734
|
+
"submit",
|
|
735
|
+
"stop",
|
|
736
|
+
"selectModel",
|
|
737
|
+
"selectTools",
|
|
738
|
+
"setCredentials",
|
|
739
|
+
"editAgent"
|
|
740
|
+
],
|
|
741
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
742
|
+
const emit = __emit;
|
|
743
|
+
const inputRef = useTemplateRef("inputRef");
|
|
744
|
+
const fileInputRef = useTemplateRef("fileInputRef");
|
|
745
|
+
const message$1 = ref("");
|
|
746
|
+
const committedSpokenMessage = ref("");
|
|
747
|
+
const attachments$2 = ref([]);
|
|
748
|
+
const toast = useToast();
|
|
749
|
+
const i18n = useI18n();
|
|
750
|
+
const uiStore = useUIStore();
|
|
751
|
+
const speechInput = useSpeechRecognition({
|
|
752
|
+
continuous: true,
|
|
753
|
+
interimResults: true,
|
|
754
|
+
lang: navigator.language
|
|
755
|
+
});
|
|
756
|
+
const placeholder = computed(() => {
|
|
757
|
+
if (__props.selectedModel) return i18n.baseText("chatHub.chat.prompt.placeholder.withModel", { interpolate: { model: __props.selectedModel.name ?? "a model" } });
|
|
758
|
+
return i18n.baseText("chatHub.chat.prompt.placeholder.selectModel");
|
|
759
|
+
});
|
|
760
|
+
const llmProvider = computed(() => isLlmProviderModel(__props.selectedModel?.model) ? __props.selectedModel?.model.provider : void 0);
|
|
761
|
+
const acceptedMimeTypes = computed(() => createMimeTypes(__props.selectedModel?.metadata.inputModalities ?? []));
|
|
762
|
+
const canUploadFiles = computed(() => !!acceptedMimeTypes.value);
|
|
763
|
+
function onMic() {
|
|
764
|
+
committedSpokenMessage.value = message$1.value;
|
|
765
|
+
if (speechInput.isListening.value) speechInput.stop();
|
|
766
|
+
else speechInput.start();
|
|
767
|
+
}
|
|
768
|
+
function onStop() {
|
|
769
|
+
emit("stop");
|
|
770
|
+
}
|
|
771
|
+
function onAttach() {
|
|
772
|
+
fileInputRef.value?.click();
|
|
773
|
+
}
|
|
774
|
+
function handleFileSelect(e) {
|
|
775
|
+
const target = e.target;
|
|
776
|
+
const files = target.files;
|
|
777
|
+
if (!files || files.length === 0) return;
|
|
778
|
+
for (const file of Array.from(files)) attachments$2.value.push(file);
|
|
779
|
+
if (target) target.value = "";
|
|
780
|
+
inputRef.value?.focus();
|
|
781
|
+
}
|
|
782
|
+
function removeAttachment(removed) {
|
|
783
|
+
attachments$2.value = attachments$2.value.filter((attachment) => attachment !== removed);
|
|
784
|
+
}
|
|
785
|
+
function handleSubmitForm() {
|
|
786
|
+
const trimmed = message$1.value.trim();
|
|
787
|
+
if (trimmed) {
|
|
788
|
+
speechInput.stop();
|
|
789
|
+
emit("submit", trimmed, attachments$2.value);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
function handleKeydownTextarea(e) {
|
|
793
|
+
const trimmed = message$1.value.trim();
|
|
794
|
+
speechInput.stop();
|
|
795
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing && trimmed) {
|
|
796
|
+
e.preventDefault();
|
|
797
|
+
speechInput.stop();
|
|
798
|
+
emit("submit", trimmed, attachments$2.value);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
function handleClickInputWrapper() {
|
|
802
|
+
inputRef.value?.focus();
|
|
803
|
+
}
|
|
804
|
+
watch(speechInput.result, (spoken) => {
|
|
805
|
+
message$1.value = committedSpokenMessage.value + " " + spoken.trimStart();
|
|
806
|
+
});
|
|
807
|
+
watch(speechInput.isFinal, (final) => {
|
|
808
|
+
if (final) committedSpokenMessage.value = message$1.value;
|
|
809
|
+
}, { flush: "post" });
|
|
810
|
+
watch(speechInput.error, (event) => {
|
|
811
|
+
if (event?.error === "not-allowed") {
|
|
812
|
+
toast.showError(new Error(i18n.baseText("chatHub.chat.prompt.microphone.accessDenied")), i18n.baseText("chatHub.chat.prompt.microphone.allowAccess"));
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (event?.error === "no-speech") toast.showMessage({
|
|
816
|
+
title: i18n.baseText("chatHub.chat.prompt.microphone.noSpeech"),
|
|
817
|
+
type: "warning"
|
|
818
|
+
});
|
|
819
|
+
});
|
|
820
|
+
function onSelectTools() {
|
|
821
|
+
if (__props.selectedModel?.model.provider === "custom-agent") {
|
|
822
|
+
emit("editAgent", __props.selectedModel.model.agentId);
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
uiStore.openModalWithData({
|
|
826
|
+
name: TOOLS_SELECTOR_MODAL_KEY,
|
|
827
|
+
data: {
|
|
828
|
+
selected: __props.selectedTools,
|
|
829
|
+
onConfirm: (newTools) => emit("selectTools", newTools)
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
__expose({
|
|
834
|
+
focus: () => inputRef.value?.focus(),
|
|
835
|
+
reset: () => {
|
|
836
|
+
message$1.value = "";
|
|
837
|
+
committedSpokenMessage.value = "";
|
|
838
|
+
attachments$2.value = [];
|
|
839
|
+
},
|
|
840
|
+
setText: (text) => {
|
|
841
|
+
message$1.value = text;
|
|
842
|
+
},
|
|
843
|
+
addAttachments: (files) => {
|
|
844
|
+
attachments$2.value.push(...files);
|
|
845
|
+
inputRef.value?.focus();
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
return (_ctx, _cache) => {
|
|
849
|
+
return openBlock(), createElementBlock("form", {
|
|
850
|
+
class: normalizeClass(_ctx.$style.prompt),
|
|
851
|
+
onSubmit: withModifiers(handleSubmitForm, ["prevent"])
|
|
852
|
+
}, [createBaseVNode("div", { class: normalizeClass(_ctx.$style.inputWrap) }, [
|
|
853
|
+
_ctx.messagingState === "missingAgent" ? (openBlock(), createBlock(unref(N8nText_default), {
|
|
854
|
+
key: 0,
|
|
855
|
+
class: normalizeClass(_ctx.$style.callout)
|
|
856
|
+
}, {
|
|
857
|
+
default: withCtx(() => [createVNode(unref(I18nT), {
|
|
858
|
+
keypath: _ctx.isNewSession ? "chatHub.chat.prompt.callout.selectModel.new" : "chatHub.chat.prompt.callout.selectModel.existing",
|
|
859
|
+
tag: "span",
|
|
860
|
+
scope: "global"
|
|
861
|
+
}, {
|
|
862
|
+
link: withCtx(() => [createBaseVNode("a", {
|
|
863
|
+
href: "",
|
|
864
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("selectModel"), ["prevent"]))
|
|
865
|
+
}, toDisplayString(unref(i18n).baseText(_ctx.isNewSession ? "chatHub.chat.prompt.callout.selectModel.new.link" : "chatHub.chat.prompt.callout.selectModel.existing.link")), 1)]),
|
|
866
|
+
_: 1
|
|
867
|
+
}, 8, ["keypath"])]),
|
|
868
|
+
_: 1
|
|
869
|
+
}, 8, ["class"])) : _ctx.messagingState === "missingCredentials" && llmProvider.value ? (openBlock(), createBlock(unref(N8nText_default), {
|
|
870
|
+
key: 1,
|
|
871
|
+
class: normalizeClass(_ctx.$style.callout)
|
|
872
|
+
}, {
|
|
873
|
+
default: withCtx(() => [createVNode(unref(I18nT), {
|
|
874
|
+
keypath: _ctx.isNewSession ? "chatHub.chat.prompt.callout.setCredentials.new" : "chatHub.chat.prompt.callout.setCredentials.existing",
|
|
875
|
+
tag: "span",
|
|
876
|
+
scope: "global"
|
|
877
|
+
}, {
|
|
878
|
+
link: withCtx(() => [createBaseVNode("a", {
|
|
879
|
+
href: "",
|
|
880
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("setCredentials", llmProvider.value), ["prevent"]))
|
|
881
|
+
}, toDisplayString(unref(i18n).baseText(_ctx.isNewSession ? "chatHub.chat.prompt.callout.setCredentials.new.link" : "chatHub.chat.prompt.callout.setCredentials.existing.link")), 1)]),
|
|
882
|
+
provider: withCtx(() => [createTextVNode(toDisplayString(unref(providerDisplayNames)[llmProvider.value]), 1)]),
|
|
883
|
+
_: 1
|
|
884
|
+
}, 8, ["keypath"])]),
|
|
885
|
+
_: 1
|
|
886
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
887
|
+
createBaseVNode("input", {
|
|
888
|
+
ref_key: "fileInputRef",
|
|
889
|
+
ref: fileInputRef,
|
|
890
|
+
type: "file",
|
|
891
|
+
class: normalizeClass(_ctx.$style.fileInput),
|
|
892
|
+
accept: acceptedMimeTypes.value,
|
|
893
|
+
multiple: "",
|
|
894
|
+
onChange: handleFileSelect
|
|
895
|
+
}, null, 42, _hoisted_1),
|
|
896
|
+
createBaseVNode("div", {
|
|
897
|
+
class: normalizeClass(_ctx.$style.inputWrapper),
|
|
898
|
+
onClick: handleClickInputWrapper
|
|
899
|
+
}, [
|
|
900
|
+
attachments$2.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
901
|
+
key: 0,
|
|
902
|
+
class: normalizeClass(_ctx.$style.attachments)
|
|
903
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(attachments$2.value, (file, index) => {
|
|
904
|
+
return openBlock(), createBlock(ChatFile_default, {
|
|
905
|
+
key: index,
|
|
906
|
+
file,
|
|
907
|
+
"is-previewable": true,
|
|
908
|
+
"is-removable": _ctx.messagingState === "idle",
|
|
909
|
+
onRemove: removeAttachment
|
|
910
|
+
}, null, 8, ["file", "is-removable"]);
|
|
911
|
+
}), 128))], 2)) : createCommentVNode("", true),
|
|
912
|
+
createVNode(unref(N8nInput_default), {
|
|
913
|
+
ref_key: "inputRef",
|
|
914
|
+
ref: inputRef,
|
|
915
|
+
modelValue: message$1.value,
|
|
916
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => message$1.value = $event),
|
|
917
|
+
type: "textarea",
|
|
918
|
+
placeholder: placeholder.value,
|
|
919
|
+
autocomplete: "off",
|
|
920
|
+
autosize: {
|
|
921
|
+
minRows: 1,
|
|
922
|
+
maxRows: 6
|
|
923
|
+
},
|
|
924
|
+
autofocus: "",
|
|
925
|
+
disabled: _ctx.messagingState !== "idle",
|
|
926
|
+
onKeydown: handleKeydownTextarea
|
|
927
|
+
}, null, 8, [
|
|
928
|
+
"modelValue",
|
|
929
|
+
"placeholder",
|
|
930
|
+
"disabled"
|
|
931
|
+
]),
|
|
932
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.footer) }, [createBaseVNode("div", { class: normalizeClass(_ctx.$style.tools) }, [createVNode(ToolsSelector_default, {
|
|
933
|
+
class: normalizeClass(_ctx.$style.toolsButton),
|
|
934
|
+
selected: _ctx.selectedTools ?? [],
|
|
935
|
+
disabled: _ctx.messagingState !== "idle" || !_ctx.isToolsSelectable,
|
|
936
|
+
"disabled-tooltip": _ctx.isToolsSelectable ? void 0 : unref(i18n).baseText("chatHub.tools.selector.disabled.tooltip"),
|
|
937
|
+
"transparent-bg": "",
|
|
938
|
+
onClick: onSelectTools
|
|
939
|
+
}, null, 8, [
|
|
940
|
+
"class",
|
|
941
|
+
"selected",
|
|
942
|
+
"disabled",
|
|
943
|
+
"disabled-tooltip"
|
|
944
|
+
])], 2), createBaseVNode("div", { class: normalizeClass(_ctx.$style.actions) }, [
|
|
945
|
+
createVNode(unref(N8nTooltip_default), {
|
|
946
|
+
content: !canUploadFiles.value ? unref(i18n).baseText("chatHub.chat.prompt.button.attach.disabled") : unref(i18n).baseText("chatHub.chat.prompt.button.attach"),
|
|
947
|
+
disabled: canUploadFiles.value && _ctx.messagingState === "idle",
|
|
948
|
+
placement: "top"
|
|
949
|
+
}, {
|
|
950
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
951
|
+
"native-type": "button",
|
|
952
|
+
type: "secondary",
|
|
953
|
+
disabled: _ctx.messagingState !== "idle" || !canUploadFiles.value,
|
|
954
|
+
icon: "paperclip",
|
|
955
|
+
"icon-size": "large",
|
|
956
|
+
text: "",
|
|
957
|
+
onClick: withModifiers(onAttach, ["stop"])
|
|
958
|
+
}, null, 8, ["disabled"])]),
|
|
959
|
+
_: 1
|
|
960
|
+
}, 8, ["content", "disabled"]),
|
|
961
|
+
unref(speechInput).isSupported ? (openBlock(), createBlock(unref(N8nIconButton_default), {
|
|
962
|
+
key: 0,
|
|
963
|
+
"native-type": "button",
|
|
964
|
+
title: unref(speechInput).isListening.value ? unref(i18n).baseText("chatHub.chat.prompt.button.stopRecording") : unref(i18n).baseText("chatHub.chat.prompt.button.voiceInput"),
|
|
965
|
+
type: "secondary",
|
|
966
|
+
disabled: _ctx.messagingState !== "idle",
|
|
967
|
+
icon: unref(speechInput).isListening.value ? "square" : "mic",
|
|
968
|
+
class: normalizeClass({ [_ctx.$style.recording]: unref(speechInput).isListening.value }),
|
|
969
|
+
"icon-size": "large",
|
|
970
|
+
onClick: withModifiers(onMic, ["stop"])
|
|
971
|
+
}, null, 8, [
|
|
972
|
+
"title",
|
|
973
|
+
"disabled",
|
|
974
|
+
"icon",
|
|
975
|
+
"class"
|
|
976
|
+
])) : createCommentVNode("", true),
|
|
977
|
+
_ctx.messagingState !== "receiving" ? (openBlock(), createBlock(unref(N8nIconButton_default), {
|
|
978
|
+
key: 1,
|
|
979
|
+
"native-type": "submit",
|
|
980
|
+
disabled: _ctx.messagingState !== "idle" || !message$1.value.trim(),
|
|
981
|
+
title: unref(i18n).baseText("chatHub.chat.prompt.button.send"),
|
|
982
|
+
loading: _ctx.messagingState === "waitingFirstChunk",
|
|
983
|
+
icon: "arrow-up",
|
|
984
|
+
"icon-size": "large",
|
|
985
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
|
|
986
|
+
}, null, 8, [
|
|
987
|
+
"disabled",
|
|
988
|
+
"title",
|
|
989
|
+
"loading"
|
|
990
|
+
])) : (openBlock(), createBlock(unref(N8nIconButton_default), {
|
|
991
|
+
key: 2,
|
|
992
|
+
"native-type": "button",
|
|
993
|
+
title: unref(i18n).baseText("chatHub.chat.prompt.button.stopGenerating"),
|
|
994
|
+
icon: "square",
|
|
995
|
+
"icon-size": "large",
|
|
996
|
+
onClick: withModifiers(onStop, ["stop"])
|
|
997
|
+
}, null, 8, ["title"]))
|
|
998
|
+
], 2)], 2)
|
|
999
|
+
], 2)
|
|
1000
|
+
], 2)], 34);
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
var ChatPrompt_vue_vue_type_style_index_0_lang_module_default = {
|
|
1005
|
+
prompt: "_prompt_b2qw2_123",
|
|
1006
|
+
inputWrap: "_inputWrap_b2qw2_128",
|
|
1007
|
+
callout: "_callout_b2qw2_136",
|
|
1008
|
+
fileInput: "_fileInput_b2qw2_153",
|
|
1009
|
+
inputWrapper: "_inputWrapper_b2qw2_157",
|
|
1010
|
+
footer: "_footer_b2qw2_181",
|
|
1011
|
+
tools: "_tools_b2qw2_188",
|
|
1012
|
+
toolsButton: "_toolsButton_b2qw2_192",
|
|
1013
|
+
iconStack: "_iconStack_b2qw2_197",
|
|
1014
|
+
icon: "_icon_b2qw2_197",
|
|
1015
|
+
iconOverlap: "_iconOverlap_b2qw2_210",
|
|
1016
|
+
iconFallback: "_iconFallback_b2qw2_214",
|
|
1017
|
+
actions: "_actions_b2qw2_220",
|
|
1018
|
+
attachments: "_attachments_b2qw2_229",
|
|
1019
|
+
recording: "_recording_b2qw2_235",
|
|
1020
|
+
chatHubPromptRecordingPulse: "_chatHubPromptRecordingPulse_b2qw2_1"
|
|
1021
|
+
};
|
|
1022
|
+
var ChatPrompt_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatPrompt_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatPrompt_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1023
|
+
var ChatStarter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1024
|
+
__name: "ChatStarter",
|
|
1025
|
+
props: { isMobileDevice: { type: Boolean } },
|
|
1026
|
+
setup(__props) {
|
|
1027
|
+
const userStore = useUsersStore();
|
|
1028
|
+
const i18n = useI18n();
|
|
1029
|
+
const greetings = computed(() => {
|
|
1030
|
+
const name = userStore.currentUser?.firstName ?? userStore.currentUser?.fullName ?? i18n.baseText("chatHub.chat.greeting.fallback");
|
|
1031
|
+
return i18n.baseText("chatHub.chat.greeting", { interpolate: { name } });
|
|
1032
|
+
});
|
|
1033
|
+
return (_ctx, _cache) => {
|
|
1034
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass([_ctx.$style.starter, { [_ctx.$style.isMobileDevice]: _ctx.isMobileDevice }]) }, [createVNode(unref(N8nHeading_default), {
|
|
1035
|
+
tag: "h2",
|
|
1036
|
+
bold: "",
|
|
1037
|
+
size: "xlarge"
|
|
1038
|
+
}, {
|
|
1039
|
+
default: withCtx(() => [createTextVNode(toDisplayString(greetings.value), 1)]),
|
|
1040
|
+
_: 1
|
|
1041
|
+
})], 2);
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
var ChatStarter_vue_vue_type_style_index_0_lang_module_default = {
|
|
1046
|
+
starter: "_starter_1julh_123",
|
|
1047
|
+
card: "_card_1julh_131",
|
|
1048
|
+
cardIcon: "_cardIcon_1julh_149",
|
|
1049
|
+
cardText: "_cardText_1julh_155"
|
|
1050
|
+
};
|
|
1051
|
+
var ChatStarter_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatStarter_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatStarter_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1052
|
+
function useFileDrop(canAcceptFiles, onFilesDropped) {
|
|
1053
|
+
const isDragging = ref(false);
|
|
1054
|
+
function handleDragEnter(e) {
|
|
1055
|
+
if (!canAcceptFiles.value) return;
|
|
1056
|
+
if (e.dataTransfer?.types.includes("Files")) isDragging.value = true;
|
|
1057
|
+
}
|
|
1058
|
+
function handleDragLeave(e) {
|
|
1059
|
+
if (!canAcceptFiles.value) return;
|
|
1060
|
+
const target = e.currentTarget;
|
|
1061
|
+
const relatedTarget = e.relatedTarget;
|
|
1062
|
+
if (relatedTarget && target.contains(relatedTarget)) return;
|
|
1063
|
+
isDragging.value = false;
|
|
1064
|
+
}
|
|
1065
|
+
function handleDragOver(e) {
|
|
1066
|
+
if (!canAcceptFiles.value) return;
|
|
1067
|
+
e.preventDefault();
|
|
1068
|
+
e.stopPropagation();
|
|
1069
|
+
}
|
|
1070
|
+
function handleDrop(e) {
|
|
1071
|
+
e.preventDefault();
|
|
1072
|
+
e.stopPropagation();
|
|
1073
|
+
isDragging.value = false;
|
|
1074
|
+
if (!canAcceptFiles.value) return;
|
|
1075
|
+
const files = e.dataTransfer?.files;
|
|
1076
|
+
if (!files || files.length === 0) return;
|
|
1077
|
+
onFilesDropped(Array.from(files));
|
|
1078
|
+
}
|
|
1079
|
+
function handlePaste(e) {
|
|
1080
|
+
if (!canAcceptFiles.value) return;
|
|
1081
|
+
const items = e.clipboardData?.items;
|
|
1082
|
+
if (!items) return;
|
|
1083
|
+
let hasFiles = false;
|
|
1084
|
+
const files = [];
|
|
1085
|
+
for (const item of Array.from(items)) if (item.kind === "file") {
|
|
1086
|
+
const file = item.getAsFile();
|
|
1087
|
+
if (file) {
|
|
1088
|
+
files.push(file);
|
|
1089
|
+
hasFiles = true;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
if (hasFiles) {
|
|
1093
|
+
e.preventDefault();
|
|
1094
|
+
onFilesDropped(files);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return {
|
|
1098
|
+
isDragging,
|
|
1099
|
+
handleDragEnter,
|
|
1100
|
+
handleDragLeave,
|
|
1101
|
+
handleDragOver,
|
|
1102
|
+
handleDrop,
|
|
1103
|
+
handlePaste
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
var ChatView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1107
|
+
__name: "ChatView",
|
|
1108
|
+
setup(__props) {
|
|
1109
|
+
const router = useRouter();
|
|
1110
|
+
const route = useRoute();
|
|
1111
|
+
const usersStore = useUsersStore();
|
|
1112
|
+
const chatStore = useChatStore();
|
|
1113
|
+
const settingsStore = useSettingsStore();
|
|
1114
|
+
const toast = useToast();
|
|
1115
|
+
const isMobileDevice$1 = useMediaQuery(MOBILE_MEDIA_QUERY);
|
|
1116
|
+
const documentTitle = useDocumentTitle();
|
|
1117
|
+
const uiStore = useUIStore();
|
|
1118
|
+
const i18n = useI18n();
|
|
1119
|
+
const headerRef = useTemplateRef("headerRef");
|
|
1120
|
+
const inputRef = useTemplateRef("inputRef");
|
|
1121
|
+
const scrollableRef = useTemplateRef("scrollable");
|
|
1122
|
+
const scrollableSize = useElementSize(scrollableRef);
|
|
1123
|
+
const sessionId = computed(() => typeof route.params.id === "string" ? route.params.id : v4_default());
|
|
1124
|
+
const isResponding = computed(() => chatStore.isResponding(sessionId.value));
|
|
1125
|
+
const isNewSession$1 = computed(() => sessionId.value !== route.params.id);
|
|
1126
|
+
const scrollContainerRef = computed(() => scrollableRef.value?.parentElement ?? null);
|
|
1127
|
+
const currentConversation = computed(() => sessionId.value ? chatStore.sessions.byId[sessionId.value] : void 0);
|
|
1128
|
+
const currentConversationTitle = computed(() => currentConversation.value?.title);
|
|
1129
|
+
const canSelectTools = computed(() => selectedModel.value?.model.provider === "custom-agent" || !!selectedModel.value?.metadata.capabilities.functionCalling);
|
|
1130
|
+
const { arrivedState, measure } = useScroll(scrollContainerRef, {
|
|
1131
|
+
throttle: 100,
|
|
1132
|
+
offset: { bottom: 100 }
|
|
1133
|
+
});
|
|
1134
|
+
const defaultModel = useLocalStorage(LOCAL_STORAGE_CHAT_HUB_SELECTED_MODEL(usersStore.currentUserId ?? "anonymous"), null, {
|
|
1135
|
+
writeDefaults: false,
|
|
1136
|
+
shallow: true,
|
|
1137
|
+
serializer: {
|
|
1138
|
+
read: (value) => {
|
|
1139
|
+
try {
|
|
1140
|
+
return chatHubConversationModelWithCachedDisplayNameSchema.parse(JSON.parse(value));
|
|
1141
|
+
} catch (error) {
|
|
1142
|
+
return null;
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
write: (value) => JSON.stringify(value)
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
const defaultAgent = computed(() => defaultModel.value ? chatStore.getAgent(defaultModel.value) : void 0);
|
|
1149
|
+
const defaultTools = useLocalStorage(LOCAL_STORAGE_CHAT_HUB_SELECTED_TOOLS(usersStore.currentUserId ?? "anonymous"), null, {
|
|
1150
|
+
writeDefaults: false,
|
|
1151
|
+
shallow: true,
|
|
1152
|
+
serializer: {
|
|
1153
|
+
read: (value) => {
|
|
1154
|
+
try {
|
|
1155
|
+
return INodesSchema.parse(JSON.parse(value));
|
|
1156
|
+
} catch (error) {
|
|
1157
|
+
return null;
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
write: (value) => JSON.stringify(value)
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
const shouldSkipNextScrollTrigger = ref(false);
|
|
1164
|
+
const modelFromQuery = computed(() => {
|
|
1165
|
+
const agentId = route.query.agentId;
|
|
1166
|
+
const workflowId = route.query.workflowId;
|
|
1167
|
+
const provider = route.query.provider;
|
|
1168
|
+
const model = route.query.model;
|
|
1169
|
+
if (!isNewSession$1.value) return null;
|
|
1170
|
+
if (typeof agentId === "string") return chatStore.getAgent({
|
|
1171
|
+
provider: "custom-agent",
|
|
1172
|
+
agentId
|
|
1173
|
+
});
|
|
1174
|
+
if (typeof workflowId === "string") return chatStore.getAgent({
|
|
1175
|
+
provider: "n8n",
|
|
1176
|
+
workflowId
|
|
1177
|
+
});
|
|
1178
|
+
if (typeof provider === "string" && typeof model === "string") {
|
|
1179
|
+
const parsedModel = chatHubConversationModelSchema.safeParse({
|
|
1180
|
+
provider,
|
|
1181
|
+
model
|
|
1182
|
+
});
|
|
1183
|
+
if (parsedModel.success) return chatStore.getAgent(parsedModel.data);
|
|
1184
|
+
}
|
|
1185
|
+
return null;
|
|
1186
|
+
});
|
|
1187
|
+
const selectedModel = computed(() => {
|
|
1188
|
+
if (!isNewSession$1.value) {
|
|
1189
|
+
const model = currentConversation.value ? unflattenModel(currentConversation.value) : null;
|
|
1190
|
+
if (!model) return null;
|
|
1191
|
+
return chatStore.getAgent(model, {
|
|
1192
|
+
name: currentConversation.value?.agentName || currentConversation.value?.model,
|
|
1193
|
+
icon: currentConversation.value?.agentIcon
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
if (modelFromQuery.value) return modelFromQuery.value;
|
|
1197
|
+
if (chatStore.streaming?.sessionId === sessionId.value) return chatStore.streaming.agent;
|
|
1198
|
+
if (!defaultModel.value) return null;
|
|
1199
|
+
return chatStore.getAgent(defaultModel.value, {
|
|
1200
|
+
name: defaultModel.value.cachedDisplayName,
|
|
1201
|
+
icon: defaultModel.value.cachedIcon
|
|
1202
|
+
});
|
|
1203
|
+
});
|
|
1204
|
+
const { customAgent } = useCustomAgent(computed(() => selectedModel.value?.model.provider === "custom-agent" ? selectedModel.value.model.agentId : void 0));
|
|
1205
|
+
const selectedTools = computed(() => {
|
|
1206
|
+
if (customAgent.value) return customAgent.value.tools;
|
|
1207
|
+
if (currentConversation.value?.tools) return currentConversation.value.tools;
|
|
1208
|
+
return modelFromQuery.value ? [] : defaultTools.value ?? [];
|
|
1209
|
+
});
|
|
1210
|
+
const { credentialsByProvider, selectCredential } = useChatCredentials(usersStore.currentUserId ?? "anonymous");
|
|
1211
|
+
const chatMessages = computed(() => chatStore.getActiveMessages(sessionId.value));
|
|
1212
|
+
const credentialsForSelectedProvider = computed(() => {
|
|
1213
|
+
const provider = selectedModel.value?.model.provider;
|
|
1214
|
+
if (!provider) return null;
|
|
1215
|
+
if (!isLlmProvider(provider)) return {};
|
|
1216
|
+
const credentialsId = credentialsByProvider.value?.[provider];
|
|
1217
|
+
if (!credentialsId) return null;
|
|
1218
|
+
return { [PROVIDER_CREDENTIAL_TYPE_MAP[provider]]: {
|
|
1219
|
+
id: credentialsId,
|
|
1220
|
+
name: ""
|
|
1221
|
+
} };
|
|
1222
|
+
});
|
|
1223
|
+
const isMissingSelectedCredential = computed(() => !credentialsForSelectedProvider.value);
|
|
1224
|
+
const messagingState = computed(() => {
|
|
1225
|
+
if (chatStore.streaming?.sessionId === sessionId.value) return chatStore.streaming.messageId ? "receiving" : "waitingFirstChunk";
|
|
1226
|
+
if (chatStore.agentsReady && !selectedModel.value) return "missingAgent";
|
|
1227
|
+
if (chatStore.agentsReady && isMissingSelectedCredential.value) return "missingCredentials";
|
|
1228
|
+
return "idle";
|
|
1229
|
+
});
|
|
1230
|
+
const editingMessageId = ref();
|
|
1231
|
+
const messageElementsRef = useTemplateRef("messages");
|
|
1232
|
+
const didSubmitInCurrentSession = ref(false);
|
|
1233
|
+
const fileDrop = useFileDrop(computed(() => {
|
|
1234
|
+
if (!(!!createMimeTypes(selectedModel.value?.metadata.inputModalities ?? []) && !isMissingSelectedCredential.value)) return false;
|
|
1235
|
+
if (editingMessageId.value) return chatMessages.value.find((msg) => msg.id === editingMessageId.value)?.type === "human";
|
|
1236
|
+
return true;
|
|
1237
|
+
}), onFilesDropped);
|
|
1238
|
+
function scrollToBottom(smooth) {
|
|
1239
|
+
scrollContainerRef.value?.scrollTo({
|
|
1240
|
+
top: scrollableRef.value?.scrollHeight,
|
|
1241
|
+
behavior: smooth ? "smooth" : "instant"
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
function scrollToMessage(messageId) {
|
|
1245
|
+
scrollableRef.value?.querySelector(`[data-message-id="${messageId}"]`)?.scrollIntoView({ behavior: "smooth" });
|
|
1246
|
+
}
|
|
1247
|
+
watch(() => chatMessages.value[chatMessages.value.length - 1]?.id, (lastMessageId) => {
|
|
1248
|
+
if (!lastMessageId) return;
|
|
1249
|
+
if (shouldSkipNextScrollTrigger.value) {
|
|
1250
|
+
shouldSkipNextScrollTrigger.value = false;
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
nextTick(measure);
|
|
1254
|
+
if (chatStore.streaming?.sessionId === sessionId.value) {
|
|
1255
|
+
scrollToMessage(chatStore.streaming.promptId);
|
|
1256
|
+
return;
|
|
1257
|
+
}
|
|
1258
|
+
scrollToBottom(false);
|
|
1259
|
+
}, {
|
|
1260
|
+
immediate: true,
|
|
1261
|
+
flush: "post"
|
|
1262
|
+
});
|
|
1263
|
+
watch(() => chatStore.agents, (models) => {
|
|
1264
|
+
const settings = settingsStore.moduleSettings?.["chat-hub"];
|
|
1265
|
+
if (!models || !!selectedModel.value || !isNewSession$1.value || !settings) return;
|
|
1266
|
+
const model = findOneFromModelsResponse(models, settings.providers);
|
|
1267
|
+
if (model) handleSelectAgent(model);
|
|
1268
|
+
}, { immediate: true });
|
|
1269
|
+
watch([sessionId, isNewSession$1], async ([id, isNew]) => {
|
|
1270
|
+
didSubmitInCurrentSession.value = false;
|
|
1271
|
+
editingMessageId.value = void 0;
|
|
1272
|
+
if (!isNew && !chatStore.getConversation(id)) try {
|
|
1273
|
+
await chatStore.fetchMessages(id);
|
|
1274
|
+
} catch (error) {
|
|
1275
|
+
toast.showError(error, i18n.baseText("chatHub.error.fetchConversationFailed"));
|
|
1276
|
+
await router.push({ name: CHAT_VIEW });
|
|
1277
|
+
}
|
|
1278
|
+
}, { immediate: true });
|
|
1279
|
+
watch([inputRef, sessionId], ([input]) => {
|
|
1280
|
+
input?.focus();
|
|
1281
|
+
}, { immediate: true });
|
|
1282
|
+
watch(currentConversationTitle, (title$1) => {
|
|
1283
|
+
documentTitle.set(title$1 ?? "Chat");
|
|
1284
|
+
}, { immediate: true });
|
|
1285
|
+
watch(credentialsByProvider, (credentials) => {
|
|
1286
|
+
if (credentials) chatStore.fetchAgents(credentials);
|
|
1287
|
+
}, { immediate: true });
|
|
1288
|
+
watch(defaultAgent, (agent, prevAgent) => {
|
|
1289
|
+
if (defaultModel.value && agent?.name && agent.name !== prevAgent?.name) defaultModel.value = {
|
|
1290
|
+
...defaultModel.value,
|
|
1291
|
+
cachedDisplayName: agent.name
|
|
1292
|
+
};
|
|
1293
|
+
if (defaultModel.value && agent?.icon && (agent.icon.type !== prevAgent?.icon?.type || agent.icon.value !== prevAgent.icon.value)) defaultModel.value = {
|
|
1294
|
+
...defaultModel.value,
|
|
1295
|
+
cachedIcon: agent.icon
|
|
1296
|
+
};
|
|
1297
|
+
if (agent && !agent.metadata.capabilities.functionCalling && (defaultTools.value ?? []).length > 0) defaultTools.value = [];
|
|
1298
|
+
}, { immediate: true });
|
|
1299
|
+
async function onSubmit(message$1, attachments$2) {
|
|
1300
|
+
if (!message$1.trim() || isResponding.value || !selectedModel.value || !credentialsForSelectedProvider.value) return;
|
|
1301
|
+
didSubmitInCurrentSession.value = true;
|
|
1302
|
+
editingMessageId.value = void 0;
|
|
1303
|
+
await chatStore.sendMessage(sessionId.value, message$1, selectedModel.value, credentialsForSelectedProvider.value, canSelectTools.value ? selectedTools.value : [], attachments$2);
|
|
1304
|
+
inputRef.value?.reset();
|
|
1305
|
+
if (isNewSession$1.value) router.push({
|
|
1306
|
+
name: CHAT_CONVERSATION_VIEW,
|
|
1307
|
+
params: { id: sessionId.value }
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
async function onStop() {
|
|
1311
|
+
await chatStore.stopStreamingMessage(sessionId.value);
|
|
1312
|
+
}
|
|
1313
|
+
function handleStartEditMessage(messageId) {
|
|
1314
|
+
editingMessageId.value = messageId;
|
|
1315
|
+
}
|
|
1316
|
+
function handleCancelEditMessage() {
|
|
1317
|
+
editingMessageId.value = void 0;
|
|
1318
|
+
}
|
|
1319
|
+
async function handleEditMessage(content$1, keptAttachmentIndices, newFiles) {
|
|
1320
|
+
if (!editingMessageId.value || isResponding.value || !selectedModel.value || !credentialsForSelectedProvider.value) return;
|
|
1321
|
+
await chatStore.editMessage(sessionId.value, editingMessageId.value, content$1, selectedModel.value, credentialsForSelectedProvider.value, keptAttachmentIndices, newFiles);
|
|
1322
|
+
editingMessageId.value = void 0;
|
|
1323
|
+
}
|
|
1324
|
+
async function handleRegenerateMessage(message$1) {
|
|
1325
|
+
if (isResponding.value || message$1.type !== "ai" || !selectedModel.value || !credentialsForSelectedProvider.value) return;
|
|
1326
|
+
const messageToRetry = message$1.id;
|
|
1327
|
+
editingMessageId.value = void 0;
|
|
1328
|
+
await chatStore.regenerateMessage(sessionId.value, messageToRetry, selectedModel.value, credentialsForSelectedProvider.value);
|
|
1329
|
+
}
|
|
1330
|
+
async function handleSelectModel(selection, selectedAgent) {
|
|
1331
|
+
const agent = selectedAgent ?? chatStore.getAgent(selection);
|
|
1332
|
+
if (currentConversation.value) try {
|
|
1333
|
+
await chatStore.updateSessionModel(sessionId.value, selection, agent.name);
|
|
1334
|
+
} catch (error) {
|
|
1335
|
+
toast.showError(error, i18n.baseText("chatHub.error.updateModelFailed"));
|
|
1336
|
+
}
|
|
1337
|
+
else {
|
|
1338
|
+
defaultModel.value = {
|
|
1339
|
+
...selection,
|
|
1340
|
+
cachedDisplayName: agent.name,
|
|
1341
|
+
cachedIcon: agent.icon ?? void 0
|
|
1342
|
+
};
|
|
1343
|
+
await router.push({
|
|
1344
|
+
name: CHAT_VIEW,
|
|
1345
|
+
force: true
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
async function handleSelectAgent(selection) {
|
|
1350
|
+
await handleSelectModel(selection.model, selection);
|
|
1351
|
+
}
|
|
1352
|
+
function handleSwitchAlternative(messageId) {
|
|
1353
|
+
shouldSkipNextScrollTrigger.value = true;
|
|
1354
|
+
chatStore.switchAlternative(sessionId.value, messageId);
|
|
1355
|
+
}
|
|
1356
|
+
function handleConfigureCredentials(provider) {
|
|
1357
|
+
headerRef.value?.openCredentialSelector(provider);
|
|
1358
|
+
}
|
|
1359
|
+
function handleConfigureModel() {
|
|
1360
|
+
headerRef.value?.openModelSelector();
|
|
1361
|
+
}
|
|
1362
|
+
async function handleUpdateTools(newTools) {
|
|
1363
|
+
defaultTools.value = newTools;
|
|
1364
|
+
if (currentConversation.value) try {
|
|
1365
|
+
await chatStore.updateToolsInSession(sessionId.value, newTools);
|
|
1366
|
+
} catch (error) {
|
|
1367
|
+
toast.showError(error, i18n.baseText("chatHub.error.updateToolsFailed"));
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
function handleEditAgent(agentId) {
|
|
1371
|
+
uiStore.openModalWithData({
|
|
1372
|
+
name: AGENT_EDITOR_MODAL_KEY,
|
|
1373
|
+
data: {
|
|
1374
|
+
agentId,
|
|
1375
|
+
credentials: credentialsByProvider,
|
|
1376
|
+
onCreateCustomAgent: handleSelectAgent
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
function openNewAgentCreator() {
|
|
1381
|
+
uiStore.openModalWithData({
|
|
1382
|
+
name: AGENT_EDITOR_MODAL_KEY,
|
|
1383
|
+
data: {
|
|
1384
|
+
credentials: credentialsByProvider,
|
|
1385
|
+
onCreateCustomAgent: handleSelectAgent
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
function handleOpenWorkflow(workflowId) {
|
|
1390
|
+
const routeData = router.resolve({
|
|
1391
|
+
name: VIEWS.WORKFLOW,
|
|
1392
|
+
params: { name: workflowId }
|
|
1393
|
+
});
|
|
1394
|
+
window.open(routeData.href, "_blank");
|
|
1395
|
+
}
|
|
1396
|
+
function onFilesDropped(files) {
|
|
1397
|
+
if (!editingMessageId.value) {
|
|
1398
|
+
inputRef.value?.addAttachments(files);
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
const index = chatMessages.value.findIndex((message$1) => message$1.id === editingMessageId.value);
|
|
1402
|
+
messageElementsRef.value?.[index]?.addFiles(files);
|
|
1403
|
+
}
|
|
1404
|
+
return (_ctx, _cache) => {
|
|
1405
|
+
return openBlock(), createBlock(ChatLayout_default, {
|
|
1406
|
+
class: normalizeClass({
|
|
1407
|
+
[_ctx.$style.chatLayout]: true,
|
|
1408
|
+
[_ctx.$style.isNewSession]: isNewSession$1.value,
|
|
1409
|
+
[_ctx.$style.isExistingSession]: !isNewSession$1.value,
|
|
1410
|
+
[_ctx.$style.isMobileDevice]: unref(isMobileDevice$1),
|
|
1411
|
+
[_ctx.$style.isDraggingFile]: unref(fileDrop).isDragging.value
|
|
1412
|
+
}),
|
|
1413
|
+
onDragenter: unref(fileDrop).handleDragEnter,
|
|
1414
|
+
onDragleave: unref(fileDrop).handleDragLeave,
|
|
1415
|
+
onDragover: unref(fileDrop).handleDragOver,
|
|
1416
|
+
onDrop: unref(fileDrop).handleDrop,
|
|
1417
|
+
onPaste: unref(fileDrop).handlePaste
|
|
1418
|
+
}, {
|
|
1419
|
+
default: withCtx(() => [
|
|
1420
|
+
unref(fileDrop).isDragging.value ? (openBlock(), createElementBlock("div", {
|
|
1421
|
+
key: 0,
|
|
1422
|
+
class: normalizeClass(_ctx.$style.dropOverlay)
|
|
1423
|
+
}, [createVNode(unref(N8nText_default), {
|
|
1424
|
+
size: "large",
|
|
1425
|
+
color: "text-dark"
|
|
1426
|
+
}, {
|
|
1427
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(i18n).baseText("chatHub.chat.dropOverlay")), 1)]),
|
|
1428
|
+
_: 1
|
|
1429
|
+
})], 2)) : createCommentVNode("", true),
|
|
1430
|
+
createVNode(ChatConversationHeader_default, {
|
|
1431
|
+
ref_key: "headerRef",
|
|
1432
|
+
ref: headerRef,
|
|
1433
|
+
"selected-model": selectedModel.value,
|
|
1434
|
+
credentials: unref(credentialsByProvider),
|
|
1435
|
+
"ready-to-show-model-selector": isNewSession$1.value || !!currentConversation.value,
|
|
1436
|
+
onSelectModel: handleSelectModel,
|
|
1437
|
+
onEditCustomAgent: handleEditAgent,
|
|
1438
|
+
onCreateCustomAgent: openNewAgentCreator,
|
|
1439
|
+
onSelectCredential: unref(selectCredential),
|
|
1440
|
+
onOpenWorkflow: handleOpenWorkflow
|
|
1441
|
+
}, null, 8, [
|
|
1442
|
+
"selected-model",
|
|
1443
|
+
"credentials",
|
|
1444
|
+
"ready-to-show-model-selector",
|
|
1445
|
+
"onSelectCredential"
|
|
1446
|
+
]),
|
|
1447
|
+
createVNode(unref(N8nScrollArea_default), {
|
|
1448
|
+
type: "scroll",
|
|
1449
|
+
"enable-vertical-scroll": true,
|
|
1450
|
+
"enable-horizontal-scroll": false,
|
|
1451
|
+
"as-child": "",
|
|
1452
|
+
class: normalizeClass(_ctx.$style.scrollArea)
|
|
1453
|
+
}, {
|
|
1454
|
+
default: withCtx(() => [createBaseVNode("div", {
|
|
1455
|
+
class: normalizeClass(_ctx.$style.scrollable),
|
|
1456
|
+
ref: "scrollable"
|
|
1457
|
+
}, [isNewSession$1.value ? (openBlock(), createBlock(ChatStarter_default, {
|
|
1458
|
+
key: 0,
|
|
1459
|
+
class: normalizeClass(_ctx.$style.starter),
|
|
1460
|
+
"is-mobile-device": unref(isMobileDevice$1)
|
|
1461
|
+
}, null, 8, ["class", "is-mobile-device"])) : (openBlock(), createElementBlock("div", {
|
|
1462
|
+
key: 1,
|
|
1463
|
+
role: "log",
|
|
1464
|
+
"aria-live": "polite",
|
|
1465
|
+
class: normalizeClass(_ctx.$style.messageList)
|
|
1466
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(chatMessages.value, (message$1, index) => {
|
|
1467
|
+
return openBlock(), createBlock(ChatMessage_default, {
|
|
1468
|
+
key: message$1.id,
|
|
1469
|
+
ref_for: true,
|
|
1470
|
+
ref: "messages",
|
|
1471
|
+
message: message$1,
|
|
1472
|
+
compact: unref(isMobileDevice$1),
|
|
1473
|
+
"is-editing": editingMessageId.value === message$1.id,
|
|
1474
|
+
"is-edit-submitting": unref(chatStore).streaming?.revisionOfMessageId === message$1.id,
|
|
1475
|
+
"has-session-streaming": isResponding.value,
|
|
1476
|
+
"cached-agent-display-name": selectedModel.value?.name ?? null,
|
|
1477
|
+
"cached-agent-icon": selectedModel.value?.icon ?? null,
|
|
1478
|
+
"min-height": didSubmitInCurrentSession.value && message$1.type === "ai" && index === chatMessages.value.length - 1 && scrollContainerRef.value ? scrollContainerRef.value.offsetHeight - 30 - 200 : void 0,
|
|
1479
|
+
"container-width": unref(scrollableSize).width.value ?? 0,
|
|
1480
|
+
onStartEdit: ($event) => handleStartEditMessage(message$1.id),
|
|
1481
|
+
onCancelEdit: handleCancelEditMessage,
|
|
1482
|
+
onRegenerate: handleRegenerateMessage,
|
|
1483
|
+
onUpdate: handleEditMessage,
|
|
1484
|
+
onSwitchAlternative: handleSwitchAlternative
|
|
1485
|
+
}, null, 8, [
|
|
1486
|
+
"message",
|
|
1487
|
+
"compact",
|
|
1488
|
+
"is-editing",
|
|
1489
|
+
"is-edit-submitting",
|
|
1490
|
+
"has-session-streaming",
|
|
1491
|
+
"cached-agent-display-name",
|
|
1492
|
+
"cached-agent-icon",
|
|
1493
|
+
"min-height",
|
|
1494
|
+
"container-width",
|
|
1495
|
+
"onStartEdit"
|
|
1496
|
+
]);
|
|
1497
|
+
}), 128))], 2)), createBaseVNode("div", { class: normalizeClass(_ctx.$style.promptContainer) }, [!unref(arrivedState).bottom && !isNewSession$1.value ? (openBlock(), createBlock(unref(N8nIconButton_default), {
|
|
1498
|
+
key: 0,
|
|
1499
|
+
type: "secondary",
|
|
1500
|
+
icon: "arrow-down",
|
|
1501
|
+
class: normalizeClass(_ctx.$style.scrollToBottomButton),
|
|
1502
|
+
title: unref(i18n).baseText("chatHub.chat.scrollToBottom"),
|
|
1503
|
+
onClick: _cache[0] || (_cache[0] = ($event) => scrollToBottom(true))
|
|
1504
|
+
}, null, 8, ["class", "title"])) : createCommentVNode("", true), createVNode(ChatPrompt_default, {
|
|
1505
|
+
ref_key: "inputRef",
|
|
1506
|
+
ref: inputRef,
|
|
1507
|
+
class: normalizeClass(_ctx.$style.prompt),
|
|
1508
|
+
"selected-model": selectedModel.value,
|
|
1509
|
+
"selected-tools": selectedTools.value,
|
|
1510
|
+
"messaging-state": messagingState.value,
|
|
1511
|
+
"is-tools-selectable": canSelectTools.value,
|
|
1512
|
+
"is-new-session": isNewSession$1.value,
|
|
1513
|
+
onSubmit,
|
|
1514
|
+
onStop,
|
|
1515
|
+
onSelectModel: handleConfigureModel,
|
|
1516
|
+
onSelectTools: handleUpdateTools,
|
|
1517
|
+
onSetCredentials: handleConfigureCredentials,
|
|
1518
|
+
onEditAgent: handleEditAgent
|
|
1519
|
+
}, null, 8, [
|
|
1520
|
+
"class",
|
|
1521
|
+
"selected-model",
|
|
1522
|
+
"selected-tools",
|
|
1523
|
+
"messaging-state",
|
|
1524
|
+
"is-tools-selectable",
|
|
1525
|
+
"is-new-session"
|
|
1526
|
+
])], 2)], 2)]),
|
|
1527
|
+
_: 1
|
|
1528
|
+
}, 8, ["class"])
|
|
1529
|
+
]),
|
|
1530
|
+
_: 1
|
|
1531
|
+
}, 8, [
|
|
1532
|
+
"class",
|
|
1533
|
+
"onDragenter",
|
|
1534
|
+
"onDragleave",
|
|
1535
|
+
"onDragover",
|
|
1536
|
+
"onDrop",
|
|
1537
|
+
"onPaste"
|
|
1538
|
+
]);
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
var ChatView_vue_vue_type_style_index_0_lang_module_default = {
|
|
1543
|
+
chatLayout: "_chatLayout_1sy6c_123",
|
|
1544
|
+
scrollArea: "_scrollArea_1sy6c_127",
|
|
1545
|
+
scrollable: "_scrollable_1sy6c_132",
|
|
1546
|
+
isNewSession: "_isNewSession_1sy6c_141",
|
|
1547
|
+
header: "_header_1sy6c_145",
|
|
1548
|
+
isMobileDevice: "_isMobileDevice_1sy6c_151",
|
|
1549
|
+
starter: "_starter_1sy6c_151",
|
|
1550
|
+
messageList: "_messageList_1sy6c_156",
|
|
1551
|
+
promptContainer: "_promptContainer_1sy6c_172",
|
|
1552
|
+
isExistingSession: "_isExistingSession_1sy6c_176",
|
|
1553
|
+
prompt: "_prompt_1sy6c_172",
|
|
1554
|
+
scrollToBottomButton: "_scrollToBottomButton_1sy6c_194",
|
|
1555
|
+
isDraggingFile: "_isDraggingFile_1sy6c_202",
|
|
1556
|
+
dropOverlay: "_dropOverlay_1sy6c_206"
|
|
1557
|
+
};
|
|
1558
|
+
var ChatView_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatView_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatView_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1559
|
+
export { ChatView_default as default };
|