n8n-editor-ui 1.34.1 → 1.34.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.
Files changed (125) hide show
  1. package/.turbo/turbo-build.log +63 -63
  2. package/dist/assets/{AuthView-94aQ7z4H.js → AuthView-TLL7d7nz.js} +2 -2
  3. package/dist/assets/{AuthView-94aQ7z4H.js.map → AuthView-TLL7d7nz.js.map} +1 -1
  4. package/dist/assets/{CanvasControls-A5WBrohY.js → CanvasControls-QMz-txwk.js} +2 -2
  5. package/dist/assets/{CanvasControls-A5WBrohY.js.map → CanvasControls-QMz-txwk.js.map} +1 -1
  6. package/dist/assets/{ChangePasswordView-wsEhj8cy.js → ChangePasswordView-BpG2Rx4d.js} +2 -2
  7. package/dist/assets/{ChangePasswordView-wsEhj8cy.js.map → ChangePasswordView-BpG2Rx4d.js.map} +1 -1
  8. package/dist/assets/{CollectionParameter-XvPjL77I.js → CollectionParameter-jdGzYeqj.js} +2 -2
  9. package/dist/assets/CollectionParameter-jdGzYeqj.js.map +1 -0
  10. package/dist/assets/{CredentialsView-0XJMAGhU.js → CredentialsView-kiuFxEVH.js} +2 -2
  11. package/dist/assets/{CredentialsView-0XJMAGhU.js.map → CredentialsView-kiuFxEVH.js.map} +1 -1
  12. package/dist/assets/{ExecutionFilter-bhanFEvf.js → ExecutionFilter-V1l-9ps5.js} +2 -2
  13. package/dist/assets/{ExecutionFilter-bhanFEvf.js.map → ExecutionFilter-V1l-9ps5.js.map} +1 -1
  14. package/dist/assets/{ExecutionPreview-OlIAVmt8.js → ExecutionPreview-MPwJjWY4.js} +2 -2
  15. package/dist/assets/{ExecutionPreview-OlIAVmt8.js.map → ExecutionPreview-MPwJjWY4.js.map} +1 -1
  16. package/dist/assets/{ExecutionsInfoAccordion-8y0XuFEi.js → ExecutionsInfoAccordion-H3fj26pu.js} +2 -2
  17. package/dist/assets/{ExecutionsInfoAccordion-8y0XuFEi.js.map → ExecutionsInfoAccordion-H3fj26pu.js.map} +1 -1
  18. package/dist/assets/{ExecutionsLandingPage-S5UN8vIw.js → ExecutionsLandingPage-7qAKHfBe.js} +2 -2
  19. package/dist/assets/{ExecutionsLandingPage-S5UN8vIw.js.map → ExecutionsLandingPage-7qAKHfBe.js.map} +1 -1
  20. package/dist/assets/{ExecutionsList-BU7_tq5x.js → ExecutionsList-Y9rsGvqE.js} +2 -2
  21. package/dist/assets/{ExecutionsList-BU7_tq5x.js.map → ExecutionsList-Y9rsGvqE.js.map} +1 -1
  22. package/dist/assets/{ExecutionsView-aBSDNhOw.js → ExecutionsView-hi5NLYKp.js} +2 -2
  23. package/dist/assets/{ExecutionsView-aBSDNhOw.js.map → ExecutionsView-hi5NLYKp.js.map} +1 -1
  24. package/dist/assets/{ForgotMyPasswordView-y5xFculD.js → ForgotMyPasswordView-ho6gQT6y.js} +2 -2
  25. package/dist/assets/{ForgotMyPasswordView-y5xFculD.js.map → ForgotMyPasswordView-ho6gQT6y.js.map} +1 -1
  26. package/dist/assets/{MainHeader-dPdeQhkH.js → MainHeader-JVxjOJwJ.js} +2 -2
  27. package/dist/assets/{MainHeader-dPdeQhkH.js.map → MainHeader-JVxjOJwJ.js.map} +1 -1
  28. package/dist/assets/{MainSidebar-5wv4Ntz3.js → MainSidebar-h-btynOF.js} +2 -2
  29. package/dist/assets/{MainSidebar-5wv4Ntz3.js.map → MainSidebar-h-btynOF.js.map} +1 -1
  30. package/dist/assets/{NodeCreation-vCHQm0aM.js → NodeCreation--SFXDuf-.js} +3 -3
  31. package/dist/assets/{NodeCreation-vCHQm0aM.js.map → NodeCreation--SFXDuf-.js.map} +1 -1
  32. package/dist/assets/{NodeCreator-Qi3ajhnf.js → NodeCreator-ns8j677p.js} +2 -2
  33. package/dist/assets/{NodeCreator-Qi3ajhnf.js.map → NodeCreator-ns8j677p.js.map} +1 -1
  34. package/dist/assets/{NodeList-bi4nWtpD.js → NodeList-f2AyrOck.js} +2 -2
  35. package/dist/assets/{NodeList-bi4nWtpD.js.map → NodeList-f2AyrOck.js.map} +1 -1
  36. package/dist/assets/{NodeView-oDPyzajr.js → NodeView-7yZJ9OMj.js} +4 -4
  37. package/dist/assets/NodeView-7yZJ9OMj.js.map +1 -0
  38. package/dist/assets/NodeView-pdKhF5kg.css +1 -0
  39. package/dist/assets/{RunDataAi-DJiuZFJ2.js → RunDataAi-PNu5uqz6.js} +2 -2
  40. package/dist/assets/{RunDataAi-DJiuZFJ2.js.map → RunDataAi-PNu5uqz6.js.map} +1 -1
  41. package/dist/assets/{RunDataJson-9PUFQ2iv.js → RunDataJson-s5yVk7VC.js} +3 -3
  42. package/dist/assets/{RunDataJson-9PUFQ2iv.js.map → RunDataJson-s5yVk7VC.js.map} +1 -1
  43. package/dist/assets/{RunDataJsonActions-4HpuK2F9.js → RunDataJsonActions-VSs2XNyt.js} +2 -2
  44. package/dist/assets/{RunDataJsonActions-4HpuK2F9.js.map → RunDataJsonActions-VSs2XNyt.js.map} +1 -1
  45. package/dist/assets/{RunDataSchema-ezXA1IRJ.js → RunDataSchema-WeaaXm2i.js} +2 -2
  46. package/dist/assets/{RunDataSchema-ezXA1IRJ.js.map → RunDataSchema-WeaaXm2i.js.map} +1 -1
  47. package/dist/assets/{RunDataTable-fjkHn30C.js → RunDataTable-2YR4xl8i.js} +2 -2
  48. package/dist/assets/{RunDataTable-fjkHn30C.js.map → RunDataTable-2YR4xl8i.js.map} +1 -1
  49. package/dist/assets/{SamlOnboarding-yIx-rRda.js → SamlOnboarding-0ds_5hgl.js} +2 -2
  50. package/dist/assets/{SamlOnboarding-yIx-rRda.js.map → SamlOnboarding-0ds_5hgl.js.map} +1 -1
  51. package/dist/assets/{SettingsApiView-EZ0nAdDr.js → SettingsApiView-ZNTmBDeh.js} +2 -2
  52. package/dist/assets/{SettingsApiView-EZ0nAdDr.js.map → SettingsApiView-ZNTmBDeh.js.map} +1 -1
  53. package/dist/assets/{SettingsCommunityNodesView-GY7HDfXP.js → SettingsCommunityNodesView-YGybEb0Q.js} +2 -2
  54. package/dist/assets/{SettingsCommunityNodesView-GY7HDfXP.js.map → SettingsCommunityNodesView-YGybEb0Q.js.map} +1 -1
  55. package/dist/assets/{SettingsExternalSecrets-XjmxCmxV.js → SettingsExternalSecrets-V6XKdflH.js} +2 -2
  56. package/dist/assets/{SettingsExternalSecrets-XjmxCmxV.js.map → SettingsExternalSecrets-V6XKdflH.js.map} +1 -1
  57. package/dist/assets/{SettingsFakeDoorView-pVOCkUpk.js → SettingsFakeDoorView-RT3jHFTZ.js} +2 -2
  58. package/dist/assets/{SettingsFakeDoorView-pVOCkUpk.js.map → SettingsFakeDoorView-RT3jHFTZ.js.map} +1 -1
  59. package/dist/assets/{SettingsLdapView-447rSrxc.js → SettingsLdapView-lVhJpXDn.js} +2 -2
  60. package/dist/assets/{SettingsLdapView-447rSrxc.js.map → SettingsLdapView-lVhJpXDn.js.map} +1 -1
  61. package/dist/assets/{SettingsLogStreamingView-bUhYaLuP.js → SettingsLogStreamingView-hWjeVuyC.js} +2 -2
  62. package/dist/assets/{SettingsLogStreamingView-bUhYaLuP.js.map → SettingsLogStreamingView-hWjeVuyC.js.map} +1 -1
  63. package/dist/assets/{SettingsSourceControl-QbgpyFeh.js → SettingsSourceControl-XOku0dYa.js} +2 -2
  64. package/dist/assets/{SettingsSourceControl-QbgpyFeh.js.map → SettingsSourceControl-XOku0dYa.js.map} +1 -1
  65. package/dist/assets/{SettingsSso-1YVWObhc.js → SettingsSso-FfUWpkMk.js} +2 -2
  66. package/dist/assets/{SettingsSso-1YVWObhc.js.map → SettingsSso-FfUWpkMk.js.map} +1 -1
  67. package/dist/assets/{SettingsUsageAndPlan-RXRRDXy4.js → SettingsUsageAndPlan-bhK5h4Fc.js} +2 -2
  68. package/dist/assets/{SettingsUsageAndPlan-RXRRDXy4.js.map → SettingsUsageAndPlan-bhK5h4Fc.js.map} +1 -1
  69. package/dist/assets/{SettingsUsersView-eHaVB_6L.js → SettingsUsersView-wSBhrK4z.js} +2 -2
  70. package/dist/assets/{SettingsUsersView-eHaVB_6L.js.map → SettingsUsersView-wSBhrK4z.js.map} +1 -1
  71. package/dist/assets/{SettingsView-JVUkQw0d.js → SettingsView-k7YCmGxR.js} +2 -2
  72. package/dist/assets/{SettingsView-JVUkQw0d.js.map → SettingsView-k7YCmGxR.js.map} +1 -1
  73. package/dist/assets/{SetupView-fQzty7Gp.js → SetupView-q1H9bzQn.js} +2 -2
  74. package/dist/assets/{SetupView-fQzty7Gp.js.map → SetupView-q1H9bzQn.js.map} +1 -1
  75. package/dist/assets/{SetupWorkflowCredentialsButton-OiOkf-hI.js → SetupWorkflowCredentialsButton-MXDnpOlJ.js} +2 -2
  76. package/dist/assets/{SetupWorkflowCredentialsButton-OiOkf-hI.js.map → SetupWorkflowCredentialsButton-MXDnpOlJ.js.map} +1 -1
  77. package/dist/assets/{SetupWorkflowFromTemplateView-ckehDOej.js → SetupWorkflowFromTemplateView-0HgnF8Wk.js} +2 -2
  78. package/dist/assets/{SetupWorkflowFromTemplateView-ckehDOej.js.map → SetupWorkflowFromTemplateView-0HgnF8Wk.js.map} +1 -1
  79. package/dist/assets/{SigninView-6kvI5K04.js → SigninView-ZtC3HJKC.js} +2 -2
  80. package/dist/assets/{SigninView-6kvI5K04.js.map → SigninView-ZtC3HJKC.js.map} +1 -1
  81. package/dist/assets/{SignupView-USh4Ng3q.js → SignupView-9jLlb4-m.js} +2 -2
  82. package/dist/assets/{SignupView-USh4Ng3q.js.map → SignupView-9jLlb4-m.js.map} +1 -1
  83. package/dist/assets/{TemplateDetails-tXvyDDVg.js → TemplateDetails-w7x_Vgw_.js} +2 -2
  84. package/dist/assets/{TemplateDetails-tXvyDDVg.js.map → TemplateDetails-w7x_Vgw_.js.map} +1 -1
  85. package/dist/assets/{TemplateList-rsNRt0qZ.js → TemplateList-0nuqWVBy.js} +2 -2
  86. package/dist/assets/{TemplateList-rsNRt0qZ.js.map → TemplateList-0nuqWVBy.js.map} +1 -1
  87. package/dist/assets/{TemplatesCollectionView-lXJ9U359.js → TemplatesCollectionView-Z9UtKR-g.js} +2 -2
  88. package/dist/assets/{TemplatesCollectionView-lXJ9U359.js.map → TemplatesCollectionView-Z9UtKR-g.js.map} +1 -1
  89. package/dist/assets/{TemplatesInfoCarousel-P2HZ4dOz.js → TemplatesInfoCarousel-N3l1eTTG.js} +2 -2
  90. package/dist/assets/{TemplatesInfoCarousel-P2HZ4dOz.js.map → TemplatesInfoCarousel-N3l1eTTG.js.map} +1 -1
  91. package/dist/assets/{TemplatesSearchView-FN7reyfg.js → TemplatesSearchView-wkSt7PFf.js} +2 -2
  92. package/dist/assets/{TemplatesSearchView-FN7reyfg.js.map → TemplatesSearchView-wkSt7PFf.js.map} +1 -1
  93. package/dist/assets/{TemplatesWorkflowView-iRU7xCpM.js → TemplatesWorkflowView-epjsTDT4.js} +2 -2
  94. package/dist/assets/{TemplatesWorkflowView-iRU7xCpM.js.map → TemplatesWorkflowView-epjsTDT4.js.map} +1 -1
  95. package/dist/assets/{VariablesView-pWnSAbjy.js → VariablesView-mj7tvP3Z.js} +2 -2
  96. package/dist/assets/{VariablesView-pWnSAbjy.js.map → VariablesView-mj7tvP3Z.js.map} +1 -1
  97. package/dist/assets/{WorkerView-8rB6MB_M.js → WorkerView-urDpqCfL.js} +2 -2
  98. package/dist/assets/{WorkerView-8rB6MB_M.js.map → WorkerView-urDpqCfL.js.map} +1 -1
  99. package/dist/assets/{WorkflowActivator-hF9F5zIs.js → WorkflowActivator-2LVSrBU4.js} +2 -2
  100. package/dist/assets/{WorkflowActivator-hF9F5zIs.js.map → WorkflowActivator-2LVSrBU4.js.map} +1 -1
  101. package/dist/assets/{WorkflowHistory-gHQbqUXH.js → WorkflowHistory-4SEsxR0t.js} +2 -2
  102. package/dist/assets/{WorkflowHistory-gHQbqUXH.js.map → WorkflowHistory-4SEsxR0t.js.map} +1 -1
  103. package/dist/assets/{WorkflowOnboardingView-VpQ3P8b_.js → WorkflowOnboardingView-27zExcdN.js} +2 -2
  104. package/dist/assets/{WorkflowOnboardingView-VpQ3P8b_.js.map → WorkflowOnboardingView-27zExcdN.js.map} +1 -1
  105. package/dist/assets/{WorkflowsView-bfxfJsmW.js → WorkflowsView-rICV14FU.js} +2 -2
  106. package/dist/assets/{WorkflowsView-bfxfJsmW.js.map → WorkflowsView-rICV14FU.js.map} +1 -1
  107. package/dist/assets/{cloud-f74z4VKj.js → cloud-8u4ixH3T.js} +2 -2
  108. package/dist/assets/{cloud-f74z4VKj.js.map → cloud-8u4ixH3T.js.map} +1 -1
  109. package/dist/assets/{index-vdh5hVg3.js → index-4C1AxeXk.js} +4 -4
  110. package/dist/assets/{index-vdh5hVg3.js.map → index-4C1AxeXk.js.map} +1 -1
  111. package/dist/assets/index-PmN852am.css +1 -0
  112. package/dist/assets/{pushConnection-j2REJYmc.js → pushConnection-kCBulx2c.js} +2 -2
  113. package/dist/assets/{pushConnection-j2REJYmc.js.map → pushConnection-kCBulx2c.js.map} +1 -1
  114. package/dist/assets/{templateActions-iSfFOAhF.js → templateActions-tZeqnIph.js} +2 -2
  115. package/dist/assets/{templateActions-iSfFOAhF.js.map → templateActions-tZeqnIph.js.map} +1 -1
  116. package/dist/assets/{useExecutionDebugging-s7lAeIqB.js → useExecutionDebugging-eQjp4txV.js} +2 -2
  117. package/dist/assets/{useExecutionDebugging-s7lAeIqB.js.map → useExecutionDebugging-eQjp4txV.js.map} +1 -1
  118. package/dist/assets/{workflowActivate-SIKKLz8V.js → workflowActivate-6jCh92f_.js} +2 -2
  119. package/dist/assets/{workflowActivate-SIKKLz8V.js.map → workflowActivate-6jCh92f_.js.map} +1 -1
  120. package/dist/index.html +2 -2
  121. package/package.json +1 -1
  122. package/dist/assets/CollectionParameter-XvPjL77I.js.map +0 -1
  123. package/dist/assets/NodeView-FjGatqri.css +0 -1
  124. package/dist/assets/NodeView-oDPyzajr.js.map +0 -1
  125. package/dist/assets/index-suVg9RiN.css +0 -1
@@ -1,9 +1,9 @@
1
1
  function __vite__mapDeps(indexes) {
2
2
  if (!__vite__mapDeps.viteFileDeps) {
3
- __vite__mapDeps.viteFileDeps = ["assets/RunDataTable-fjkHn30C.js","assets/pinia-UPmhnKmF.js","assets/n8n-G5ZIZCy5.js","assets/vendor-VXT4wwt2.js","assets/lodash-es-xYzII6mS.js","assets/axios-s2RMMPhA.js","assets/flatted-jPn12Tq4.js","assets/esprima-next-ulPLCZ1Z.js","assets/luxon-ZRIU05qF.js","assets/@vueuse/core-4MtarU7n.js","assets/uuid-McvpxQtQ.js","assets/vue-i18n-ZIlZf-IE.js","assets/@n8n/permissions-8yMqUF1Y.js","assets/n8n-bK37G-YZ.css","assets/TextWithHighlights.vue_vue_type_script_setup_true_lang-mItvY54u.js","assets/TextWithHighlights-bae2kITV.css","assets/index-vdh5hVg3.js","assets/@n8n/codemirror-lang-sql-A8tNeQAo.js","assets/@lezer/common-1hBQ1gIF.js","assets/prettier-s3fE3Qyr.js","assets/@jsplumb/util-DR0SB56A.js","assets/@jsplumb/core-MKwKlGip.js","assets/@jsplumb/common-Q5_tv_GT.js","assets/@jsplumb/connector-bezier-3dWY17R5.js","assets/@jsplumb/browser-ui-AlqFM-P6.js","assets/codemirror-lang-html-n8n-aqAgigXU.js","assets/codemirror-lang-n8n-expression-7tlJbTJw.js","assets/fast-json-stable-stringify-4gflVid-.js","assets/timeago.js--Bumj2r9.js","assets/qrcode.vue-t9lCVWTj.js","assets/vue3-touch-events-_RfbPMOD.js","assets/chart.js-JtqvIvkt.js","assets/index-suVg9RiN.css","assets/useExecutionDebugging-s7lAeIqB.js","assets/file-saver-7fKiBHqp.js","assets/vue-json-pretty-c0xb0mJ1.js","assets/RunDataAi-DJiuZFJ2.js","assets/RunDataAi-B6oRAQZq.css","assets/dateFormatter-7nt2saFg.js","assets/workflowActivate-SIKKLz8V.js","assets/collaboration.store-zPDg5IkG.js","assets/RunDataTable-25yAPJgq.css","assets/RunDataJson-9PUFQ2iv.js","assets/RunDataJson-K3Vn-dXm.css","assets/RunDataSchema-ezXA1IRJ.js","assets/RunDataSchema-4SYZaHmX.css","assets/RunDataSearch-6Yg8LN1O.js","assets/RunDataSearch-RI7itMeM.css","assets/NodeCreation-vCHQm0aM.js","assets/NodeCreation-ol7iBDi0.css","assets/CanvasControls-A5WBrohY.js","assets/CanvasControls-BJ0vSuW8.css","assets/SetupWorkflowCredentialsButton-OiOkf-hI.js"]
3
+ __vite__mapDeps.viteFileDeps = ["assets/RunDataTable-2YR4xl8i.js","assets/pinia-UPmhnKmF.js","assets/n8n-G5ZIZCy5.js","assets/vendor-VXT4wwt2.js","assets/lodash-es-xYzII6mS.js","assets/axios-s2RMMPhA.js","assets/flatted-jPn12Tq4.js","assets/esprima-next-ulPLCZ1Z.js","assets/luxon-ZRIU05qF.js","assets/@vueuse/core-4MtarU7n.js","assets/uuid-McvpxQtQ.js","assets/vue-i18n-ZIlZf-IE.js","assets/@n8n/permissions-8yMqUF1Y.js","assets/n8n-bK37G-YZ.css","assets/TextWithHighlights.vue_vue_type_script_setup_true_lang-mItvY54u.js","assets/TextWithHighlights-bae2kITV.css","assets/index-4C1AxeXk.js","assets/@n8n/codemirror-lang-sql-A8tNeQAo.js","assets/@lezer/common-1hBQ1gIF.js","assets/prettier-s3fE3Qyr.js","assets/@jsplumb/util-DR0SB56A.js","assets/@jsplumb/core-MKwKlGip.js","assets/@jsplumb/common-Q5_tv_GT.js","assets/@jsplumb/connector-bezier-3dWY17R5.js","assets/@jsplumb/browser-ui-AlqFM-P6.js","assets/codemirror-lang-html-n8n-aqAgigXU.js","assets/codemirror-lang-n8n-expression-7tlJbTJw.js","assets/fast-json-stable-stringify-4gflVid-.js","assets/timeago.js--Bumj2r9.js","assets/qrcode.vue-t9lCVWTj.js","assets/vue3-touch-events-_RfbPMOD.js","assets/chart.js-JtqvIvkt.js","assets/index-PmN852am.css","assets/useExecutionDebugging-eQjp4txV.js","assets/file-saver-7fKiBHqp.js","assets/vue-json-pretty-c0xb0mJ1.js","assets/RunDataAi-PNu5uqz6.js","assets/RunDataAi-B6oRAQZq.css","assets/dateFormatter-7nt2saFg.js","assets/workflowActivate-6jCh92f_.js","assets/collaboration.store-zPDg5IkG.js","assets/RunDataTable-25yAPJgq.css","assets/RunDataJson-s5yVk7VC.js","assets/RunDataJson-K3Vn-dXm.css","assets/RunDataSchema-WeaaXm2i.js","assets/RunDataSchema-4SYZaHmX.css","assets/RunDataSearch-6Yg8LN1O.js","assets/RunDataSearch-RI7itMeM.css","assets/NodeCreation--SFXDuf-.js","assets/NodeCreation-ol7iBDi0.css","assets/CanvasControls-QMz-txwk.js","assets/CanvasControls-BJ0vSuW8.css","assets/SetupWorkflowCredentialsButton-MXDnpOlJ.js"]
4
4
  }
5
5
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6
6
  }
7
- import{u as pe,y as ee,v as Z,q as fe,x as Te,el as wn,c_ as jn,J as me,cZ as we,N as M,dX as Ie,_ as G,$ as oe,em as Kn,en as Yn,bg as vn,ay as Nn,a8 as We,e as tt,eo as co,ep as qn,cV as Me,ap as Ze,aB as bt,cS as kn,b8 as et,a2 as Re,ds as de,a9 as He,B as bn,dj as ho,eq as Gn,er as Le,o as $e,a6 as Fe,es as wt,df as Ae,et as po,eu as Jn,ev as fo,d4 as zt,m as Tt,l as jt,ew as Tn,an as rt,O as Xn,ex as Qn,ey as Zn,ez as es,cR as go,b6 as Vt,aZ as mo,eA as ts,db as Ee,eB as Se,eC as yo,eD as os,eE as ns,eF as wo,eG as Bt,cJ as Pe,z as Kt,eH as ss,eI as is,k as Sn,dh as yt,V as J,dd as as,eJ as rs,eK as ls,t as Dn,eL as ds,eM as us,eN as cs,eO as hs,eP as ps,e8 as fs,eQ as gs,F as ms,D as It,r as lt,eR as En,eS as ge,eT as ot,d7 as Yt,b as ys,S as ws,eU as ze,eV as vt,eW as qt,eX as vo,eY as No,eZ as ko,e_ as bo,e$ as To,f0 as So,f1 as Do,f2 as Eo,f3 as Co,f4 as Io,f5 as vs,b9 as Po,f6 as _o,f7 as Oo,f8 as Ut,f9 as Ns,fa as ks,fb as $o,ba as bs,b2 as Ro,fc as Ts,fd as Ao,fe as Ss,ff as Ds,fg as Es,fh as Cs,fi as Is,fj as Mo,fk as Ps,fl as _s,fm as Os,fn as Wo,fo as Vo,fp as $s,fq as Rs,fr as Bo,fs as As,ah as Ms,ft as Uo,fu as xo,a1 as Ws,d9 as Vs,d8 as Bs,da as Us,fv as xs,fw as Lo,M as Ke,a3 as Ye,fx as Ls,cY as Hs,f as Fs,dc as zs,fy as Ne,cK as js,cL as Ks,cM as Ys,bu as qs,cU as Gs,cT as Pt,aa as Js,fz as Xs,fA as Qs,ej as Zs,fB as ei}from"./n8n-G5ZIZCy5.js";import{m as le,d as St,s as Gt}from"./pinia-UPmhnKmF.js";import{_ as Ho,$ as Fo,a0 as zo,a1 as dt}from"./@jsplumb/core-MKwKlGip.js";import{d as Jt,i as Nt,j as Cn,c as Xt,k as ti,N as nt,l as Qt,a as Dt,m as Ve,n as xt,o as Ce,p as In,b as Zt,q as oi,P as ni,r as Pn,t as eo,R as _n,v as si,J as ii,w as ai,C as ri,x as jo,y as Lt,z as On,A as _t,B as li,D as di,E as Ht,F as qe,G as ui,H as ci,h as $n,K as hi,I as ut,L as pi,M as fi,O as gi,u as mi,Q as yi,U as ct,s as Ko,V as ce,W as wi,X as vi,Y as Ni,Z as Be,_ as Ge,$ as ki,a0 as bi,a1 as Ot,a2 as Ti,a3 as Yo,a4 as ht,a5 as Si,a6 as Di,a7 as Ei,a8 as Ci,a9 as Ii,aa as Pi,ab as _i,ac as qo,ad as Go,ae as Jo,af as $t,ag as Oi,ah as Xo,ai as Qo,aj as $i,ak as pt,al as Zo,am as en,an as Ri,ao as Ai,ap as tn,aq as on,ar as Mi,as as Wi,at as Vi,au as Bi,av as Ui,aw as xi,ax as Li}from"./index-vdh5hVg3.js";import{r as j,e as q,d as to,b as Rn,v as Y,f as d,h as N,i as f,K as y,y as D,E as v,J as O,I as w,D as _,H as E,$ as nn,V as re,a6 as S,at as st,F as te,_ as ue,aj as An,ak as Mn,z as se,ae as Et,M as Q,A as Hi,L as ae,x as he,Y as Wn,G as Vn,l as Fi,u as x,N as zi,au as _e,aw as De,a0 as oo,aB as ji,T as Ki,n as Bn}from"./vendor-VXT4wwt2.js";import{u as Yi}from"./useExecutionDebugging-s7lAeIqB.js";import{g as ke,s as Ue,A as Rt,z as qi,e as Gi}from"./lodash-es-xYzII6mS.js";import{F as At}from"./file-saver-7fKiBHqp.js";import{V as Ji}from"./vue-json-pretty-c0xb0mJ1.js";import{V as Xi,R as Qi}from"./RunDataAi-DJiuZFJ2.js";import{c as Zi}from"./dateFormatter-7nt2saFg.js";import{w as sn}from"./workflowActivate-SIKKLz8V.js";import{v as be}from"./uuid-McvpxQtQ.js";import{a as ea,u as ta}from"./collaboration.store-zPDg5IkG.js";import{g as oa,f as ft,h as an,a as rn,E as ln,b as dn,d as un,i as gt}from"./@jsplumb/browser-ui-AlqFM-P6.js";const Mt=j([0,0]),Je=j(!1),Xe=j({source:"canvas"}),mt=j([]),cn=j(()=>{}),it=(e=()=>{})=>{const t=pe(),o=ee(),n=Z(),s=Jt(),{getInputDataWithPinned:a}=Cn(),i=Te(),l=q(()=>s.preferences.branchReadOnly||t.isReadOnlyView),r=q(()=>{if(!Je.value)return[];const c=t.selectedNodes.map(k=>n.getNodeByName(k.name)),T=Xe.value;return T.source==="canvas"?c:T.source==="node-right-click"?c.some($=>$.name===T.node.name)?c:[T.node]:[T.node]}),u=c=>{const T=n.allNodes.filter(k=>k.type===c.name);return c.maxNodes===void 0||T.length<c.maxNodes},h=c=>{const T=o.getNodeType(c.type,c.typeVersion);return!T||wn.includes(T.name)?!1:u(T)},p=c=>{const T=o.getNodeType(c.type,c.typeVersion),k=a(c);return!T||k.length===0?!1:T.outputs.length===1&&!jn.includes(c.type)},g=c=>!!n.pinDataByNodeName(c.name),b=()=>{Xe.value={source:"canvas"},Je.value=!1,mt.value=[],Mt.value=[0,0]},m=(c,T={source:"canvas"})=>{if(c.stopPropagation(),Je.value&&T.source===Xe.value.source){b();return}c.preventDefault(),cn.value=e,Xe.value=T,Mt.value=Nt(c),Je.value=!0;const k=r.value,$=k.every(z=>z.type===fe),R={adjustToNumber:k.length,interpolate:{subject:$?i.baseText("contextMenu.sticky",{adjustToNumber:k.length}):i.baseText("contextMenu.node",{adjustToNumber:k.length})}},B=[{id:"select_all",divided:!0,label:i.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:k.length===n.allNodes.length},{id:"deselect_all",label:i.baseText("contextMenu.deselectAll"),disabled:k.length===0}];if(k.length===0)mt.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:i.baseText("contextMenu.addNode"),disabled:l.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:i.baseText("contextMenu.addSticky"),disabled:l.value},...B];else{const z=V=>{const L=n.getCurrentWorkflow(),ne=L.getNode(V.name),ye=o.getNodeType(V.type,V.typeVersion),W=me(L,ne,ye);return!!we(W).find(C=>C!==M.Main)},A=[!$&&{id:"toggle_activation",label:k.every(V=>V.disabled)?i.baseText("contextMenu.activate",R):i.baseText("contextMenu.deactivate",R),shortcut:{keys:["D"]},disabled:l.value},!$&&{id:"toggle_pin",label:k.every(V=>g(V))?i.baseText("contextMenu.unpin",R):i.baseText("contextMenu.pin",R),shortcut:{keys:["p"]},disabled:k.some(z)||l.value||!k.every(p)},{id:"copy",label:i.baseText("contextMenu.copy",R),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:i.baseText("contextMenu.duplicate",R),shortcut:{metaKey:!0,keys:["D"]},disabled:l.value||!k.every(h)},...B,{id:"delete",divided:!0,label:i.baseText("contextMenu.delete",R),shortcut:{keys:["Del"]},disabled:l.value}].filter(Boolean);if(k.length===1){const V=$?[{id:"open",label:i.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:l.value},{id:"change_color",label:i.baseText("contextMenu.changeColor"),disabled:l.value}]:[{id:"open",label:i.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:i.baseText("contextMenu.test"),disabled:l.value},{id:"rename",label:i.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:l.value}];A.unshift(...V)}mt.value=A}},P=c=>{cn.value(c,r.value)};return to(()=>t.nodeViewOffsetPosition,()=>{b()}),{isOpen:Je,position:Mt,target:Xe,actions:mt,targetNodes:r,open:m,close:b,_dispatchAction:P}};function na(){const e=j(!1),t=j(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=Ie(),s=pe(),a=Xt(),i=Z(),{isOpen:l}=it();function r(A){Object.assign(t.value.style,A)}function u(A){const[V,L]=k(A);t.value=Object.assign(t.value,{x:V,y:L}),r({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(A){const V=g(A);r({left:V.x+"px",top:V.y+"px",width:V.width+"px",height:V.height+"px"})}function p(){t.value.x=0,t.value.y=0,r({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function g(A){const[V,L]=k(A);return{x:Math.min(V,t.value.x),y:Math.min(L,t.value.y),width:Math.abs(V-t.value.x),height:Math.abs(L-t.value.y)}}function b(A){const V=[],L=g(A);return i.allNodes.forEach(ne=>{ne.position[0]<L.x||ne.position[0]>L.x+L.width||ne.position[1]<L.y||ne.position[1]>L.y+L.height||V.push(ne)}),V}function m(){t.value.id="select-box",r({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",c),document.querySelector("#node-view").appendChild(t.value)}function P(A){if(A.buttons===0){c(A);return}h(A)}function c(A){if(A.button===2||l.value)return;if(!e.value){o&&A.target instanceof HTMLElement&&A.target&&A.target.id.includes("node-view")&&B();return}document.removeEventListener("mousemove",P),B();const V=b(A);V.forEach(L=>{R(L)}),V.length===1&&(s.lastSelectedNode=V[0].name),p()}function T(A,V){n(A)||V||A.button===2||s.isActionActive("dragActive")||(u(A),document.addEventListener("mousemove",P))}function k(A){const V=Nt(A),[L,ne]=a.canvasPositionFromPagePosition(V),ye=a.nodeViewScale,W=s.nodeViewOffsetPosition;return ti(L,ne,ye,W)}function $(A){s.removeNodeFromSelection(A),z.value.removeFromDragSelection(z.value.getManagedElement(A==null?void 0:A.id))}function R(A){s.addSelectedNode(A),z.value.addToDragSelection(z.value.getManagedElement(A==null?void 0:A.id))}function B(){z.value.clearDragSelection(),s.resetSelectedNodes(),s.lastSelectedNode=null,s.lastSelectedNodeOutputIndex=null,a.lastSelectedConnection=null,a.newNodeInsertPosition=null}const z=q(()=>a.jsPlumbInstance);return Rn(()=>{m()}),{selectActive:e,getMousePositionWithinNodeView:k,mouseUpMouseSelect:c,mouseDownMouseSelect:T,nodeDeselected:$,nodeSelected:R,deselectAllNodes:B}}function sa(){function e(){return ee().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,p;const{canvasNames:s}=Z();if(!s.has(o)&&!n.includes(o))return o;const i=e().find(g=>o.startsWith(g));if(i){let g="",b=1;const m=o.split(i).pop(),P=m==null?void 0:m[m.length-1];for(P&&Number.isInteger(Number(P))&&(b=parseInt(P,10),o=o.slice(0,-1)),g=o;s.has(g)||n.includes(g);)g=o+b++;return g}if(/^\d+-?\d*$/.test(o)){let g="",b=1;const m=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(m!=null&&m.groups))throw new Error("Failed to find match for unique name");for(((h=m==null?void 0:m.groups)==null?void 0:h.suffix)!==""&&(b=parseInt(m.groups.suffix,10)),g=m.groups.base;s.has(g)||n.includes(g);)g=m.groups.base+"-"+b++;return g}let l="",r=1;const u=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(u!=null&&u.groups))throw new Error("Failed to find match for unique name");for(((p=u==null?void 0:u.groups)==null?void 0:p.suffix)!==""&&(r=parseInt(u.groups.suffix,10)),l=u.groups.base;s.has(l)||n.includes(l);)l=u.groups.base+r++;return l}return{uniqueNodeName:t}}const ia=Y({name:"NodeTitle",components:{NodeIcon:nt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),aa="_container_9bi3m_1",ra="_title_9bi3m_11",la="_hoverable_9bi3m_19",da="_editIcon_9bi3m_22",ua="_iconWrapper_9bi3m_26",ca="_editIconContainer_9bi3m_39",ha="_editButtons_9bi3m_45",pa="_editContainer_9bi3m_53",fa={container:aa,title:ra,hoverable:la,editIcon:da,iconWrapper:ua,editIconContainer:ca,editButtons:ha,editContainer:pa};function ga(e,t,o,n,s,a){const i=S("NodeIcon"),l=S("n8n-text"),r=S("n8n-input"),u=S("n8n-button"),h=S("font-awesome-icon"),p=S("n8n-popover");return d(),N("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...g)=>e.onEdit&&e.onEdit(...g))},[f("span",{class:D(e.$style.iconWrapper)},[y(i,{"node-type":e.nodeType,size:18},null,8,["node-type"])],2),y(p,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:v(()=>[f("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[O(w(e.modelValue)+" ",1),f("div",{class:D(e.$style.editIconContainer)},[e.editable?(d(),_(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):E("",!0)],2)],2)]),default:v(()=>[f("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=nn((...g)=>e.onRename&&e.onRename(...g),["enter"])),t[3]||(t[3]=re(()=>{},["stop"])),t[4]||(t[4]=nn(g=>e.editName=!1,["esc"]))]},[y(l,{bold:!0,color:"text-base",tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),y(r,{ref:"input",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=g=>e.newName=g),size:"small","data-test-id":"node-rename-input"},null,8,["modelValue"]),f("div",{class:D(e.$style.editButtons)},[y(u,{type:"secondary",size:"small",label:e.$locale.baseText("ndv.title.cancel"),onClick:t[1]||(t[1]=g=>e.editName=!1)},null,8,["label"]),y(u,{type:"primary",size:"small",label:e.$locale.baseText("ndv.title.rename"),onClick:e.onRename},null,8,["label","onClick"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const ma={$style:fa},ya=G(ia,[["render",ga],["__cssModules",ma]]),wa=Y({name:"NodeSettingsTabs",props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},setup(){return{externalHooks:We()}},computed:{...le(oe,Z),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,s,a,i;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(i=(a=(s=(n=e.codex)==null?void 0:n.resources)==null?void 0:s.primaryDocumentation)==null?void 0:a[0])==null?void 0:i.url;return o?o+t:this.isCommunityNode?`${Kn}${e.name.split(".")[0]}`:Yn+t},isCommunityNode(){const e=this.nodeType;return e?vn(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:Nn,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.externalHooks.run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function va(e,t,o,n,s,a){const i=S("n8n-tabs");return d(),_(i,{options:e.options,"model-value":e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","model-value","onUpdate:modelValue","onTooltipClick"])}const Na=G(wa,[["render",va]]),ka=Y({name:"NodeWebhooks",props:["node","nodeType"],setup(){const e=st(),t=Qt(),o=Dt({router:e});return{clipboard:t,workflowHelpers:o,...tt()}},data(){return{isMinimized:this.nodeType&&!co.includes(this.nodeType.name),showUrlFor:"test"}},computed:{isProductionOnly(){return this.nodeType&&qn.includes(this.nodeType.name)},urlOptions(){return[...this.isProductionOnly?[]:[{label:this.baseText.testUrl,value:"test"}],{label:this.baseText.productionUrl,value:"production"}]},visibleWebhookUrls(){return this.webhooksNode.filter(e=>typeof e.ndvHideUrl=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideUrl"):!e.ndvHideUrl)},webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Ze:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.chatTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.chatTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.chatTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.chatTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.chatTrigger")};case Me:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},watch:{node(){this.isMinimized=!co.includes(this.nodeType.name)}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.clipboard.copy(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.workflowHelpers.getWebhookUrl(e,this.node,this.isProductionOnly?"production":this.showUrlFor):""},isWebhookMethodVisible(e){return typeof e.ndvHideMethod=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideMethod"):!e.ndvHideMethod}}}),no=e=>(An("data-v-df24ab0e"),e=e(),Mn(),e),ba={key:0,class:"webhooks"},Ta=["title"],Sa={key:0,class:"node-webhooks"},Da={key:0,class:"url-selection"},Ea={key:0,class:"webhook-wrapper"},Ca={class:"http-field"},Ia={class:"http-method"},Pa=no(()=>f("br",null,null,-1)),_a={class:"url-field"},Oa=["onClick"],$a=no(()=>f("br",null,null,-1)),Ra={key:1,class:"webhook-wrapper"},Aa={class:"url-field-full-width"},Ma=["onClick"],Wa=no(()=>f("br",null,null,-1));function Va(e,t,o,n,s,a){const i=S("font-awesome-icon"),l=S("n8n-radio-buttons"),r=S("el-col"),u=S("el-row"),h=S("n8n-tooltip"),p=S("el-collapse-transition");return e.webhooksNode.length&&e.visibleWebhookUrls.length>0?(d(),N("div",ba,[f("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide,onClick:t[0]||(t[0]=g=>e.isMinimized=!e.isMinimized)},[y(i,{icon:"angle-right",class:"minimize-button minimize-icon"}),O(" "+w(e.baseText.toggleTitle),1)],10,Ta),y(p,null,{default:v(()=>[e.isMinimized?E("",!0):(d(),N("div",Sa,[e.isProductionOnly?E("",!0):(d(),N("div",Da,[y(u,null,{default:v(()=>[y(r,{span:24},{default:v(()=>[y(l,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=g=>e.showUrlFor=g),options:e.urlOptions},null,8,["modelValue","options"])]),_:1})]),_:1})])),(d(!0),N(te,null,ue(e.visibleWebhookUrls,(g,b)=>(d(),_(h,{key:b,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:v(()=>[e.isWebhookMethodVisible(g)?(d(),N("div",Ea,[f("div",Ca,[f("div",Ia,[O(w(e.workflowHelpers.getWebhookExpressionValue(g,"httpMethod")),1),Pa])]),f("div",_a,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[O(w(e.getWebhookUrlDisplay(g)),1),$a],8,Oa)])])):(d(),N("div",Ra,[f("div",Aa,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[O(w(e.getWebhookUrlDisplay(g)),1),Wa],8,Ma)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):E("",!0)}const Ba=G(ka,[["render",Va],["__scopeId","data-v-df24ab0e"]]),Ua=["data-test-id"],xa=["textContent"],La=["onClick"],Ha=["onClick"],Fa=["data-node-name"],za=["onClick"],ja=Y({__name:"NDVSubConnections",props:{rootNode:{}},emits:["switchSelectedNode","openConnectionNodeCreator"],setup(e,{expose:t,emit:o}){const n=e,s=Z(),a=ee(),i=Ve(),{debounce:l}=bt(),r=o,u=j([]),h=j([]),p=j(!1),g=q(()=>a.getNodeType(n.rootNode.type,n.rootNode.typeVersion)),b=q(()=>s.getNodeByName(n.rootNode.name)),m=q(()=>s.getCurrentWorkflow()),P=q(()=>{const W=i.getNodeIssues(g.value,n.rootNode,m.value,["typeUnknown","parameters","credentials","execution"]);return(W==null?void 0:W.input)??{}}),c=q(()=>u.value.reduce((W,K)=>{const C=B(m.value.getParentNodes(n.rootNode.name,K.type));return{...W,[K.type]:C}},{}));function T(W){return u.value.find(K=>K.type===W)}function k(W){const K=T(W);return(K==null?void 0:K.maxConnections)!==1}function $(W){return k(W)&&!h.value.includes(W)}function R(W,K){k(W)&&(K?h.value=[...h.value,W]:h.value=h.value.filter(C=>C!==W))}function B(W){return W.map(K=>{const C=s.getNodeByName(K);if(C){const U=a.getNodeType(C.type);if(U){const F=i.getNodeIssues(U,C,m.value),I=F?kn(F,C):"";return{node:C,nodeType:U,issues:I}}}return null}).filter(K=>K!==null)}function z(W){return p.value&&(P.value[W]??[]).length>0}function A(W){return typeof W=="string"?!1:"type"in W}function V(){return!g.value||!n.rootNode?[]:me(m.value,n.rootNode,g.value).filter(C=>A(C)?C.type!=="main":!1)}function L(W,K){if(k(K)&&!h.value.includes(K)){R(K,!0);return}r("switchSelectedNode",W)}function ne(W){const K=c.value[W];if(k(W)&&!h.value.includes(W)&&K.length>=1){R(W,!0);return}r("openConnectionNodeCreator",n.rootNode.name,W)}function ye(){p.value=!1,setTimeout(()=>{p.value=!0},0)}return to(b,l(()=>setTimeout(()=>{h.value=[],u.value=V()},0),{debounceTime:1e3}),{immediate:!0}),t({showNodeInputsIssues:ye}),(W,K)=>{const C=S("n8n-icon-button"),U=S("n8n-tooltip"),F=Et("on-click-outside");return d(),N("div",{class:D(W.$style.container)},[f("div",{class:D(W.$style.connections),style:se(`--possible-connections: ${u.value.length}`)},[(d(!0),N(te,null,ue(u.value,I=>(d(),N("div",{key:I.type,"data-test-id":`subnode-connection-group-${I.type}`},[f("div",{class:D(W.$style.connectionType)},[f("span",{class:D({[W.$style.connectionLabel]:!0,[W.$style.hasIssues]:z(I.type)}),textContent:w(`${I.displayName}${I.required?" *":""}`)},null,10,xa),Q((d(),N("div",{class:D({[W.$style.connectedNodesWrapper]:!0,[W.$style.connectedNodesWrapperExpanded]:h.value.includes(I.type)}),style:se(`--nodes-length: ${c.value[I.type].length}`),onClick:H=>R(I.type,!0)},[!(c.value[I.type].length>=1)||I.maxConnections!==1?(d(),N("div",{key:0,class:D({[W.$style.plusButton]:!0,[W.$style.hasIssues]:z(I.type)}),onClick:H=>ne(I.type)},[y(U,{placement:"top",teleported:!0,offset:10,"show-after":300,disabled:$(I.type)&&c.value[I.type].length>=1},{content:v(()=>[O(" Add "+w(I.displayName)+" ",1),z(I.type)?(d(),_(xt,{key:0,title:`${W.$locale.baseText("node.issues")}:`,items:P.value[I.type]},null,8,["title","items"])):E("",!0)]),default:v(()=>[y(C,{size:"medium",icon:"plus",type:"tertiary","data-test-id":`add-subnode-${I.type}`},null,8,["data-test-id"])]),_:2},1032,["disabled"])],10,Ha)):E("",!0),c.value[I.type].length>0?(d(),N("div",{key:1,class:D({[W.$style.connectedNodes]:!0,[W.$style.connectedNodesMultiple]:c.value[I.type].length>1})},[(d(!0),N(te,null,ue(c.value[I.type],(H,X)=>(d(),N("div",{key:H.node.name,class:D({[W.$style.nodeWrapper]:!0,[W.$style.hasIssues]:H.issues}),"data-test-id":"floating-subnode","data-node-name":H.node.name,style:se(`--node-index: ${X}`)},[(d(),_(U,{key:H.node.name,placement:"top",teleported:!0,offset:10,"show-after":300,disabled:$(I.type)},{content:v(()=>[O(w(H.node.name)+" ",1),H.issues?(d(),_(xt,{key:0,title:`${W.$locale.baseText("node.issues")}:`,items:H.issues},null,8,["title","items"])):E("",!0)]),default:v(()=>[f("div",{class:D(W.$style.connectedNode),onClick:ie=>L(H.node.name,I.type)},[y(nt,{"node-type":H.nodeType,"node-name":H.node.name,"tooltip-position":"top",size:20,circle:""},null,8,["node-type","node-name"])],10,za)]),_:2},1032,["disabled"]))],14,Fa))),128))],2)):E("",!0)],14,La)),[[F,()=>R(I.type,!1)]])],2)],8,Ua))),128))],6)],2)}}}),Ka="_container_dier5_18",Ya="_connections_dier5_26",qa="_connectionType_dier5_38",Ga="_connectionLabel_dier5_45",Ja="_hasIssues_dier5_51",Xa="_connectedNodesWrapper_dier5_55",Qa="_plusButton_dier5_63",Za="_connectedNodesWrapperExpanded_dier5_81",er="_connectedNodesMultiple_dier5_87",tr="_connectedNode_dier5_55",or="_connectedNodes_dier5_55",nr="_nodeWrapper_dier5_125",sr={container:Ka,connections:Ya,connectionType:qa,connectionLabel:Ga,hasIssues:Ja,connectedNodesWrapper:Xa,plusButton:Qa,"horizontal-shake":"_horizontal-shake_dier5_1",connectedNodesWrapperExpanded:Za,connectedNodesMultiple:er,connectedNode:tr,connectedNodes:or,nodeWrapper:nr},ir={$style:sr},ar=G(ja,[["__cssModules",ir]]),rr=Y({inheritAttrs:!1,props:{nodeName:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String},hideIcon:{type:Boolean}},setup(e){const t=st(),n=Z().getNodeByName(e.nodeName),s=Ce(n),a=We(),{runWorkflow:i}=In({router:t});return{externalHooks:a,pinnedData:s,runWorkflow:i,...tt(),...Zt()}},computed:{...le(ee,oe,Z,pe),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===et)},isChatNode(){return!!(this.nodeType&&this.nodeType.name===Ze)},isChatChild(){return this.workflowsStore.checkIfNodeHasChatParent(this.nodeName)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Me)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===Re)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isChatNode?this.$locale.baseText("ndv.execute.testChat"):this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.$locale.baseText("ndv.execute.testNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isChatNode||this.isChatChild&&this.ndvStore.isDNVDataEmpty("input"))this.ndvStore.setActiveNodeName(null),de.emit("openChat");else if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.pinnedData.hasData.value&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===He,e&&this.node&&this.pinnedData.unsetData("unpin-and-execute-modal")),!this.pinnedData.hasData.value||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.externalHooks.run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function lr(e,t,o,n,s,a){const i=S("n8n-button"),l=S("n8n-tooltip");return d(),N("div",null,[y(l,{placement:"bottom",disabled:!e.disabledHint},{content:v(()=>[f("div",null,w(e.disabledHint),1)]),default:v(()=>[f("div",null,[y(i,Hi(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:!e.isListeningForEvents&&!e.hideIcon&&"flask","transparent-background":e.transparent,title:e.isTriggerNode?"":e.$locale.baseText("ndv.execute.testNode.description"),onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparent-background","title","onClick"])])]),_:1},8,["disabled"])])}const so=G(rr,[["render",lr]]),dr=Y({name:"NodeSettings",components:{NodeTitle:ya,NodeCredentials:oi,ParameterInputList:ni,NodeSettingsTabs:Na,NodeWebhooks:Ba,NDVSubConnections:ar,NodeExecuteButton:so},setup(){const e=Ve();return{externalHooks:We(),nodeHelpers:e}},computed:{...le(eo,ee,oe,pe,bn,Z,Pn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(ho)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=me(e,t,this.nodeType);if(!we(o).includes(M.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return!((e=this.node)!=null&&e.typeVersion)||this.latestVersion===this.node.typeVersion},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return vn((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:Nn,CUSTOM_NODES_DOCS_URL:Gn,MAIN_NODE_PANEL_WIDTH:Le,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:ho,parameters:""})}catch{}}}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.nodeHelpers.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){var e;this.hiddenIssuesInputs=[],(e=this.$refs.subConnections)==null||e.showNodeInputsIssues(),this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),s=!1;if(n!==void 0&&n.includes("[")){const a=n.match(/(.*)\[(\d+)\]$/);a&&(o.push(a[1]),n=a[2],s=!0)}if(o.length===0)if(t===null){const{[n]:a,...i}=this.nodeValues;this.nodeValues=i}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let a=ke(this.nodeValues,o.join("."));const{[n]:i,...l}=a;if(a=l,s&&a.length===0){n=o.pop(),a=ke(this.nodeValues,o.join("."));const{[n]:r,...u}=a;a=u}}else typeof t=="object"?Ue(ke(this.nodeValues,o.join(".")),n,$e(t)):Ue(ke(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.nodeHelpers.updateNodeCredentialIssues(t),this.externalHooks.run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new _n(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var s;let t;e.hasOwnProperty("value")?t=e.value:t=ke(this.nodeValues,e.name);const o=e.node||((s=this.node)==null?void 0:s.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const a={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",a)}else if(e.name==="parameters"){const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!a)return;let i=Fe(a.properties,n.parameters,!1,!1,n);const l=Object.assign({},i);i=$e(i);for(const r of Object.keys(e.value)){t=e.value[r];const u=r.split(".").slice(1).join("."),h=u.match(/(.*)\[(\d+)\]$/);if(e[r]===void 0&&h!==null){const p=h[1],g=h[2],b=ke(i,p);Array.isArray(b)&&(b.splice(parseInt(g,10),1),Ue(i,p,b))}else t===void 0?Rt(i,u):Ue(i,u,t);this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:u,newValue:t,parameters:this.parameters,oldNodeParameters:l})}i=Fe(a.properties,i,!0,!1,n);for(const r of Object.keys(i))i&&i[r]!==null&&i[r]!==void 0&&this.setValue(`parameters.${r}`,i[r]);if(i){const r={name:n.name,value:i};this.workflowsStore.setNodeParameters(r),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!a)return;let i=Fe(a.properties,n.parameters,!1,!1,n);const l=Object.assign({},i);i=$e(i);const r=e.name.split(".").slice(1).join("."),u=r.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&u!==null){const p=u[1],g=u[2],b=ke(i,p);Array.isArray(b)&&(b.splice(parseInt(g,10),1),Ue(i,p,b))}else t===void 0?Rt(i,r):Ue(i,r,t),this.removeMismatchedOptionValues(a,i,{name:r,value:t});i=Fe(a.properties,i,!0,!1,n);for(const p of Object.keys(i))i&&i[p]!==null&&i[p]!==void 0&&this.setValue(`parameters.${p}`,i[p]);const h={name:n.name,value:i};this.workflowsStore.setNodeParameters(h),this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:r,newValue:t,parameters:this.parameters,oldNodeParameters:l}),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(a.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const a={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(a)}},removeMismatchedOptionValues(e,t,o){e.properties.forEach(n=>{var r,u;const s=n.displayOptions;if(!(t!=null&&t.hasOwnProperty(n.name))||!s||!n.options)return;const a=(r=s.show)==null?void 0:r[o.name],i=(u=s.hide)==null?void 0:u[o.name];if(a===void 0&&i===void 0)return;(!Object.keys(t).every(h=>(n.options??[]).find(p=>p.name===h)!==void 0)||a!==o.value||i===o.value)&&Rt(t,n.name)})},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:$e(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}}}),ur="_header_1pn0y_1",cr="_warningIcon_1pn0y_5",hr="_descriptionContainer_1pn0y_10",pr={header:ur,warningIcon:cr,descriptionContainer:hr},fr={class:"header-side-menu"},gr={key:1},mr={key:0,class:"node-is-not-valid"},yr={class:"missingNodeTitleContainer mt-s mb-xs"},wr={class:"mb-l"},vr=["href"],Nr=["href","textContent"],kr={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},br={key:1,class:"no-parameters"},Tr={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},Sr={class:"node-version","data-test-id":"node-version"};function Dr(e,t,o,n,s,a){var $;const i=S("NodeTitle"),l=S("NodeExecuteButton"),r=S("NodeSettingsTabs"),u=S("font-awesome-icon"),h=S("n8n-text"),p=S("i18n-t"),g=S("n8n-link"),b=S("n8n-notice"),m=S("NodeWebhooks"),P=S("NodeCredentials"),c=S("ParameterInputList"),T=S("NDVSubConnections"),k=S("n8n-block-ui");return d(),N("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=re(()=>{},["stop"]))},[f("div",{class:D(e.$style.header)},[f("div",fr,[e.node?(d(),_(i,{key:0,class:"node-name","model-value":e.node.name,"node-type":e.nodeType,"read-only":e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["model-value","node-type","read-only","onUpdate:modelValue"])):E("",!0),e.isExecutable?(d(),N("div",gr,[!e.blockUI&&e.node&&e.nodeValid?(d(),_(l,{key:0,"data-test-id":"node-execute-button","node-name":e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small","telemetry-source":"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["node-name","disabled","onExecute","onStopExecution"])):E("",!0)])):E("",!0)]),e.node&&e.nodeValid?(d(),_(r,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=R=>e.openPanel=R),"node-type":e.nodeType,"session-id":e.sessionId},null,8,["modelValue","node-type","session-id"])):E("",!0)],2),e.node&&!e.nodeValid?(d(),N("div",mr,[f("p",{class:D(e.$style.warningIcon)},[y(u,{icon:"exclamation-triangle"})],2),f("div",yr,[y(h,{size:"large",color:"text-dark",bold:""},{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(d(),N("div",{key:0,class:D(e.$style.descriptionContainer)},[f("div",wr,[y(p,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:v(()=>[f("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},w(e.node.type.split(".")[0]),9,vr)]),_:1},8,["onClick"])]),y(g,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(d(),_(p,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:v(()=>[f("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:w(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,Nr)]),_:1}))])):E("",!0),e.node&&e.nodeValid?(d(),N("div",kr,[e.hasForeignCredential?(d(),_(b,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):E("",!0),Q(f("div",null,[y(m,{node:e.node,"node-type":e.nodeType},null,8,["node","node-type"]),e.nodeValuesInitialized?(d(),_(c,{key:0,parameters:e.parametersNoneSetting,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:v(()=>[y(P,{node:e.node,readonly:e.isReadOnly,"show-all":!0,"hide-issues":e.hiddenIssuesInputs.includes("credentials"),onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur},null,8,["node","readonly","hide-issues","onCredentialSelected","onValueChanged","onBlur"])]),_:1},8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onActivate","onParameterBlur"])):E("",!0),e.parametersNoneSetting.length===0?(d(),N("div",br,[y(h,null,{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):E("",!0),e.nodeHelpers.isCustomApiCallSelected(e.nodeValues)?(d(),N("div",Tr,[y(b,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):E("",!0)],512),[[ae,e.openPanel==="params"]]),Q(f("div",null,[y(c,{parameters:e.parametersSetting,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),y(c,{parameters:e.nodeSettings,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),f("div",Sr,[O(w(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:($=e.nodeType)==null?void 0:$.displayName,version:(e.node.typeVersion??e.latestVersion).toString()}}))+" ",1),f("span",null,"("+w(e.nodeVersionTag)+")",1)])],512),[[ae,e.openPanel==="settings"]])])):E("",!0),e.node?(d(),_(T,{key:2,ref:"subConnections","root-node":e.node,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["root-node","onSwitchSelectedNode","onOpenConnectionNodeCreator"])):E("",!0),y(k,{show:e.blockUI},null,8,["show"])],34)}const Er={$style:pr},Cr=G(dr,[["render",Dr],["__cssModules",Er],["__scopeId","data-v-b094ac2b"]]),Ir=Y({name:"Draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...le(oe),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,s;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((s=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:s.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){var t;if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const o=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:o||"",dimensions:((t=this.draggingEl)==null?void 0:t.getBoundingClientRect())??null}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),Pr="_dragging_176yl_1",_r="_draggable_176yl_6",Or={dragging:Pr,draggable:_r,"draggable-data-transfer":"_draggable-data-transfer_176yl_13"};function $r(e,t,o,n,s,a){return d(),_(Vn(e.tag),{ref:"wrapper",class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart},{default:v(()=>[he(e.$slots,"default",{isDragging:e.isDragging}),(d(),_(Wn,{to:"body"},[Q(f("div",{ref:"draggable",class:D(e.$style.draggable),style:se(e.draggableStyle)},[he(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[ae,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Rr={$style:Or},Ar=G(Ir,[["render",$r],["__cssModules",Rr]]),Mr=Y({components:{Draggable:Ar},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),Wr="_dragContainer_1fum9_1",Vr="_dragButton_1fum9_5",Br="_leftArrow_1fum9_19 _arrow_1fum9_28",Ur="_rightArrow_1fum9_20 _arrow_1fum9_28",xr="_visible_1fum9_24",Lr="_arrow_1fum9_28",Hr="_grid_1fum9_46",Fr={dragContainer:Wr,dragButton:Vr,leftArrow:Br,rightArrow:Ur,visible:xr,arrow:Lr,grid:Hr},zr=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),jr=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Kr=[zr,jr];function Yr(e,t,o,n,s,a){const i=S("font-awesome-icon"),l=S("Draggable");return d(),_(l,{type:"panel-resize",class:D(e.$style.dragContainer),onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd},{default:v(({isDragging:r})=>[f("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(d(),N("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:r})},[y(i,{icon:"arrow-left"})],2)):E("",!0),e.canMoveRight?(d(),N("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:r})},[y(i,{icon:"arrow-right"})],2)):E("",!0),f("div",{class:D(e.$style.grid)},Kr,2)],2)]),_:1},8,["class","onDrag","onDragstart","onDragend"])}const qr={$style:Fr},Gr=G(Mr,[["render",Yr],["__cssModules",qr]]),Jr=["data-node-name","data-node-placement","onClick"],Xr=Y({__name:"NDVFloatingNodes",props:{rootNode:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,s=Z(),a=ee(),i=s.getCurrentWorkflow(),l=o;function r(m){const P=p.value[m][0];P&&l("switchSelectedNode",P.node.name)}function u(m){if(m.shiftKey&&m.altKey&&(m.ctrlKey||m.metaKey)){const c={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowLeft:"inputMain"}[m.key]||null;c&&r(c)}}function h(m){return m.map(P=>{const c=s.getNodeByName(P);if(c){const T=a.getNodeType(c.type);if(T)return{node:c,nodeType:T}}return null}).filter(P=>P!==null)}const p=q(()=>{const m=n.rootNode.name;return{outputSub:h(i.getChildNodes(m,"ALL_NON_MAIN")),outputMain:h(i.getChildNodes(m,"main",1)),inputMain:h(i.getParentNodes(m,"main",1))}}),g=["outputSub","outputMain","inputMain"],b={outputSub:"bottom",outputMain:"left",inputMain:"right"};return Rn(()=>{document.addEventListener("keydown",u,!0)}),Fi(()=>{document.removeEventListener("keydown",u,!0)}),t({moveNodeDirection:r}),(m,P)=>{const c=S("n8n-tooltip");return d(),N("aside",{class:D(m.$style.floatingNodes)},[(d(),N(te,null,ue(g,T=>f("ul",{key:T,class:D([m.$style.nodesList,m.$style[T]])},[(d(!0),N(te,null,ue(p.value[T],({node:k,nodeType:$})=>(d(),N(te,null,[k&&$?(d(),_(c,{key:k.name,placement:b[T],teleported:!1,offset:60},{content:v(()=>[O(w(k.name),1)]),default:v(()=>[f("li",{class:D(m.$style.connectedNode),"data-test-id":"floating-node","data-node-name":k.name,"data-node-placement":T,onClick:R=>m.$emit("switchSelectedNode",k.name)},[y(nt,{"node-type":$,"node-name":k.name,"tooltip-position":b[T],size:35,circle:""},null,8,["node-type","node-name","tooltip-position"])],10,Jr)]),_:2},1032,["placement"])):E("",!0)],64))),256))],2)),64))],2)}}}),Qr="_floatingNodes_1c7jr_1",Zr="_nodesList_1c7jr_15",el="_inputSub_1c7jr_29",tl="_outputSub_1c7jr_29",ol="_outputMain_1c7jr_40",nl="_inputMain_1c7jr_40",sl="_connectedNode_1c7jr_63",il={floatingNodes:Qr,nodesList:Zr,inputSub:el,outputSub:tl,outputMain:ol,inputMain:nl,connectedNode:sl},al={$style:il},rl=G(Xr,[["__cssModules",al]]),Oe=24,hn=80,xe=280,ll=320,dl=420,ul={regular:Le,dragless:Le,unknown:Le,inputless:Le,wide:Le*2},cl=Y({name:"NDVDraggablePanels",components:{PanelDragButton:Gr,NDVFloatingNodes:rl},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},setup(){const{callDebounced:e}=bt();return{callDebounced:e}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:xe,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),wt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),wt.off("setPositionByName",this.setPositionByName)},computed:{...le(oe),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":ke(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(hn)},minWindowWidth(){return 2*(Oe+hn)+xe},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth(Oe+20)+this.inputPanelMargin:this.pxToRelativeWidth(Oe)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth(Oe+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth(Oe),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(xe+Oe),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return ke(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?dl*e:ll*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(xe);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(xe);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth(Oe+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(ul[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,s=this.minimumLeftPosition>t,a=this.currentNodePaneType==="inputless";if(s){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:a?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced(this.onResize,{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),s=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=xe||(this.setMainPanelWidth(s),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=Ae(`${po}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){Ae(`${po}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),hl="_dataPanel_a6j4o_1",pl="_inputPanel_a6j4o_10 _dataPanel_a6j4o_1",fl="_outputPanel_a6j4o_18 _dataPanel_a6j4o_1",gl="_mainPanel_a6j4o_26",ml="_draggable_a6j4o_30",yl="_mainPanelInner_a6j4o_34",wl="_dragging_a6j4o_41",vl="_dragButtonContainer_a6j4o_54",Nl="_visible_a6j4o_70",kl={dataPanel:hl,inputPanel:pl,outputPanel:fl,mainPanel:gl,draggable:ml,mainPanelInner:yl,dragging:wl,"double-width":"_double-width_a6j4o_50",dragButtonContainer:vl,visible:Nl};function bl(e,t,o,n,s,a){const i=S("NDVFloatingNodes"),l=S("PanelDragButton"),r=S("n8n-resize-wrapper");return d(),N("div",null,[e.activeNode?(d(),_(i,{key:0,"root-node":e.activeNode,onSwitchSelectedNode:e.onSwitchSelectedNode},null,8,["root-node","onSwitchSelectedNode"])):E("",!0),e.hideInputAndOutput?E("",!0):(d(),N("div",{key:1,class:D(e.$style.inputPanel),style:se(e.inputPanelStyles)},[he(e.$slots,"input")],6)),e.hideInputAndOutput?E("",!0):(d(),N("div",{key:2,class:D(e.$style.outputPanel),style:se(e.outputPanelStyles)},[he(e.$slots,"output")],6)),f("div",{class:D(e.$style.mainPanel),style:se(e.mainPanelStyles)},[y(r,{"is-resizing-enabled":e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),"min-width":e.MIN_PANEL_WIDTH,"grid-size":20,"supported-directions":e.supportedResizeDirections,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd},{default:v(()=>[f("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(d(),_(l,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),"can-move-left":e.canMoveLeft,"can-move-right":e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","can-move-left","can-move-right","onDragstart","onDrag","onDragend"])):E("",!0)],2),f("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[he(e.$slots,"main")],2)]),_:3},8,["is-resizing-enabled","width","min-width","supported-directions","onResize","onResizestart","onResizeend"])],6)])}const Tl={$style:kl},Sl=G(cl,[["render",bl],["__cssModules",Tl]]),Dl={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...fo.defaults.allowedTags,"style","img","title"],allowedAttributes:{...fo.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},El={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return Jn(this.inputHtml,Dl)}}},Cl=["srcdoc"];function Il(e,t,o,n,s,a){return d(),N("iframe",{class:"__html-display",srcdoc:a.sanitizedHtml},null,8,Cl)}const Un=G(El,[["render",Il]]),Pl=Object.freeze(Object.defineProperty({__proto__:null,default:Un},Symbol.toStringTag,{value:"Module"})),_l=Y({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Ji,RunDataHtml:Un},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...le(Z)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:s}=this.binaryData,a=n==="json",i=n==="html";if(!e)a||i?this.data=zt(atob(t)):this.embedSource="data:"+s+";base64,"+t;else try{const l=this.workflowsStore.getBinaryUrl(e,"view",o,s);if(a||i){const r=await fetch(l,{credentials:"include"});this.data=await(a?r.json():r.text())}else this.embedSource=l}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),Ol={key:0},$l={key:1},Rl={key:2},Al={key:0,controls:"",autoplay:""},Ml=["src","type"],Wl={key:1,controls:"",autoplay:""},Vl=["src","type"],Bl=["src"];function Ul(e,t,o,n,s,a){const i=S("VueJsonPretty"),l=S("RunDataHtml");return d(),N("span",null,[e.isLoading?(d(),N("div",Ol,"Loading binary data...")):e.error?(d(),N("div",$l,"Error loading binary data")):(d(),N("span",Rl,[e.binaryData.fileType==="video"?(d(),N("video",Al,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Ml),O(" "+w(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(d(),N("audio",Wl,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Vl),O(" "+w(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(d(),_(i,{key:2,data:e.data,deep:3,"show-length":!0},null,8,["data"])):e.binaryData.fileType==="html"?(d(),_(l,{key:3,"input-html":e.data},null,8,["input-html"])):(d(),N("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Bl))]))])}const xl=G(_l,[["render",Ul]]),Ll=Y({name:"BinaryDataDisplay",components:{BinaryDataDisplayEmbed:xl},props:["displayData","windowVisible"],setup(){return{nodeHelpers:Ve()}},computed:{...le(Z),binaryData(){const e=this.nodeHelpers.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Hl={class:"binary-data-window-wrapper"},Fl={key:0};function zl(e,t,o,n,s,a){var r;const i=S("n8n-button"),l=S("BinaryDataDisplayEmbed");return e.windowVisible?(d(),N("div",{key:0,class:D(["binary-data-window",(r=e.binaryData)==null?void 0:r.fileType])},[y(i,{size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList"),onClick:re(e.closeWindow,["stop"])},null,8,["title","label","onClick"]),f("div",Hl,[e.binaryData?(d(),_(l,{key:1,"binary-data":e.binaryData},null,8,["binary-data"])):(d(),N("div",Fl,w(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):E("",!0)}const jl=G(Ll,[["render",zl]]),Kl={class:"feedback"},Yl=Y({__name:"Feedback",props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,n=Te();function s(a){o("update:modelValue",a)}return(a,i)=>{const l=S("N8nText"),r=S("FontAwesomeIcon"),u=S("N8nTooltip");return d(),N("div",Kl,[e.modelValue?(d(),_(l,{key:1,color:e.modelValue==="positive"?"success":"danger"},{default:v(()=>[y(r,{icon:e.modelValue==="positive"?"thumbs-up":"thumbs-down",class:"mr-2xs"},null,8,["icon"]),O(" "+w(x(n).baseText(`feedback.${e.modelValue}`)),1)]),_:1},8,["color"])):(d(),_(l,{key:0,class:"mr-2xs"},{default:v(()=>[O(w(x(n).baseText("feedback.title")),1)]),_:1})),e.modelValue?E("",!0):(d(),_(u,{key:2,content:x(n).baseText("feedback.positive")},{default:v(()=>[f("span",{class:"feedback-button","data-test-id":"feedback-button-positive",onClick:i[0]||(i[0]=h=>s("positive"))},[y(r,{icon:"thumbs-up"})])]),_:1},8,["content"])),e.modelValue?E("",!0):(d(),_(u,{key:3,content:x(n).baseText("feedback.negative")},{default:v(()=>[f("span",{class:"feedback-button","data-test-id":"feedback-button-negative",onClick:i[1]||(i[1]=h=>s("negative"))},[y(r,{icon:"thumbs-down"})])]),_:1},8,["content"]))])}}}),ql=St("ai",()=>{const e=Tt(),t=jt(),o=q(()=>t.settings.ai.errorDebugging);async function n(s){return await si(e.getRestApiContext,s)}return{isErrorDebuggingEnabled:o,debugError:n}}),Gl={class:"node-error-view"},Jl={class:"node-error-view__header"},Xl={class:"node-error-view__header-message"},Ql=["innerHTML"],Zl={key:0},ed={key:2,class:"node-error-view__feedback-toolbar"},td={class:"node-error-view__info"},od={class:"node-error-view__info-header"},nd={class:"node-error-view__info-title"},sd={class:"copy-button"},id={class:"node-error-view__info-content"},ad={key:0,class:"node-error-view__details"},rd={class:"node-error-view__details-summary"},ld={class:"node-error-view__details-content"},dd={key:0,class:"node-error-view__details-row"},ud={class:"node-error-view__details-label"},cd={class:"node-error-view__details-value"},hd={key:1,class:"node-error-view__details-row"},pd={class:"node-error-view__details-label"},fd={class:"node-error-view__details-value"},gd={key:2,class:"node-error-view__details-row"},md={class:"node-error-view__details-label"},yd={class:"node-error-view__details-value"},wd={key:3,class:"node-error-view__details-row"},vd={class:"node-error-view__details-label"},Nd={class:"node-error-view__details-value"},kd={key:4,class:"node-error-view__details-row"},bd={class:"node-error-view__details-label"},Td={class:"node-error-view__details-value"},Sd={class:"node-error-view__details"},Dd={class:"node-error-view__details-summary"},Ed={class:"node-error-view__details-content"},Cd={key:0,class:"node-error-view__details-row"},Id={class:"node-error-view__details-label"},Pd={class:"node-error-view__details-value"},_d={key:1,class:"node-error-view__details-row"},Od={class:"node-error-view__details-label"},$d={class:"node-error-view__details-value"},Rd={key:2,class:"node-error-view__details-row"},Ad={class:"node-error-view__details-label"},Md={class:"node-error-view__details-value"},Wd={key:3,class:"node-error-view__details-row"},Vd={class:"node-error-view__details-label"},Bd={class:"node-error-view__details-value"},Ud={key:4,class:"node-error-view__details-row"},xd={class:"node-error-view__details-label"},Ld={class:"node-error-view__details-value"},Hd={class:"node-error-view__details-row"},Fd={class:"node-error-view__details-label"},zd={class:"node-error-view__details-value"},jd={key:5,class:"node-error-view__details-row"},Kd={class:"node-error-view__details-label"},Yd={class:"node-error-view__details-value"},qd={key:6,class:"node-error-view__details-row"},Gd={class:"node-error-view__details-label"},Jd={class:"node-error-view__details-value"},Xd={key:7,class:"node-error-view__details-row"},Qd={class:"node-error-view__details-label"},Zd={class:"node-error-view__details-value"},eu={key:8,class:"node-error-view__details-row"},tu={class:"node-error-view__details-label"},ou={class:"node-error-view__details-value"},nu=Y({__name:"NodeErrorView",props:{error:{type:Object,required:!0}},setup(e){const t=e,o=Qt(),n=tt(),s=Te(),a=Xn(),i=ee(),l=oe(),r=Tt(),u=ql(),h=j(!1),p=j(""),g=j(),b=q(()=>u.isErrorDebuggingEnabled),m=q(()=>b.value&&!(h.value||p.value)),P=q(()=>JSON.stringify(t.error.cause).length<Tn),c=q(()=>{const C=l.activeNode;if(!C)return[];const U=i.getNodeType(C.type,C.typeVersion);return U===null?[]:U.properties}),T=q(()=>{const C=r.urlBaseEditor;let U="Self Hosted";return C.includes("n8n.cloud")&&(U="Cloud"),r.versionCli+` (${U})`}),k=q(()=>{var F,I;const C=(F=t.error)==null?void 0:F.node;if(!C)return"Node";const U=i.getNodeType(C.type,C.typeVersion);return((I=U==null?void 0:U.defaults)==null?void 0:I.name)||C.name}),$=q(()=>{var F;const C=[];if(!((F=t.error.messages)!=null&&F.length))return[];const U=L();return Array.from(new Set(t.error.messages)).forEach(I=>{const X=/^\d{3} - \{/.test(I)?I.split(" - ").map(ie=>ie.trim()):[];for(const ie of X)try{const ve=JSON.parse(ie);if(typeof ve=="object"){C.push(ve);return}}catch{}I!==U&&C.push(I)}),C});async function R(){try{h.value=!0;const{message:C}=await u.debugError({error:t.error});p.value=C}catch(C){n.showError(C,s.baseText("generic.error"))}finally{h.value=!1}}async function B(){var C;p.value="",g.value=void 0,await R(),a.track("User regenerated error debugging AI hint",{node_type:(C=t.error.node)==null?void 0:C.type,error_title:t.error.message})}async function z(C){var U;a.track("User responded error debugging AI hint",{helpful:C==="positive",node_type:(U=t.error.node)==null?void 0:U.type,error_title:t.error.message})}function A(C){if(!C||"hidden"in C&&C.hidden)return s.baseText("nodeSettings.deprecated");const U=Math.max(...i.getNodeVersions(C.type));return U===C.typeVersion?s.baseText("nodeSettings.latest"):s.baseText("nodeSettings.latestVersion",{interpolate:{version:U.toString()}})}function V(){var F,I;if(t.error.name==="NodeOperationError"&&t.error.functionality==="configuration-node")return rt(t.error.description+s.baseText("pushConnection.executionError.openNode",{interpolate:{node:t.error.node.name}}));if((F=t.error.context)!=null&&F.descriptionKey){const H={nodeCause:t.error.context.nodeCause,runIndex:t.error.context.runIndex??"0",itemIndex:t.error.context.itemIndex??"0"};return rt(s.baseText(`nodeErrorView.description.${t.error.context.descriptionKey}`,{interpolate:H}))}if(!((I=t.error.context)!=null&&I.descriptionTemplate))return rt(t.error.description??"");const U=ne(t.error.context.parameter);return rt(t.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,U))}function L(){var I;const C="";if(t.error.name==="NodeOperationError"&&t.error.functionality==="configuration-node")return s.baseText("nodeErrorView.errorSubNode",{interpolate:{node:t.error.node.name}});if(t.error.message===t.error.description)return C;if(!((I=t.error.context)!=null&&I.messageTemplate))return C+t.error.message;const F=ne(t.error.context.parameter);return C+t.error.context.messageTemplate.replace(/%%PARAMETER%%/g,F)}function ne(C,U=!0){try{const F=ye(c.value,C.split("."));if(!F.length)throw new Error;return U?F.map(I=>I.displayName).join(" > "):F.pop().displayName}catch{return`Could not find parameter "${C}"`}}function ye(C,U){let F=U.shift();if(F===void 0)return[];const I=F.match(/(.*)\[([\d])\]$/);I!==null&&I.length>0&&(F=I[1]);const H=C.find(X=>X.name===F);if(H===void 0)throw new Error(`Could not find parameter "${F}"`);return U.length===0?[H]:H.hasOwnProperty("options")?[H,...ye(H.options,U)]:H.hasOwnProperty("values")?[H,...ye(H.values,U)]:[H]}function W(){var H,X,ie,ve,at,je;const C=t.error,U={errorMessage:L()};C.description&&(U.errorDescription=C.description);const F={};(H=C==null?void 0:C.messages)!=null&&H.length&&(F.rawErrorMessage=C.messages),"httpCode"in C&&C.httpCode&&(F.httpCode=C.httpCode),C.context&&C.context.data&&(F.errorData=C.context.data),C.extra&&(F.errorExtra=C.extra),U.errorDetails=F;const I={};C.node&&(I.nodeName=C.node.name,I.nodeType=C.node.type,I.nodeVersion=C.node.typeVersion,(ie=(X=C.node)==null?void 0:X.parameters)!=null&&ie.resource&&(I.resource=C.node.parameters.resource),(at=(ve=C==null?void 0:C.node)==null?void 0:ve.parameters)!=null&&at.operation&&(I.operation=C.node.parameters.operation)),C.context&&(C.context.itemIndex!==void 0&&(I.itemIndex=C.context.itemIndex),C.context.runIndex!==void 0&&(I.runIndex=C.context.runIndex),C.context.parameter!==void 0&&(I.parameter=C.context.parameter),C.context.causeDetailed&&(I.causeDetailed=C.context.causeDetailed)),C.timestamp&&(I.time=new Date(C.timestamp).toLocaleString()),I.n8nVersion=T.value,I.binaryDataMode=r.binaryDataMode,C.cause&&(I.cause=C.cause),I.stackTrace=(je=C.stack)==null?void 0:je.split(`
8
- `),U.n8nDetails=I,o.copy(JSON.stringify(U,null,2)),K()}function K(){n.showMessage({title:s.baseText("nodeErrorView.showMessage.title"),type:"info"})}return(C,U)=>{var io,ao,ro,lo,uo;const F=S("N8nButton"),I=S("N8nSpinner"),H=S("FontAwesomeIcon"),X=S("N8nTooltip"),ie=S("N8nCard"),ve=S("n8n-icon-button"),at=S("n8n-tooltip"),je=S("font-awesome-icon");return d(),N("div",Gl,[f("div",Jl,[f("div",Xl,[f("div",{class:D(m.value?"mt-4xs":"")},w(L()),3),m.value?(d(),_(F,{key:0,type:"tertiary",size:"small",onClick:R},{default:v(()=>[O(w(x(s).baseText("nodeErrorView.debugError.button")),1)]),_:1})):E("",!0)]),e.error.description||(io=e.error.context)!=null&&io.descriptionKey?(d(),N("div",{key:0,class:"node-error-view__header-description",innerHTML:V()},null,8,Ql)):E("",!0)]),h.value||p.value?(d(),_(ie,{key:0,class:"node-error-view__debugging mb-s"},{default:v(()=>[h.value?(d(),N("span",Zl,[y(I,{class:"mr-3xs"}),O(" "+w(x(s).baseText("nodeErrorView.debugError.loading")),1)])):(d(),_(x(Xi),{key:1,source:p.value},null,8,["source"])),p.value?(d(),N("div",ed,[y(Yl,{modelValue:g.value,"onUpdate:modelValue":[U[0]||(U[0]=Ct=>g.value=Ct),z]},null,8,["modelValue"]),y(X,{content:x(s).baseText("nodeErrorView.debugError.feedback.reload")},{default:v(()=>[f("span",{class:"node-error-view__feedback-button",onClick:B},[y(H,{icon:"sync-alt"})])]),_:1},8,["content"])])):E("",!0)]),_:1})):E("",!0),f("div",td,[f("div",od,[f("p",nd,w(x(s).baseText("nodeErrorView.details.title")),1),y(at,{class:"item",content:x(s).baseText("nodeErrorView.copyToClipboard.tooltip"),placement:"left"},{default:v(()=>[f("div",sd,[y(ve,{icon:"copy",type:"secondary",size:"mini",text:"true","transparent-background":"transparent",onClick:W})])]),_:1},8,["content"])]),f("div",id,["httpCode"in e.error&&e.error.httpCode||$.value.length||(ro=(ao=e.error)==null?void 0:ao.context)!=null&&ro.data||e.error.extra?(d(),N("details",ad,[f("summary",rd,[y(je,{class:"node-error-view__details-icon",icon:"angle-right"}),O(" "+w(x(s).baseText("nodeErrorView.details.from",{interpolate:{node:`${k.value}`}})),1)]),f("div",ld,["httpCode"in e.error&&e.error.httpCode?(d(),N("div",dd,[f("p",ud,w(x(s).baseText("nodeErrorView.errorCode")),1),f("p",cd,[f("code",null,w(e.error.httpCode),1)])])):E("",!0),$.value.length?(d(),N("div",hd,[f("p",pd,w(x(s).baseText("nodeErrorView.details.rawMessages")),1),f("div",fd,[(d(!0),N(te,null,ue($.value,(Ct,zn)=>(d(),N("div",{key:zn},[f("pre",null,[f("code",null,w(Ct),1)])]))),128))])])):E("",!0),(uo=(lo=e.error)==null?void 0:lo.context)!=null&&uo.data?(d(),N("div",gd,[f("p",md,w(x(s).baseText("nodeErrorView.details.errorData")),1),f("div",yd,[f("pre",null,[f("code",null,w(e.error.context.data),1)])])])):E("",!0),e.error.extra?(d(),N("div",wd,[f("p",vd,w(x(s).baseText("nodeErrorView.details.errorExtra")),1),f("div",Nd,[f("pre",null,[f("code",null,w(e.error.extra),1)])])])):E("",!0),e.error.context&&e.error.context.request?(d(),N("div",kd,[f("p",bd,w(x(s).baseText("nodeErrorView.details.request")),1),f("div",Td,[f("pre",null,[f("code",null,w(e.error.context.request),1)])])])):E("",!0)])])):E("",!0),f("details",Sd,[f("summary",Dd,[y(je,{class:"node-error-view__details-icon",icon:"angle-right"}),O(" "+w(x(s).baseText("nodeErrorView.details.info")),1)]),f("div",Ed,[e.error.context&&e.error.context.itemIndex!==void 0?(d(),N("div",Cd,[f("p",Id,w(x(s).baseText("nodeErrorView.itemIndex")),1),f("p",Pd,[f("code",null,w(e.error.context.itemIndex),1)])])):E("",!0),e.error.context&&e.error.context.runIndex!==void 0?(d(),N("div",_d,[f("p",Od,w(x(s).baseText("nodeErrorView.runIndex")),1),f("p",$d,[f("code",null,w(e.error.context.runIndex),1)])])):E("",!0),e.error.context&&e.error.context.parameter!==void 0?(d(),N("div",Rd,[f("p",Ad,w(x(s).baseText("nodeErrorView.inParameter")),1),f("p",Md,[f("code",null,w(ne(`${e.error.context.parameter}`)),1)])])):E("",!0),e.error.node&&e.error.node.type?(d(),N("div",Wd,[f("p",Vd,w(x(s).baseText("nodeErrorView.details.nodeType")),1),f("p",Bd,[f("code",null,w(e.error.node.type),1)])])):E("",!0),e.error.node&&e.error.node.typeVersion?(d(),N("div",Ud,[f("p",xd,w(x(s).baseText("nodeErrorView.details.nodeVersion")),1),f("p",Ld,[f("code",null,[f("span",null,w(e.error.node.typeVersion+" "),1),f("span",null,"("+w(A(e.error.node))+")",1)])])])):E("",!0),f("div",Hd,[f("p",Fd,w(x(s).baseText("nodeErrorView.details.n8nVersion")),1),f("p",zd,[f("code",null,w(T.value),1)])]),e.error.timestamp?(d(),N("div",jd,[f("p",Kd,w(x(s).baseText("nodeErrorView.time")),1),f("p",Yd,[f("code",null,w(new Date(e.error.timestamp).toLocaleString()),1)])])):E("",!0),e.error.cause&&P.value?(d(),N("div",qd,[f("p",Gd,w(x(s).baseText("nodeErrorView.details.errorCause")),1),f("pre",Jd,[f("code",null,w(e.error.cause),1)])])):E("",!0),e.error.context&&e.error.context.causeDetailed?(d(),N("div",Xd,[f("p",Qd,w(x(s).baseText("nodeErrorView.details.causeDetailed")),1),f("pre",Zd,[f("code",null,w(e.error.context.causeDetailed),1)])])):E("",!0),e.error.stack?(d(),N("div",eu,[f("p",tu,w(x(s).baseText("nodeErrorView.details.stackTrace")),1),f("pre",ou,[f("code",null,w(e.error.stack),1)])])):E("",!0)])])])])])}}}),su={key:0},iu={key:1},au={key:2},ru=Y({__name:"RunDataPinButton",props:{tooltipContentsVisibility:{},dataPinningDocsUrl:{},pinnedData:{},disabled:{type:Boolean}},emits:["togglePinData"],setup(e,{emit:t}){const o=Te(),n=e,s=t,a=q(()=>n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?!0:void 0);return(i,l)=>{const r=S("n8n-link"),u=S("n8n-text"),h=S("n8n-icon-button"),p=S("n8n-tooltip");return d(),_(p,{placement:"bottom-end",visible:a.value},{content:v(()=>[n.tooltipContentsVisibility.binaryDataTooltipContent?(d(),N("div",su,w(x(o).baseText("ndv.pinData.pin.binary")),1)):n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?(d(),N("div",iu,w(x(o).baseText("node.discovery.pinData.ndv")),1)):(d(),N("div",au,[f("strong",null,w(x(o).baseText("ndv.pinData.pin.title")),1),y(u,{size:"small",tag:"p"},{default:v(()=>[O(w(x(o).baseText("ndv.pinData.pin.description"))+" ",1),y(r,{to:n.dataPinningDocsUrl,size:"small"},{default:v(()=>[O(w(x(o).baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})]))]),default:v(()=>[y(h,{class:D(i.$style.pinDataButton),type:"tertiary",active:n.pinnedData.hasData.value,icon:"thumbtack",disabled:n.disabled,"data-test-id":"ndv-pin-data",onClick:l[0]||(l[0]=g=>s("togglePinData"))},null,8,["class","active","disabled"])]),_:1},8,["visible"])}}}),lu="_pinDataButton_9zxxl_1",du={pinDataButton:lu},uu={$style:du},cu=G(ru,[["__cssModules",uu]]),hu=_e(async()=>await Pe(()=>import("./RunDataTable-fjkHn30C.js"),__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,34,35,36,37,38,39,40,41]))),pu=_e(async()=>await Pe(()=>import("./RunDataJson-9PUFQ2iv.js"),__vite__mapDeps([42,2,3,4,5,6,7,8,1,9,10,11,12,13,35,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,43]))),fu=_e(async()=>await Pe(()=>import("./RunDataSchema-ezXA1IRJ.js"),__vite__mapDeps([44,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,14,15,33,34,35,36,37,38,39,40,45]))),gu=_e(async()=>await Pe(()=>Promise.resolve().then(()=>Pl),void 0)),mu=_e(async()=>await Pe(()=>import("./RunDataSearch-6Yg8LN1O.js"),__vite__mapDeps([46,2,3,4,5,6,7,8,1,9,10,11,12,13,47]))),yu=Y({name:"RunData",components:{BinaryDataDisplay:jl,NodeErrorView:nu,JsonEditor:ii,RunDataTable:hu,RunDataJson:pu,RunDataSchema:fu,RunDataHtml:gu,RunDataSearch:mu,RunDataPinButton:cu},props:{node:{type:Object,default:null},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String,required:!0},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=oe(),o=Ve(),n=We(),s=zi(e,"node"),a=Ce(s,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode(e.paneType)});return{...tt(),externalHooks:n,nodeHelpers:o,pinnedData:a}},data(){return{connectionType:M.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:Tn,MAX_DISPLAY_ITEMS_AUTO_ALL:Qn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){var e,t,o;if(this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane()),this.hasRunError){const n=(o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])==null?void 0:o.error;n&&["unknown error"].some(a=>n.message.toLowerCase().includes(a))&&this.$telemetry.track(`User encountered an error: "${n.message}"`,{node:this.node.type,errorMessage:n.message,nodeVersion:this.node.typeVersion,n8nVersion:this.rootStore.versionCli},{withPostHog:!0})}},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...le(ee,oe,Z,Jt,Tt),isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Zn},dataEditingDocsUrl(){return es},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=me(e,t,this.nodeType);return!!!we(o).find(a=>a!==M.Main)&&!this.isPaneTypeInput&&this.pinnedData.isValidNodeType.value&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!go(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===Vt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.pinnedData.hasData.value))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinnedData.data.value?this.pinnedData.data.value.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return mo(this.inputData)},binaryData(){return this.node?this.nodeHelpers.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const s=this.getRawInputData(this.runIndex,n).length,a=this.getDataCount(this.runIndex,n),i=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:s,interpolate:{matched:a,total:s}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:a,interpolate:{count:a}});let l=this.getOutputName(n);if(`${l}`==`${n}`)l=`${this.$locale.baseText("ndv.output")} ${l}`;else{const r=ts.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;l=e(`${this.getOutputName(n)}${r}`)}t.push({label:this.search&&a||s?`${l} (${i})`:l,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return Ee(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=Ae(wo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,Se.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,Se.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){Ae(wo).value="true",Ae(Bt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinnedData.data.value?yo(this.pinnedData.data.value):mo(this.rawInputData),o=t.length>0?t:os;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.pinnedData.hasData.value,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"undefined":this.displayMode,is_data_pinned:this.pinnedData.hasData.value})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.pinnedData.setData(yo(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"none":this.displayMode};this.externalHooks.run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.nodeHelpers.updateNodeParameterIssues(this.node),this.pinnedData.hasData.value){this.pinnedData.unsetData(e);return}try{this.pinnedData.setData(this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.externalHooks.run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let s=0;s<=this.maxOutputIndex;s++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,s)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=M.Main){let n=[];return this.node&&(n=this.nodeHelpers.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinnedData.data.value&&!this.isProductionExecutionPreview?Array.isArray(this.pinnedData.data.value)?this.pinnedData.data.value.map(t=>({json:t})):[{json:this.pinnedData.data.value}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>ns(t,this.search))):e},getDataCount(e,t,o=M.Main){var a,i,l;if(!this.node)return 0;if((l=(i=(a=this.workflowRunData)==null?void 0:a[this.node.name])==null?void 0:i[e])!=null&&l.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),s=this.getPinDataOrLiveData(n);return this.getFilteredData(s).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=we(t)}this.connectionType=e.length===0?M.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.nodeHelpers.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:s,fileExtension:a,mimeType:i}=this.binaryData[e][t];if(o){const l=this.workflowsStore.getBinaryUrl(o,"download",s,i);At.saveAs(l,[s,a].join("."));return}else{const l="data:"+i+";base64,"+n,r=await fetch(l).then(async u=>await u.blob());At.saveAs(r,s)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});At.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&qi(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===Vt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(e,t){e.id!==t.id&&this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>go(t.json))})},immediate:!0,deep:!0},jsonData(e,t){Gi(e,t)||(this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e))},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),wu="_infoIcon_bnhk0_1",vu="_center_bnhk0_5",Nu="_container_bnhk0_19",ku="_pinnedDataCallout_bnhk0_28",bu="_header_bnhk0_36",Tu="_dataContainer_bnhk0_50",Su="_dataDisplay_bnhk0_59",Du="_tabs_bnhk0_71",Eu="_itemsCount_bnhk0_78",Cu="_runSelector_bnhk0_86",Iu="_runSelectorWrapper_bnhk0_95",Pu="_pagination_bnhk0_100",_u="_pageSizeSelector_bnhk0_110",Ou="_binaryIndex_bnhk0_116",$u="_binaryRow_bnhk0_133",Ru="_binaryCell_bnhk0_138",Au="_binaryHeader_bnhk0_150",Mu="_binaryButtonContainer_bnhk0_159",Wu="_binaryValue_bnhk0_170",Vu="_displayModes_bnhk0_175",Bu="_tooltipContain_bnhk0_181",Uu="_spinner_bnhk0_185",xu="_editMode_bnhk0_196",Lu="_editModeBody_bnhk0_205",Hu="_editModeFooter_bnhk0_212",Fu="_editModeFooterInfotip_bnhk0_222",zu="_editModeActions_bnhk0_228",ju="_stretchVertically_bnhk0_235",Ku="_uiBlocker_bnhk0_239",Yu={infoIcon:wu,center:vu,container:Nu,pinnedDataCallout:ku,header:bu,dataContainer:Tu,"actions-group":"_actions-group_bnhk0_55",dataDisplay:Su,tabs:Du,itemsCount:Eu,runSelector:Cu,runSelectorWrapper:Iu,pagination:Pu,pageSizeSelector:_u,binaryIndex:Ou,binaryRow:$u,binaryCell:Ru,binaryHeader:Au,binaryButtonContainer:Mu,binaryValue:Wu,displayModes:Vu,tooltipContain:Bu,spinner:Uu,editMode:xu,editModeBody:Lu,editModeFooter:Hu,editModeFooterInfotip:Fu,editModeActions:zu,stretchVertically:ju,uiBlocker:Ku},qu={key:0,class:"ml-4xs"},Gu={key:0},Ju=["innerHTML"],Xu=["data-test-id"],Qu={key:0},Zu={key:1},ec={key:2},tc={key:3},oc={key:4};function nc(e,t,o,n,s,a){var C,U,F;const i=S("n8n-link"),l=S("n8n-callout"),r=S("BinaryDataDisplay"),u=S("n8n-radio-buttons"),h=S("n8n-icon-button"),p=S("RunDataPinButton"),g=S("n8n-button"),b=S("n8n-option"),m=S("n8n-select"),P=S("n8n-tooltip"),c=S("RunDataSearch"),T=S("n8n-tabs"),k=S("n8n-text"),$=S("n8n-spinner"),R=S("JsonEditor"),B=S("n8n-info-tip"),z=S("NodeErrorView"),A=S("i18n-t"),V=S("RunDataTable"),L=S("RunDataJson"),ne=S("RunDataHtml"),ye=S("RunDataSchema"),W=S("el-pagination"),K=S("n8n-block-ui");return d(),N("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...I)=>e.activatePane&&e.activatePane(...I))},[e.canPinData&&e.pinnedData.hasData.value&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(d(),_(l,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:v(()=>[y(i,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:v(()=>[O(w(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:v(()=>[O(w(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),N("span",qu,[y(i,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=re(I=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:v(()=>[O(w(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):E("",!0)]),_:1},8,["class"])):E("",!0),y(r,{"window-visible":e.binaryDataDisplayVisible,"display-data":e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["window-visible","display-data","onClose"]),f("div",{class:D(e.$style.header)},[he(e.$slots,"header",{},void 0,!0),Q(f("div",{class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header",onClick:t[3]||(t[3]=re(()=>{},["stop"]))},[Q(y(u,{"model-value":e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["model-value","options","onUpdate:modelValue"]),[[ae,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?Q((d(),_(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=I=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[ae,!e.editMode.enabled]]):E("",!0),(e.canPinData||(C=e.binaryData)!=null&&C.length)&&e.rawInputData.length&&!e.editMode.enabled?(d(),_(p,{key:1,disabled:!e.rawInputData.length&&!e.pinnedData.hasData.value||e.isReadOnlyRoute||e.readOnlyEnv||!!((U=e.binaryData)!=null&&U.length),"tooltip-contents-visibility":{binaryDataTooltipContent:!!((F=e.binaryData)!=null&&F.length),pinDataDiscoveryTooltipContent:e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible},"data-pinning-docs-url":e.dataPinningDocsUrl,"pinned-data":e.pinnedData,onTogglePinData:t[2]||(t[2]=I=>e.onTogglePinData({source:"pin-icon-click"}))},null,8,["disabled","tooltip-contents-visibility","data-pinning-docs-url","pinned-data"])):E("",!0),Q(f("div",{class:D(e.$style.editModeActions)},[y(g,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),y(g,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[ae,e.editMode.enabled]])],2),[[ae,!e.hasRunError]])],2),e.maxRunIndex>0?Q((d(),N("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[f("div",{class:D(e.$style.runSelectorWrapper)},[y(m,{size:"small","model-value":e.runIndex,teleported:"","onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=re(()=>{},["stop"]))},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.output.run")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.maxRunIndex+1,I=>(d(),_(b,{key:I,label:e.getRunLabel(I),value:I-1},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"]),e.canLinkRuns?(d(),_(P,{key:0,placement:"right"},{content:v(()=>[O(w(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:v(()=>[y(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):E("",!0),he(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(d(),_(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ae,!e.editMode.enabled]]):E("",!0),he(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(d(),N("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[y(T,{"model-value":e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["model-value","options","onUpdate:modelValue"]),e.showIOSearch?(d(),_(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)):!e.hasRunError&&e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?Q((d(),N("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(d(),_(k,{key:0},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(d(),_(k,{key:1},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(d(),_(c,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ae,!e.editMode.enabled&&!e.hasRunError]]):E("",!0),f("div",{ref:"dataContainer",class:D(e.$style.dataContainer),"data-test-id":"ndv-data-container"},[e.isExecuting?(d(),N("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[f("div",{class:D(e.$style.spinner)},[y($,{type:"ring"})],2),y(k,null,{default:v(()=>[O(w(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(d(),N("div",{key:1,class:D(e.$style.editMode)},[f("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[y(R,{"model-value":e.editMode.value,"onUpdate:modelValue":t[8]||(t[8]=I=>e.ndvStore.setOutputPanelEditModeValue(I))},null,8,["model-value"])],2),f("div",{class:D(e.$style.editModeFooter)},[y(B,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:v(()=>[O(w(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),y(i,{to:e.dataEditingDocsUrl,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(d(),N("div",{key:2,class:D(e.$style.stretchVertically)},[y(z,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(d(),N("div",{key:4,class:D(e.$style.center)},[y(k,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),y(i,{onClick:e.enableNode},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(d(),N("div",{key:5,class:D(e.$style.center)},[he(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(d(),N("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(d(),_(k,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:v(()=>[O(w(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?he(e.$slots,"content",{key:1},void 0,!0):(d(),_(z,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(d(),N("div",{key:7,class:D(e.$style.center)},[e.search?(d(),N("div",Gu,[y(k,{tag:"h3",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(k,null,{default:v(()=>[y(A,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:v(()=>[f("a",{href:"#",onClick:t[9]||(t[9]=(...I)=>e.onSearchClear&&e.onSearchClear(...I))},w(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(d(),_(k,{key:1},{default:v(()=>[O(w(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(d(),N("div",{key:8,class:D(e.$style.center)},[he(e.$slots,"no-output-data",{},()=>[O("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(d(),N("div",{key:9,class:D(e.$style.center)},[y(k,{bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.tooMuchDataTitle),1)]),_:1}),y(k,{align:"center",tag:"div"},{default:v(()=>[f("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,Ju)]),_:1}),y(g,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),y(g,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=I=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?he(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(d(),N("div",{key:11,class:D(e.$style.center)},[y(k,null,{default:v(()=>[O(w(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),f("a",{onClick:t[11]||(t[11]=(...I)=>e.switchToBinary&&e.switchToBinary(...I))},w(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(d(),N("div",{key:12,class:D(e.$style.center)},[y(k,{tag:"h3",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(k,null,{default:v(()=>[y(A,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:v(()=>[f("a",{href:"#",onClick:t[12]||(t[12]=(...I)=>e.onSearchClear&&e.onSearchClear(...I))},w(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(d(),_(De,{key:13},{default:v(()=>[y(V,{node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"page-offset":e.currentPageOffset,"total-runs":e.maxRunIndex,"has-default-hover-state":e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=I=>e.$emit("tableMounted",I)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","input-data","mapping-enabled","distance-from-active","run-index","page-offset","total-runs","has-default-hover-state","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(d(),_(De,{key:14},{default:v(()=>[y(L,{"pane-type":e.paneType,"edit-mode":e.editMode,"sessio-id":e.sessionId,node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["pane-type","edit-mode","sessio-id","node","input-data","mapping-enabled","distance-from-active","run-index","total-runs","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(d(),_(De,{key:15},{default:v(()=>[y(ne,{"input-html":e.inputDataPage[0].json.html},null,8,["input-html"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(d(),_(De,{key:16},{default:v(()=>[y(ye,{data:e.jsonData,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,node:e.node,"pane-type":e.paneType,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["data","mapping-enabled","distance-from-active","node","pane-type","run-index","total-runs","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(d(),N("div",{key:17,class:D(e.$style.center)},[y(k,{align:"center",tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(d(),N("div",{key:18,class:D(e.$style.dataDisplay)},[(d(!0),N(te,null,ue(e.binaryData,(I,H)=>(d(),N("div",{key:H},[e.binaryData.length>1?(d(),N("div",{key:0,class:D(e.$style.binaryIndex)},[f("div",null,w(H+1),1)],2)):E("",!0),f("div",{class:D(e.$style.binaryRow)},[(d(!0),N(te,null,ue(I,(X,ie)=>(d(),N("div",{key:H+"_"+ie,class:D(e.$style.binaryCell)},[f("div",{"data-test-id":"ndv-binary-data_"+H},[f("div",{class:D(e.$style.binaryHeader)},w(ie),3),X.fileName?(d(),N("div",Qu,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileName),3)])):E("",!0),X.directory?(d(),N("div",Zu,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.directory),3)])):E("",!0),X.fileExtension?(d(),N("div",ec,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileExtension),3)])):E("",!0),X.mimeType?(d(),N("div",tc,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.mimeType),3)])):E("",!0),X.fileSize?(d(),N("div",oc,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileSize),3)])):E("",!0),f("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(H,ie)?(d(),_(g,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:ve=>e.displayBinaryData(H,ie)},null,8,["label","onClick"])):E("",!0),e.isDownloadable(H,ie)?(d(),_(g,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:ve=>e.downloadBinaryData(H,ie)},null,8,["label","onClick"])):E("",!0)],2)],8,Xu)],2))),128))],2)]))),128))],2)):E("",!0):(d(),N("div",{key:3,class:D(e.$style.center)},[he(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?Q((d(),N("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[y(W,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next",total:e.dataCount,"onUpdate:currentPage":e.onCurrentPageChange},null,8,["current-page","page-size","total","onUpdate:currentPage"]),f("div",{class:D(e.$style.pageSizeSelector)},[y(m,{size:"mini","model-value":e.pageSize,teleported:"","onUpdate:modelValue":e.onPageSizeChange},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.output.pageSize")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.pageSizes,I=>(d(),_(b,{key:I,label:I,value:I},null,8,["label","value"]))),128)),y(b,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["model-value","onUpdate:modelValue"])],2)],2)),[[ae,!e.editMode.enabled]]):E("",!0),y(K,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const sc={$style:Yu},xn=G(yu,[["render",nc],["__cssModules",sc],["__scopeId","data-v-f2610902"]]),ic=Y({props:{taskData:{},hasStaleData:Boolean,hasPinData:Boolean},computed:{theme(){var e;return(e=this.runTaskData)!=null&&e.error?"danger":"success"},runTaskData(){return this.taskData},runMetadata(){if(!this.runTaskData)return null;const{date:e,time:t}=Zi(this.runTaskData.startTime);return{executionTime:this.runTaskData.executionTime,startTime:`${e} at ${t}`}}}}),ac=["innerHTML"],rc=f("br",null,null,-1),lc=f("br",null,null,-1);function dc(e,t,o,n,s,a){const i=S("n8n-info-tip"),l=S("n8n-text");return e.hasStaleData?(d(),_(i,{key:0,theme:"warning",type:"tooltip","tooltip-placement":"right","data-test-id":"node-run-info-stale"},{default:v(()=>[f("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,ac)]),_:1})):e.runMetadata?(d(),_(i,{key:1,type:"tooltip",theme:e.theme,"data-test-id":`node-run-info-${e.theme}`,"tooltip-placement":"right"},{default:v(()=>[f("div",null,[y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.runTaskData.error?e.$locale.baseText("runData.executionStatus.failed"):e.$locale.baseText("runData.executionStatus.success")),1)]),_:1}),rc,y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),O(" "+w(e.runMetadata.startTime),1),lc,y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),O(" "+w(e.runMetadata.executionTime)+" "+w(e.$locale.baseText("runData.ms")),1)])]),_:1},8,["theme","data-test-id"])):E("",!0)}const uc=G(ic,[["render",dc]]),Wt={REGULAR:"regular",LOGS:"logs"},cc=Y({name:"OutputPanel",components:{RunData:xn,RunInfo:uc,RunDataAi:Qi},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=oe(),{activeNode:o}=Gt(t),{isSubNodeType:n}=ai({node:o});return{pinnedData:Ce(o,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode("output")}),isSubNodeType:n}},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:Wt.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:Wt.LOGS}]}},computed:{...le(ee,oe,pe,Z),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.pinnedData.isValidNodeType.value&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===Wt.LOGS?wt.emit("setPositionByName","minLeft"):wt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),hc="_outputTypeSelect_f1tu5_6",pc="_titleSection_f1tu5_11",fc="_title_f1tu5_11",gc="_noOutputData_f1tu5_27",mc="_recoveredOutputData_f1tu5_37",yc={outputTypeSelect:hc,titleSection:pc,title:fc,noOutputData:gc,recoveredOutputData:mc},wc=f("br",null,null,-1);function vc(e,t,o,n,s,a){const i=S("n8n-radio-buttons"),l=S("RunInfo"),r=S("n8n-text"),u=S("RunDataAi"),h=S("RunData");return d(),_(h,{ref:"runData",node:e.node,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.output.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.output.noOutputDataInBranch"),"is-executing":e.isNodeRunning,"executing-message":e.$locale.baseText("ndv.output.executing"),"session-id":e.sessionId,"block-u-i":e.blockUI,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"output","data-output-type":e.outputMode,onActivatePane:e.activatePane,onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=p=>e.$emit("tableMounted",p)),onItemHover:t[4]||(t[4]=p=>e.$emit("itemHover",p)),onSearch:t[5]||(t[5]=p=>e.$emit("search",p))},oo({header:v(()=>[f("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(d(),_(i,{key:0,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=p=>e.outputMode=p),e.onUpdateOutputMode],options:e.outputTypes},null,8,["modelValue","options","onUpdate:modelValue"])):(d(),N("span",{key:1,class:D(e.$style.title)},w(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),e.hasNodeRun&&!e.pinnedData.hasData.value&&e.runsCount===1?Q((d(),_(l,{key:2,"task-data":e.runTaskData,"has-stale-data":e.staleData,"has-pin-data":e.pinnedData.hasData.value},null,8,["task-data","has-stale-data","has-pin-data"])),[[ae,!e.outputPanelEditMode.enabled]]):E("",!0)],2)]),"node-not-run":v(()=>[e.workflowRunning&&!e.isTriggerNode?(d(),_(r,{key:0,"data-test-id":"ndv-output-waiting"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):E("",!0),e.workflowRunning?E("",!0):(d(),_(r,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:v(()=>[e.isSubNodeType.value?(d(),N(te,{key:0},[O(w(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(d(),N(te,{key:1},[O(w(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(d(),N("span",{key:0,onClick:t[1]||(t[1]=(...p)=>e.insertTestData&&e.insertTestData(...p))},[wc,O(" "+w(e.$locale.baseText("generic.or"))+" ",1),y(r,{tag:"a",size:"medium",color:"primary"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):E("",!0)],64))]),_:1}))]),"no-output-data":v(()=>[y(r,{bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),y(r,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),f("a",{onClick:t[2]||(t[2]=(...p)=>e.openSettings&&e.openSettings(...p))},w(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),O(" "+w(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":v(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(r,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(r,null,{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:v(()=>[y(u,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.pinnedData.hasData.value&&e.runsCount>1?{name:"run-info",fn:v(()=>[y(l,{"task-data":e.runTaskData},null,8,["task-data"])]),key:"1"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","block-u-i","is-production-execution-preview","is-pane-active","data-output-type","onActivatePane","onRunChange","onLinkRun","onUnlinkRun"])}const Nc={$style:yc},kc=G(cc,[["render",vc],["__cssModules",Nc]]),bc={},Tc={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Sc=ji('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Dc=[Sc];function Ec(e,t){return d(),N("svg",Tc,Dc)}const Cc=G(bc,[["render",Ec]]),Ic=Y({name:"InputPanel",components:{RunData:xn,NodeExecuteButton:so,WireMeUp:Cc},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...le(ee,oe,Z,pe),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[Kt,et,ss,is];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const s=this.currentWorkflow.getNode(this.activeNode.name);e=me(this.currentWorkflow,s,this.activeNodeType),t=Ee(this.currentWorkflow,s,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(s=>this.filterOutConnectionType(s,M.Main))&&t.find(s=>this.filterOutConnectionType(s,M.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"?(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0]):this.mappedNode=null},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var s;if(!e||!this.isMultiInputNode||!this.activeNode||((s=this.activeNodeType)==null?void 0:s.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((a,i,l)=>i[0]&&i[0].node===e?[...a,l]:a,[]).map(a=>{var i,l;return(l=(i=this.activeNodeType)==null?void 0:i.inputNames)==null?void 0:l[a]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}}}),Pc="_mappedNode_1b87q_1",_c="_titleSection_1b87q_6",Oc="_inputModeTab_1b87q_15",$c="_noOutputData_1b87q_19",Rc="_recoveredOutputData_1b87q_29",Ac="_notConnected_1b87q_38",Mc="_title_1b87q_6",Wc={mappedNode:Pc,titleSection:_c,inputModeTab:Oc,noOutputData:$c,recoveredOutputData:Rc,notConnected:Ac,title:Mc},Vc={key:0},Bc={key:1},Uc=["innerHTML"];function xc(e,t,o,n,s,a){const i=S("n8n-option"),l=S("n8n-select"),r=S("n8n-radio-buttons"),u=S("n8n-text"),h=S("NodeExecuteButton"),p=S("n8n-tooltip"),g=S("WireMeUp"),b=S("RunData");return d(),_(b,{node:e.currentNode,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":!e.mappedNode&&e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.input.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.input.noOutputDataInBranch"),"is-executing":e.isExecutingPrevious,"executing-message":e.$locale.baseText("ndv.input.executingPrevious"),"session-id":e.sessionId,"override-outputs":e.connectedCurrentNodeOutputs,"mapping-enabled":e.isMappingEnabled,"distance-from-active":e.currentNodeDepth,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"input","data-test-id":"ndv-input-panel",onActivatePane:e.activatePane,onItemHover:t[2]||(t[2]=m=>e.$emit("itemHover",m)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onSearch:t[4]||(t[4]=m=>e.$emit("search",m))},oo({header:v(()=>[f("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(d(),_(l,{key:0,teleported:"",size:"small","model-value":e.currentNodeName,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select","onUpdate:modelValue":e.onInputNodeChange},{prepend:v(()=>[f("span",{class:D(e.$style.title)},w(e.$locale.baseText("ndv.input")),3)]),default:v(()=>[(d(!0),N(te,null,ue(e.parentNodes,m=>(d(),_(i,{key:m.name,value:m.name,class:"node-option",label:`${e.truncate(m.name)} ${e.getMultipleNodesText(m.name)}`,"data-test-id":"ndv-input-option"},{default:v(()=>[f("span",null,w(e.truncate(m.name))+" ",1),e.getMultipleNodesText(m.name)?(d(),N("span",Vc,w(e.getMultipleNodesText(m.name)),1)):(d(),N("span",Bc,w(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:m.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["model-value","no-data-text","placeholder","onUpdate:modelValue"])):(d(),N("span",{key:1,class:D(e.$style.title)},w(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(d(),_(r,{key:2,options:e.inputModes,"model-value":e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","model-value","onUpdate:modelValue"])):E("",!0)],2)]),"node-not-run":v(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(d(),N("div",{key:0,class:D(e.$style.noOutputData)},[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?E("",!0):(d(),_(p,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:v(()=>[f("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,Uc)]),default:v(()=>[y(h,{type:"secondary","hide-icon":"",transparent:!0,"node-name":e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),"telemetry-source":"inputs","data-test-id":"execute-previous-node",onExecute:e.onNodeExecute},null,8,["node-name","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?E("",!0):(d(),_(u,{key:1,tag:"div",size:"small"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(d(),N("div",{key:1,class:D(e.$style.notConnected)},[f("div",null,[y(g)]),y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),y(u,{tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),f("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...m)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...m))},w(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":v(()=>[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":v(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(u,null,{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:v(()=>[(d(),_(Vn("style"),null,{default:v(()=>[O("button.linkRun { display: none }")]),_:1})),f("div",{class:D(e.$style.mappedNode)},[y(l,{"model-value":e.mappedNode,size:"small",teleported:"","onUpdate:modelValue":e.onMappedNodeSelected,onClick:t[0]||(t[0]=re(()=>{},["stop"]))},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.input.previousNode")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.rootNodesParents,m=>(d(),_(i,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","override-outputs","mapping-enabled","distance-from-active","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const Lc={$style:Wc},Hc=G(Ic,[["render",xc],["__cssModules",Lc],["__scopeId","data-v-51727c96"]]),Fc=Y({name:"TriggerPanel",components:{NodeExecuteButton:so,CopyInput:ri,NodeIcon:nt},props:{nodeName:{type:String},sessionId:{type:String}},setup(){const e=st();return{workflowHelpers:Dt({router:e})}},data:()=>({executionsHelpEventBus:Sn()}),computed:{...le(ee,oe,pe,Z),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hideContent(){var e,t,o,n;if(!((e=this.nodeType)!=null&&e.triggerPanel))return!1;if((t=this.nodeType)!=null&&t.triggerPanel&&((o=this.nodeType)!=null&&o.triggerPanel.hasOwnProperty("hideContent"))){const s=(n=this.nodeType)==null?void 0:n.triggerPanel.hideContent;if(typeof s=="boolean")return s;if(this.node){const a=this.workflowHelpers.getCurrentWorkflow().expression.getSimpleParameterValue(this.node,s,"internal",{});if(typeof a=="boolean")return a}}return!1},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?yt(this.nodeType):""},displayChatButton(){return!!(this.node&&this.node.type===Ze&&this.node.parameters.mode!=="webhook")},isWebhookNode(){return!!(this.node&&this.node.type===Re)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Me?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;switch((e=this.nodeType)==null?void 0:e.name){case Ze:return this.$locale.baseText("ndv.trigger.webhookBasedNode.chatTrigger.serviceHint");case Me:return this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint");default:return this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})}},header(){var t;const e=this.nodeType?yt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?yt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},openWebhookUrl(){this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-chat"}),window.open(this.webhookTestUrl,"_blank","noreferrer")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:J.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(as))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),zc="_container_1evnm_1",jc="_header_1evnm_18",Kc="_action_1evnm_25",Yc="_shake_1evnm_29",qc="_accordion_1evnm_50",Gc={container:zc,header:jc,action:Kc,shake:Yc,accordion:qc},Jc={key:"empty"},Xc={key:"listening"},Qc={key:0},Zc={key:1},eh={key:0},th={key:"default"},oh={key:0,class:"mb-xl"},nh=["textContent"],sh=["innerHTML"];function ih(e,t,o,n,s,a){const i=S("NodeIcon"),l=S("n8n-pulse"),r=S("n8n-text"),u=S("CopyInput"),h=S("NodeExecuteButton"),p=S("n8n-button"),g=S("n8n-spinner"),b=S("n8n-heading"),m=S("n8n-link"),P=S("n8n-info-accordion");return d(),N("div",{class:D(e.$style.container)},[y(Ki,{name:"fade",mode:"out-in"},{default:v(()=>[e.hasIssues||e.hideContent?(d(),N("div",Jc)):e.isListeningForEvents?(d(),N("div",Xc,[y(l,null,{default:v(()=>[y(i,{"node-type":e.nodeType,size:40},null,8,["node-type"])]),_:1}),e.isWebhookNode?(d(),N("div",Qc,[y(r,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(r,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:e.webhookHttpMethod}})),1)]),_:1})],2),y(u,{value:e.webhookTestUrl,"toast-title":e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toast-title","copy-button-text","onCopy"]),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])])):(d(),N("div",Zc,[y(r,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:v(()=>[O(w(e.listeningTitle),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(r,{tag:"div"},{default:v(()=>[O(w(e.listeningHint),1)]),_:1})],2),e.displayChatButton?(d(),N("div",eh,[y(p,{class:"mb-xl",onClick:t[0]||(t[0]=c=>e.openWebhookUrl())},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.chatTrigger.openChat")),1)]),_:1})])):E("",!0),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])]))])):(d(),N("div",th,[e.isActivelyPolling?(d(),N("div",oh,[y(g,{type:"ring"})])):E("",!0),f("div",{class:D(e.$style.action)},[f("div",{class:D(e.$style.header)},[e.header?(d(),_(b,{key:0,tag:"h1",bold:""},{default:v(()=>[O(w(e.header),1)]),_:1})):E("",!0),e.subheader?(d(),_(r,{key:1},{default:v(()=>[f("span",{textContent:w(e.subheader)},null,8,nh)]),_:1})):E("",!0)],2),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])],2),e.activationHint?(d(),_(r,{key:1,size:"small",onClick:e.onLinkClick},{default:v(()=>[f("span",{innerHTML:e.activationHint},null,8,sh),O("  ")]),_:1},8,["onClick"])):E("",!0),e.activationHint&&e.executionsHelp?(d(),_(m,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):E("",!0),e.executionsHelp?(d(),_(P,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,"event-bus":e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","event-bus","onClick:body"])):E("",!0)]))]),_:1})],2)}const ah={$style:Gc},rh=G(Fc,[["render",ih],["__cssModules",ah],["__scopeId","data-v-4b3bae7d"]]),lh=Y({name:"NodeDetailsView",components:{NodeSettings:Cr,InputPanel:Hc,OutputPanel:kc,NDVDraggablePanels:Sl,TriggerPanel:rh},mixins:[sn],props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e,t){var u,h;const o=oe(),n=We(),s=Ve(),{activeNode:a}=Gt(o),i=Ce(a),l=st(),r=Dt({router:l});return{externalHooks:n,nodeHelpers:s,pinnedData:i,workflowHelpers:r,...Ie(),...Zt(),...(h=(u=sn).setup)==null?void 0:h.call(u,e,t)}},data(){return{settingsEventBus:Sn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){Se.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){Se.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...le(ee,oe,pe,Z,jt),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,s,a,i,l;const e=!!((n=this.activeNodeType)!=null&&n.triggerPanel);if(typeof((s=this.activeNodeType)==null?void 0:s.triggerPanel)=="boolean")return e;const t=!!((i=(a=this.activeNodeType)==null?void 0:a.webhooks)!=null&&i.length),o=(l=this.activeNodeType)==null?void 0:l.polling;return!this.readOnly&&this.isTriggerNode&&(t||o||e)},workflow(){return this.workflowHelpers.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var e;for(const t of this.parentNodes)if(this.workflowsStore.pinnedWorkflowData[t]||(e=this.workflowRunData)!=null&&e[t])return t;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?rs.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===Kt)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===fe},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=Ee(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(s=>s!==M.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${ls}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(Dn.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.externalHooks.run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.nodeHelpers.getNodeSubtitle(e,this.activeNodeType,this.workflowHelpers.getCurrentWorkflow())}),setTimeout(()=>{var o;if(this.activeNode){const n=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:(o=n==null?void 0:n.main)==null?void 0:o.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},async close(){var e,t;if(!this.isDragging){if(this.activeNode&&(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired)){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled&&this.activeNode){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===He){const{value:n}=this.outputPanelEditMode;try{this.pinnedData.setData(zt(n),"on-ndv-close-modal")}catch(s){console.error(s)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),dh="_modalBackground_16z4c_1",uh="_triggerWarning_16z4c_6",ch="_backToCanvas_16z4c_10",hh="_featureRequest_16z4c_31",ph={modalBackground:dh,triggerWarning:uh,backToCanvas:ch,featureRequest:hh};function fh(e,t,o,n,s,a){const i=S("n8n-icon"),l=S("n8n-text"),r=S("n8n-tooltip"),u=S("TriggerPanel"),h=S("InputPanel"),p=S("OutputPanel"),g=S("NodeSettings"),b=S("font-awesome-icon"),m=S("NDVDraggablePanels"),P=S("el-dialog");return d(),_(P,{"model-value":(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:v(()=>{var c;return[y(r,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:v(()=>[f("div",{class:D(e.$style.triggerWarning)},w(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:v(()=>[f("div",{class:D(e.$style.backToCanvas),"data-test-id":"back-to-canvas",onClick:t[0]||(t[0]=(...T)=>e.close&&e.close(...T))},[y(i,{icon:"arrow-left",color:"text-xlight",size:"medium"}),y(l,{color:"text-xlight",size:"medium",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(d(),N("div",{key:0,ref:"container",class:"data-display",tabindex:"0",onKeydownCapture:t[6]||(t[6]=(...T)=>e.onKeyDown&&e.onKeyDown(...T))},[f("div",{class:D(e.$style.modalBackground),onClick:t[1]||(t[1]=(...T)=>e.close&&e.close(...T))},null,2),(d(),_(m,{key:e.activeNode.name,"is-trigger-node":e.isTriggerNode,"hide-input-and-output":e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,"is-draggable":!e.isTriggerNode,"has-double-width":((c=e.activeNodeType)==null?void 0:c.parameterPane)==="wide","node-type":e.activeNodeType,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},oo({output:v(()=>[y(p,{"data-test-id":"output-panel","can-link-runs":e.canLinkRuns,"run-index":e.outputRun,"linked-runs":e.linked,"session-id":e.sessionId,"is-read-only":e.readOnly||e.hasForeignCredential,"block-u-i":e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["can-link-runs","run-index","linked-runs","session-id","is-read-only","block-u-i","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:v(()=>[y(g,{"event-bus":e.settingsEventBus,dragging:e.isDragging,"session-id":e.sessionId,"node-type":e.activeNodeType,"foreign-credentials":e.foreignCredentials,"read-only":e.readOnly,"block-u-i":e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=T=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["event-bus","dragging","session-id","node-type","foreign-credentials","read-only","block-u-i","executable","onValueChanged","onExecute","onStopExecution","onActivate","onSwitchSelectedNode","onOpenConnectionNodeCreator"]),e.featureRequestUrl?(d(),N("a",{key:0,class:D(e.$style.featureRequest),target:"_blank",onClick:t[5]||(t[5]=(...T)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...T))},[y(b,{icon:"lightbulb"}),O(" "+w(e.$locale.baseText("ndv.featureRequest")),1)],2)):E("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:v(()=>[e.showTriggerPanel?(d(),_(u,{key:0,"node-name":e.activeNode.name,"session-id":e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["node-name","session-id","onExecute","onActivate"])):e.isTriggerNode?E("",!0):(d(),_(h,{key:1,workflow:e.workflow,"can-link-runs":e.canLinkRuns,"run-index":e.inputRun,"linked-runs":e.linked,"current-node-name":e.inputNodeName,"session-id":e.sessionId,"read-only":e.readOnly||e.hasForeignCredential,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","can-link-runs","run-index","linked-runs","current-node-name","session-id","read-only","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["is-trigger-node","hide-input-and-output","position","is-draggable","has-double-width","node-type","onSwitchSelectedNode","onOpenConnectionNodeCreator","onClose","onInit","onDragstart","onDragend"]))],544)):E("",!0)]}),_:1},8,["model-value","before-close","data-has-output-connection"])}const gh={$style:ph},mh=G(lh,[["render",fh],["__cssModules",gh]]),yh=Y({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=it(),{position:n,isOpen:s,actions:a,target:i}=o,l=j(),r=t;to(s,()=>{var p,g;s?(p=l.value)==null||p.open():(g=l.value)==null||g.close()},{flush:"post"});function u(p){const g=p;o._dispatchAction(g),r("action",g,o.targetNodes.value)}function h(p){p||o.close()}return(p,g)=>x(s)?(d(),_(Wn,{key:0,to:"body"},[f("div",{class:D(p.$style.contextMenu),style:se({left:`${x(n)[0]}px`,top:`${x(n)[1]}px`})},[y(x(ds),{ref_key:"dropdown",ref:l,items:x(a),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":x(i).source!=="node-button",onSelect:u,onVisibleChange:h},{activator:v(()=>[f("div",{class:D(p.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):E("",!0)}}),wh="_contextMenu_1t4kq_1",vh="_activator_1t4kq_5",Nh={contextMenu:wh,activator:vh},kh={$style:Nh},bh=G(yh,[["__cssModules",kh]]),Th=(e,t)=>{const o=ps.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},Sh=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Ln=Y({data(){return{inputs:[],outputs:[]}},mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},computed:{...le(ee,pe,Xt,Z,eo),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String,required:!0},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},s=me(this.workflow,this.data,t)||[];this.inputs=s;const a=[...s];a.sort((i,l)=>typeof i=="string"?1:typeof l=="string"||i.required&&!l.required?-1:!i.required&&l.required?1:0),a.forEach((i,l)=>{var z,A;let r;typeof i=="string"?r={type:i}:r=i;const u=r.type,h=u===M.Main?M.Main:"other";o.hasOwnProperty(h)?o[h]++:o[h]=0,n.hasOwnProperty(u)?n[u]++:n[u]=0;const p=o[h],g=n[u],b=s.filter(V=>{const L=typeof V=="string"?V:V.type;return u===M.Main?L===M.Main:L!==M.Main}),m=b.filter(V=>V!==M.Main),P=m.filter(V=>typeof V!="string"&&V.required),c=m.filter(V=>typeof V!="string"&&!V.required),T=this.getSpacerIndexes(P.length,c.length),k=jo(u,"input",b.length,T)[p],$=Lt(u),R={uuid:On(this.nodeId,u,g),anchor:k,maxConnections:r.maxConnections??-1,endpoint:"Rectangle",paintStyle:_t(t,"--color-foreground-xdark",u),hoverPaintStyle:_t(t,"--color-primary",u),scope:li($),source:u!==M.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:u,index:g},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(u,t)},B=(z=this.instance)==null?void 0:z.addEndpoint(this.$refs[this.data.name],R);this.__addEndpointTestingData(B,"input",g),(r.displayName||(A=t.inputNames)!=null&&A[l])&&B.addOverlay(di(r.displayName||t.inputNames[l],u,r.required)),Array.isArray(B)||(B.__meta={nodeName:e.name,nodeId:this.nodeId,index:g,totalEndpoints:b.length,nodeType:e.type})}),a.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=us,n=cs){const s=[];if(e>0&&t>0){if(o)s.push(e);else if(e+t<n)for(let a=e;a<n-t;a++)s.push(a)}else if(e>0&&e<n&&t===0)for(let a=0;a<n-e;a++)s.push(a+e);else if(e===0&&t>0&&t<n)for(let a=0;a<n-t;a++)s.push(a);return s},__addOutputEndpoints(e,t){const o={},n={};this.outputs=Ee(this.workflow,this.data,t)||[];let s=0;const a=[];this.outputs.forEach((l,r)=>{var h;let u;typeof l=="string"?u={type:l}:u=l,(h=t.outputNames)!=null&&h[r]&&(u.displayName=t.outputNames[r]),u.displayName&&(s=u.displayName.length>s?u.displayName.length:s),a.push(u)});const i=s<4?"short":"medium";this.outputs.forEach((l,r)=>{const u=a[r],h=u.type,p=h===M.Main?M.Main:"other";o.hasOwnProperty(p)?o[p]++:o[p]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const g=o[p],b=n[h],m=this.outputs.filter($=>{const R=typeof $=="string"?$:$.type;return h===M.Main?R===M.Main:R!==M.Main}),P=jo(h,"output",m.length)[g],c=Lt(h),T={uuid:Ht(this.nodeId,h,b),anchor:P,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&m.length>2?7:9}},hoverPaintStyle:qe(t,"--color-primary"),scope:c,source:!0,target:h!==M.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:h,index:b},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(h,u,t)},k=this.instance.addEndpoint(this.$refs[this.data.name],T);if(this.__addEndpointTestingData(k,"output",b),u.displayName){const $=ui(u.displayName,h,u==null?void 0:u.category);k.addOverlay($)}if(Array.isArray(k)||(k.__meta={nodeName:e.name,nodeId:this.nodeId,index:b,totalEndpoints:m.length,endpointLabelLength:i}),!this.isReadOnly&&h===M.Main){const $={uuid:Ht(this.nodeId,h,b),anchor:P,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:k,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:i,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:h,index:b,category:u==null?void 0:u.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};u!=null&&u.category&&($.cssClass=`${$.cssClass} ${u==null?void 0:u.category}`);const R=this.instance.addEndpoint(this.$refs[this.data.name],$);this.__addEndpointTestingData(R,"plus",b),Array.isArray(R)||(R.__meta={nodeName:e.name,nodeId:this.nodeId,index:b,nodeType:e.type,totalEndpoints:m.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(hs);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===M.Main?{paintStyle:_t(t,this.__getEndpointColor(M.Main),e)}:Object.values(M).includes(e)?(n=>({endpoint:Th(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",s=a=>({endpoint:Sh(),paintStyle:qe(o,this.__getEndpointColor(a)),hoverPaintStyle:qe(o,this.__getEndpointColor(a))});return e===M.Main?t.category==="error"?{paintStyle:{...qe(o,this.__getEndpointColor(M.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:qe(o,this.__getEndpointColor(M.Main)),cssClass:`dot-${n}-endpoint`}:Object.values(M).includes(e)?s(e):{}},touchEnd(e){Ie().isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=Ie(),o=e.path||e.composedPath&&e.composedPath();for(let n=0;n<o.length;n++)if(o[n].className&&typeof o[n].className=="string"&&o[n].className.includes("no-select-on-click"))return;t.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(t.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),Dh=Y({name:"Node",components:{TitledList:xt,FontAwesomeIcon:fs,NodeIcon:nt},mixins:[Ln],props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1}},setup(e){const t=Z(),o=it(),n=We(),s=Ve(),a=t.getNodeByName(e.name),i=Ce(a),l=Ie(),{callDebounced:r}=bt();return{contextMenu:o,externalHooks:n,nodeHelpers:s,pinnedData:i,deviceSupport:l,callDebounced:r}},computed:{...le(ee,oe,pe,Z),showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?wn.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(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].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?yt(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},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(){return this.data.type===et},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},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=>e.type===this.data.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(n=>n!==M.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=me(this.workflow,this.node,this.nodeType)||[],n=we(t).filter(l=>l!==M.Main);if(n.length){t.filter(r=>typeof r!="string"&&r.required);let l=0;e["--configurable-node-input-count"]=n.length+l}let s=[];this.workflow.nodes[this.node.name]&&(s=Ee(this.workflow,this.node,this.nodeType));const i=we(s).filter(l=>l===M.Main);e["--node-main-output-count"]=i.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.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,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(s=>{s!=null&&s.error&&e.push(`${s.error.message}${s.error.description?` (${s.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...kn(this.data.issues,this.data)),e},nodeDisabledTitle(){return this.data.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=ke(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===gs?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,n,s;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((s=(n=(o=this.nodeRunData)==null?void 0:o[0])==null?void 0:n.error)==null?void 0:s.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-canvas-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=>e.name===this.data.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)}},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(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){Ae(Bt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(Ae(Bt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)||"";this.nodeSubtitle=e.includes(ms)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new ci(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(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",this.data.name)},toggleDisableNode(e){e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:this.data.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){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},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})}}}),Hn=e=>(An("data-v-1142d909"),e=e(),Mn(),e),Eh=["id","data-name","data-node-type"],Ch={class:"select-background"},Ih={key:0,class:"trigger-icon"},Ph=["innerHTML"],_h={key:0,class:"node-issues","data-test-id":"node-issues"},Oh={key:1,class:"waiting"},$h=["textContent"],Rh={key:2,class:"node-pin-data-icon"},Ah={key:0,class:"items-count"},Mh={key:3},Wh={key:4,class:"data-count"},Vh={key:0,class:"items-count"},Bh=["title"],Uh={class:"node-trigger-tooltip__wrapper"},xh=["textContent"],Lh=Hn(()=>f("span",null,null,-1)),Hh=Hn(()=>f("span",null,null,-1)),Fh={class:"node-description"},zh=["title"],jh={"data-test-id":"canvas-node-box-title"},Kh={key:0},Yh=["title"],qh={class:"node-options-inner"};function Gh(e,t,o,n,s,a){var g;const i=S("FontAwesomeIcon"),l=S("n8n-tooltip"),r=S("TitledList"),u=S("NodeIcon"),h=S("n8n-icon-button"),p=Et("touch");return d(),N("div",{id:e.nodeId,ref:e.data.name,class:D(e.nodeWrapperClass),style:se(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(g=e.nodeType)==null?void 0:g.name,onContextmenu:t[4]||(t[4]=b=>e.openContextMenu(b,"node-right-click"))},[Q(f("div",Ch,null,512),[[ae,e.isSelected]]),f("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[Q((d(),N("div",{class:D(e.nodeClass),style:se(e.nodeStyle),onClick:t[0]||(t[0]=re((...b)=>e.onClick&&e.onClick(...b),["left"]))},[e.isTriggerNode?(d(),N("i",Ih,[y(l,{placement:"bottom"},{content:v(()=>[f("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Ph)]),default:v(()=>[y(i,{icon:"bolt",size:"lg"})]),_:1})])):E("",!0),e.data.disabled?E("",!0):(d(),N("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(d(),N("div",_h,[y(l,{"show-after":500,placement:"bottom"},{content:v(()=>[y(r,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:v(()=>[y(i,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(d(),N("div",Oh,[y(l,{placement:"bottom"},{content:v(()=>[f("div",{textContent:w(e.waiting)},null,8,$h)]),default:v(()=>[y(i,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(d(),N("span",Rh,[y(i,{icon:"thumbtack"}),e.workflowDataItems>1?(d(),N("span",Ah,w(e.workflowDataItems),1)):E("",!0)])):e.nodeExecutionStatus==="unknown"?(d(),N("span",Mh)):e.workflowDataItems?(d(),N("span",Wh,[y(i,{icon:"check"}),e.workflowDataItems>1?(d(),N("span",Vh,w(e.workflowDataItems),1)):E("",!0)])):E("",!0)],2)),f("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[y(i,{icon:"sync-alt",spin:""})],8,Bh),f("div",Uh,[y(l,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:v(()=>[f("div",{textContent:w(e.getTriggerNodeTooltip)},null,8,xh)]),default:v(()=>[Lh]),_:1},8,["visible"]),e.isTriggerNode?(d(),_(l,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:v(()=>[O(w(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:v(()=>[Hh]),_:1},8,["visible"])):E("",!0)]),y(u,{class:"node-icon","node-type":e.nodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),e.showDisabledLinethrough?(d(),N("div",{key:0,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):E("",!0)],2),f("div",Fh,[f("div",{class:"node-name",title:e.nodeTitle},[f("p",jh,w(e.nodeTitle),1),e.data.disabled?(d(),N("p",Kh,"("+w(e.$locale.baseText("node.disabled"))+")",1)):E("",!0)],8,zh),e.nodeSubtitle!==void 0?(d(),N("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},w(e.nodeSubtitle),9,Yh)):E("",!0)]),e.isReadOnly?E("",!0):Q((d(),N("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=re(()=>{},["stop"])),onMousedown:t[3]||(t[3]=re(()=>{},["stop"]))},[f("div",qh,[e.isConfigNode?E("",!0):(d(),_(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"])),y(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"]),y(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"]),y(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=b=>e.openContextMenu(b,"node-button"))})])],544)),[[ae,!e.hideActions]])],46,Eh)}const Jh=G(Dh,[["render",Gh],["__scopeId","data-v-1142d909"]]),Xh=Y({name:"Sticky",mixins:[Ln],props:{nodeViewScale:{type:Number},gridSize:{type:Number}},setup(){const e=Ie(),t=j(),o=j(!1),n=a=>{o.value=a},s=it(a=>{var i;a==="change_color"&&(n(!0),(i=t.value)==null||i.click())});return{deviceSupport:e,colorPopoverTrigger:t,contextMenu:s,forceActions:o,setForceActions:n}},computed:{...le(ee,oe,pe,Z),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&It(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.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&&lt(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&lt(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")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===En,n=e.querySelector('img[alt="n8n quickstart video"'),s=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){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:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:It(e.content)?e.content:this.node.parameters.content,height:lt(e.height)?e.height:this.node.parameters.height,width:lt(e.width)?e.width:this.node.parameters.width,color:It(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.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()}}}),Qh=["id","data-name"],Zh={class:"select-sticky-background"},ep=["title"],tp=["title"],op={class:"content"},np=["onClick"];function sp(e,t,o,n,s,a){const i=S("n8n-sticky"),l=S("font-awesome-icon"),r=S("n8n-popover"),u=Et("touch");return d(),N("div",{id:e.nodeId,ref:e.data.name,class:"sticky-wrapper",style:se(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[f("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:se(e.stickySize)},[Q(f("div",Zh,null,512),[[ae,e.isSelected]]),Q((d(),N("div",{class:"sticky-box",onClick:t[0]||(t[0]=re((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[y(i,{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"])],32)),[[u,e.touchStart,"start"],[u,e.touchEnd,"end"]]),Q(f("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[Q((d(),N("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[y(l,{icon:"trash"})],8,ep)),[[u,e.deleteNode,"tap"]]),y(r,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:v(()=>[f("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[y(l,{icon:"palette"})],8,tp)]),default:v(()=>[f("div",op,[(d(!0),N(te,null,ue(Array.from({length:7}),(h,p)=>{var g,b;return d(),N("div",{key:p,class:D(["color",`sticky-color-${p+1}`]),"data-test-id":"color",style:se({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${p+1})`,"box-shadow":p===0&&((g=e.node)==null?void 0:g.parameters.color)===""||p+1===((b=e.node)==null?void 0:b.parameters.color)?`0 0 0 1px var(--color-sticky-background-${p+1})`:"none"}),onClick:m=>e.changeColor(p+1)},null,14,np)}),128))])]),_:1},8,["onShow","onHide"])],2),[[ae,e.showActions]])],6)],12,Qh)}const ip=G(Xh,[["render",sp],["__scopeId","data-v-f4958951"]]),ap=60,rp=30,lp=30,dp=15,up=-20,pn=-200,cp=-5;function hp(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const s=e.charAt(o).toLowerCase(),a=t.charAt(n).toLowerCase();s===a&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function pp(e,t){return Fn(e,t,0,0,null,[],256,0,0,5)}function Fn(e,t,o,n,s,a,i,l,r,u){let h=0;if(++r>=u)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let p=!1,g=[],b=0,m=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(l>=i)return{matched:!1,outScore:h};m&&s&&(a=[...s],m=!1);const c=[],T=Fn(e,t,o,n+1,a,c,i,l,r,u),k=T.outScore;T.matched&&((!p||k>b)&&(g=[...c],b=k),p=!0),a[l++]=n,++o}++n}const P=o===e.length;if(P){h=100;let c=up*a[0];c=c<pn?pn:c,h+=c;const T=t.length-l;h+=cp*T;for(let k=0;k<l;k++){const $=a[k];if(k>0){const R=a[k-1];$===R+1&&(h+=ap)}if($>0){const R=t[$-1],B=t[$];R!==R.toUpperCase()&&B!==B.toLowerCase()&&(h+=lp),(R==="_"||R===" ")&&(h+=rp)}else h+=dp}return p&&(!P||b>h)?(a=[...g],h=b,{matched:!0,outScore:h}):P?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function fp(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,s=0;for(;n&&s<o.length;){const a=o[s];n=n[a],s++}return n}function gp(e,t,o){const n=t.reduce((s,a)=>{let i=[];o.forEach(({key:r,weight:u})=>{const h=fp(a,r);Array.isArray(h)?i=i.concat(h.map(p=>({value:p,weight:u}))):typeof h=="string"&&i.push({value:h,weight:u})});const l=i.reduce((r,{value:u,weight:h})=>{if(!hp(e,u))return r;const p=pp(e,u);p.outScore*=h;const{matched:g,outScore:b}=p;return!r&&g||g&&r&&b>r.outScore?p:r},null);return l&&s.push({score:l.outScore,item:a}),s},[]);return n.sort((s,a)=>a.score-s.score),n}function Qe(e,t,o="node"){var s,a,i;const n={uuid:be(),key:e.name,subcategory:t??((i=(a=(s=e.codex)==null?void 0:s.subcategories)==null?void 0:a[ge])==null?void 0:i[0])??ot,properties:{...e},type:o};return n}function mp(e){const t=[ge,Yt];return e.reduce((o,n)=>{let s=[ot];return t.forEach(a=>{var i,l,r,u;(l=(i=n.codex)==null?void 0:i.categories)!=null&&l.includes(a)&&(s=((u=(r=n.codex)==null?void 0:r.subcategories)==null?void 0:u[a])??[])}),s.forEach(a=>{o[a]||(o[a]=[]),o[a].push(Qe(n,a))}),o},{})}function Ft(e){return e.sort((t,o)=>{var a,i,l,r;if(t.type!=="node"||o.type!=="node")return 0;const n=((i=(a=t.properties)==null?void 0:a.displayName)==null?void 0:i.toLowerCase())||t.key,s=((r=(l=o.properties)==null?void 0:l.displayName)==null?void 0:r.toLowerCase())||o.key;return n.localeCompare(s,void 0,{sensitivity:"base"})})}function fn(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(gp(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:s})=>s)}function gn(e){return e.map(t=>t.type==="section"?t.children:t).flat()}function yp(e,t){const o=e.reduce((s,a)=>{const i=t.find(r=>r.items.includes(a.key)),l=(i==null?void 0:i.key)??"other";return s[l]=[...s[l]??[],a],s},{}),n=t.map(s=>({type:"section",key:s.key,title:s.title,children:Ft(o[s.key]??[])})).concat({type:"section",key:"other",title:ys.baseText("nodeCreator.sectionNames.other"),children:Ft(o.other??[])}).filter(s=>s.children.length>0);return n.length<=1?e:n}const kt=St(ws.NODE_CREATOR,()=>{const e=j(ze),t=j([]),o=j({}),n=j(!1),s=j(""),a=q(()=>Object.values(t.value).map(p=>Qe(p)));function i(p){t.value=p}function l(p){o.value=p}function r(p){n.value=p}function u(p){e.value=p}function h(p){s.value=p}return{openSource:s,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:r,setSelectedView:u,setOpenSource:h,setActions:l,setMergeNodes:i,allNodeCreatorNodes:a}}),wp=["textContent"],vp=Y({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=kt(),n=q(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(s,a)=>{const i=S("font-awesome-icon"),l=S("n8n-tooltip");return d(),N("div",{ref:"container",class:D(s.$style.canvasAddButton),style:se(n.value),"data-test-id":"canvas-add-button"},[y(l,{placement:"top",visible:s.showTooltip,disabled:x(o).showScrim,"popper-class":s.$style.tooltip,"show-after":700},{content:v(()=>[O(w(s.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:v(()=>[f("button",{class:D(s.$style.button),"data-test-id":"canvas-plus-button",onClick:a[0]||(a[0]=r=>s.$emit("click"))},[y(i,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),f("p",{class:D(s.$style.label),textContent:w(s.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,wp)],6)}}}),Np="_canvasAddButton_1easi_1",kp="_button_1easi_13",bp="_label_1easi_34",Tp={canvasAddButton:Np,button:kp,label:bp},Sp={$style:Tp},Dp=G(vp,[["__cssModules",Sp]]);function mn(e,t){return e.filter(o=>{var n,s,a;return!o.hidden&&((a=(s=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:s[Yt])==null?void 0:a.includes(t))}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon,iconData:o.name.toLowerCase().includes("openai")?{type:"file",icon:"openai",fileBuffer:"/static/open-ai.svg"}:void 0}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function af(e){const t=Te(),o=ee(),n=$n(),s=mn(o.allLatestNodeTypes,Vs),a=mn(o.allLatestNodeTypes,Bs);return{value:vt,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox",{interpolate:{link:n.getWebsiteCategoryURL("ai")}}),items:[...s,...a,{key:qt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function Ep(e){const t=Te();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:qt,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:vo,type:"subcategory",properties:{title:vo,icon:"file-import",...o(M.AiDocument)}},{key:No,type:"subcategory",properties:{title:No,icon:"language",...o(M.AiLanguageModel)}},{key:ko,type:"subcategory",properties:{title:ko,icon:"brain",...o(M.AiMemory)}},{key:bo,type:"subcategory",properties:{title:bo,icon:"list",...o(M.AiOutputParser)}},{key:To,type:"subcategory",properties:{title:To,icon:"search",...o(M.AiRetriever)}},{key:So,type:"subcategory",properties:{title:So,icon:"grip-lines-vertical",...o(M.AiTextSplitter)}},{key:Do,type:"subcategory",properties:{title:Do,icon:"tools",...o(M.AiTool)}},{key:Eo,type:"subcategory",properties:{title:Eo,icon:"vector-square",...o(M.AiEmbedding)}},{key:Co,type:"subcategory",properties:{title:Co,icon:"project-diagram",...o(M.AiVectorStore)}},{key:Io,type:"subcategory",properties:{title:Io,icon:"code"}}]}}function rf(e){const t=Te();return{value:ze,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:ot,type:"subcategory",properties:{forceIncludeNodes:[Re,vs],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:Po,type:"node",category:[ge],properties:{group:[],name:Po,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:Re,type:"node",category:[ge],properties:{group:[],name:Re,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Me,type:"node",category:[ge],properties:{group:[],name:Me,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:et,type:"node",category:[ge],properties:{group:[],name:et,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:_o,type:"node",category:[ge],properties:{group:[],name:_o,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:Oo,category:ge,properties:{title:Oo,icon:"folder-open"}}]}}function lf(e){const t=Te(),o={value:Ut,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:ot,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe",forceIncludeNodes:[Ns,ks]}},{type:"subcategory",key:$o,category:ge,properties:{title:$o,icon:"pen",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[bs,Ro,Ts]},{key:"addOrRemove",title:t.baseText("nodeCreator.sectionNames.transform.addOrRemove"),items:[Ao,Ss,Ds,Es]},{key:"combine",title:t.baseText("nodeCreator.sectionNames.transform.combine"),items:[Cs,Is,Mo]},{key:"convert",title:t.baseText("nodeCreator.sectionNames.transform.convert"),items:[Vt,Ps,_s,Os,Wo,Vo,$s,Rs]}]}},{type:"subcategory",key:Bo,category:ge,properties:{title:Bo,icon:"code-branch",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ao,As,Ms,Mo]}]}},{type:"subcategory",key:Uo,category:ge,properties:{title:Uo,icon:"file-alt",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Vo,Wo]}]}},{type:"subcategory",key:xo,category:ge,properties:{title:xo,icon:"toolbox",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ws,Re,Ro]}]}}]};return(e??[]).some(s=>{var a,i;return(i=(a=s.codex)==null?void 0:a.categories)==null?void 0:i.includes(Yt)})&&o.items.push({key:vt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi"),tag:t.baseText("nodeCreator.aiPanel.newTag")}}),o.items.push({key:ze,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Cp="data-keyboard-nav-id",yn=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Ip=St("nodeCreatorKeyboardNavigation",()=>{const e=j([]),t=j(null),o=j({});function n(c){return c==null?void 0:c.getAttribute("data-keyboard-nav-type")}function s(c){return(c==null?void 0:c.getAttribute(Cp))||void 0}async function a(){return await new Promise(c=>{m(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(T=>new WeakRef(T)),c()},0)})}function i(c,T){Object.values(o.value).filter(R=>R.keyboardKeys.includes(c)).forEach(R=>{if(!t.value)return;(R.condition===void 0||R.condition(n(T)||"",t.value))&&t.value&&R.handler(t.value,c)})}async function l(c){var z,A,V;const T=c.key;if(!yn.includes(T))return;c.preventDefault(),c.stopPropagation(),await a();const k=e.value.findIndex(L=>s(L==null?void 0:L.deref())===t.value),$=(z=e.value[k])==null?void 0:z.deref(),R=T==="ArrowDown",B=T==="ArrowUp";if($){if(R){const L=k<e.value.length-1?k+1:0;u((A=e.value[L])==null?void 0:A.deref())}if(B){const L=k>0?k-1:e.value.length-1;u((V=e.value[L])==null?void 0:V.deref())}i(T,$)}}function r(c){t.value=c}function u(c){const T=s(c);T&&(r(T),c!=null&&c.scrollIntoView&&(c==null||c.scrollIntoView({block:"center"})))}async function h(c){var T;await a(),u((T=e.value[c])==null?void 0:T.deref())}function p(){document.addEventListener("keydown",l,{capture:!0})}function g(){m(),document.removeEventListener("keydown",l,{capture:!0})}function b(c,T){T.keyboardKeys.forEach(k=>{if(yn.includes(k))o.value={...o.value,[c]:T};else throw new Error(`Key ${k} is not supported`)})}function m(){e.value=[]}function P(){return e.value.findIndex(c=>s(c==null?void 0:c.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:p,refreshSelectableItems:a,detachKeydownEvent:g,registerKeyHook:b,getActiveItemIndex:P,setActiveItemId:r,setActiveItemIndex:h}}),Pp=St("nodeCreatorViewStacks",()=>{const e=kt(),{getActiveItemIndex:t}=Ip(),o=j([]),n=q(()=>{const c=o.value[o.value.length-1];if(!(c!=null&&c.baselineItems))return c.items?p(c.items):[];if(c.search&&i.value){const T=i.value.length>0?i.value:gn(c.baselineItems??[]);return p(fn(c.search||"",T))}return p(c.baselineItems)}),s=q(()=>{const c=o.value[o.value.length-1];if(!c)return{};const T=gn(c.baselineItems??[]);return{...c,items:n.value,hasSearch:T.length>8||(c==null?void 0:c.hasSearch)}}),a=q(()=>s.value.mode||ze),i=q(()=>{const c=o.value[o.value.length-1];return c!=null&&c.searchItems?c.searchItems.map(T=>Qe(T,c.subcategory)):[]}),l=q(()=>{const c=o.value[o.value.length-1];if(!(c!=null&&c.search))return[];const T=e.mergedNodes.map($=>Qe($));return p(fn(c.search||"",T)).filter($=>!n.value.find(R=>R.key===$.key))}),r=q(()=>mp(e.mergedNodes));async function u(c,T,k){var z;const $=Te();let R,B;T===!0?(R=ee().visibleNodeTypesByInputConnectionTypeNames,B={properties:{title:$.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(R=ee().visibleNodeTypesByOutputConnectionTypeNames,B=Ep().items.find(A=>A.properties.connectionType===c)),await Bn(),g({title:B==null?void 0:B.properties.title,rootView:qt,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:B==null?void 0:B.properties.icon,color:(z=B==null?void 0:B.properties.iconProps)==null?void 0:z.color},panelClass:B==null?void 0:B.properties.panelClass,baseFilter:A=>{var L;if(A.key===Us)return!1;const V=R[c].includes(A.key);return V&&((L=k==null?void 0:k.nodes)!=null&&L.length)?k.nodes.includes(A.key):V},itemsMapper(A){return{...A,subcategory:c}},preventBack:!0})}function h(){const c=o.value[o.value.length-1];if(!c||!s.value.uuid)return;let T=(c==null?void 0:c.items)??[];if(!(c!=null&&c.items)){const k=(c==null?void 0:c.subcategory)??ot,$=r.value[k],R=c.sections;R?T=yp($,R):T=$}if((c.forceIncludeNodes??[]).length>0){const k=e.mergedNodes.filter($=>{var R;return(R=c.forceIncludeNodes)==null?void 0:R.includes($.name)}).map($=>Qe($,c.subcategory));T.push(...k)}c.baseFilter&&(T=T.filter(c.baseFilter)),c.itemsMapper&&(T=T.map(c.itemsMapper)),c.items||(T=Ft(T)),m({baselineItems:T})}function p(c){return c.map(T=>({...T,uuid:`${T.key}-${be()}`}))}function g(c){s.value.uuid&&m({activeIndex:t()});const T=be();o.value.push({...c,uuid:T,transitionDirection:"in",activeIndex:0}),h()}function b(){s.value.uuid&&(o.value.pop(),m({transitionDirection:"out"}))}function m(c){const T=o.value[o.value.length-1],k=o.value.findIndex($=>$.uuid===T.uuid);T&&Object.keys(c).forEach($=>{const R=$;o.value[k]={...o.value[k],[$]:c[R]}})}function P(){o.value=[]}return{viewStacks:o,activeViewStack:s,activeViewStackMode:a,globalSearchItemsDiff:l,gotoCompatibleConnectionView:u,resetViewStacks:P,updateCurrentViewStack:m,pushViewStack:g,popViewStack:b}});function _p(e,t={}){const o=pe(),n=j([0,0]),s=Ie();function a(u){const h=o.nodeViewOffsetPosition,[p,g]=Nt(u),b=h[0]+(p-n.value[0]),m=h[1]+(g-n.value[1]);return o.nodeViewOffsetPosition=[b,m],n.value=[p,g],[b,m]}function i(u,h){if(!(s.isCtrlKeyPressed(u)||h)||o.isActionActive("dragActive"))return;u.button!==xs.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[p,g]=Nt(u);n.value=[p,g];const b=x(e);b==null||b.addEventListener("mousemove",r)}function l(u){if(!o.nodeViewMoveInProgress)return;const h=x(e);h==null||h.removeEventListener("mousemove",r),o.nodeViewMoveInProgress=!1}function r(u){const h=x(e);if(!(u.target&&!(h===u.target||h!=null&&h.contains(u.target)))&&!o.isActionActive("dragActive")){if(u.buttons===Lo.MIDDLE&&(o.nodeViewMoveInProgress=!0),u.buttons===Lo.NONE){const p=x(t.onMouseMoveEnd);p==null||p(u);return}a(u)}}return{moveLastPosition:n,onMouseDown:i,onMouseUp:l,onMouseMove:r,panCanvas:a}}const Op=_e(async()=>await Pe(()=>import("./NodeCreation-vCHQm0aM.js").then(e=>e.N),__vite__mapDeps([48,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,49]))),$p=_e(async()=>await Pe(()=>import("./CanvasControls-A5WBrohY.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,51]))),Rp=_e(async()=>await Pe(()=>import("./SetupWorkflowCredentialsButton-OiOkf-hI.js"),__vite__mapDeps([52,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Ap=Y({name:"NodeView",components:{NodeDetailsView:mh,Node:Jh,Sticky:ip,CanvasAddButton:Dp,KeyboardShortcutTooltip:hi,NodeCreation:Op,CanvasControls:$p,ContextMenu:bh,SetupWorkflowCredentialsButton:Rp},async beforeRouteLeave(e,t,o){if(ut(e)===Ke.EXECUTIONS||t.name===J.TEMPLATE_IMPORT||ut(e)===Ke.WORKFLOW&&t.name===J.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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});n===He?(this.workflowsStore.setWorkflowId(Ye),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===J.NEW_WORKFLOW?await this.$router.replace({name:J.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===Ls&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ye),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),n=st(),s=oe(),a=We(),i=Te(),l=it(),r=Cn(),u=Ve(),h=Qt(),{activeNode:p}=Gt(s),g=Ce(p),b=Ie(),{callDebounced:m}=bt(),P=_p(e,{onMouseMoveEnd:o}),c=Dt({router:n}),{runWorkflow:T}=In({router:n});return{locale:i,contextMenu:l,dataSchema:r,nodeHelpers:u,externalHooks:a,clipboard:h,pinnedData:g,deviceSupport:b,canvasPanning:P,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:c,runWorkflow:T,callDebounced:m,...na(),...pi(),...Hs(),...tt(),...Zt(),...sa(),...Yi()}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=ut(e),n=!this.uiStore.nodeViewInitialized;let s=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ye)&&t.name!==J.NEW_WORKFLOW&&e.params.action!=="workflowSave";const a=e.name===J.TEMPLATE_IMPORT;if(o===Ke.WORKFLOW||a){if(s||n||a){if(this.canvasStore.startLoading(),n){const i=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=i}await Promise.all([this.loadCredentials(),this.initView()]),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ke.EXECUTIONS&&(s=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),s&&(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,t,o)=>{console.error("errorCaptured"),console.error(e)},computed:{...le(Xt,mi,bn,kt,ee,oe,Tt,jt,$n,pe,Z,Fs,kt,gi,Pn,eo,fi,ta,ea,Jt),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===J.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!==fe)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===fe)},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 yi(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(){return this.$route.params.name||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===Kt||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[zs,Ze].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.containsChatNodes&&this.triggerNodes.length===1},isExecutionDisabled(){return!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}},data(){return{GRID_SIZE:ct,STICKY_NODE_TYPE:fe,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:Ne,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},async mounted(){var t;this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=this.settingsStore.isPreviewMode&&this.isDemo?[]:[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];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(oa(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(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&js(this.currentUser)<=Ks){const o=await this.uiStore.getNextOnboardingPrompt(),n=(o==null?void 0:o.toast_sequence_number)===1?Ys: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(qs)}})},n)}Ko.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(Ne.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),de.on("newWorkflow",this.newWorkflow),de.on("importWorkflowData",this.onImportWorkflowDataEvent),de.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),de.on("openChat",this.onOpenChat),ce.on("nodeMove",this.onMoveNode),ce.on("revertAddNode",this.onRevertAddNode),ce.on("revertRemoveNode",this.onRevertRemoveNode),ce.on("revertAddConnection",this.onRevertAddConnection),ce.on("revertRemoveConnection",this.onRevertRemoveConnection),ce.on("revertRenameNode",this.onRevertNameChange),ce.on("enableNodeToggle",this.onRevertEnableToggle),Se.on("pin-data",this.addPinDataConnections),Se.on("unpin-data",this.removePinDataConnections),de.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),de.off("newWorkflow",this.newWorkflow),de.off("importWorkflowData",this.onImportWorkflowDataEvent),de.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),de.off("openChat",this.onOpenChat),ce.off("nodeMove",this.onMoveNode),ce.off("revertAddNode",this.onRevertAddNode),ce.off("revertRemoveNode",this.onRevertRemoveNode),ce.off("revertAddConnection",this.onRevertAddConnection),ce.off("revertRemoveConnection",this.onRevertRemoveConnection),ce.off("revertRenameNode",this.onRevertNameChange),ce.off("enableNodeToggle",this.onRevertEnableToggle),Se.off("pin-data",this.addPinDataConnections),Se.off("unpin-data",this.removePinDataConnections),de.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},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.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),de.off("newWorkflow",this.newWorkflow),de.off("importWorkflowData",this.onImportWorkflowDataEvent),de.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ye),Ko.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const n=t??this.ndvStore.activeNodeName,s=n?this.workflowsStore.getNodeByName(n):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&s&&this.insertNodeAfterSelected({index:0,endpointUuid:`${s.id}-input${e}0`,eventSource:Ne.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:s.id})})},editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return 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}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.externalHooks.run("nodeView.onRunNode",n),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(Gs)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Pt(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)===wi).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 s;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((s=t==null?void 0:t.issues)==null?void 0:s.input)??{}).forEach(a=>{n.filter(l=>l._defaultType.scope===a).forEach(l=>{const r=l==null?void 0:l.endpoint;r&&r.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(Ne.NO_TRIGGER_EXECUTION_TOOLTIP)});const 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.settingsStore.fetchPromptsData(),this.$route.name===J.EXECUTION_DEBUG&&await this.$router.replace({name:J.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"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(ze),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(s){this.showError(s,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(Ye),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes($e(t.workflowData.nodes),$e(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&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let s=!1;if(t.data.resultData.runData){const a=t.data.resultData.runData;e:for(const i of Object.keys(a))for(const l of a[i])if(l.error){s=!0;break e}}!s&&t.data.resultData.error.stack&&(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=vi(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.workflowsStore.activeWorkflowExecution=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(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:J.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:Js(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:J.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},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.workflowsStore.activeWorkflowExecution;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.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(s=>s.id);this.workflowsStore.setWorkflowTagIds(n||[]),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.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=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.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp(e)},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),n=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,s=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,a=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!a){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const i=e.path||e.composedPath&&e.composedPath();for(const r of i)if(r.className&&typeof r.className=="string"&&r.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&s){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const l=this.uiStore.getSelectedNodes.map(r=>r&&this.workflowsStore.getNodeByName(r.name)).filter(r=>!!r);if(e.key==="d"&&s&&!a)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},l);else if(e.key==="d"&&t&&!a)l.length>0&&(e.preventDefault(),this.duplicateNodes(l));else if(e.key==="p"&&s&&!a)l.length>0&&(e.preventDefault(),this.togglePinNodes(l,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&s&&!a)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},l);else if(e.key==="Tab"&&s&&!a)this.onToggleNodeCreator({source:Ne.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!a)this.onRunWorkflow();else if(e.key==="S"&&o&&!a)this.onAddNodes({nodes:[{type:fe}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&s&&!a){const r=this.lastSelectedNode;r!==null&&r.type!==fe&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},r.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},l);else if(e.key==="x"&&t&&!a)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},l);else if(e.key==="n"&&n){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===J.NEW_WORKFLOW?de.emit("newWorkflow"):this.$router.push({name:J.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&s){const r=this.lastSelectedNode;if(r!==null){if(r.type===fe&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=r.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowsStore.outgoingConnectionsByNodeName(r.name);if(u.main===void 0||u.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},u.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"&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowHelpers.getCurrentWorkflow();if(!u.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=u.connectionsByDestinationNode[r.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)&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowHelpers.getCurrentWorkflow();if(!u.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=u.connectionsByDestinationNode[r.name];if(!Array.isArray(h.main)||!h.main.length)return;const p=h.main[0][0].node,g=this.workflowsStore.outgoingConnectionsByNodeName(p);if(!Array.isArray(g.main)||!g.main.length)return;let b,m=e.key==="ArrowUp"?-99999999:99999999,P=null;for(const c of g.main)for(const T of c)T.node!==r.name&&(b=this.workflowsStore.getNodeByName(T.node),b&&(e.key==="ArrowUp"?b.position[1]<=r.position[1]&&b.position[1]>m&&(P=b.name,m=b.position[1]):b.position[1]>=r.position[1]&&b.position[1]<m&&(P=b.name,m=b.position[1])));P!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},P,!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(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e){const s=Ce(n);if(o){const a=this.dataSchema.getInputDataWithPinned(n);a.length!==0&&s.setData(a,t)}else s.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 n of o)this.nodeSelectedByName(n);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 n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],s=this.workflowHelpers.getCurrentWorkflow(),a=this.workflowHelpers.getConnectedNodes("downstream",s,e);for(const i of a){const l=this.workflowsStore.nodesByName[i],r=l.position;if(l.position[0]<n.position[0])continue;const u={name:i,properties:{position:[l.position[0]+t,l.position[1]]}};this.workflowsStore.updateNodeProperties(u),this.onNodeMoved(l),(o&&r[0]!==u.properties.position[0]||r[1]!==u.properties.position[1])&&this.historyStore.pushCommandToUndo(new Ni(i,r,u.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 n={meta:{...this.workflowsStore.workflow.meta??{},instanceId:this.rootStore.instanceId},...o};this.workflowHelpers.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const s=JSON.stringify(n,null,2);this.clipboard.copy(s),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(a=>a.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.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 n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},s={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(s),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),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(Pt(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(ut(this.$route)===Ke.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 await this.importWorkflowData(o,"paste",!1)}},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 n={};e.nodes&&e.nodes.forEach(r=>{if(r.webhookId&&Xs.includes(r.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(h=>h.webhookId===r.webhookId)&&(r.webhookId=be()),r.id){const u=be();n[u]=r.id,r.id=u}else r.id=be()}),this.removeUnknownCredentials(e);const s=this.rootStore.instanceId,a=JSON.stringify(Pt(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==s?e.meta.instanceId:"",isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:a}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:a}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:a}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,Be(this.nodes,this.lastClickPosition));const i=await this.addNodesToWorkflow(e);setTimeout(()=>{i.nodes.forEach(r=>{this.nodeSelectedByName(r.name)})});const l=this.settingsStore.areTagsEnabled;if(o&&l&&Array.isArray(e.tags)){const r=await this.tagsStore.fetchAll(),u=new Set(r.map(m=>m.name)),h=e.tags,p=h.filter(m=>!u.has(m.name)),g=[];for(const m of p){const P=this.tagsStore.create(m.name).then(c=>(r.push(c),c));g.push(P)}await Promise.all(g);const b=h.reduce((m,P)=>{const c=r.find(T=>T.name===P.name);return c&&m.push(c.id),m},[]);this.workflowsStore.addWorkflowTagIds(b),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})}}catch(n){this.showError(n,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,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=zt(e.dataTransfer.getData(Qs));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-Ge/2+ct,o[1]-Ge/2];await this.onAddNodes(t,!0,n),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 n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.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 a,i,l,r;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:be(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},s=(a=e.credentials)==null?void 0:a.map(u=>this.credentialsStore.getUsableCredentialByType(u.name)).flat();if(s&&s.length===1){const u=s[0],h=this.credentialsStore.getCredentialById(u.id),p={id:h.id,name:h.name},g={[u.type]:p};await this.loadNodesProperties([n].map(P=>({name:P.type,version:P.typeVersion})));const b=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),m=Fe((b==null?void 0:b.properties)||[],{},!0,!1,n);if(e.credentials){const P=e.credentials.find(T=>T.name===u.type);if((i=P==null?void 0:P.displayOptions)!=null&&i.hide)return n;const c=(l=P==null?void 0:P.displayOptions)==null?void 0:l.show;if(!c)return n.credentials=g,n;if(Object.keys(c).length===1&&c.authentication){n.credentials=g;let T={};for(const k of Object.keys(c)){if(m&&!m[k]){T={},n.credentials=void 0;break}const $=(r=c[k])==null?void 0:r[0];$&&typeof $=="string"&&(T[k]=$),n.parameters={...n.parameters,...T}}}}}return n},async injectNode(e,t={},o=!0,n=!1,s=!1){var u,h;const a=this.nodeTypesStore.getNodeType(e);if(a===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(a.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=a.maxNodes){this.showMaxNodeTypeError(a);return}const i=await this.getNewNodeWithDefaultCredential(a,{name:t.name}),l=this.lastSelectedNode;if(t.position)i.position=Be(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(l){const p=this.canvasStore.lastSelectedConnection;if(p){const[g]=ki(p);g<=bi&&this.pushDownstreamNodes(l.name,Ot,n)}if(this.canvasStore.newNodeInsertPosition)i.position=Be(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+ct,this.canvasStore.newNodeInsertPosition[1]-Ge/2]),this.canvasStore.newNodeInsertPosition=null;else{let g=0;const b=this.workflowHelpers.getCurrentWorkflow();if(p){const T=this.nodeTypesStore.getNodeType(l.type,l.typeVersion);if(T){const k=[[-100,100],[-140,0,140],[-240,-100,100,240]],$=Ee(b,l,T),B=we($).filter(z=>z===M.Main);if(B.length>1){const z=k[B.length-2],A=p.__meta?p.__meta.sourceOutputIndex:0;g=z[A]}}}let m=[];try{m=Ee(b,i,a)}catch{}const P=we(m),c=this.nodeTypesStore.getNodeType(l.type,l.typeVersion);if(P.length>0&&P.every(T=>T!==M.Main)){const T=b.getNode(l.name),k=me(b,T,c),R=(we(k)||[]).filter(B=>B!==M.Main).findIndex(B=>m[0]===B);i.position=Be(this.nodes,[l.position[0]+Ge/(Math.max(((u=c==null?void 0:c.inputs)==null?void 0:u.length)??1),1)*R,l.position[1]+Ot],[100,0])}else{const T=me(b,l,c),k=we(T);let $=Ot;k.find(R=>R!==M.Main)&&($+=150),i.position=Be(this.nodes,[l.position[0]+$,l.position[1]+g],[100,0])}}}else{const p=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;i.position=Be(this.nodes,p)}const r=this.locale.localizeNodeName(i.name,i.type);if(i.name=this.uniqueNodeName(r),(h=a.webhooks)!=null&&h.length&&(i.webhookId=be()),await this.addNodes([i],void 0,n),this.workflowsStore.setNodePristine(i.name,!0),this.uiStore.stateIsDirty=!0,e===fe)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),Ti().trackAddedTrigger(e);const p={node_type:e,node_version:i.typeVersion,is_auto_add:s,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};l&&(p.input_node_type=l.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",p)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(i.name,o&&e!==fe)})),i},getConnection(e,t,o,n,s){const a=this.workflowsStore.outgoingConnectionsByNodeName(e)[s];if(a){const i=a[t];if(i)return i.find(l=>l.node===o&&l.index===n)}},connectTwoNodes(e,t,o,n,s){this.uiStore.stateIsDirty=!0;const a=this.workflowsStore.getNodeByName(e),i=this.workflowsStore.getNodeByName(o);if(a&&i&&!this.checkNodeConnectionAllowed(a,i,s)||this.getConnection(e,t,o,n,s))return;const l=[{node:e,type:s,index:t},{node:o,type:s,index:n}];this.__addConnection(l)},async addNode(e,t={},o=!0,n=!1,s=!1){var g;if(!this.editAllowedCheck())return;const a=this.lastSelectedNode,i=this.uiStore.lastSelectedNodeOutputIndex,l=this.uiStore.lastSelectedNodeEndpointUuid,r=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const u=await this.injectNode(e,t,o,n,s);if(!u)return;const h=i||0,p=l||"";if(l&&!s){const b=this.instance.getEndpoint(l);if(b&&this.checkNodeConnectionAllowed(a,u,b.scope)){const m=b.scope,P=this.instance.getManagedElement(u.id),T=this.instance.getEndpoints(P).find(k=>k.scope===m&&b.parameters.connection!==k.parameters.connection);(g=this.instance)==null||g.connect({uuids:[p,(T==null?void 0:T.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(a&&!s){if(await this.$nextTick(),r!=null&&r.__meta){this.__deleteJSPlumbConnection(r,n);const b=r.__meta.targetNodeName,m=r.__meta.targetOutputIndex;this.connectTwoNodes(u.name,0,b,m,M.Main)}this.connectTwoNodes(a.name,h,u.name,0,M.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.workflowHelpers.getCurrentWorkflow(),s=n.getNode(e);if(!s)return{nodes:[]};const a=this.nodeTypesStore.getNodeType(s==null?void 0:s.type,s.typeVersion);if(a){const l=me(n,s,a).filter(r=>!(typeof r=="string"||r.type!==t||!r.filter));l.length&&(o=l[0].filter)}return o},insertNodeAfterSelected(e){var a,i,l;const t=e.outputType??M.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((i=(a=e.connection)==null?void 0:a.target.jtk)==null?void 0:i.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((l=e.connection)==null?void 0:l.endpoints[0].parameters.connection)==="source";t!==M.Main&&Object.values(M).includes(t)&&Pp().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(r=>{})},async onEventConnectionAbort(e){var t,o;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const n=this.workflowsStore.getNodeById(e.parameters.nodeId),s=e.parameters.type??M.Main,a=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(n){const i=e.parameters.connection==="target",l=i?this.pullConnActiveNodeName:n.name,r=i?n.name:this.pullConnActiveNodeName,u=e.parameters.index;Yo(e),await this.$nextTick(),this.connectTwoNodes(l,u,r,((o=a==null?void 0:a.parameters)==null?void 0:o.index)??0,s),this.pullConnActiveNodeName=null,this.dropPrevented=!1}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:Ne.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var s;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((s=n==null?void 0:n.inputs)!=null&&s.length){const a=this.workflowHelpers.getCurrentWorkflow(),i=a.getNode(t.name);let l=[];n&&(l=me(a,i,n));for(const r of l||[])if(!(typeof r=="string"||r.type!==o||!r.filter)&&r.filter.nodes.length&&!r.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 n=this.workflowsStore.getNodeById(t.nodeId),s=this.workflowsStore.getNodeById(o.nodeId),a=(n==null?void 0:n.name)||"",i=(s==null?void 0:s.name)||"";return n&&s&&!this.checkNodeConnectionAllowed(n,s,o.type)?!1:this.getConnection(a,t.index,i,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 r=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=r}const n=e.sourceEndpoint.parameters,s=e.targetEndpoint.parameters,a=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,i=(o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name;a&&i&&(e.connection.__meta={sourceNodeName:a,sourceOutputIndex:n.index,targetNodeName:i,targetOutputIndex:s.index}),ht(e.connection),Si(e.targetEndpoint);const l=[{node:a,type:n.type,index:n.index},{node:i,type:s.type,index:s.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:l}),!this.isReadOnlyRoute&&!this.readOnlyEnv){Di(e.sourceEndpoint),Ei(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:Ne.NODE_CONNECTION_ACTION})});const r=Ii(e.connection,Ci);n.type!==M.Main&&(e.connection.setPaintStyle(Pi(e.connection,e.sourceEndpoint.parameters.category)),r==null||r.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new _i(l)),this.isInsertingNodes||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var r,u;qo(e.source,e.target,(u=(r=e.connection)==null?void 0:r.connector)!=null&&u.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(n){console.error(n)}},addConectionsTestData(){this.instance.connections.forEach(e=>{var t;qo(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=>{Go(t),Jo(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.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)&&$t(this.activeConnection),this.enterTimer=void 0,e&&(Oi(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)&&($t(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Xo(e.connection);const n=e.connection.parameters,s=e.originalEndpoint.parameters,a=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name)||"",type:s.type,index:s.index}];this.__removeConnection(a,!1)}catch(n){console.error(n)}},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 n=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=n}const o=Qo(e);if(Xo(e.targetEndpoint),$i(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).name,a=e.connection.parameters.index,i=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new pt(o)),this.connectTwoNodes(s,a,this.pullConnActiveNodeName,((t=i==null?void 0:i.parameters)==null?void 0:t.index)??0,M.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const n=new pt(o,this);this.historyStore.pushCommandToUndo(n)}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,$t(e),ht(e);const o=e.scope,n=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),a=e.parameters.connection==="source"?"target":"source",i=n.filter(u=>{const h=u.jtk.endpoint;if(!h)return!1;const p=h.parameters.nodeId===e.parameters.nodeId,g=h.parameters.connection;return!p&&g===a}),l=u=>{if(!e)return;const h=i.filter(p=>{const g=p.jtk.endpoint;if(p.classList.contains("jtk-floating-endpoint"))return!1;const b=en(p,u,50),m=en(g.element,u,30);if(b||m){const P=this.workflowsStore.getNodeById(g.parameters.nodeId);if(P)return!!this.nodeTypesStore.getNodeType(P.type,P.typeVersion)}return!1}).sort((p,g)=>{const b=Zo(p,u,50),m=Zo(g,u,50);return!(b!=null&&b.y)&&!(m!=null&&m.y)?0:b!=null&&b.y?m!=null&&m.y?m.y-b.y:-1:1});if(h.length>0){const g=h[0].jtk.endpoint,b=this.workflowsStore.getNodeById(g.parameters.nodeId);this.pullConnActiveNodeName=(b==null?void 0:b.name)??null,Ri(e,g)}else Ai(e),this.pullConnActiveNodeName=null},r=u=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(u),Yo(e),window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",r),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",l),window.addEventListener("touchmove",l),window.addEventListener("mouseup",r),window.addEventListener("touchend",l),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:Ne.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:Ne.ADD_INPUT_ENDPOINT,nodeCreatorView:vt,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ft,this.onEventConnectionAbort),this.instance.bind(Ho,this.onInterceptBeforeDrop),this.instance.bind(Fo,this.onEventConnection),this.instance.bind(an,this.onDragMove),this.instance.bind(rn,this.onConnectionMouseOver),this.instance.bind(ln,this.onConnectionMouseOut),this.instance.bind(zo,this.onConnectionMoved),this.instance.bind(dn,this.onEndpointMouseOver),this.instance.bind(un,this.onEndpointMouseOut),this.instance.bind(dt,this.onConnectionDetached),this.instance.bind(gt,this.onConnectionDrag),this.instance.bind([gt,ft,dt],this.onConnectionDragAbortDetached),this.instance.bind(tn,this.onPlusEndpointClick),this.instance.bind(on,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ft,this.onEventConnectionAbort),this.instance.unbind(Ho,this.onInterceptBeforeDrop),this.instance.unbind(Fo,this.onEventConnection),this.instance.unbind(an,this.onDragMove),this.instance.unbind(rn,this.onConnectionMouseOver),this.instance.unbind(ln,this.onConnectionMouseOut),this.instance.unbind(zo,this.onConnectionMoved),this.instance.unbind(dn,this.onEndpointMouseOver),this.instance.unbind(un,this.onEndpointMouseOut),this.instance.unbind(dt,this.onConnectionDetached),this.instance.unbind(gt,this.onConnectionDrag),this.instance.unbind(gt,this.onConnectionDragAbortDetached),this.instance.unbind(ft,this.onConnectionDragAbortDetached),this.instance.unbind(dt,this.onConnectionDragAbortDetached),this.instance.unbind(tn,this.onPlusEndpointClick),this.instance.unbind(on,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const s of n||[]){const a=s==null?void 0:s.endpoint;a&&a.type===Mi&&a.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*Zs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.canvasStore.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},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===J.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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(n===He)await this.workflowHelpers.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===ei)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(s){this.showError(s,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:J.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}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([J.WORKFLOW,J.NEW_WORKFLOW])},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Ht(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?On(n.id,t,o):null},__addConnection(e){var s;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 n=[t,o];(s=this.instance)==null||s.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})},__removeConnection(e,t=!1){var o,n;if(t){const s=this.workflowsStore.getNodeByName(e[0].node),a=this.workflowsStore.getNodeByName(e[1].node);if(!s||!a)return;const i=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),l=((o=i==null?void 0:i.outputs)==null?void 0:o[e[0].index])||M.Main,r=typeof l=="string"?l:l.name,u=Lt(r);((n=this.instance)==null?void 0:n.getConnections({scope:u,source:s.id,target:a.id})).forEach(p=>{p.__meta?p.__meta.sourceOutputIndex===e[0].index&&p.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(p):this.__deleteJSPlumbConnection(p)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,s;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const a=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:M.Main},{index:(s=e.__meta)==null?void 0:s.targetOutputIndex,node:e.__meta.targetNodeName,type:M.Main}],i=new pt(a,this);this.historyStore.pushCommandToUndo(i)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Qo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new pt(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=$e(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const s=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:s}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{Jo(n),Go(n)})},onNodeRun({name:e,data:t,waiting:o}){var l;const n=this.workflowsStore.pinnedWorkflowData;if(n!=null&&n[e]){const{outgoing:r}=this.getIncomingOutgoingConnections(e);r.forEach(u=>{var h;if(((h=u.__meta)==null?void 0:h.sourceNodeName)===e){const p=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Wi({connection:u,overlayIds:[xi],classNames:p?["has-run"]:[],includeConnector:!0})}});return}const s=e,a=this.workflowsStore.getNodeByName(s),i=a!==null?a.id:"";if(t===null||t.length===0||o){((l=this.instance)==null?void 0:l.getConnections({source:i})).forEach(h=>{ht(h)}),Vi(a,this.instance).forEach(h=>{h.endpoint.type==="N8nPlus"&&h.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,a)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const s=[];if(s.includes(n.type)){let p=!1;for(const g of this.nodes)if(g.name!==n.name&&s.includes(g.type)){p=!0;break}if(!p)return}n.type===fe?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===En}):(this.externalHooks.run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let a=!1;const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),l=this.workflowHelpers.getCurrentWorkflow(),r=l.getNode(n.name);let u=[],h=[];if(i&&(u=me(l,r,i),h=Ee(l,r,i)),h.length===1&&u.length===1){const{incoming:p,outgoing:g}=this.getIncomingOutgoingConnections(n.name);if(p.length===1&&g.length===1){const b=p[0],m=g[0];if(b.__meta&&m.__meta){a=!0;const P=b.__meta.sourceNodeName,c=b.__meta.sourceOutputIndex,T=m.__meta.targetNodeName,k=m.__meta.targetOutputIndex;setTimeout(()=>{var $;this.connectTwoNodes(P,c,T,k,M.Main),a&&(($=this.instance)==null||$.setSuspendDrawing(!1,!0),a=!1)},100)}}}Bn(()=>{var p,g,b;(p=this.instance)==null||p.setSuspendDrawing(!0),(((g=this.instance)==null?void 0:g.endpointsByElement[n.id])||[]).flat().forEach(m=>{var P;return(P=this.instance)==null?void 0:P.deleteEndpoint(m)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),a||(b=this.instance)==null||b.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new Li(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},a?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});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==He)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){var i;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const s=((i=this.activeNode)==null?void 0:i.name)===e;s&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const a=this.workflowHelpers.getCurrentWorkflow(!0);a.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new _n(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(a.nodes),a.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),s&&(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 n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const a=o.id.toString(),i=n.find(l=>l.id===a);if(i){(i.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:i.id,name:i.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const s=n.filter(a=>a.name===o.name);s.length===1&&(e.credentials[t].id=s[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var s,a;if(!(e!=null&&e.length))return;this.isInsertingNodes=!0,await this.loadNodesProperties(e.map(i=>({name:i.type,version:i.typeVersion})));let n;e.forEach(i=>{if(i.id||(i.id=be()),n=this.nodeTypesStore.getNodeType(i.type,i.typeVersion),i.hasOwnProperty("disabled")||(i.disabled=!1),i.hasOwnProperty("parameters")||(i.parameters={}),n!==null){let l=null;try{l=Fe(n.properties,i.parameters,!0,!1,i)}catch(r){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${i.name}"`),console.error(r)}i.parameters=l!==null?l:{},[Re,Me].includes(i.type)&&i.parameters.path===""&&(i.parameters.path=i.webhookId)}this.matchCredentials(i),this.workflowsStore.addNode(i),o&&this.historyStore.pushCommandToUndo(new Bi(i))}),await this.$nextTick(),(s=this.instance)==null||s.setSuspendDrawing(!0),t&&await this.addConnections(t),this.nodeHelpers.refreshNodeIssues(),this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),this.isInsertingNodes=!1,(a=this.instance)==null||a.setSuspendDrawing(!1,!0)},async addConnections(e){const t=[];for(const o in e)for(const n in e[o])e[o][n].forEach((s,a)=>{s&&s.forEach(i=>{t.push([{node:o,type:n,index:a},{node:i.node,type:i.type,index:i.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(s=>{this.__addConnection(s)})},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.workflowHelpers.getNodeTypesMaxCount();let s,a;const i=[];await this.loadNodesProperties(e.nodes.map(c=>({name:c.type,version:c.typeVersion}))),e.nodes.forEach(c=>{if(n[c.type]!==void 0)if(n[c.type].exist>=n[c.type].max){t[c.name]=n[c.type].nodeNames[0];return}else n[c.type].exist+=1;s=c.name;const T=this.locale.localizeNodeName(c.name,c.type);a=this.uniqueNodeName(T,o),o.push(a),t[s]=a,i.push(c)});const l={},r=e.connections,u=i.map(c=>c.name);let h,p,g,b,m;for(h of Object.keys(r)){if(!u.includes(h))continue;const c={};for(p of Object.keys(r[h]))for(c[p]=[],g=0;g<r[h][p].length;g++){const T=[];if(r[h][p][g])for(b=0;b<r[h][p][g].length;b++)m=r[h][p][g][b],u.includes(m.node)&&T.push(m);c[p].push(T)}l[h]=c}const P=this.workflowHelpers.getWorkflow(i,l);for(s in t)s!==t[s]&&P.renameNode(s,t[s]);if(e.pinData){let c=!0;for(const T of Object.keys(e.pinData)){if(!c){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const k=P.nodes[t[T]];try{Ce(k).setData(e.pinData[T],"add-nodes"),c=!0}catch($){c=!1,console.error($)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(P.nodes),P.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(P.nodes),connections:P.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const p of e){o=this.workflowHelpers.getNodeDataToSave(p),n.push(p.name),t.nodes.push(o);const g=this.workflowsStore.pinDataByNodeName(p.name);if(g&&(t.pinData[p.name]=g),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(Dn.Sharing)){const b=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([m,P])=>{var c;return P.id&&(!b[P.id]||((c=b[P.id])==null?void 0:c.currentUserHasAccess))}))}}let s,a,i,l,r,u,h;return t.nodes.forEach(p=>{if(a=this.workflowsStore.outgoingConnectionsByNodeName(p.name),Object.keys(a).length!==0){h={};for(i of Object.keys(a))for(r=0;r<a[i].length;r++){for(s=[],l=0;l<a[i][r].length;l++)u=a[i][r][l],n.indexOf(u.node)!==-1&&s.push(u);s.length&&(h.hasOwnProperty(i)||(h[i]=[]),h[i][r]=s)}Object.keys(h).length&&(t.connections[p.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(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const s=Array.isArray(n.version)?n.version:[n.version];e.find(a=>a.name===n.name&&s.includes(a.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.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 n=JSON.parse(e.data);if(n&&n.command==="openWorkflow")try{await this.importWorkflowExact(n),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:s.message,type:"error"})}else if(n&&n.command==="openExecution")try{this.isProductionExecutionPreview=n.executionMode!=="manual",await this.openExecution(n.executionId),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(s){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:s.message,type:"error"})}else(n==null?void 0:n.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=n.execution)}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){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=this.workflowsStore.getWorkflowResultDataByNodeName(t)!==null,s=["pinned"];n&&s.push("has-run"),((i=this.instance)==null?void 0:i.getConnections({source:o.id})).forEach(l=>{Ui(l,{total:e[t].length,iterations:0,classNames:s})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var s;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(s=this.instance)==null?void 0:s.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(ht),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Ut:ze),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case vt:n="ai";break;case Ut:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let s=n;for(const{type:u,isAutoAdd:h,name:p,openDetail:g,position:b}of e){await this.addNode(u,{position:b??s,dragAndDrop:o,name:p},g??!1,!0,h);const m=this.nodes[this.nodes.length-1];s=[m.position[0]+Ge*2+ct,m.position[1]]}const a=this.nodes.length-e.length;for(const{from:u,to:h}of t){const p=this.nodes[a+u.nodeIndex],g=this.nodes[a+h.nodeIndex];this.connectTwoNodes(p.name,u.outputIndex??0,g.name,h.inputIndex??0,M.Main)}const i=this.nodes[this.nodes.length-1],r=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(i.name,1);r.length>1&&r.slice(1).forEach((u,h)=>{const p=this.workflowsStore.getNodeByName(u.name);p&&this.onMoveNode({nodeName:p.name,position:[p.position[0],p.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 n;o&&((n=this.instance)==null||n.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=be(),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,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.nodeHelpers.disableNodes([o])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[J.NEW_WORKFLOW,J.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:J.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===J.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:Ne.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:fe}],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);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),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)}}}),Mp="_content_yewsk_1",Wp="_shake_yewsk_9",Vp="_setupCredentialsButtonWrapper_yewsk_27",Bp={content:Mp,shake:Wp,setupCredentialsButtonWrapper:Vp},Up=["textContent"],xp={key:0,class:"workflow-execute-wrapper"};function Lp(e,t,o,n,s,a){const i=S("CanvasAddButton"),l=S("Node"),r=S("Sticky"),u=S("NodeDetailsView"),h=S("SetupWorkflowCredentialsButton"),p=S("NodeCreation"),g=S("CanvasControls"),b=S("ContextMenu"),m=S("n8n-button"),P=S("KeyboardShortcutTooltip"),c=S("n8n-icon-button"),T=Et("touch");return d(),N("div",{ref:"nodeViewRootRef",class:D(e.$style.content)},[f("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[14]||(t[14]=(...k)=>e.onDragOver&&e.onDragOver(...k)),onDrop:t[15]||(t[15]=(...k)=>e.onDrop&&e.onDrop(...k))},[Q((d(),N("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[4]||(t[4]=(...k)=>e.mouseDown&&e.mouseDown(...k)),onTouchend:t[5]||(t[5]=(...k)=>e.mouseUp&&e.mouseUp(...k)),onTouchmove:t[6]||(t[6]=(...k)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...k)),onMousedown:t[7]||(t[7]=(...k)=>e.mouseDown&&e.mouseDown(...k)),onMouseup:t[8]||(t[8]=(...k)=>e.mouseUp&&e.mouseUp(...k)),onContextmenu:t[9]||(t[9]=(...k)=>e.contextMenu.open&&e.contextMenu.open(...k)),onWheel:t[10]||(t[10]=(...k)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...k))},[f("div",{id:"node-view-background",class:"node-view-background",style:se(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),f("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:se(e.workflowStyle),"data-test-id":"node-view"},[Q(y(i,{ref:"canvasAddButton",style:se(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:t[0]||(t[0]=k=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onHook:mounted"]),[[ae,e.showCanvasAddButton]]),(d(!0),N(te,null,ue(e.nodesToRender,k=>(d(),_(l,{key:`${k.id}_node`,name:k.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===k.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[1]||(t[1]=$=>e.removeNode($,!0)),onToggleDisableNode:t[2]||(t[2]=$=>e.toggleActivationNodes([$]))},{"custom-tooltip":v(()=>[f("span",{textContent:w(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,Up)]),_: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)),(d(!0),N(te,null,ue(e.stickiesToRender,k=>(d(),_(r,{key:`${k.id}_sticky`,name:k.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===k.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[3]||(t[3]=$=>e.removeNode($,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[T,e.touchTap,"tap"]]),y(u,{"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"]),(d(),_(De,null,{default:v(()=>[f("div",{class:D(e.$style.setupCredentialsButtonWrapper)},[y(h)],2)]),_:1})),(d(),_(De,null,{default:v(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),_(p,{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"])):E("",!0)]),_:1})),(d(),_(De,null,{default:v(()=>[y(g)]),_:1})),(d(),_(De,null,{default:v(()=>[y(b,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),N("div",xp,[e.isManualChatOnly?E("",!0):(d(),N("span",{key:0,onMouseenter:t[11]||(t[11]=k=>e.showTriggerMissingToltip(!0)),onMouseleave:t[12]||(t[12]=k=>e.showTriggerMissingToltip(!1)),onClick:t[13]||(t[13]=(...k)=>e.onRunContainerClick&&e.onRunContainerClick(...k))},[y(P,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:v(()=>[y(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:re(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(d(),_(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:re(e.onOpenChat,["stop"])},null,8,["onClick"])):E("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(d(),_(c,{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:re(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):E("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(d(),_(c,{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:re(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):E("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(d(),_(c,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:re(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):E("",!0)])):E("",!0)],32)],2)}const Hp={$style:Bp},Fp=G(Ap,[["render",Lp],["__cssModules",Hp],["__scopeId","data-v-562ca1f4"]]),df=Object.freeze(Object.defineProperty({__proto__:null,default:Fp},Symbol.toStringTag,{value:"Module"}));export{af as A,Ar as D,df as N,lf as R,rf as T,Pp as a,Ip as b,Ep as c,gn as f,Ft as s,Qe as t,kt as u};
9
- //# sourceMappingURL=NodeView-oDPyzajr.js.map
7
+ import{u as pe,y as ee,v as Z,q as fe,x as Te,el as wn,c_ as jn,J as me,cZ as we,N as M,dX as Ie,_ as G,$ as oe,em as Kn,en as Yn,bg as vn,ay as Nn,a8 as We,e as tt,eo as co,ep as qn,cV as Me,ap as Ze,aB as bt,cS as kn,b8 as et,a2 as Re,ds as de,a9 as He,B as bn,dj as ho,eq as Gn,er as Le,o as $e,a6 as Fe,es as wt,df as Ae,et as po,eu as Jn,ev as fo,d4 as zt,m as Tt,l as jt,ew as Tn,an as rt,O as Xn,ex as Qn,ey as Zn,ez as es,cR as go,b6 as Vt,aZ as mo,eA as ts,db as Ee,eB as Se,eC as yo,eD as os,eE as ns,eF as wo,eG as Bt,cJ as Pe,z as Kt,eH as ss,eI as is,k as Sn,dh as yt,V as J,dd as as,eJ as rs,eK as ls,t as Dn,eL as ds,eM as us,eN as cs,eO as hs,eP as ps,e8 as fs,eQ as gs,F as ms,D as It,r as lt,eR as En,eS as ge,eT as ot,d7 as Yt,b as ys,S as ws,eU as ze,eV as vt,eW as qt,eX as vo,eY as No,eZ as ko,e_ as bo,e$ as To,f0 as So,f1 as Do,f2 as Eo,f3 as Co,f4 as Io,f5 as vs,b9 as Po,f6 as _o,f7 as Oo,f8 as Ut,f9 as Ns,fa as ks,fb as $o,ba as bs,b2 as Ro,fc as Ts,fd as Ao,fe as Ss,ff as Ds,fg as Es,fh as Cs,fi as Is,fj as Mo,fk as Ps,fl as _s,fm as Os,fn as Wo,fo as Vo,fp as $s,fq as Rs,fr as Bo,fs as As,ah as Ms,ft as Uo,fu as xo,a1 as Ws,d9 as Vs,d8 as Bs,da as Us,fv as xs,fw as Lo,M as Ke,a3 as Ye,fx as Ls,cY as Hs,f as Fs,dc as zs,fy as Ne,cK as js,cL as Ks,cM as Ys,bu as qs,cU as Gs,cT as Pt,aa as Js,fz as Xs,fA as Qs,ej as Zs,fB as ei}from"./n8n-G5ZIZCy5.js";import{m as le,d as St,s as Gt}from"./pinia-UPmhnKmF.js";import{_ as Ho,$ as Fo,a0 as zo,a1 as dt}from"./@jsplumb/core-MKwKlGip.js";import{d as Jt,i as Nt,j as Cn,c as Xt,k as ti,N as nt,l as Qt,a as Dt,m as Ve,n as xt,o as Ce,p as In,b as Zt,q as oi,P as ni,r as Pn,t as eo,R as _n,v as si,J as ii,w as ai,C as ri,x as jo,y as Lt,z as On,A as _t,B as li,D as di,E as Ht,F as qe,G as ui,H as ci,h as $n,K as hi,I as ut,L as pi,M as fi,O as gi,u as mi,Q as yi,U as ct,s as Ko,V as ce,W as wi,X as vi,Y as Ni,Z as Be,_ as Ge,$ as ki,a0 as bi,a1 as Ot,a2 as Ti,a3 as Yo,a4 as ht,a5 as Si,a6 as Di,a7 as Ei,a8 as Ci,a9 as Ii,aa as Pi,ab as _i,ac as qo,ad as Go,ae as Jo,af as $t,ag as Oi,ah as Xo,ai as Qo,aj as $i,ak as pt,al as Zo,am as en,an as Ri,ao as Ai,ap as tn,aq as on,ar as Mi,as as Wi,at as Vi,au as Bi,av as Ui,aw as xi,ax as Li}from"./index-4C1AxeXk.js";import{r as j,e as q,d as to,b as Rn,v as Y,f as d,h as N,i as f,K as y,y as D,E as v,J as O,I as w,D as _,H as E,$ as nn,V as re,a6 as S,at as st,F as te,_ as ue,aj as An,ak as Mn,z as se,ae as Et,M as Q,A as Hi,L as ae,x as he,Y as Wn,G as Vn,l as Fi,u as x,N as zi,au as _e,aw as De,a0 as oo,aB as ji,T as Ki,n as Bn}from"./vendor-VXT4wwt2.js";import{u as Yi}from"./useExecutionDebugging-eQjp4txV.js";import{g as ke,s as Ue,A as Rt,z as qi,e as Gi}from"./lodash-es-xYzII6mS.js";import{F as At}from"./file-saver-7fKiBHqp.js";import{V as Ji}from"./vue-json-pretty-c0xb0mJ1.js";import{V as Xi,R as Qi}from"./RunDataAi-PNu5uqz6.js";import{c as Zi}from"./dateFormatter-7nt2saFg.js";import{w as sn}from"./workflowActivate-6jCh92f_.js";import{v as be}from"./uuid-McvpxQtQ.js";import{a as ea,u as ta}from"./collaboration.store-zPDg5IkG.js";import{g as oa,f as ft,h as an,a as rn,E as ln,b as dn,d as un,i as gt}from"./@jsplumb/browser-ui-AlqFM-P6.js";const Mt=j([0,0]),Je=j(!1),Xe=j({source:"canvas"}),mt=j([]),cn=j(()=>{}),it=(e=()=>{})=>{const t=pe(),o=ee(),n=Z(),s=Jt(),{getInputDataWithPinned:a}=Cn(),i=Te(),l=q(()=>s.preferences.branchReadOnly||t.isReadOnlyView),r=q(()=>{if(!Je.value)return[];const c=t.selectedNodes.map(k=>n.getNodeByName(k.name)),T=Xe.value;return T.source==="canvas"?c:T.source==="node-right-click"?c.some($=>$.name===T.node.name)?c:[T.node]:[T.node]}),u=c=>{const T=n.allNodes.filter(k=>k.type===c.name);return c.maxNodes===void 0||T.length<c.maxNodes},h=c=>{const T=o.getNodeType(c.type,c.typeVersion);return!T||wn.includes(T.name)?!1:u(T)},p=c=>{const T=o.getNodeType(c.type,c.typeVersion),k=a(c);return!T||k.length===0?!1:T.outputs.length===1&&!jn.includes(c.type)},g=c=>!!n.pinDataByNodeName(c.name),b=()=>{Xe.value={source:"canvas"},Je.value=!1,mt.value=[],Mt.value=[0,0]},m=(c,T={source:"canvas"})=>{if(c.stopPropagation(),Je.value&&T.source===Xe.value.source){b();return}c.preventDefault(),cn.value=e,Xe.value=T,Mt.value=Nt(c),Je.value=!0;const k=r.value,$=k.every(z=>z.type===fe),R={adjustToNumber:k.length,interpolate:{subject:$?i.baseText("contextMenu.sticky",{adjustToNumber:k.length}):i.baseText("contextMenu.node",{adjustToNumber:k.length})}},B=[{id:"select_all",divided:!0,label:i.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:k.length===n.allNodes.length},{id:"deselect_all",label:i.baseText("contextMenu.deselectAll"),disabled:k.length===0}];if(k.length===0)mt.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:i.baseText("contextMenu.addNode"),disabled:l.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:i.baseText("contextMenu.addSticky"),disabled:l.value},...B];else{const z=V=>{const L=n.getCurrentWorkflow(),ne=L.getNode(V.name),ye=o.getNodeType(V.type,V.typeVersion),W=me(L,ne,ye);return!!we(W).find(C=>C!==M.Main)},A=[!$&&{id:"toggle_activation",label:k.every(V=>V.disabled)?i.baseText("contextMenu.activate",R):i.baseText("contextMenu.deactivate",R),shortcut:{keys:["D"]},disabled:l.value},!$&&{id:"toggle_pin",label:k.every(V=>g(V))?i.baseText("contextMenu.unpin",R):i.baseText("contextMenu.pin",R),shortcut:{keys:["p"]},disabled:k.some(z)||l.value||!k.every(p)},{id:"copy",label:i.baseText("contextMenu.copy",R),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:i.baseText("contextMenu.duplicate",R),shortcut:{metaKey:!0,keys:["D"]},disabled:l.value||!k.every(h)},...B,{id:"delete",divided:!0,label:i.baseText("contextMenu.delete",R),shortcut:{keys:["Del"]},disabled:l.value}].filter(Boolean);if(k.length===1){const V=$?[{id:"open",label:i.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:l.value},{id:"change_color",label:i.baseText("contextMenu.changeColor"),disabled:l.value}]:[{id:"open",label:i.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:i.baseText("contextMenu.test"),disabled:l.value},{id:"rename",label:i.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:l.value}];A.unshift(...V)}mt.value=A}},P=c=>{cn.value(c,r.value)};return to(()=>t.nodeViewOffsetPosition,()=>{b()}),{isOpen:Je,position:Mt,target:Xe,actions:mt,targetNodes:r,open:m,close:b,_dispatchAction:P}};function na(){const e=j(!1),t=j(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=Ie(),s=pe(),a=Xt(),i=Z(),{isOpen:l}=it();function r(A){Object.assign(t.value.style,A)}function u(A){const[V,L]=k(A);t.value=Object.assign(t.value,{x:V,y:L}),r({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(A){const V=g(A);r({left:V.x+"px",top:V.y+"px",width:V.width+"px",height:V.height+"px"})}function p(){t.value.x=0,t.value.y=0,r({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function g(A){const[V,L]=k(A);return{x:Math.min(V,t.value.x),y:Math.min(L,t.value.y),width:Math.abs(V-t.value.x),height:Math.abs(L-t.value.y)}}function b(A){const V=[],L=g(A);return i.allNodes.forEach(ne=>{ne.position[0]<L.x||ne.position[0]>L.x+L.width||ne.position[1]<L.y||ne.position[1]>L.y+L.height||V.push(ne)}),V}function m(){t.value.id="select-box",r({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",c),document.querySelector("#node-view").appendChild(t.value)}function P(A){if(A.buttons===0){c(A);return}h(A)}function c(A){if(A.button===2||l.value)return;if(!e.value){o&&A.target instanceof HTMLElement&&A.target&&A.target.id.includes("node-view")&&B();return}document.removeEventListener("mousemove",P),B();const V=b(A);V.forEach(L=>{R(L)}),V.length===1&&(s.lastSelectedNode=V[0].name),p()}function T(A,V){n(A)||V||A.button===2||s.isActionActive("dragActive")||(u(A),document.addEventListener("mousemove",P))}function k(A){const V=Nt(A),[L,ne]=a.canvasPositionFromPagePosition(V),ye=a.nodeViewScale,W=s.nodeViewOffsetPosition;return ti(L,ne,ye,W)}function $(A){s.removeNodeFromSelection(A),z.value.removeFromDragSelection(z.value.getManagedElement(A==null?void 0:A.id))}function R(A){s.addSelectedNode(A),z.value.addToDragSelection(z.value.getManagedElement(A==null?void 0:A.id))}function B(){z.value.clearDragSelection(),s.resetSelectedNodes(),s.lastSelectedNode=null,s.lastSelectedNodeOutputIndex=null,a.lastSelectedConnection=null,a.newNodeInsertPosition=null}const z=q(()=>a.jsPlumbInstance);return Rn(()=>{m()}),{selectActive:e,getMousePositionWithinNodeView:k,mouseUpMouseSelect:c,mouseDownMouseSelect:T,nodeDeselected:$,nodeSelected:R,deselectAllNodes:B}}function sa(){function e(){return ee().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,p;const{canvasNames:s}=Z();if(!s.has(o)&&!n.includes(o))return o;const i=e().find(g=>o.startsWith(g));if(i){let g="",b=1;const m=o.split(i).pop(),P=m==null?void 0:m[m.length-1];for(P&&Number.isInteger(Number(P))&&(b=parseInt(P,10),o=o.slice(0,-1)),g=o;s.has(g)||n.includes(g);)g=o+b++;return g}if(/^\d+-?\d*$/.test(o)){let g="",b=1;const m=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(m!=null&&m.groups))throw new Error("Failed to find match for unique name");for(((h=m==null?void 0:m.groups)==null?void 0:h.suffix)!==""&&(b=parseInt(m.groups.suffix,10)),g=m.groups.base;s.has(g)||n.includes(g);)g=m.groups.base+"-"+b++;return g}let l="",r=1;const u=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(u!=null&&u.groups))throw new Error("Failed to find match for unique name");for(((p=u==null?void 0:u.groups)==null?void 0:p.suffix)!==""&&(r=parseInt(u.groups.suffix,10)),l=u.groups.base;s.has(l)||n.includes(l);)l=u.groups.base+r++;return l}return{uniqueNodeName:t}}const ia=Y({name:"NodeTitle",components:{NodeIcon:nt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),aa="_container_9bi3m_1",ra="_title_9bi3m_11",la="_hoverable_9bi3m_19",da="_editIcon_9bi3m_22",ua="_iconWrapper_9bi3m_26",ca="_editIconContainer_9bi3m_39",ha="_editButtons_9bi3m_45",pa="_editContainer_9bi3m_53",fa={container:aa,title:ra,hoverable:la,editIcon:da,iconWrapper:ua,editIconContainer:ca,editButtons:ha,editContainer:pa};function ga(e,t,o,n,s,a){const i=S("NodeIcon"),l=S("n8n-text"),r=S("n8n-input"),u=S("n8n-button"),h=S("font-awesome-icon"),p=S("n8n-popover");return d(),N("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...g)=>e.onEdit&&e.onEdit(...g))},[f("span",{class:D(e.$style.iconWrapper)},[y(i,{"node-type":e.nodeType,size:18},null,8,["node-type"])],2),y(p,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:v(()=>[f("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[O(w(e.modelValue)+" ",1),f("div",{class:D(e.$style.editIconContainer)},[e.editable?(d(),_(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):E("",!0)],2)],2)]),default:v(()=>[f("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=nn((...g)=>e.onRename&&e.onRename(...g),["enter"])),t[3]||(t[3]=re(()=>{},["stop"])),t[4]||(t[4]=nn(g=>e.editName=!1,["esc"]))]},[y(l,{bold:!0,color:"text-base",tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),y(r,{ref:"input",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=g=>e.newName=g),size:"small","data-test-id":"node-rename-input"},null,8,["modelValue"]),f("div",{class:D(e.$style.editButtons)},[y(u,{type:"secondary",size:"small",label:e.$locale.baseText("ndv.title.cancel"),onClick:t[1]||(t[1]=g=>e.editName=!1)},null,8,["label"]),y(u,{type:"primary",size:"small",label:e.$locale.baseText("ndv.title.rename"),onClick:e.onRename},null,8,["label","onClick"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const ma={$style:fa},ya=G(ia,[["render",ga],["__cssModules",ma]]),wa=Y({name:"NodeSettingsTabs",props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},setup(){return{externalHooks:We()}},computed:{...le(oe,Z),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,s,a,i;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(i=(a=(s=(n=e.codex)==null?void 0:n.resources)==null?void 0:s.primaryDocumentation)==null?void 0:a[0])==null?void 0:i.url;return o?o+t:this.isCommunityNode?`${Kn}${e.name.split(".")[0]}`:Yn+t},isCommunityNode(){const e=this.nodeType;return e?vn(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:Nn,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.externalHooks.run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function va(e,t,o,n,s,a){const i=S("n8n-tabs");return d(),_(i,{options:e.options,"model-value":e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","model-value","onUpdate:modelValue","onTooltipClick"])}const Na=G(wa,[["render",va]]),ka=Y({name:"NodeWebhooks",props:["node","nodeType"],setup(){const e=st(),t=Qt(),o=Dt({router:e});return{clipboard:t,workflowHelpers:o,...tt()}},data(){return{isMinimized:this.nodeType&&!co.includes(this.nodeType.name),showUrlFor:"test"}},computed:{isProductionOnly(){return this.nodeType&&qn.includes(this.nodeType.name)},urlOptions(){return[...this.isProductionOnly?[]:[{label:this.baseText.testUrl,value:"test"}],{label:this.baseText.productionUrl,value:"production"}]},visibleWebhookUrls(){return this.webhooksNode.filter(e=>typeof e.ndvHideUrl=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideUrl"):!e.ndvHideUrl)},webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Ze:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.chatTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.chatTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.chatTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.chatTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.chatTrigger")};case Me:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},watch:{node(){this.isMinimized=!co.includes(this.nodeType.name)}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.clipboard.copy(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.workflowHelpers.getWebhookUrl(e,this.node,this.isProductionOnly?"production":this.showUrlFor):""},isWebhookMethodVisible(e){return typeof e.ndvHideMethod=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideMethod"):!e.ndvHideMethod}}}),no=e=>(An("data-v-df24ab0e"),e=e(),Mn(),e),ba={key:0,class:"webhooks"},Ta=["title"],Sa={key:0,class:"node-webhooks"},Da={key:0,class:"url-selection"},Ea={key:0,class:"webhook-wrapper"},Ca={class:"http-field"},Ia={class:"http-method"},Pa=no(()=>f("br",null,null,-1)),_a={class:"url-field"},Oa=["onClick"],$a=no(()=>f("br",null,null,-1)),Ra={key:1,class:"webhook-wrapper"},Aa={class:"url-field-full-width"},Ma=["onClick"],Wa=no(()=>f("br",null,null,-1));function Va(e,t,o,n,s,a){const i=S("font-awesome-icon"),l=S("n8n-radio-buttons"),r=S("el-col"),u=S("el-row"),h=S("n8n-tooltip"),p=S("el-collapse-transition");return e.webhooksNode.length&&e.visibleWebhookUrls.length>0?(d(),N("div",ba,[f("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide,onClick:t[0]||(t[0]=g=>e.isMinimized=!e.isMinimized)},[y(i,{icon:"angle-right",class:"minimize-button minimize-icon"}),O(" "+w(e.baseText.toggleTitle),1)],10,Ta),y(p,null,{default:v(()=>[e.isMinimized?E("",!0):(d(),N("div",Sa,[e.isProductionOnly?E("",!0):(d(),N("div",Da,[y(u,null,{default:v(()=>[y(r,{span:24},{default:v(()=>[y(l,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=g=>e.showUrlFor=g),options:e.urlOptions},null,8,["modelValue","options"])]),_:1})]),_:1})])),(d(!0),N(te,null,ue(e.visibleWebhookUrls,(g,b)=>(d(),_(h,{key:b,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:v(()=>[e.isWebhookMethodVisible(g)?(d(),N("div",Ea,[f("div",Ca,[f("div",Ia,[O(w(e.workflowHelpers.getWebhookExpressionValue(g,"httpMethod")),1),Pa])]),f("div",_a,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[O(w(e.getWebhookUrlDisplay(g)),1),$a],8,Oa)])])):(d(),N("div",Ra,[f("div",Aa,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[O(w(e.getWebhookUrlDisplay(g)),1),Wa],8,Ma)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):E("",!0)}const Ba=G(ka,[["render",Va],["__scopeId","data-v-df24ab0e"]]),Ua=["data-test-id"],xa=["textContent"],La=["onClick"],Ha=["onClick"],Fa=["data-node-name"],za=["onClick"],ja=Y({__name:"NDVSubConnections",props:{rootNode:{}},emits:["switchSelectedNode","openConnectionNodeCreator"],setup(e,{expose:t,emit:o}){const n=e,s=Z(),a=ee(),i=Ve(),{debounce:l}=bt(),r=o,u=j([]),h=j([]),p=j(!1),g=q(()=>a.getNodeType(n.rootNode.type,n.rootNode.typeVersion)),b=q(()=>s.getNodeByName(n.rootNode.name)),m=q(()=>s.getCurrentWorkflow()),P=q(()=>{const W=i.getNodeIssues(g.value,n.rootNode,m.value,["typeUnknown","parameters","credentials","execution"]);return(W==null?void 0:W.input)??{}}),c=q(()=>u.value.reduce((W,K)=>{const C=B(m.value.getParentNodes(n.rootNode.name,K.type));return{...W,[K.type]:C}},{}));function T(W){return u.value.find(K=>K.type===W)}function k(W){const K=T(W);return(K==null?void 0:K.maxConnections)!==1}function $(W){return k(W)&&!h.value.includes(W)}function R(W,K){k(W)&&(K?h.value=[...h.value,W]:h.value=h.value.filter(C=>C!==W))}function B(W){return W.map(K=>{const C=s.getNodeByName(K);if(C){const U=a.getNodeType(C.type);if(U){const F=i.getNodeIssues(U,C,m.value),I=F?kn(F,C):"";return{node:C,nodeType:U,issues:I}}}return null}).filter(K=>K!==null)}function z(W){return p.value&&(P.value[W]??[]).length>0}function A(W){return typeof W=="string"?!1:"type"in W}function V(){return!g.value||!n.rootNode?[]:me(m.value,n.rootNode,g.value).filter(C=>A(C)?C.type!=="main":!1)}function L(W,K){if(k(K)&&!h.value.includes(K)){R(K,!0);return}r("switchSelectedNode",W)}function ne(W){const K=c.value[W];if(k(W)&&!h.value.includes(W)&&K.length>=1){R(W,!0);return}r("openConnectionNodeCreator",n.rootNode.name,W)}function ye(){p.value=!1,setTimeout(()=>{p.value=!0},0)}return to(b,l(()=>setTimeout(()=>{h.value=[],u.value=V()},0),{debounceTime:1e3}),{immediate:!0}),t({showNodeInputsIssues:ye}),(W,K)=>{const C=S("n8n-icon-button"),U=S("n8n-tooltip"),F=Et("on-click-outside");return d(),N("div",{class:D(W.$style.container)},[f("div",{class:D(W.$style.connections),style:se(`--possible-connections: ${u.value.length}`)},[(d(!0),N(te,null,ue(u.value,I=>(d(),N("div",{key:I.type,"data-test-id":`subnode-connection-group-${I.type}`},[f("div",{class:D(W.$style.connectionType)},[f("span",{class:D({[W.$style.connectionLabel]:!0,[W.$style.hasIssues]:z(I.type)}),textContent:w(`${I.displayName}${I.required?" *":""}`)},null,10,xa),Q((d(),N("div",{class:D({[W.$style.connectedNodesWrapper]:!0,[W.$style.connectedNodesWrapperExpanded]:h.value.includes(I.type)}),style:se(`--nodes-length: ${c.value[I.type].length}`),onClick:H=>R(I.type,!0)},[!(c.value[I.type].length>=1)||I.maxConnections!==1?(d(),N("div",{key:0,class:D({[W.$style.plusButton]:!0,[W.$style.hasIssues]:z(I.type)}),onClick:H=>ne(I.type)},[y(U,{placement:"top",teleported:!0,offset:10,"show-after":300,disabled:$(I.type)&&c.value[I.type].length>=1},{content:v(()=>[O(" Add "+w(I.displayName)+" ",1),z(I.type)?(d(),_(xt,{key:0,title:`${W.$locale.baseText("node.issues")}:`,items:P.value[I.type]},null,8,["title","items"])):E("",!0)]),default:v(()=>[y(C,{size:"medium",icon:"plus",type:"tertiary","data-test-id":`add-subnode-${I.type}`},null,8,["data-test-id"])]),_:2},1032,["disabled"])],10,Ha)):E("",!0),c.value[I.type].length>0?(d(),N("div",{key:1,class:D({[W.$style.connectedNodes]:!0,[W.$style.connectedNodesMultiple]:c.value[I.type].length>1})},[(d(!0),N(te,null,ue(c.value[I.type],(H,X)=>(d(),N("div",{key:H.node.name,class:D({[W.$style.nodeWrapper]:!0,[W.$style.hasIssues]:H.issues}),"data-test-id":"floating-subnode","data-node-name":H.node.name,style:se(`--node-index: ${X}`)},[(d(),_(U,{key:H.node.name,placement:"top",teleported:!0,offset:10,"show-after":300,disabled:$(I.type)},{content:v(()=>[O(w(H.node.name)+" ",1),H.issues?(d(),_(xt,{key:0,title:`${W.$locale.baseText("node.issues")}:`,items:H.issues},null,8,["title","items"])):E("",!0)]),default:v(()=>[f("div",{class:D(W.$style.connectedNode),onClick:ie=>L(H.node.name,I.type)},[y(nt,{"node-type":H.nodeType,"node-name":H.node.name,"tooltip-position":"top",size:20,circle:""},null,8,["node-type","node-name"])],10,za)]),_:2},1032,["disabled"]))],14,Fa))),128))],2)):E("",!0)],14,La)),[[F,()=>R(I.type,!1)]])],2)],8,Ua))),128))],6)],2)}}}),Ka="_container_dier5_18",Ya="_connections_dier5_26",qa="_connectionType_dier5_38",Ga="_connectionLabel_dier5_45",Ja="_hasIssues_dier5_51",Xa="_connectedNodesWrapper_dier5_55",Qa="_plusButton_dier5_63",Za="_connectedNodesWrapperExpanded_dier5_81",er="_connectedNodesMultiple_dier5_87",tr="_connectedNode_dier5_55",or="_connectedNodes_dier5_55",nr="_nodeWrapper_dier5_125",sr={container:Ka,connections:Ya,connectionType:qa,connectionLabel:Ga,hasIssues:Ja,connectedNodesWrapper:Xa,plusButton:Qa,"horizontal-shake":"_horizontal-shake_dier5_1",connectedNodesWrapperExpanded:Za,connectedNodesMultiple:er,connectedNode:tr,connectedNodes:or,nodeWrapper:nr},ir={$style:sr},ar=G(ja,[["__cssModules",ir]]),rr=Y({inheritAttrs:!1,props:{nodeName:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String},hideIcon:{type:Boolean}},setup(e){const t=st(),n=Z().getNodeByName(e.nodeName),s=Ce(n),a=We(),{runWorkflow:i}=In({router:t});return{externalHooks:a,pinnedData:s,runWorkflow:i,...tt(),...Zt()}},computed:{...le(ee,oe,Z,pe),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===et)},isChatNode(){return!!(this.nodeType&&this.nodeType.name===Ze)},isChatChild(){return this.workflowsStore.checkIfNodeHasChatParent(this.nodeName)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Me)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===Re)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isChatNode?this.$locale.baseText("ndv.execute.testChat"):this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.$locale.baseText("ndv.execute.testNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isChatNode||this.isChatChild&&this.ndvStore.isDNVDataEmpty("input"))this.ndvStore.setActiveNodeName(null),de.emit("openChat");else if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.pinnedData.hasData.value&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===He,e&&this.node&&this.pinnedData.unsetData("unpin-and-execute-modal")),!this.pinnedData.hasData.value||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.externalHooks.run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function lr(e,t,o,n,s,a){const i=S("n8n-button"),l=S("n8n-tooltip");return d(),N("div",null,[y(l,{placement:"bottom",disabled:!e.disabledHint},{content:v(()=>[f("div",null,w(e.disabledHint),1)]),default:v(()=>[f("div",null,[y(i,Hi(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:!e.isListeningForEvents&&!e.hideIcon&&"flask","transparent-background":e.transparent,title:e.isTriggerNode?"":e.$locale.baseText("ndv.execute.testNode.description"),onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparent-background","title","onClick"])])]),_:1},8,["disabled"])])}const so=G(rr,[["render",lr]]),dr=Y({name:"NodeSettings",components:{NodeTitle:ya,NodeCredentials:oi,ParameterInputList:ni,NodeSettingsTabs:Na,NodeWebhooks:Ba,NDVSubConnections:ar,NodeExecuteButton:so},setup(){const e=Ve();return{externalHooks:We(),nodeHelpers:e}},computed:{...le(eo,ee,oe,pe,bn,Z,Pn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(ho)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=me(e,t,this.nodeType);if(!we(o).includes(M.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return!((e=this.node)!=null&&e.typeVersion)||this.latestVersion===this.node.typeVersion},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return vn((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:Nn,CUSTOM_NODES_DOCS_URL:Gn,MAIN_NODE_PANEL_WIDTH:Le,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:ho,parameters:""})}catch{}}}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.nodeHelpers.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){var e;this.hiddenIssuesInputs=[],(e=this.$refs.subConnections)==null||e.showNodeInputsIssues(),this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),s=!1;if(n!==void 0&&n.includes("[")){const a=n.match(/(.*)\[(\d+)\]$/);a&&(o.push(a[1]),n=a[2],s=!0)}if(o.length===0)if(t===null){const{[n]:a,...i}=this.nodeValues;this.nodeValues=i}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let a=ke(this.nodeValues,o.join("."));const{[n]:i,...l}=a;if(a=l,s&&a.length===0){n=o.pop(),a=ke(this.nodeValues,o.join("."));const{[n]:r,...u}=a;a=u}}else typeof t=="object"?Ue(ke(this.nodeValues,o.join(".")),n,$e(t)):Ue(ke(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.nodeHelpers.updateNodeCredentialIssues(t),this.externalHooks.run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new _n(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var s;let t;e.hasOwnProperty("value")?t=e.value:t=ke(this.nodeValues,e.name);const o=e.node||((s=this.node)==null?void 0:s.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const a={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",a)}else if(e.name==="parameters"){const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!a)return;let i=Fe(a.properties,n.parameters,!1,!1,n);const l=Object.assign({},i);i=$e(i);for(const r of Object.keys(e.value)){t=e.value[r];const u=r.split(".").slice(1).join("."),h=u.match(/(.*)\[(\d+)\]$/);if(e[r]===void 0&&h!==null){const p=h[1],g=h[2],b=ke(i,p);Array.isArray(b)&&(b.splice(parseInt(g,10),1),Ue(i,p,b))}else t===void 0?Rt(i,u):Ue(i,u,t);this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:u,newValue:t,parameters:this.parameters,oldNodeParameters:l})}i=Fe(a.properties,i,!0,!1,n);for(const r of Object.keys(i))i&&i[r]!==null&&i[r]!==void 0&&this.setValue(`parameters.${r}`,i[r]);if(i){const r={name:n.name,value:i};this.workflowsStore.setNodeParameters(r),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!a)return;let i=Fe(a.properties,n.parameters,!1,!1,n);const l=Object.assign({},i);i=$e(i);const r=e.name.split(".").slice(1).join("."),u=r.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&u!==null){const p=u[1],g=u[2],b=ke(i,p);Array.isArray(b)&&(b.splice(parseInt(g,10),1),Ue(i,p,b))}else t===void 0?Rt(i,r):Ue(i,r,t),this.removeMismatchedOptionValues(a,i,{name:r,value:t});i=Fe(a.properties,i,!0,!1,n);for(const p of Object.keys(i))i&&i[p]!==null&&i[p]!==void 0&&this.setValue(`parameters.${p}`,i[p]);const h={name:n.name,value:i};this.workflowsStore.setNodeParameters(h),this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:r,newValue:t,parameters:this.parameters,oldNodeParameters:l}),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(a.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const a={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(a)}},removeMismatchedOptionValues(e,t,o){e.properties.forEach(n=>{var r,u;const s=n.displayOptions;if(!(t!=null&&t.hasOwnProperty(n.name))||!s||!n.options)return;const a=(r=s.show)==null?void 0:r[o.name],i=(u=s.hide)==null?void 0:u[o.name];if(a===void 0&&i===void 0)return;(!Object.keys(t).every(h=>(n.options??[]).find(p=>p.name===h)!==void 0)||a!==o.value||i===o.value)&&Rt(t,n.name)})},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:$e(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}}}),ur="_header_1pn0y_1",cr="_warningIcon_1pn0y_5",hr="_descriptionContainer_1pn0y_10",pr={header:ur,warningIcon:cr,descriptionContainer:hr},fr={class:"header-side-menu"},gr={key:1},mr={key:0,class:"node-is-not-valid"},yr={class:"missingNodeTitleContainer mt-s mb-xs"},wr={class:"mb-l"},vr=["href"],Nr=["href","textContent"],kr={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},br={key:1,class:"no-parameters"},Tr={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},Sr={class:"node-version","data-test-id":"node-version"};function Dr(e,t,o,n,s,a){var $;const i=S("NodeTitle"),l=S("NodeExecuteButton"),r=S("NodeSettingsTabs"),u=S("font-awesome-icon"),h=S("n8n-text"),p=S("i18n-t"),g=S("n8n-link"),b=S("n8n-notice"),m=S("NodeWebhooks"),P=S("NodeCredentials"),c=S("ParameterInputList"),T=S("NDVSubConnections"),k=S("n8n-block-ui");return d(),N("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=re(()=>{},["stop"]))},[f("div",{class:D(e.$style.header)},[f("div",fr,[e.node?(d(),_(i,{key:0,class:"node-name","model-value":e.node.name,"node-type":e.nodeType,"read-only":e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["model-value","node-type","read-only","onUpdate:modelValue"])):E("",!0),e.isExecutable?(d(),N("div",gr,[!e.blockUI&&e.node&&e.nodeValid?(d(),_(l,{key:0,"data-test-id":"node-execute-button","node-name":e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small","telemetry-source":"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["node-name","disabled","onExecute","onStopExecution"])):E("",!0)])):E("",!0)]),e.node&&e.nodeValid?(d(),_(r,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=R=>e.openPanel=R),"node-type":e.nodeType,"session-id":e.sessionId},null,8,["modelValue","node-type","session-id"])):E("",!0)],2),e.node&&!e.nodeValid?(d(),N("div",mr,[f("p",{class:D(e.$style.warningIcon)},[y(u,{icon:"exclamation-triangle"})],2),f("div",yr,[y(h,{size:"large",color:"text-dark",bold:""},{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(d(),N("div",{key:0,class:D(e.$style.descriptionContainer)},[f("div",wr,[y(p,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:v(()=>[f("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},w(e.node.type.split(".")[0]),9,vr)]),_:1},8,["onClick"])]),y(g,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(d(),_(p,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:v(()=>[f("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:w(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,Nr)]),_:1}))])):E("",!0),e.node&&e.nodeValid?(d(),N("div",kr,[e.hasForeignCredential?(d(),_(b,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):E("",!0),Q(f("div",null,[y(m,{node:e.node,"node-type":e.nodeType},null,8,["node","node-type"]),e.nodeValuesInitialized?(d(),_(c,{key:0,parameters:e.parametersNoneSetting,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:v(()=>[y(P,{node:e.node,readonly:e.isReadOnly,"show-all":!0,"hide-issues":e.hiddenIssuesInputs.includes("credentials"),onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur},null,8,["node","readonly","hide-issues","onCredentialSelected","onValueChanged","onBlur"])]),_:1},8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onActivate","onParameterBlur"])):E("",!0),e.parametersNoneSetting.length===0?(d(),N("div",br,[y(h,null,{default:v(()=>[O(w(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):E("",!0),e.nodeHelpers.isCustomApiCallSelected(e.nodeValues)?(d(),N("div",Tr,[y(b,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):E("",!0)],512),[[ae,e.openPanel==="params"]]),Q(f("div",null,[y(c,{parameters:e.parametersSetting,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),y(c,{parameters:e.nodeSettings,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),f("div",Sr,[O(w(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:($=e.nodeType)==null?void 0:$.displayName,version:(e.node.typeVersion??e.latestVersion).toString()}}))+" ",1),f("span",null,"("+w(e.nodeVersionTag)+")",1)])],512),[[ae,e.openPanel==="settings"]])])):E("",!0),e.node?(d(),_(T,{key:2,ref:"subConnections","root-node":e.node,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["root-node","onSwitchSelectedNode","onOpenConnectionNodeCreator"])):E("",!0),y(k,{show:e.blockUI},null,8,["show"])],34)}const Er={$style:pr},Cr=G(dr,[["render",Dr],["__cssModules",Er],["__scopeId","data-v-b094ac2b"]]),Ir=Y({name:"Draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...le(oe),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,s;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((s=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:s.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){var t;if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const o=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:o||"",dimensions:((t=this.draggingEl)==null?void 0:t.getBoundingClientRect())??null}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),Pr="_dragging_176yl_1",_r="_draggable_176yl_6",Or={dragging:Pr,draggable:_r,"draggable-data-transfer":"_draggable-data-transfer_176yl_13"};function $r(e,t,o,n,s,a){return d(),_(Vn(e.tag),{ref:"wrapper",class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart},{default:v(()=>[he(e.$slots,"default",{isDragging:e.isDragging}),(d(),_(Wn,{to:"body"},[Q(f("div",{ref:"draggable",class:D(e.$style.draggable),style:se(e.draggableStyle)},[he(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[ae,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Rr={$style:Or},Ar=G(Ir,[["render",$r],["__cssModules",Rr]]),Mr=Y({components:{Draggable:Ar},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),Wr="_dragContainer_1fum9_1",Vr="_dragButton_1fum9_5",Br="_leftArrow_1fum9_19 _arrow_1fum9_28",Ur="_rightArrow_1fum9_20 _arrow_1fum9_28",xr="_visible_1fum9_24",Lr="_arrow_1fum9_28",Hr="_grid_1fum9_46",Fr={dragContainer:Wr,dragButton:Vr,leftArrow:Br,rightArrow:Ur,visible:xr,arrow:Lr,grid:Hr},zr=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),jr=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Kr=[zr,jr];function Yr(e,t,o,n,s,a){const i=S("font-awesome-icon"),l=S("Draggable");return d(),_(l,{type:"panel-resize",class:D(e.$style.dragContainer),onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd},{default:v(({isDragging:r})=>[f("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(d(),N("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:r})},[y(i,{icon:"arrow-left"})],2)):E("",!0),e.canMoveRight?(d(),N("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:r})},[y(i,{icon:"arrow-right"})],2)):E("",!0),f("div",{class:D(e.$style.grid)},Kr,2)],2)]),_:1},8,["class","onDrag","onDragstart","onDragend"])}const qr={$style:Fr},Gr=G(Mr,[["render",Yr],["__cssModules",qr]]),Jr=["data-node-name","data-node-placement","onClick"],Xr=Y({__name:"NDVFloatingNodes",props:{rootNode:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,s=Z(),a=ee(),i=s.getCurrentWorkflow(),l=o;function r(m){const P=p.value[m][0];P&&l("switchSelectedNode",P.node.name)}function u(m){if(m.shiftKey&&m.altKey&&(m.ctrlKey||m.metaKey)){const c={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowLeft:"inputMain"}[m.key]||null;c&&r(c)}}function h(m){return m.map(P=>{const c=s.getNodeByName(P);if(c){const T=a.getNodeType(c.type);if(T)return{node:c,nodeType:T}}return null}).filter(P=>P!==null)}const p=q(()=>{const m=n.rootNode.name;return{outputSub:h(i.getChildNodes(m,"ALL_NON_MAIN")),outputMain:h(i.getChildNodes(m,"main",1)),inputMain:h(i.getParentNodes(m,"main",1))}}),g=["outputSub","outputMain","inputMain"],b={outputSub:"bottom",outputMain:"left",inputMain:"right"};return Rn(()=>{document.addEventListener("keydown",u,!0)}),Fi(()=>{document.removeEventListener("keydown",u,!0)}),t({moveNodeDirection:r}),(m,P)=>{const c=S("n8n-tooltip");return d(),N("aside",{class:D(m.$style.floatingNodes)},[(d(),N(te,null,ue(g,T=>f("ul",{key:T,class:D([m.$style.nodesList,m.$style[T]])},[(d(!0),N(te,null,ue(p.value[T],({node:k,nodeType:$})=>(d(),N(te,null,[k&&$?(d(),_(c,{key:k.name,placement:b[T],teleported:!1,offset:60},{content:v(()=>[O(w(k.name),1)]),default:v(()=>[f("li",{class:D(m.$style.connectedNode),"data-test-id":"floating-node","data-node-name":k.name,"data-node-placement":T,onClick:R=>m.$emit("switchSelectedNode",k.name)},[y(nt,{"node-type":$,"node-name":k.name,"tooltip-position":b[T],size:35,circle:""},null,8,["node-type","node-name","tooltip-position"])],10,Jr)]),_:2},1032,["placement"])):E("",!0)],64))),256))],2)),64))],2)}}}),Qr="_floatingNodes_1c7jr_1",Zr="_nodesList_1c7jr_15",el="_inputSub_1c7jr_29",tl="_outputSub_1c7jr_29",ol="_outputMain_1c7jr_40",nl="_inputMain_1c7jr_40",sl="_connectedNode_1c7jr_63",il={floatingNodes:Qr,nodesList:Zr,inputSub:el,outputSub:tl,outputMain:ol,inputMain:nl,connectedNode:sl},al={$style:il},rl=G(Xr,[["__cssModules",al]]),Oe=24,hn=80,xe=280,ll=320,dl=420,ul={regular:Le,dragless:Le,unknown:Le,inputless:Le,wide:Le*2},cl=Y({name:"NDVDraggablePanels",components:{PanelDragButton:Gr,NDVFloatingNodes:rl},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},setup(){const{callDebounced:e}=bt();return{callDebounced:e}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:xe,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),wt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),wt.off("setPositionByName",this.setPositionByName)},computed:{...le(oe),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":ke(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(hn)},minWindowWidth(){return 2*(Oe+hn)+xe},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth(Oe+20)+this.inputPanelMargin:this.pxToRelativeWidth(Oe)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth(Oe+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth(Oe),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(xe+Oe),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return ke(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?dl*e:ll*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(xe);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(xe);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth(Oe+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(ul[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,s=this.minimumLeftPosition>t,a=this.currentNodePaneType==="inputless";if(s){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:a?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced(this.onResize,{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),s=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=xe||(this.setMainPanelWidth(s),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=Ae(`${po}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){Ae(`${po}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),hl="_dataPanel_a6j4o_1",pl="_inputPanel_a6j4o_10 _dataPanel_a6j4o_1",fl="_outputPanel_a6j4o_18 _dataPanel_a6j4o_1",gl="_mainPanel_a6j4o_26",ml="_draggable_a6j4o_30",yl="_mainPanelInner_a6j4o_34",wl="_dragging_a6j4o_41",vl="_dragButtonContainer_a6j4o_54",Nl="_visible_a6j4o_70",kl={dataPanel:hl,inputPanel:pl,outputPanel:fl,mainPanel:gl,draggable:ml,mainPanelInner:yl,dragging:wl,"double-width":"_double-width_a6j4o_50",dragButtonContainer:vl,visible:Nl};function bl(e,t,o,n,s,a){const i=S("NDVFloatingNodes"),l=S("PanelDragButton"),r=S("n8n-resize-wrapper");return d(),N("div",null,[e.activeNode?(d(),_(i,{key:0,"root-node":e.activeNode,onSwitchSelectedNode:e.onSwitchSelectedNode},null,8,["root-node","onSwitchSelectedNode"])):E("",!0),e.hideInputAndOutput?E("",!0):(d(),N("div",{key:1,class:D(e.$style.inputPanel),style:se(e.inputPanelStyles)},[he(e.$slots,"input")],6)),e.hideInputAndOutput?E("",!0):(d(),N("div",{key:2,class:D(e.$style.outputPanel),style:se(e.outputPanelStyles)},[he(e.$slots,"output")],6)),f("div",{class:D(e.$style.mainPanel),style:se(e.mainPanelStyles)},[y(r,{"is-resizing-enabled":e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),"min-width":e.MIN_PANEL_WIDTH,"grid-size":20,"supported-directions":e.supportedResizeDirections,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd},{default:v(()=>[f("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(d(),_(l,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),"can-move-left":e.canMoveLeft,"can-move-right":e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","can-move-left","can-move-right","onDragstart","onDrag","onDragend"])):E("",!0)],2),f("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[he(e.$slots,"main")],2)]),_:3},8,["is-resizing-enabled","width","min-width","supported-directions","onResize","onResizestart","onResizeend"])],6)])}const Tl={$style:kl},Sl=G(cl,[["render",bl],["__cssModules",Tl]]),Dl={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...fo.defaults.allowedTags,"style","img","title"],allowedAttributes:{...fo.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},El={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return Jn(this.inputHtml,Dl)}}},Cl=["srcdoc"];function Il(e,t,o,n,s,a){return d(),N("iframe",{class:"__html-display",srcdoc:a.sanitizedHtml},null,8,Cl)}const Un=G(El,[["render",Il]]),Pl=Object.freeze(Object.defineProperty({__proto__:null,default:Un},Symbol.toStringTag,{value:"Module"})),_l=Y({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Ji,RunDataHtml:Un},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...le(Z)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:s}=this.binaryData,a=n==="json",i=n==="html";if(!e)a||i?this.data=zt(atob(t)):this.embedSource="data:"+s+";base64,"+t;else try{const l=this.workflowsStore.getBinaryUrl(e,"view",o,s);if(a||i){const r=await fetch(l,{credentials:"include"});this.data=await(a?r.json():r.text())}else this.embedSource=l}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),Ol={key:0},$l={key:1},Rl={key:2},Al={key:0,controls:"",autoplay:""},Ml=["src","type"],Wl={key:1,controls:"",autoplay:""},Vl=["src","type"],Bl=["src"];function Ul(e,t,o,n,s,a){const i=S("VueJsonPretty"),l=S("RunDataHtml");return d(),N("span",null,[e.isLoading?(d(),N("div",Ol,"Loading binary data...")):e.error?(d(),N("div",$l,"Error loading binary data")):(d(),N("span",Rl,[e.binaryData.fileType==="video"?(d(),N("video",Al,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Ml),O(" "+w(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(d(),N("audio",Wl,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Vl),O(" "+w(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(d(),_(i,{key:2,data:e.data,deep:3,"show-length":!0},null,8,["data"])):e.binaryData.fileType==="html"?(d(),_(l,{key:3,"input-html":e.data},null,8,["input-html"])):(d(),N("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Bl))]))])}const xl=G(_l,[["render",Ul]]),Ll=Y({name:"BinaryDataDisplay",components:{BinaryDataDisplayEmbed:xl},props:["displayData","windowVisible"],setup(){return{nodeHelpers:Ve()}},computed:{...le(Z),binaryData(){const e=this.nodeHelpers.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Hl={class:"binary-data-window-wrapper"},Fl={key:0};function zl(e,t,o,n,s,a){var r;const i=S("n8n-button"),l=S("BinaryDataDisplayEmbed");return e.windowVisible?(d(),N("div",{key:0,class:D(["binary-data-window",(r=e.binaryData)==null?void 0:r.fileType])},[y(i,{size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList"),onClick:re(e.closeWindow,["stop"])},null,8,["title","label","onClick"]),f("div",Hl,[e.binaryData?(d(),_(l,{key:1,"binary-data":e.binaryData},null,8,["binary-data"])):(d(),N("div",Fl,w(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):E("",!0)}const jl=G(Ll,[["render",zl]]),Kl={class:"feedback"},Yl=Y({__name:"Feedback",props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,n=Te();function s(a){o("update:modelValue",a)}return(a,i)=>{const l=S("N8nText"),r=S("FontAwesomeIcon"),u=S("N8nTooltip");return d(),N("div",Kl,[e.modelValue?(d(),_(l,{key:1,color:e.modelValue==="positive"?"success":"danger"},{default:v(()=>[y(r,{icon:e.modelValue==="positive"?"thumbs-up":"thumbs-down",class:"mr-2xs"},null,8,["icon"]),O(" "+w(x(n).baseText(`feedback.${e.modelValue}`)),1)]),_:1},8,["color"])):(d(),_(l,{key:0,class:"mr-2xs"},{default:v(()=>[O(w(x(n).baseText("feedback.title")),1)]),_:1})),e.modelValue?E("",!0):(d(),_(u,{key:2,content:x(n).baseText("feedback.positive")},{default:v(()=>[f("span",{class:"feedback-button","data-test-id":"feedback-button-positive",onClick:i[0]||(i[0]=h=>s("positive"))},[y(r,{icon:"thumbs-up"})])]),_:1},8,["content"])),e.modelValue?E("",!0):(d(),_(u,{key:3,content:x(n).baseText("feedback.negative")},{default:v(()=>[f("span",{class:"feedback-button","data-test-id":"feedback-button-negative",onClick:i[1]||(i[1]=h=>s("negative"))},[y(r,{icon:"thumbs-down"})])]),_:1},8,["content"]))])}}}),ql=St("ai",()=>{const e=Tt(),t=jt(),o=q(()=>t.settings.ai.errorDebugging);async function n(s){return await si(e.getRestApiContext,s)}return{isErrorDebuggingEnabled:o,debugError:n}}),Gl={class:"node-error-view"},Jl={class:"node-error-view__header"},Xl={class:"node-error-view__header-message"},Ql=["innerHTML"],Zl={key:0},ed={key:2,class:"node-error-view__feedback-toolbar"},td={class:"node-error-view__info"},od={class:"node-error-view__info-header"},nd={class:"node-error-view__info-title"},sd={class:"copy-button"},id={class:"node-error-view__info-content"},ad={key:0,class:"node-error-view__details"},rd={class:"node-error-view__details-summary"},ld={class:"node-error-view__details-content"},dd={key:0,class:"node-error-view__details-row"},ud={class:"node-error-view__details-label"},cd={class:"node-error-view__details-value"},hd={key:1,class:"node-error-view__details-row"},pd={class:"node-error-view__details-label"},fd={class:"node-error-view__details-value"},gd={key:2,class:"node-error-view__details-row"},md={class:"node-error-view__details-label"},yd={class:"node-error-view__details-value"},wd={key:3,class:"node-error-view__details-row"},vd={class:"node-error-view__details-label"},Nd={class:"node-error-view__details-value"},kd={key:4,class:"node-error-view__details-row"},bd={class:"node-error-view__details-label"},Td={class:"node-error-view__details-value"},Sd={class:"node-error-view__details"},Dd={class:"node-error-view__details-summary"},Ed={class:"node-error-view__details-content"},Cd={key:0,class:"node-error-view__details-row"},Id={class:"node-error-view__details-label"},Pd={class:"node-error-view__details-value"},_d={key:1,class:"node-error-view__details-row"},Od={class:"node-error-view__details-label"},$d={class:"node-error-view__details-value"},Rd={key:2,class:"node-error-view__details-row"},Ad={class:"node-error-view__details-label"},Md={class:"node-error-view__details-value"},Wd={key:3,class:"node-error-view__details-row"},Vd={class:"node-error-view__details-label"},Bd={class:"node-error-view__details-value"},Ud={key:4,class:"node-error-view__details-row"},xd={class:"node-error-view__details-label"},Ld={class:"node-error-view__details-value"},Hd={class:"node-error-view__details-row"},Fd={class:"node-error-view__details-label"},zd={class:"node-error-view__details-value"},jd={key:5,class:"node-error-view__details-row"},Kd={class:"node-error-view__details-label"},Yd={class:"node-error-view__details-value"},qd={key:6,class:"node-error-view__details-row"},Gd={class:"node-error-view__details-label"},Jd={class:"node-error-view__details-value"},Xd={key:7,class:"node-error-view__details-row"},Qd={class:"node-error-view__details-label"},Zd={class:"node-error-view__details-value"},eu={key:8,class:"node-error-view__details-row"},tu={class:"node-error-view__details-label"},ou={class:"node-error-view__details-value"},nu=Y({__name:"NodeErrorView",props:{error:{type:Object,required:!0}},setup(e){const t=e,o=Qt(),n=tt(),s=Te(),a=Xn(),i=ee(),l=oe(),r=Tt(),u=ql(),h=j(!1),p=j(""),g=j(),b=q(()=>u.isErrorDebuggingEnabled),m=q(()=>b.value&&!(h.value||p.value)),P=q(()=>JSON.stringify(t.error.cause).length<Tn),c=q(()=>{const C=l.activeNode;if(!C)return[];const U=i.getNodeType(C.type,C.typeVersion);return U===null?[]:U.properties}),T=q(()=>{const C=r.urlBaseEditor;let U="Self Hosted";return C.includes("n8n.cloud")&&(U="Cloud"),r.versionCli+` (${U})`}),k=q(()=>{var F,I;const C=(F=t.error)==null?void 0:F.node;if(!C)return"Node";const U=i.getNodeType(C.type,C.typeVersion);return((I=U==null?void 0:U.defaults)==null?void 0:I.name)||C.name}),$=q(()=>{var F;const C=[];if(!((F=t.error.messages)!=null&&F.length))return[];const U=L();return Array.from(new Set(t.error.messages)).forEach(I=>{const X=/^\d{3} - \{/.test(I)?I.split(" - ").map(ie=>ie.trim()):[];for(const ie of X)try{const ve=JSON.parse(ie);if(typeof ve=="object"){C.push(ve);return}}catch{}I!==U&&C.push(I)}),C});async function R(){try{h.value=!0;const{message:C}=await u.debugError({error:t.error});p.value=C}catch(C){n.showError(C,s.baseText("generic.error"))}finally{h.value=!1}}async function B(){var C;p.value="",g.value=void 0,await R(),a.track("User regenerated error debugging AI hint",{node_type:(C=t.error.node)==null?void 0:C.type,error_title:t.error.message})}async function z(C){var U;a.track("User responded error debugging AI hint",{helpful:C==="positive",node_type:(U=t.error.node)==null?void 0:U.type,error_title:t.error.message})}function A(C){if(!C||"hidden"in C&&C.hidden)return s.baseText("nodeSettings.deprecated");const U=Math.max(...i.getNodeVersions(C.type));return U===C.typeVersion?s.baseText("nodeSettings.latest"):s.baseText("nodeSettings.latestVersion",{interpolate:{version:U.toString()}})}function V(){var F,I;if(t.error.name==="NodeOperationError"&&t.error.functionality==="configuration-node")return rt(t.error.description+s.baseText("pushConnection.executionError.openNode",{interpolate:{node:t.error.node.name}}));if((F=t.error.context)!=null&&F.descriptionKey){const H={nodeCause:t.error.context.nodeCause,runIndex:t.error.context.runIndex??"0",itemIndex:t.error.context.itemIndex??"0"};return rt(s.baseText(`nodeErrorView.description.${t.error.context.descriptionKey}`,{interpolate:H}))}if(!((I=t.error.context)!=null&&I.descriptionTemplate))return rt(t.error.description??"");const U=ne(t.error.context.parameter);return rt(t.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,U))}function L(){var I;const C="";if(t.error.name==="NodeOperationError"&&t.error.functionality==="configuration-node")return s.baseText("nodeErrorView.errorSubNode",{interpolate:{node:t.error.node.name}});if(t.error.message===t.error.description)return C;if(!((I=t.error.context)!=null&&I.messageTemplate))return C+t.error.message;const F=ne(t.error.context.parameter);return C+t.error.context.messageTemplate.replace(/%%PARAMETER%%/g,F)}function ne(C,U=!0){try{const F=ye(c.value,C.split("."));if(!F.length)throw new Error;return U?F.map(I=>I.displayName).join(" > "):F.pop().displayName}catch{return`Could not find parameter "${C}"`}}function ye(C,U){let F=U.shift();if(F===void 0)return[];const I=F.match(/(.*)\[([\d])\]$/);I!==null&&I.length>0&&(F=I[1]);const H=C.find(X=>X.name===F);if(H===void 0)throw new Error(`Could not find parameter "${F}"`);return U.length===0?[H]:H.hasOwnProperty("options")?[H,...ye(H.options,U)]:H.hasOwnProperty("values")?[H,...ye(H.values,U)]:[H]}function W(){var H,X,ie,ve,at,je;const C=t.error,U={errorMessage:L()};C.description&&(U.errorDescription=C.description);const F={};(H=C==null?void 0:C.messages)!=null&&H.length&&(F.rawErrorMessage=C.messages),"httpCode"in C&&C.httpCode&&(F.httpCode=C.httpCode),C.context&&C.context.data&&(F.errorData=C.context.data),C.extra&&(F.errorExtra=C.extra),U.errorDetails=F;const I={};C.node&&(I.nodeName=C.node.name,I.nodeType=C.node.type,I.nodeVersion=C.node.typeVersion,(ie=(X=C.node)==null?void 0:X.parameters)!=null&&ie.resource&&(I.resource=C.node.parameters.resource),(at=(ve=C==null?void 0:C.node)==null?void 0:ve.parameters)!=null&&at.operation&&(I.operation=C.node.parameters.operation)),C.context&&(C.context.itemIndex!==void 0&&(I.itemIndex=C.context.itemIndex),C.context.runIndex!==void 0&&(I.runIndex=C.context.runIndex),C.context.parameter!==void 0&&(I.parameter=C.context.parameter),C.context.causeDetailed&&(I.causeDetailed=C.context.causeDetailed)),C.timestamp&&(I.time=new Date(C.timestamp).toLocaleString()),I.n8nVersion=T.value,I.binaryDataMode=r.binaryDataMode,C.cause&&(I.cause=C.cause),I.stackTrace=(je=C.stack)==null?void 0:je.split(`
8
+ `),U.n8nDetails=I,o.copy(JSON.stringify(U,null,2)),K()}function K(){n.showMessage({title:s.baseText("nodeErrorView.showMessage.title"),type:"info"})}return(C,U)=>{var io,ao,ro,lo,uo;const F=S("N8nButton"),I=S("N8nSpinner"),H=S("FontAwesomeIcon"),X=S("N8nTooltip"),ie=S("N8nCard"),ve=S("n8n-icon-button"),at=S("n8n-tooltip"),je=S("font-awesome-icon");return d(),N("div",Gl,[f("div",Jl,[f("div",Xl,[f("div",{class:D(m.value?"mt-4xs":"")},w(L()),3),m.value?(d(),_(F,{key:0,type:"tertiary",size:"small",onClick:R},{default:v(()=>[O(w(x(s).baseText("nodeErrorView.debugError.button")),1)]),_:1})):E("",!0)]),e.error.description||(io=e.error.context)!=null&&io.descriptionKey?(d(),N("div",{key:0,class:"node-error-view__header-description",innerHTML:V()},null,8,Ql)):E("",!0)]),h.value||p.value?(d(),_(ie,{key:0,class:"node-error-view__debugging mb-s"},{default:v(()=>[h.value?(d(),N("span",Zl,[y(I,{class:"mr-3xs"}),O(" "+w(x(s).baseText("nodeErrorView.debugError.loading")),1)])):(d(),_(x(Xi),{key:1,source:p.value},null,8,["source"])),p.value?(d(),N("div",ed,[y(Yl,{modelValue:g.value,"onUpdate:modelValue":[U[0]||(U[0]=Ct=>g.value=Ct),z]},null,8,["modelValue"]),y(X,{content:x(s).baseText("nodeErrorView.debugError.feedback.reload")},{default:v(()=>[f("span",{class:"node-error-view__feedback-button",onClick:B},[y(H,{icon:"sync-alt"})])]),_:1},8,["content"])])):E("",!0)]),_:1})):E("",!0),f("div",td,[f("div",od,[f("p",nd,w(x(s).baseText("nodeErrorView.details.title")),1),y(at,{class:"item",content:x(s).baseText("nodeErrorView.copyToClipboard.tooltip"),placement:"left"},{default:v(()=>[f("div",sd,[y(ve,{icon:"copy",type:"secondary",size:"mini",text:"true","transparent-background":"transparent",onClick:W})])]),_:1},8,["content"])]),f("div",id,["httpCode"in e.error&&e.error.httpCode||$.value.length||(ro=(ao=e.error)==null?void 0:ao.context)!=null&&ro.data||e.error.extra?(d(),N("details",ad,[f("summary",rd,[y(je,{class:"node-error-view__details-icon",icon:"angle-right"}),O(" "+w(x(s).baseText("nodeErrorView.details.from",{interpolate:{node:`${k.value}`}})),1)]),f("div",ld,["httpCode"in e.error&&e.error.httpCode?(d(),N("div",dd,[f("p",ud,w(x(s).baseText("nodeErrorView.errorCode")),1),f("p",cd,[f("code",null,w(e.error.httpCode),1)])])):E("",!0),$.value.length?(d(),N("div",hd,[f("p",pd,w(x(s).baseText("nodeErrorView.details.rawMessages")),1),f("div",fd,[(d(!0),N(te,null,ue($.value,(Ct,zn)=>(d(),N("div",{key:zn},[f("pre",null,[f("code",null,w(Ct),1)])]))),128))])])):E("",!0),(uo=(lo=e.error)==null?void 0:lo.context)!=null&&uo.data?(d(),N("div",gd,[f("p",md,w(x(s).baseText("nodeErrorView.details.errorData")),1),f("div",yd,[f("pre",null,[f("code",null,w(e.error.context.data),1)])])])):E("",!0),e.error.extra?(d(),N("div",wd,[f("p",vd,w(x(s).baseText("nodeErrorView.details.errorExtra")),1),f("div",Nd,[f("pre",null,[f("code",null,w(e.error.extra),1)])])])):E("",!0),e.error.context&&e.error.context.request?(d(),N("div",kd,[f("p",bd,w(x(s).baseText("nodeErrorView.details.request")),1),f("div",Td,[f("pre",null,[f("code",null,w(e.error.context.request),1)])])])):E("",!0)])])):E("",!0),f("details",Sd,[f("summary",Dd,[y(je,{class:"node-error-view__details-icon",icon:"angle-right"}),O(" "+w(x(s).baseText("nodeErrorView.details.info")),1)]),f("div",Ed,[e.error.context&&e.error.context.itemIndex!==void 0?(d(),N("div",Cd,[f("p",Id,w(x(s).baseText("nodeErrorView.itemIndex")),1),f("p",Pd,[f("code",null,w(e.error.context.itemIndex),1)])])):E("",!0),e.error.context&&e.error.context.runIndex!==void 0?(d(),N("div",_d,[f("p",Od,w(x(s).baseText("nodeErrorView.runIndex")),1),f("p",$d,[f("code",null,w(e.error.context.runIndex),1)])])):E("",!0),e.error.context&&e.error.context.parameter!==void 0?(d(),N("div",Rd,[f("p",Ad,w(x(s).baseText("nodeErrorView.inParameter")),1),f("p",Md,[f("code",null,w(ne(`${e.error.context.parameter}`)),1)])])):E("",!0),e.error.node&&e.error.node.type?(d(),N("div",Wd,[f("p",Vd,w(x(s).baseText("nodeErrorView.details.nodeType")),1),f("p",Bd,[f("code",null,w(e.error.node.type),1)])])):E("",!0),e.error.node&&e.error.node.typeVersion?(d(),N("div",Ud,[f("p",xd,w(x(s).baseText("nodeErrorView.details.nodeVersion")),1),f("p",Ld,[f("code",null,[f("span",null,w(e.error.node.typeVersion+" "),1),f("span",null,"("+w(A(e.error.node))+")",1)])])])):E("",!0),f("div",Hd,[f("p",Fd,w(x(s).baseText("nodeErrorView.details.n8nVersion")),1),f("p",zd,[f("code",null,w(T.value),1)])]),e.error.timestamp?(d(),N("div",jd,[f("p",Kd,w(x(s).baseText("nodeErrorView.time")),1),f("p",Yd,[f("code",null,w(new Date(e.error.timestamp).toLocaleString()),1)])])):E("",!0),e.error.cause&&P.value?(d(),N("div",qd,[f("p",Gd,w(x(s).baseText("nodeErrorView.details.errorCause")),1),f("pre",Jd,[f("code",null,w(e.error.cause),1)])])):E("",!0),e.error.context&&e.error.context.causeDetailed?(d(),N("div",Xd,[f("p",Qd,w(x(s).baseText("nodeErrorView.details.causeDetailed")),1),f("pre",Zd,[f("code",null,w(e.error.context.causeDetailed),1)])])):E("",!0),e.error.stack?(d(),N("div",eu,[f("p",tu,w(x(s).baseText("nodeErrorView.details.stackTrace")),1),f("pre",ou,[f("code",null,w(e.error.stack),1)])])):E("",!0)])])])])])}}}),su={key:0},iu={key:1},au={key:2},ru=Y({__name:"RunDataPinButton",props:{tooltipContentsVisibility:{},dataPinningDocsUrl:{},pinnedData:{},disabled:{type:Boolean}},emits:["togglePinData"],setup(e,{emit:t}){const o=Te(),n=e,s=t,a=q(()=>n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?!0:void 0);return(i,l)=>{const r=S("n8n-link"),u=S("n8n-text"),h=S("n8n-icon-button"),p=S("n8n-tooltip");return d(),_(p,{placement:"bottom-end",visible:a.value},{content:v(()=>[n.tooltipContentsVisibility.binaryDataTooltipContent?(d(),N("div",su,w(x(o).baseText("ndv.pinData.pin.binary")),1)):n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?(d(),N("div",iu,w(x(o).baseText("node.discovery.pinData.ndv")),1)):(d(),N("div",au,[f("strong",null,w(x(o).baseText("ndv.pinData.pin.title")),1),y(u,{size:"small",tag:"p"},{default:v(()=>[O(w(x(o).baseText("ndv.pinData.pin.description"))+" ",1),y(r,{to:n.dataPinningDocsUrl,size:"small"},{default:v(()=>[O(w(x(o).baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})]))]),default:v(()=>[y(h,{class:D(i.$style.pinDataButton),type:"tertiary",active:n.pinnedData.hasData.value,icon:"thumbtack",disabled:n.disabled,"data-test-id":"ndv-pin-data",onClick:l[0]||(l[0]=g=>s("togglePinData"))},null,8,["class","active","disabled"])]),_:1},8,["visible"])}}}),lu="_pinDataButton_9zxxl_1",du={pinDataButton:lu},uu={$style:du},cu=G(ru,[["__cssModules",uu]]),hu=_e(async()=>await Pe(()=>import("./RunDataTable-2YR4xl8i.js"),__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,34,35,36,37,38,39,40,41]))),pu=_e(async()=>await Pe(()=>import("./RunDataJson-s5yVk7VC.js"),__vite__mapDeps([42,2,3,4,5,6,7,8,1,9,10,11,12,13,35,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,43]))),fu=_e(async()=>await Pe(()=>import("./RunDataSchema-WeaaXm2i.js"),__vite__mapDeps([44,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,14,15,33,34,35,36,37,38,39,40,45]))),gu=_e(async()=>await Pe(()=>Promise.resolve().then(()=>Pl),void 0)),mu=_e(async()=>await Pe(()=>import("./RunDataSearch-6Yg8LN1O.js"),__vite__mapDeps([46,2,3,4,5,6,7,8,1,9,10,11,12,13,47]))),yu=Y({name:"RunData",components:{BinaryDataDisplay:jl,NodeErrorView:nu,JsonEditor:ii,RunDataTable:hu,RunDataJson:pu,RunDataSchema:fu,RunDataHtml:gu,RunDataSearch:mu,RunDataPinButton:cu},props:{node:{type:Object,default:null},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String,required:!0},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=oe(),o=Ve(),n=We(),s=zi(e,"node"),a=Ce(s,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode(e.paneType)});return{...tt(),externalHooks:n,nodeHelpers:o,pinnedData:a}},data(){return{connectionType:M.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:Tn,MAX_DISPLAY_ITEMS_AUTO_ALL:Qn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){var e,t,o;if(this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane()),this.hasRunError){const n=(o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])==null?void 0:o.error;n&&["unknown error"].some(a=>n.message.toLowerCase().includes(a))&&this.$telemetry.track(`User encountered an error: "${n.message}"`,{node:this.node.type,errorMessage:n.message,nodeVersion:this.node.typeVersion,n8nVersion:this.rootStore.versionCli},{withPostHog:!0})}},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...le(ee,oe,Z,Jt,Tt),isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Zn},dataEditingDocsUrl(){return es},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=me(e,t,this.nodeType);return!!!we(o).find(a=>a!==M.Main)&&!this.isPaneTypeInput&&this.pinnedData.isValidNodeType.value&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!go(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===Vt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.pinnedData.hasData.value))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinnedData.data.value?this.pinnedData.data.value.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return mo(this.inputData)},binaryData(){return this.node?this.nodeHelpers.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const s=this.getRawInputData(this.runIndex,n).length,a=this.getDataCount(this.runIndex,n),i=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:s,interpolate:{matched:a,total:s}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:a,interpolate:{count:a}});let l=this.getOutputName(n);if(`${l}`==`${n}`)l=`${this.$locale.baseText("ndv.output")} ${l}`;else{const r=ts.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;l=e(`${this.getOutputName(n)}${r}`)}t.push({label:this.search&&a||s?`${l} (${i})`:l,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return Ee(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=Ae(wo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,Se.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,Se.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){Ae(wo).value="true",Ae(Bt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinnedData.data.value?yo(this.pinnedData.data.value):mo(this.rawInputData),o=t.length>0?t:os;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.pinnedData.hasData.value,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"undefined":this.displayMode,is_data_pinned:this.pinnedData.hasData.value})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.pinnedData.setData(yo(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"none":this.displayMode};this.externalHooks.run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.nodeHelpers.updateNodeParameterIssues(this.node),this.pinnedData.hasData.value){this.pinnedData.unsetData(e);return}try{this.pinnedData.setData(this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.externalHooks.run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let s=0;s<=this.maxOutputIndex;s++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,s)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=M.Main){let n=[];return this.node&&(n=this.nodeHelpers.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinnedData.data.value&&!this.isProductionExecutionPreview?Array.isArray(this.pinnedData.data.value)?this.pinnedData.data.value.map(t=>({json:t})):[{json:this.pinnedData.data.value}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>ns(t,this.search))):e},getDataCount(e,t,o=M.Main){var a,i,l;if(!this.node)return 0;if((l=(i=(a=this.workflowRunData)==null?void 0:a[this.node.name])==null?void 0:i[e])!=null&&l.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),s=this.getPinDataOrLiveData(n);return this.getFilteredData(s).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=we(t)}this.connectionType=e.length===0?M.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.nodeHelpers.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:s,fileExtension:a,mimeType:i}=this.binaryData[e][t];if(o){const l=this.workflowsStore.getBinaryUrl(o,"download",s,i);At.saveAs(l,[s,a].join("."));return}else{const l="data:"+i+";base64,"+n,r=await fetch(l).then(async u=>await u.blob());At.saveAs(r,s)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});At.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&qi(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===Vt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(e,t){e.id!==t.id&&this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>go(t.json))})},immediate:!0,deep:!0},jsonData(e,t){Gi(e,t)||(this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e))},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),wu="_infoIcon_bnhk0_1",vu="_center_bnhk0_5",Nu="_container_bnhk0_19",ku="_pinnedDataCallout_bnhk0_28",bu="_header_bnhk0_36",Tu="_dataContainer_bnhk0_50",Su="_dataDisplay_bnhk0_59",Du="_tabs_bnhk0_71",Eu="_itemsCount_bnhk0_78",Cu="_runSelector_bnhk0_86",Iu="_runSelectorWrapper_bnhk0_95",Pu="_pagination_bnhk0_100",_u="_pageSizeSelector_bnhk0_110",Ou="_binaryIndex_bnhk0_116",$u="_binaryRow_bnhk0_133",Ru="_binaryCell_bnhk0_138",Au="_binaryHeader_bnhk0_150",Mu="_binaryButtonContainer_bnhk0_159",Wu="_binaryValue_bnhk0_170",Vu="_displayModes_bnhk0_175",Bu="_tooltipContain_bnhk0_181",Uu="_spinner_bnhk0_185",xu="_editMode_bnhk0_196",Lu="_editModeBody_bnhk0_205",Hu="_editModeFooter_bnhk0_212",Fu="_editModeFooterInfotip_bnhk0_222",zu="_editModeActions_bnhk0_228",ju="_stretchVertically_bnhk0_235",Ku="_uiBlocker_bnhk0_239",Yu={infoIcon:wu,center:vu,container:Nu,pinnedDataCallout:ku,header:bu,dataContainer:Tu,"actions-group":"_actions-group_bnhk0_55",dataDisplay:Su,tabs:Du,itemsCount:Eu,runSelector:Cu,runSelectorWrapper:Iu,pagination:Pu,pageSizeSelector:_u,binaryIndex:Ou,binaryRow:$u,binaryCell:Ru,binaryHeader:Au,binaryButtonContainer:Mu,binaryValue:Wu,displayModes:Vu,tooltipContain:Bu,spinner:Uu,editMode:xu,editModeBody:Lu,editModeFooter:Hu,editModeFooterInfotip:Fu,editModeActions:zu,stretchVertically:ju,uiBlocker:Ku},qu={key:0,class:"ml-4xs"},Gu={key:0},Ju=["innerHTML"],Xu=["data-test-id"],Qu={key:0},Zu={key:1},ec={key:2},tc={key:3},oc={key:4};function nc(e,t,o,n,s,a){var C,U,F;const i=S("n8n-link"),l=S("n8n-callout"),r=S("BinaryDataDisplay"),u=S("n8n-radio-buttons"),h=S("n8n-icon-button"),p=S("RunDataPinButton"),g=S("n8n-button"),b=S("n8n-option"),m=S("n8n-select"),P=S("n8n-tooltip"),c=S("RunDataSearch"),T=S("n8n-tabs"),k=S("n8n-text"),$=S("n8n-spinner"),R=S("JsonEditor"),B=S("n8n-info-tip"),z=S("NodeErrorView"),A=S("i18n-t"),V=S("RunDataTable"),L=S("RunDataJson"),ne=S("RunDataHtml"),ye=S("RunDataSchema"),W=S("el-pagination"),K=S("n8n-block-ui");return d(),N("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...I)=>e.activatePane&&e.activatePane(...I))},[e.canPinData&&e.pinnedData.hasData.value&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(d(),_(l,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:v(()=>[y(i,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:v(()=>[O(w(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:v(()=>[O(w(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),N("span",qu,[y(i,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=re(I=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:v(()=>[O(w(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):E("",!0)]),_:1},8,["class"])):E("",!0),y(r,{"window-visible":e.binaryDataDisplayVisible,"display-data":e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["window-visible","display-data","onClose"]),f("div",{class:D(e.$style.header)},[he(e.$slots,"header",{},void 0,!0),Q(f("div",{class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header",onClick:t[3]||(t[3]=re(()=>{},["stop"]))},[Q(y(u,{"model-value":e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["model-value","options","onUpdate:modelValue"]),[[ae,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?Q((d(),_(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=I=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[ae,!e.editMode.enabled]]):E("",!0),(e.canPinData||(C=e.binaryData)!=null&&C.length)&&e.rawInputData.length&&!e.editMode.enabled?(d(),_(p,{key:1,disabled:!e.rawInputData.length&&!e.pinnedData.hasData.value||e.isReadOnlyRoute||e.readOnlyEnv||!!((U=e.binaryData)!=null&&U.length),"tooltip-contents-visibility":{binaryDataTooltipContent:!!((F=e.binaryData)!=null&&F.length),pinDataDiscoveryTooltipContent:e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible},"data-pinning-docs-url":e.dataPinningDocsUrl,"pinned-data":e.pinnedData,onTogglePinData:t[2]||(t[2]=I=>e.onTogglePinData({source:"pin-icon-click"}))},null,8,["disabled","tooltip-contents-visibility","data-pinning-docs-url","pinned-data"])):E("",!0),Q(f("div",{class:D(e.$style.editModeActions)},[y(g,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),y(g,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[ae,e.editMode.enabled]])],2),[[ae,!e.hasRunError]])],2),e.maxRunIndex>0?Q((d(),N("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[f("div",{class:D(e.$style.runSelectorWrapper)},[y(m,{size:"small","model-value":e.runIndex,teleported:"","onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=re(()=>{},["stop"]))},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.output.run")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.maxRunIndex+1,I=>(d(),_(b,{key:I,label:e.getRunLabel(I),value:I-1},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"]),e.canLinkRuns?(d(),_(P,{key:0,placement:"right"},{content:v(()=>[O(w(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:v(()=>[y(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):E("",!0),he(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(d(),_(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ae,!e.editMode.enabled]]):E("",!0),he(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(d(),N("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[y(T,{"model-value":e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["model-value","options","onUpdate:modelValue"]),e.showIOSearch?(d(),_(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)):!e.hasRunError&&e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?Q((d(),N("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(d(),_(k,{key:0},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(d(),_(k,{key:1},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(d(),_(c,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=I=>e.search=I),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ae,!e.editMode.enabled&&!e.hasRunError]]):E("",!0),f("div",{ref:"dataContainer",class:D(e.$style.dataContainer),"data-test-id":"ndv-data-container"},[e.isExecuting?(d(),N("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[f("div",{class:D(e.$style.spinner)},[y($,{type:"ring"})],2),y(k,null,{default:v(()=>[O(w(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(d(),N("div",{key:1,class:D(e.$style.editMode)},[f("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[y(R,{"model-value":e.editMode.value,"onUpdate:modelValue":t[8]||(t[8]=I=>e.ndvStore.setOutputPanelEditModeValue(I))},null,8,["model-value"])],2),f("div",{class:D(e.$style.editModeFooter)},[y(B,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:v(()=>[O(w(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),y(i,{to:e.dataEditingDocsUrl,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(d(),N("div",{key:2,class:D(e.$style.stretchVertically)},[y(z,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(d(),N("div",{key:4,class:D(e.$style.center)},[y(k,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),y(i,{onClick:e.enableNode},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(d(),N("div",{key:5,class:D(e.$style.center)},[he(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(d(),N("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(d(),_(k,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:v(()=>[O(w(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?he(e.$slots,"content",{key:1},void 0,!0):(d(),_(z,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(d(),N("div",{key:7,class:D(e.$style.center)},[e.search?(d(),N("div",Gu,[y(k,{tag:"h3",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(k,null,{default:v(()=>[y(A,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:v(()=>[f("a",{href:"#",onClick:t[9]||(t[9]=(...I)=>e.onSearchClear&&e.onSearchClear(...I))},w(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(d(),_(k,{key:1},{default:v(()=>[O(w(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(d(),N("div",{key:8,class:D(e.$style.center)},[he(e.$slots,"no-output-data",{},()=>[O("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(d(),N("div",{key:9,class:D(e.$style.center)},[y(k,{bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.tooMuchDataTitle),1)]),_:1}),y(k,{align:"center",tag:"div"},{default:v(()=>[f("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,Ju)]),_:1}),y(g,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),y(g,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=I=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?he(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(d(),N("div",{key:11,class:D(e.$style.center)},[y(k,null,{default:v(()=>[O(w(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),f("a",{onClick:t[11]||(t[11]=(...I)=>e.switchToBinary&&e.switchToBinary(...I))},w(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(d(),N("div",{key:12,class:D(e.$style.center)},[y(k,{tag:"h3",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(k,null,{default:v(()=>[y(A,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:v(()=>[f("a",{href:"#",onClick:t[12]||(t[12]=(...I)=>e.onSearchClear&&e.onSearchClear(...I))},w(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(d(),_(De,{key:13},{default:v(()=>[y(V,{node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"page-offset":e.currentPageOffset,"total-runs":e.maxRunIndex,"has-default-hover-state":e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=I=>e.$emit("tableMounted",I)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","input-data","mapping-enabled","distance-from-active","run-index","page-offset","total-runs","has-default-hover-state","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(d(),_(De,{key:14},{default:v(()=>[y(L,{"pane-type":e.paneType,"edit-mode":e.editMode,"sessio-id":e.sessionId,node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["pane-type","edit-mode","sessio-id","node","input-data","mapping-enabled","distance-from-active","run-index","total-runs","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(d(),_(De,{key:15},{default:v(()=>[y(ne,{"input-html":e.inputDataPage[0].json.html},null,8,["input-html"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(d(),_(De,{key:16},{default:v(()=>[y(ye,{data:e.jsonData,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,node:e.node,"pane-type":e.paneType,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["data","mapping-enabled","distance-from-active","node","pane-type","run-index","total-runs","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(d(),N("div",{key:17,class:D(e.$style.center)},[y(k,{align:"center",tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(d(),N("div",{key:18,class:D(e.$style.dataDisplay)},[(d(!0),N(te,null,ue(e.binaryData,(I,H)=>(d(),N("div",{key:H},[e.binaryData.length>1?(d(),N("div",{key:0,class:D(e.$style.binaryIndex)},[f("div",null,w(H+1),1)],2)):E("",!0),f("div",{class:D(e.$style.binaryRow)},[(d(!0),N(te,null,ue(I,(X,ie)=>(d(),N("div",{key:H+"_"+ie,class:D(e.$style.binaryCell)},[f("div",{"data-test-id":"ndv-binary-data_"+H},[f("div",{class:D(e.$style.binaryHeader)},w(ie),3),X.fileName?(d(),N("div",Qu,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileName),3)])):E("",!0),X.directory?(d(),N("div",Zu,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.directory),3)])):E("",!0),X.fileExtension?(d(),N("div",ec,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileExtension),3)])):E("",!0),X.mimeType?(d(),N("div",tc,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.mimeType),3)])):E("",!0),X.fileSize?(d(),N("div",oc,[f("div",null,[y(k,{size:"small",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},w(X.fileSize),3)])):E("",!0),f("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(H,ie)?(d(),_(g,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:ve=>e.displayBinaryData(H,ie)},null,8,["label","onClick"])):E("",!0),e.isDownloadable(H,ie)?(d(),_(g,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:ve=>e.downloadBinaryData(H,ie)},null,8,["label","onClick"])):E("",!0)],2)],8,Xu)],2))),128))],2)]))),128))],2)):E("",!0):(d(),N("div",{key:3,class:D(e.$style.center)},[he(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?Q((d(),N("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[y(W,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next",total:e.dataCount,"onUpdate:currentPage":e.onCurrentPageChange},null,8,["current-page","page-size","total","onUpdate:currentPage"]),f("div",{class:D(e.$style.pageSizeSelector)},[y(m,{size:"mini","model-value":e.pageSize,teleported:"","onUpdate:modelValue":e.onPageSizeChange},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.output.pageSize")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.pageSizes,I=>(d(),_(b,{key:I,label:I,value:I},null,8,["label","value"]))),128)),y(b,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["model-value","onUpdate:modelValue"])],2)],2)),[[ae,!e.editMode.enabled]]):E("",!0),y(K,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const sc={$style:Yu},xn=G(yu,[["render",nc],["__cssModules",sc],["__scopeId","data-v-f2610902"]]),ic=Y({props:{taskData:{},hasStaleData:Boolean,hasPinData:Boolean},computed:{theme(){var e;return(e=this.runTaskData)!=null&&e.error?"danger":"success"},runTaskData(){return this.taskData},runMetadata(){if(!this.runTaskData)return null;const{date:e,time:t}=Zi(this.runTaskData.startTime);return{executionTime:this.runTaskData.executionTime,startTime:`${e} at ${t}`}}}}),ac=["innerHTML"],rc=f("br",null,null,-1),lc=f("br",null,null,-1);function dc(e,t,o,n,s,a){const i=S("n8n-info-tip"),l=S("n8n-text");return e.hasStaleData?(d(),_(i,{key:0,theme:"warning",type:"tooltip","tooltip-placement":"right","data-test-id":"node-run-info-stale"},{default:v(()=>[f("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,ac)]),_:1})):e.runMetadata?(d(),_(i,{key:1,type:"tooltip",theme:e.theme,"data-test-id":`node-run-info-${e.theme}`,"tooltip-placement":"right"},{default:v(()=>[f("div",null,[y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.runTaskData.error?e.$locale.baseText("runData.executionStatus.failed"):e.$locale.baseText("runData.executionStatus.success")),1)]),_:1}),rc,y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),O(" "+w(e.runMetadata.startTime),1),lc,y(l,{bold:!0,size:"small"},{default:v(()=>[O(w(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),O(" "+w(e.runMetadata.executionTime)+" "+w(e.$locale.baseText("runData.ms")),1)])]),_:1},8,["theme","data-test-id"])):E("",!0)}const uc=G(ic,[["render",dc]]),Wt={REGULAR:"regular",LOGS:"logs"},cc=Y({name:"OutputPanel",components:{RunData:xn,RunInfo:uc,RunDataAi:Qi},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=oe(),{activeNode:o}=Gt(t),{isSubNodeType:n}=ai({node:o});return{pinnedData:Ce(o,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode("output")}),isSubNodeType:n}},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:Wt.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:Wt.LOGS}]}},computed:{...le(ee,oe,pe,Z),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.pinnedData.isValidNodeType.value&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===Wt.LOGS?wt.emit("setPositionByName","minLeft"):wt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),hc="_outputTypeSelect_f1tu5_6",pc="_titleSection_f1tu5_11",fc="_title_f1tu5_11",gc="_noOutputData_f1tu5_27",mc="_recoveredOutputData_f1tu5_37",yc={outputTypeSelect:hc,titleSection:pc,title:fc,noOutputData:gc,recoveredOutputData:mc},wc=f("br",null,null,-1);function vc(e,t,o,n,s,a){const i=S("n8n-radio-buttons"),l=S("RunInfo"),r=S("n8n-text"),u=S("RunDataAi"),h=S("RunData");return d(),_(h,{ref:"runData",node:e.node,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.output.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.output.noOutputDataInBranch"),"is-executing":e.isNodeRunning,"executing-message":e.$locale.baseText("ndv.output.executing"),"session-id":e.sessionId,"block-u-i":e.blockUI,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"output","data-output-type":e.outputMode,onActivatePane:e.activatePane,onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=p=>e.$emit("tableMounted",p)),onItemHover:t[4]||(t[4]=p=>e.$emit("itemHover",p)),onSearch:t[5]||(t[5]=p=>e.$emit("search",p))},oo({header:v(()=>[f("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(d(),_(i,{key:0,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=p=>e.outputMode=p),e.onUpdateOutputMode],options:e.outputTypes},null,8,["modelValue","options","onUpdate:modelValue"])):(d(),N("span",{key:1,class:D(e.$style.title)},w(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),e.hasNodeRun&&!e.pinnedData.hasData.value&&e.runsCount===1?Q((d(),_(l,{key:2,"task-data":e.runTaskData,"has-stale-data":e.staleData,"has-pin-data":e.pinnedData.hasData.value},null,8,["task-data","has-stale-data","has-pin-data"])),[[ae,!e.outputPanelEditMode.enabled]]):E("",!0)],2)]),"node-not-run":v(()=>[e.workflowRunning&&!e.isTriggerNode?(d(),_(r,{key:0,"data-test-id":"ndv-output-waiting"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):E("",!0),e.workflowRunning?E("",!0):(d(),_(r,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:v(()=>[e.isSubNodeType.value?(d(),N(te,{key:0},[O(w(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(d(),N(te,{key:1},[O(w(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(d(),N("span",{key:0,onClick:t[1]||(t[1]=(...p)=>e.insertTestData&&e.insertTestData(...p))},[wc,O(" "+w(e.$locale.baseText("generic.or"))+" ",1),y(r,{tag:"a",size:"medium",color:"primary"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):E("",!0)],64))]),_:1}))]),"no-output-data":v(()=>[y(r,{bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),y(r,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),f("a",{onClick:t[2]||(t[2]=(...p)=>e.openSettings&&e.openSettings(...p))},w(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),O(" "+w(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":v(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(r,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(r,null,{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:v(()=>[y(u,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.pinnedData.hasData.value&&e.runsCount>1?{name:"run-info",fn:v(()=>[y(l,{"task-data":e.runTaskData},null,8,["task-data"])]),key:"1"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","block-u-i","is-production-execution-preview","is-pane-active","data-output-type","onActivatePane","onRunChange","onLinkRun","onUnlinkRun"])}const Nc={$style:yc},kc=G(cc,[["render",vc],["__cssModules",Nc]]),bc={},Tc={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Sc=ji('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Dc=[Sc];function Ec(e,t){return d(),N("svg",Tc,Dc)}const Cc=G(bc,[["render",Ec]]),Ic=Y({name:"InputPanel",components:{RunData:xn,NodeExecuteButton:so,WireMeUp:Cc},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...le(ee,oe,Z,pe),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[Kt,et,ss,is];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const s=this.currentWorkflow.getNode(this.activeNode.name);e=me(this.currentWorkflow,s,this.activeNodeType),t=Ee(this.currentWorkflow,s,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(s=>this.filterOutConnectionType(s,M.Main))&&t.find(s=>this.filterOutConnectionType(s,M.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"?(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0]):this.mappedNode=null},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var s;if(!e||!this.isMultiInputNode||!this.activeNode||((s=this.activeNodeType)==null?void 0:s.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((a,i,l)=>i[0]&&i[0].node===e?[...a,l]:a,[]).map(a=>{var i,l;return(l=(i=this.activeNodeType)==null?void 0:i.inputNames)==null?void 0:l[a]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}}}),Pc="_mappedNode_1b87q_1",_c="_titleSection_1b87q_6",Oc="_inputModeTab_1b87q_15",$c="_noOutputData_1b87q_19",Rc="_recoveredOutputData_1b87q_29",Ac="_notConnected_1b87q_38",Mc="_title_1b87q_6",Wc={mappedNode:Pc,titleSection:_c,inputModeTab:Oc,noOutputData:$c,recoveredOutputData:Rc,notConnected:Ac,title:Mc},Vc={key:0},Bc={key:1},Uc=["innerHTML"];function xc(e,t,o,n,s,a){const i=S("n8n-option"),l=S("n8n-select"),r=S("n8n-radio-buttons"),u=S("n8n-text"),h=S("NodeExecuteButton"),p=S("n8n-tooltip"),g=S("WireMeUp"),b=S("RunData");return d(),_(b,{node:e.currentNode,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":!e.mappedNode&&e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.input.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.input.noOutputDataInBranch"),"is-executing":e.isExecutingPrevious,"executing-message":e.$locale.baseText("ndv.input.executingPrevious"),"session-id":e.sessionId,"override-outputs":e.connectedCurrentNodeOutputs,"mapping-enabled":e.isMappingEnabled,"distance-from-active":e.currentNodeDepth,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"input","data-test-id":"ndv-input-panel",onActivatePane:e.activatePane,onItemHover:t[2]||(t[2]=m=>e.$emit("itemHover",m)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onSearch:t[4]||(t[4]=m=>e.$emit("search",m))},oo({header:v(()=>[f("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(d(),_(l,{key:0,teleported:"",size:"small","model-value":e.currentNodeName,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select","onUpdate:modelValue":e.onInputNodeChange},{prepend:v(()=>[f("span",{class:D(e.$style.title)},w(e.$locale.baseText("ndv.input")),3)]),default:v(()=>[(d(!0),N(te,null,ue(e.parentNodes,m=>(d(),_(i,{key:m.name,value:m.name,class:"node-option",label:`${e.truncate(m.name)} ${e.getMultipleNodesText(m.name)}`,"data-test-id":"ndv-input-option"},{default:v(()=>[f("span",null,w(e.truncate(m.name))+" ",1),e.getMultipleNodesText(m.name)?(d(),N("span",Vc,w(e.getMultipleNodesText(m.name)),1)):(d(),N("span",Bc,w(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:m.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["model-value","no-data-text","placeholder","onUpdate:modelValue"])):(d(),N("span",{key:1,class:D(e.$style.title)},w(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(d(),_(r,{key:2,options:e.inputModes,"model-value":e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","model-value","onUpdate:modelValue"])):E("",!0)],2)]),"node-not-run":v(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(d(),N("div",{key:0,class:D(e.$style.noOutputData)},[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?E("",!0):(d(),_(p,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:v(()=>[f("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,Uc)]),default:v(()=>[y(h,{type:"secondary","hide-icon":"",transparent:!0,"node-name":e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),"telemetry-source":"inputs","data-test-id":"execute-previous-node",onExecute:e.onNodeExecute},null,8,["node-name","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?E("",!0):(d(),_(u,{key:1,tag:"div",size:"small"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(d(),N("div",{key:1,class:D(e.$style.notConnected)},[f("div",null,[y(g)]),y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),y(u,{tag:"div"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),f("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...m)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...m))},w(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":v(()=>[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":v(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(u,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(u,null,{default:v(()=>[O(w(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:v(()=>[(d(),_(Vn("style"),null,{default:v(()=>[O("button.linkRun { display: none }")]),_:1})),f("div",{class:D(e.$style.mappedNode)},[y(l,{"model-value":e.mappedNode,size:"small",teleported:"","onUpdate:modelValue":e.onMappedNodeSelected,onClick:t[0]||(t[0]=re(()=>{},["stop"]))},{prepend:v(()=>[O(w(e.$locale.baseText("ndv.input.previousNode")),1)]),default:v(()=>[(d(!0),N(te,null,ue(e.rootNodesParents,m=>(d(),_(i,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","override-outputs","mapping-enabled","distance-from-active","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const Lc={$style:Wc},Hc=G(Ic,[["render",xc],["__cssModules",Lc],["__scopeId","data-v-51727c96"]]),Fc=Y({name:"TriggerPanel",components:{NodeExecuteButton:so,CopyInput:ri,NodeIcon:nt},props:{nodeName:{type:String},sessionId:{type:String}},setup(){const e=st();return{workflowHelpers:Dt({router:e})}},data:()=>({executionsHelpEventBus:Sn()}),computed:{...le(ee,oe,pe,Z),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hideContent(){var e,t,o,n;if(!((e=this.nodeType)!=null&&e.triggerPanel))return!1;if((t=this.nodeType)!=null&&t.triggerPanel&&((o=this.nodeType)!=null&&o.triggerPanel.hasOwnProperty("hideContent"))){const s=(n=this.nodeType)==null?void 0:n.triggerPanel.hideContent;if(typeof s=="boolean")return s;if(this.node){const a=this.workflowHelpers.getCurrentWorkflow().expression.getSimpleParameterValue(this.node,s,"internal",{});if(typeof a=="boolean")return a}}return!1},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?yt(this.nodeType):""},displayChatButton(){return!!(this.node&&this.node.type===Ze&&this.node.parameters.mode!=="webhook")},isWebhookNode(){return!!(this.node&&this.node.type===Re)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Me?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;switch((e=this.nodeType)==null?void 0:e.name){case Ze:return this.$locale.baseText("ndv.trigger.webhookBasedNode.chatTrigger.serviceHint");case Me:return this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint");default:return this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})}},header(){var t;const e=this.nodeType?yt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?yt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},openWebhookUrl(){this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-chat"}),window.open(this.webhookTestUrl,"_blank","noreferrer")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:J.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(as))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),zc="_container_1evnm_1",jc="_header_1evnm_18",Kc="_action_1evnm_25",Yc="_shake_1evnm_29",qc="_accordion_1evnm_50",Gc={container:zc,header:jc,action:Kc,shake:Yc,accordion:qc},Jc={key:"empty"},Xc={key:"listening"},Qc={key:0},Zc={key:1},eh={key:0},th={key:"default"},oh={key:0,class:"mb-xl"},nh=["textContent"],sh=["innerHTML"];function ih(e,t,o,n,s,a){const i=S("NodeIcon"),l=S("n8n-pulse"),r=S("n8n-text"),u=S("CopyInput"),h=S("NodeExecuteButton"),p=S("n8n-button"),g=S("n8n-spinner"),b=S("n8n-heading"),m=S("n8n-link"),P=S("n8n-info-accordion");return d(),N("div",{class:D(e.$style.container)},[y(Ki,{name:"fade",mode:"out-in"},{default:v(()=>[e.hasIssues||e.hideContent?(d(),N("div",Jc)):e.isListeningForEvents?(d(),N("div",Xc,[y(l,null,{default:v(()=>[y(i,{"node-type":e.nodeType,size:40},null,8,["node-type"])]),_:1}),e.isWebhookNode?(d(),N("div",Qc,[y(r,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(r,null,{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:e.webhookHttpMethod}})),1)]),_:1})],2),y(u,{value:e.webhookTestUrl,"toast-title":e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toast-title","copy-button-text","onCopy"]),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])])):(d(),N("div",Zc,[y(r,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:v(()=>[O(w(e.listeningTitle),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(r,{tag:"div"},{default:v(()=>[O(w(e.listeningHint),1)]),_:1})],2),e.displayChatButton?(d(),N("div",eh,[y(p,{class:"mb-xl",onClick:t[0]||(t[0]=c=>e.openWebhookUrl())},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.chatTrigger.openChat")),1)]),_:1})])):E("",!0),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])]))])):(d(),N("div",th,[e.isActivelyPolling?(d(),N("div",oh,[y(g,{type:"ring"})])):E("",!0),f("div",{class:D(e.$style.action)},[f("div",{class:D(e.$style.header)},[e.header?(d(),_(b,{key:0,tag:"h1",bold:""},{default:v(()=>[O(w(e.header),1)]),_:1})):E("",!0),e.subheader?(d(),_(r,{key:1},{default:v(()=>[f("span",{textContent:w(e.subheader)},null,8,nh)]),_:1})):E("",!0)],2),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])],2),e.activationHint?(d(),_(r,{key:1,size:"small",onClick:e.onLinkClick},{default:v(()=>[f("span",{innerHTML:e.activationHint},null,8,sh),O("  ")]),_:1},8,["onClick"])):E("",!0),e.activationHint&&e.executionsHelp?(d(),_(m,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:v(()=>[O(w(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):E("",!0),e.executionsHelp?(d(),_(P,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,"event-bus":e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","event-bus","onClick:body"])):E("",!0)]))]),_:1})],2)}const ah={$style:Gc},rh=G(Fc,[["render",ih],["__cssModules",ah],["__scopeId","data-v-4b3bae7d"]]),lh=Y({name:"NodeDetailsView",components:{NodeSettings:Cr,InputPanel:Hc,OutputPanel:kc,NDVDraggablePanels:Sl,TriggerPanel:rh},mixins:[sn],props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e,t){var u,h;const o=oe(),n=We(),s=Ve(),{activeNode:a}=Gt(o),i=Ce(a),l=st(),r=Dt({router:l});return{externalHooks:n,nodeHelpers:s,pinnedData:i,workflowHelpers:r,...Ie(),...Zt(),...(h=(u=sn).setup)==null?void 0:h.call(u,e,t)}},data(){return{settingsEventBus:Sn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){Se.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){Se.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...le(ee,oe,pe,Z,jt),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,s,a,i,l;const e=!!((n=this.activeNodeType)!=null&&n.triggerPanel);if(typeof((s=this.activeNodeType)==null?void 0:s.triggerPanel)=="boolean")return e;const t=!!((i=(a=this.activeNodeType)==null?void 0:a.webhooks)!=null&&i.length),o=(l=this.activeNodeType)==null?void 0:l.polling;return!this.readOnly&&this.isTriggerNode&&(t||o||e)},workflow(){return this.workflowHelpers.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var e;for(const t of this.parentNodes)if(this.workflowsStore.pinnedWorkflowData[t]||(e=this.workflowRunData)!=null&&e[t])return t;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?rs.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===Kt)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===fe},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=Ee(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(s=>s!==M.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${ls}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(Dn.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.externalHooks.run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.nodeHelpers.getNodeSubtitle(e,this.activeNodeType,this.workflowHelpers.getCurrentWorkflow())}),setTimeout(()=>{var o;if(this.activeNode){const n=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:(o=n==null?void 0:n.main)==null?void 0:o.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},async close(){var e,t;if(!this.isDragging){if(this.activeNode&&(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired)){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled&&this.activeNode){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===He){const{value:n}=this.outputPanelEditMode;try{this.pinnedData.setData(zt(n),"on-ndv-close-modal")}catch(s){console.error(s)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),dh="_modalBackground_16z4c_1",uh="_triggerWarning_16z4c_6",ch="_backToCanvas_16z4c_10",hh="_featureRequest_16z4c_31",ph={modalBackground:dh,triggerWarning:uh,backToCanvas:ch,featureRequest:hh};function fh(e,t,o,n,s,a){const i=S("n8n-icon"),l=S("n8n-text"),r=S("n8n-tooltip"),u=S("TriggerPanel"),h=S("InputPanel"),p=S("OutputPanel"),g=S("NodeSettings"),b=S("font-awesome-icon"),m=S("NDVDraggablePanels"),P=S("el-dialog");return d(),_(P,{"model-value":(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:v(()=>{var c;return[y(r,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:v(()=>[f("div",{class:D(e.$style.triggerWarning)},w(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:v(()=>[f("div",{class:D(e.$style.backToCanvas),"data-test-id":"back-to-canvas",onClick:t[0]||(t[0]=(...T)=>e.close&&e.close(...T))},[y(i,{icon:"arrow-left",color:"text-xlight",size:"medium"}),y(l,{color:"text-xlight",size:"medium",bold:!0},{default:v(()=>[O(w(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(d(),N("div",{key:0,ref:"container",class:"data-display",tabindex:"0",onKeydownCapture:t[6]||(t[6]=(...T)=>e.onKeyDown&&e.onKeyDown(...T))},[f("div",{class:D(e.$style.modalBackground),onClick:t[1]||(t[1]=(...T)=>e.close&&e.close(...T))},null,2),(d(),_(m,{key:e.activeNode.name,"is-trigger-node":e.isTriggerNode,"hide-input-and-output":e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,"is-draggable":!e.isTriggerNode,"has-double-width":((c=e.activeNodeType)==null?void 0:c.parameterPane)==="wide","node-type":e.activeNodeType,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},oo({output:v(()=>[y(p,{"data-test-id":"output-panel","can-link-runs":e.canLinkRuns,"run-index":e.outputRun,"linked-runs":e.linked,"session-id":e.sessionId,"is-read-only":e.readOnly||e.hasForeignCredential,"block-u-i":e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["can-link-runs","run-index","linked-runs","session-id","is-read-only","block-u-i","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:v(()=>[y(g,{"event-bus":e.settingsEventBus,dragging:e.isDragging,"session-id":e.sessionId,"node-type":e.activeNodeType,"foreign-credentials":e.foreignCredentials,"read-only":e.readOnly,"block-u-i":e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=T=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["event-bus","dragging","session-id","node-type","foreign-credentials","read-only","block-u-i","executable","onValueChanged","onExecute","onStopExecution","onActivate","onSwitchSelectedNode","onOpenConnectionNodeCreator"]),e.featureRequestUrl?(d(),N("a",{key:0,class:D(e.$style.featureRequest),target:"_blank",onClick:t[5]||(t[5]=(...T)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...T))},[y(b,{icon:"lightbulb"}),O(" "+w(e.$locale.baseText("ndv.featureRequest")),1)],2)):E("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:v(()=>[e.showTriggerPanel?(d(),_(u,{key:0,"node-name":e.activeNode.name,"session-id":e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["node-name","session-id","onExecute","onActivate"])):e.isTriggerNode?E("",!0):(d(),_(h,{key:1,workflow:e.workflow,"can-link-runs":e.canLinkRuns,"run-index":e.inputRun,"linked-runs":e.linked,"current-node-name":e.inputNodeName,"session-id":e.sessionId,"read-only":e.readOnly||e.hasForeignCredential,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","can-link-runs","run-index","linked-runs","current-node-name","session-id","read-only","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["is-trigger-node","hide-input-and-output","position","is-draggable","has-double-width","node-type","onSwitchSelectedNode","onOpenConnectionNodeCreator","onClose","onInit","onDragstart","onDragend"]))],544)):E("",!0)]}),_:1},8,["model-value","before-close","data-has-output-connection"])}const gh={$style:ph},mh=G(lh,[["render",fh],["__cssModules",gh]]),yh=Y({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=it(),{position:n,isOpen:s,actions:a,target:i}=o,l=j(),r=t;to(s,()=>{var p,g;s?(p=l.value)==null||p.open():(g=l.value)==null||g.close()},{flush:"post"});function u(p){const g=p;o._dispatchAction(g),r("action",g,o.targetNodes.value)}function h(p){p||o.close()}return(p,g)=>x(s)?(d(),_(Wn,{key:0,to:"body"},[f("div",{class:D(p.$style.contextMenu),style:se({left:`${x(n)[0]}px`,top:`${x(n)[1]}px`})},[y(x(ds),{ref_key:"dropdown",ref:l,items:x(a),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":x(i).source!=="node-button",onSelect:u,onVisibleChange:h},{activator:v(()=>[f("div",{class:D(p.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):E("",!0)}}),wh="_contextMenu_1t4kq_1",vh="_activator_1t4kq_5",Nh={contextMenu:wh,activator:vh},kh={$style:Nh},bh=G(yh,[["__cssModules",kh]]),Th=(e,t)=>{const o=ps.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},Sh=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Dh=e=>e<=2?"small":e<=6?"medium":"large",Ln=Y({data(){return{inputs:[],outputs:[]}},mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},computed:{...le(ee,pe,Xt,Z,eo),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String,required:!0},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},s=me(this.workflow,this.data,t)||[];this.inputs=s;const a=[...s];a.sort((i,l)=>typeof i=="string"?1:typeof l=="string"||i.required&&!l.required?-1:!i.required&&l.required?1:0),a.forEach((i,l)=>{var z,A;let r;typeof i=="string"?r={type:i}:r=i;const u=r.type,h=u===M.Main?M.Main:"other";o.hasOwnProperty(h)?o[h]++:o[h]=0,n.hasOwnProperty(u)?n[u]++:n[u]=0;const p=o[h],g=n[u],b=s.filter(V=>{const L=typeof V=="string"?V:V.type;return u===M.Main?L===M.Main:L!==M.Main}),m=b.filter(V=>V!==M.Main),P=m.filter(V=>typeof V!="string"&&V.required),c=m.filter(V=>typeof V!="string"&&!V.required),T=this.getSpacerIndexes(P.length,c.length),k=jo(u,"input",b.length,T)[p],$=Lt(u),R={uuid:On(this.nodeId,u,g),anchor:k,maxConnections:r.maxConnections??-1,endpoint:"Rectangle",paintStyle:_t(t,"--color-foreground-xdark",u),hoverPaintStyle:_t(t,"--color-primary",u),scope:li($),source:u!==M.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:u,index:g},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(u,t)},B=(z=this.instance)==null?void 0:z.addEndpoint(this.$refs[this.data.name],R);this.__addEndpointTestingData(B,"input",g),(r.displayName||(A=t.inputNames)!=null&&A[l])&&B.addOverlay(di(r.displayName||t.inputNames[l],u,r.required)),Array.isArray(B)||(B.__meta={nodeName:e.name,nodeId:this.nodeId,index:g,totalEndpoints:b.length,nodeType:e.type})}),a.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=us,n=cs){const s=[];if(e>0&&t>0){if(o)s.push(e);else if(e+t<n)for(let a=e;a<n-t;a++)s.push(a)}else if(e>0&&e<n&&t===0)for(let a=0;a<n-e;a++)s.push(a+e);else if(e===0&&t>0&&t<n)for(let a=0;a<n-t;a++)s.push(a);return s},__addOutputEndpoints(e,t){const o={},n={};this.outputs=Ee(this.workflow,this.data,t)||[];let s=0;const a=[];this.outputs.forEach((l,r)=>{var h;let u;typeof l=="string"?u={type:l}:u=l,(h=t.outputNames)!=null&&h[r]&&(u.displayName=t.outputNames[r]),u.displayName&&(s=u.displayName.length>s?u.displayName.length:s),a.push(u)});const i=Dh(s);this.outputs.forEach((l,r)=>{const u=a[r],h=u.type,p=h===M.Main?M.Main:"other";o.hasOwnProperty(p)?o[p]++:o[p]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const g=o[p],b=n[h],m=this.outputs.filter($=>{const R=typeof $=="string"?$:$.type;return h===M.Main?R===M.Main:R!==M.Main}),P=jo(h,"output",m.length)[g],c=Lt(h),T={uuid:Ht(this.nodeId,h,b),anchor:P,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&m.length>2?7:9}},hoverPaintStyle:qe(t,"--color-primary"),scope:c,source:!0,target:h!==M.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:h,index:b},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(h,u,t)},k=this.instance.addEndpoint(this.$refs[this.data.name],T);if(this.__addEndpointTestingData(k,"output",b),u.displayName){const $=ui(u.displayName,h,u==null?void 0:u.category);k.addOverlay($)}if(Array.isArray(k)||(k.__meta={nodeName:e.name,nodeId:this.nodeId,index:b,totalEndpoints:m.length,endpointLabelLength:i}),!this.isReadOnly&&h===M.Main){const $={uuid:Ht(this.nodeId,h,b),anchor:P,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:k,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:i,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:h,index:b,category:u==null?void 0:u.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};u!=null&&u.category&&($.cssClass=`${$.cssClass} ${u==null?void 0:u.category}`);const R=this.instance.addEndpoint(this.$refs[this.data.name],$);this.__addEndpointTestingData(R,"plus",b),Array.isArray(R)||(R.__meta={nodeName:e.name,nodeId:this.nodeId,index:b,nodeType:e.type,totalEndpoints:m.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(hs);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===M.Main?{paintStyle:_t(t,this.__getEndpointColor(M.Main),e)}:Object.values(M).includes(e)?(n=>({endpoint:Th(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",s=a=>({endpoint:Sh(),paintStyle:qe(o,this.__getEndpointColor(a)),hoverPaintStyle:qe(o,this.__getEndpointColor(a))});return e===M.Main?t.category==="error"?{paintStyle:{...qe(o,this.__getEndpointColor(M.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:qe(o,this.__getEndpointColor(M.Main)),cssClass:`dot-${n}-endpoint`}:Object.values(M).includes(e)?s(e):{}},touchEnd(e){Ie().isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=Ie(),o=e.path||e.composedPath&&e.composedPath();for(let n=0;n<o.length;n++)if(o[n].className&&typeof o[n].className=="string"&&o[n].className.includes("no-select-on-click"))return;t.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(t.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),Eh=Y({name:"Node",components:{TitledList:xt,FontAwesomeIcon:fs,NodeIcon:nt},mixins:[Ln],props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1}},setup(e){const t=Z(),o=it(),n=We(),s=Ve(),a=t.getNodeByName(e.name),i=Ce(a),l=Ie(),{callDebounced:r}=bt();return{contextMenu:o,externalHooks:n,nodeHelpers:s,pinnedData:i,deviceSupport:l,callDebounced:r}},computed:{...le(ee,oe,pe,Z),showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?wn.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(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].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?yt(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},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(){return this.data.type===et},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},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=>e.type===this.data.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(n=>n!==M.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=me(this.workflow,this.node,this.nodeType)||[],n=we(t).filter(l=>l!==M.Main);if(n.length){t.filter(r=>typeof r!="string"&&r.required);let l=0;e["--configurable-node-input-count"]=n.length+l}let s=[];this.workflow.nodes[this.node.name]&&(s=Ee(this.workflow,this.node,this.nodeType));const i=we(s).filter(l=>l===M.Main);e["--node-main-output-count"]=i.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.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,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(s=>{s!=null&&s.error&&e.push(`${s.error.message}${s.error.description?` (${s.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...kn(this.data.issues,this.data)),e},nodeDisabledTitle(){return this.data.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=ke(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===gs?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,n,s;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((s=(n=(o=this.nodeRunData)==null?void 0:o[0])==null?void 0:n.error)==null?void 0:s.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-canvas-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=>e.name===this.data.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)}},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(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){Ae(Bt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(Ae(Bt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)||"";this.nodeSubtitle=e.includes(ms)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new ci(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(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",this.data.name)},toggleDisableNode(e){e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:this.data.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){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},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})}}}),Hn=e=>(An("data-v-0c595bb9"),e=e(),Mn(),e),Ch=["id","data-name","data-node-type"],Ih={class:"select-background"},Ph={key:0,class:"trigger-icon"},_h=["innerHTML"],Oh={key:0,class:"node-issues","data-test-id":"node-issues"},$h={key:1,class:"waiting"},Rh=["textContent"],Ah={key:2,class:"node-pin-data-icon"},Mh={key:0,class:"items-count"},Wh={key:3},Vh={key:4,class:"data-count"},Bh={key:0,class:"items-count"},Uh=["title"],xh={class:"node-trigger-tooltip__wrapper"},Lh=["textContent"],Hh=Hn(()=>f("span",null,null,-1)),Fh=Hn(()=>f("span",null,null,-1)),zh={class:"node-description"},jh=["title"],Kh={"data-test-id":"canvas-node-box-title"},Yh={key:0},qh=["title"],Gh={class:"node-options-inner"};function Jh(e,t,o,n,s,a){var g;const i=S("FontAwesomeIcon"),l=S("n8n-tooltip"),r=S("TitledList"),u=S("NodeIcon"),h=S("n8n-icon-button"),p=Et("touch");return d(),N("div",{id:e.nodeId,ref:e.data.name,class:D(e.nodeWrapperClass),style:se(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(g=e.nodeType)==null?void 0:g.name,onContextmenu:t[4]||(t[4]=b=>e.openContextMenu(b,"node-right-click"))},[Q(f("div",Ih,null,512),[[ae,e.isSelected]]),f("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[Q((d(),N("div",{class:D(e.nodeClass),style:se(e.nodeStyle),onClick:t[0]||(t[0]=re((...b)=>e.onClick&&e.onClick(...b),["left"]))},[e.isTriggerNode?(d(),N("i",Ph,[y(l,{placement:"bottom"},{content:v(()=>[f("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,_h)]),default:v(()=>[y(i,{icon:"bolt",size:"lg"})]),_:1})])):E("",!0),e.data.disabled?E("",!0):(d(),N("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(d(),N("div",Oh,[y(l,{"show-after":500,placement:"bottom"},{content:v(()=>[y(r,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:v(()=>[y(i,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(d(),N("div",$h,[y(l,{placement:"bottom"},{content:v(()=>[f("div",{textContent:w(e.waiting)},null,8,Rh)]),default:v(()=>[y(i,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(d(),N("span",Ah,[y(i,{icon:"thumbtack"}),e.workflowDataItems>1?(d(),N("span",Mh,w(e.workflowDataItems),1)):E("",!0)])):e.nodeExecutionStatus==="unknown"?(d(),N("span",Wh)):e.workflowDataItems?(d(),N("span",Vh,[y(i,{icon:"check"}),e.workflowDataItems>1?(d(),N("span",Bh,w(e.workflowDataItems),1)):E("",!0)])):E("",!0)],2)),f("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[y(i,{icon:"sync-alt",spin:""})],8,Uh),f("div",xh,[y(l,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:v(()=>[f("div",{textContent:w(e.getTriggerNodeTooltip)},null,8,Lh)]),default:v(()=>[Hh]),_:1},8,["visible"]),e.isTriggerNode?(d(),_(l,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:v(()=>[O(w(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:v(()=>[Fh]),_:1},8,["visible"])):E("",!0)]),y(u,{class:"node-icon","node-type":e.nodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),e.showDisabledLinethrough?(d(),N("div",{key:0,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):E("",!0)],2),f("div",zh,[f("div",{class:"node-name",title:e.nodeTitle},[f("p",Kh,w(e.nodeTitle),1),e.data.disabled?(d(),N("p",Yh,"("+w(e.$locale.baseText("node.disabled"))+")",1)):E("",!0)],8,jh),e.nodeSubtitle!==void 0?(d(),N("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},w(e.nodeSubtitle),9,qh)):E("",!0)]),e.isReadOnly?E("",!0):Q((d(),N("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=re(()=>{},["stop"])),onMousedown:t[3]||(t[3]=re(()=>{},["stop"]))},[f("div",Gh,[e.isConfigNode?E("",!0):(d(),_(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"])),y(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"]),y(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"]),y(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=b=>e.openContextMenu(b,"node-button"))})])],544)),[[ae,!e.hideActions]])],46,Ch)}const Xh=G(Eh,[["render",Jh],["__scopeId","data-v-0c595bb9"]]),Qh=Y({name:"Sticky",mixins:[Ln],props:{nodeViewScale:{type:Number},gridSize:{type:Number}},setup(){const e=Ie(),t=j(),o=j(!1),n=a=>{o.value=a},s=it(a=>{var i;a==="change_color"&&(n(!0),(i=t.value)==null||i.click())});return{deviceSupport:e,colorPopoverTrigger:t,contextMenu:s,forceActions:o,setForceActions:n}},computed:{...le(ee,oe,pe,Z),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&It(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.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&&lt(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&lt(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")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===En,n=e.querySelector('img[alt="n8n quickstart video"'),s=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){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:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:It(e.content)?e.content:this.node.parameters.content,height:lt(e.height)?e.height:this.node.parameters.height,width:lt(e.width)?e.width:this.node.parameters.width,color:It(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.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()}}}),Zh=["id","data-name"],ep={class:"select-sticky-background"},tp=["title"],op=["title"],np={class:"content"},sp=["onClick"];function ip(e,t,o,n,s,a){const i=S("n8n-sticky"),l=S("font-awesome-icon"),r=S("n8n-popover"),u=Et("touch");return d(),N("div",{id:e.nodeId,ref:e.data.name,class:"sticky-wrapper",style:se(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[f("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:se(e.stickySize)},[Q(f("div",ep,null,512),[[ae,e.isSelected]]),Q((d(),N("div",{class:"sticky-box",onClick:t[0]||(t[0]=re((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[y(i,{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"])],32)),[[u,e.touchStart,"start"],[u,e.touchEnd,"end"]]),Q(f("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[Q((d(),N("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[y(l,{icon:"trash"})],8,tp)),[[u,e.deleteNode,"tap"]]),y(r,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:v(()=>[f("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[y(l,{icon:"palette"})],8,op)]),default:v(()=>[f("div",np,[(d(!0),N(te,null,ue(Array.from({length:7}),(h,p)=>{var g,b;return d(),N("div",{key:p,class:D(["color",`sticky-color-${p+1}`]),"data-test-id":"color",style:se({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${p+1})`,"box-shadow":p===0&&((g=e.node)==null?void 0:g.parameters.color)===""||p+1===((b=e.node)==null?void 0:b.parameters.color)?`0 0 0 1px var(--color-sticky-background-${p+1})`:"none"}),onClick:m=>e.changeColor(p+1)},null,14,sp)}),128))])]),_:1},8,["onShow","onHide"])],2),[[ae,e.showActions]])],6)],12,Zh)}const ap=G(Qh,[["render",ip],["__scopeId","data-v-f4958951"]]),rp=60,lp=30,dp=30,up=15,cp=-20,pn=-200,hp=-5;function pp(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const s=e.charAt(o).toLowerCase(),a=t.charAt(n).toLowerCase();s===a&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function fp(e,t){return Fn(e,t,0,0,null,[],256,0,0,5)}function Fn(e,t,o,n,s,a,i,l,r,u){let h=0;if(++r>=u)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let p=!1,g=[],b=0,m=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(l>=i)return{matched:!1,outScore:h};m&&s&&(a=[...s],m=!1);const c=[],T=Fn(e,t,o,n+1,a,c,i,l,r,u),k=T.outScore;T.matched&&((!p||k>b)&&(g=[...c],b=k),p=!0),a[l++]=n,++o}++n}const P=o===e.length;if(P){h=100;let c=cp*a[0];c=c<pn?pn:c,h+=c;const T=t.length-l;h+=hp*T;for(let k=0;k<l;k++){const $=a[k];if(k>0){const R=a[k-1];$===R+1&&(h+=rp)}if($>0){const R=t[$-1],B=t[$];R!==R.toUpperCase()&&B!==B.toLowerCase()&&(h+=dp),(R==="_"||R===" ")&&(h+=lp)}else h+=up}return p&&(!P||b>h)?(a=[...g],h=b,{matched:!0,outScore:h}):P?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function gp(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,s=0;for(;n&&s<o.length;){const a=o[s];n=n[a],s++}return n}function mp(e,t,o){const n=t.reduce((s,a)=>{let i=[];o.forEach(({key:r,weight:u})=>{const h=gp(a,r);Array.isArray(h)?i=i.concat(h.map(p=>({value:p,weight:u}))):typeof h=="string"&&i.push({value:h,weight:u})});const l=i.reduce((r,{value:u,weight:h})=>{if(!pp(e,u))return r;const p=fp(e,u);p.outScore*=h;const{matched:g,outScore:b}=p;return!r&&g||g&&r&&b>r.outScore?p:r},null);return l&&s.push({score:l.outScore,item:a}),s},[]);return n.sort((s,a)=>a.score-s.score),n}function Qe(e,t,o="node"){var s,a,i;const n={uuid:be(),key:e.name,subcategory:t??((i=(a=(s=e.codex)==null?void 0:s.subcategories)==null?void 0:a[ge])==null?void 0:i[0])??ot,properties:{...e},type:o};return n}function yp(e){const t=[ge,Yt];return e.reduce((o,n)=>{let s=[ot];return t.forEach(a=>{var i,l,r,u;(l=(i=n.codex)==null?void 0:i.categories)!=null&&l.includes(a)&&(s=((u=(r=n.codex)==null?void 0:r.subcategories)==null?void 0:u[a])??[])}),s.forEach(a=>{o[a]||(o[a]=[]),o[a].push(Qe(n,a))}),o},{})}function Ft(e){return e.sort((t,o)=>{var a,i,l,r;if(t.type!=="node"||o.type!=="node")return 0;const n=((i=(a=t.properties)==null?void 0:a.displayName)==null?void 0:i.toLowerCase())||t.key,s=((r=(l=o.properties)==null?void 0:l.displayName)==null?void 0:r.toLowerCase())||o.key;return n.localeCompare(s,void 0,{sensitivity:"base"})})}function fn(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(mp(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:s})=>s)}function gn(e){return e.map(t=>t.type==="section"?t.children:t).flat()}function wp(e,t){const o=e.reduce((s,a)=>{const i=t.find(r=>r.items.includes(a.key)),l=(i==null?void 0:i.key)??"other";return s[l]=[...s[l]??[],a],s},{}),n=t.map(s=>({type:"section",key:s.key,title:s.title,children:Ft(o[s.key]??[])})).concat({type:"section",key:"other",title:ys.baseText("nodeCreator.sectionNames.other"),children:Ft(o.other??[])}).filter(s=>s.children.length>0);return n.length<=1?e:n}const kt=St(ws.NODE_CREATOR,()=>{const e=j(ze),t=j([]),o=j({}),n=j(!1),s=j(""),a=q(()=>Object.values(t.value).map(p=>Qe(p)));function i(p){t.value=p}function l(p){o.value=p}function r(p){n.value=p}function u(p){e.value=p}function h(p){s.value=p}return{openSource:s,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:r,setSelectedView:u,setOpenSource:h,setActions:l,setMergeNodes:i,allNodeCreatorNodes:a}}),vp=["textContent"],Np=Y({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=kt(),n=q(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(s,a)=>{const i=S("font-awesome-icon"),l=S("n8n-tooltip");return d(),N("div",{ref:"container",class:D(s.$style.canvasAddButton),style:se(n.value),"data-test-id":"canvas-add-button"},[y(l,{placement:"top",visible:s.showTooltip,disabled:x(o).showScrim,"popper-class":s.$style.tooltip,"show-after":700},{content:v(()=>[O(w(s.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:v(()=>[f("button",{class:D(s.$style.button),"data-test-id":"canvas-plus-button",onClick:a[0]||(a[0]=r=>s.$emit("click"))},[y(i,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),f("p",{class:D(s.$style.label),textContent:w(s.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,vp)],6)}}}),kp="_canvasAddButton_1easi_1",bp="_button_1easi_13",Tp="_label_1easi_34",Sp={canvasAddButton:kp,button:bp,label:Tp},Dp={$style:Sp},Ep=G(Np,[["__cssModules",Dp]]);function mn(e,t){return e.filter(o=>{var n,s,a;return!o.hidden&&((a=(s=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:s[Yt])==null?void 0:a.includes(t))}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon,iconData:o.name.toLowerCase().includes("openai")?{type:"file",icon:"openai",fileBuffer:"/static/open-ai.svg"}:void 0}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function rf(e){const t=Te(),o=ee(),n=$n(),s=mn(o.allLatestNodeTypes,Vs),a=mn(o.allLatestNodeTypes,Bs);return{value:vt,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox",{interpolate:{link:n.getWebsiteCategoryURL("ai")}}),items:[...s,...a,{key:qt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function Cp(e){const t=Te();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:qt,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:vo,type:"subcategory",properties:{title:vo,icon:"file-import",...o(M.AiDocument)}},{key:No,type:"subcategory",properties:{title:No,icon:"language",...o(M.AiLanguageModel)}},{key:ko,type:"subcategory",properties:{title:ko,icon:"brain",...o(M.AiMemory)}},{key:bo,type:"subcategory",properties:{title:bo,icon:"list",...o(M.AiOutputParser)}},{key:To,type:"subcategory",properties:{title:To,icon:"search",...o(M.AiRetriever)}},{key:So,type:"subcategory",properties:{title:So,icon:"grip-lines-vertical",...o(M.AiTextSplitter)}},{key:Do,type:"subcategory",properties:{title:Do,icon:"tools",...o(M.AiTool)}},{key:Eo,type:"subcategory",properties:{title:Eo,icon:"vector-square",...o(M.AiEmbedding)}},{key:Co,type:"subcategory",properties:{title:Co,icon:"project-diagram",...o(M.AiVectorStore)}},{key:Io,type:"subcategory",properties:{title:Io,icon:"code"}}]}}function lf(e){const t=Te();return{value:ze,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:ot,type:"subcategory",properties:{forceIncludeNodes:[Re,vs],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:Po,type:"node",category:[ge],properties:{group:[],name:Po,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:Re,type:"node",category:[ge],properties:{group:[],name:Re,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Me,type:"node",category:[ge],properties:{group:[],name:Me,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:et,type:"node",category:[ge],properties:{group:[],name:et,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:_o,type:"node",category:[ge],properties:{group:[],name:_o,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:Oo,category:ge,properties:{title:Oo,icon:"folder-open"}}]}}function df(e){const t=Te(),o={value:Ut,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:ot,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe",forceIncludeNodes:[Ns,ks]}},{type:"subcategory",key:$o,category:ge,properties:{title:$o,icon:"pen",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[bs,Ro,Ts]},{key:"addOrRemove",title:t.baseText("nodeCreator.sectionNames.transform.addOrRemove"),items:[Ao,Ss,Ds,Es]},{key:"combine",title:t.baseText("nodeCreator.sectionNames.transform.combine"),items:[Cs,Is,Mo]},{key:"convert",title:t.baseText("nodeCreator.sectionNames.transform.convert"),items:[Vt,Ps,_s,Os,Wo,Vo,$s,Rs]}]}},{type:"subcategory",key:Bo,category:ge,properties:{title:Bo,icon:"code-branch",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ao,As,Ms,Mo]}]}},{type:"subcategory",key:Uo,category:ge,properties:{title:Uo,icon:"file-alt",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Vo,Wo]}]}},{type:"subcategory",key:xo,category:ge,properties:{title:xo,icon:"toolbox",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ws,Re,Ro]}]}}]};return(e??[]).some(s=>{var a,i;return(i=(a=s.codex)==null?void 0:a.categories)==null?void 0:i.includes(Yt)})&&o.items.push({key:vt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi"),tag:t.baseText("nodeCreator.aiPanel.newTag")}}),o.items.push({key:ze,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Ip="data-keyboard-nav-id",yn=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Pp=St("nodeCreatorKeyboardNavigation",()=>{const e=j([]),t=j(null),o=j({});function n(c){return c==null?void 0:c.getAttribute("data-keyboard-nav-type")}function s(c){return(c==null?void 0:c.getAttribute(Ip))||void 0}async function a(){return await new Promise(c=>{m(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(T=>new WeakRef(T)),c()},0)})}function i(c,T){Object.values(o.value).filter(R=>R.keyboardKeys.includes(c)).forEach(R=>{if(!t.value)return;(R.condition===void 0||R.condition(n(T)||"",t.value))&&t.value&&R.handler(t.value,c)})}async function l(c){var z,A,V;const T=c.key;if(!yn.includes(T))return;c.preventDefault(),c.stopPropagation(),await a();const k=e.value.findIndex(L=>s(L==null?void 0:L.deref())===t.value),$=(z=e.value[k])==null?void 0:z.deref(),R=T==="ArrowDown",B=T==="ArrowUp";if($){if(R){const L=k<e.value.length-1?k+1:0;u((A=e.value[L])==null?void 0:A.deref())}if(B){const L=k>0?k-1:e.value.length-1;u((V=e.value[L])==null?void 0:V.deref())}i(T,$)}}function r(c){t.value=c}function u(c){const T=s(c);T&&(r(T),c!=null&&c.scrollIntoView&&(c==null||c.scrollIntoView({block:"center"})))}async function h(c){var T;await a(),u((T=e.value[c])==null?void 0:T.deref())}function p(){document.addEventListener("keydown",l,{capture:!0})}function g(){m(),document.removeEventListener("keydown",l,{capture:!0})}function b(c,T){T.keyboardKeys.forEach(k=>{if(yn.includes(k))o.value={...o.value,[c]:T};else throw new Error(`Key ${k} is not supported`)})}function m(){e.value=[]}function P(){return e.value.findIndex(c=>s(c==null?void 0:c.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:p,refreshSelectableItems:a,detachKeydownEvent:g,registerKeyHook:b,getActiveItemIndex:P,setActiveItemId:r,setActiveItemIndex:h}}),_p=St("nodeCreatorViewStacks",()=>{const e=kt(),{getActiveItemIndex:t}=Pp(),o=j([]),n=q(()=>{const c=o.value[o.value.length-1];if(!(c!=null&&c.baselineItems))return c.items?p(c.items):[];if(c.search&&i.value){const T=i.value.length>0?i.value:gn(c.baselineItems??[]);return p(fn(c.search||"",T))}return p(c.baselineItems)}),s=q(()=>{const c=o.value[o.value.length-1];if(!c)return{};const T=gn(c.baselineItems??[]);return{...c,items:n.value,hasSearch:T.length>8||(c==null?void 0:c.hasSearch)}}),a=q(()=>s.value.mode||ze),i=q(()=>{const c=o.value[o.value.length-1];return c!=null&&c.searchItems?c.searchItems.map(T=>Qe(T,c.subcategory)):[]}),l=q(()=>{const c=o.value[o.value.length-1];if(!(c!=null&&c.search))return[];const T=e.mergedNodes.map($=>Qe($));return p(fn(c.search||"",T)).filter($=>!n.value.find(R=>R.key===$.key))}),r=q(()=>yp(e.mergedNodes));async function u(c,T,k){var z;const $=Te();let R,B;T===!0?(R=ee().visibleNodeTypesByInputConnectionTypeNames,B={properties:{title:$.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(R=ee().visibleNodeTypesByOutputConnectionTypeNames,B=Cp().items.find(A=>A.properties.connectionType===c)),await Bn(),g({title:B==null?void 0:B.properties.title,rootView:qt,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:B==null?void 0:B.properties.icon,color:(z=B==null?void 0:B.properties.iconProps)==null?void 0:z.color},panelClass:B==null?void 0:B.properties.panelClass,baseFilter:A=>{var L;if(A.key===Us)return!1;const V=R[c].includes(A.key);return V&&((L=k==null?void 0:k.nodes)!=null&&L.length)?k.nodes.includes(A.key):V},itemsMapper(A){return{...A,subcategory:c}},preventBack:!0})}function h(){const c=o.value[o.value.length-1];if(!c||!s.value.uuid)return;let T=(c==null?void 0:c.items)??[];if(!(c!=null&&c.items)){const k=(c==null?void 0:c.subcategory)??ot,$=r.value[k],R=c.sections;R?T=wp($,R):T=$}if((c.forceIncludeNodes??[]).length>0){const k=e.mergedNodes.filter($=>{var R;return(R=c.forceIncludeNodes)==null?void 0:R.includes($.name)}).map($=>Qe($,c.subcategory));T.push(...k)}c.baseFilter&&(T=T.filter(c.baseFilter)),c.itemsMapper&&(T=T.map(c.itemsMapper)),c.items||(T=Ft(T)),m({baselineItems:T})}function p(c){return c.map(T=>({...T,uuid:`${T.key}-${be()}`}))}function g(c){s.value.uuid&&m({activeIndex:t()});const T=be();o.value.push({...c,uuid:T,transitionDirection:"in",activeIndex:0}),h()}function b(){s.value.uuid&&(o.value.pop(),m({transitionDirection:"out"}))}function m(c){const T=o.value[o.value.length-1],k=o.value.findIndex($=>$.uuid===T.uuid);T&&Object.keys(c).forEach($=>{const R=$;o.value[k]={...o.value[k],[$]:c[R]}})}function P(){o.value=[]}return{viewStacks:o,activeViewStack:s,activeViewStackMode:a,globalSearchItemsDiff:l,gotoCompatibleConnectionView:u,resetViewStacks:P,updateCurrentViewStack:m,pushViewStack:g,popViewStack:b}});function Op(e,t={}){const o=pe(),n=j([0,0]),s=Ie();function a(u){const h=o.nodeViewOffsetPosition,[p,g]=Nt(u),b=h[0]+(p-n.value[0]),m=h[1]+(g-n.value[1]);return o.nodeViewOffsetPosition=[b,m],n.value=[p,g],[b,m]}function i(u,h){if(!(s.isCtrlKeyPressed(u)||h)||o.isActionActive("dragActive"))return;u.button!==xs.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[p,g]=Nt(u);n.value=[p,g];const b=x(e);b==null||b.addEventListener("mousemove",r)}function l(u){if(!o.nodeViewMoveInProgress)return;const h=x(e);h==null||h.removeEventListener("mousemove",r),o.nodeViewMoveInProgress=!1}function r(u){const h=x(e);if(!(u.target&&!(h===u.target||h!=null&&h.contains(u.target)))&&!o.isActionActive("dragActive")){if(u.buttons===Lo.MIDDLE&&(o.nodeViewMoveInProgress=!0),u.buttons===Lo.NONE){const p=x(t.onMouseMoveEnd);p==null||p(u);return}a(u)}}return{moveLastPosition:n,onMouseDown:i,onMouseUp:l,onMouseMove:r,panCanvas:a}}const $p=_e(async()=>await Pe(()=>import("./NodeCreation--SFXDuf-.js").then(e=>e.N),__vite__mapDeps([48,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,49]))),Rp=_e(async()=>await Pe(()=>import("./CanvasControls-QMz-txwk.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,51]))),Ap=_e(async()=>await Pe(()=>import("./SetupWorkflowCredentialsButton-MXDnpOlJ.js"),__vite__mapDeps([52,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Mp=Y({name:"NodeView",components:{NodeDetailsView:mh,Node:Xh,Sticky:ap,CanvasAddButton:Ep,KeyboardShortcutTooltip:hi,NodeCreation:$p,CanvasControls:Rp,ContextMenu:bh,SetupWorkflowCredentialsButton:Ap},async beforeRouteLeave(e,t,o){if(ut(e)===Ke.EXECUTIONS||t.name===J.TEMPLATE_IMPORT||ut(e)===Ke.WORKFLOW&&t.name===J.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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});n===He?(this.workflowsStore.setWorkflowId(Ye),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===J.NEW_WORKFLOW?await this.$router.replace({name:J.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===Ls&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ye),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),n=st(),s=oe(),a=We(),i=Te(),l=it(),r=Cn(),u=Ve(),h=Qt(),{activeNode:p}=Gt(s),g=Ce(p),b=Ie(),{callDebounced:m}=bt(),P=Op(e,{onMouseMoveEnd:o}),c=Dt({router:n}),{runWorkflow:T}=In({router:n});return{locale:i,contextMenu:l,dataSchema:r,nodeHelpers:u,externalHooks:a,clipboard:h,pinnedData:g,deviceSupport:b,canvasPanning:P,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:c,runWorkflow:T,callDebounced:m,...na(),...pi(),...Hs(),...tt(),...Zt(),...sa(),...Yi()}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=ut(e),n=!this.uiStore.nodeViewInitialized;let s=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ye)&&t.name!==J.NEW_WORKFLOW&&e.params.action!=="workflowSave";const a=e.name===J.TEMPLATE_IMPORT;if(o===Ke.WORKFLOW||a){if(s||n||a){if(this.canvasStore.startLoading(),n){const i=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=i}await Promise.all([this.loadCredentials(),this.initView()]),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ke.EXECUTIONS&&(s=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),s&&(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,t,o)=>{console.error("errorCaptured"),console.error(e)},computed:{...le(Xt,mi,bn,kt,ee,oe,Tt,jt,$n,pe,Z,Fs,kt,gi,Pn,eo,fi,ta,ea,Jt),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===J.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!==fe)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===fe)},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 yi(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(){return this.$route.params.name||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===Kt||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[zs,Ze].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.containsChatNodes&&this.triggerNodes.length===1},isExecutionDisabled(){return!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}},data(){return{GRID_SIZE:ct,STICKY_NODE_TYPE:fe,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:Ne,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},async mounted(){var t;this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=this.settingsStore.isPreviewMode&&this.isDemo?[]:[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];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(oa(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(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&js(this.currentUser)<=Ks){const o=await this.uiStore.getNextOnboardingPrompt(),n=(o==null?void 0:o.toast_sequence_number)===1?Ys: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(qs)}})},n)}Ko.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(Ne.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),de.on("newWorkflow",this.newWorkflow),de.on("importWorkflowData",this.onImportWorkflowDataEvent),de.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),de.on("openChat",this.onOpenChat),ce.on("nodeMove",this.onMoveNode),ce.on("revertAddNode",this.onRevertAddNode),ce.on("revertRemoveNode",this.onRevertRemoveNode),ce.on("revertAddConnection",this.onRevertAddConnection),ce.on("revertRemoveConnection",this.onRevertRemoveConnection),ce.on("revertRenameNode",this.onRevertNameChange),ce.on("enableNodeToggle",this.onRevertEnableToggle),Se.on("pin-data",this.addPinDataConnections),Se.on("unpin-data",this.removePinDataConnections),de.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),de.off("newWorkflow",this.newWorkflow),de.off("importWorkflowData",this.onImportWorkflowDataEvent),de.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),de.off("openChat",this.onOpenChat),ce.off("nodeMove",this.onMoveNode),ce.off("revertAddNode",this.onRevertAddNode),ce.off("revertRemoveNode",this.onRevertRemoveNode),ce.off("revertAddConnection",this.onRevertAddConnection),ce.off("revertRemoveConnection",this.onRevertRemoveConnection),ce.off("revertRenameNode",this.onRevertNameChange),ce.off("enableNodeToggle",this.onRevertEnableToggle),Se.off("pin-data",this.addPinDataConnections),Se.off("unpin-data",this.removePinDataConnections),de.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},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.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),de.off("newWorkflow",this.newWorkflow),de.off("importWorkflowData",this.onImportWorkflowDataEvent),de.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ye),Ko.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const n=t??this.ndvStore.activeNodeName,s=n?this.workflowsStore.getNodeByName(n):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&s&&this.insertNodeAfterSelected({index:0,endpointUuid:`${s.id}-input${e}0`,eventSource:Ne.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:s.id})})},editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return 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}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.externalHooks.run("nodeView.onRunNode",n),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(Gs)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Pt(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)===wi).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 s;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((s=t==null?void 0:t.issues)==null?void 0:s.input)??{}).forEach(a=>{n.filter(l=>l._defaultType.scope===a).forEach(l=>{const r=l==null?void 0:l.endpoint;r&&r.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(Ne.NO_TRIGGER_EXECUTION_TOOLTIP)});const 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.settingsStore.fetchPromptsData(),this.$route.name===J.EXECUTION_DEBUG&&await this.$router.replace({name:J.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"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(ze),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(s){this.showError(s,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(Ye),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes($e(t.workflowData.nodes),$e(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&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let s=!1;if(t.data.resultData.runData){const a=t.data.resultData.runData;e:for(const i of Object.keys(a))for(const l of a[i])if(l.error){s=!0;break e}}!s&&t.data.resultData.error.stack&&(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=vi(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.workflowsStore.activeWorkflowExecution=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(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:J.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:Js(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:J.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},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.workflowsStore.activeWorkflowExecution;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.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(s=>s.id);this.workflowsStore.setWorkflowTagIds(n||[]),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.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=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.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp(e)},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),n=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,s=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,a=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!a){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const i=e.path||e.composedPath&&e.composedPath();for(const r of i)if(r.className&&typeof r.className=="string"&&r.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&s){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const l=this.uiStore.getSelectedNodes.map(r=>r&&this.workflowsStore.getNodeByName(r.name)).filter(r=>!!r);if(e.key==="d"&&s&&!a)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},l);else if(e.key==="d"&&t&&!a)l.length>0&&(e.preventDefault(),this.duplicateNodes(l));else if(e.key==="p"&&s&&!a)l.length>0&&(e.preventDefault(),this.togglePinNodes(l,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&s&&!a)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},l);else if(e.key==="Tab"&&s&&!a)this.onToggleNodeCreator({source:Ne.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!a)this.onRunWorkflow();else if(e.key==="S"&&o&&!a)this.onAddNodes({nodes:[{type:fe}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&s&&!a){const r=this.lastSelectedNode;r!==null&&r.type!==fe&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},r.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},l);else if(e.key==="x"&&t&&!a)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},l);else if(e.key==="n"&&n){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===J.NEW_WORKFLOW?de.emit("newWorkflow"):this.$router.push({name:J.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&s){const r=this.lastSelectedNode;if(r!==null){if(r.type===fe&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=r.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowsStore.outgoingConnectionsByNodeName(r.name);if(u.main===void 0||u.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},u.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"&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowHelpers.getCurrentWorkflow();if(!u.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=u.connectionsByDestinationNode[r.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)&&s){const r=this.lastSelectedNode;if(r===null)return;const u=this.workflowHelpers.getCurrentWorkflow();if(!u.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=u.connectionsByDestinationNode[r.name];if(!Array.isArray(h.main)||!h.main.length)return;const p=h.main[0][0].node,g=this.workflowsStore.outgoingConnectionsByNodeName(p);if(!Array.isArray(g.main)||!g.main.length)return;let b,m=e.key==="ArrowUp"?-99999999:99999999,P=null;for(const c of g.main)for(const T of c)T.node!==r.name&&(b=this.workflowsStore.getNodeByName(T.node),b&&(e.key==="ArrowUp"?b.position[1]<=r.position[1]&&b.position[1]>m&&(P=b.name,m=b.position[1]):b.position[1]>=r.position[1]&&b.position[1]<m&&(P=b.name,m=b.position[1])));P!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},P,!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(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e){const s=Ce(n);if(o){const a=this.dataSchema.getInputDataWithPinned(n);a.length!==0&&s.setData(a,t)}else s.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 n of o)this.nodeSelectedByName(n);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 n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],s=this.workflowHelpers.getCurrentWorkflow(),a=this.workflowHelpers.getConnectedNodes("downstream",s,e);for(const i of a){const l=this.workflowsStore.nodesByName[i],r=l.position;if(l.position[0]<n.position[0])continue;const u={name:i,properties:{position:[l.position[0]+t,l.position[1]]}};this.workflowsStore.updateNodeProperties(u),this.onNodeMoved(l),(o&&r[0]!==u.properties.position[0]||r[1]!==u.properties.position[1])&&this.historyStore.pushCommandToUndo(new Ni(i,r,u.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 n={meta:{...this.workflowsStore.workflow.meta??{},instanceId:this.rootStore.instanceId},...o};this.workflowHelpers.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const s=JSON.stringify(n,null,2);this.clipboard.copy(s),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(a=>a.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.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 n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},s={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(s),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),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(Pt(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(ut(this.$route)===Ke.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 await this.importWorkflowData(o,"paste",!1)}},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 n={};e.nodes&&e.nodes.forEach(r=>{if(r.webhookId&&Xs.includes(r.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(h=>h.webhookId===r.webhookId)&&(r.webhookId=be()),r.id){const u=be();n[u]=r.id,r.id=u}else r.id=be()}),this.removeUnknownCredentials(e);const s=this.rootStore.instanceId,a=JSON.stringify(Pt(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==s?e.meta.instanceId:"",isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:a}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:a}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:a}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,Be(this.nodes,this.lastClickPosition));const i=await this.addNodesToWorkflow(e);setTimeout(()=>{i.nodes.forEach(r=>{this.nodeSelectedByName(r.name)})});const l=this.settingsStore.areTagsEnabled;if(o&&l&&Array.isArray(e.tags)){const r=await this.tagsStore.fetchAll(),u=new Set(r.map(m=>m.name)),h=e.tags,p=h.filter(m=>!u.has(m.name)),g=[];for(const m of p){const P=this.tagsStore.create(m.name).then(c=>(r.push(c),c));g.push(P)}await Promise.all(g);const b=h.reduce((m,P)=>{const c=r.find(T=>T.name===P.name);return c&&m.push(c.id),m},[]);this.workflowsStore.addWorkflowTagIds(b),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})}}catch(n){this.showError(n,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,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=zt(e.dataTransfer.getData(Qs));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-Ge/2+ct,o[1]-Ge/2];await this.onAddNodes(t,!0,n),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 n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.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 a,i,l,r;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:be(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},s=(a=e.credentials)==null?void 0:a.map(u=>this.credentialsStore.getUsableCredentialByType(u.name)).flat();if(s&&s.length===1){const u=s[0],h=this.credentialsStore.getCredentialById(u.id),p={id:h.id,name:h.name},g={[u.type]:p};await this.loadNodesProperties([n].map(P=>({name:P.type,version:P.typeVersion})));const b=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),m=Fe((b==null?void 0:b.properties)||[],{},!0,!1,n);if(e.credentials){const P=e.credentials.find(T=>T.name===u.type);if((i=P==null?void 0:P.displayOptions)!=null&&i.hide)return n;const c=(l=P==null?void 0:P.displayOptions)==null?void 0:l.show;if(!c)return n.credentials=g,n;if(Object.keys(c).length===1&&c.authentication){n.credentials=g;let T={};for(const k of Object.keys(c)){if(m&&!m[k]){T={},n.credentials=void 0;break}const $=(r=c[k])==null?void 0:r[0];$&&typeof $=="string"&&(T[k]=$),n.parameters={...n.parameters,...T}}}}}return n},async injectNode(e,t={},o=!0,n=!1,s=!1){var u,h;const a=this.nodeTypesStore.getNodeType(e);if(a===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(a.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=a.maxNodes){this.showMaxNodeTypeError(a);return}const i=await this.getNewNodeWithDefaultCredential(a,{name:t.name}),l=this.lastSelectedNode;if(t.position)i.position=Be(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(l){const p=this.canvasStore.lastSelectedConnection;if(p){const[g]=ki(p);g<=bi&&this.pushDownstreamNodes(l.name,Ot,n)}if(this.canvasStore.newNodeInsertPosition)i.position=Be(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+ct,this.canvasStore.newNodeInsertPosition[1]-Ge/2]),this.canvasStore.newNodeInsertPosition=null;else{let g=0;const b=this.workflowHelpers.getCurrentWorkflow();if(p){const T=this.nodeTypesStore.getNodeType(l.type,l.typeVersion);if(T){const k=[[-100,100],[-140,0,140],[-240,-100,100,240]],$=Ee(b,l,T),B=we($).filter(z=>z===M.Main);if(B.length>1){const z=k[B.length-2],A=p.__meta?p.__meta.sourceOutputIndex:0;g=z[A]}}}let m=[];try{m=Ee(b,i,a)}catch{}const P=we(m),c=this.nodeTypesStore.getNodeType(l.type,l.typeVersion);if(P.length>0&&P.every(T=>T!==M.Main)){const T=b.getNode(l.name),k=me(b,T,c),R=(we(k)||[]).filter(B=>B!==M.Main).findIndex(B=>m[0]===B);i.position=Be(this.nodes,[l.position[0]+Ge/(Math.max(((u=c==null?void 0:c.inputs)==null?void 0:u.length)??1),1)*R,l.position[1]+Ot],[100,0])}else{const T=me(b,l,c),k=we(T);let $=Ot;k.find(R=>R!==M.Main)&&($+=150),i.position=Be(this.nodes,[l.position[0]+$,l.position[1]+g],[100,0])}}}else{const p=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;i.position=Be(this.nodes,p)}const r=this.locale.localizeNodeName(i.name,i.type);if(i.name=this.uniqueNodeName(r),(h=a.webhooks)!=null&&h.length&&(i.webhookId=be()),await this.addNodes([i],void 0,n),this.workflowsStore.setNodePristine(i.name,!0),this.uiStore.stateIsDirty=!0,e===fe)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),Ti().trackAddedTrigger(e);const p={node_type:e,node_version:i.typeVersion,is_auto_add:s,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};l&&(p.input_node_type=l.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",p)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(i.name,o&&e!==fe)})),i},getConnection(e,t,o,n,s){const a=this.workflowsStore.outgoingConnectionsByNodeName(e)[s];if(a){const i=a[t];if(i)return i.find(l=>l.node===o&&l.index===n)}},connectTwoNodes(e,t,o,n,s){this.uiStore.stateIsDirty=!0;const a=this.workflowsStore.getNodeByName(e),i=this.workflowsStore.getNodeByName(o);if(a&&i&&!this.checkNodeConnectionAllowed(a,i,s)||this.getConnection(e,t,o,n,s))return;const l=[{node:e,type:s,index:t},{node:o,type:s,index:n}];this.__addConnection(l)},async addNode(e,t={},o=!0,n=!1,s=!1){var g;if(!this.editAllowedCheck())return;const a=this.lastSelectedNode,i=this.uiStore.lastSelectedNodeOutputIndex,l=this.uiStore.lastSelectedNodeEndpointUuid,r=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const u=await this.injectNode(e,t,o,n,s);if(!u)return;const h=i||0,p=l||"";if(l&&!s){const b=this.instance.getEndpoint(l);if(b&&this.checkNodeConnectionAllowed(a,u,b.scope)){const m=b.scope,P=this.instance.getManagedElement(u.id),T=this.instance.getEndpoints(P).find(k=>k.scope===m&&b.parameters.connection!==k.parameters.connection);(g=this.instance)==null||g.connect({uuids:[p,(T==null?void 0:T.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(a&&!s){if(await this.$nextTick(),r!=null&&r.__meta){this.__deleteJSPlumbConnection(r,n);const b=r.__meta.targetNodeName,m=r.__meta.targetOutputIndex;this.connectTwoNodes(u.name,0,b,m,M.Main)}this.connectTwoNodes(a.name,h,u.name,0,M.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.workflowHelpers.getCurrentWorkflow(),s=n.getNode(e);if(!s)return{nodes:[]};const a=this.nodeTypesStore.getNodeType(s==null?void 0:s.type,s.typeVersion);if(a){const l=me(n,s,a).filter(r=>!(typeof r=="string"||r.type!==t||!r.filter));l.length&&(o=l[0].filter)}return o},insertNodeAfterSelected(e){var a,i,l;const t=e.outputType??M.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((i=(a=e.connection)==null?void 0:a.target.jtk)==null?void 0:i.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((l=e.connection)==null?void 0:l.endpoints[0].parameters.connection)==="source";t!==M.Main&&Object.values(M).includes(t)&&_p().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(r=>{})},async onEventConnectionAbort(e){var t,o;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const n=this.workflowsStore.getNodeById(e.parameters.nodeId),s=e.parameters.type??M.Main,a=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(n){const i=e.parameters.connection==="target",l=i?this.pullConnActiveNodeName:n.name,r=i?n.name:this.pullConnActiveNodeName,u=e.parameters.index;Yo(e),await this.$nextTick(),this.connectTwoNodes(l,u,r,((o=a==null?void 0:a.parameters)==null?void 0:o.index)??0,s),this.pullConnActiveNodeName=null,this.dropPrevented=!1}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:Ne.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var s;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((s=n==null?void 0:n.inputs)!=null&&s.length){const a=this.workflowHelpers.getCurrentWorkflow(),i=a.getNode(t.name);let l=[];n&&(l=me(a,i,n));for(const r of l||[])if(!(typeof r=="string"||r.type!==o||!r.filter)&&r.filter.nodes.length&&!r.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 n=this.workflowsStore.getNodeById(t.nodeId),s=this.workflowsStore.getNodeById(o.nodeId),a=(n==null?void 0:n.name)||"",i=(s==null?void 0:s.name)||"";return n&&s&&!this.checkNodeConnectionAllowed(n,s,o.type)?!1:this.getConnection(a,t.index,i,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 r=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=r}const n=e.sourceEndpoint.parameters,s=e.targetEndpoint.parameters,a=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,i=(o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name;a&&i&&(e.connection.__meta={sourceNodeName:a,sourceOutputIndex:n.index,targetNodeName:i,targetOutputIndex:s.index}),ht(e.connection),Si(e.targetEndpoint);const l=[{node:a,type:n.type,index:n.index},{node:i,type:s.type,index:s.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:l}),!this.isReadOnlyRoute&&!this.readOnlyEnv){Di(e.sourceEndpoint),Ei(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:Ne.NODE_CONNECTION_ACTION})});const r=Ii(e.connection,Ci);n.type!==M.Main&&(e.connection.setPaintStyle(Pi(e.connection,e.sourceEndpoint.parameters.category)),r==null||r.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new _i(l)),this.isInsertingNodes||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var r,u;qo(e.source,e.target,(u=(r=e.connection)==null?void 0:r.connector)!=null&&u.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(n){console.error(n)}},addConectionsTestData(){this.instance.connections.forEach(e=>{var t;qo(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=>{Go(t),Jo(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.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)&&$t(this.activeConnection),this.enterTimer=void 0,e&&(Oi(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)&&($t(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Xo(e.connection);const n=e.connection.parameters,s=e.originalEndpoint.parameters,a=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name)||"",type:s.type,index:s.index}];this.__removeConnection(a,!1)}catch(n){console.error(n)}},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 n=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=n}const o=Qo(e);if(Xo(e.targetEndpoint),$i(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).name,a=e.connection.parameters.index,i=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new pt(o)),this.connectTwoNodes(s,a,this.pullConnActiveNodeName,((t=i==null?void 0:i.parameters)==null?void 0:t.index)??0,M.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const n=new pt(o,this);this.historyStore.pushCommandToUndo(n)}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,$t(e),ht(e);const o=e.scope,n=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),a=e.parameters.connection==="source"?"target":"source",i=n.filter(u=>{const h=u.jtk.endpoint;if(!h)return!1;const p=h.parameters.nodeId===e.parameters.nodeId,g=h.parameters.connection;return!p&&g===a}),l=u=>{if(!e)return;const h=i.filter(p=>{const g=p.jtk.endpoint;if(p.classList.contains("jtk-floating-endpoint"))return!1;const b=en(p,u,50),m=en(g.element,u,30);if(b||m){const P=this.workflowsStore.getNodeById(g.parameters.nodeId);if(P)return!!this.nodeTypesStore.getNodeType(P.type,P.typeVersion)}return!1}).sort((p,g)=>{const b=Zo(p,u,50),m=Zo(g,u,50);return!(b!=null&&b.y)&&!(m!=null&&m.y)?0:b!=null&&b.y?m!=null&&m.y?m.y-b.y:-1:1});if(h.length>0){const g=h[0].jtk.endpoint,b=this.workflowsStore.getNodeById(g.parameters.nodeId);this.pullConnActiveNodeName=(b==null?void 0:b.name)??null,Ri(e,g)}else Ai(e),this.pullConnActiveNodeName=null},r=u=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(u),Yo(e),window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",r),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",l),window.addEventListener("touchmove",l),window.addEventListener("mouseup",r),window.addEventListener("touchend",l),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:Ne.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:Ne.ADD_INPUT_ENDPOINT,nodeCreatorView:vt,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ft,this.onEventConnectionAbort),this.instance.bind(Ho,this.onInterceptBeforeDrop),this.instance.bind(Fo,this.onEventConnection),this.instance.bind(an,this.onDragMove),this.instance.bind(rn,this.onConnectionMouseOver),this.instance.bind(ln,this.onConnectionMouseOut),this.instance.bind(zo,this.onConnectionMoved),this.instance.bind(dn,this.onEndpointMouseOver),this.instance.bind(un,this.onEndpointMouseOut),this.instance.bind(dt,this.onConnectionDetached),this.instance.bind(gt,this.onConnectionDrag),this.instance.bind([gt,ft,dt],this.onConnectionDragAbortDetached),this.instance.bind(tn,this.onPlusEndpointClick),this.instance.bind(on,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ft,this.onEventConnectionAbort),this.instance.unbind(Ho,this.onInterceptBeforeDrop),this.instance.unbind(Fo,this.onEventConnection),this.instance.unbind(an,this.onDragMove),this.instance.unbind(rn,this.onConnectionMouseOver),this.instance.unbind(ln,this.onConnectionMouseOut),this.instance.unbind(zo,this.onConnectionMoved),this.instance.unbind(dn,this.onEndpointMouseOver),this.instance.unbind(un,this.onEndpointMouseOut),this.instance.unbind(dt,this.onConnectionDetached),this.instance.unbind(gt,this.onConnectionDrag),this.instance.unbind(gt,this.onConnectionDragAbortDetached),this.instance.unbind(ft,this.onConnectionDragAbortDetached),this.instance.unbind(dt,this.onConnectionDragAbortDetached),this.instance.unbind(tn,this.onPlusEndpointClick),this.instance.unbind(on,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const s of n||[]){const a=s==null?void 0:s.endpoint;a&&a.type===Mi&&a.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*Zs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.canvasStore.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},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===J.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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(n===He)await this.workflowHelpers.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===ei)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(s){this.showError(s,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:J.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}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([J.WORKFLOW,J.NEW_WORKFLOW])},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Ht(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?On(n.id,t,o):null},__addConnection(e){var s;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 n=[t,o];(s=this.instance)==null||s.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})},__removeConnection(e,t=!1){var o,n;if(t){const s=this.workflowsStore.getNodeByName(e[0].node),a=this.workflowsStore.getNodeByName(e[1].node);if(!s||!a)return;const i=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),l=((o=i==null?void 0:i.outputs)==null?void 0:o[e[0].index])||M.Main,r=typeof l=="string"?l:l.name,u=Lt(r);((n=this.instance)==null?void 0:n.getConnections({scope:u,source:s.id,target:a.id})).forEach(p=>{p.__meta?p.__meta.sourceOutputIndex===e[0].index&&p.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(p):this.__deleteJSPlumbConnection(p)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,s;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const a=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:M.Main},{index:(s=e.__meta)==null?void 0:s.targetOutputIndex,node:e.__meta.targetNodeName,type:M.Main}],i=new pt(a,this);this.historyStore.pushCommandToUndo(i)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Qo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new pt(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=$e(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const s=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:s}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{Jo(n),Go(n)})},onNodeRun({name:e,data:t,waiting:o}){var l;const n=this.workflowsStore.pinnedWorkflowData;if(n!=null&&n[e]){const{outgoing:r}=this.getIncomingOutgoingConnections(e);r.forEach(u=>{var h;if(((h=u.__meta)==null?void 0:h.sourceNodeName)===e){const p=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Wi({connection:u,overlayIds:[xi],classNames:p?["has-run"]:[],includeConnector:!0})}});return}const s=e,a=this.workflowsStore.getNodeByName(s),i=a!==null?a.id:"";if(t===null||t.length===0||o){((l=this.instance)==null?void 0:l.getConnections({source:i})).forEach(h=>{ht(h)}),Vi(a,this.instance).forEach(h=>{h.endpoint.type==="N8nPlus"&&h.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,a)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const s=[];if(s.includes(n.type)){let p=!1;for(const g of this.nodes)if(g.name!==n.name&&s.includes(g.type)){p=!0;break}if(!p)return}n.type===fe?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===En}):(this.externalHooks.run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let a=!1;const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),l=this.workflowHelpers.getCurrentWorkflow(),r=l.getNode(n.name);let u=[],h=[];if(i&&(u=me(l,r,i),h=Ee(l,r,i)),h.length===1&&u.length===1){const{incoming:p,outgoing:g}=this.getIncomingOutgoingConnections(n.name);if(p.length===1&&g.length===1){const b=p[0],m=g[0];if(b.__meta&&m.__meta){a=!0;const P=b.__meta.sourceNodeName,c=b.__meta.sourceOutputIndex,T=m.__meta.targetNodeName,k=m.__meta.targetOutputIndex;setTimeout(()=>{var $;this.connectTwoNodes(P,c,T,k,M.Main),a&&(($=this.instance)==null||$.setSuspendDrawing(!1,!0),a=!1)},100)}}}Bn(()=>{var p,g,b;(p=this.instance)==null||p.setSuspendDrawing(!0),(((g=this.instance)==null?void 0:g.endpointsByElement[n.id])||[]).flat().forEach(m=>{var P;return(P=this.instance)==null?void 0:P.deleteEndpoint(m)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),a||(b=this.instance)==null||b.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new Li(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},a?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});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==He)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){var i;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const s=((i=this.activeNode)==null?void 0:i.name)===e;s&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const a=this.workflowHelpers.getCurrentWorkflow(!0);a.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new _n(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(a.nodes),a.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),s&&(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 n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const a=o.id.toString(),i=n.find(l=>l.id===a);if(i){(i.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:i.id,name:i.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const s=n.filter(a=>a.name===o.name);s.length===1&&(e.credentials[t].id=s[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var s,a;if(!(e!=null&&e.length))return;this.isInsertingNodes=!0,await this.loadNodesProperties(e.map(i=>({name:i.type,version:i.typeVersion})));let n;e.forEach(i=>{if(i.id||(i.id=be()),n=this.nodeTypesStore.getNodeType(i.type,i.typeVersion),i.hasOwnProperty("disabled")||(i.disabled=!1),i.hasOwnProperty("parameters")||(i.parameters={}),n!==null){let l=null;try{l=Fe(n.properties,i.parameters,!0,!1,i)}catch(r){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${i.name}"`),console.error(r)}i.parameters=l!==null?l:{},[Re,Me].includes(i.type)&&i.parameters.path===""&&(i.parameters.path=i.webhookId)}this.matchCredentials(i),this.workflowsStore.addNode(i),o&&this.historyStore.pushCommandToUndo(new Bi(i))}),await this.$nextTick(),(s=this.instance)==null||s.setSuspendDrawing(!0),t&&await this.addConnections(t),this.nodeHelpers.refreshNodeIssues(),this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),this.isInsertingNodes=!1,(a=this.instance)==null||a.setSuspendDrawing(!1,!0)},async addConnections(e){const t=[];for(const o in e)for(const n in e[o])e[o][n].forEach((s,a)=>{s&&s.forEach(i=>{t.push([{node:o,type:n,index:a},{node:i.node,type:i.type,index:i.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(s=>{this.__addConnection(s)})},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.workflowHelpers.getNodeTypesMaxCount();let s,a;const i=[];await this.loadNodesProperties(e.nodes.map(c=>({name:c.type,version:c.typeVersion}))),e.nodes.forEach(c=>{if(n[c.type]!==void 0)if(n[c.type].exist>=n[c.type].max){t[c.name]=n[c.type].nodeNames[0];return}else n[c.type].exist+=1;s=c.name;const T=this.locale.localizeNodeName(c.name,c.type);a=this.uniqueNodeName(T,o),o.push(a),t[s]=a,i.push(c)});const l={},r=e.connections,u=i.map(c=>c.name);let h,p,g,b,m;for(h of Object.keys(r)){if(!u.includes(h))continue;const c={};for(p of Object.keys(r[h]))for(c[p]=[],g=0;g<r[h][p].length;g++){const T=[];if(r[h][p][g])for(b=0;b<r[h][p][g].length;b++)m=r[h][p][g][b],u.includes(m.node)&&T.push(m);c[p].push(T)}l[h]=c}const P=this.workflowHelpers.getWorkflow(i,l);for(s in t)s!==t[s]&&P.renameNode(s,t[s]);if(e.pinData){let c=!0;for(const T of Object.keys(e.pinData)){if(!c){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const k=P.nodes[t[T]];try{Ce(k).setData(e.pinData[T],"add-nodes"),c=!0}catch($){c=!1,console.error($)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(P.nodes),P.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(P.nodes),connections:P.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const p of e){o=this.workflowHelpers.getNodeDataToSave(p),n.push(p.name),t.nodes.push(o);const g=this.workflowsStore.pinDataByNodeName(p.name);if(g&&(t.pinData[p.name]=g),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(Dn.Sharing)){const b=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([m,P])=>{var c;return P.id&&(!b[P.id]||((c=b[P.id])==null?void 0:c.currentUserHasAccess))}))}}let s,a,i,l,r,u,h;return t.nodes.forEach(p=>{if(a=this.workflowsStore.outgoingConnectionsByNodeName(p.name),Object.keys(a).length!==0){h={};for(i of Object.keys(a))for(r=0;r<a[i].length;r++){for(s=[],l=0;l<a[i][r].length;l++)u=a[i][r][l],n.indexOf(u.node)!==-1&&s.push(u);s.length&&(h.hasOwnProperty(i)||(h[i]=[]),h[i][r]=s)}Object.keys(h).length&&(t.connections[p.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(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const s=Array.isArray(n.version)?n.version:[n.version];e.find(a=>a.name===n.name&&s.includes(a.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.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 n=JSON.parse(e.data);if(n&&n.command==="openWorkflow")try{await this.importWorkflowExact(n),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:s.message,type:"error"})}else if(n&&n.command==="openExecution")try{this.isProductionExecutionPreview=n.executionMode!=="manual",await this.openExecution(n.executionId),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(s){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:s.message,type:"error"})}else(n==null?void 0:n.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=n.execution)}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){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=this.workflowsStore.getWorkflowResultDataByNodeName(t)!==null,s=["pinned"];n&&s.push("has-run"),((i=this.instance)==null?void 0:i.getConnections({source:o.id})).forEach(l=>{Ui(l,{total:e[t].length,iterations:0,classNames:s})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var s;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(s=this.instance)==null?void 0:s.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(ht),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Ut:ze),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case vt:n="ai";break;case Ut:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let s=n;for(const{type:u,isAutoAdd:h,name:p,openDetail:g,position:b}of e){await this.addNode(u,{position:b??s,dragAndDrop:o,name:p},g??!1,!0,h);const m=this.nodes[this.nodes.length-1];s=[m.position[0]+Ge*2+ct,m.position[1]]}const a=this.nodes.length-e.length;for(const{from:u,to:h}of t){const p=this.nodes[a+u.nodeIndex],g=this.nodes[a+h.nodeIndex];this.connectTwoNodes(p.name,u.outputIndex??0,g.name,h.inputIndex??0,M.Main)}const i=this.nodes[this.nodes.length-1],r=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(i.name,1);r.length>1&&r.slice(1).forEach((u,h)=>{const p=this.workflowsStore.getNodeByName(u.name);p&&this.onMoveNode({nodeName:p.name,position:[p.position[0],p.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 n;o&&((n=this.instance)==null||n.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=be(),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,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.nodeHelpers.disableNodes([o])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[J.NEW_WORKFLOW,J.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:J.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===J.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:Ne.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:fe}],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);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),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)}}}),Wp="_content_yewsk_1",Vp="_shake_yewsk_9",Bp="_setupCredentialsButtonWrapper_yewsk_27",Up={content:Wp,shake:Vp,setupCredentialsButtonWrapper:Bp},xp=["textContent"],Lp={key:0,class:"workflow-execute-wrapper"};function Hp(e,t,o,n,s,a){const i=S("CanvasAddButton"),l=S("Node"),r=S("Sticky"),u=S("NodeDetailsView"),h=S("SetupWorkflowCredentialsButton"),p=S("NodeCreation"),g=S("CanvasControls"),b=S("ContextMenu"),m=S("n8n-button"),P=S("KeyboardShortcutTooltip"),c=S("n8n-icon-button"),T=Et("touch");return d(),N("div",{ref:"nodeViewRootRef",class:D(e.$style.content)},[f("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[14]||(t[14]=(...k)=>e.onDragOver&&e.onDragOver(...k)),onDrop:t[15]||(t[15]=(...k)=>e.onDrop&&e.onDrop(...k))},[Q((d(),N("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[4]||(t[4]=(...k)=>e.mouseDown&&e.mouseDown(...k)),onTouchend:t[5]||(t[5]=(...k)=>e.mouseUp&&e.mouseUp(...k)),onTouchmove:t[6]||(t[6]=(...k)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...k)),onMousedown:t[7]||(t[7]=(...k)=>e.mouseDown&&e.mouseDown(...k)),onMouseup:t[8]||(t[8]=(...k)=>e.mouseUp&&e.mouseUp(...k)),onContextmenu:t[9]||(t[9]=(...k)=>e.contextMenu.open&&e.contextMenu.open(...k)),onWheel:t[10]||(t[10]=(...k)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...k))},[f("div",{id:"node-view-background",class:"node-view-background",style:se(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),f("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:se(e.workflowStyle),"data-test-id":"node-view"},[Q(y(i,{ref:"canvasAddButton",style:se(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:t[0]||(t[0]=k=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onHook:mounted"]),[[ae,e.showCanvasAddButton]]),(d(!0),N(te,null,ue(e.nodesToRender,k=>(d(),_(l,{key:`${k.id}_node`,name:k.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===k.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[1]||(t[1]=$=>e.removeNode($,!0)),onToggleDisableNode:t[2]||(t[2]=$=>e.toggleActivationNodes([$]))},{"custom-tooltip":v(()=>[f("span",{textContent:w(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,xp)]),_: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)),(d(!0),N(te,null,ue(e.stickiesToRender,k=>(d(),_(r,{key:`${k.id}_sticky`,name:k.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===k.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[3]||(t[3]=$=>e.removeNode($,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[T,e.touchTap,"tap"]]),y(u,{"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"]),(d(),_(De,null,{default:v(()=>[f("div",{class:D(e.$style.setupCredentialsButtonWrapper)},[y(h)],2)]),_:1})),(d(),_(De,null,{default:v(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),_(p,{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"])):E("",!0)]),_:1})),(d(),_(De,null,{default:v(()=>[y(g)]),_:1})),(d(),_(De,null,{default:v(()=>[y(b,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(d(),N("div",Lp,[e.isManualChatOnly?E("",!0):(d(),N("span",{key:0,onMouseenter:t[11]||(t[11]=k=>e.showTriggerMissingToltip(!0)),onMouseleave:t[12]||(t[12]=k=>e.showTriggerMissingToltip(!1)),onClick:t[13]||(t[13]=(...k)=>e.onRunContainerClick&&e.onRunContainerClick(...k))},[y(P,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:v(()=>[y(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:re(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(d(),_(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:re(e.onOpenChat,["stop"])},null,8,["onClick"])):E("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(d(),_(c,{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:re(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):E("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(d(),_(c,{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:re(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):E("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(d(),_(c,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:re(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):E("",!0)])):E("",!0)],32)],2)}const Fp={$style:Up},zp=G(Mp,[["render",Hp],["__cssModules",Fp],["__scopeId","data-v-562ca1f4"]]),uf=Object.freeze(Object.defineProperty({__proto__:null,default:zp},Symbol.toStringTag,{value:"Module"}));export{rf as A,Ar as D,uf as N,df as R,lf as T,_p as a,Pp as b,Cp as c,gn as f,Ft as s,Qe as t,kt as u};
9
+ //# sourceMappingURL=NodeView-7yZJ9OMj.js.map