n8n-editor-ui 1.47.0 → 1.47.2
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/.turbo/turbo-build.log +79 -79
- package/dist/assets/{AuthView-BgFWzBDm.js → AuthView-B_jZMnGj.js} +2 -2
- package/dist/assets/{AuthView-BgFWzBDm.js.map → AuthView-B_jZMnGj.js.map} +1 -1
- package/dist/assets/{CanvasControls-m_3acPPd.js → CanvasControls-ns1B0A0j.js} +2 -2
- package/dist/assets/{CanvasControls-m_3acPPd.js.map → CanvasControls-ns1B0A0j.js.map} +1 -1
- package/dist/assets/{ChangePasswordView-CN6JWR-N.js → ChangePasswordView-BDsuHv0B.js} +2 -2
- package/dist/assets/{ChangePasswordView-CN6JWR-N.js.map → ChangePasswordView-BDsuHv0B.js.map} +1 -1
- package/dist/assets/{CollectionParameter-DHmcKhO-.js → CollectionParameter-Br-xtutZ.js} +2 -2
- package/dist/assets/CollectionParameter-Br-xtutZ.js.map +1 -0
- package/dist/assets/{CredentialsView-D9TXjOnK.js → CredentialsView-DnJ_jhDo.js} +2 -2
- package/dist/assets/{CredentialsView-D9TXjOnK.js.map → CredentialsView-DnJ_jhDo.js.map} +1 -1
- package/dist/assets/{ErrorView-CYag8fsg.js → ErrorView-BfV5e5ko.js} +2 -2
- package/dist/assets/{ErrorView-CYag8fsg.js.map → ErrorView-BfV5e5ko.js.map} +1 -1
- package/dist/assets/{ExecutionsFilter-Cf35yNfd.js → ExecutionsFilter-0XcXH83H.js} +2 -2
- package/dist/assets/{ExecutionsFilter-Cf35yNfd.js.map → ExecutionsFilter-0XcXH83H.js.map} +1 -1
- package/dist/assets/{ExecutionsView-ztrgLYNP.js → ExecutionsView-aFiZuLVt.js} +2 -2
- package/dist/assets/{ExecutionsView-ztrgLYNP.js.map → ExecutionsView-aFiZuLVt.js.map} +1 -1
- package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js → ForgotMyPasswordView-64X9tXq4.js} +2 -2
- package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js.map → ForgotMyPasswordView-64X9tXq4.js.map} +1 -1
- package/dist/assets/MainHeader-Ch0Iz_7s.js +2 -0
- package/dist/assets/{MainHeader-CMxbwL4C.js.map → MainHeader-Ch0Iz_7s.js.map} +1 -1
- package/dist/assets/{MainSidebar-BuwaBgG9.js → MainSidebar-3ee-tTgz.js} +2 -2
- package/dist/assets/{MainSidebar-BuwaBgG9.js.map → MainSidebar-3ee-tTgz.js.map} +1 -1
- package/dist/assets/{NodeCreation-B7Uimsok.js → NodeCreation-PrQGENrl.js} +3 -3
- package/dist/assets/{NodeCreation-B7Uimsok.js.map → NodeCreation-PrQGENrl.js.map} +1 -1
- package/dist/assets/{NodeCreator-IRjqf3_R.js → NodeCreator-DlK1669m.js} +2 -2
- package/dist/assets/{NodeCreator-IRjqf3_R.js.map → NodeCreator-DlK1669m.js.map} +1 -1
- package/dist/assets/{NodeDetailsView-CSnjluIR.js → NodeDetailsView-DcV7LI-g.js} +4 -4
- package/dist/assets/{NodeDetailsView-CSnjluIR.js.map → NodeDetailsView-DcV7LI-g.js.map} +1 -1
- package/dist/assets/{NodeView-DMzj-gox.css → NodeView--67hs6V6.css} +1 -1
- package/dist/assets/NodeView-D_kbUfVN.js +3 -0
- package/dist/assets/NodeView-D_kbUfVN.js.map +1 -0
- package/dist/assets/{NodeView.v2-DyU_S0rY.js → NodeView.v2-D_Wbnl01.js} +3 -3
- package/dist/assets/{NodeView.v2-DyU_S0rY.js.map → NodeView.v2-D_Wbnl01.js.map} +1 -1
- package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-6oVL0vKx.js} +2 -2
- package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js.map → ProjectCardBadge.vue_vue_type_script_setup_true_lang-6oVL0vKx.js.map} +1 -1
- package/dist/assets/{ProjectSettings-CbNlX27g.js → ProjectSettings-CfcplqBX.js} +2 -2
- package/dist/assets/{ProjectSettings-CbNlX27g.js.map → ProjectSettings-CfcplqBX.js.map} +1 -1
- package/dist/assets/{ProjectTabs-Cx2VWeba.js → ProjectTabs-5ZO9YR8J.js} +2 -2
- package/dist/assets/{ProjectTabs-Cx2VWeba.js.map → ProjectTabs-5ZO9YR8J.js.map} +1 -1
- package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js → PushConnectionTracker-Bp-RjnYr.js} +2 -2
- package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js.map → PushConnectionTracker-Bp-RjnYr.js.map} +1 -1
- package/dist/assets/{ResourcesListLayout-CKSHiUAP.js → ResourcesListLayout-B4W1PSHT.js} +2 -2
- package/dist/assets/{ResourcesListLayout-CKSHiUAP.js.map → ResourcesListLayout-B4W1PSHT.js.map} +1 -1
- package/dist/assets/{RunDataAi-BVqsN7UN.js → RunDataAi-C3XiqNZa.js} +2 -2
- package/dist/assets/{RunDataAi-BVqsN7UN.js.map → RunDataAi-C3XiqNZa.js.map} +1 -1
- package/dist/assets/{RunDataJson-6Yfwd78r.js → RunDataJson-CMcOD-78.js} +3 -3
- package/dist/assets/{RunDataJson-6Yfwd78r.js.map → RunDataJson-CMcOD-78.js.map} +1 -1
- package/dist/assets/{RunDataJsonActions-5ig3g4km.js → RunDataJsonActions-BQBpmtOi.js} +2 -2
- package/dist/assets/{RunDataJsonActions-5ig3g4km.js.map → RunDataJsonActions-BQBpmtOi.js.map} +1 -1
- package/dist/assets/{RunDataSchema-CrW957BW.js → RunDataSchema-CF4YH-8y.js} +3 -3
- package/dist/assets/{RunDataSchema-CrW957BW.js.map → RunDataSchema-CF4YH-8y.js.map} +1 -1
- package/dist/assets/{RunDataSearch-BrIWOZXO.js → RunDataSearch-DwB8g_cE.js} +2 -2
- package/dist/assets/{RunDataSearch-BrIWOZXO.js.map → RunDataSearch-DwB8g_cE.js.map} +1 -1
- package/dist/assets/RunDataTable-BVAuNDP9.js +2 -0
- package/dist/assets/{RunDataTable-B01U16vv.js.map → RunDataTable-BVAuNDP9.js.map} +1 -1
- package/dist/assets/{SamlOnboarding-CfbBlTNm.js → SamlOnboarding-Csd8l-7T.js} +2 -2
- package/dist/assets/{SamlOnboarding-CfbBlTNm.js.map → SamlOnboarding-Csd8l-7T.js.map} +1 -1
- package/dist/assets/{SettingsApiView-CuliNEKo.js → SettingsApiView-DnvdV7dx.js} +2 -2
- package/dist/assets/{SettingsApiView-CuliNEKo.js.map → SettingsApiView-DnvdV7dx.js.map} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js → SettingsCommunityNodesView-C11a_Ybs.js} +2 -2
- package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js.map → SettingsCommunityNodesView-C11a_Ybs.js.map} +1 -1
- package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js → SettingsExternalSecrets-IIReUcRG.js} +2 -2
- package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js.map → SettingsExternalSecrets-IIReUcRG.js.map} +1 -1
- package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js → SettingsFakeDoorView-BOUfBJS8.js} +2 -2
- package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js.map → SettingsFakeDoorView-BOUfBJS8.js.map} +1 -1
- package/dist/assets/{SettingsLdapView-9hy5C87y.js → SettingsLdapView-BaSjQ4cy.js} +2 -2
- package/dist/assets/{SettingsLdapView-9hy5C87y.js.map → SettingsLdapView-BaSjQ4cy.js.map} +1 -1
- package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js → SettingsLogStreamingView-COGhA1hN.js} +2 -2
- package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js.map → SettingsLogStreamingView-COGhA1hN.js.map} +1 -1
- package/dist/assets/{SettingsPersonalView-Cs82ezMX.js → SettingsPersonalView-BJGgPTwa.js} +2 -2
- package/dist/assets/{SettingsPersonalView-Cs82ezMX.js.map → SettingsPersonalView-BJGgPTwa.js.map} +1 -1
- package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js → SettingsSourceControl-DkdSLuvp.js} +2 -2
- package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js.map → SettingsSourceControl-DkdSLuvp.js.map} +1 -1
- package/dist/assets/{SettingsSso-Di6lHXV2.js → SettingsSso-DA9AOKH5.js} +2 -2
- package/dist/assets/{SettingsSso-Di6lHXV2.js.map → SettingsSso-DA9AOKH5.js.map} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js → SettingsUsageAndPlan-BVPtlthH.js} +2 -2
- package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js.map → SettingsUsageAndPlan-BVPtlthH.js.map} +1 -1
- package/dist/assets/{SettingsUsersView-dOWjUJTW.js → SettingsUsersView-BuKt4ZDO.js} +2 -2
- package/dist/assets/{SettingsUsersView-dOWjUJTW.js.map → SettingsUsersView-BuKt4ZDO.js.map} +1 -1
- package/dist/assets/{SettingsView-DQ0hQWFt.js → SettingsView-DJ78VuiY.js} +2 -2
- package/dist/assets/{SettingsView-DQ0hQWFt.js.map → SettingsView-DJ78VuiY.js.map} +1 -1
- package/dist/assets/{SetupView-CqT8d0D8.js → SetupView-C70Dkfed.js} +2 -2
- package/dist/assets/{SetupView-CqT8d0D8.js.map → SetupView-C70Dkfed.js.map} +1 -1
- package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js → SetupWorkflowCredentialsButton-CEQ1LrFl.js} +2 -2
- package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js.map → SetupWorkflowCredentialsButton-CEQ1LrFl.js.map} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js → SetupWorkflowFromTemplateView-BUzzXtBr.js} +2 -2
- package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js.map → SetupWorkflowFromTemplateView-BUzzXtBr.js.map} +1 -1
- package/dist/assets/{SigninView-2eLLF8DU.js → SigninView-B3CNL-yp.js} +2 -2
- package/dist/assets/{SigninView-2eLLF8DU.js.map → SigninView-B3CNL-yp.js.map} +1 -1
- package/dist/assets/{SignoutView-BQyCyjsK.js → SignoutView-svcLavkC.js} +2 -2
- package/dist/assets/{SignoutView-BQyCyjsK.js.map → SignoutView-svcLavkC.js.map} +1 -1
- package/dist/assets/{SignupView-ByYEkUpW.js → SignupView-DJWRTPKF.js} +2 -2
- package/dist/assets/{SignupView-ByYEkUpW.js.map → SignupView-DJWRTPKF.js.map} +1 -1
- package/dist/assets/{TemplateDetails-I6WMCxGm.js → TemplateDetails-BnbiWxo-.js} +2 -2
- package/dist/assets/{TemplateDetails-I6WMCxGm.js.map → TemplateDetails-BnbiWxo-.js.map} +1 -1
- package/dist/assets/{TemplateList-DRf0Cbhg.js → TemplateList-By-t2s0M.js} +2 -2
- package/dist/assets/{TemplateList-DRf0Cbhg.js.map → TemplateList-By-t2s0M.js.map} +1 -1
- package/dist/assets/{TemplatesCollectionView-BYkDe49v.js → TemplatesCollectionView-D2L1fmSc.js} +2 -2
- package/dist/assets/{TemplatesCollectionView-BYkDe49v.js.map → TemplatesCollectionView-D2L1fmSc.js.map} +1 -1
- package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js → TemplatesSearchView-Bmr6Nd6g.js} +2 -2
- package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js.map → TemplatesSearchView-Bmr6Nd6g.js.map} +1 -1
- package/dist/assets/{TemplatesView-zULLoEwu.js → TemplatesView-BbunSn-s.js} +2 -2
- package/dist/assets/{TemplatesView-zULLoEwu.js.map → TemplatesView-BbunSn-s.js.map} +1 -1
- package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js → TemplatesWorkflowView-XxBIlMWY.js} +2 -2
- package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js.map → TemplatesWorkflowView-XxBIlMWY.js.map} +1 -1
- package/dist/assets/{VariablesView-NcNcsjHY.js → VariablesView-ZY5xLmKI.js} +2 -2
- package/dist/assets/{VariablesView-NcNcsjHY.js.map → VariablesView-ZY5xLmKI.js.map} +1 -1
- package/dist/assets/{WorkerView-dtJzfgCM.js → WorkerView-DV19-i1-.js} +2 -2
- package/dist/assets/{WorkerView-dtJzfgCM.js.map → WorkerView-DV19-i1-.js.map} +1 -1
- package/dist/assets/{WorkflowActivator-D6Zad1X2.js → WorkflowActivator-BXWURYao.js} +2 -2
- package/dist/assets/{WorkflowActivator-D6Zad1X2.js.map → WorkflowActivator-BXWURYao.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js → WorkflowExecutionsInfoAccordion-aldNazgt.js} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js.map → WorkflowExecutionsInfoAccordion-aldNazgt.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js → WorkflowExecutionsLandingPage-CaAameTk.js} +2 -2
- package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js.map → WorkflowExecutionsLandingPage-CaAameTk.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsPreview-C_EBlNX6.js → WorkflowExecutionsPreview-Bb-wJtr-.js} +2 -2
- package/dist/assets/WorkflowExecutionsPreview-Bb-wJtr-.js.map +1 -0
- package/dist/assets/WorkflowExecutionsView-D7nlOP1-.js +2 -0
- package/dist/assets/WorkflowExecutionsView-D7nlOP1-.js.map +1 -0
- package/dist/assets/{WorkflowHistory-DkdQ1koF.js → WorkflowHistory-C6zCGFoY.js} +2 -2
- package/dist/assets/{WorkflowHistory-DkdQ1koF.js.map → WorkflowHistory-C6zCGFoY.js.map} +1 -1
- package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js → WorkflowOnboardingView-Bu_Oqtr7.js} +2 -2
- package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js.map → WorkflowOnboardingView-Bu_Oqtr7.js.map} +1 -1
- package/dist/assets/{WorkflowPreview-CLzyAzmJ.js → WorkflowPreview-CVwpKdpj.js} +2 -2
- package/dist/assets/{WorkflowPreview-CLzyAzmJ.js.map → WorkflowPreview-CVwpKdpj.js.map} +1 -1
- package/dist/assets/{WorkflowsView-CzJx_-P5.js → WorkflowsView-DVeAZ2zW.js} +2 -2
- package/dist/assets/{WorkflowsView-CzJx_-P5.js.map → WorkflowsView-DVeAZ2zW.js.map} +1 -1
- package/dist/assets/{cloud-CRMEbZfJ.js → cloud-BRhZDk2r.js} +2 -2
- package/dist/assets/{cloud-CRMEbZfJ.js.map → cloud-BRhZDk2r.js.map} +1 -1
- package/dist/assets/{collaboration.store-Co5wlk8y.js → collaboration.store-Ol7bcCFc.js} +2 -2
- package/dist/assets/{collaboration.store-Co5wlk8y.js.map → collaboration.store-Ol7bcCFc.js.map} +1 -1
- package/dist/assets/index-1OxaEeO3.js +341 -0
- package/dist/assets/index-1OxaEeO3.js.map +1 -0
- package/dist/assets/{nodeCreator.store-CTXKjjQB.js → nodeCreator.store-FIsc3SCx.js} +2 -2
- package/dist/assets/{nodeCreator.store-CTXKjjQB.js.map → nodeCreator.store-FIsc3SCx.js.map} +1 -1
- package/dist/assets/{templateActions-CIRsIG2W.js → templateActions-w_1vSarr.js} +2 -2
- package/dist/assets/{templateActions-CIRsIG2W.js.map → templateActions-w_1vSarr.js.map} +1 -1
- package/dist/assets/{useExecutionDebugging-BzC-1xF-.js → useExecutionDebugging-EHinBq_u.js} +2 -2
- package/dist/assets/{useExecutionDebugging-BzC-1xF-.js.map → useExecutionDebugging-EHinBq_u.js.map} +1 -1
- package/dist/assets/{useExecutionHelpers-C2K8pfbF.js → useExecutionHelpers-LeKoU_T-.js} +2 -2
- package/dist/assets/{useExecutionHelpers-C2K8pfbF.js.map → useExecutionHelpers-LeKoU_T-.js.map} +1 -1
- package/dist/assets/{usePushConnection-EMXpPhl-.js → usePushConnection-PQgFeT_8.js} +2 -2
- package/dist/assets/{usePushConnection-EMXpPhl-.js.map → usePushConnection-PQgFeT_8.js.map} +1 -1
- package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js → useUserHelpers-DZtbUAMm.js} +2 -2
- package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js.map → useUserHelpers-DZtbUAMm.js.map} +1 -1
- package/dist/assets/{useWorkflowActivate-BwVActuc.js → useWorkflowActivate-npf1npdP.js} +2 -2
- package/dist/assets/{useWorkflowActivate-BwVActuc.js.map → useWorkflowActivate-npf1npdP.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/CollectionParameter-DHmcKhO-.js.map +0 -1
- package/dist/assets/MainHeader-CMxbwL4C.js +0 -2
- package/dist/assets/NodeView-C-hQ3_xD.js +0 -3
- package/dist/assets/NodeView-C-hQ3_xD.js.map +0 -1
- package/dist/assets/RunDataTable-B01U16vv.js +0 -2
- package/dist/assets/WorkflowExecutionsPreview-C_EBlNX6.js.map +0 -1
- package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js +0 -2
- package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js.map +0 -1
- package/dist/assets/index-Dtri_pSJ.js +0 -341
- package/dist/assets/index-Dtri_pSJ.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/NodeCreation-B7Uimsok.js","assets/n8n-4UEsHtUL.js","assets/axios-Mm4CS0gO.js","assets/esprima-next-nhoSXAeq.js","assets/luxon-CLwAIbs0.js","assets/vendor-Dv5OeN6t.js","assets/lodash-es-CZ1inz46.js","assets/n8n-C4uNEd0H.css","assets/index-Dtri_pSJ.js","assets/pinia-sugP77Im.js","assets/flatted-DN8lQ2XG.js","assets/@vueuse/core-BBHtM40w.js","assets/@n8n/permissions-BxxteU-C.js","assets/dateformat-CIxnBJXX.js","assets/vue-i18n-Delvyc9x.js","assets/uuid-SoommWqA.js","assets/@n8n/codemirror-lang-sql-DBO6T13I.js","assets/@lezer/common-B6ct0j_v.js","assets/prettier-bS6l4Vb1.js","assets/@jsplumb/util-DS-9vq_E.js","assets/@jsplumb/core-CVBraiyY.js","assets/@jsplumb/common-CF-b-6-M.js","assets/@jsplumb/connector-bezier-BGU0Ovbw.js","assets/@jsplumb/browser-ui-BVF2KoJK.js","assets/codemirror-lang-html-n8n-CWDO6_kP.js","assets/@n8n/codemirror-lang-Dl0FW_KM.js","assets/fast-json-stable-stringify-BOfzoJX1.js","assets/timeago.js-CiyKClrF.js","assets/qrcode.vue-BGkPba5A.js","assets/vue3-touch-events-mV0oX_Sl.js","assets/chart.js-343vZi4M.js","assets/index-BhLXy8h2.css","assets/nodeCreator.store-CTXKjjQB.js","assets/NodeCreation-gfazfzcF.css","assets/CanvasControls-m_3acPPd.js","assets/CanvasControls-BsWaXMAp.css","assets/SetupWorkflowCredentialsButton-BR-ObOqw.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
-
import{ac as ke,al as go,_ as Te,o as fe,N as b,k as Re,aj as yo,m as we,x as vo,am as No,an as at,h as dt,j as So,p as It,n as ko,e as Nt}from"./n8n-4UEsHtUL.js";import{m as St,s as To}from"./pinia-sugP77Im.js";import{_ as Ot,$ as At,a0 as Pt,a1 as Ue}from"./@jsplumb/core-CVBraiyY.js";import{e as me,a4 as be,j as ue,n as so,a5 as Xe,N as oe,a6 as We,x as tt,a7 as no,m as ot,a8 as bo,a9 as xt,aa as Ce,ab as Ne,ac as io,ad as lt,ae as Eo,af as Co,ag as Do,ah as Io,ai as gt,aj as De,ak as Oo,al as Ao,am as Po,an as xo,ao as _o,ap as ro,d as ao,aq as kt,L as Ze,ar as Mo,as as Ro,at as Wo,au as $o,av as Vo,X as yt,aw as Bo,ax as Uo,a3 as lo,ay as _t,az as Me,u as co,aA as ct,aB as Le,aC as Lo,aD as uo,aE as ho,G as Fo,aF as Ho,aG as Mt,aH as jo,aI as Fe,J as Ie,V as B,A as He,P as Oe,aJ as Rt,aK as Ko,q as zo,aL as qo,aM as Go,I as Yo,H as Jo,aN as K,p as Xo,o as Zo,K as Qo,aO as es,aP as ts,aQ as os,a as ss,$ as ns,b as is,l as rs,aR as as,c as ds,aS as ls,aT as cs,aU as us,aV as ut,E as ht,aW as hs,aX as ps,aY as fs,aZ as ws,Z as Wt,z,a_ as q,a$ as je,b0 as ms,b1 as gs,b2 as pt,b3 as ys,b4 as vs,b5 as Ns,b6 as Ss,b7 as ve,b8 as ks,b9 as Ae,ba as Ts,bb as bs,bc as ft,bd as Es,be as $t,bf as Ke,bg as ze,bh as Cs,bi as Ds,bj as Is,bk as Os,bl as As,bm as Ps,bn as xs,bo as Vt,bp as Bt,bq as Ut,br as Lt,bs as wt,bt as _s,bu as Ft,bv as Ht,bw as Ms,bx as qe,by as jt,bz as Kt,bA as Rs,bB as Ws,bC as zt,bD as qt,bE as Gt,bF as $s,T as Vs,bG as Bs,bH as Yt,bI as Us,bJ as Ls,bK as Fs,bL as Hs,bM as js,bN as Ks,bO as zs,bP as Jt,bQ as qs,bR as Gs,bS as Ys,bT as Js}from"./index-Dtri_pSJ.js";import{r as j,e as X,d as po,b as Xs,G as Ee,u as se,l as N,M as H,p as C,U as I,O as W,I as $,J as ie,a5 as Zs,R as U,a as Qs,ag as R,aq as st,m as D,P as ne,V as Se,a2 as le,T as G,S as fo,aw as en,ax as tn,F as Qe,a7 as et,aH as on,n as sn,aK as Tt,aM as Pe}from"./vendor-Dv5OeN6t.js";import{u as nn}from"./useExecutionDebugging-BzC-1xF-.js";import{N as rn}from"./NodeDetailsView-CSnjluIR.js";import{g as an}from"./lodash-es-CZ1inz46.js";import{u as vt,a as dn}from"./nodeCreator.store-CTXKjjQB.js";import{a as ln,u as cn}from"./collaboration.store-Co5wlk8y.js";import{g as un,f as Ge,h as Xt,a as Zt,E as Qt,b as eo,d as to,i as Ye}from"./@jsplumb/browser-ui-BVF2KoJK.js";import{v as pe}from"./uuid-SoommWqA.js";import"./axios-Mm4CS0gO.js";import"./esprima-next-nhoSXAeq.js";import"./luxon-CLwAIbs0.js";import"./@jsplumb/util-DS-9vq_E.js";import"./@jsplumb/common-CF-b-6-M.js";import"./flatted-DN8lQ2XG.js";import"./@vueuse/core-BBHtM40w.js";import"./@n8n/permissions-BxxteU-C.js";import"./dateformat-CIxnBJXX.js";import"./vue-i18n-Delvyc9x.js";import"./@n8n/codemirror-lang-sql-DBO6T13I.js";import"./@lezer/common-B6ct0j_v.js";import"./prettier-bS6l4Vb1.js";import"./@jsplumb/connector-bezier-BGU0Ovbw.js";import"./codemirror-lang-html-n8n-CWDO6_kP.js";import"./@n8n/codemirror-lang-Dl0FW_KM.js";import"./fast-json-stable-stringify-BOfzoJX1.js";import"./timeago.js-CiyKClrF.js";import"./qrcode.vue-BGkPba5A.js";import"./vue3-touch-events-mV0oX_Sl.js";import"./chart.js-343vZi4M.js";import"./file-saver-By8WREO3.js";import"./vue-json-pretty-Cqx2Hpq3.js";import"./dateFormatter-CfbOITvW.js";import"./RunDataAi-BVqsN7UN.js";import"./useWorkflowActivate-BwVActuc.js";const mt=j([0,0]),xe=j(!1),_e=j({source:"canvas"}),Je=j([]),oo=j(()=>{}),$e=(e=()=>{})=>{const t=me(),o=be(),s=ue(),n=so(),i=tt(),r=X(()=>n.preferences.branchReadOnly||t.isReadOnlyView),d=X(()=>{if(!xe.value)return[];const f=t.selectedNodes.map(w=>s.getNodeByName(w.name)),m=_e.value;return m.source==="canvas"?f:m.source==="node-right-click"?f.some(S=>S.name===m.node.name)?f:[m.node]:[m.node]}),a=f=>{const m=s.allNodes.filter(w=>w.type===f.name);return f.maxNodes===void 0||m.length<f.maxNodes},l=f=>{const m=o.getNodeType(f.type,f.typeVersion);return!m||no.includes(m.name)?!1:a(m)},h=f=>!!s.pinDataByNodeName(f.name),c=()=>{_e.value={source:"canvas"},xe.value=!1,Je.value=[],mt.value=[0,0]},p=(f,m={source:"canvas"})=>{if(f.stopPropagation(),xe.value&&m.source===_e.value.source){c();return}f.preventDefault(),oo.value=e,_e.value=m,mt.value=Xe(f),xe.value=!0;const w=d.value,S=w.every(M=>M.type===oe),k={adjustToNumber:w.length,interpolate:{subject:S?i.baseText("contextMenu.sticky",{adjustToNumber:w.length}):i.baseText("contextMenu.node",{adjustToNumber:w.length})}},y=[{id:"select_all",divided:!0,label:i.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:w.length===s.allNodes.length},{id:"deselect_all",label:i.baseText("contextMenu.deselectAll"),disabled:w.length===0}];if(w.length===0)Je.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:i.baseText("contextMenu.addNode"),disabled:r.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:i.baseText("contextMenu.addSticky"),disabled:r.value},...y];else{const M=[!S&&{id:"toggle_activation",label:w.every(V=>V.disabled)?i.baseText("contextMenu.activate",k):i.baseText("contextMenu.deactivate",k),shortcut:{keys:["D"]},disabled:r.value},!S&&{id:"toggle_pin",label:w.every(V=>h(V))?i.baseText("contextMenu.unpin",k):i.baseText("contextMenu.pin",k),shortcut:{keys:["p"]},disabled:r.value||!w.every(V=>We(V).canPinNode(!0))},{id:"copy",label:i.baseText("contextMenu.copy",k),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:i.baseText("contextMenu.duplicate",k),shortcut:{metaKey:!0,keys:["D"]},disabled:r.value||!w.every(l)},...y,{id:"delete",divided:!0,label:i.baseText("contextMenu.delete",k),shortcut:{keys:["Del"]},disabled:r.value}].filter(Boolean);if(w.length===1){const V=S?[{id:"open",label:i.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:r.value},{id:"change_color",label:i.baseText("contextMenu.changeColor"),disabled:r.value}]:[{id:"open",label:i.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:i.baseText("contextMenu.test"),disabled:r.value},{id:"rename",label:i.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:r.value}];M.unshift(...V)}Je.value=M}},u=f=>{oo.value(f,d.value)};return po(()=>t.nodeViewOffsetPosition,()=>{c()}),{isOpen:xe,position:mt,target:_e,actions:Je,targetNodes:d,open:p,close:c,_dispatchAction:u}};function hn(){const e=j(!1),t=j(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:s}=ke(),n=me(),i=ot(),r=ue(),{isOpen:d}=$e();function a(v){Object.assign(t.value.style,v)}function l(v){const[x,F]=k(v);t.value=Object.assign(t.value,{x,y:F}),a({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(v){const x=p(v);a({left:x.x+"px",top:x.y+"px",width:x.width+"px",height:x.height+"px"})}function c(){t.value.x=0,t.value.y=0,a({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function p(v){const[x,F]=k(v);return{x:Math.min(x,t.value.x),y:Math.min(F,t.value.y),width:Math.abs(x-t.value.x),height:Math.abs(F-t.value.y)}}function u(v){const x=[],F=p(v);return r.allNodes.forEach(de=>{de.position[0]<F.x||de.position[0]>F.x+F.width||de.position[1]<F.y||de.position[1]>F.y+F.height||x.push(de)}),x}function f(){t.value.id="select-box",a({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",w),document.querySelector("#node-view").appendChild(t.value)}function m(v){if(v.buttons===0){w(v);return}h(v)}function w(v){if("button"in v&&v.button===2||d.value)return;if(!e.value){o&&v.target instanceof HTMLElement&&v.target&&v.target.id.includes("node-view")&&V();return}document.removeEventListener("mousemove",m),V();const x=u(v);x.forEach(F=>{M(F)}),x.length===1&&(n.lastSelectedNode=x[0].name),c()}function S(v,x){s(v)||x||v.button===2||n.isActionActive("dragActive")||(l(v),document.addEventListener("mousemove",m))}function k(v){const x=Xe(v),[F,de]=i.canvasPositionFromPagePosition(x),nt=i.nodeViewScale,g=n.nodeViewOffsetPosition;return bo(F,de,nt,g)}function y(v){n.removeNodeFromSelection(v),re.value.removeFromDragSelection(re.value.getManagedElement(v==null?void 0:v.id))}function M(v){n.addSelectedNode(v),re.value.addToDragSelection(re.value.getManagedElement(v==null?void 0:v.id))}function V(){re.value.clearDragSelection(),n.resetSelectedNodes(),n.lastSelectedNode=null,n.lastSelectedNodeOutputIndex=null,i.newNodeInsertPosition=null,i.setLastSelectedConnection(void 0)}const re=X(()=>i.jsPlumbInstance);return Xs(()=>{f()}),{selectActive:e,getMousePositionWithinNodeView:k,mouseUpMouseSelect:w,mouseDownMouseSelect:S,nodeDeselected:y,nodeSelected:M,deselectAllNodes:V}}function pn(){function e(){return be().allNodeTypes.reduce((o,s)=>{if(typeof s.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(s.defaults.name)&&o.push(s.defaults.name),o},[])}function t(o,s=[]){var h,c;const{canvasNames:n}=ue();if(!n.has(o)&&!s.includes(o))return o;const r=e().find(p=>o.startsWith(p));if(r){let p="",u=1;const f=o.split(r).pop(),m=f==null?void 0:f[f.length-1];for(m&&Number.isInteger(Number(m))&&(u=parseInt(m,10),o=o.slice(0,-1)),p=o;n.has(p)||s.includes(p);)p=o+u++;return p}if(/^\d+-?\d*$/.test(o)){let p="",u=1;const f=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(f!=null&&f.groups))throw new Error("Failed to find match for unique name");for(((h=f==null?void 0:f.groups)==null?void 0:h.suffix)!==""&&(u=parseInt(f.groups.suffix,10)),p=f.groups.base;n.has(p)||s.includes(p);)p=f.groups.base+"-"+u++;return p}let d="",a=1;const l=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(l!=null&&l.groups))throw new Error("Failed to find match for unique name");for(((c=l==null?void 0:l.groups)==null?void 0:c.suffix)!==""&&(a=parseInt(l.groups.suffix,10)),d=l.groups.base;n.has(d)||s.includes(d);)d=l.groups.base+a++;return d}return{uniqueNodeName:t}}const fn=Ee({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=$e(),{position:s,isOpen:n,actions:i,target:r}=o,d=j(),a=t;po(n,()=>{var c,p;n?(c=d.value)==null||c.open():(p=d.value)==null||p.close()},{flush:"post"});function l(c){const p=c;o._dispatchAction(p),a("action",p,o.targetNodes.value)}function h(c){c||o.close()}return(c,p)=>se(n)?(N(),H(Zs,{key:0,to:"body"},[C("div",{class:$(c.$style.contextMenu),style:ie({left:`${se(s)[0]}px`,top:`${se(s)[1]}px`})},[I(se(go),{ref_key:"dropdown",ref:d,items:se(i),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":se(r).source!=="node-button",onSelect:l,onVisibleChange:h},{activator:W(()=>[C("div",{class:$(c.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):U("",!0)}}),wn="_contextMenu_1t4kq_1",mn="_activator_1t4kq_5",gn={contextMenu:wn,activator:mn},yn={$style:gn},vn=Te(fn,[["__cssModules",yn]]);function wo({name:e,instance:t,workflowObject:o,isReadOnly:s,emit:n}){const i=me(),r=ke(),d=ue(),a=be(),l=tt(),h=X(()=>{var g;return((g=Qs())==null?void 0:g.refs)??{}}),c=X(()=>d.getNodeByName(e)),p=X(()=>{var g;return((g=c.value)==null?void 0:g.id)??""}),u=j([]),f=j([]),m=(g,E)=>{const _=Po.includes(g);return{type:"N8nAddInput",options:{width:24,height:72,color:E,multiple:_}}},w=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),S=g=>g<=2?"small":g<=6?"medium":"large";function k(g,E,_){var O;if(window!=null&&window.Cypress&&"canvas"in g.endpoint&&t){const A=g.endpoint.canvas;t.setAttribute(A,"data-endpoint-name",((O=c.value)==null?void 0:O.name)??""),t.setAttribute(A,"data-input-index",_.toString()),t.setAttribute(A,"data-endpoint-type",E)}}function y(g,E){var L;const _={},O={};u.value=fe(o,c.value,E)||[];const A=[...u.value];A.sort((ae,Z)=>typeof ae=="string"?1:typeof Z=="string"||ae.required&&!Z.required?-1:!ae.required&&Z.required?1:0),A.forEach((ae,Z)=>{var bt,Et,Ct;let Y;typeof ae=="string"?Y={type:ae}:Y=ae;const T=Y.type,P=T===b.Main?b.Main:"other";_.hasOwnProperty(P)?_[P]++:_[P]=0,O.hasOwnProperty(T)?O[T]++:O[T]=0;const ge=_[P],ye=O[T],J=u.value.filter(te=>{const Dt=typeof te=="string"?te:te.type;return T===b.Main?Dt===b.Main:Dt!==b.Main}),he=J.filter(te=>te!==b.Main),Ve=he.filter(te=>typeof te!="string"&&te.required),it=he.filter(te=>typeof te!="string"&&!te.required),rt=M(Ve.length,it.length),ce=xt(T,"input",J.length,rt)[ge];if(!Ce(T))return;const Be=Ne(T),Q={uuid:io(p.value,T,ye),anchor:ce,maxConnections:Y.maxConnections??-1,endpoint:"Rectangle",paintStyle:lt(E,"--color-foreground-xdark",T),hoverPaintStyle:lt(E,"--color-primary",T),scope:Eo(Be),source:T!==b.Main,target:!s&&u.value.length>1,parameters:{connection:"target",nodeId:p.value,type:T,index:ye},enabled:!s,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...x(T,E)},ee=t==null?void 0:t.addEndpoint(h.value[((bt=c.value)==null?void 0:bt.name)??""],Q);k(ee,"input",ye),(Y.displayName??((Et=E.inputNames)==null?void 0:Et[Z]))&&ee.addOverlay(Co(Y.displayName??((Ct=E.inputNames)==null?void 0:Ct[Z])??"",T,Y.required)),Array.isArray(ee)||(ee.__meta={nodeName:g.name,nodeId:p.value,index:ye,totalEndpoints:J.length,nodeType:g.type})}),A.length===0&&(t==null||t.manage(h.value[((L=c.value)==null?void 0:L.name)??""]))}function M(g,E,_=Do,O=Io){const A=[];if(g>0&&E>0){if(_)A.push(g);else if(g+E<O)for(let L=g;L<O-E;L++)A.push(L)}else if(g>0&&g<O&&E===0)for(let L=0;L<O-g;L++)A.push(L+g);else if(g===0&&E>0&&E<O)for(let L=0;L<O-E;L++)A.push(L);return A}function V(g,E){const _={},O={};if(!c.value)return;f.value=Re(o,c.value,E)||[];let A=0;const L=[];f.value.forEach((Z,Y)=>{var P;let T;typeof Z=="string"?T={type:Z}:T=Z,(P=E.outputNames)!=null&&P[Y]&&(T.displayName=E.outputNames[Y]),T.displayName&&(A=T.displayName.length>A?T.displayName.length:A),L.push(T)});const ae=S(A);f.value.forEach((Z,Y)=>{var Be;const T=L[Y],P=T.type,ge=P===b.Main?b.Main:"other";_.hasOwnProperty(ge)?_[ge]++:_[ge]=0,O.hasOwnProperty(P)?O[P]++:O[P]=0;const ye=_[ge],J=O[P],he=f.value.filter(Q=>{const ee=typeof Q=="string"?Q:Q.type;return P===b.Main?ee===b.Main:ee!==b.Main}),Ve=xt(P,"output",he.length)[ye];if(!Ce(P))return;const it=Ne(P),rt={uuid:gt(p.value,P,J),anchor:Ve,maxConnections:-1,endpoint:{type:"Dot",options:{radius:E&&he.length>2?7:9}},hoverPaintStyle:De(E,"--color-primary"),scope:it,source:!0,target:P!==b.Main,enabled:!s,parameters:{connection:"source",nodeId:p.value,type:P,index:J},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...F(P,T,E)},ce=t==null?void 0:t.addEndpoint(h.value[((Be=c.value)==null?void 0:Be.name)??""],rt);if(ce){if(k(ce,"output",J),T.displayName&&Ce(P)){const Q=Oo(T.displayName,P,T==null?void 0:T.category);ce.addOverlay(Q)}if(Array.isArray(ce)||(ce.__meta={nodeName:g.name,nodeId:p.value,index:J,totalEndpoints:he.length,endpointLabelLength:ae}),!s&&P===b.Main){const Q={uuid:gt(p.value,P,J),anchor:Ve,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:ce,showOutputLabel:f.value.length===1,size:f.value.length>=3?"small":"medium",endpointLabelLength:ae,hoverMessage:l.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!s,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:p.value,type:P,index:J,category:T==null?void 0:T.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};if(T!=null&&T.category&&(Q.cssClass=`${Q.cssClass} ${T==null?void 0:T.category}`),!t||!c.value)return;const ee=t.addEndpoint(h.value[c.value.name],Q);k(ee,"plus",J),Array.isArray(ee)||(ee.__meta={nodeName:g.name,nodeId:p.value,index:J,nodeType:g.type,totalEndpoints:he.length})}}})}function re(g){const E=a.getNodeType(g.type,g.typeVersion)??a.getNodeType(Ao);y(g,E),V(g,E)}function v(g){return`--node-type-${g}-color`}function x(g,E){return g===b.Main?{paintStyle:lt(E,v(b.Main),g)}:Ce(g)?(O=>({endpoint:m(O,v(O))}))(g):{}}function F(g,E,_){const O=L=>({endpoint:w(),paintStyle:De(_,v(L)),hoverPaintStyle:De(_,v(L))}),A="output";return g===b.Main?E.category==="error"?{paintStyle:{...De(_,v(b.Main)),fill:"var(--color-danger)"},cssClass:`dot-${A}-endpoint`}:{paintStyle:De(_,v(b.Main)),cssClass:`dot-${A}-endpoint`}:Ce(g)?O(g):{}}function de(g){r.isTouchDevice&&i.isActionActive("dragActive")&&i.removeActiveAction("dragActive")}function nt(g){var _,O;const E=g.path||((_=g.composedPath)==null?void 0:_.call(g));for(let A=0;A<E.length;A++)if(E[A].className&&typeof E[A].className=="string"&&E[A].className.includes("no-select-on-click"))return;r.isTouchDevice||(i.isActionActive("dragActive")?i.removeActiveAction("dragActive"):(r.isCtrlKeyPressed(g)||n("deselectAllNodes"),i.isNodeSelected(((O=c.value)==null?void 0:O.name)??"")?n("deselectNode",e):n("nodeSelected",e)))}return{getSpacerIndexes:M,addInputEndpoints:y,addOutputEndpoints:V,addEndpointTestingData:k,addNode:re,getEndpointColor:v,getInputConnectionStyle:x,getOutputConnectionStyle:F,mouseLeftClick:nt,touchEnd:de,inputs:u,outputs:f}}const Nn=Ee({name:"Node",components:{TitledList:xo,FontAwesomeIcon:yo,NodeIcon:_o},props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1},name:{type:String,required:!0},instance:{type:Object,required:!0},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},emits:{run:null,runWorkflow:null,removeNode:null,toggleDisableNode:null},setup(e,{emit:t}){const o=ue(),s=$e(),n=lo(),i=ro(),r=o.getNodeByName(e.name),d=We(r),a=ke(),{callDebounced:l}=ao(),h=wo({name:e.name,instance:e.instance,workflowObject:e.workflow,isReadOnly:e.isReadOnly,emit:t});return{contextMenu:s,externalHooks:n,nodeHelpers:i,pinnedData:d,deviceSupport:a,...h,callDebounced:l}},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},computed:{...St(be,ot,Ze,me,ue,kt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""},showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?no.includes(this.nodeType.name)?!1:this.nodeType.maxNodes===void 0||this.sameTypeNodes.length<this.nodeType.maxNodes:!0},isScheduledGroup(){var e;return((e=this.nodeType)==null?void 0:e.group.includes("schedule"))===!0},iconColorDefault(){if(this.isConfigNode)return"var(--color-text-base)"},nodeRunData(){return this.data?this.workflowsStore.getWorkflowResultDataByNodeName(this.data.name)??[]:[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error"].includes(this.nodeExecutionStatus)?!0:this.pinnedData.hasData.value?!1:!!(((e=this.data)==null?void 0:e.issues)!==void 0&&Object.keys(this.data.issues).length)},workflowDataItems(){const e=this.nodeRunData;return e===null?0:e.length},canvasOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},getTriggerNodeTooltip(){if(this.nodeType!==null&&this.nodeType.hasOwnProperty("eventTriggerDescription")){const e=this.$locale.shortNodeType(this.nodeType.name),{eventTriggerDescription:t}=this.nodeType;return this.$locale.nodeText().eventTriggerDescription(e,t??"")}else return this.$locale.baseText("node.waitingForYouToCreateAnEventIn",{interpolate:{nodeType:this.nodeType?Mo(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.data?this.workflowsStore.isNodeExecuting(this.data.name):!1},isSingleActiveTriggerNode(){return this.workflowsStore.workflowTriggerNodes.filter(t=>{const o=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);return o&&o.eventTriggerDescription!==""&&!t.disabled}).length===1},isManualTypeNode(){var e;return((e=this.data)==null?void 0:e.type)===Ro},isConfigNode(){return this.data?this.nodeTypesStore.isConfigNode(this.workflow,this.data,this.data.type??""):!1},isConfigurableNode(){var e;return this.data?this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??""):!1},isTriggerNode(){return this.data?this.nodeTypesStore.isTriggerNode(this.data.type):!1},isTriggerNodeTooltipEmpty(){return this.nodeType!==null?this.nodeType.eventTriggerDescription==="":!1},isNodeDisabled(){return this.node&&this.node.disabled},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.nodesByName[this.name]},sameTypeNodes(){return this.workflowsStore.allNodes.filter(e=>{var t;return e.type===((t=this.data)==null?void 0:t.type)})},nodeWrapperClass(){const e={"node-wrapper":!0,"node-wrapper--trigger":this.isTriggerNode,"node-wrapper--configurable":this.isConfigurableNode,"node-wrapper--config":this.isConfigNode};if(this.outputs.length){const o=we(this.outputs).filter(s=>s!==b.Main);o.length&&o.forEach(s=>{e[`node-wrapper--connection-type-${s}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=fe(this.workflow,this.node,this.nodeType)||[],s=we(t).filter(d=>d!==b.Main);if(s.length){t.filter(a=>typeof a!="string"&&a.required);let d=0;e["--configurable-node-input-count"]=s.length+d}let n=[];this.workflow.nodes[this.node.name]&&(n=Re(this.workflow,this.node,this.nodeType));const r=we(n).filter(d=>d===b.Main);e["--node-main-output-count"]=r.length}return e},nodeClass(){var e;return{"node-box":!0,disabled:(e=this.data)==null?void 0:e.disabled,executing:this.isExecuting}},nodeExecutionStatus(){var t;const e=(t=this.workflowsStore.getWorkflowRunData)==null?void 0:t[this.name];return e?e.filter(Boolean)[0].executionStatus??"":""},nodeIssues(){var o,s;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(n=>{if(n!=null&&n.error){const{message:i,description:r}=n.error,d=`${i}${r?` (${r})`:""}`;e.push(vo(d))}}),((s=this.data)==null?void 0:s.issues)!==void 0&&e.push(...No(this.data.issues,this.data)),e},nodeDisabledTitle(){var e;return(e=this.data)!=null&&e.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLineThrough(){var e;return!this.isConfigurableNode&&!!((e=this.data)!=null&&e.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){var e;return this.$locale.shortNodeType(((e=this.data)==null?void 0:e.type)??"")},nodeTitle(){var e,t;return((e=this.data)==null?void 0:e.name)==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):((t=this.data)==null?void 0:t.name)??""},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=an(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===Wo?this.$locale.baseText("node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall"):this.$locale.baseText("node.nodeIsWaitingTill",{interpolate:{date:o.toLocaleDateString(),time:o.toLocaleTimeString()}})}}},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},nodeStyle(){var o,s,n,i;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),(o=this.data)!=null&&o.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((i=(n=(s=this.nodeRunData)==null?void 0:s[0])==null?void 0:n.error)==null?void 0:i.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-node-pinned-border":this.nodeExecutionStatus==="unknown"?t="--color-foreground-xdark":this.workflowDataItems&&(e["border-width"]="2px",e["border-style"]="solid",t="--color-success")),e["border-color"]=`var(${t})`,e},isSelected(){return this.uiStore.getSelectedNodes.find(e=>{var t;return e.name===((t=this.data)==null?void 0:t.name)})!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.pinnedData.hasData.value&&!this.isNodeDisabled&&this.workflowRunning&&this.workflowDataItems===0&&this.isSingleActiveTriggerNode&&!this.isTriggerNodeTooltipEmpty&&!this.hasIssues&&!this.dragging},isContextMenuOpen(){var e;return this.contextMenu.isOpen.value&&this.contextMenu.target.value.source==="node-button"&&this.contextMenu.target.value.node.name===((e=this.data)==null?void 0:e.name)},iconNodeType(){var e,t,o;if(((e=this.data)==null?void 0:e.type)===$o||((t=this.data)==null?void 0:t.type)===Vo){const s=(o=this.data.parameters)==null?void 0:o.icon,n=this.workflow.expression.getSimpleParameterValue(this.data,s,"internal",{});if(n&&typeof n=="string")return this.nodeTypesStore.getNodeType(n)}return this.nodeType}},watch:{isActive(e,t){!e&&t&&this.setSubtitle()},canvasOffsetPosition(){this.showTriggerNodeTooltip&&(this.showTriggerNodeTooltip=!1,setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},200)),this.pinDataDiscoveryTooltipVisible&&(this.pinDataDiscoveryTooltipVisible=!1,setTimeout(()=>{this.pinDataDiscoveryTooltipVisible=!0},200))},shouldShowTriggerTooltip(e){e?setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},2500):this.showTriggerNodeTooltip=!1},nodeRunData:{deep:!0,handler(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}}},created(){yt(_t).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){if(this.data!==null)try{this.addNode(this.data)}catch{}setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{var e;this.$emit("run",{name:(e=this.data)==null?void 0:e.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isAnyModalOpen||e===0||(yt(_t).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){if(!(!this.data||!this.nodeType))try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)??"";this.nodeSubtitle=e.includes(Bo)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new Uo(this.data.name,!this.data.disabled,this.data.disabled===!0)),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}))},executeNode(){var e,t;this.$emit("runWorkflow",(e=this.data)==null?void 0:e.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:(t=this.data)==null?void 0:t.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){var e,t;this.$telemetry.track("User clicked node hover button",{node_type:(e=this.data)==null?void 0:e.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",(t=this.data)==null?void 0:t.name)},toggleDisableNode(e){var t;e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:(t=this.data)==null?void 0:t.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}),this.$emit("toggleDisableNode",this.data)},onClick(e){this.callDebounced(this.onClickDebounced,{debounceTime:50,trailing:!0},e)},onClickDebounced(...e){const t=e[0];t.detail>=2?this.setNodeActive():this.mouseLeftClick(t)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},openContextMenu(e,t){this.data&&this.contextMenu.open(e,{source:t,node:this.data})}}}),mo=e=>(en("data-v-b3e246ea"),e=e(),tn(),e),Sn=["id","data-name","data-node-type"],kn={class:"select-background"},Tn={key:0,class:"trigger-icon"},bn=["innerHTML"],En={key:0,class:"node-issues","data-test-id":"node-issues"},Cn={key:1,class:"waiting"},Dn=["textContent"],In={key:2,class:"node-pin-data-icon"},On={key:0,class:"items-count"},An={key:3},Pn={key:4,class:"data-count"},xn={key:0,class:"items-count"},_n=["title"],Mn={class:"node-trigger-tooltip__wrapper"},Rn=["textContent"],Wn=mo(()=>C("span",null,null,-1)),$n=mo(()=>C("span",null,null,-1)),Vn={class:"node-description"},Bn=["title"],Un={"data-test-id":"canvas-node-box-title"},Ln={key:0},Fn=["title"],Hn={class:"node-options-inner"};function jn(e,t,o,s,n,i){var p;const r=R("FontAwesomeIcon"),d=R("n8n-tooltip"),a=R("TitledList"),l=R("NodeIcon"),h=R("n8n-icon-button"),c=st("touch");return e.data?(N(),D("div",{key:0,id:e.nodeId,ref:e.data.name,class:$(e.nodeWrapperClass),style:ie(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(p=e.nodeType)==null?void 0:p.name,onContextmenu:t[4]||(t[4]=u=>e.openContextMenu(u,"node-right-click"))},[ne(C("div",kn,null,512),[[Se,e.isSelected]]),C("div",{class:$({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[ne((N(),D("div",{class:$(e.nodeClass),style:ie(e.nodeStyle),onClick:t[0]||(t[0]=le((...u)=>e.onClick&&e.onClick(...u),["left"]))},[e.isTriggerNode?(N(),D("i",Tn,[I(d,{placement:"bottom"},{content:W(()=>[C("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,bn)]),default:W(()=>[I(r,{icon:"bolt",size:"lg"})]),_:1})])):U("",!0),e.data.disabled?U("",!0):(N(),D("div",{key:1,class:$({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(N(),D("div",En,[I(d,{"show-after":500,placement:"bottom"},{content:W(()=>[I(a,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:W(()=>[I(r,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(N(),D("div",Cn,[I(d,{placement:"bottom"},{content:W(()=>[C("div",{textContent:G(e.waiting)},null,8,Dn)]),default:W(()=>[I(r,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(N(),D("span",In,[I(r,{icon:"thumbtack"}),e.workflowDataItems>1?(N(),D("span",On,G(e.workflowDataItems),1)):U("",!0)])):e.nodeExecutionStatus==="unknown"?(N(),D("span",An)):e.workflowDataItems?(N(),D("span",Pn,[I(r,{icon:"check"}),e.workflowDataItems>1?(N(),D("span",xn,G(e.workflowDataItems),1)):U("",!0)])):U("",!0)],2)),C("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[I(r,{icon:"sync-alt",spin:""})],8,_n),C("div",Mn,[I(d,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:W(()=>[C("div",{textContent:G(e.getTriggerNodeTooltip)},null,8,Rn)]),default:W(()=>[Wn]),_:1},8,["visible"]),e.isTriggerNode?(N(),H(d,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:W(()=>[fo(G(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:W(()=>[$n]),_:1},8,["visible"])):U("",!0)]),I(l,{class:"node-icon","node-type":e.iconNodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[c,e.touchStart,"start"],[c,e.touchEnd,"end"]]),e.showDisabledLineThrough?(N(),D("div",{key:0,class:$({"disabled-line-through":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):U("",!0)],2),C("div",Vn,[C("div",{class:"node-name",title:e.nodeTitle},[C("p",Un,G(e.nodeTitle),1),e.data.disabled?(N(),D("p",Ln,"("+G(e.$locale.baseText("node.disabled"))+")",1)):U("",!0)],8,Bn),e.nodeSubtitle!==void 0?(N(),D("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},G(e.nodeSubtitle),9,Fn)):U("",!0)]),e.isReadOnly?U("",!0):ne((N(),D("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=le(()=>{},["stop"])),onMousedown:t[3]||(t[3]=le(()=>{},["stop"]))},[C("div",Hn,[e.isConfigNode?U("",!0):(N(),H(h,{key:0,"data-test-id":"execute-node-button",type:"tertiary",text:"",size:"small",icon:"play",disabled:e.workflowRunning,title:e.$locale.baseText("node.testStep"),onClick:e.executeNode},null,8,["disabled","title","onClick"])),I(h,{"data-test-id":"disable-node-button",type:"tertiary",text:"",size:"small",icon:"power-off",title:e.nodeDisabledTitle,onClick:e.toggleDisableNode},null,8,["title","onClick"]),I(h,{"data-test-id":"delete-node-button",type:"tertiary",size:"small",text:"",icon:"trash",title:e.$locale.baseText("node.delete"),onClick:e.deleteNode},null,8,["title","onClick"]),I(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=u=>e.openContextMenu(u,"node-button"))})])],544)),[[Se,!e.hideActions]])],46,Sn)):U("",!0)}const Kn=Te(Nn,[["render",jn],["__scopeId","data-v-b3e246ea"]]),zn=Ee({name:"Sticky",props:{nodeViewScale:{type:Number,default:1},gridSize:{type:Number,default:Me},name:{type:String,required:!0},instance:{type:Object,required:!0},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},emits:{removeNode:null,nodeSelected:null},setup(e,{emit:t}){const o=ke(),s=co(),n=j(),i=j(!1),r=l=>{i.value=l},d=$e(l=>{var h;l==="change_color"&&(r(!0),(h=n.value)==null||h.click())}),a=wo({name:e.name,instance:e.instance,workflowObject:e.workflow,isReadOnly:e.isReadOnly,emit:t});return{deviceSupport:o,toast:s,colorPopoverTrigger:n,contextMenu:d,forceActions:i,...a,setForceActions:r}},data(){return{isResizing:!1,isTouchActive:!1}},computed:{...St(be,me,Ze,ot,ue,kt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""},defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&ct(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>{var t;return e.name===((t=this.data)==null?void 0:t.name)})!==void 0},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.getNodeByName(this.name)},position(){return this.node?this.node.position:[0,0]},height(){return this.node&&Le(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&Le(this.node.parameters.width)?this.node.parameters.width:0},stickySize(){return{height:this.height+"px",width:this.width+"px"}},stickyPosition(){return{left:this.position[0]+"px",top:this.position[1]+"px",zIndex:this.isActive?9999999:-1*Math.floor(this.height*this.width/1e3)}},showActions(){return!(this.hideActions||this.isReadOnly||this.workflowRunning||this.isResizing)||this.forceActions},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")}},mounted(){if(this.data!==null)try{this.addNode(this.data)}catch{}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){Lo(this.data),await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){var t,o;this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...(t=this.node)==null?void 0:t.parameters,color:e},position:((o=this.node)==null?void 0:o.position)??[0,0]}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e){if(e){const t=this.name===uo,o=e.querySelector('img[alt="n8n quickstart video"]'),s=t&&o?"welcome_video":t&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){this.node&&(this.node.parameters.content=e,this.setParameters({content:e}))},onResizeStart(){this.isResizing=!0,!this.isSelected&&this.node&&this.$emit("nodeSelected",this.node.name,!1,!0)},onResize({height:e,width:t,dX:o,dY:s}){this.node&&((o!==0||s!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(s||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:ct(e.content)?e.content:this.node.parameters.content,height:Le(e.height)?e.height:this.node.parameters.height,width:Le(e.width)?e.width:this.node.parameters.width,color:ct(e.color)?e.color:this.node.parameters.color},o={key:this.node.id,name:this.node.name,value:t};this.workflowsStore.setNodeParameters(o)}},setPosition(e){if(!this.node)return;const t={name:this.node.name,properties:{position:e}};this.workflowsStore.updateNodeProperties(t)},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&!this.isActive?this.contextMenu.open(e,{source:"node-right-click",node:this.node}):e.stopPropagation()}}}),qn=["id","data-name"],Gn={class:"select-sticky-background"},Yn=["title"],Jn=["title"],Xn={class:"content"},Zn=["onClick"];function Qn(e,t,o,s,n,i){var h,c;const r=R("n8n-sticky"),d=R("font-awesome-icon"),a=R("n8n-popover"),l=st("touch");return N(),D("div",{id:e.nodeId,ref:(h=e.data)==null?void 0:h.name,class:"sticky-wrapper",style:ie(e.stickyPosition),"data-name":(c=e.data)==null?void 0:c.name,"data-test-id":"sticky"},[C("div",{class:$({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:ie(e.stickySize)},[ne(C("div",Gn,null,512),[[Se,e.isSelected]]),ne((N(),D("div",{class:"sticky-box",onClick:t[0]||(t[0]=le((...p)=>e.mouseLeftClick&&e.mouseLeftClick(...p),["left"])),onContextmenu:t[1]||(t[1]=(...p)=>e.onContextMenu&&e.onContextMenu(...p))},[e.node?(N(),H(r,{key:0,id:e.node.id,"model-value":e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,"background-color":e.node.parameters.color,"read-only":e.isReadOnly,"default-text":e.defaultText,"edit-mode":e.isActive&&!e.isReadOnly,"grid-size":e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["id","model-value","height","width","scale","background-color","read-only","default-text","edit-mode","grid-size","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])):U("",!0)],32)),[[l,e.touchStart,"start"],[l,e.touchEnd,"end"]]),ne(C("div",{class:$({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[ne((N(),D("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.delete")},[I(d,{icon:"trash"})],8,Yn)),[[l,e.deleteNode,"tap"]]),I(a,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:W(()=>[C("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[I(d,{icon:"palette"})],8,Jn)]),default:W(()=>[C("div",Xn,[(N(!0),D(Qe,null,et(Array.from({length:7}),(p,u)=>{var f,m;return N(),D("div",{key:u,class:$(["color",`sticky-color-${u+1}`]),"data-test-id":"color",style:ie({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${u+1})`,"box-shadow":u===0&&((f=e.node)==null?void 0:f.parameters.color)===""||u+1===((m=e.node)==null?void 0:m.parameters.color)?`0 0 0 1px var(--color-sticky-background-${u+1})`:"none"}),onClick:w=>e.changeColor(u+1)},null,14,Zn)}),128))])]),_:1},8,["onShow","onHide"])],2),[[Se,e.showActions]])],6)],12,qn)}const ei=Te(zn,[["render",Qn],["__scopeId","data-v-0582f633"]]),ti=["textContent"],oi=Ee({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=vt(),s=X(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(n,i)=>{const r=R("font-awesome-icon"),d=R("n8n-tooltip");return N(),D("div",{ref:"container",class:$(n.$style.canvasAddButton),style:ie(s.value),"data-test-id":"canvas-add-button"},[I(d,{placement:"top",visible:n.showTooltip,disabled:se(o).showScrim,"popper-class":n.$style.tooltip,"show-after":700},{content:W(()=>[fo(G(n.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:W(()=>[C("button",{class:$(n.$style.button),"data-test-id":"canvas-plus-button",onClick:i[0]||(i[0]=a=>n.$emit("click"))},[I(r,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),C("p",{class:$(n.$style.label),textContent:G(n.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,ti)],6)}}}),si="_canvasAddButton_1easi_1",ni="_button_1easi_13",ii="_label_1easi_34",ri={canvasAddButton:si,button:ni,label:ii},ai={$style:ri},di=Te(oi,[["__cssModules",ai]]),li=["onClick"],ci=Ee({__name:"NextStepPopup",emits:["optionSelected"],setup(e,{emit:t}){const o=ho(),s=tt(),n=Fo(),i=t,r=X(()=>o.assistantChatOpen),d=X(()=>o.nextStepPopupConfig.title),a=X(()=>[{label:s.baseText("nextStepPopup.option.choose"),icon:"➕",key:"choose",disabled:!1},{label:s.baseText("nextStepPopup.option.generate"),icon:"✨",key:"generate",disabled:r.value}]),l=X(()=>[o.nextStepPopupConfig.position[0],o.nextStepPopupConfig.position[1]]),h=X(()=>({left:`${l.value[0]}px`,top:`${l.value[1]}px`})),c=()=>{o.closeNextStepPopup()},p=u=>{u==="choose"?i("optionSelected",u):u==="generate"&&(n.track("User clicked generate AI button",{},{withPostHog:!0}),o.assistantChatOpen=!0),c()};return(u,f)=>{const m=st("on-click-outside");return ne((N(),D("div",{class:$(u.$style.container),style:ie(h.value)},[C("div",{class:$(u.$style.title)},G(d.value),3),C("ul",{class:$(u.$style.options)},[(N(!0),D(Qe,null,et(a.value,w=>(N(),D("li",{key:w.key,class:$({[u.$style.option]:!0,[u.$style.disabled]:w.disabled}),onClick:S=>p(w.key)},[C("div",{class:$(u.$style.icon)},G(w.icon),3),C("div",{class:$(u.$style.label)},G(w.label),3)],10,li))),128))],2)],6)),[[m,c]])}}}),ui="_container_1bss5_1",hi="_title_1bss5_33",pi="_options_1bss5_39",fi="_option_1bss5_39",wi="_disabled_1bss5_57",mi={container:ui,title:hi,options:pi,option:fi,disabled:wi},gi={$style:mi},yi=Te(ci,[["__cssModules",gi]]);function vi(e,t={}){const o=me(),s=j([0,0]),n=ke();function i(l){const h=o.nodeViewOffsetPosition,[c,p]=Xe(l),u=h[0]+(c-s.value[0]),f=h[1]+(p-s.value[1]);return o.nodeViewOffsetPosition=[u,f],s.value=[c,p],[u,f]}function r(l,h){if(!(n.isCtrlKeyPressed(l)||h)||o.isActionActive("dragActive"))return;l.button!==Ho.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[c,p]=Xe(l);s.value=[c,p];const u=se(e);u==null||u.addEventListener("mousemove",a)}function d(){if(!o.nodeViewMoveInProgress)return;const l=se(e);l==null||l.removeEventListener("mousemove",a),o.nodeViewMoveInProgress=!1}function a(l){const h=se(e);if(!(l.target&&!(h===l.target||h!=null&&h.contains(l.target)))&&!o.isActionActive("dragActive")){if(l instanceof MouseEvent&&l.buttons===Mt.MIDDLE&&(o.nodeViewMoveInProgress=!0),l instanceof MouseEvent&&l.buttons===Mt.NONE){const c=se(t.onMouseMoveEnd);c==null||c(l);return}i(l)}}return{moveLastPosition:s,onMouseDown:r,onMouseUp:d,onMouseMove:a,panCanvas:i}}const Ni=Tt(async()=>await Nt(()=>import("./NodeCreation-B7Uimsok.js").then(e=>e.N),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Si=Tt(async()=>await Nt(()=>import("./CanvasControls-m_3acPPd.js"),__vite__mapDeps([34,9,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,35]))),ki=Tt(async()=>await Nt(()=>import("./SetupWorkflowCredentialsButton-BR-ObOqw.js"),__vite__mapDeps([36,8,5,9,1,2,3,4,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),Ti=Ee({name:"NodeView",components:{NodeDetailsView:rn,Node:Kn,Sticky:ei,CanvasAddButton:di,KeyboardShortcutTooltip:jo,NodeCreation:Ni,CanvasControls:Si,ContextMenu:vn,SetupWorkflowCredentialsButton:ki,NextStepPopup:yi},async beforeRouteLeave(e,t,o){if(Fe(e)===Ie.EXECUTIONS||t.name===B.TEMPLATE_IMPORT||Fe(e)===Ie.WORKFLOW&&t.name===B.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const s=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});s===He?(this.workflowsStore.setWorkflowId(Oe),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.npsSurveyStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===B.NEW_WORKFLOW?(await this.$router.replace({name:B.WORKFLOW,params:{name:this.currentWorkflow}}),await this.$router.push(e)):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):s===Rt&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Oe),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},setup(){const e=j(null),t=j(null),o=j(null),s=on(),n=Ze(),i=lo(),r=tt(),d=$e(),a=qs(),l=ro(),h=Ko(),{activeNode:c}=To(n),p=We(c),u=ke(),{callDebounced:f}=ao(),m=vi(e,{onMouseMoveEnd:o}),w=zo({router:s}),{runWorkflow:S,stopCurrentExecution:k}=qo({router:s});return{locale:r,contextMenu:d,dataSchema:a,nodeHelpers:l,externalHooks:i,clipboard:h,pinnedData:p,deviceSupport:u,canvasPanning:m,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:w,runWorkflow:S,stopCurrentExecution:k,callDebounced:f,...hn(),...Go(),...Yo(),...co(),...Jo(),...pn(),...nn()}},data(){return{GRID_SIZE:Me,STICKY_NODE_TYPE:oe,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,credentialsUpdated:!1,pullConnActiveNodeName:null,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,isInsertingNodes:!1,isProductionExecutionPreview:!1,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:K,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},computed:{...St(ot,ds,as,vt,be,Ze,rs,is,ns,me,ue,ss,vt,os,ts,kt,es,cn,ln,so,Qo,Zo,ho,Xo),nativelyNumberSuffixedDefaults(){return this.nodeTypesStore.nativelyNumberSuffixedDefaults},currentUser(){return this.usersStore.currentUser},activeNode(){return this.ndvStore.activeNode},executionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},isDemo(){return this.$route.name===B.DEMO},showCanvasAddButton(){return!this.isLoading&&!this.containsTrigger&&!this.isDemo&&!this.readOnlyEnv},lastSelectedNode(){return this.uiStore.getLastSelectedNode},nodes(){return this.workflowsStore.allNodes},nodesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type!==oe)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===oe)},runButtonText(){return this.workflowRunning?this.executionWaitingForWebhook?this.$locale.baseText("nodeView.runButtonText.waitingForTriggerEvent"):this.$locale.baseText("nodeView.runButtonText.executingWorkflow"):this.$locale.baseText("nodeView.runButtonText.executeWorkflow")},workflowStyle(){const e=this.uiStore.nodeViewOffsetPosition;return{left:e[0]+"px",top:e[1]+"px"}},canvasAddButtonStyle(){return{"pointer-events":this.createNodeActive?"none":"all"}},backgroundStyle(){return ls(this.nodeViewScale,this.uiStore.nodeViewOffsetPosition,this.isExecutionPreview)},workflowClasses(){const e=[];return(this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&(this.uiStore.nodeViewMoveInProgress?e.push("move-in-process"):e.push("move-active")),(this.selectActive||this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&e.push("do-not-select"),this.connectionDragScope.type&&(e.push("connection-drag-scope-active"),e.push(`connection-drag-scope-active-type-${this.connectionDragScope.type}`),e.push(`connection-drag-scope-active-connection-${this.connectionDragScope.connection}`)),e},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){var e;return((e=this.$route.params.name)==null?void 0:e.toString())||this.workflowsStore.workflowId},workflowName(){return this.workflowsStore.workflowName},allTriggersDisabled(){return this.triggerNodes.filter(t=>t.disabled).length===this.triggerNodes.length},triggerNodes(){return this.nodes.filter(e=>e.type===cs||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[us,ut].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.canvasChatNode?this.containsChatNodes&&this.triggerNodes.length===1&&!this.pinnedChatNodeData:!1},canvasChatNode(){return this.nodes.find(e=>e.type===ut)},pinnedChatNodeData(){return this.canvasChatNode?this.workflowsStore.pinDataByNodeName(this.canvasChatNode.name):null},isExecutionDisabled(){return this.containsChatNodes&&this.triggerNodes.every(e=>e.disabled||e.type===ut)&&!this.pinnedChatNodeData?!0:!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance},isLoading(){return this.canvasStore.isLoading},currentWorkflowObject(){return this.workflowsStore.getCurrentWorkflow()},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},isNextStepPopupVisible(){return this.aiStore.nextStepPopupConfig.open},shouldShowNextStepDialog(){const e=yt(Gs).value==="true",t=this.aiStore.isAssistantExperimentEnabled;return this.settingsStore.isCloudDeployment&&t&&!e}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=Fe(e),s=!this.uiStore.nodeViewInitialized;let n=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Oe)&&t.name!==B.NEW_WORKFLOW&&e.params.action!=="workflowSave";const i=e.name===B.TEMPLATE_IMPORT;if(o===Ie.WORKFLOW||i){if(n||s||i){if(this.canvasStore.startLoading(),s){const r=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=r}await this.initView(),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ie.EXECUTIONS&&(n=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),n&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.nodeViewRef;t&&(t.style.transform=`scale(${e})`)}},errorCaptured:e=>{console.error("errorCaptured"),console.error(e)},async mounted(){var t;if(this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),!this.nodeViewRef){this.showError(new Error("NodeView reference not found"),this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=(()=>{if(this.settingsStore.isPreviewMode&&this.isDemo)return[];const o=[this.loadActiveWorkflows(),this.loadCredentialTypes()];return this.settingsStore.isEnterpriseFeatureEnabled(ht.Variables)&&o.push(this.loadVariables()),this.settingsStore.isEnterpriseFeatureEnabled(ht.ExternalSecrets)&&o.push(this.loadSecrets()),o})();this.nodeTypesStore.allNodeTypes.length===0&&e.push(this.loadNodeTypes());try{await Promise.all(e)}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}if(un(async()=>{try{try{this.bindCanvasEvents()}catch{}await this.initView(),window.parent&&window.parent.postMessage(JSON.stringify({command:"n8nReady",version:this.rootStore.versionCli}),"*")}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted2.title"),this.$locale.baseText("nodeView.showError.mounted2.message")+":")}this.canvasStore.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)},0)}),this.externalHooks.run("nodeView.mount").catch(()=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&hs(this.currentUser)<=ps){const o=await this.uiStore.getNextOnboardingPrompt(),s=(o==null?void 0:o.toast_sequence_number)===1?fs:1e3;o!=null&&o.title&&(o!=null&&o.description)&&setTimeout(async()=>{this.showToast({type:"info",title:o.title,message:o.description,duration:0,customClass:"clickable",closeOnClick:!0,onClick:()=>{this.$telemetry.track("user clicked onboarding toast",{seq_num:o.toast_sequence_number,title:o.title,description:o.description}),this.uiStore.openModal(ws)}})},s)}Wt.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.registerCustomAction({key:"showNodeCreator",action:()=>{this.ndvStore.activeNodeName=null,this.$nextTick(()=>{this.showTriggerCreator(K.TAB)})}}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON),this.uiStore.addFirstStepOnLoad=!1,this.bindCanvasEvents(),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("message",this.onPostMessageReceived),window.addEventListener("pageshow",this.onPageShow),z.on("newWorkflow",this.newWorkflow),z.on("importWorkflowData",this.onImportWorkflowDataEvent),z.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),z.on("openChat",this.onOpenChat),q.on("nodeMove",this.onMoveNode),q.on("revertAddNode",this.onRevertAddNode),q.on("revertRemoveNode",this.onRevertRemoveNode),q.on("revertAddConnection",this.onRevertAddConnection),q.on("revertRemoveConnection",this.onRevertRemoveConnection),q.on("revertRenameNode",this.onRevertNameChange),q.on("enableNodeToggle",this.onRevertEnableToggle),je.on("pin-data",this.addPinDataConnections),je.on("unpin-data",this.removePinDataConnections),z.on("saveWorkflow",this.saveCurrentWorkflowExternal),this.canvasStore.isDemo=this.isDemo},deactivated(){this.unbindCanvasEvents(),document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("message",this.onPostMessageReceived),window.removeEventListener("beforeunload",this.onBeforeUnload),window.removeEventListener("pageshow",this.onPageShow),z.off("newWorkflow",this.newWorkflow),z.off("importWorkflowData",this.onImportWorkflowDataEvent),z.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),z.off("openChat",this.onOpenChat),q.off("nodeMove",this.onMoveNode),q.off("revertAddNode",this.onRevertAddNode),q.off("revertRemoveNode",this.onRevertRemoveNode),q.off("revertAddConnection",this.onRevertAddConnection),q.off("revertRemoveConnection",this.onRevertRemoveConnection),q.off("revertRenameNode",this.onRevertNameChange),q.off("enableNodeToggle",this.onRevertEnableToggle),je.off("pin-data",this.addPinDataConnections),je.off("unpin-data",this.removePinDataConnections),z.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect(),this.collaborationStore.initialize()},beforeUnmount(){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),this.unregisterCustomAction("showNodeCreator"),this.unregisterCustomAction("openNodeDetail"),this.unregisterCustomAction("openSelectiveNodeCreator"),this.isDemo||this.pushStore.pushDisconnect(),this.collaborationStore.terminate(),this.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),z.off("newWorkflow",this.newWorkflow),z.off("importWorkflowData",this.onImportWorkflowDataEvent),z.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Oe),Wt.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const s=t??this.ndvStore.activeNodeName,n=s?this.workflowsStore.getNodeByName(s):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&n&&this.insertNodeAfterSelected({index:0,endpointUuid:`${n.id}-input${e}0`,eventSource:K.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:n.id})})},editAllowedCheck(){return this.readOnlyNotification?!1:this.isReadOnlyRoute||this.readOnlyEnv?(this.readOnlyNotification=this.showMessage({title:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.title`:"readOnly.showMessage.executions.title"),message:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.message`:"readOnly.showMessage.executions.message"),type:"info",dangerouslyUseHTMLString:!0,onClose:()=>{this.readOnlyNotification=null}}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),s={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",push_ref:this.ndvStore.pushRef};this.$telemetry.track("User clicked execute node button",s),this.externalHooks.run("nodeView.onRunNode",s),this.runWorkflow({destinationNode:e,source:t})},async onOpenChat(){const e={workflow_id:this.workflowsStore.workflowId};this.$telemetry.track("User clicked chat open button",e),this.externalHooks.run("nodeView.onOpenChat",e),this.uiStore.openModal(ms)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(at(e,this.workflowHelpers.getNodeTypes(),{isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph)};this.$telemetry.track("User clicked execute workflow button",t),this.externalHooks.run("nodeView.onRunWorkflow",t)}),await this.runWorkflow({}),this.refreshEndpointsErrorsState()},resetEndpointsErrors(){Object.values(this.instance.getManagedElements()).flatMap(t=>t.endpoints).filter(t=>(t==null?void 0:t.endpoint.type)===gs).forEach(t=>{const o=t==null?void 0:t.endpoint;o&&((t==null?void 0:t.connections)??[]).length>0&&o.resetError()})},refreshEndpointsErrorsState(){const e=this.workflowsStore.allNodes.filter(t=>t.issues);this.resetEndpointsErrors(),e.forEach(t=>{var n;const o=this.instance.getManagedElement(t.id),s=this.instance.getEndpoints(o);Object.keys(((n=t==null?void 0:t.issues)==null?void 0:n.input)??{}).forEach(i=>{s.filter(d=>d._defaultType.scope===i).forEach(d=>{const a=d==null?void 0:d.endpoint;a&&a.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst"),t=this.showMessage({type:"info",title:this.$locale.baseText("nodeView.cantExecuteNoTrigger"),message:e,duration:3e3,onClick:()=>setTimeout(()=>{this.createNodeActive&&t.close()},0),dangerouslyUseHTMLString:!0})},clearExecutionData(){this.workflowsStore.workflowExecutionData=null,this.nodeHelpers.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.workflowHelpers.saveCurrentWorkflow();t&&(await this.npsSurveyStore.fetchPromptsData(),this.$route.name===B.EXECUTION_DEBUG&&await this.$router.replace({name:B.WORKFLOW,params:{name:this.currentWorkflow}})),this.activeNode&&(e.target instanceof HTMLInputElement?t=e.target.readOnly:t=!0,t&&this.showMessage({title:this.$locale.baseText("generic.workflowSaved"),type:"success"}))},async onCanvasAddButtonCLick(e){if(e){if(this.shouldShowNextStepDialog){const t=e.target.closest("button");t&&(this.aiStore.latestConnectionInfo=null,this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.firstStep"),t));return}this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON);return}},onNextStepSelected(e){if(e==="choose"){const t=this.aiStore.latestConnectionInfo;t===null?this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON):this.insertNodeAfterSelected(t)}},showTriggerCreator(e){this.createNodeActive||(this.ndvStore.activeNodeName=null,this.nodeCreatorStore.setSelectedView(pt),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0,nodeCreatorView:pt}))},async openExecution(e){var o,s;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(n){this.showError(n,this.$locale.baseText("nodeView.showError.openExecution.title"));return}if(t===void 0)throw new Error(`Execution with id "${e}" could not be found!`);if(this.workflowsStore.setWorkflowName({newName:t.workflowData.name,setStateDirty:!1}),this.workflowsStore.setWorkflowId(Oe),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.sharedWithProjects&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWithProjects:t.workflowData.sharedWithProjects}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes(dt(t.workflowData.nodes),dt(t.workflowData.connections)),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!1,this.externalHooks.run("execution.open",{workflowId:t.workflowData.id,workflowName:t.workflowData.name,executionId:e}),this.$telemetry.track("User opened read-only execution",{workflow_id:t.workflowData.id,execution_mode:t.mode,execution_finished:t.finished}),!t.finished&&((s=(o=t.data)==null?void 0:o.resultData)!=null&&s.error)){let n=!1;if(t.data.resultData.runData){const i=t.data.resultData.runData;e:for(const r of Object.keys(i))for(const d of i[r])if(d.error){n=!0;break e}}!n&&(t.data.resultData.error.stack||t.data.resultData.error.message)&&(console.error(`Execution ${e} error:`),console.error(t.data.resultData.error.stack),this.showMessage({title:this.$locale.baseText("nodeView.showError.workflowError"),message:t.data.resultData.error.message,type:"error",duration:0}))}t.waitTill&&this.showMessage({title:this.$locale.baseText("nodeView.thisExecutionHasntFinishedYet"),message:`<a data-action="reload">${this.$locale.baseText("nodeView.refresh")}</a> ${this.$locale.baseText("nodeView.toSeeTheLatestStatus")}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${this.$locale.baseText("nodeView.moreInfo")}</a>`,type:"warning",duration:0}),this.canvasStore.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=ys(e.workflow.nodes),await this.addNodes(e.workflow.nodes,e.workflow.connections),e.workflow.pinData&&this.workflowsStore.setWorkflowPinData(e.workflow.pinData),await this.$nextTick(),this.canvasStore.zoomToFit()},async openWorkflowTemplate(e){this.canvasStore.startLoading(),this.canvasStore.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.executionsStore.activeExecution=null;let t;try{if(this.externalHooks.run("template.requested",{templateId:e}),t=await this.templatesStore.getFixedWorkflowTemplate(e),!t)throw new Error(this.$locale.baseText("nodeView.workflowTemplateWithIdCouldNotBeFound",{interpolate:{templateId:e}}))}catch(s){this.showError(s,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:B.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:vs(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:B.NEW_WORKFLOW,query:{templateId:e}});const o=t.workflow.nodes.map(this.workflowsStore.convertTemplateNodeToNodeUi);await this.addNodes(o,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name,this.projectsStore.currentProjectId)||{},this.workflowsStore.addToWorkflowMetadata({templateId:e}),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.externalHooks.run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.canvasStore.stopLoading()},async openWorkflow(e){this.canvasStore.startLoading();const t=this.executionsStore.activeExecution;this.resetWorkspace(),this.workflowsStore.addWorkflow(e),this.workflowsStore.setActive(e.active||!1),this.workflowsStore.setWorkflowId(e.id),this.workflowsStore.setWorkflowName({newName:e.name,setStateDirty:!1}),this.workflowsStore.setWorkflowSettings(e.settings??{}),this.workflowsStore.setWorkflowPinData(e.pinData??{}),this.workflowsStore.setWorkflowVersionId(e.versionId),this.workflowsStore.setWorkflowMetadata(e.meta),e.sharedWithProjects&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWithProjects:e.sharedWithProjects}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags??[],s=o.map(n=>n.id);this.workflowsStore.setWorkflowTagIds(s||[]),this.tagsStore.upsertTags(o),await this.addNodes(e.nodes,e.connections),this.credentialsUpdated||(this.uiStore.stateIsDirty=!1),this.canvasStore.zoomToFit(),this.externalHooks.run("workflow.open",{workflowId:e.id,workflowName:e.name}),(t==null?void 0:t.workflowId)!==e.id?(this.executionsStore.activeExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.executionsStore.activeExecution=t,this.canvasStore.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.deviceSupport.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.aiStore.closeNextStepPopup(),this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp()},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close(),this.aiStore.closeNextStepPopup();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),s=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,n=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,i=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!i){e.stopPropagation(),e.preventDefault();const a=!this.uiStore.stateIsDirty;if(this.isReadOnlyRoute||this.readOnlyEnv||a)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const r=(e==null?void 0:e.composedPath())??[];for(const a of r)if(a instanceof HTMLElement&&a.className&&typeof a.className=="string"&&a.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&n){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const d=this.uiStore.getSelectedNodes.map(a=>a&&this.workflowsStore.getNodeByName(a.name)).filter(a=>!!a);if(e.key==="d"&&n&&!i)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},d);else if(e.key==="d"&&t&&!i)d.length>0&&(e.preventDefault(),this.duplicateNodes(d));else if(e.key==="p"&&n&&!i)d.length>0&&(e.preventDefault(),this.togglePinNodes(d,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&n&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},d);else if(e.key==="Tab"&&n&&!i)this.onToggleNodeCreator({source:K.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!i&&!this.isExecutionDisabled)this.onRunWorkflow();else if(e.key==="S"&&o&&!i)this.onAddNodes({nodes:[{type:oe}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&n&&!i){const a=this.lastSelectedNode;a!==null&&a.type!==oe&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},a.name)}else if(e.key==="a"&&t)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectAllNodes,{debounceTime:1e3});else if(e.key==="c"&&t)this.callDebounced(this.copyNodes,{debounceTime:1e3},d);else if(e.key==="x"&&t&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},d);else if(e.key==="n"&&s){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.value.name===B.NEW_WORKFLOW?z.emit("newWorkflow"):this.$router.push({name:B.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&n){const a=this.lastSelectedNode;if(a!==null){if(a.type===oe&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=a.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&n){const a=this.lastSelectedNode;if(a===null)return;const l=this.workflowsStore.outgoingConnectionsByNodeName(a.name);if(l.main===void 0||l.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},l.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectUpstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowLeft"&&n){const a=this.lastSelectedNode;if(a===null)return;const l=this.workflowHelpers.getCurrentWorkflow();if(!l.connectionsByDestinationNode.hasOwnProperty(a.name))return;const h=l.connectionsByDestinationNode[a.name];if(h.main===void 0||h.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},h.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)&&n){const a=this.lastSelectedNode;if(a===null)return;const l=this.workflowHelpers.getCurrentWorkflow();if(!l.connectionsByDestinationNode.hasOwnProperty(a.name))return;const h=l.connectionsByDestinationNode[a.name];if(!Array.isArray(h.main)||!h.main.length)return;const c=h.main[0][0].node,p=this.workflowsStore.outgoingConnectionsByNodeName(c);if(!Array.isArray(p.main)||!p.main.length)return;let u,f=e.key==="ArrowUp"?-99999999:99999999,m=null;for(const w of p.main)for(const S of w)S.node!==a.name&&(u=this.workflowsStore.getNodeByName(S.node),u&&(e.key==="ArrowUp"?u.position[1]<=a.position[1]&&u.position[1]>f&&(m=u.name,f=u.position[1]):u.position[1]>=a.position[1]&&u.position[1]<f&&(m=u.name,f=u.position[1])));m!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},m,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.nodeHelpers.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(s=>!this.workflowsStore.pinDataByNodeName(s.name));for(const s of e){const n=We(s);if(o){const i=this.dataSchema.getInputDataWithPinned(s);i.length!==0&&n.setData(i,t)}else n.unsetData(t)}this.historyStore.stopRecordingUndo()},deleteNodes(e){this.historyStore.startRecordingUndo(),e.forEach(t=>{this.removeNode(t.name,!0,!1)}),setTimeout(()=>{this.historyStore.stopRecordingUndo()},200)},selectAllNodes(){this.nodes.forEach(e=>{this.nodeSelectedByName(e.name)})},selectUpstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("upstream",t,e.name);for(const s of o)this.nodeSelectedByName(s);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("downstream",t,e.name);for(const s of o)this.nodeSelectedByName(s);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const s=this.workflowsStore.nodesByName[e],n=this.workflowHelpers.getCurrentWorkflow(),i=this.workflowHelpers.getConnectedNodes("downstream",n,e);for(const r of i){const d=this.workflowsStore.nodesByName[r],a=d.position;if(d.position[0]<s.position[0])continue;const l={name:r,properties:{position:[d.position[0]+t,d.position[1]]}};this.workflowsStore.updateNodeProperties(l),this.onNodeMoved(d),(o&&a[0]!==l.properties.position[0]||a[1]!==l.properties.position[1])&&this.historyStore.pushCommandToUndo(new Ns(r,a,l.properties.position),o)}},cutNodes(e){const t=!this.isReadOnlyRoute&&!this.readOnlyEnv;this.copyNodes(e,t),t&&this.deleteNodes(e)},copyNodes(e,t=!1){this.getNodesToSave(e).then(o=>{const s={meta:{...this.workflowsStore.workflow.meta,instanceId:this.rootStore.instanceId},...o};delete s.meta.templateCredsSetupCompleted,this.workflowHelpers.removeForeignCredentialsFromWorkflow(s,this.credentialsStore.allCredentials);const n=JSON.stringify(s,null,2);this.clipboard.copy(n),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(i=>i.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.executionsStore.stopCurrentExecution(e)}catch(t){const o=await this.workflowsStore.getExecution(e);if(o===void 0)this.workflowsStore.finishActiveExecution({executionId:e,data:{finished:!0,stoppedAt:new Date}}),this.workflowsStore.executingNode.length=0,this.uiStore.removeActiveAction("workflowRunning"),this.titleSet(this.workflowsStore.workflowName,"IDLE"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.message"),type:"success"});else if(o!=null&&o.finished){const s={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},n={data:s,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(n),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(s),this.uiStore.removeActiveAction("workflowRunning"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.message"),type:"success"})}else this.showError(t,this.$locale.baseText("nodeView.showError.stopExecution.title"))}this.stopExecutionInProgress=!1,this.workflowHelpers.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(at(t,this.workflowHelpers.getNodeTypes(),{isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph)};this.$telemetry.track("User clicked stop workflow execution",o)})}},async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("nodeView.showError.stopWaitingForWebhook.title"));return}},async onClipboardPasteEvent(e){if(this.readOnlyEnv)return;if(Fe(this.$route)===Ie.WORKFLOW){let o;if(!this.editAllowedCheck())return;if(e.match(/^http[s]?:\/\/.*\.json$/i)){if(!this.editAllowedCheck()||await this.confirm(this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.cancelButtonText"),dangerouslyUseHTMLString:!0})!==He||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return o?await this.importWorkflowData(o,"paste",!1):void 0}},async getWorkflowDataFromUrl(e){let t;this.canvasStore.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.canvasStore.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.canvasStore.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const s={};if(e.nodes){const a=e.nodes.map(l=>l.name);e.nodes.forEach(l=>{if(!l.name){const h=this.nodeTypesStore.getNodeType(l.type),c=this.uniqueNodeName((h==null?void 0:h.displayName)??l.type,a);l.name=c,a.push(c)}if(l.webhookId&&Ss.includes(l.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(c=>c.webhookId===l.webhookId)&&(l.webhookId=pe()),l.id){const h=pe();s[h]=l.id,l.id=h}else l.id=pe()})}this.removeUnknownCredentials(e);const n=this.rootStore.instanceId,i=JSON.stringify(at(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:s,sourceInstanceId:e.meta&&e.meta.instanceId!==n?e.meta.instanceId:"",isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:i}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,ve(this.nodes,this.lastClickPosition));const r=await this.addNodesToWorkflow(e);setTimeout(()=>{((r==null?void 0:r.nodes)??[]).forEach(a=>{this.nodeSelectedByName(a.name)})});const d=this.settingsStore.areTagsEnabled;if(o&&d&&Array.isArray(e.tags)){const a=await this.tagsStore.fetchAll(),l=new Set(a.map(f=>f.name)),h=e.tags,c=h.filter(f=>!l.has(f.name)),p=[];for(const f of c){const m=this.tagsStore.create(f.name).then(w=>(a.push(w),w));p.push(m)}await Promise.all(p);const u=h.reduce((f,m)=>{const w=a.find(S=>S.name===m.name);return w&&f.push(w.id),f},[]);this.workflowsStore.addWorkflowTagIds(u),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)})}}catch(s){this.showError(s,this.$locale.baseText("nodeView.showError.importWorkflowData.title"))}},removeUnknownCredentials(e){if(e!=null&&e.nodes){for(const t of e.nodes)if(t.credentials)for(const[o,s]of Object.entries(t.credentials))typeof s=="string"||s.id===null||this.credentialsStore.getCredentialById(s.id)||delete t.credentials[o]}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=So(e.dataTransfer.getData(ks));if(t){const o=this.getMousePositionWithinNodeView(e),s=[o[0]-Ae/2+Me,o[1]-Ae/2];await this.onAddNodes(t,!0,s),this.createNodeActive=!1}},nodeDeselectedByName(e){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeDeselected(t)},nodeSelectedByName(e,t=!1,o){o===!0&&this.deselectAllNodes();const s=this.workflowsStore.getNodeByName(e);s&&(this.nodeSelected(s),this.uiStore.lastSelectedNode=s.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.newNodeInsertPosition=null,this.canvasStore.setLastSelectedConnection(void 0),t&&(this.ndvStore.activeNodeName=s.name))},showMaxNodeTypeError(e){const t=e.maxNodes;this.showMessage({title:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.title"),message:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.message",{adjustToNumber:t,interpolate:{nodeTypeDataDisplayName:e.displayName}}),type:"error",duration:0})},async getNewNodeWithDefaultCredential(e,t){var i,r,d,a;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const s={id:pe(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},n=(i=e.credentials)==null?void 0:i.map(l=>this.credentialsStore.getUsableCredentialByType(l.name)).flat();if(n&&n.length===1){const l=n[0],h=this.credentialsStore.getCredentialById(l.id),c={id:h.id,name:h.name},p={[l.type]:c};await this.loadNodesProperties([s].map(m=>({name:m.type,version:m.typeVersion})));const u=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),f=It((u==null?void 0:u.properties)||[],{},!0,!1,s);if(e.credentials){const m=e.credentials.find(S=>S.name===l.type);if((r=m==null?void 0:m.displayOptions)!=null&&r.hide)return s;const w=(d=m==null?void 0:m.displayOptions)==null?void 0:d.show;if(!w)return s.credentials=p,s;if(Object.keys(w).length===1&&w.authentication){s.credentials=p;let S={};for(const k of Object.keys(w)){if(f&&!f[k]){S={},s.credentials=void 0;break}const y=(a=w[k])==null?void 0:a[0];y&&typeof y=="string"&&(S[k]=y),s.parameters={...s.parameters,...S}}}}}return s},async injectNode(e,t={},o=!0,s=!1,n=!1){var l,h;const i=this.nodeTypesStore.getNodeType(e);if(i===null){this.showMessage({title:this.$locale.baseText("nodeView.showMessage.addNodeButton.title"),message:this.$locale.baseText("nodeView.showMessage.addNodeButton.message",{interpolate:{nodeTypeName:e}}),type:"error"});return}if(i.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=i.maxNodes){this.showMaxNodeTypeError(i);return}const r=await this.getNewNodeWithDefaultCredential(i,{name:t.name}),d=this.lastSelectedNode;if(t.position)r.position=ve(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(d){const c=this.canvasStore.lastSelectedConnection;if(c){const[p]=Ts(c);p<=bs&&this.pushDownstreamNodes(d.name,ft,s)}if(this.canvasStore.newNodeInsertPosition)r.position=ve(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+Me,this.canvasStore.newNodeInsertPosition[1]-Ae/2]),this.canvasStore.newNodeInsertPosition=null;else{let p=0;const u=this.workflowHelpers.getCurrentWorkflow();if(c){const k=this.nodeTypesStore.getNodeType(d.type,d.typeVersion);if(k){const y=[[-100,100],[-140,0,140],[-240,-100,100,240]],M=Re(u,d,k),re=we(M).filter(v=>v===b.Main);if(re.length>1){const v=y[re.length-2],x=c.__meta?c.__meta.sourceOutputIndex:0;p=v[x]}}}let f=[];try{f=Re(u,r,i)}catch{}const m=we(f),w=this.nodeTypesStore.getNodeType(d.type,d.typeVersion),S=u.getNode(d.name);if(!S||!w){console.error("Could not find last selected node or node type");return}if(m.length>0&&m.every(k=>k!==b.Main)){const k=fe(u,S,w),M=(we(k)||[]).filter(V=>V!==b.Main).findIndex(V=>f[0]===V);r.position=ve(this.nodes,[d.position[0]+Ae/(Math.max(((l=w==null?void 0:w.inputs)==null?void 0:l.length)??1),1)*M,d.position[1]+ft],[100,0])}else{const k=fe(u,d,w),y=we(k);let M=ft;y.find(V=>V!==b.Main)&&(M+=150),r.position=ve(this.nodes,[d.position[0]+M,d.position[1]+p],[100,0])}}}else{const c=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;r.position=ve(this.nodes,c)}const a=this.locale.localizeNodeName(r.name,r.type);if(r.name=this.uniqueNodeName(a),(h=i.webhooks)!=null&&h.length&&(r.webhookId=pe()),await this.addNodes([r],void 0,s),this.workflowsStore.setNodePristine(r.name,!0),this.uiStore.stateIsDirty=!0,e===oe)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),Es().trackAddedTrigger(e);const c={node_type:e,node_version:r.typeVersion,is_auto_add:n,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};d&&(c.input_node_type=d.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",c)}return s&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(r.name,o&&e!==oe)})),r},getConnection(e,t,o,s,n){const i=this.workflowsStore.outgoingConnectionsByNodeName(e)[n];if(i){const r=i[t];if(r)return r.find(d=>d.node===o&&d.index===s)}},connectTwoNodes(e,t,o,s,n){this.uiStore.stateIsDirty=!0;const i=this.workflowsStore.getNodeByName(e),r=this.workflowsStore.getNodeByName(o);if(i&&r&&!this.checkNodeConnectionAllowed(i,r,n)||this.getConnection(e,t,o,s,n))return;const d=[{node:e,type:n,index:t},{node:o,type:n,index:s}];this.__addConnection(d)},async addNode(e,t={},o=!0,s=!1,n=!1){var p;if(!this.editAllowedCheck())return;const i=this.lastSelectedNode,r=this.uiStore.lastSelectedNodeOutputIndex,d=this.uiStore.lastSelectedNodeEndpointUuid,a=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const l=await this.injectNode(e,t,o,s,n);if(!l)return;const h=r||0,c=d||"";if(d&&!n&&i){const u=this.instance.getEndpoint(d);if(u&&this.checkNodeConnectionAllowed(i,l,u.scope)){const f=u.scope,m=this.instance.getManagedElement(l.id),S=this.instance.getEndpoints(m).find(k=>k.scope===f&&u.parameters.connection!==k.parameters.connection);(p=this.instance)==null||p.connect({uuids:[c,(S==null?void 0:S.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(i&&!n){if(await this.$nextTick(),a!=null&&a.__meta){this.__deleteJSPlumbConnection(a,s);const u=a.__meta.targetNodeName,f=a.__meta.targetOutputIndex;this.connectTwoNodes(l.name,0,u,f,b.Main)}this.connectTwoNodes(i.name,h,l.name,0,b.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const s=this.workflowHelpers.getCurrentWorkflow(),n=s.getNode(e);if(!n)return{nodes:[]};const i=this.nodeTypesStore.getNodeType(n==null?void 0:n.type,n.typeVersion);if(i){const d=fe(s,n,i).filter(a=>!(typeof a=="string"||a.type!==t||!a.filter));d.length&&(o=d[0].filter)}return o},insertNodeAfterSelected(e){var i,r,d;const t=e.outputType??b.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((r=(i=e.connection)==null?void 0:i.target.jtk)==null?void 0:r.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&this.canvasStore.setLastSelectedConnection(e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const s=((d=e.connection)==null?void 0:d.endpoints[0].parameters.connection)==="source";t!==b.Main&&ko.includes(t)&&dn().gotoCompatibleConnectionView(t,s,this.getNodeCreatorFilter(o.name,t)).catch(()=>{})},async onEventConnectionAbort(e){var t,o,s;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const a=this.workflowsStore.getNodeById(e.parameters.nodeId),l=e.parameters.type??b.Main,h=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(a){const c=e.parameters.connection==="target",p=c?this.pullConnActiveNodeName:a.name,u=c?a.name:this.pullConnActiveNodeName,f=e.parameters.index;$t(e),await this.$nextTick(),this.connectTwoNodes(p,f,u,((o=h==null?void 0:h.parameters)==null?void 0:o.index)??0,l),this.pullConnActiveNodeName=null,this.dropPrevented=!1}return}const n=`${e.parameters.nodeId}-output${e.parameters.index}`,i=e.instance.getEndpoint(n);if(!((s=i==null?void 0:i.endpoint)!=null&&s.canvas)||!this.shouldShowNextStepDialog){this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:K.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type});return}const r=i.endpoint.canvas,d=new MutationObserver(a=>{if(a.find(h=>{var p,u;const c=h.target;return Ke(c)&&((u=(p=c.jtk)==null?void 0:p.endpoint)==null?void 0:u.uuid)===i.uuid&&c.style.display==="block"})){const h={sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:K.NODE_CONNECTION_DROP,outputType:e.parameters.type,endpointUuid:i.uuid,stepName:i.__meta.nodeName};this.aiStore.latestConnectionInfo=h,this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.nextStep"),r),d.disconnect();return}});d.observe(this.$refs.nodeViewRef,{attributes:!0,attributeFilter:["style"],subtree:!0})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var n;const s=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((n=s==null?void 0:s.inputs)!=null&&n.length){const i=this.workflowHelpers.getCurrentWorkflow(),r=i.getNode(t.name);let d=[];s&&r&&(d=fe(i,r,s));for(const a of d||[])if(!(typeof a=="string"||a.type!==o||!a.filter)&&a.filter.nodes.length&&!a.filter.nodes.includes(e.type))return this.dropPrevented=!0,this.showToast({title:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.title"),message:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.message",{interpolate:{sourceNodeName:e.name,targetNodeName:t.name}}),type:"error",duration:5e3}),!1}return!0},onInterceptBeforeDrop(e){try{let t,o;if(e.connection.endpoints[0].parameters.connection==="target"?(t=e.dropEndpoint.parameters,o=e.connection.endpoints[0].parameters):(t=e.connection.endpoints[0].parameters,o=e.dropEndpoint.parameters),t.type!==o.type||t.connection===o.connection)return this.dropPrevented=!0,!1;const s=this.workflowsStore.getNodeById(t.nodeId),n=this.workflowsStore.getNodeById(o.nodeId),i=(s==null?void 0:s.name)||"",r=(n==null?void 0:n.name)||"";return s&&n&&!this.checkNodeConnectionAllowed(s,n,o.type)?!1:this.getConnection(i,t.index,r,o.index,t.type)?(this.dropPrevented=!0,this.pullConnActiveNodeName=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const a=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=a}const s=e.sourceEndpoint.parameters,n=e.targetEndpoint.parameters,i=(t=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:t.name,r=(o=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:o.name;if(i&&r&&(e.connection.__meta={sourceNodeName:i,sourceOutputIndex:s.index,targetNodeName:r,targetOutputIndex:n.index}),ze(e.connection),Cs(e.targetEndpoint),!i||!r){console.error("Could not find source or target node name");return}const d=[{node:i,type:s.type,index:s.index},{node:r,type:n.type,index:n.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:d}),!this.isReadOnlyRoute&&!this.readOnlyEnv){Ds(e.sourceEndpoint),Is(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:s.index,connection:e.connection,eventSource:K.NODE_CONNECTION_ACTION})});const a=Os(e.connection,As);s.type!==b.Main&&(e.connection.setPaintStyle(Ps(e.connection,e.sourceEndpoint.parameters.category)),a==null||a.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new xs(d)),this.isInsertingNodes||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var a,l;Vt(e.source,e.target,(l=(a=e.connection)==null?void 0:a.connector)!=null&&l.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(s){console.error(s)}},addConectionsTestData(){this.instance.connections.forEach(e=>{var t;Vt(e.source,e.target,(t=e==null?void 0:e.connector)!=null&&t.hasOwnProperty("canvas")?e==null?void 0:e.connector.canvas:void 0)})},onDragMove(){const e=this.nodes.length;this.callDebounced(this.updateConnectionsOverlays,{debounceTime:e>20?200:0})},updateConnectionsOverlays(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Bt(t),Ut(t),Object.values(t.overlays).forEach(o=>{var s;o.canvas&&((s=this.instance)==null||s.repaint(o.canvas))})})},isConnectionActive(e){var t,o;return!(e!=null&&e.id)||!((t=this.activeConnection)!=null&&t.id)?!1:((o=this.activeConnection)==null?void 0:o.id)===e.id},onConnectionMouseOver(e){try{if(this.exitTimer!==void 0&&(clearTimeout(this.exitTimer),this.exitTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??this.enterTimer??!e??this.isConnectionActive(e))return;this.enterTimer=setTimeout(()=>{this.activeConnection&&!this.isConnectionActive(e)&&Lt(this.activeConnection)&&wt(this.activeConnection),this.enterTimer=void 0,e&&(_s(e),this.activeConnection=e)},150)}catch(t){console.error(t)}},onConnectionMouseOut(e){try{if(this.exitTimer||(this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??!e??!this.isConnectionActive(e)))return;this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,e&&this.isConnectionActive(e)&&Lt(this.activeConnection)&&(wt(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Ft(e.connection);const s=e.connection.parameters,n=e.originalEndpoint.parameters,i=[{node:((t=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:t.name)||"",type:s.type,index:s.index},{node:((o=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:o.name)||"",type:n.type,index:n.index}];this.__removeConnection(i,!1)}catch(s){console.error(s)}},onEndpointMouseOver(e,t){!e.isTarget||t.target!==e.endpoint.canvas||this.instance.setHover(e,!0)},onEndpointMouseOut(e){e.isTarget&&this.instance.setHover(e,!1)},async onConnectionDetached(e){var t;try{if(e.sourceEndpoint.parameters.connection==="target"){const s=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=s}const o=Ht(e);if(Ft(e.targetEndpoint),Ms(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.__removeConnectionByConnectionInfo(e,!1,!1),this.pullConnActiveNodeName){this.historyStore.startRecordingUndo();const s=this.workflowsStore.getNodeById(e.connection.parameters.nodeId);if(!s)throw new Error("Could not find source node");const n=s.name,i=e.connection.parameters.index,r=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new qe(o)),this.connectTwoNodes(n,i,this.pullConnActiveNodeName,((t=r==null?void 0:r.parameters)==null?void 0:t.index)??0,b.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const s=new qe(o);this.historyStore.pushCommandToUndo(s)}this.nodeHelpers.updateNodesInputIssues()}catch(o){console.error(o)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.pullConnActiveNodeName=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,wt(e),ze(e);const o=e.scope,s=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),i=e.parameters.connection==="source"?"target":"source",r=s.filter(l=>{if(!Ke(l))return!1;const h=l.jtk.endpoint;if(!h)return!1;const c=h.parameters.nodeId===e.parameters.nodeId,p=h.parameters.connection;return!c&&p===i}),d=l=>{if(!e)return;const h=r.filter(c=>{if(!Ke(c))return!1;const p=c.jtk.endpoint;if(c.classList.contains("jtk-floating-endpoint"))return!1;const u=jt(c,l,50),f=jt(p.element,l,30);if(u||f){const m=this.workflowsStore.getNodeById(p.parameters.nodeId);if(m)return!!this.nodeTypesStore.getNodeType(m.type,m.typeVersion)}return!1}).sort((c,p)=>{const u=Kt(c,l,50),f=Kt(p,l,50);return!(u!=null&&u.y)&&!(f!=null&&f.y)?0:u!=null&&u.y?f!=null&&f.y?f.y-u.y:-1:1});if(h.length>0&&Ke(h[0])){const p=h[0].jtk.endpoint,u=this.workflowsStore.getNodeById(p.parameters.nodeId);this.pullConnActiveNodeName=(u==null?void 0:u.name)??null,Rs(e,p)}else Ws(e),this.pullConnActiveNodeName=null},a=l=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(l),$t(e),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",a),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",a),window.addEventListener("touchend",d),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(){var e;Object.values((e=this.instance)==null?void 0:e.endpointsByElement).flatMap(t=>Object.values(t)).filter(t=>t.endpoint.type==="N8nPlus").forEach(t=>setTimeout(()=>t.instance.revalidate(t.element),0))},onPlusEndpointClick(e){if(this.shouldShowNextStepDialog){if(e!=null&&e.__meta){this.aiStore.latestConnectionInfo={sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.PLUS_ENDPOINT,outputType:Ne(e.scope),endpointUuid:e.uuid,stepName:e.__meta.nodeName};const t=e.endpoint.canvas;this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.nextStep"),t)}}else this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.PLUS_ENDPOINT,outputType:Ne(e.scope),endpointUuid:e.uuid,stepName:e.__meta.nodeName})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.ADD_INPUT_ENDPOINT,nodeCreatorView:zt,outputType:Ne(e.scope),endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(Ge,this.onEventConnectionAbort),this.instance.bind(Ot,this.onInterceptBeforeDrop),this.instance.bind(At,this.onEventConnection),this.instance.bind(Xt,this.onDragMove),this.instance.bind(Zt,this.onConnectionMouseOver),this.instance.bind(Qt,this.onConnectionMouseOut),this.instance.bind(Pt,this.onConnectionMoved),this.instance.bind(eo,this.onEndpointMouseOver),this.instance.bind(to,this.onEndpointMouseOut),this.instance.bind(Ue,this.onConnectionDetached),this.instance.bind(Ye,this.onConnectionDrag),this.instance.bind([Ye,Ge,Ue],this.onConnectionDragAbortDetached),this.instance.bind(qt,this.onPlusEndpointClick),this.instance.bind(Gt,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(Ge,this.onEventConnectionAbort),this.instance.unbind(Ot,this.onInterceptBeforeDrop),this.instance.unbind(At,this.onEventConnection),this.instance.unbind(Xt,this.onDragMove),this.instance.unbind(Zt,this.onConnectionMouseOver),this.instance.unbind(Qt,this.onConnectionMouseOut),this.instance.unbind(Pt,this.onConnectionMoved),this.instance.unbind(eo,this.onEndpointMouseOver),this.instance.unbind(to,this.onEndpointMouseOut),this.instance.unbind(Ue,this.onConnectionDetached),this.instance.unbind(Ye,this.onConnectionDrag),this.instance.unbind(Ye,this.onConnectionDragAbortDetached),this.instance.unbind(Ge,this.onConnectionDragAbortDetached),this.instance.unbind(Ue,this.onConnectionDragAbortDetached),this.instance.unbind(qt,this.onPlusEndpointClick),this.instance.unbind(Gt,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(){if(this.instance){const e=this.instance.getManagedElements();for(const t of Object.values(e)){const o=t.endpoints;for(const s of o||[]){const n=s==null?void 0:s.endpoint;n&&n.type===$s&&n.unbindEvents()}}}this.eventsAttached=!1},onBeforeUnload(e){if(!(this.isDemo||window.preventNodeViewBeforeUnload)){if(this.uiStore.stateIsDirty)return this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId),this.unloadTimeout=setTimeout(()=>{this.collaborationStore.notifyWorkflowOpened(this.workflowsStore.workflowId)},5*Vs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},makeNewWorkflowShareable(){const{currentProject:e,personalProject:t}=this.projectsStore,o=e??t??{},s=(e==null?void 0:e.scopes)??(t==null?void 0:t.scopes)??[];this.workflowsStore.workflow.homeProject=o,this.workflowsStore.workflow.scopes=s},async newWorkflow(){const{getVariant:e}=Bs();if(this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(void 0,this.projectsStore.currentProjectId),this.workflowsStore.currentWorkflowExecutions=[],this.executionsStore.activeExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),this.canvasStore.zoomToFit(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.executionsStore.activeExecution=null,this.makeNewWorkflowShareable(),this.canvasStore.stopLoading(),e(Yt.name)===Yt.variant){const t=this.canvasStore.getAutoAddManualTriggerNode();t&&(await this.addNodes([t]),this.uiStore.lastSelectedNode=t.name)}},async initView(){var e,t;if(this.$route.params.action==="workflowSave"){this.uiStore.stateIsDirty=!1;return}if(this.blankRedirect)this.blankRedirect=!1;else if(this.$route.name===B.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o.toString())}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const s=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});if(s===He)await this.workflowHelpers.saveCurrentWorkflow()&&await this.npsSurveyStore.fetchPromptsData();else if(s===Rt)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name.toString()),o!==null){let s;try{s=await this.workflowsStore.fetchWorkflow(o)}catch(n){this.showError(n,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:B.NEW_WORKFLOW})}s&&(this.titleSet(s.name,"IDLE"),await this.openWorkflow(s),await this.checkAndInitDebugMode(),await this.projectsStore.setProjectNavActiveIdByWorkflowHomeProject(s.homeProject),(e=s.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${s.meta.onboardingId}`,{workflow_id:s.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}await this.loadCredentials(),this.historyStore.reset(),this.uiStore.nodeViewInitialized=!0,document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("unload",this.onUnload),this.showNotificationForViews([B.WORKFLOW,B.NEW_WORKFLOW])},getOutputEndpointUUID(e,t,o){const s=this.workflowsStore.getNodeByName(e);return s?gt(s.id,t,o):null},getInputEndpointUUID(e,t,o){const s=this.workflowsStore.getNodeByName(e);return s?io(s.id,t,o):null},__addConnection(e){var n;const t=this.getOutputEndpointUUID(e[0].node,e[0].type,e[0].index),o=this.getInputEndpointUUID(e[1].node,e[1].type,e[1].index);if(!t||!o)return;const s=[t,o];(n=this.instance)==null||n.connect({uuids:s,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)})},__removeConnection(e,t=!1){var o;if(t){const s=this.workflowsStore.getNodeByName(e[0].node),n=this.workflowsStore.getNodeByName(e[1].node);if(!s||!n)return;const i=document.getElementById(s.id),r=document.getElementById(n.id);if(i&&r){const d=(o=this.instance)==null?void 0:o.getConnections({source:i,target:r});Array.isArray(d)&&d.forEach(a=>{a.__meta?a.__meta.sourceOutputIndex===e[0].index&&a.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(a):this.__deleteJSPlumbConnection(a)})}}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,s,n;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const i=[{index:(s=e.__meta)==null?void 0:s.sourceOutputIndex,node:e.__meta.sourceNodeName,type:b.Main},{index:(n=e.__meta)==null?void 0:n.targetOutputIndex,node:e.__meta.targetNodeName,type:b.Main}],r=new qe(i);this.historyStore.pushCommandToUndo(r)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const s=Ht(e);s&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new qe(s)),this.workflowsStore.removeConnection({connection:s}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=dt(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,s;const t=this.workflowsStore.getNodeByName(e);if(t){const n=document.getElementById(t.id);if(!n)return{incoming:[],outgoing:[]};const i=(o=this.instance)==null?void 0:o.getConnections({source:n}),r=(s=this.instance)==null?void 0:s.getConnections({target:n});return{incoming:Array.isArray(r)?r:Object.values(r),outgoing:Array.isArray(i)?i:Object.values(i)}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(s=>{Ut(s),Bt(s)})},onNodeRun({name:e,data:t,waiting:o}){var d;const s=this.workflowsStore.pinnedWorkflowData;if(s!=null&&s[e]){const{outgoing:a}=this.getIncomingOutgoingConnections(e);a.forEach(l=>{var h;if(((h=l.__meta)==null?void 0:h.sourceNodeName)===e){const c=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Us({connection:l,overlayIds:[Ys],classNames:c?["has-run"]:[],includeConnector:!0})}});return}const n=e,i=this.workflowsStore.getNodeByName(n),r=i!==null?i.id:"";if(t===null||t.length===0||o){const a=document.getElementById(r);if(!a)return;const l=(d=this.instance)==null?void 0:d.getConnections({source:a});(Array.isArray(l)?l:Object.values(l)).forEach(c=>{ze(c)}),Ls(i,this.instance).forEach(c=>{c.endpoint.type==="N8nPlus"&&c.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,i)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const s=this.workflowsStore.getNodeByName(e);if(!s)return;t&&o&&this.historyStore.startRecordingUndo();const n=[];if(n.includes(s.type)){let c=!1;for(const p of this.nodes)if(p.name!==s.name&&n.includes(p.type)){c=!0;break}if(!c)return}s.type===oe?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:s.name===uo}):(this.externalHooks.run("node.deleteNode",{node:s}),this.$telemetry.track("User deleted node",{node_type:s.type,workflow_id:this.workflowsStore.workflowId}));let i=!1;const r=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),d=this.workflowHelpers.getCurrentWorkflow(),a=d.getNode(s.name);let l=[],h=[];if(r&&a&&(l=fe(d,a,r),h=Re(d,a,r)),h.length===1&&l.length===1){const{incoming:c,outgoing:p}=this.getIncomingOutgoingConnections(s.name);if(c.length===1&&p.length===1){const u=c[0],f=p[0];if(u.__meta&&f.__meta){i=!0;const m=u.__meta.sourceNodeName,w=u.__meta.sourceOutputIndex,S=f.__meta.targetNodeName,k=f.__meta.targetOutputIndex;setTimeout(()=>{var y;this.connectTwoNodes(m,w,S,k,b.Main),i&&((y=this.instance)==null||y.setSuspendDrawing(!1,!0),i=!1)},100)}}}sn(()=>{var c,p,u;(c=this.instance)==null||c.setSuspendDrawing(!0),(((p=this.instance)==null?void 0:p.endpointsByElement[s.id])||[]).flat().forEach(f=>{var m;return(m=this.instance)==null?void 0:m.deleteEndpoint(f)}),this.workflowsStore.removeAllNodeConnection(s),this.workflowsStore.removeNode(s),this.workflowsStore.clearNodeExecutionData(s.name),i||(u=this.instance)==null||u.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(s),t&&this.historyStore.pushCommandToUndo(new Js(s))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},i?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},async onOpenConnectionNodeCreator(e,t){await this.openSelectiveNodeCreator({connectiontype:t,node:e})},async redrawNode(e){const t="x____XXXX____x";await this.renameNode(e,t),await this.renameNode(t,e)},valueChanged(e){e.name==="name"&&e.oldValue&&this.renameNode(e.oldValue,e.value)},async renameNodePrompt(e){try{const t=this.prompt(this.$locale.baseText("nodeView.prompt.newName")+":",this.$locale.baseText("nodeView.prompt.renameNode")+`: ${e}`,{customClass:"rename-prompt",confirmButtonText:this.$locale.baseText("nodeView.prompt.rename"),cancelButtonText:this.$locale.baseText("nodeView.prompt.cancel"),inputErrorMessage:this.$locale.baseText("nodeView.prompt.invalidName"),inputValue:e,inputValidator:n=>n.trim()?!0:this.$locale.baseText("nodeView.prompt.invalidName")});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const s=await t;if((s==null?void 0:s.action)!==He)return;await this.renameNode(e,s.value,!0)}catch{}},async renameNode(e,t,o=!1){var r;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const n=((r=this.activeNode)==null?void 0:r.name)===e;n&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const i=this.workflowHelpers.getCurrentWorkflow(!0);i.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new Fs(e,t)),this.workflowsStore.renameNodeSelectedAndExecution({old:e,new:t}),this.deleteEveryEndpoint(),this.workflowsStore.removeAllConnections({setStateDirty:!1}),this.workflowsStore.removeAllNodes({removePinData:!1,setStateDirty:!0}),await this.$nextTick(),await this.addNodes(Object.values(i.nodes),i.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),n&&(this.ndvStore.activeNodeName=t,this.renamingActive=!1),o&&this.historyStore.stopRecordingUndo(),this.suspendRecordingDetachedConnections=!1},deleteEveryEndpoint(){var e,t;this.instance&&((e=this.instance)==null||e.reset(),Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>o).forEach(o=>o.destroy()),this.instance.deleteEveryConnection({fireEvent:!0}))},matchCredentials(e){e.credentials&&Object.entries(e.credentials).forEach(([t,o])=>{const s=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const i=o.id.toString(),r=s.find(d=>d.id===i);if(r){(r.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:r.id,name:r.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const n=s.filter(i=>i.name===o.name);n.length===1&&(e.credentials[t].id=n[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var n,i;if(!(e!=null&&e.length))return;this.isInsertingNodes=!0,await this.loadNodesProperties(e.map(r=>({name:r.type,version:r.typeVersion})));let s;e.forEach(r=>{const d={...r};if(d.id||(d.id=pe()),s=this.nodeTypesStore.getNodeType(d.type,d.typeVersion),d.hasOwnProperty("disabled")||(d.disabled=!1),d.hasOwnProperty("parameters")||(d.parameters={}),s!==null){let a=null;try{a=It(s.properties,d.parameters,!0,!1,r)}catch(l){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${d.name}"`),console.error(l)}d.parameters=a??{},[Hs,js].includes(d.type)&&d.parameters.path===""&&(d.parameters.path=d.webhookId)}this.matchCredentials(d),this.workflowsStore.addNode(d),o&&this.historyStore.pushCommandToUndo(new Ks(d))}),await this.$nextTick(),(n=this.instance)==null||n.setSuspendDrawing(!0),t&&await this.addConnections(t),this.nodeHelpers.refreshNodeIssues(),this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),this.isInsertingNodes=!1,(i=this.instance)==null||i.setSuspendDrawing(!1,!0)},async addConnections(e){const t=[];for(const o in e)for(const s in e[o])e[o][s].forEach((n,i)=>{n&&n.forEach(r=>{t.push([{node:o,type:Ne(s)??b.Main,index:i},{node:r.node,type:r.type,index:r.index}])})});await this.processConnectionBatch(t),setTimeout(this.addConectionsTestData,0)},async processConnectionBatch(e){for(let o=0;o<e.length;o+=100)e.slice(o,o+100).forEach(n=>{this.__addConnection(n)})},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const s=this.workflowHelpers.getNodeTypesMaxCount();let n,i;const r=[];await this.loadNodesProperties(e.nodes.map(w=>({name:w.type,version:w.typeVersion}))),e.nodes.forEach(w=>{if(s[w.type]!==void 0)if(s[w.type].exist>=s[w.type].max){t[w.name]=s[w.type].nodeNames[0];return}else s[w.type].exist+=1;n=w.name;const S=this.locale.localizeNodeName(w.name,w.type);i=this.uniqueNodeName(S,o),o.push(i),t[n]=i,r.push(w)});const d={},a=e.connections,l=r.map(w=>w.name);let h,c,p,u,f;for(h of Object.keys(a)){if(!l.includes(h))continue;const w={};for(c of Object.keys(a[h]))for(w[c]=[],p=0;p<a[h][c].length;p++){const S=[];if(a[h][c][p])for(u=0;u<a[h][c][p].length;u++)f=a[h][c][p][u],l.includes(f.node)&&S.push(f);w[c].push(S)}d[h]=w}const m=this.workflowHelpers.getWorkflow(r,d);for(n in t)n!==t[n]&&m.renameNode(n,t[n]);if(e.pinData){let w=!0;for(const S of Object.keys(e.pinData)){if(!w){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const k=m.nodes[t[S]];try{We(k).setData(e.pinData[S],"add-nodes"),w=!0}catch(y){w=!1,console.error(y)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(m.nodes),m.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(m.nodes),connections:m.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const s=[];for(const c of e){o=this.workflowHelpers.getNodeDataToSave(c),s.push(c.name),t.nodes.push(o);const p=this.workflowsStore.pinDataByNodeName(c.name);if(p&&(t.pinData[c.name]=p),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(ht.Sharing)){const u=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([f,m])=>{var w;return m.id&&(!u[m.id]||((w=u[m.id])==null?void 0:w.currentUserHasAccess))}))}}let n,i,r,d,a,l,h;return t.nodes.forEach(c=>{if(i=this.workflowsStore.outgoingConnectionsByNodeName(c.name),Object.keys(i).length!==0){h={};for(r of Object.keys(i))for(a=0;a<i[r].length;a++){for(n=[],d=0;d<i[r][a].length;d++)l=i[r][a][d],s.indexOf(l.node)!==-1&&n.push(l);n.length&&(h.hasOwnProperty(r)||(h[r]=[]),h[r][a]=n)}Object.keys(h).length&&(t.connections[c.name]=h)}}),t},resetWorkspace(){if(this.workflowsStore.resetWorkflow(),this.onToggleNodeCreator({createNodeActive:!1}),this.nodeCreatorStore.setShowScrim(!1),this.canvasStore.resetZoom(),this.unbindEndpointEventListeners(),this.deleteEveryEndpoint(),this.executionWaitingForWebhook)try{this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch{}this.workflowsStore.resetState(),this.uiStore.removeActiveAction("workflowRunning"),this.uiStore.resetSelectedNodes(),this.uiStore.nodeViewOffsetPosition=[0,0],this.credentialsUpdated=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){var o,s,n;const e=this.workflowsStore.getWorkflowById(this.currentWorkflow);let t;if(e)t={workflowId:e.id};else{const r=(typeof((o=this.$route.query)==null?void 0:o.projectId)=="string"?(s=this.$route.query)==null?void 0:s.projectId:void 0)??((n=this.projectsStore.personalProject)==null?void 0:n.id);if(r===void 0)throw new Error("Could not find projectId in the query nor could I find the personal project in the project store");t={projectId:r}}await this.credentialsStore.fetchAllCredentialsForWorkflow(t)},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(s=>{const n=Array.isArray(s.version)?s.version:[s.version];e.find(i=>i.name===s.name&&n.includes(i.version))&&!s.hasOwnProperty("properties")&&o.push({name:s.name,version:Array.isArray(s.version)?s.version.slice(-1)[0]:s.version})}),o.length>0&&(this.canvasStore.startLoading(),await this.nodeTypesStore.getNodesInformation(o),this.canvasStore.stopLoading())},async onPostMessageReceived(e){var t,o;if(!(!e||typeof e.data!="string"||!((o=(t=e.data)==null?void 0:t.includes)!=null&&o.call(t,'"command"'))))try{const s=JSON.parse(e.data);if(s&&s.command==="openWorkflow")try{await this.importWorkflowExact(s),this.canOpenNDV=s.canOpenNDV??!0,this.hideNodeIssues=s.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(n){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:n.message,type:"error"})}else if(s&&s.command==="openExecution")try{this.isProductionExecutionPreview=s.executionMode!=="manual",await this.openExecution(s.executionId),this.canOpenNDV=s.canOpenNDV??!0,this.hideNodeIssues=s.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(n){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("nodeView.showError.openExecution.title")}),"*"),this.showMessage({title:this.$locale.baseText("nodeView.showError.openExecution.title"),message:n.message,type:"error"})}else(s==null?void 0:s.command)==="setActiveExecution"&&(this.executionsStore.activeExecution=await this.executionsStore.fetchExecution(s.executionId))}catch{}},async onImportWorkflowDataEvent(e){await this.importWorkflowData(e.data,"file")},async onImportWorkflowUrlEvent(e){const t=await this.getWorkflowDataFromUrl(e.url);t!==void 0&&await this.importWorkflowData(t,"url")},addPinDataConnections(e){e&&Object.keys(e).forEach(t=>{var a;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const s=document.getElementById(o.id);if(!s)return;const n=this.workflowsStore.getWorkflowResultDataByNodeName(t)!==null,i=this.isProductionExecutionPreview?[]:["pinned"];n&&i.push("has-run");const r=(a=this.instance)==null?void 0:a.getConnections({source:s});(Array.isArray(r)?r:Object.values(r)).forEach(l=>{zs(l,{total:e[t].length,iterations:0,classNames:i})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var r;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const s=document.getElementById(o.id);if(!s)return;const n=(r=this.instance)==null?void 0:r.getConnections({source:s}),i=Array.isArray(n)?n:Object.values(n);this.instance.setSuspendDrawing(!0),i.forEach(ze),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Jt:pt),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let s;switch(this.nodeCreatorStore.selectedView){case zt:s="ai";break;case Jt:s="regular";break;default:s="regular"}t&&e&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:s,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:s,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,s){let n=s;for(const{type:l,isAutoAdd:h,name:c,openDetail:p,position:u}of e){await this.addNode(l,{position:u??n,dragAndDrop:o,name:c},p??!1,!0,h);const f=this.nodes[this.nodes.length-1];n=[f.position[0]+Ae*2+Me,f.position[1]]}const i=this.nodes.length-e.length;for(const{from:l,to:h}of t){const c=this.nodes[i+l.nodeIndex],p=this.nodes[i+h.nodeIndex];this.connectTwoNodes(c.name,l.outputIndex??0,p.name,h.inputIndex??0,b.Main)}const r=this.nodes[this.nodes.length-1],a=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(r.name,1);a.length>1&&a.slice(1).forEach((l,h)=>{const c=this.workflowsStore.getNodeByName(l.name);c&&this.onMoveNode({nodeName:c.name,position:[c.position[0],c.position[1]+100*(h+1)]})}),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)},async saveCurrentWorkflowExternal(e){await this.workflowHelpers.saveCurrentWorkflow(),e==null||e()},setSuspendRecordingDetachedConnections(e){this.suspendRecordingDetachedConnections=e},onMoveNode({nodeName:e,position:t}){this.workflowsStore.updateNodeProperties({name:e,properties:{position:t}});const o=this.workflowsStore.getNodeByName(e);setTimeout(()=>{var s;o&&((s=this.instance)==null||s.repaintEverything(),this.onNodeMoved(o))},0)},onRevertAddNode({node:e}){this.removeNode(e.name,!1)},async onRevertRemoveNode({node:e}){this.workflowsStore.workflow.nodes.find(o=>o.id===e.id)||(e.id=pe(),await this.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e}){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeHelpers.disableNodes([t])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&(this.$route.name===B.NEW_WORKFLOW||this.$route.name===B.TEMPLATE_IMPORT)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:B.HOMEPAGE})})},async checkAndInitDebugMode(){this.$route.name===B.EXECUTION_DEBUG&&(this.titleSet(this.workflowName,"DEBUG"),this.workflowsStore.isInDebugMode||(await this.applyExecutionData(this.$route.params.executionId),this.workflowsStore.isInDebugMode=!0))},onContextMenuAction(e,t){switch(e){case"copy":this.copyNodes(t);break;case"delete":this.deleteNodes(t);break;case"duplicate":this.duplicateNodes(t);break;case"execute":this.onRunNode(t[0].name,"NodeView.onContextMenuAction");break;case"open":this.ndvStore.activeNodeName=t[0].name;break;case"rename":this.renameNodePrompt(t[0].name);break;case"toggle_activation":this.toggleActivationNodes(t);break;case"toggle_pin":this.togglePinNodes(t,"context-menu");break;case"add_node":this.onToggleNodeCreator({source:K.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:oe}],connections:[]});break;case"select_all":this.selectAllNodes();break;case"deselect_all":this.deselectAllNodes();break}},async onSourceControlPull(){let e=null;this.$route.params.name&&(e=this.$route.params.name.toString());try{if(await Promise.all([this.loadVariables(),this.tagsStore.fetchAll(),this.loadCredentials()]),e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}}catch(t){console.error(t)}}}}),bi="_content_yewsk_1",Ei="_shake_yewsk_9",Ci="_setupCredentialsButtonWrapper_yewsk_27",Di={content:bi,shake:Ei,setupCredentialsButtonWrapper:Ci},Ii=["textContent"],Oi={key:0,class:"workflow-execute-wrapper"};function Ai(e,t,o,s,n,i){const r=R("CanvasAddButton"),d=R("Node"),a=R("Sticky"),l=R("NodeDetailsView"),h=R("SetupWorkflowCredentialsButton"),c=R("NodeCreation"),p=R("CanvasControls"),u=R("ContextMenu"),f=R("NextStepPopup"),m=R("n8n-button"),w=R("KeyboardShortcutTooltip"),S=R("n8n-icon-button"),k=st("touch");return N(),D("div",{ref:"nodeViewRootRef",class:$(e.$style.content)},[C("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[13]||(t[13]=(...y)=>e.onDragOver&&e.onDragOver(...y)),onDrop:t[14]||(t[14]=(...y)=>e.onDrop&&e.onDrop(...y))},[ne((N(),D("div",{class:$(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[3]||(t[3]=(...y)=>e.mouseDown&&e.mouseDown(...y)),onTouchend:t[4]||(t[4]=(...y)=>e.mouseUp&&e.mouseUp(...y)),onTouchmove:t[5]||(t[5]=(...y)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...y)),onMousedown:t[6]||(t[6]=(...y)=>e.mouseDown&&e.mouseDown(...y)),onMouseup:t[7]||(t[7]=(...y)=>e.mouseUp&&e.mouseUp(...y)),onContextmenu:t[8]||(t[8]=(...y)=>e.contextMenu.open&&e.contextMenu.open(...y)),onWheel:t[9]||(t[9]=(...y)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...y))},[C("div",{id:"node-view-background",class:"node-view-background",style:ie(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),C("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:ie(e.workflowStyle),"data-test-id":"node-view"},[ne(I(r,{ref:"canvasAddButton",style:ie(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:e.onCanvasAddButtonCLick,"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onClick","onHook:mounted"]),[[Se,e.showCanvasAddButton]]),(N(!0),D(Qe,null,et(e.nodesToRender,y=>(N(),H(d,{key:`${y.id}_node`,name:y.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===y.name,"hide-actions":e.pullConnActive,"is-production-execution-preview":e.isProductionExecutionPreview,workflow:e.currentWorkflowObject,"disable-pointer-events":!e.canOpenNDV,"hide-node-issues":e.hideNodeIssues,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,onRemoveNode:t[0]||(t[0]=M=>e.removeNode(M,!0)),onToggleDisableNode:t[1]||(t[1]=M=>e.toggleActivationNodes([M]))},{"custom-tooltip":W(()=>[C("span",{textContent:G(e.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting"))},null,8,Ii)]),_:2},1032,["name","is-read-only","instance","is-active","hide-actions","is-production-execution-preview","workflow","disable-pointer-events","hide-node-issues","onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun"]))),128)),(N(!0),D(Qe,null,et(e.stickiesToRender,y=>(N(),H(a,{key:`${y.id}_sticky`,name:y.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===y.name,"node-view-scale":e.nodeViewScale,"grid-size":e.GRID_SIZE,"hide-actions":e.pullConnActive,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[2]||(t[2]=M=>e.removeNode(M,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[k,e.touchTap,"tap"]]),I(l,{"read-only":e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,"is-production-execution-preview":e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["read-only","renaming","is-production-execution-preview","onRedrawNode","onSwitchSelectedNode","onOpenConnectionNodeCreator","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(N(),H(Pe,null,{default:W(()=>[C("div",{class:$(e.$style.setupCredentialsButtonWrapper)},[I(h)],2)]),_:1})),(N(),H(Pe,null,{default:W(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(N(),H(c,{key:0,"create-node-active":e.createNodeActive,"node-view-scale":e.nodeViewScale,onToggleNodeCreator:e.onToggleNodeCreator,onAddNodes:e.onAddNodes},null,8,["create-node-active","node-view-scale","onToggleNodeCreator","onAddNodes"])):U("",!0)]),_:1})),(N(),H(Pe,null,{default:W(()=>[I(p)]),_:1})),(N(),H(Pe,null,{default:W(()=>[I(u,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),(N(),H(Pe,null,{default:W(()=>[ne(I(f,{onOptionSelected:e.onNextStepSelected},null,8,["onOptionSelected"]),[[Se,e.isNextStepPopupVisible]])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(N(),D("div",Oi,[e.isManualChatOnly?U("",!0):(N(),D("span",{key:0,onMouseenter:t[10]||(t[10]=y=>e.showTriggerMissingToltip(!0)),onMouseleave:t[11]||(t[11]=y=>e.showTriggerMissingToltip(!1)),onClick:t[12]||(t[12]=(...y)=>e.onRunContainerClick&&e.onRunContainerClick(...y))},[I(w,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:W(()=>[I(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:le(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(N(),H(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:le(e.onOpenChat,["stop"])},null,8,["onClick"])):U("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(N(),H(S,{key:2,icon:"stop",size:"large",class:"stop-execution",type:"secondary",title:e.stopExecutionInProgress?e.$locale.baseText("nodeView.stoppingCurrentExecution"):e.$locale.baseText("nodeView.stopCurrentExecution"),loading:e.stopExecutionInProgress,"data-test-id":"stop-execution-button",onClick:le(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):U("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(N(),H(S,{key:3,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary","data-test-id":"stop-execution-waiting-for-webhook-button",onClick:le(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):U("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(N(),H(S,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:le(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):U("",!0)])):U("",!0)],32)],2)}const Pi={$style:Di},mr=Te(Ti,[["render",Ai],["__cssModules",Pi],["__scopeId","data-v-4c672b04"]]);export{mr as default};
|
|
3
|
-
//# sourceMappingURL=NodeView-C-hQ3_xD.js.map
|