@decocms/mesh 2.49.0 → 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/client/assets/{AlertCircle-BFx0e2Kg.js → AlertCircle-Di9gDF27.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CXYe7OQX.js → ArrowLeft-DRT5Kva0.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-R0MaTaQm.js → ArrowUp-ADrR5tBm.js} +1 -1
  4. package/dist/client/assets/{Check-Dl4vgpiq.js → Check-DV_PJHoi.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-Bw360URq.js → ChevronDown-miVIsNeU.js} +1 -1
  6. package/dist/client/assets/{Code01-C5Af9Cmu.js → Code01-DsGXDkFW.js} +1 -1
  7. package/dist/client/assets/{Copy01-Dwxl1_b8.js → Copy01-DjFu-LyY.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-jAK3hIr0.js → CpuChip02-DaRabvxH.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-CO9lVWWD.js → DotsHorizontal-9EIbueXK.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-7fR0Oh92.js → DotsVertical-A_4-2fyA.js} +1 -1
  11. package/dist/client/assets/{Download01-D3LKI3um.js → Download01-CVks9g2O.js} +1 -1
  12. package/dist/client/assets/{Edit01-eTcj7luW.js → Edit01-DCEA2Qo9.js} +1 -1
  13. package/dist/client/assets/{File06-CR5y5_r6.js → File06-C6uwXICm.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BSrHPBCD.js → FilterLines-DJ93i98-.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-CECNBiyR.js → FlipBackward-DRTxuL3t.js} +1 -1
  16. package/dist/client/assets/{Grid01-z7B51opS.js → Grid01-BoZHahfB.js} +1 -1
  17. package/dist/client/assets/{Home02-D3uKc5vy.js → Home02-muh-RG9B.js} +1 -1
  18. package/dist/client/assets/{Image01-DaJkh8SV.js → Image01-D9YYSrLM.js} +1 -1
  19. package/dist/client/assets/{Inbox01-DN0A5urx.js → Inbox01-Cq_E93Vb.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-BIImTW8l.js → InfoCircle-Bsvsn9PN.js} +1 -1
  21. package/dist/client/assets/{Key01-CtWWv5DE.js → Key01-oOseIqFa.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CkozvERL.js → LinkExternal01-2BudTXxn.js} +1 -1
  23. package/dist/client/assets/{List-DjfxyLsa.js → List-Cxn3eArS.js} +1 -1
  24. package/dist/client/assets/{Loading01-DQ8Kn5fo.js → Loading01-aRByu34A.js} +1 -1
  25. package/dist/client/assets/{Lock01-D21WF_7F.js → Lock01-Brl3PEsE.js} +1 -1
  26. package/dist/client/assets/Pin01-DSY0pMf_.js +1 -0
  27. package/dist/client/assets/{Play-Bh_tgkP3.js → Play-DxbISkTi.js} +1 -1
  28. package/dist/client/assets/{Plus-BcDBhW0L.js → Plus-SY33KYEr.js} +1 -1
  29. package/dist/client/assets/{SearchMd-HI2aO3Sf.js → SearchMd-lbDK5Ate.js} +1 -1
  30. package/dist/client/assets/Share07-ZUAVRGob.js +1 -0
  31. package/dist/client/assets/{Terminal-ByvCcEAl.js → Terminal-CjZh4_rX.js} +1 -1
  32. package/dist/client/assets/{Trash01-BvTKgpoJ.js → Trash01-4FYj2iBl.js} +1 -1
  33. package/dist/client/assets/{Upload01-D5nIw1CS.js → Upload01-Bae6suDr.js} +1 -1
  34. package/dist/client/assets/{X-VemvUJYi.js → X-BEpqZ85A.js} +1 -1
  35. package/dist/client/assets/{XClose-BuJzgPXO.js → XClose-Cpieg5au.js} +1 -1
  36. package/dist/client/assets/agent-detail-DO7NyJaK.js +1 -0
  37. package/dist/client/assets/{agents-gA1FzKB9.js → agents-CYlVMl7O.js} +1 -1
  38. package/dist/client/assets/{alert-dialog-UkKJZN3T.js → alert-dialog-B5fsha1N.js} +1 -1
  39. package/dist/client/assets/{auth-catchall-ClXo_Czy.js → auth-catchall-BNK2FtQ5.js} +1 -1
  40. package/dist/client/assets/{avatar-Cbkc6T1n.js → avatar-ADVP1wQ0.js} +1 -1
  41. package/dist/client/assets/{badge-BGQ828q4.js → badge-BUaN0GSU.js} +1 -1
  42. package/dist/client/assets/{binder-D0pyLP77.js → binder-DP2nHbKJ.js} +1 -1
  43. package/dist/client/assets/{button-CFAZeZNj.js → button-lbHs5V7A.js} +1 -1
  44. package/dist/client/assets/{card-BNUgm4Cj.js → card-D3N03iqe.js} +1 -1
  45. package/dist/client/assets/{checkbox-BrJdV6BD.js → checkbox-DsczbnXL.js} +1 -1
  46. package/dist/client/assets/collection-detail-3Vy0aH1H.js +26 -0
  47. package/dist/client/assets/{collection-display-button-KL6yy337.js → collection-display-button-Bm1VRbpn.js} +1 -1
  48. package/dist/client/assets/{collection-header-BRPxBXdV.js → collection-header-EJ18B4Kz.js} +1 -1
  49. package/dist/client/assets/{collection-page-DnOeYCUs.js → collection-page-nhlC30CB.js} +1 -1
  50. package/dist/client/assets/{collection-search-38g04oQk.js → collection-search-DiKIf-5M.js} +1 -1
  51. package/dist/client/assets/{collection-tab-DaMZyMNK.js → collection-tab-D71oDPbA.js} +1 -1
  52. package/dist/client/assets/{collection-table-wrapper-a4UtkhWO.js → collection-table-wrapper-BLZDDtS3.js} +1 -1
  53. package/dist/client/assets/{connect-XdqJNfe-.js → connect-DK_ROefe.js} +1 -1
  54. package/dist/client/assets/{connection-card-eiNrc9Oz.js → connection-card-ClAy-kQR.js} +1 -1
  55. package/dist/client/assets/connection-detail-BQPv-aOL.js +1 -0
  56. package/dist/client/assets/{connections-CXyIFchp.js → connections-lF7xNpQy.js} +1 -1
  57. package/dist/client/assets/constants-B7pfoUZg.js +1 -0
  58. package/dist/client/assets/{constants-00bCXGh6.js → constants-ovc0nrYw.js} +1 -1
  59. package/dist/client/assets/{create-organization-dialog-CwkhEHMQ.js → create-organization-dialog-CY11ou7A.js} +1 -1
  60. package/dist/client/assets/{dialog-DM-upVuo.js → dialog-An0-PT9G.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-BSCcMvpq.js → dropdown-menu-jRXJy65A.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-DT4p-b7r.js → dynamic-plugin-layout-Ba0zmJ4P.js} +1 -1
  63. package/dist/client/assets/empty-state-CDV5F3rR.js +1 -0
  64. package/dist/client/assets/{empty-state-MJclvS0E.js → empty-state-Dcr6oc2T.js} +1 -1
  65. package/dist/client/assets/{env-vars-editor-B5RFEwRD.js → env-vars-editor-DCJfI9ec.js} +1 -1
  66. package/dist/client/assets/{error-boundary-BOGwopZ8.js → error-boundary-FFpmvDrc.js} +1 -1
  67. package/dist/client/assets/{extract-connection-data-ArbtrUUq.js → extract-connection-data-Ck7onbtS.js} +1 -1
  68. package/dist/client/assets/{file-browser-B__vDD-M.js → file-browser-DOWwpgy9.js} +2 -2
  69. package/dist/client/assets/{form-D2fsSg1B.js → form-Dmu6BYOb.js} +1 -1
  70. package/dist/client/assets/{grid-view-gUz58ppA.js → grid-view-2XpZTQtd.js} +1 -1
  71. package/dist/client/assets/{home-DFvABpDO.js → home-JjWXGei6.js} +1 -1
  72. package/dist/client/assets/{index-DOPyUYPA.js → index-8jAlU_ml.js} +1 -1
  73. package/dist/client/assets/index-BXgcsaLF.css +1 -0
  74. package/dist/client/assets/{index-DHEzlhNG.js → index-CSP34uke.js} +78 -78
  75. package/dist/client/assets/{index-CSKo3AB-.js → index-CctEkCg3.js} +2 -2
  76. package/dist/client/assets/{index-C8qswj69.js → index-DOFIWV3y.js} +1 -1
  77. package/dist/client/assets/{index-iYJsRKb1.js → index-DxlXchoO.js} +1 -1
  78. package/dist/client/assets/index-LzJObHKr.js +1 -0
  79. package/dist/client/assets/{infiniteQueryObserver-DITl44kb.js → infiniteQueryObserver-B3MDrAX7.js} +1 -1
  80. package/dist/client/assets/{input-dDHeSId1.js → input-ORro9zKB.js} +1 -1
  81. package/dist/client/assets/{layout-eAPYoLHe.js → layout-B9gKge9L.js} +1 -1
  82. package/dist/client/assets/{localstorage-keys-RorudcE2.js → localstorage-keys-C_QsekvO.js} +1 -1
  83. package/dist/client/assets/{login-Dspy4n1j.js → login-IU-ayTZF.js} +1 -1
  84. package/dist/client/assets/{mcp-oauth-Dyuau07a.js → mcp-oauth-D2MZPKxK.js} +1 -1
  85. package/dist/client/assets/{mcp-server-card-DXECwgUQ.js → mcp-server-card-BgJDEYWw.js} +1 -1
  86. package/dist/client/assets/{mcp-server-detail-BpEadstr.js → mcp-server-detail-HpvwCMXd.js} +2 -2
  87. package/dist/client/assets/{members-DTc-EP6X.js → members-CHefA9td.js} +1 -1
  88. package/dist/client/assets/{monaco-editor-CoGmzjgM.js → monaco-editor-B-LLGrs2.js} +1 -1
  89. package/dist/client/assets/monitoring-J0OpUpWh.js +49 -0
  90. package/dist/client/assets/{oauth-callback-LIfM465p.js → oauth-callback-BGIpYsFZ.js} +1 -1
  91. package/dist/client/assets/page-BylaQxnI.js +1 -0
  92. package/dist/client/assets/{page-p9eXrSJA.js → page-DLa2Zsi-.js} +1 -1
  93. package/dist/client/assets/pin-to-sidebar-button-DOK9Zss0.js +1 -0
  94. package/dist/client/assets/{plugin-empty-state-puwJA1ki.js → plugin-empty-state-n3Py5P3p.js} +1 -1
  95. package/dist/client/assets/{plugin-header-B66oq3LZ.js → plugin-header-CUoi_uCt.js} +1 -1
  96. package/dist/client/assets/{plugins-DshL_s7_.js → plugins-CXvBiPDQ.js} +1 -1
  97. package/dist/client/assets/{popover-7buvgRdj.js → popover-B_K1WCq-.js} +1 -1
  98. package/dist/client/assets/{registry-utils-CbzWp9OX.js → registry-utils-DOkK6lrH.js} +1 -1
  99. package/dist/client/assets/{resizable-BCXkVCQe.js → resizable-N3PmBkp2.js} +1 -1
  100. package/dist/client/assets/{resource-tabs-C_5hrBh-.js → resource-tabs-zgxDm5p_.js} +1 -1
  101. package/dist/client/assets/{select-DIh_ARVf.js → select-eS1X4-WO.js} +1 -1
  102. package/dist/client/assets/{settings-U9Ce1T3p.js → settings-heUtSQ9G.js} +1 -1
  103. package/dist/client/assets/shell-layout-BcqC19mc.js +3 -0
  104. package/dist/client/assets/{spinner-D29bareA.js → spinner-DbbM-Lkf.js} +1 -1
  105. package/dist/client/assets/{switch-CaozShsq.js → switch-CMaQzWDo.js} +1 -1
  106. package/dist/client/assets/{textarea-By7616c7.js → textarea-C5fJqZj1.js} +1 -1
  107. package/dist/client/assets/{tool-set-selector-CPK6fuP0.js → tool-set-selector-OlbxXjN2.js} +1 -1
  108. package/dist/client/assets/{tools-list-DmtwoEPt.js → tools-list-Dt39U_Mc.js} +1 -1
  109. package/dist/client/assets/{tooltip-C6p3ZTWD.js → tooltip-BxqZ0ncr.js} +1 -1
  110. package/dist/client/assets/typewriter-title-Bz16mlWc.js +16 -0
  111. package/dist/client/assets/{use-binding-DWMAlJMq.js → use-binding-B_0dZ2Cu.js} +3 -3
  112. package/dist/client/assets/{use-collections-DxVui4KR.js → use-collections-Dzj9tBCd.js} +1 -1
  113. package/dist/client/assets/{use-connection-M951sLQc.js → use-connection-B2MZNzHN.js} +1 -1
  114. package/dist/client/assets/{use-create-virtual-mcp-jExGASGt.js → use-create-virtual-mcp-CKwMRLUe.js} +1 -1
  115. package/dist/client/assets/{use-list-state-6d2DWIZc.js → use-list-state-UML86H2v.js} +1 -1
  116. package/dist/client/assets/{use-mcp-prompts-B8x8i4pO.js → use-mcp-prompts-4lPkeeHV.js} +1 -1
  117. package/dist/client/assets/{use-members-DR5gTD2C.js → use-members-BX7csdWV.js} +1 -1
  118. package/dist/client/assets/{use-mobile-npvaN7oN.js → use-mobile-DtgIvjED.js} +1 -1
  119. package/dist/client/assets/{use-organization-settings-D2PS4P0Y.js → use-organization-settings-S9rGWmpn.js} +1 -1
  120. package/dist/client/assets/{use-virtual-mcp-sMRp6Cch.js → use-virtual-mcp-B-vfbhzs.js} +1 -1
  121. package/dist/client/assets/useInfiniteQuery-Cb9-alO8.js +1 -0
  122. package/dist/client/assets/{useMutation-B-hML37f.js → useMutation-DogLiEJl.js} +1 -1
  123. package/dist/client/assets/useQuery-606lSbCB.js +1 -0
  124. package/dist/client/assets/{view-mode-toggle-CHe5z87O.js → view-mode-toggle-DMe_n-l4.js} +1 -1
  125. package/dist/client/assets/workflow-DMMWwKId.js +1 -0
  126. package/dist/client/index.html +2 -2
  127. package/dist/server/cli.js +123 -123
  128. package/dist/server/migrate.js +105 -105
  129. package/dist/server/server.js +110 -110
  130. package/package.json +1 -2
  131. package/dist/client/assets/GitBranch01-CwMj0n-I.js +0 -1
  132. package/dist/client/assets/agent-detail-BogR5s3T.js +0 -1
  133. package/dist/client/assets/collection-detail-CEUGbkaT.js +0 -26
  134. package/dist/client/assets/connection-detail-CKc2_Ofa.js +0 -1
  135. package/dist/client/assets/constants-DViIPxIH.js +0 -1
  136. package/dist/client/assets/empty-state-D5F6myv7.js +0 -1
  137. package/dist/client/assets/index-B0qsrDFa.css +0 -1
  138. package/dist/client/assets/index-BGbU896x.js +0 -1
  139. package/dist/client/assets/monitoring-CcNyiiXy.js +0 -49
  140. package/dist/client/assets/page-BZV40eAE.css +0 -1
  141. package/dist/client/assets/page-BrzvV_Br.js +0 -21
  142. package/dist/client/assets/pin-to-sidebar-button-DTtHVcuw.js +0 -1
  143. package/dist/client/assets/shell-layout-DpAuW-G7.js +0 -3
  144. package/dist/client/assets/typewriter-title-DI2zJB0T.js +0 -16
  145. package/dist/client/assets/useInfiniteQuery-wdX1y8Qt.js +0 -1
  146. package/dist/client/assets/useQuery-CErcyT2z.js +0 -1
  147. package/dist/client/assets/value-BRo4iI4w.js +0 -1
  148. package/dist/client/assets/workflow-2AVxzWvo.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.49.0",
3
+ "version": "2.51.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -90,7 +90,6 @@
90
90
  "@untitledui/icons": "^0.0.19",
91
91
  "@vercel/nft": "^1.1.1",
92
92
  "@vitejs/plugin-react": "^5.1.0",
93
- "@xyflow/react": "^12.10.0",
94
93
  "ai": "^6.0.1",
95
94
  "babel-plugin-react-compiler": "^1.0.0",
96
95
  "better-auth": "1.4.5",
@@ -1 +0,0 @@
1
- import{r}from"./index-CSKo3AB-.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));i.displayName="GitBranch01";export{i};
@@ -1 +0,0 @@
1
- import{r as y,c as M,j as t,p as rt,f as We,a as it,g as at,V as ct,s as dt,bg as mt,bq as ut,u as ft,b as ht,d as xt,a8 as Re}from"./index-CSKo3AB-.js";import{I as Ae,E as pt}from"./empty-state-D5F6myv7.js";import{E as Ye}from"./error-boundary-BOGwopZ8.js";import{C as Ge}from"./checkbox-BrJdV6BD.js";import{c as G,B as q}from"./button-CFAZeZNj.js";import{i as gt}from"./ArrowLeft-CXYe7OQX.js";import{b as He}from"./use-connection-M951sLQc.js";import{C as jt}from"./collection-search-38g04oQk.js";import{I as Ee}from"./input-dDHeSId1.js";import{s as bt}from"./Plus-BcDBhW0L.js";import{i as vt}from"./X-VemvUJYi.js";import{P as yt}from"./pin-to-sidebar-button-DTtHVcuw.js";import{T as Nt}from"./tool-set-selector-CPK6fuP0.js";import{I as St,R as Ct,a as _t,u as De}from"./index-DOPyUYPA.js";import{c as Le,K as Fe}from"./constants-00bCXGh6.js";import{l as wt,a as kt}from"./use-mcp-prompts-B8x8i4pO.js";import{u as It,a as Tt}from"./use-virtual-mcp-sMRp6Cch.js";import{s as Ke}from"./slugify-CEUa2lfQ.js";import{B as Qe}from"./badge-BGQ828q4.js";import{b as Mt,c as $t,a as Pt,D as zt}from"./dialog-DM-upVuo.js";import{F as de,a as Rt,b as me,d as ue,f as fe,c as Ze}from"./form-D2fsSg1B.js";import{R as At}from"./resource-tabs-C_5hrBh-.js";import{S as Et,a as Vt,b as Dt,c as Lt,d as Be}from"./select-DIh_ARVf.js";import{S as Ft}from"./switch-CaozShsq.js";import{T as Bt}from"./textarea-By7616c7.js";import{b as Q,c as Z,T as J,a as X}from"./tooltip-C6p3ZTWD.js";import{i as Je}from"./Check-Dl4vgpiq.js";import{i as Ot}from"./Code01-C5Af9Cmu.js";import{a as qt}from"./Copy01-Dwxl1_b8.js";import{i as Ut}from"./CpuChip02-jAK3hIr0.js";import{i as Wt}from"./FlipBackward-CECNBiyR.js";import{i as Ce}from"./InfoCircle-BIImTW8l.js";import{i as ze}from"./Loading01-DQ8Kn5fo.js";import{a as Yt,V as Gt,b as Ht}from"./layout-eAPYoLHe.js";import"./use-collections-DxVui4KR.js";import"./useMutation-B-hML37f.js";import"./useQuery-CErcyT2z.js";import"./SearchMd-HI2aO3Sf.js";import"./use-organization-settings-D2PS4P0Y.js";import"./ChevronDown-Bw360URq.js";const Xe=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Xe.displayName="ArrowsRight";const et=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));et.displayName="Circle";const tt=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));tt.displayName="Lightbulb02";const st=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));st.displayName="Save01";const ot=({size:o=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));ot.displayName="Share07";const Kt=y.memo(function(e){const s=M.c(20),{connection:l,isSelected:n,hasItemsEnabled:r,activeItemsCount:i,totalItemsCount:a,onSelect:m,onToggle:c}=e,d=n?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=G("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ae,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let x;s[5]!==l.title?(x=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=x):x=s[6];let p;s[7]!==m||s[8]!==f||s[9]!==x?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,x]}),s[7]=m,s[8]=f,s[9]=x,s[10]=p):p=s[10];let g;s[11]!==i||s[12]!==r||s[13]!==c||s[14]!==a?(g=a>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",a]}),t.jsx(Ge,{checked:r,onCheckedChange:c,onClick:Zt})]}),s[11]=i,s[12]=r,s[13]=c,s[14]=a,s[15]=g):g=s[15];let S;return s[16]!==u||s[17]!==p||s[18]!==g?(S=t.jsxs("div",{className:u,children:[p,g]}),s[16]=u,s[17]=p,s[18]=g,s[19]=S):S=s[19],S}),Qt=y.memo(function(e){const s=M.c(18),{connectionId:l,item:n,isSelected:r,onToggle:i}=e,a=`item-${l}-${n.id}`,m=r?"text-foreground":"text-muted-foreground";let c;s[0]!==m?(c=G("text-sm font-medium",m),s[0]=m,s[1]=c):c=s[1];let d;s[2]!==n.name||s[3]!==c?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:c,children:n.name})}),s[2]=n.name,s[3]=c,s[4]=d):d=s[4];let u;s[5]!==n.description?(u=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),s[5]=n.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const x=`item-${l}-${n.id}`;let p;s[10]!==r||s[11]!==i||s[12]!==x?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:x,checked:r,onCheckedChange:i,onClick:Jt})}),s[10]=r,s[11]=i,s[12]=x,s[13]=p):p=s[13];let g;return s[14]!==a||s[15]!==f||s[16]!==p?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:a,children:[f,p]}),s[14]=a,s[15]=f,s[16]=p,s[17]=g):g=s[17],g});function lt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:n,extraContent:r,excludeVirtualMcpId:i}){const[a,m]=y.useState(""),c=y.useDeferredValue(a),[d,u]=y.useState("all"),[f,x]=y.useState(!1),p=y.useRef(new Set(Object.keys(o))),g=He({searchTerm:c.trim()||void 0}),S=i?g.filter(h=>h.connection_type!=="VIRTUAL"?!0:rt(h.connection_url)!==i):g,C=p.current,I=[...C.values()].map(h=>S.find(N=>N.id===h)).filter(h=>h!==void 0),k=S.filter(h=>!C.has(h.id)),j=[...I,...k],v=h=>{const N=o[h];return N!==void 0&&N.length>0},_=j.filter(h=>{if(d==="all")return!0;const N=v(h.id);return d==="selected"?N:d==="unselected"?!N:!0}),[T,$]=y.useState(j[0]?.id??null),w=T?j.find(h=>h.id===T)??null:null,P=w?s(w):[],E=(h,N)=>o[h]?.includes(N)??!1,z=(h,N)=>{const D=o[h]??[],L=D.includes(N),U={...o};if(L){const W=D.filter(H=>H!==N);W.length===0?delete U[h]:U[h]=W}else U[h]=[...D,N];e(U)},R=h=>{const N=j.find(B=>B.id===h);if(!N)return;const D=s(N);if(D.length===0)return;const L=o[h]??[],U=D.map(B=>B.id),W=L.length>0&&U.every(B=>L.includes(B)),H={...o};W?delete H[h]:(H[h]=U,$(h)),e(H)},V=h=>{$(h),x(!0)},F=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:G("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[t.jsx(jt,{value:a,onChange:m,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>u("all"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>u("selected"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>u("unselected"),className:G("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:_.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:_.map(h=>{const D=s(h).length,L=o[h.id]?.length??0;return t.jsx(Kt,{connection:h,isSelected:T===h.id,hasItemsEnabled:v(h.id),activeItemsCount:L,totalItemsCount:D,onSelect:()=>V(h.id),onToggle:()=>R(h.id)},h.id)})})})]}),t.jsx("div",{className:G("flex-1 flex-col",f?"flex":"hidden md:flex"),children:w?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(q,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(gt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ae,{icon:w.icon,name:w.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:w.title}),w.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:w.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Qt,{connectionId:w.id,item:h,isSelected:E(w.id,h.id),onToggle:()=>z(w.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Zt(o){return o.stopPropagation()}function Jt(o){return o.stopPropagation()}function Xt(o){const e=M.c(7),{promptSet:s,onPromptSetChange:l,connectionPrompts:n,excludeVirtualMcpId:r}=o;let i;e[0]!==n?(i=c=>(n.get(c.id)??[]).map(es),e[0]=n,e[1]=i):i=e[1];const a=i;let m;return e[2]!==r||e[3]!==a||e[4]!==l||e[5]!==s?(m=t.jsx(lt,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available",excludeVirtualMcpId:r}),e[2]=r,e[3]=a,e[4]=l,e[5]=s,e[6]=m):m=e[6],m}function es(o){return{id:o.name,name:o.name,description:o.description}}function ts(o){return o.includes("*")}function ss(o){const e=M.c(27),{patterns:s,onAddPattern:l,onRemovePattern:n}=o,[r,i]=y.useState("");let a;e[0]!==r||e[1]!==l||e[2]!==s?(a=()=>{const f=r.trim();f&&!s.includes(f)&&(l(f),i(""))},e[0]=r,e[1]=l,e[2]=s,e[3]=a):a=e[3];const m=a;let c;e[4]!==m?(c=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=c):c=e[5];const d=c;let u;if(e[6]!==m||e[7]!==d||e[8]!==r||e[9]!==n||e[10]!==s){const f=s.filter(ts);let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("code",{children:"*"}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",x," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=_=>i(_.target.value),e[14]=g):g=e[14];let S;e[15]!==d||e[16]!==r?(S=t.jsx(Ee,{value:r,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==r?(C=r.trim(),e[18]=r,e[19]=C):C=e[19];const I=!C;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(bt,{size:16}),e[20]=k):k=e[20];let j;e[21]!==m||e[22]!==I?(j=t.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:I,children:k}),e[21]=m,e[22]=I,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==S?(v=t.jsxs("div",{className:"flex gap-2",children:[S,j]}),e[24]=j,e[25]=S,e[26]=v):v=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,v,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>n(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(vt,{size:12})})]},_))})]}),e[6]=m,e[7]=d,e[8]=r,e[9]=n,e[10]=s,e[11]=u}else u=e[11];return u}function os(o){const e=M.c(24),{resourceSet:s,onResourceSetChange:l,connectionResources:n,excludeVirtualMcpId:r}=o,[i]=y.useState(null);let a;e[0]!==n?(a=j=>(n.get(j.id)??[]).map(ls),e[0]=n,e[1]=a):a=e[1];const m=a;let c;e[2]!==l||e[3]!==s?(c=(j,v)=>{const _=s[j]??[];_.includes(v)||l({...s,[j]:[..._,v]})},e[2]=l,e[3]=s,e[4]=c):c=e[4];const d=c;let u;e[5]!==l||e[6]!==s?(u=(j,v)=>{const T=(s[j]??[]).filter($=>$!==v);if(T.length===0){const $={...s};delete $[j],l($)}else l({...s,[j]:T})},e[5]=l,e[6]=s,e[7]=u):u=e[7];const f=u;let x;e[8]!==l?(x=j=>{l(j)},e[8]=l,e[9]=x):x=e[9];const p=x;let g;e[10]!==s||e[11]!==i?(g=i?s[i]??[]:[],e[10]=s,e[11]=i,e[12]=g):g=e[12];const S=g;let C;e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==S?(C=i?t.jsx(ss,{patterns:S,onAddPattern:j=>d(i,j),onRemovePattern:j=>f(i,j)}):null,e[13]=d,e[14]=f,e[15]=i,e[16]=S,e[17]=C):C=e[17];const I=C;let k;return e[18]!==r||e[19]!==I||e[20]!==m||e[21]!==p||e[22]!==s?(k=t.jsx("div",{className:"h-full",children:t.jsx(lt,{itemSet:s,onItemSetChange:p,getItems:m,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:I,excludeVirtualMcpId:r})}),e[18]=r,e[19]=I,e[20]=m,e[21]=p,e[22]=s,e[23]=k):k=e[23],k}function ls(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function ns(o){const e=M.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=G("grid gap-3",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==l||e[6]!==n?(r=t.jsx(Ct,{"data-slot":"radio-group",className:n,...l}),e[5]=l,e[6]=n,e[7]=r):r=e[7],r}function Pe(o){const e=M.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let n;e[3]!==s?(n=G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=n):n=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(_t,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(et,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=r):r=e[5];let i;return e[6]!==l||e[7]!==n?(i=t.jsx(St,{"data-slot":"radio-group-item",className:n,...l,children:r}),e[6]=l,e[7]=n,e[8]=i):i=e[8],i}function rs(o){const s=new TextEncoder().encode(o),l=Array.from(s,n=>String.fromCharCode(n)).join("");return btoa(l)}const is=ct.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0,metadata:!0}).extend({title:dt().min(1,"Name is required").max(255)});function Oe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const n=e.get(l.connection_id)??[];n.length>0&&(s[l.connection_id]=n)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function qe(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Ue(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function as(o,e,s,l){const n=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(n).map(r=>{const i=o[r]??[],a=l.get(r)??[],m=a.length>0&&a.every(c=>i.includes(c));return{connection_id:r,selected_tools:i.length===0||m?null:i,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function cs(o){const e=M.c(10),{url:s}=o,[l,n]=y.useState(!1);let r;e[0]!==s?(r=async()=>{await navigator.clipboard.writeText(s),n(!0),Re.success("Agent URL copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=r):r=e[1];const i=r;let a;e[2]!==l?(a=l?t.jsx(Je,{size:20,className:"text-green-600"}):t.jsx(qt,{size:20}),e[2]=l,e[3]=a):a=e[3];const m=l?"Copied!":"Copy URL";let c;e[4]!==m?(c=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==i||e[7]!==a||e[8]!==c?(d=t.jsxs(q,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=i,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function ds(o){const e=M.c(7),{url:s,serverName:l}=o;let n;e[0]!==l||e[1]!==s?(n=()=>{const c=Ke(l),u=rs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Re.success("Opening Cursor...")},e[0]=l,e[1]=s,e[2]=n):n=e[2];const r=n;let i,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let m;return e[5]!==r?(m=t.jsxs(q,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[i,a]}),e[5]=r,e[6]=m):m=e[6],m}function ms(o){const e=M.c(11),{url:s,serverName:l}=o,[n,r]=y.useState(!1);let i;e[0]!==l||e[1]!==s?(i=async()=>{const f=Ke(l),p=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${p.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),r(!0),Re.success("Claude Code command copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=l,e[1]=s,e[2]=i):i=e[2];const a=i;let m;e[3]!==n?(m=n?t.jsx(Je,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=n,e[4]=m):m=e[4];const c=n?"Copied!":"Install on Claude";let d;e[5]!==c?(d=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==m||e[9]!==d?(u=t.jsxs(q,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=a,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function us(o){const e=M.c(40),{open:s,onOpenChange:l,virtualMcp:n}=o,[r,i]=y.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=N=>{(N==="passthrough"||N==="smart_tool_selection"||N==="code_execution")&&i(N)},e[0]=a):a=e[0];const m=a;let c;e[1]!==r||e[2]!==n.id?(c=new URL(`/mcp/virtual-mcp/${n.id}`,window.location.origin),c.searchParams.set("mode",r),e[1]=r,e[2]=n.id,e[3]=c):c=e[3];let d;e[4]!==n.id||e[5]!==n.title?(d=n.title||`agent-${n.id.slice(0,8)}`,e[4]=n.id,e[5]=n.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Mt,{children:t.jsx($t,{children:"Share Agent"})}),e[7]=f):f=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Xe,{className:"size-5 text-muted-foreground"})}),e[9]=p):p=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[11]=S):S=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[p,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(Q,{children:t.jsxs(Z,{children:[S,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Pe,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=C):C=e[12];let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(tt,{className:"size-5 text-muted-foreground"})}),e[13]=I):I=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=k):k=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[15]=j):j=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[I,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[k,t.jsx(Q,{children:t.jsxs(Z,{children:[j,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Pe,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=v):v=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ot,{className:"size-5 text-muted-foreground"})}),e[17]=_):_=e[17];let T;e[18]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=T):T=e[18];let $;e[19]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(J,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[19]=$):$=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[_,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[T,t.jsx(Q,{children:t.jsxs(Z,{children:[$,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Pe,{id:"mode-code",value:"code_execution"}),t.jsx(Qe,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=w):w=e[20];let P;e[21]!==r?(P=t.jsxs("div",{className:"flex flex-col gap-3",children:[x,t.jsxs(ns,{value:r,onValueChange:m,className:"flex flex-col gap-4.5",children:[C,v,w]})]}),e[21]=r,e[22]=P):P=e[22];let E;e[23]!==c.href?(E=t.jsx(cs,{url:c.href}),e[23]=c.href,e[24]=E):E=e[24];let z,R;e[25]!==u||e[26]!==c.href?(z=t.jsx(ds,{url:c.href,serverName:u}),R=t.jsx(ms,{url:c.href,serverName:u}),e[25]=u,e[26]=c.href,e[27]=z,e[28]=R):(z=e[27],R=e[28]);let V;e[29]!==E||e[30]!==z||e[31]!==R?(V=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[E,z,R]})}),e[29]=E,e[30]=z,e[31]=R,e[32]=V):V=e[32];let F;e[33]!==P||e[34]!==V?(F=t.jsxs(Pt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[P,V]})]}),e[33]=P,e[34]=V,e[35]=F):F=e[35];let h;return e[36]!==l||e[37]!==s||e[38]!==F?(h=t.jsx(zt,{open:s,onOpenChange:l,children:F}),e[36]=l,e[37]=s,e[38]=F,e[39]=h):h=e[39],h}function fs(o){const e=M.c(27),{form:s,icon:l}=o;let n;e[0]!==s?(n=s.watch("title")||"Agent",e[0]=s,e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ut,{}),e[2]=r):r=e[2];let i;e[3]!==l||e[4]!==n?(i=t.jsx(Ae,{icon:l,name:n,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:r}),e[3]=l,e[4]=n,e[5]=i):i=e[5];let a;e[6]!==s.control?(a=t.jsx(de,{control:s.control,name:"status",render:js}),e[6]=s.control,e[7]=a):a=e[7];let m;e[8]!==i||e[9]!==a?(m=t.jsxs("div",{className:"flex items-start justify-between",children:[i,a]}),e[8]=i,e[9]=a,e[10]=m):m=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(de,{control:s.control,name:"title",render:gs}),t.jsx(de,{control:s.control,name:"description",render:ps})]}),e[11]=s.control,e[12]=c):c=e[12];let d;e[13]!==m||e[14]!==c?(d=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15];let u;e[16]!==s.control?(u=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(de,{control:s.control,name:"tool_selection_mode",render:xs})}),e[16]=s.control,e[17]=u):u=e[17];let f;e[18]!==s.control?(f=t.jsx("div",{className:"flex flex-col gap-3 p-5",children:t.jsx(de,{control:s.control,name:"metadata",render:hs})}),e[18]=s.control,e[19]=f):f=e[19];let x;e[20]!==d||e[21]!==u||e[22]!==f?(x=t.jsxs("div",{className:"flex flex-col",children:[d,u,f]}),e[20]=d,e[21]=u,e[22]=f,e[23]=x):x=e[23];let p;return e[24]!==s||e[25]!==x?(p=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(Rt,{...s,children:x})}),e[24]=s,e[25]=x,e[26]=p):p=e[26],p}function hs(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{children:[t.jsx(Ze,{className:"text-sm font-medium text-foreground mb-1",children:"Instructions"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Define the agent's role, capabilities, and behavior to guide how it interprets requests, uses available tools, and responds to users."})]}),t.jsx(ue,{children:t.jsx(Bt,{value:e.value?.instructions??"",onChange:s=>e.onChange({...e.value??{},instructions:s.target.value||void 0}),placeholder:"You are a helpful assistant that specializes in customer support. Your role is to help users resolve issues and answer questions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})}),t.jsx(fe,{})]})}function xs(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ze,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Q,{children:t.jsxs(Z,{children:[t.jsx(J,{asChild:!0,children:t.jsx(q,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(Ce,{size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(Et,{value:e.value,onValueChange:e.onChange,children:[t.jsx(ue,{children:t.jsx(Vt,{className:"w-[180px]",children:t.jsx(Dt,{})})}),t.jsxs(Lt,{children:[t.jsx(Be,{value:"inclusion",children:"Include Selected"}),t.jsx(Be,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(fe,{})]})}function ps(o){const{field:e}=o;return t.jsxs(me,{className:"w-full space-y-0",children:[t.jsx(ue,{children:t.jsx(Ee,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(fe,{})]})}function gs(o){const{field:e}=o;return t.jsxs(me,{className:"w-full space-y-0",children:[t.jsx(ue,{children:t.jsx(Ee,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(fe,{})]})}function js(o){const{field:e}=o;return t.jsxs(me,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(ue,{children:t.jsx(Ft,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(fe,{})]})}function bs(o){const e=M.c(76),{virtualMcp:s,virtualMcpId:l,requestedTabId:n}=o,i=mt().location.href,a=ut();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/agents/$agentId"},e[0]=m):m=e[0];const c=We(m),d=Tt(),{org:u}=ft();let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={},e[1]=f):f=e[1];const x=He(f),p=x.map(Ss);let g;e[2]!==u?(g=b=>({queryKey:Fe.connectionPrompts(b),queryFn:async()=>{try{const A=await Le({connectionId:b,orgId:u.id});return await wt(A)}catch{return{prompts:[]}}},staleTime:6e4,retry:!1}),e[2]=u,e[3]=g):g=e[3];const S=De({queries:p.map(g)});let C;e[4]!==u?(C=b=>({queryKey:Fe.connectionResources(b),queryFn:async()=>{try{const A=await Le({connectionId:b,orgId:u.id});return await kt(A)}catch{return{resources:[]}}},staleTime:6e4,retry:!1}),e[4]=u,e[5]=C):C=e[5];const I=De({queries:p.map(C)}),k=new Map;p.forEach((b,A)=>{const K=S[A];K?.data?k.set(b,K.data.prompts.map(Ns)):k.set(b,[])});const j=new Map;p.forEach((b,A)=>{const K=I[A];K?.data?j.set(b,K.data.resources.map(ys)):j.set(b,[])});let v;if(e[6]!==x){v=new Map;for(const b of x)b.tools&&b.tools.length>0&&v.set(b.id,b.tools.map(vs));e[6]=x,e[7]=v}else v=e[7];let _;e[8]!==v||e[9]!==s?(_=()=>Oe(s,v),e[8]=v,e[9]=s,e[10]=_):_=e[10];const[T,$]=y.useState(_);let w;e[11]!==s?(w=()=>qe(s),e[11]=s,e[12]=w):w=e[12];const[P,E]=y.useState(w);let z;e[13]!==s?(z=()=>Ue(s),e[13]=s,e[14]=z):z=e[14];const[R,V]=y.useState(z),[F,h]=y.useState(!1),[N,D]=y.useState(!1);let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=b=>{$(b),h(!0)},e[15]=L):L=e[15];const U=L;let W;e[16]===Symbol.for("react.memo_cache_sentinel")?(W=b=>{E(b),h(!0)},e[16]=W):W=e[16];const H=W;let B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=b=>{V(b),h(!0)},e[17]=B):B=e[17];const nt=B;let he;e[18]===Symbol.for("react.memo_cache_sentinel")?(he=ht(is),e[18]=he):he=e[18];const _e=s.tool_selection_mode??"inclusion";let ee;e[19]!==s.metadata?(ee=s.metadata??{instructions:""},e[19]=s.metadata,e[20]=ee):ee=e[20];let xe;e[21]!==_e||e[22]!==ee||e[23]!==s.description||e[24]!==s.status||e[25]!==s.title?(xe={resolver:he,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e,metadata:ee}},e[21]=_e,e[22]=ee,e[23]=s.description,e[24]=s.status,e[25]=s.title,e[26]=xe):xe=e[26];const Y=xt(xe),we=Y.formState.isDirty||F;let pe;e[27]!==d.update||e[28]!==v||e[29]!==Y||e[30]!==R||e[31]!==P||e[32]!==T||e[33]!==l?(pe=async()=>{try{const b=Y.getValues(),A=as(T,P,R,v),K={title:b.title,description:b.description,status:b.status,tool_selection_mode:b.tool_selection_mode,metadata:b.metadata,connections:A};await d.update.mutateAsync({id:l,data:K}),Y.reset(b),h(!1)}catch(b){console.error("Failed to save virtual MCP:",b)}},e[27]=d.update,e[28]=v,e[29]=Y,e[30]=R,e[31]=P,e[32]=T,e[33]=l,e[34]=pe):pe=e[34];const ke=pe;let ge;e[35]!==v||e[36]!==Y||e[37]!==s?(ge=()=>{Y.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",metadata:s.metadata??{instructions:""}}),$(Oe(s,v)),E(qe(s)),V(Ue(s)),h(!1)},e[35]=v,e[36]=Y,e[37]=s,e[38]=ge):ge=e[38];const Ie=ge;let je;e[39]===Symbol.for("react.memo_cache_sentinel")?(je=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[39]=je):je=e[39];const Ve=je,O=Ve.some(b=>b.id===n)?n:"settings";let be;e[40]!==c?(be=b=>{c({search:A=>({...A,tab:b}),replace:!0})},e[40]=c,e[41]=be):be=e[41];const Te=be,ce=d.update.isPending;let te;e[42]!==a.history?(te=()=>a.history.back(),e[42]=a.history,e[43]=te):te=e[43];let se;e[44]!==O||e[45]!==Te?(se=t.jsx(Yt,{children:t.jsx(At,{tabs:Ve,activeTab:O,onTabChange:Te})}),e[44]=O,e[45]=Te,e[46]=se):se=e[46];let oe;e[47]!==Ie||e[48]!==ke||e[49]!==we||e[50]!==ce?(oe=we&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ce,onClick:Ie,"aria-label":"Cancel",children:t.jsx(Wt,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Cancel"})]})}),t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ce,onClick:ke,"aria-label":"Save",children:ce?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Save"})]})})]}),e[47]=Ie,e[48]=ke,e[49]=we,e[50]=ce,e[51]=oe):oe=e[51];let ve;e[52]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>D(!0),e[52]=ve):ve=e[52];let ye;e[53]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(Q,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:ve,"aria-label":"Share",children:t.jsx(ot,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Share"})]})}),e[53]=ye):ye=e[53];const Me=s.icon??"cpu_chip";let le;e[54]!==Me||e[55]!==i||e[56]!==s.title?(le=t.jsx(yt,{title:s.title,url:i,icon:Me}),e[54]=Me,e[55]=i,e[56]=s.title,e[57]=le):le=e[57];let ne;e[58]!==oe||e[59]!==le?(ne=t.jsxs(Gt,{children:[oe,ye,le]}),e[58]=oe,e[59]=le,e[60]=ne):ne=e[60];let Ne;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[61]=Ne):Ne=e[61];const $e=O==="settings"?t.jsx(fs,{form:Y,icon:s.icon}):O==="tools"?t.jsx(Nt,{toolSet:T,onToolSetChange:U,excludeVirtualMcpId:l}):O==="resources"?t.jsx(os,{resourceSet:P,onResourceSetChange:H,connectionResources:j,excludeVirtualMcpId:l}):O==="prompts"?t.jsx(Xt,{promptSet:R,onPromptSetChange:nt,connectionPrompts:k,excludeVirtualMcpId:l}):null;let re;e[62]!==$e?(re=t.jsx(y.Suspense,{fallback:Ne,children:$e}),e[62]=$e,e[63]=re):re=e[63];let ie;e[64]!==O||e[65]!==re?(ie=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ye,{children:re},O)})})}),e[64]=O,e[65]=re,e[66]=ie):ie=e[66];let ae;e[67]!==N||e[68]!==s?(ae=t.jsx(us,{open:N,onOpenChange:D,virtualMcp:s}),e[67]=N,e[68]=s,e[69]=ae):ae=e[69];let Se;return e[70]!==te||e[71]!==se||e[72]!==ne||e[73]!==ie||e[74]!==ae?(Se=t.jsxs(Ht,{onBack:te,children:[se,ne,ie,ae]}),e[70]=te,e[71]=se,e[72]=ne,e[73]=ie,e[74]=ae,e[75]=Se):Se=e[75],Se}function vs(o){return o.name}function ys(o){return{uri:o.uri,name:o.name,description:o.description}}function Ns(o){return{name:o.name,description:o.description}}function Ss(o){return o.id}function Cs(){const o=M.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/agents/$agentId"},o[0]=e):e=o[0];const s=We(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},o[1]=l):l=o[1];const n=it(l),{org:r}=n,i=n.agentId??n.virtualMcpId??"";let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},o[2]=a):a=o[2];const c=at(a).tab||"settings",d=It(i);if(!d){let f;return o[3]!==s||o[4]!==r?(f=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(pt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(q,{variant:"outline",onClick:()=>s({to:"/$org/agents",params:{org:r}}),children:"Back to agents"})})}),o[3]=s,o[4]=r,o[5]=f):f=o[5],f}let u;return o[6]!==c||o[7]!==d||o[8]!==i?(u=t.jsx(bs,{virtualMcp:d,virtualMcpId:i,requestedTabId:c}),o[6]=c,o[7]=d,o[8]=i,o[9]=u):u=o[9],u}function _s(){const o=M.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),o[0]=e):e=o[0],e}function ho(){const o=M.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),o[0]=e):e=o[0],e}export{ho as default};
@@ -1,26 +0,0 @@
1
- import{bG as Q,r as k,o as ms,s as et,c as N,j as o,bg as pt,u as Y,d as ps,m as xs,a as oe,g as hs,a8 as nn,bz as q,bH as gs,ak as bs,ai as xt,aj as ne,al as sn,am as js,ae as ht,af as vs,an as on,ah as rn,au as ys,av as ws,aq as ln,aw as Ss,bI as gt,bJ as Ns,ag as ks,bc as Cs,b6 as Is,bK as _s,bq as cn}from"./index-CSKo3AB-.js";import{E as an,I as Ve,n as Ts}from"./empty-state-D5F6myv7.js";import{E as dn}from"./error-boundary-BOGwopZ8.js";import{a as bt,u as jt,f as vt,e as yt,d as wt}from"./use-collections-DxVui4KR.js";import{u as ee}from"./constants-00bCXGh6.js";import{P as St}from"./pin-to-sidebar-button-DTtHVcuw.js";import{B as K,c as O}from"./button-CFAZeZNj.js";import{F as tt,a as $s,b as Nt,d as kt}from"./form-D2fsSg1B.js";import{I as Ct}from"./input-dDHeSId1.js";import{T as ct}from"./textarea-By7616c7.js";import{T as le,a as ce,b as ae,c as de}from"./tooltip-C6p3ZTWD.js";import{i as un}from"./FlipBackward-CECNBiyR.js";import{a as fn,V as It,b as Ne}from"./layout-eAPYoLHe.js";import{S as mn,a as pn,b as xn,c as hn,d as at}from"./select-DIh_ARVf.js";import{i as Es}from"./AlertCircle-BFx0e2Kg.js";import{s as Os,M as ke}from"./monaco-editor-CoGmzjgM.js";import{i as Rs}from"./Code01-C5Af9Cmu.js";import{a as Ms}from"./Copy01-Dwxl1_b8.js";import{i as $e}from"./Loading01-DQ8Kn5fo.js";import{i as _t,n as As}from"./Play-Bh_tgkP3.js";import{s as Tt}from"./XClose-BuJzgPXO.js";import{u as Ps,O as Ls,M as zs,F as Ds,v as Ws}from"./index-C8qswj69.js";import{u as $t,b as Hs}from"./use-connection-M951sLQc.js";import{E as Et}from"./empty-state-MJclvS0E.js";import{D as Vs,a as Fs}from"./use-binding-DWMAlJMq.js";import{b as gn}from"./use-virtual-mcp-sMRp6Cch.js";import{b as Bs,R as Ut,a as Us}from"./resizable-BCXkVCQe.js";import{S as Ee}from"./spinner-D29bareA.js";import{V as qs}from"./view-mode-toggle-CHe5z87O.js";import{i as Ks}from"./GitBranch01-CwMj0n-I.js";import{N as Js,c as Gs,d as Xs,e as Zs,m as Pe,P as Qs,f as Ys,R as eo,g as to,h as no,j as qt,E as so,k as oo,T as ro,l as io,n as lo,o as bn}from"./index-DHEzlhNG.js";import{b as co,c as ao,d as uo,e as fo,a as mo,D as po}from"./dialog-DM-upVuo.js";import"./index-iYJsRKb1.js";import{s as jn}from"./Plus-BcDBhW0L.js";import{i as Ot}from"./Check-Dl4vgpiq.js";import{i as xo}from"./DotsHorizontal-CO9lVWWD.js";import{D as ho,a as go,b as bo,c as Kt}from"./dropdown-menu-BSCcMvpq.js";import{i as jo}from"./Grid01-z7B51opS.js";import{B as Se}from"./badge-BGQ828q4.js";import{i as vn}from"./X-VemvUJYi.js";import"./useMutation-B-hML37f.js";import"./useQuery-CErcyT2z.js";import"./use-organization-settings-D2PS4P0Y.js";import"./ArrowLeft-CXYe7OQX.js";import"./ChevronDown-Bw360URq.js";import"./infiniteQueryObserver-DITl44kb.js";import"./mcp-oauth-Dyuau07a.js";import"./env-vars-editor-B5RFEwRD.js";import"./Trash01-BvTKgpoJ.js";import"./File06-CR5y5_r6.js";import"./Key01-CtWWv5DE.js";import"./extract-connection-data-ArbtrUUq.js";import"./constants-DViIPxIH.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CbzWp9OX.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-jAK3hIr0.js";import"./Terminal-ByvCcEAl.js";import"./index-DOPyUYPA.js";import"./binder-D0pyLP77.js";import"./localstorage-keys-RorudcE2.js";import"./popover-7buvgRdj.js";import"./Image01-DaJkh8SV.js";import"./SearchMd-HI2aO3Sf.js";import"./use-mcp-prompts-B8x8i4pO.js";import"./ArrowUp-R0MaTaQm.js";import"./Edit01-eTcj7luW.js";import"./use-create-virtual-mcp-jExGASGt.js";const yn=Q("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const wn=Q("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Rt=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Mt=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const yo=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Sn=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Nn=Q("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const kn=Q("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Cn=Q("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const In=Q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),At=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));At.displayName="AlertOctagon";const _n=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));_n.displayName="Box";const Tn=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Tn.displayName="ClockFastForward";const $n=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));$n.displayName="Code02";const Le=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Le.displayName="Columns01";const En=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));En.displayName="CornerDownRight";const On=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));On.displayName="Database01";const Rn=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Rn.displayName="Repeat03";const Pt=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Pt.displayName="Save02";const Mn=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Mn.displayName="Tool01";ms({title:et().min(1),description:et().nullable(),body:et()});function nt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function So(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function No(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(tt,{control:n.control,name:"title",render:Io}),o.jsx(tt,{control:n.control,name:"description",render:Co})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(tt,{control:n.control,name:"body",render:ko})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx($s,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function ko(t){const{field:e}=t;return o.jsx(Nt,{children:o.jsx(kt,{children:o.jsx(ct,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Co(t){const{field:e}=t;return o.jsxs(Nt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(kt,{children:o.jsx(Ct,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Io(t){const{field:e}=t;return o.jsxs(Nt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(kt,{children:o.jsx(Ct,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function _o(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=pt().location.href,{org:c}=Y(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=ee(d),f=bt(n,"PROMPT",s,u),p=jt(n,"PROMPT",u),x=p.update.isPending;let m;e[3]!==f?(m=f?{title:f.title,description:f.description??null,body:nt(f)}:void 0,e[3]=f,e[4]=m):m=e[4];let h;e[5]!==m?(h={values:m},e[5]=m,e[6]=h):h=e[6];const g=ps(h);let b;e[7]!==g||e[8]!==f?(b=()=>{f&&g.reset({title:f.title,description:f.description??null,body:nt(f)})},e[7]=g,e[8]=f,e[9]=b):b=e[9];const j=b;let y;e[10]!==p.update||e[11]!==g||e[12]!==s?(y=g.handleSubmit(async V=>{const J=await p.update.mutateAsync({id:s,data:{title:V.title,description:V.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:V.body}}]}});g.reset({title:J.title,description:J.description??null,body:nt(J)})}),e[10]=p.update,e[11]=g,e[12]=s,e[13]=y):y=e[13];const w=y;if(!f){let V;return e[14]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(an,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=V):V=e[14],V}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let S;e[17]!==f.description?(S=f.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:f.description})]}):null,e[17]=f.description,e[18]=S):S=e[18];let C;e[19]!==v||e[20]!==S?(C=o.jsx(fn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,S]})}),e[19]=v,e[20]=S,e[21]=C):C=e[21];let _;e[22]!==f.title||e[23]!==l?(_=o.jsx(St,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=_):_=e[24];const T=!g.formState.isDirty||x;let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(un,{size:14}),e[25]=M):M=e[25];let R;e[26]!==j||e[27]!==T?(R=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(K,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:j,"aria-label":"Cancel",children:M})})}),e[26]=j,e[27]=T,e[28]=R):R=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(ce,{side:"bottom",children:"Cancel"}),e[29]=P):P=e[29];let A;e[30]!==R?(A=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[R,P]})}),e[30]=R,e[31]=A):A=e[31];const W=!g.formState.isDirty||x;let z;e[32]!==w?(z=()=>{w()},e[32]=w,e[33]=z):z=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(Pt,{size:14}),e[34]=D):D=e[34];let I;e[35]!==W||e[36]!==z?(I=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(K,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:W,onClick:z,"aria-label":"Save",children:D})})}),e[35]=W,e[36]=z,e[37]=I):I=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(ce,{side:"bottom",children:"Save"}),e[38]=$):$=e[38];let E;e[39]!==I?(E=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[I,$]})}),e[39]=I,e[40]=E):E=e[40];let L;e[41]!==_||e[42]!==A||e[43]!==E?(L=o.jsxs(It,{children:[_,A,E]}),e[41]=_,e[42]=A,e[43]=E,e[44]=L):L=e[44];let H;e[45]!==g?(H=o.jsx("div",{className:"h-full",children:o.jsx(No,{form:g})}),e[45]=g,e[46]=H):H=e[46];let U;return e[47]!==i||e[48]!==L||e[49]!==H||e[50]!==C?(U=o.jsxs(Ne,{onBack:i,children:[C,L,H]}),e[47]=i,e[48]=L,e[49]=H,e[50]=C,e[51]=U):U=e[51],U}function To(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=So(),e[0]=i):i=e[0];const r=i;if(!r){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(an,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(dn,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(_o,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const $o=xs("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Eo(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O($o({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Oo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Ro(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Mo=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ao(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=Ps(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Ls,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(zs,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx(Po,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function Po({toolName:t,connectionId:e,onBack:n}){const i=pt().location.href,{replayId:r}=hs({strict:!1}),l=(()=>{if(!r)return null;const I=`replay-${r}`,$=sessionStorage.getItem(I);if(!$)return null;sessionStorage.removeItem(I);try{return JSON.parse($)}catch{return null}})(),c=(()=>{if(!l)return null;const I={};for(const[$,E]of Object.entries(l))E!==null&&typeof E=="object"?I[$]=JSON.stringify(E,null,2):I[$]=E;return I})(),[a,d]=k.useState(c??{}),[u,f]=k.useState(l?JSON.stringify(l,null,2):"{}"),[p,x]=k.useState(null),[m,h]=k.useState(null),[g,b]=k.useState(!1),[j,y]=k.useState(null),{org:w}=Y(),v=$t(e),S=ee({connectionId:e,orgId:w.id}),C=vt({client:S}),_=C.data?.tools?.find(I=>I.name===t),T=_?.inputSchema?.properties,M=T?Object.keys(T):[],R=M.length>0,P={};if(R&&_?.inputSchema?.properties)for(const I of M)P[I]=_.inputSchema.required?.includes(I)?"":void 0;const A=I=>Object.prototype.hasOwnProperty.call(a,I),W=async()=>{b(!0),h(null),x(null),y(null);const I=performance.now();try{if(!S)throw new Error("MCP client is not available");const $=R?{...P,...a}:(()=>{const F=u.trim();if(!F)return{};const G=JSON.parse(F);if(G&&typeof G=="object")return G;throw new Error("Raw JSON input must be an object.")})();R&&_?.inputSchema?.properties&&Object.entries(_.inputSchema.properties).forEach(([F,G])=>{if((G.type==="object"||G.type==="array")&&typeof $[F]=="string")try{$[F]=JSON.parse($[F])}catch{}});const E=await S.callTool({name:t,arguments:$}),L=E.structuredContent??E,H=performance.now(),U=Math.round(H-I);x(L);const V=JSON.stringify(L),J=new TextEncoder().encode(V).length;y({duration:`${U}ms`,bytes:`${J} bytes`,tokens:`~${Math.ceil(J/4)} tokens`,cost:"$0.0000"})}catch($){const E=$ instanceof Error?$.message:String($);h(E||"Unknown error occurred");const L=performance.now();y({duration:`${Math.round(L-I)}ms`})}finally{b(!1)}},z=(I,$)=>{d(E=>({...E,[I]:$}))},D=()=>{x(null),h(null),y(null)};return o.jsxs(Ne,{onBack:n,children:[o.jsx(It,{children:o.jsx(St,{title:_?.name??Mo(t),url:i,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ve,{icon:v?.icon||null,name:v?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[C.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):C.isLoading?o.jsx($e,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:C.isSuccess?"ready":C.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:_?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),_?.inputSchema?.required&&_.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&_?.inputSchema?.properties?Object.entries(_.inputSchema.properties).map(([I,$])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,_.inputSchema?.required?.includes(I)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.type})]}),$.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.description}),$.type==="object"||$.type==="array"?o.jsx(ct,{className:"font-mono text-xs",value:A(I)?a[I]??"":P[I]??"",onChange:E=>z(I,E.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):$.type==="boolean"?o.jsxs(mn,{value:A(I)?String(a[I]??""):"",onValueChange:E=>z(I,E==="true"),children:[o.jsx(pn,{children:o.jsx(xn,{placeholder:"Select true or false..."})}),o.jsxs(hn,{children:[o.jsx(at,{value:"true",children:"true"}),o.jsx(at,{value:"false",children:"false"})]})]}):o.jsx(Ct,{value:A(I)?a[I]??"":P[I]??"",onChange:E=>z(I,E.target.value),placeholder:`Enter ${I}...`})]},I)):_?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(ct,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:I=>f(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Os,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(_n,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(On,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(K,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:W,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx($e,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_t,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ae,{children:o.jsxs(de,{children:[o.jsx(le,{asChild:!0,children:o.jsx(K,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:D,disabled:!p&&!m,children:o.jsx(Tt,{size:14})})}),o.jsx(ce,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),m&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Eo,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Es,{className:"h-4 w-4"}),o.jsx(Oo,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Ro,{className:"text-xs text-destructive",children:m})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?o.jsxs(o.Fragment,{children:[o.jsx(ke,{code:JSON.stringify(p,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(K,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),nn.success("Copied to clipboard")},children:o.jsx(Ms,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Rs,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Lo(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=oe(i).connectionId;if(!$t(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(k.Suspense,{fallback:a,children:o.jsx(Ao,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const Jt=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const p=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,p))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Lt=(t=>t?Jt(t):Jt),zo=t=>t;function dt(t,e=zo){const n=q.useSyncExternalStore(t.subscribe,q.useCallback(()=>e(t.getState()),[t,e]),q.useCallback(()=>e(t.getInitialState()),[t,e]));return q.useDebugValue(n),n}const Do=t=>{const e=Lt(t),n=s=>dt(e,s);return Object.assign(n,e),n},Wo=(t=>Do);function An(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const ut=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return ut(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return ut(s)(n)}}}},Ho=(t,e)=>(n,s,i)=>{let r={storage:An(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},p=i.setState;i.setState=(g,b)=>(p(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let m;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(w=>{var v;return w((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return ut(u.getItem.bind(u))(r.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==r.version){if(r.migrate){const v=r.migrate(w.state,w.version);return v instanceof Promise?v.then(S=>[!0,S]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var v;if(j!==c)return;const[S,C]=w;if(m=r.merge(C,(v=s())!=null?v:x),n(m,!0),S)return f()}).then(()=>{j===c&&(y?.(m,void 0),m=s(),l=!0,d.forEach(w=>w(m)))}).catch(w=>{j===c&&y?.(void 0,w)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),m||x},Pn=Ho,{useSyncExternalStoreWithSelector:Vo}=gs,Fo=t=>t;function Bo(t,e=Fo,n){const s=Vo(t.subscribe,t.getState,t.getInitialState,e,n);return q.useDebugValue(s),s}const Gt=t=>Symbol.iterator in t,Xt=t=>"entries"in t,Zt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function qo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Gt(t)&&Gt(e)?Xt(t)&&Xt(e)?Zt(t,e):Uo(t,e):Zt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ko(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
- ${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
3
- `:""} ${d}${f}: ${n(u)};`}).join(`
4
- `)}
5
- }`}return`interface ${e} ${n(t)}`}function st(t,e){const n=t.trim();return e.some(i=>i.name.toLowerCase()===n.toLowerCase())?`${n}_${Math.random().toString(36).substring(2,6)}`:n}function Jo(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
6
-
7
- ${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function ot(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Vs,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const Ln=k.createContext(null),Go=t=>Lt()(Pn(e=>({...t,actions:{setIsAddingStep:n=>e(s=>({...s,isAddingStep:n})),setCurrentStepTab:n=>e(s=>({...s,currentStepTab:n})),setToolAction:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.map(i=>"toolName"in i.action&&i.action.toolName===n.toolName?{...i,action:n}:i)}})),appendStep:({step:n,type:s})=>e(i=>{const r=n??ot(s,i.workflow.steps.length),l=i.workflow.steps.find(a=>a.name===r.name),c=l?`${r.name} ${parseInt(l.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:r.name;return{workflow:{...i.workflow,steps:[...i.workflow.steps,{...r,name:c}]}}}),deleteStep:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.filter(i=>i.name!==n)}})),duplicateStep:n=>e(s=>{const i=s.workflow.steps.findIndex(a=>a.name===n);if(i===-1)return s;const r=s.workflow.steps[i];if(!r)return s;const l={...r,name:st(r.name,s.workflow.steps)},c=[...s.workflow.steps];return c.splice(i+1,0,l),{workflow:{...s.workflow,steps:c},currentStepName:l.name}}),setCurrentStepName:n=>e(s=>({...s,currentStepName:n})),updateStep:(n,s)=>e(i=>({...i,workflow:{...i.workflow,steps:i.workflow.steps.map(r=>r.name===n?{...r,...s}:r)}})),setTrackingExecutionId:n=>e(s=>({...s,trackingExecutionId:n})),resetToOriginalWorkflow:()=>e(n=>({...n,workflow:n.originalWorkflow})),startAddingStep:n=>e(s=>({...s,isAddingStep:!0,addingStepType:n})),cancelAddingStep:()=>e(n=>({...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:n=>e(s=>{const i=s.selectedParentSteps.includes(n);return{...s,selectedParentSteps:i?s.selectedParentSteps.filter(r=>r!==n):[...s.selectedParentSteps,n]}}),confirmAddCodeStep:()=>e(n=>{const{selectedParentSteps:s,addingStepType:i,workflow:r}=n;if(i!=="code"||s.length===0)return n;const l={};for(const f of s)l[f]=`@${f}`;const c={};for(const f of s){const p=r.steps.find(x=>x.name===f);p?.outputSchema&&(c[f]=p.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=ot("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Ko(a,"Input"),p=d.action,x=Jo(p.code,f);d={...d,action:{...p,code:x}}}const u=st(d.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...d,name:u}]},currentStepName:u}}),addToolStep:()=>e(n=>{let s=ot("tool",Number((Math.random()*1e6).toFixed(0)));const i=st(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),setWorkflow:n=>e(s=>({...s,workflow:n})),startReplacingTool:n=>e(s=>({...s,replacingToolInfo:{toolName:n}})),cancelReplacingTool:()=>e(n=>({...n,replacingToolInfo:null})),setSelectedVirtualMcpId:n=>e(s=>({...s,selectedVirtualMcpId:n}))}}),{name:`workflow-store-${encodeURIComponent(t.workflow.id)}`,storage:An(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function Xo(t){const e=N.c(8),{children:n,initialState:s}=t,i=gn();let r;e[0]!==s.currentStepTab||e[1]!==s.trackingExecutionId||e[2]!==s.workflow||e[3]!==i?.[0]?.id?(r=()=>Go({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:i?.[0]?.id,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[0]=s.currentStepTab,e[1]=s.trackingExecutionId,e[2]=s.workflow,e[3]=i?.[0]?.id,e[4]=r):r=e[4];const[l]=k.useState(r);let c;return e[5]!==n||e[6]!==l?(c=o.jsx(Ln.Provider,{value:l,children:n}),e[5]=n,e[6]=l,e[7]=c):c=e[7],c}function Oe(t,e){const n=k.useContext(Ln);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Bo(n,t,qo)}function Ce(){return Oe(Zo)}function Zo(t){return t.workflow}function X(){return Oe(Qo)}function Qo(t){return t.actions}function zn(){const t=Me();return Oe(Yo)??t[0]?.name}function Yo(t){return t.currentStepName}function Re(){const t=N.c(5),e=zn(),n=Me();let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==e?(r=l=>l.name===e,t[3]=e,t[4]=r):r=t[4],s=n.find(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];const i=s;return i||n[0]}function Me(){return Ce().steps}function ft(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!ft(t[n],e[n]))return!1;return!0}if(typeof t=="object"){const n=t,s=e,i=Object.keys(n),r=Object.keys(s);if(i.length!==r.length)return!1;for(const l of i)if(!(l in s)||!ft(n[l],s[l]))return!1;return!0}return!1}function Dn(){const t=N.c(5),e=Ce();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=fs(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=ft(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function B(){return Oe(er)}function er(t){return t.trackingExecutionId}function Ie(){return Oe(tr)}function tr(t){return t.selectedVirtualMcpId}function nr(t){const e=N.c(18),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=gn()??[],a=n??void 0;let d;e[0]!==s?(d=g=>s(g===""?void 0:g),e[0]=s,e[1]=d):d=e[1];let u;e[2]!==i?(u=O("text-xs",i),e[2]=i,e[3]=u):u=e[3];let f;e[4]!==l?(f=o.jsx(xn,{placeholder:l}),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==u||e[7]!==f?(p=o.jsx(pn,{size:"sm",className:u,children:f}),e[6]=u,e[7]=f,e[8]=p):p=e[8];let x;e[9]!==c?(x=c.map(sr),e[9]=c,e[10]=x):x=e[10];let m;e[11]!==x?(m=o.jsx(hn,{children:x}),e[11]=x,e[12]=m):m=e[12];let h;return e[13]!==a||e[14]!==d||e[15]!==p||e[16]!==m?(h=o.jsxs(mn,{value:a,onValueChange:d,children:[p,m]}),e[13]=a,e[14]=d,e[15]=p,e[16]=m,e[17]=h):h=e[17],h}function sr(t){return o.jsx(at,{value:t.id,children:t.title},t.id)}function _e(){const t=N.c(2),e=Hs();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=Fs(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}const Qt=[100,1e3,2e3];function re(t){const e=N.c(15),{org:n}=Y(),s=_e(),i=k.useRef(0);let r;e[0]!==s.id||e[1]!==n.id?(r={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==t?(c={id:t},e[3]=t,e[4]=c):c=e[4];const a=!!t;let d;e[5]!==t?(d=t?h=>{const b=h.state?.data,y=(b?.structuredContent??b)?.item?.status;if(y==="running"||y==="enqueued"){const w=Qt[i.current]??1;return i.current=(i.current+1)%Qt.length,w}return i.current=0,!1}:!1,e[5]=t,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==a||e[10]!==d?(u={client:l,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:c,gcTime:0,enabled:a,select:or,refetchInterval:d},e[7]=l,e[8]=c,e[9]=a,e[10]=d,e[11]=u):u=e[11];const{data:f,isLoading:p}=yt(u),x=f?.item;let m;return e[12]!==p||e[13]!==x?(m={item:x,isLoading:p},e[12]=p,e[13]=x,e[14]=m):m=e[14],m}function or(t){return t.structuredContent??t}function rr(t,e){const n=N.c(14),{org:s}=Y(),i=_e();let r;n[0]!==i.id||n[1]!==s.id?(r={connectionId:i.id,orgId:s.id},n[0]=i.id,n[1]=s.id,n[2]=r):r=n[2];const l=ee(r);let c;n[3]!==t||n[4]!==e?(c={executionId:t,stepId:e},n[3]=t,n[4]=e,n[5]=c):c=n[5];const a=!!t&&!!e;let d;n[6]!==l||n[7]!==c||n[8]!==a?(d={client:l,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:c,enabled:a,select:ir},n[6]=l,n[7]=c,n[8]=a,n[9]=d):d=n[9];const{data:u,isLoading:f}=yt(d),p=u?.output,x=u?.error;let m;return n[10]!==f||n[11]!==p||n[12]!==x?(m={output:p,error:x,isLoading:f},n[10]=f,n[11]=p,n[12]=x,n[13]=m):m=n[13],m}function ir(t){return t.structuredContent??t}function lr(){const t=N.c(19),{org:e}=Y(),n=_e(),s=Ce();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ee(i);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=["workflow"],t[3]=l):l=t[3];let c;t[4]!==s.id?(c={field:l,operator:"eq",value:s.id},t[4]=s.id,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=[{field:["created_at"],direction:"desc"}],t[6]=a):a=t[6];let d;t[7]!==c?(d={where:c,orderBy:a,limit:100},t[7]=c,t[8]=d):d=t[8];const u=!!s.id;let f;t[9]!==r||t[10]!==d||t[11]!==u?(f={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:d,enabled:u,staleTime:5e3,select:cr},t[9]=r,t[10]=d,t[11]=u,t[12]=f):f=t[12];const{data:p,isLoading:x,refetch:m}=yt(f);let h;t[13]!==p?.items?(h=p?.items??[],t[13]=p?.items,t[14]=h):h=t[14];let g;return t[15]!==x||t[16]!==m||t[17]!==h?(g={executions:h,isLoading:x,refetch:m},t[15]=x,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function cr(t){return t.structuredContent??t}function Wn(t){const e=[];function n(s){if(typeof s=="string"){const i=s.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(i)for(const r of i)if(r==="@input")e.push("__entire_input__");else{const l=r.replace("@input.","");e.push(l)}}else Array.isArray(s)?s.forEach(n):typeof s=="object"&&s!==null&&Object.values(s).forEach(n)}return n(t),[...new Set(e)]}function ar(t){const e=[];for(const n of t){const s=Wn(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function dr(t){for(const e of t)if(Wn(e.input).includes("__entire_input__"))return!0;return!1}function ur(t){const e=ar(t);if(e.length===0)return dr(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function fr(){const t=N.c(2),e=Ce();let n;return t[0]!==e.steps?(n=ur(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function mr(){const t=N.c(15),{org:e}=Y(),{id:n}=_e(),{setTrackingExecutionId:s}=X(),i=Ce(),r=Ie(),l=fr();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ee(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=wt(d);let p;t[5]!==r||t[6]!==s||t[7]!==u||t[8]!==i?(p=async g=>{const b=g===void 0?{}:g;if(!r)throw new Error("Please select an Agent before running the workflow");const j=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:r,start_at_epoch_ms:j,workflow_collection_id:i.id}}),v=(y.structuredContent??y)?.item?.id??void 0;return s(v),v},t[5]=r,t[6]=s,t[7]=u,t[8]=i,t[9]=p):p=t[9];const x=p,m=l!==null;let h;return t[10]!==x||t[11]!==l||t[12]!==f||t[13]!==m?(h={handleRunWorkflow:x,isPending:f,requiresInput:m,inputSchema:l},t[10]=x,t[11]=l,t[12]=f,t[13]=m,t[14]=h):h=t[14],h}function pr(){const t=N.c(10),{org:e}=Y(),{id:n}=_e();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=wt(r);let a;t[5]!==l?(a=async f=>await l({name:"CANCEL_EXECUTION",arguments:{executionId:f}}),t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleCancelWorkflow:d,isCancelling:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function xr(){const t=N.c(10),{org:e}=Y(),{id:n}=_e();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=wt(r);let a;t[5]!==l?(a=async f=>{const p=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(p.structuredContent??p)?.success??!1},t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleResumeWorkflow:d,isResuming:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function hr(){const t=N.c(3),e=B(),{item:n}=re(e);let s;return t[0]!==n||t[1]!==e?(s=e&&n?(()=>{const r={};return n?.input&&(r.input=n.input),r})():void 0,t[0]=n,t[1]=e,t[2]=s):s=t[2],s}function gr(t,e,n,s){if(!e)return[...t].sort(s);const i=n(e);return[...t].sort((r,l)=>{const c=n(r),a=n(l);return c===i?-1:a===i?1:s?s(r,l):0})}const zt=Wo()(Pn(t=>({viewMode:"visual",setViewMode:e=>t({viewMode:e}),showExecutionsList:!1,setShowExecutionsList:e=>t({showExecutionsList:e}),toggleExecutionsList:()=>t(e=>({showExecutionsList:!e.showExecutionsList}))}),{name:"workflow-view-mode"})),Hn=k.createContext([]);function Vn(){return k.useContext(Hn)}function br({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Qs;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,d,u;const f=r.view.state.selection.$to.nodeAfter;(a=f?.text)!=null&&a.startsWith(" ")&&(l.to+=1),r.chain().focus().insertContentAt(l,[{type:n,attrs:{...c,mentionSuggestionChar:s}},{type:"text",text:" "}]).run(),(u=(d=r.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:r,range:l})=>{const c=r.doc.resolve(l.from),a=r.schema.nodes[n];return!!c.parent.type.contentMatch.matchType(a)},...e}}function Fn(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>br({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function Yt(t,e){const n=Fn(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var jr=Js.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,s;return`${(n=e?.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var s,i;return["span",Pe(this.HTMLAttributes,t.HTMLAttributes),`${(s=n?.char)!=null?s:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=Yt(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Pe({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Pe({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Pe({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Zs({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;s!==null;){const[,i,r,l]=s,c=r??l;e[i==="char"?"mentionSuggestionChar":i]=c,s=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:Yt(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:s}=e,{empty:i,anchor:r}=s;if(!i)return!1;let l=new Xs,c=0;return e.doc.nodesBetween(r-1,r,(a,d)=>{if(a.type.name===this.name)return n=!0,l=a,c=d,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return Fn(this).map(Gs)}}),vr=jr,rt,Fe="HoverCard",[Bn]=ln(Fe,[on]),Be=on(),[yr,Ue]=Bn(Fe),Un=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=Be(e),d=k.useRef(0),u=k.useRef(0),f=k.useRef(!1),p=k.useRef(!1),[x,m]=ht({prop:s,defaultProp:i??!1,onChange:r,caller:Fe}),h=k.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>m(!0),l)},[l,m]),g=k.useCallback(()=>{clearTimeout(d.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),c))},[c,m]),b=k.useCallback(()=>m(!1),[m]);return k.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(yr,{scope:e,open:x,onOpenChange:m,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:p,children:o.jsx(vs,{...a,children:n})})};Un.displayName=Fe;var qn="HoverCardTrigger",Kn=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=Ue(qn,n),r=Be(n);return o.jsx(bs,{asChild:!0,...r,children:o.jsx(xt.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:ne(t.onPointerEnter,We(i.onOpen)),onPointerLeave:ne(t.onPointerLeave,We(i.onClose)),onFocus:ne(t.onFocus,i.onOpen),onBlur:ne(t.onBlur,i.onClose),onTouchStart:ne(t.onTouchStart,l=>l.preventDefault())})})});Kn.displayName=qn;var Dt="HoverCardPortal",[wr,Sr]=Bn(Dt,{forceMount:void 0}),Jn=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=Ue(Dt,e);return o.jsx(wr,{scope:e,forceMount:n,children:o.jsx(sn,{present:n||r.open,children:o.jsx(js,{asChild:!0,container:i,children:s})})})};Jn.displayName=Dt;var De="HoverCardContent",Gn=k.forwardRef((t,e)=>{const n=Sr(De,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=Ue(De,t.__scopeHoverCard);return o.jsx(sn,{present:s||r.open,children:o.jsx(Nr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:ne(t.onPointerEnter,We(r.onOpen)),onPointerLeave:ne(t.onPointerLeave,We(r.onClose)),ref:e})})});Gn.displayName=De;var Nr=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=Ue(De,n),d=Be(n),u=k.useRef(null),f=rn(e,u),[p,x]=k.useState(!1);return k.useEffect(()=>{if(p){const m=document.body;return rt=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=rt,m.style.webkitUserSelect=rt}}},[p]),k.useEffect(()=>{if(u.current){const m=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),k.useEffect(()=>{u.current&&Ir(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(ys,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ne(r,m=>{m.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(ws,{...d,...c,onPointerDown:ne(c.onPointerDown,m=>{m.currentTarget.contains(m.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),kr="HoverCardArrow",Cr=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=Be(n);return o.jsx(Ss,{...i,...s,ref:e})});Cr.displayName=kr;function We(t){return e=>e.pointerType==="touch"?void 0:t()}function Ir(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var _r=Un,Tr=Kn,$r=Jn,Er=Gn;function Or(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(_r,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function Rr(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Tr,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Mr(t){const e=N.c(12);let n,s,i,r;e[0]!==t?({className:n,align:i,sideOffset:r,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=r):(n=e[1],s=e[2],i=e[3],r=e[4]);const l=i===void 0?"center":i,c=r===void 0?4:r;let a;e[5]!==n?(a=O("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(d=o.jsx($r,{"data-slot":"hover-card-portal",children:o.jsx(Er,{"data-slot":"hover-card-content",align:l,sideOffset:c,className:a,...s})}),e[7]=l,e[8]=s,e[9]=c,e[10]=a,e[11]=d):d=e[11],d}const Xn=k.createContext(void 0);function Ar(t,e){const n=e.split("."),s=n[0];if(!s)return;let i=t[s];for(let r=1;r<n.length&&i!==void 0;r++){const l=n[r];if(l)if(typeof i=="object"&&i!==null)i=i[l];else return}return i}function Pr(t){const e=N.c(20),{node:n}=t,s=k.useContext(Xn),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?Ar(s,i):void 0;l=h!==void 0?typeof h=="object"?JSON.stringify(h,null,2):String(h):void 0,e[0]=r,e[1]=i,e[2]=s,e[3]=l}else l=e[3];const c=l;let a;e[4]!==i?(a=o.jsxs("span",{className:"bg-primary/20 text-primary px-1 rounded font-medium cursor-pointer",children:["@",i]}),e[4]=i,e[5]=a):a=e[5];const d=a;if(!r||c===void 0){let h;return e[6]!==d?(h=o.jsx(qt,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(Rr,{asChild:!0,children:d}),e[8]=d,e[9]=u):u=e[9];let f;e[10]!==i?(f=o.jsxs("div",{className:"text-xs font-medium text-muted-foreground",children:["@",i]}),e[10]=i,e[11]=f):f=e[11];let p;e[12]!==c?(p=o.jsx("pre",{className:"text-xs font-mono bg-muted/50 p-2 rounded overflow-auto max-h-[200px] whitespace-pre-wrap break-all",children:c}),e[12]=c,e[13]=p):p=e[13];let x;e[14]!==f||e[15]!==p?(x=o.jsx(Mr,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,p]})}),e[14]=f,e[15]=p,e[16]=x):x=e[16];let m;return e[17]!==u||e[18]!==x?(m=o.jsx(qt,{as:"span",children:o.jsxs(Or,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=m):m=e[19],m}function Zn(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let se=Qn();function Qn(){return Lt(()=>({items:[],selectedIndex:0,command:null}))}function en(t,e){se.setState({items:t,command:e,selectedIndex:0})}function Lr(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e-1+t.length)%t.length})}function zr(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e+1)%t.length})}function Yn(){const{items:t,selectedIndex:e,command:n}=se.getState(),s=t[e];return s?(n?.(s),!0):!1}function tn(){se=Qn()}function Dr(){const t=N.c(7),e=dt(se,Hr),n=dt(se,Wr);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{se.setState({selectedIndex:c}),Yn()},className:O("flex items-center w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",c===n?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l.label},l.id),t[3]=n,t[4]=r):r=t[4],s=e.map(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];let i;return t[5]!==s?(i=o.jsx("div",{className:"bg-popover border border-border rounded-lg shadow-lg overflow-hidden min-w-[180px]",children:o.jsx("div",{className:"p-1",children:s})}),t[5]=s,t[6]=i):i=t[6],i}function Wr(t){return t.selectedIndex}function Hr(t){return t.items}function Vr(){let t=null,e=null;return{onStart:n=>{en(n.items,n.command),t=new no(Dr,{editor:n.editor}),e=document.createElement("div"),e.style.cssText="position:absolute;z-index:9999";const s=n.clientRect?.();s&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`),e.appendChild(t.element),document.body.appendChild(e)},onUpdate:n=>{en(n.items,n.command);const s=n.clientRect?.();s&&e&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`)},onKeyDown:({event:n})=>n.key==="Escape"?(e?.remove(),t?.destroy(),tn(),!0):n.key==="ArrowUp"?(Lr(),!0):n.key==="ArrowDown"?(zr(),!0):n.key==="Enter"?Yn():!1,onExit:()=>{e?.remove(),t?.destroy(),tn()}}}const it=/@([\w.]+)/g;function Fr(t,e){if(!t)return null;const n=Zn(e),s=new Map(n.map(a=>[a.id,a]));if(!it.test(t))return t;it.lastIndex=0;const r=[];let l=0,c;for(;(c=it.exec(t))!==null;){const a=c[1]??"",d=c.index;d>l&&r.push({type:"text",text:t.slice(l,d)});const u=s.get(a);u?r.push({type:"mention",attrs:{id:u.id,label:u.label}}):r.push({type:"text",text:c[0]}),l=d+c[0].length}return l<t.length&&r.push({type:"text",text:t.slice(l)}),{type:"doc",content:[{type:"paragraph",content:r.length>0?r:void 0}]}}function Wt(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=hr();let d;e[0]!==n||e[1]!==s?(d=Fr(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,p=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=Ys.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let m;if(e[4]!==n||e[5]!==f){let T;e[7]!==n?(T=M=>{const{query:R}=M;return Zn(n).filter(A=>A.label.toLowerCase().includes(R.toLowerCase())||A.id.toLowerCase().includes(R.toLowerCase()))},e[7]=n,e[8]=T):T=e[8],m=vr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Kr,renderHTML:qr,suggestion:{items:T,render:Vr,command:Ur}}).extend(f?{addNodeView(){return eo(Pr)}}:{}),e[4]=n,e[5]=f,e[6]=m}else m=e[6];let h;e[9]!==m?(h=[x,m],e[9]=m,e[10]=h):h=e[10];const g=r??"";let b;e[11]!==g?(b={attributes:{class:"prose prose-sm max-w-none focus:outline-none w-full min-h-[20px]","data-placeholder":g},handleKeyDown:Br},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=T=>{const{editor:M}=T;return i?.(M.getText().trim())},e[13]=i,e[14]=j):j=e[14];let y;e[15]!==u||e[16]!==p||e[17]!==h||e[18]!==b||e[19]!==j?(y={content:u,editable:p,extensions:h,editorProps:b,onUpdate:j},e[15]=u,e[16]=p,e[17]=h,e[18]=b,e[19]=j,e[20]=y):y=e[20];const w=to(y);let v;e[21]!==l?(v=O("rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l),e[21]=l,e[22]=v):v=e[22];let S;e[23]!==w?(S=o.jsx(so,{editor:w}),e[23]=w,e[24]=S):S=e[24];let C;e[25]!==v||e[26]!==S?(C=o.jsx("div",{className:v,children:S}),e[25]=v,e[26]=S,e[27]=C):C=e[27];const _=C;if(a!==void 0){let T;return e[28]!==_||e[29]!==a?(T=o.jsx(Xn.Provider,{value:a,children:_}),e[28]=_,e[29]=a,e[30]=T):T=e[30],T}return _}function Br(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Ur(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function qr(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Kr(t){const{node:e}=t;return`@${e.attrs.id}`}function Jr(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Vn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Gr(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Vn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Xr(t){const e=N.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=u=>s(u.target.value===""?void 0:Number(u.target.value)),e[0]=s,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),e[2]=a):a=e[2];let d;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(d=o.jsx("input",{id:r,type:"number",value:l,onChange:c,disabled:i,className:a}),e[3]=r,e[4]=i,e[5]=l,e[6]=c,e[7]=d):d=e[7],d}function Zr(t){const e=N.c(13),{value:n,onChange:s,readonly:i,id:r,label:l}=t,c=n??!1;let a;e[0]!==s?(a=p=>s(p.target.checked),e[0]=s,e[1]=a):a=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(d=o.jsx("input",{id:r,type:"checkbox",checked:c,onChange:a,disabled:i,className:"h-4 w-4 rounded border-input"}),e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=d):d=e[6];let u;e[7]!==l?(u=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==d||e[11]!==u?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[d,u]}),e[9]=r,e[10]=d,e[11]=u,e[12]=f):f=e[12],f}function Qr(t){const e=N.c(14),{value:n,onChange:s,readonly:i,id:r,options:l}=t;let c;e[0]!==l.enumOptions?(c=l.enumOptions??[],e[0]=l.enumOptions,e[1]=c):c=e[1];const a=c,d=n??"";let u;e[2]!==s?(u=h=>s(h.target.value),e[2]=s,e[3]=u):u=e[3];let f,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),p=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=p):(f=e[4],p=e[5]);let x;e[6]!==a?(x=a.map(Yr),e[6]=a,e[7]=x):x=e[7];let m;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(m=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[p,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=m):m=e[13],m}function Yr(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const ei={TextWidget:Jr,TextareaWidget:Gr,NumberWidget:Xr,CheckboxWidget:Zr,SelectWidget:Qr};function ti(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:In,color:"text-blue-500"};case"number":case"integer":return{Icon:kn,color:"text-blue-500"};case"array":return{Icon:wn,color:"text-purple-500"};case"object":return{Icon:yn,color:"text-orange-500"};case"boolean":return{Icon:Cn,color:"text-pink-500"};case"null":return{Icon:gt,color:"text-gray-500"};default:return{Icon:Sn,color:"text-muted-foreground"}}}function ni(t){const e=N.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let v;return e[0]!==l?(v=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=v):v=e[1],v}if(n==="root"){let v;return e[2]!==l?(v=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=v):v=e[3],v}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,p,x,m,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:v,color:S}=ti(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(m=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=m):m=e[17],e[18]!==i?(h=i&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"}),e[18]=i,e[19]=h):h=e[19],u=v,f=14,p=O(S,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=p,e[11]=x,e[12]=m,e[13]=h,e[14]=g}else u=e[8],f=e[9],p=e[10],x=e[11],m=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==p?(b=o.jsx(u,{size:f,className:p}),e[20]=u,e[21]=f,e[22]=p,e[23]=b):b=e[23];let j;e[24]!==x||e[25]!==m||e[26]!==h||e[27]!==b?(j=o.jsxs("div",{className:x,children:[m,h,b]}),e[24]=x,e[25]=m,e[26]=h,e[27]=b,e[28]=j):j=e[28];let y;e[29]!==r?(y=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=y):y=e[30];let w;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==y?(w=o.jsxs("div",{className:g,children:[j,y,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=y,e[35]=w):w=e[35],w}function si(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(ri),e[0]=n,e[1]=c):c=e[1];let a;return e[2]!==c?(a=o.jsx("div",{className:"space-y-4",children:c}),e[2]=c,e[3]=a):a=e[3],a}let r;e[4]!==n?(r=n.map(oi),e[4]=n,e[5]=r):r=e[5];let l;return e[6]!==r?(l=o.jsx("div",{className:"pl-4 border-l-2 border-border/50 space-y-4",children:r}),e[6]=r,e[7]=l):l=e[7],l}function oi(t){return o.jsx("div",{children:t.content},t.name)}function ri(t){return o.jsx("div",{children:t.content},t.name)}function ii(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(li),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==l?(c=o.jsx("div",{className:"space-y-2",children:l}),e[2]=l,e[3]=c):c=e[3];let a;e[4]!==s||e[5]!==i||e[6]!==r?(a=s&&o.jsxs(K,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:i,children:["+ Add ",r||"item"]}),e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==c||e[9]!==a?(d=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function li(t){return o.jsx("div",{className:"flex gap-2 items-start",children:o.jsx("div",{className:"flex-1",children:t})},t.key||t.index)}function ci(){return null}function ai(){return null}const di={FieldTemplate:ni,ObjectFieldTemplate:si,ArrayFieldTemplate:ii,UnsupportedFieldTemplate:ci,ErrorListTemplate:ai};function ui(t){const e=N.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,d,u)=>{const f=typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d??""),p=Array.isArray(u.type)?u.type.join(" | "):u.type??"string";return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),o.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:p})]}),u.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:u.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(Wt,{mentions:i,value:f,readOnly:!0,className:"border-0 bg-transparent p-0"})})]},a)},e[0]=i,e[1]=r):r=e[1];const l=r;let c;return e[2]!==s||e[3]!==n.properties||e[4]!==l?(c=o.jsx("div",{className:"space-y-4",children:Object.entries(n.properties).map(a=>{const[d,u]=a,f=s[d];return l(d,f,u)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function es({inputSchema:t,inputParams:e,setInputParams:n,handleInputChange:s,mentions:i,readOnly:r}){const l=i??[];if(!t)return o.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."});if(r)return o.jsx(ui,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=k.useRef(e??{}),d=u=>{const f=u.formData??{},p=a.current;if(n?.(f),s){for(const[x,m]of Object.entries(f))p[x]!==m&&s(x,m);for(const x of Object.keys(p))x in f||s(x,void 0)}a.current=f};return o.jsx(Hn.Provider,{value:l,children:o.jsx(Ds,{schema:c,formData:e,onChange:d,validator:Ws,widgets:ei,templates:di,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function fi(t){const e=N.c(33),{open:n,onOpenChange:s,inputSchema:i,onSubmit:r,isPending:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[a,d]=k.useState(c);let u;e[1]!==a||e[2]!==s||e[3]!==r?(u=async()=>{await r(a),s(!1),d({})},e[1]=a,e[2]=s,e[3]=r,e[4]=u):u=e[4];const f=u;let p;e[5]!==s?(p=_=>{_||d({}),s(_)},e[5]=s,e[6]=p):p=e[6];const x=p;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsxs(co,{children:[o.jsx(ao,{children:"Workflow Input"}),o.jsx(uo,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=m):m=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[8]=h):h=e[8];let g;e[9]!==a||e[10]!==i?(g=o.jsx("div",{className:"py-4",children:o.jsx(es,{inputSchema:i,inputParams:a,setInputParams:d,mentions:h})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==x?(b=()=>x(!1),e[12]=x,e[13]=b):b=e[13];let j;e[14]!==l||e[15]!==b?(j=o.jsx(K,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let y;e[17]!==l?(y=l?o.jsx(Ee,{size:"xs"}):o.jsx(_t,{size:14}),e[17]=l,e[18]=y):y=e[18];let w;e[19]!==f||e[20]!==l||e[21]!==y?(w=o.jsxs(K,{onClick:f,disabled:l,className:"gap-2",children:[y,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=y,e[22]=w):w=e[22];let v;e[23]!==w||e[24]!==j?(v=o.jsxs(fo,{children:[j,w]}),e[23]=w,e[24]=j,e[25]=v):v=e[25];let S;e[26]!==v||e[27]!==g?(S=o.jsxs(mo,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[m,g,v]}),e[26]=v,e[27]=g,e[28]=S):S=e[28];let C;return e[29]!==x||e[30]!==n||e[31]!==S?(C=o.jsx(po,{open:n,onOpenChange:x,children:S}),e[29]=x,e[30]=n,e[31]=S,e[32]=C):C=e[32],C}function mi(t){const e=N.c(27),{title:n,description:s,onSave:i,isSaving:r}=t,c=pt().location.href,{viewMode:a,setViewMode:d,showExecutionsList:u,toggleExecutionsList:f}=zt(),{resetToOriginalWorkflow:p,setSelectedVirtualMcpId:x}=X(),m=Dn(),h=Ie(),g=B();let b;e[0]!==n?(b=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==s?(j=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=j):j=e[3];let y;e[4]!==b||e[5]!==j?(y=o.jsx(fn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,j]})}),e[4]=b,e[5]=j,e[6]=y):y=e[6];let w;e[7]!==m||e[8]!==r||e[9]!==i||e[10]!==p||e[11]!==h||e[12]!==x||e[13]!==d||e[14]!==u||e[15]!==n||e[16]!==f||e[17]!==g||e[18]!==c||e[19]!==a?(w=!g&&o.jsxs(o.Fragment,{children:[o.jsx(St,{title:n,url:c,icon:"workflow"}),o.jsx(k.Suspense,{fallback:o.jsx(Ee,{size:"xs"}),children:o.jsx(nr,{selectedVirtualMcpId:h,onVirtualMcpChange:x,placeholder:"Select Agent"})}),o.jsx(qs,{value:a,onValueChange:d,size:"sm",options:[{value:"visual",icon:o.jsx(Ks,{})},{value:"code",icon:o.jsx($n,{})}]}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(K,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:p,disabled:!m,"aria-label":"Reset changes",children:o.jsx(un,{size:14})})})}),o.jsx(ce,{side:"bottom",children:"Reset changes"})]})}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(K,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:i,disabled:!m||r,"aria-label":"Save workflow",children:r?o.jsx(Ee,{size:"xs"}):o.jsx(Pt,{size:14})})})}),o.jsx(ce,{side:"bottom",children:"Save workflow"})]})}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(K,{variant:u?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:f,"aria-label":u?"Hide runs":"Show runs",children:o.jsx(Tn,{size:14})})})}),o.jsx(ce,{side:"bottom",children:u?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=r,e[9]=i,e[10]=p,e[11]=h,e[12]=x,e[13]=d,e[14]=u,e[15]=n,e[16]=f,e[17]=g,e[18]=c,e[19]=a,e[20]=w):w=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(hi,{}),e[21]=v):v=e[21];let S;e[22]!==w?(S=o.jsxs(It,{children:[w,v]}),e[22]=w,e[23]=S):S=e[23];let C;return e[24]!==y||e[25]!==S?(C=o.jsxs(o.Fragment,{children:[y,S]}),e[24]=y,e[25]=S,e[26]=C):C=e[26],C}function pi(){const t=B(),{item:e}=re(t);return e?.completed_at_epoch_ms!=null}function xi(){const t=B(),{item:e}=re(t);return e?.status==="cancelled"}function hi(){const t=N.c(58),e=Dn(),n=pi(),s=xi(),i=B(),r=Ie(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=mr(),u=Me(),[f,p]=k.useState(!1),{handleCancelWorkflow:x,isCancelling:m}=pr(),{handleResumeWorkflow:h,isResuming:g}=xr(),b=i&&!n;let j;t[0]!==u?(j=u.some(gi),t[0]=u,t[1]=j):j=t[1];const y=j,w=!r,v=u.length===0,S=e||v||y||w||c||m,C=b||c;let _;t[2]!==y||t[3]!==w||t[4]!==e||t[5]!==s||t[6]!==C||t[7]!==v?(_=()=>s?"Workflow is currently cancelled":C?"Workflow is currently running":e?"Save your changes before running":w?"Select an Agent first":v||y?"Add at least one step to the workflow":null,t[2]=y,t[3]=w,t[4]=e,t[5]=s,t[6]=C,t[7]=v,t[8]=_):_=t[8];const M=_();let R;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==C||t[15]!==a||t[16]!==i?(R=async()=>{if(a&&d){p(!0);return}if(s&&i){await h(i);return}if(C&&i){await x(i);return}await l({})},t[9]=x,t[10]=h,t[11]=l,t[12]=d,t[13]=s,t[14]=C,t[15]=a,t[16]=i,t[17]=R):R=t[17];const P=R;let A;t[18]!==l?(A=async ie=>{await l(ie)},t[18]=l,t[19]=A):A=t[19];const W=A,z=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",D=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let I;t[20]!==D?(I=O("gap-2 h-7 px-3",D),t[20]=D,t[21]=I):I=t[21];let $;t[22]!==m||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?($=(!b&&!c&&!m&&!g||s)&&o.jsx(_t,{size:14}),t[22]=m,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=$):$=t[27];let E;t[28]!==m||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(E=b&&!c&&!m&&!g&&!s&&o.jsx(oo,{size:14}),t[28]=m,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=E):E=t[33];let L;t[34]!==m||t[35]!==c||t[36]!==g?(L=(c||m||g)&&o.jsx(Ee,{size:"xs"}),t[34]=m,t[35]=c,t[36]=g,t[37]=L):L=t[37];let H;t[38]!==z||t[39]!==P||t[40]!==S||t[41]!==I||t[42]!==$||t[43]!==E||t[44]!==L?(H=o.jsxs(K,{variant:"default",size:"sm",className:I,disabled:S,onClick:P,children:[$,E,L,z]}),t[38]=z,t[39]=P,t[40]=S,t[41]=I,t[42]=$,t[43]=E,t[44]=L,t[45]=H):H=t[45];const U=H;let V;t[46]!==U||t[47]!==M?(V=M?o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:U})}),o.jsx(ce,{side:"bottom",children:M})]})}):U,t[46]=U,t[47]=M,t[48]=V):V=t[48];const J=V;let F;t[49]!==W||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(F=a&&d&&o.jsx(fi,{open:f,onOpenChange:p,inputSchema:d,onSubmit:W,isPending:c}),t[49]=W,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=F):F=t[54];let G;return t[55]!==J||t[56]!==F?(G=o.jsxs(o.Fragment,{children:[J,F]}),t[55]=J,t[56]=F,t[57]=G):G=t[57],G}function gi(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function bi(){const t=N.c(15),e=B(),n=Me(),{item:s}=re(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.status||t[3]!==n){i={};let r;t[5]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(ji)??[]),t[5]=s.completed_steps?.success,t[6]=r):r=t[6];const l=r;let c;t[7]!==s.completed_steps?.error?(c=s.completed_steps?.error??[],t[7]=s.completed_steps?.error,t[8]=c):c=t[8];let a;t[9]!==c?(a=new Set(c),t[9]=c,t[10]=a):a=t[10];const d=a;let u;t[11]!==d||t[12]!==n||t[13]!==l?(u=-1,n.forEach((f,p)=>{(l.has(f.name)||d.has(f.name))&&(u=p)}),t[11]=d,t[12]=n,t[13]=l,t[14]=u):u=t[14],n.forEach((f,p)=>{let x="pending";d.has(f.name)?x="error":l.has(f.name)?x="success":s.status==="running"&&p===u+1&&(x="running"),i[f.name]={status:x,output:void 0,error:void 0,stepIndex:p}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.status,t[3]=n,t[4]=i}else i=t[4];return i}function ji(t){return t.name}function vi(t){const e=N.c(119),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=B(),{item:p}=re(f),x=p?.completed_steps,m=x?.success;let h;e[0]!==n.name||e[1]!==m?(h=m?.find(J=>J.name===n.name),e[0]=n.name,e[1]=m,e[2]=h):h=e[2];const g=h,b=g?.completed_at_epoch_ms,j=g!=null;let y;e[3]!==x?.error||e[4]!==n.name?(y=x?.error?.includes(n.name),e[3]=x?.error,e[4]=n.name,e[5]=y):y=e[5];const w=y,v="toolName"in n.action,S=v&&"connectionId"in n.action?n.action.connectionId:null,_=!!(v&&"toolName"in n.action?n.action.toolName:null);let T,M,R,P,A,W,z,D,I,$,E;if(e[6]!==S||e[7]!==r||e[8]!==_||e[9]!==s||e[10]!==j||e[11]!==w||e[12]!==c||e[13]!==i||e[14]!==l||e[15]!==v||e[16]!==d||e[17]!==u||e[18]!==a||e[19]!==n||e[20]!==f){const J=Ei(n);T=j?"success":w?"error":r?.status;const F=r!==void 0,G=T==="success"||T==="error";let ie=J.length>0?60:12;(T==="success"||T==="error")&&(ie=ie+32);let Z,ue,fe;if(e[32]!==i||e[33]!==l||e[34]!==a||e[35]!==T){const Te=Si(T);let Ae;e[44]!==T?(Ae=Ni(T),e[44]=T,e[45]=Ae):Ae=e[45],Z=Ae;const Xe=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",Ze=T==="running"&&"bg-accent/50",Qe=l&&"opacity-50";e[46]!==Xe||e[47]!==Ze||e[48]!==Qe?(D=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",Xe,Ze,Qe),e[46]=Xe,e[47]=Ze,e[48]=Qe,e[49]=D):D=e[49],I=a,$="button",E=0,e[50]!==a?(M=Ye=>{(Ye.key==="Enter"||Ye.key===" ")&&(Ye.preventDefault(),a())},e[50]=a,e[51]=M):M=e[51],fe="w-5 flex flex-col items-center justify-center shrink-0 pt-3",ue=O("text-xs font-mono opacity-75 h-8 flex items-center",Te),e[32]=i,e[33]=l,e[34]=a,e[35]=T,e[36]=Z,e[37]=M,e[38]=ue,e[39]=fe,e[40]=D,e[41]=I,e[42]=$,e[43]=E}else Z=e[36],M=e[37],ue=e[38],fe=e[39],D=e[40],I=e[41],$=e[42],E=e[43];const Je=s+1;let me;e[52]!==ue||e[53]!==Je?(me=o.jsxs("span",{className:ue,children:[Je,"."]}),e[52]=ue,e[53]=Je,e[54]=me):me=e[54],e[55]!==fe||e[56]!==me?(R=o.jsx("div",{className:fe,children:me}),e[55]=fe,e[56]=me,e[57]=R):R=e[57];let pe;e[58]!==Z||e[59]!==s?(pe=s>0?o.jsx(lt,{height:12,color:Z}):o.jsx("div",{className:"h-3"}),e[58]=Z,e[59]=s,e[60]=pe):pe=e[60];let xe;e[61]!==S||e[62]!==_||e[63]!==v||e[64]!==n.name?(xe=o.jsx(Ti,{connectionId:S,isToolStep:v,hasToolSelected:_,stepName:n.name}),e[61]=S,e[62]=_,e[63]=v,e[64]=n.name,e[65]=xe):xe=e[65];let he;e[66]!==Z||e[67]!==G||e[68]!==T?(he=G&&o.jsxs(o.Fragment,{children:[o.jsx(lt,{height:8,color:Z}),o.jsx(ki,{status:T})]}),e[66]=Z,e[67]=G,e[68]=T,e[69]=he):he=e[69];let ge;e[70]!==Z||e[71]!==ie||e[72]!==c||e[73]!==f?(ge=c&&f?null:o.jsx(lt,{height:ie,color:Z}),e[70]=Z,e[71]=ie,e[72]=c,e[73]=f,e[74]=ge):ge=e[74],e[75]!==pe||e[76]!==xe||e[77]!==he||e[78]!==ge?(P=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[pe,xe,he,ge]}),e[75]=pe,e[76]=xe,e[77]=he,e[78]=ge,e[79]=P):P=e[79],A="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3";const Ge=_?"font-medium text-foreground":"text-foreground";let be;e[80]!==Ge?(be=O("text-sm truncate flex-1",Ge),e[80]=Ge,e[81]=be):be=e[81];let je;e[82]!==n?(je=$i(n),e[82]=n,e[83]=je):je=e[83];let ve;e[84]!==be||e[85]!==je?(ve=o.jsx("span",{className:be,children:je}),e[84]=be,e[85]=je,e[86]=ve):ve=e[86];let ye;e[87]!==F||e[88]!==T?(ye=F&&o.jsx(Ci,{status:T}),e[87]=F,e[88]=T,e[89]=ye):ye=e[89];let we;e[90]!==F||e[91]!==d||e[92]!==u?(we=!F&&o.jsxs(ho,{children:[o.jsx(go,{asChild:!0,children:o.jsx(K,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:wi,children:o.jsx(xo,{size:14})})}),o.jsxs(bo,{align:"end",children:[o.jsxs(Kt,{onClick:Te=>{Te.stopPropagation(),u()},children:[o.jsx(wo,{size:14}),"Duplicate"]}),o.jsxs(Kt,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:Te=>{Te.stopPropagation(),d()},children:[o.jsx(Ns,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[90]=F,e[91]=d,e[92]=u,e[93]=we):we=e[93],e[94]!==ve||e[95]!==ye||e[96]!==we?(W=o.jsxs("div",{className:"flex items-center h-8",children:[ve,ye,we]}),e[94]=ve,e[95]=ye,e[96]=we,e[97]=W):W=e[97],z=J.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:J.map(yi)}),e[6]=S,e[7]=r,e[8]=_,e[9]=s,e[10]=j,e[11]=w,e[12]=c,e[13]=i,e[14]=l,e[15]=v,e[16]=d,e[17]=u,e[18]=a,e[19]=n,e[20]=f,e[21]=T,e[22]=M,e[23]=R,e[24]=P,e[25]=A,e[26]=W,e[27]=z,e[28]=D,e[29]=I,e[30]=$,e[31]=E}else T=e[21],M=e[22],R=e[23],P=e[24],A=e[25],W=e[26],z=e[27],D=e[28],I=e[29],$=e[30],E=e[31];let L;e[98]!==T||e[99]!==b?(L=T==="success"&&o.jsx(Ii,{completedAtEpochMs:b}),e[98]=T,e[99]=b,e[100]=L):L=e[100];let H;e[101]!==r?.error||e[102]!==T?(H=T==="error"&&o.jsx(_i,{error:r?.error}),e[101]=r?.error,e[102]=T,e[103]=H):H=e[103];let U;e[104]!==L||e[105]!==H||e[106]!==A||e[107]!==W||e[108]!==z?(U=o.jsxs("div",{className:A,children:[W,z,L,H]}),e[104]=L,e[105]=H,e[106]=A,e[107]=W,e[108]=z,e[109]=U):U=e[109];let V;return e[110]!==M||e[111]!==R||e[112]!==P||e[113]!==U||e[114]!==D||e[115]!==I||e[116]!==$||e[117]!==E?(V=o.jsxs("div",{className:D,onClick:I,role:$,tabIndex:E,onKeyDown:M,children:[R,P,U]}),e[110]=M,e[111]=R,e[112]=P,e[113]=U,e[114]=D,e[115]=I,e[116]=$,e[117]=E,e[118]=V):V=e[118],V}function yi(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function wi(t){return t.stopPropagation()}function Si(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function Ni(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function ki(t){const e=N.c(2),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-success flex items-center justify-center",children:o.jsx(Ot,{size:8,className:"text-success-foreground"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-destructive flex items-center justify-center",children:o.jsx(Tt,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function Ci(t){const e=N.c(3),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(Ot,{size:11,className:"text-success"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(Tt,{size:11,className:"text-destructive"})}),e[1]=s):s=e[1],s}if(n==="running"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx($e,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function Ii(t){const e=N.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null?new Date(n):null;s=a?a.toISOString().split("T")[0]:null,i=a?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(As,{size:16,className:"text-success"}),o.jsx("span",{className:"text-xs text-success",children:s}),o.jsx("span",{className:"text-xs text-success",children:r})]}),e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==l?(c=o.jsx("div",{className:"inline-flex items-center gap-3 px-1.5 py-1 bg-success-foreground rounded-lg w-fit",children:l}),e[6]=l,e[7]=c):c=e[7],c}function _i(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(At,{size:16,className:"text-destructive"}),e[0]=s):s=e[0];const i=n||"Execution failed";let r;return e[1]!==i?(r=o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-1.5 py-1 bg-destructive-foreground rounded-lg w-fit",children:[s,o.jsx("span",{className:"text-xs text-destructive",children:i})]}),e[1]=i,e[2]=r):r=e[2],r}function Ti(t){const e=N.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=$t(n??"");if(s&&i&&l?.icon){let a;return e[0]!==l.icon||e[1]!==r?(a=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center overflow-hidden",children:o.jsx(Ve,{icon:l.icon,name:r,size:"xs",className:"border-0 rounded-none"})}),e[0]=l.icon,e[1]=r,e[2]=a):a=e[2],a}let c;return e[3]!==s?(c=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:s?o.jsx(Mn,{size:16,className:"text-muted-foreground"}):o.jsx(yo,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function lt(t){const e=N.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=O("w-px",i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;return e[4]!==r||e[5]!==l?(c=o.jsx("div",{className:r,style:l}),e[4]=r,e[5]=l,e[6]=c):c=e[6],c}function $i(t){return t.name?t.name:"toolName"in t.action&&t.action.toolName?t.action.toolName:"code"in t.action?t.name||"Code Step":"Select tool..."}function Ei(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Oi(t){const e=N.c(32),{className:n}=t,s=Me(),i=zn(),r=bi(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=X(),d=B();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(y=>r[y.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{children:"Loading..."}),e[3]=p):p=e[3];let x;e[4]!==n?(x=O("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let m;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let y;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(y=(w,v)=>{const S=r?.[w.name],C=f!==-1&&v>f&&S?.status==="pending",_=v===s.length-1;return o.jsx(vi,{step:w,index:v,isSelected:w.name===i,executionStatus:S,isSkipped:C,isLastStep:_,onSelect:()=>l(w.name),onDelete:()=>c(w.name),onDuplicate:()=>a(w.name)},w.name)},e[14]=i,e[15]=c,e[16]=a,e[17]=f,e[18]=l,e[19]=r,e[20]=s.length,e[21]=y):y=e[21],m=s.map(y),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=m}else m=e[13];let h;e[22]!==m?(h=o.jsx("div",{className:"pt-3 -space-y-1",children:m}),e[22]=m,e[23]=h):h=e[23];let g;e[24]!==d?(g=d?null:o.jsx(Ri,{}),e[24]=d,e[25]=g):g=e[25];let b;e[26]!==h||e[27]!==g?(b=o.jsxs("div",{className:"w-full -space-y-1",children:[h,g]}),e[26]=h,e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==x||e[30]!==b?(j=o.jsx(k.Suspense,{fallback:p,children:o.jsx("div",{className:x,children:b})}),e[29]=x,e[30]=b,e[31]=j):j=e[31],j}function Ri(){const t=N.c(8),{addToolStep:e}=X();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("div",{className:"w-5 shrink-0"}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"w-px h-3 bg-border"}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(jn,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(K,{variant:"outline",size:"icon",className:"size-8 rounded-lg",onClick:e,children:i}),t[3]=e,t[4]=r):r=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"w-px h-8",style:{backgroundImage:"repeating-linear-gradient(180deg, var(--border), var(--border) 4px, transparent 4px, transparent 8px)",backgroundPosition:"left top",backgroundRepeat:"repeat-y",backgroundSize:"2px 100%"}}),t[5]=l):l=t[5];let c;return t[6]!==r?(c=o.jsxs("div",{className:"flex gap-2 items-start px-4 pb-3",children:[n,o.jsxs("div",{className:"flex flex-col border-1 border-transparent items-center shrink-0",children:[s,r,l]})]}),t[6]=r,t[7]=c):c=t[7],c}function Mi(){const t=N.c(11),{org:e}=Y(),s=Ie()??null;let i;t[0]!==e.id||t[1]!==s?(i={connectionId:s,orgId:e.id},t[0]=e.id,t[1]=s,t[2]=i):i=t[2];const r=ee(i);let l;t[3]!==r?(l={client:r},t[3]=r,t[4]=l):l=t[4];const c=vt(l);let a;t[5]!==c.data?.tools?(a=c.data?.tools??[],t[5]=c.data?.tools,t[6]=a):a=t[6];let d;return t[7]!==a||t[8]!==c.error||t[9]!==c.isLoading?(d={tools:a,isLoading:c.isLoading,error:c.error},t[7]=a,t[8]=c.error,t[9]=c.isLoading,t[10]=d):d=t[10],d}function Ai(t){const e=N.c(7),{className:n}=t;if(!Ie()){let r;e[0]!==n?(r=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground p-4 text-center",children:"Select an agent to see available tools"}),e[2]=l):l=e[2];let c;return e[3]!==r?(c=o.jsx("div",{className:r,children:l}),e[3]=r,e[4]=c):c=e[4],c}let i;return e[5]!==n?(i=o.jsx(Pi,{className:n}),e[5]=n,e[6]=i):i=e[6],i}function Pi(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=Mi(),l=Re(),{updateStep:c}=X(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let v;e[3]!==d?(v=S=>S.name===d,e[3]=d,e[4]=v):v=e[4],u=s.find(v),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const p=gr(s,u??null,zi,Li);let x;e[5]!==l||e[6]!==c?(x=v=>{l&&c(l.name,{action:{...l.action,toolName:v.name},outputSchema:v.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const m=x;if(i){let v;e[8]!==n?(v=O("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=v):v=e[9];let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Ee,{size:"sm"})}),e[10]=S):S=e[10];let C;return e[11]!==v?(C=o.jsx("div",{className:v,children:S}),e[11]=v,e[12]=C):C=e[12],C}if(r){let v;e[13]!==n?(v=O("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=v):v=e[14];let S;e[15]!==r.message?(S=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-destructive p-4 text-center",children:["Failed to load tools: ",r.message]}),e[15]=r.message,e[16]=S):S=e[16];let C;return e[17]!==v||e[18]!==S?(C=o.jsx("div",{className:v,children:S}),e[17]=v,e[18]=S,e[19]=C):C=e[19],C}let h;e[20]!==n?(h=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=h):h=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("span",{className:"text-base font-medium text-foreground",children:"Select tool"}),e[22]=g):g=e[22];let b;e[23]!==s.length?(b=o.jsx("div",{className:"flex items-start border-b border-border",children:o.jsxs("div",{className:"flex-1 flex items-center h-12 px-5",children:[g,o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",s.length,")"]})]})}),e[23]=s.length,e[24]=b):b=e[24];let j;if(e[25]!==m||e[26]!==p||e[27]!==d){let v;e[29]!==m||e[30]!==d?(v=S=>o.jsx(Di,{icon:null,title:S.name,description:S.description,isSelected:S.name===d,onClick:()=>m(S)},S.name),e[29]=m,e[30]=d,e[31]=v):v=e[31],j=p.map(v),e[25]=m,e[26]=p,e[27]=d,e[28]=j}else j=e[28];let y;e[32]!==j?(y=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=y):y=e[33];let w;return e[34]!==h||e[35]!==b||e[36]!==y?(w=o.jsxs("div",{className:h,children:[b,y]}),e[34]=h,e[35]=b,e[36]=y,e[37]=w):w=e[37],w}function Li(t,e){return t.name.localeCompare(e.name)}function zi(t){return t.name}function Di(t){const e=N.c(20),{icon:n,title:s,description:i,isSelected:r,onClick:l}=t,c=r&&"bg-muted/50";let a;e[0]!==c?(a=O("flex items-start gap-2.5 min-h-14 px-5 py-4 cursor-pointer transition-colors","hover:bg-muted/50",c),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==l?(d=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==s?(u=o.jsx(Ve,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==s?(f=o.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:s}),e[7]=s,e[8]=f):f=e[8];let p;e[9]!==i?(p=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=p):p=e[10];let x;e[11]!==f||e[12]!==p?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,p]}),e[11]=f,e[12]=p,e[13]=x):x=e[13];let m;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(m=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,x]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=x,e[19]=m):m=e[19],m}var te="Accordion",Wi=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ht,Hi,Vi]=Cs(te),[qe]=ln(te,[Vi,bn]),Vt=bn(),ts=q.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(Ht.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(qi,{...r,ref:e}):o.jsx(Ui,{...i,ref:e})})});ts.displayName=te;var[ns,Fi]=qe(te),[ss,Bi]=qe(te,{collapsible:!1}),Ui=q.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=ht({prop:n,defaultProp:s??"",onChange:i,caller:te});return o.jsx(ns,{scope:t.__scopeAccordion,value:q.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:q.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(ss,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(os,{...l,ref:e})})})}),qi=q.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=ht({prop:n,defaultProp:s??[],onChange:i,caller:te}),a=q.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=q.useCallback(u=>c((f=[])=>f.filter(p=>p!==u)),[c]);return o.jsx(ns,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(ss,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(os,{...r,ref:e})})})}),[Ki,Ke]=qe(te),os=q.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=q.useRef(null),a=rn(c,e),d=Hi(n),f=Is(i)==="ltr",p=ne(t.onKeyDown,x=>{if(!Wi.includes(x.key))return;const m=x.target,h=d().filter(_=>!_.ref.current?.disabled),g=h.findIndex(_=>_.ref.current===m),b=h.length;if(g===-1)return;x.preventDefault();let j=g;const y=0,w=b-1,v=()=>{j=g+1,j>w&&(j=y)},S=()=>{j=g-1,j<y&&(j=w)};switch(x.key){case"Home":j=y;break;case"End":j=w;break;case"ArrowRight":r==="horizontal"&&(f?v():S());break;case"ArrowDown":r==="vertical"&&v();break;case"ArrowLeft":r==="horizontal"&&(f?S():v());break;case"ArrowUp":r==="vertical"&&S();break}const C=j%b;h[C].ref.current?.focus()});return o.jsx(Ki,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(Ht.Slot,{scope:n,children:o.jsx(xt.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:p})})})}),He="AccordionItem",[Ji,Ft]=qe(He),rs=q.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=Ke(He,n),l=Fi(He,n),c=Vt(n),a=ks(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(Ji,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(io,{"data-orientation":r.orientation,"data-state":us(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});rs.displayName=He;var is="AccordionHeader",ls=q.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ke(te,n),r=Ft(is,n);return o.jsx(xt.h3,{"data-orientation":i.orientation,"data-state":us(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});ls.displayName=is;var mt="AccordionTrigger",cs=q.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ke(te,n),r=Ft(mt,n),l=Bi(mt,n),c=Vt(n);return o.jsx(Ht.ItemSlot,{scope:n,children:o.jsx(ro,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});cs.displayName=mt;var as="AccordionContent",ds=q.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ke(te,n),r=Ft(as,n),l=Vt(n);return o.jsx(lo,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...l,...s,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});ds.displayName=as;function us(t){return t?"open":"closed"}var Gi=ts,Xi=rs,Zi=ls,Qi=cs,Yi=ds;function el(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Gi,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function tl(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("border-b last:border-b-0",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx(Xi,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function nl(t){const e=N.c(11);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=O("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-4 text-left text-sm font-medium transition-all outline-none hover:bg-accent/50 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-90",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(jo,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 transition-transform duration-200"}),e[6]=l):l=e[6];let c;return e[7]!==n||e[8]!==i||e[9]!==r?(c=o.jsx(Zi,{className:"flex",children:o.jsxs(Qi,{"data-slot":"accordion-trigger",className:r,...i,children:[n,l]})}),e[7]=n,e[8]=i,e[9]=r,e[10]=c):c=e[10],c}function sl(t){const e=N.c(12);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=O("pt-0 pb-4",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]!==n||e[7]!==r?(l=o.jsx("div",{className:r,children:n}),e[6]=n,e[7]=r,e[8]=l):l=e[8];let c;return e[9]!==i||e[10]!==l?(c=o.jsx(Yi,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...i,children:l}),e[9]=i,e[10]=l,e[11]=c):c=e[11],c}function ol(t){const{updateStep:e}=X(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=Bt(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function rl(t){const e=N.c(32),{className:n}=t,s=Re(),{appendStep:i}=X();ol(s);const r=B(),{item:l}=re(r);if(!s){let b;e[0]!==n?(b=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==i?(j=()=>{i({type:"tool"})},e[2]=i,e[3]=j):j=e[3];let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(jn,{size:14}),e[4]=y):y=e[4];let w;e[5]!==j?(w=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground gap-2 flex-col",children:["Select or create a step to configure",o.jsx(K,{variant:"ghost",size:"icon",className:"size-7",onClick:j,children:y})]}),e[5]=j,e[6]=w):w=e[6];let v;return e[7]!==b||e[8]!==w?(v=o.jsx("div",{className:b,children:w}),e[7]=b,e[8]=w,e[9]=v):v=e[9],v}const c=s?.name,a=!!(l?.completed_steps?.success?.some(b=>b.name===c)||l?.completed_steps?.error?.includes(c));let d;e[10]!==n?(d=O("flex flex-col h-full bg-sidebar overflow-scroll",n),e[10]=n,e[11]=d):d=e[11];let u,f;e[12]!==s?(u=o.jsx(il,{step:s}),f=o.jsx(cl,{step:s}),e[12]=s,e[13]=u,e[14]=f):(u=e[13],f=e[14]);const p=a?"open":"closed";let x;e[15]!==s||e[16]!==a||e[17]!==p?(x=o.jsx(dl,{step:s,defaultOpen:a},p),e[15]=s,e[16]=a,e[17]=p,e[18]=x):x=e[18];let m;e[19]!==s||e[20]!==r?(m=!r&&o.jsx(pl,{step:s}),e[19]=s,e[20]=r,e[21]=m):m=e[21];let h;e[22]!==s||e[23]!==r?(h=!r&&o.jsx(gl,{step:s}),e[22]=s,e[23]=r,e[24]=h):h=e[24];let g;return e[25]!==d||e[26]!==u||e[27]!==f||e[28]!==x||e[29]!==m||e[30]!==h?(g=o.jsxs("div",{className:d,children:[u,f,x,m,h]}),e[25]=d,e[26]=u,e[27]=f,e[28]=x,e[29]=m,e[30]=h,e[31]=g):g=e[31],g}function il(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=B(),l=i??"";let c;e[0]!==l?(c=o.jsx(Ve,{icon:null,name:l,size:"xs",className:"shadow-sm"}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==i?(a=o.jsx("span",{className:"text-base font-medium text-foreground truncate flex-1",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==r?(d=r?null:o.jsx(ll,{}),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==a||e[8]!==d?(u=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;e[10]!==n.description?(f=n.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[10]=n.description,e[11]=f):f=e[11];let p;return e[12]!==u||e[13]!==f?(p=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[u,f]}),e[12]=u,e[13]=f,e[14]=p):p=e[14],p}function ll(){const t=N.c(9),e=Re(),{updateStep:n,startReplacingTool:s}=X(),i=B(),l=e&&"toolName"in e.action?e.action.toolName:null;let c;t[0]!==e||t[1]!==s||t[2]!==l||t[3]!==i||t[4]!==n?(c=()=>{if(e){if(i){nn.error("You cannot replace a tool while a workflow is executing.");return}l&&s(l),n(e.name,{action:{...e.action,toolName:""}})}},t[0]=e,t[1]=s,t[2]=l,t[3]=i,t[4]=n,t[5]=c):c=t[5];const a=c;let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Rn,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(K,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:d}),t[7]=a,t[8]=u):u=t[8],u}function Bt(t){const e=N.c(13),{org:n}=Y(),i=Ie()??null;let r;e[0]!==n.id||e[1]!==i?(r={connectionId:i,orgId:n.id},e[0]=n.id,e[1]=i,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==l?(c={client:l},e[3]=l,e[4]=c):c=e[4];const a=vt(c);let d;e[5]!==t||e[6]!==a.data?.tools?(d=a.data?.tools?.find(p=>p.name===t),e[5]=t,e[6]=a.data?.tools,e[7]=d):d=e[7];const u=d;let f;return e[8]!==u||e[9]!==a.error||e[10]!==a.isLoading||e[11]!==a.isSuccess?(f={tool:u,isLoading:a.isLoading,isReady:a.isSuccess,error:a.error},e[8]=u,e[9]=a.error,e[10]=a.isLoading,e[11]=a.isSuccess,e[12]=f):f=e[12],f}function cl(t){const e=N.c(18),{step:n}=t,{updateStep:s}=X(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=B(),{tool:c}=Bt(r??"");if(!c||!c.inputSchema)return null;let a;e[0]!==n.name||e[1]!==s?(a=v=>{s(n.name,{input:v})},e[0]=n.name,e[1]=s,e[2]=a):a=e[2];const d=a;let u;e[3]!==n.input||e[4]!==c.inputSchema||e[5]!==l?(u=l?al(c.inputSchema,n.input):c.inputSchema,e[3]=n.input,e[4]=c.inputSchema,e[5]=l,e[6]=u):u=e[6];const f=u,p=l?"output":"input";let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(nl,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[7]=x):x=e[7];const m=n.name+l,h=!!l,g=f,b=n.input;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[8]=j):j=e[8];let y;e[9]!==d||e[10]!==m||e[11]!==h||e[12]!==g||e[13]!==b?(y=o.jsxs(tl,{value:"input",className:"border-b-0",children:[x,o.jsx(sl,{className:"px-5 pt-2",children:o.jsx(es,{readOnly:h,inputSchema:g,inputParams:b,setInputParams:d,mentions:j},m)})]}),e[9]=d,e[10]=m,e[11]=h,e[12]=g,e[13]=b,e[14]=y):y=e[14];let w;return e[15]!==y||e[16]!==p?(w=o.jsx(el,{type:"single",collapsible:!0,defaultValue:p,className:"border-b border-border shrink-0",children:y}),e[15]=y,e[16]=p,e[17]=w):w=e[17],w}function al(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function dl(t){const e=N.c(24),{step:n,defaultOpen:s}=t,i=n.outputSchema,r=B(),{item:l}=re(r),c=!!(l?.completed_steps?.success?.some(T=>T.name===n.name)||l?.completed_steps?.error?.includes(n.name)),[a,d]=k.useState(s),{output:u,error:f}=rr(r,c?n.name:void 0);let p;e[0]!==f||e[1]!==u?(p=u||(f?{error:f}:void 0),e[0]=f,e[1]=u,e[2]=p):p=e[2];const x=p,m=i&&typeof i=="object"?i.properties:void 0;let h;e[3]!==m?(h=m?Object.entries(m):[],e[3]=m,e[4]=h):h=e[4];const g=h,b=a?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[5]!==b?(j=O("flex flex-col border-b border-border",b),e[5]=b,e[6]=j):j=e[6];let y;e[7]!==a?(y=()=>d(!a),e[7]=a,e[8]=y):y=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),e[9]=w):w=e[9];let v;e[10]!==a?(v=o.jsxs("div",{className:"flex items-center justify-between",children:[w,a?o.jsx(Mt,{size:14,className:"text-muted-foreground"}):o.jsx(Rt,{size:14,className:"text-muted-foreground"})]}),e[10]=a,e[11]=v):v=e[11];let S;e[12]!==y||e[13]!==v?(S=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:y,children:v}),e[12]=y,e[13]=v,e[14]=S):S=e[14];let C;e[15]!==x||e[16]!==a||e[17]!==g||e[18]!==r?(C=a&&o.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:[r&&x?o.jsx(ke,{code:JSON.stringify(x,null,2),language:"json",height:"100%",readOnly:!0}):null,!r&&g.map(ul)]}),e[15]=x,e[16]=a,e[17]=g,e[18]=r,e[19]=C):C=e[19];let _;return e[20]!==j||e[21]!==S||e[22]!==C?(_=o.jsxs("div",{className:j,children:[S,C]}),e[20]=j,e[21]=S,e[22]=C,e[23]=_):_=e[23],_}function ul(t){const[e,n]=t;return o.jsx(ml,{name:e,schema:n},e)}function fl(t){switch(t){case"string":return{Icon:In,color:"text-blue-500"};case"number":case"integer":return{Icon:kn,color:"text-blue-500"};case"array":return{Icon:wn,color:"text-purple-500"};case"object":return{Icon:yn,color:"text-orange-500"};case"boolean":return{Icon:Cn,color:"text-pink-500"};case"null":return{Icon:gt,color:"text-gray-500"};default:return{Icon:Sn,color:"text-muted-foreground"}}}function ml(t){const e=N.c(28),{name:n,schema:s}=t,i=Re(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:w,color:v}=fl(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=w,c=14,a=O(v),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=d,e[5]=u}else l=e[1],c=e[2],a=e[3],d=e[4],u=e[5];let f;e[6]!==l||e[7]!==c||e[8]!==a?(f=o.jsx(l,{size:c,className:a}),e[6]=l,e[7]=c,e[8]=a,e[9]=f):f=e[9];let p;e[10]!==n?(p=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=p):p=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==p?(x=o.jsxs("div",{className:d,children:[f,p]}),e[12]=d,e[13]=f,e[14]=p,e[15]=x):x=e[15];let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(En,{size:14,className:"opacity-50"}),e[16]=m):m=e[16];const h=i?.name;let g;e[17]!==h?(g=o.jsxs("span",{className:"text-muted-foreground",children:[h,"."]}),e[17]=h,e[18]=g):g=e[18];let b;e[19]!==n?(b=o.jsx("div",{className:"bg-blue-500/10 text-blue-500 px-1 py-0.5 rounded",children:n}),e[19]=n,e[20]=b):b=e[20];let j;e[21]!==g||e[22]!==b?(j=o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[m,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let y;return e[24]!==j||e[25]!==u||e[26]!==x?(y=o.jsxs("div",{className:u,children:[x,j]}),e[24]=j,e[25]=u,e[26]=x,e[27]=y):y=e[27],y}function pl(t){const e=N.c(29),{step:n}=t,{updateStep:s}=X(),i=B(),[r,l]=k.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=Bt(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
8
- // Tool output schema not available
9
- }`;const _=d.outputSchema,T=_.properties;return T?`interface Input {
10
- ${Object.entries(T).map(R=>{const[P,A]=R,W=ze(A),z=!_.required?.includes(P);return` ${P}${z?"?":""}: ${W};`}).join(`
11
- `)}
12
- }`:`interface Input {
13
- [key: string]: unknown;
14
- }`},e[0]=d,e[1]=f):f=e[1];const p=f;let x;e[2]!==p||e[3]!==n.action||e[4]!==n.name||e[5]!==s?(x=()=>{if("transformCode"in n.action&&n.action.transformCode){l(hl);return}const T=`${p()}
15
-
16
- interface Output {
17
- // Define your output type here
18
- result: unknown;
19
- }
20
-
21
- export default async function(input: Input): Promise<Output> {
22
- // Transform the tool output
23
- return {
24
- result: input,
25
- };
26
- }`;s(n.name,{action:{...n.action,transformCode:T}}),l(xl)},e[2]=p,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const m=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(_,T)=>{s(n.name,{action:{...n.action,transformCode:_},...T?{outputSchema:T}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=h):h=e[10];const g=h;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[11]!==b?(j=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=y):y=e[13];let w;e[14]!==r?(w=o.jsxs("div",{className:"flex items-center justify-between",children:[y,r?o.jsx(Mt,{size:14,className:"text-muted-foreground"}):o.jsx(Rt,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==w||e[17]!==m?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:w}),e[16]=w,e[17]=m,e[18]=v):v=e[18];let S;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(S=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ke,{code:u,language:"typescript",readOnly:i!==void 0,onSave:g,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=g,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=S):S=e[24];let C;return e[25]!==j||e[26]!==v||e[27]!==S?(C=o.jsxs("div",{className:j,children:[v,S]}),e[25]=j,e[26]=v,e[27]=S,e[28]=C):C=e[28],C}function xl(t){return!t}function hl(t){return!t}function gl(t){const e=N.c(24),{step:n}=t,[s,i]=k.useState(!1),{updateStep:r}=X(),l="code"in n.action&&n.action.code?n.action.code:null,c=B();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,y)=>{r(n.name,{action:{...n.action,code:j},...y?{outputSchema:y}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const d=a;if(!l)return null;const u=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==u?(f=O("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let p;e[6]!==s?(p=()=>i(!s),e[6]=s,e[7]=p):p=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=x):x=e[8];let m;e[9]!==s?(m=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx(Mt,{size:14,className:"text-muted-foreground"}):o.jsx(Rt,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=m):m=e[10];let h;e[11]!==p||e[12]!==m?(h=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:m}),e[11]=p,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==n.name||e[18]!==c?(g=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ke,{onSave:(j,y)=>d(j,y),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=d,e[16]=s,e[17]=n.name,e[18]=c,e[19]=g):g=e[19];let b;return e[20]!==f||e[21]!==h||e[22]!==g?(b=o.jsxs("div",{className:f,children:[h,g]}),e[20]=f,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}function ze(t){if(Array.isArray(t.type))return t.type.map(n=>ze({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${ze(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=ze(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function bl(t){switch(t){case"success":return o.jsxs(Se,{variant:"success",className:"gap-1",children:[o.jsx(Ot,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(Se,{variant:"destructive",className:"gap-1",children:[o.jsx(At,{size:11}),"Error"]});case"running":return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(Le,{size:11}),"Running"]});case"enqueued":return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(Le,{size:11}),"On hold"]});case"cancelled":return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(vn,{size:11}),"Cancelled"]});default:return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(Le,{size:11}),t]})}}function jl(t){return`Run #${t.slice(-4).toUpperCase()}`}function vl(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=lr(),{setShowExecutionsList:r}=zt(),{setTrackingExecutionId:l}=X(),c=B();let a;e[0]!==l?(a=y=>{l(y)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let p;e[4]!==n?(p=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=p):p=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(vn,{size:11}),e[7]=m):m=e[7];let h;e[8]!==f?(h=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[x,o.jsx(K,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:m})]}),e[8]=f,e[9]=h):h=e[9];let g;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((y,w)=>o.jsx(yl,{execution:y,isSelected:y.id===c,isFirst:w===0,onSelect:()=>d(y.id)},y.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=g):g=e[14];let b;e[15]!==g?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:g}),e[15]=g,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==h||e[19]!==b?(j=o.jsxs("div",{className:p,children:[h,b]}),e[17]=p,e[18]=h,e[19]=b,e[20]=j):j=e[20],j}function yl(t){const e=N.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n.status?(u=bl(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=jl(n.id),e[6]=n.id,e[7]=f):f=e[7];let p;e[8]!==f?(p=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=p):p=e[9];let x;e[10]!==u||e[11]!==p?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,p]}),e[10]=u,e[11]=p,e[12]=x):x=e[12];let m;return e[13]!==r||e[14]!==d||e[15]!==x?(m=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=m):m=e[16],m}function fs(t){const e=N.c(11),{itemId:n}=t,[s,i]=k.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=oe(r),c=l??"no-connection",{org:a}=Y(),d=l??null;let u;e[1]!==a.id||e[2]!==d?(u={connectionId:d,orgId:a.id},e[1]=a.id,e[2]=d,e[3]=u):u=e[3];const f=ee(u),p=bt(c,"WORKFLOW",n,f),x=jt(c,"WORKFLOW",f);let m;e[4]!==x||e[5]!==n?(m=async b=>{i(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{i(!1)})},e[4]=x,e[5]=n,e[6]=m):m=e[6];const h=m;let g;return e[7]!==s||e[8]!==p||e[9]!==h?(g={item:p,update:h,isUpdating:s},e[7]=s,e[8]=p,e[9]=h,e[10]=g):g=e[10],g}function wl(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=X();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.steps||e[3]!==n.title){const f={title:n.title,description:n.description,steps:n.steps};r=ke,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.steps,e[3]=n.title,e[4]=r,e[5]=l,e[6]=c,e[7]=a}else r=e[4],l=e[5],c=e[6],a=e[7];let d;e[8]!==s||e[9]!==i||e[10]!==n?(d=f=>{const p=JSON.parse(f);i({...n,...p}),s(p)},e[8]=s,e[9]=i,e[10]=n,e[11]=d):d=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):u=e[17],u}function Sl(){const t=N.c(9),e=B(),{item:n}=re(e),s=n?.start_at_epoch_ms,i=n?.completed_at_epoch_ms,r=n?.status==="running"&&s&&!i;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Date.now(),t[0]=l):l=t[0];const c=k.useRef(l);let a;t[1]!==r?(a=h=>{if(!r)return Nl;const g=setInterval(()=>{c.current=Date.now(),h()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const d=a;let u;t[3]!==r?(u=()=>r?c.current:0,t[3]=r,t[4]=u):u=t[4];const f=u,p=k.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let m=null;if(s){let h;t[5]!==s?(h=new Date(s).getTime(),t[5]=s,t[6]=h):h=t[6];const g=h;if(i){let b;t[7]!==i?(b=new Date(i).getTime(),t[7]=i,t[8]=b):b=t[8],m=Math.max(0,b-g)}else r&&(m=Math.max(0,p-g))}return m??x}function Nl(){}function kl(t){if(t<1e3)return`${t}ms`;const e=t/1e3,n=e%60,s=Math.floor(e/60),i=s%60,r=Math.floor(s/60);return r>0?`${r}h ${i}m ${n.toFixed(3)}s`:i>0?`${i}m ${n.toFixed(3)}s`:`${n.toFixed(3)}s`}function Cl(){const t=N.c(20),{setTrackingExecutionId:e}=X(),n=B(),s=Sl();let i;t[0]!==s?(i=s!=null?kl(s):null,t[0]=s,t[1]=i):i=t[1];const r=i;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(_s,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=l):l=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=c):c=t[3];let a;t[4]!==n?(a=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[c,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=a):a=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(vo,{className:"w-4 h-4 text-muted-foreground"}),t[6]=d):d=t[6];let u;t[7]!==r?(u=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[d,o.jsx("span",{className:"text-sm text-muted-foreground",children:r})]}),t[7]=r,t[8]=u):u=t[8];let f;t[9]!==a||t[10]!==u?(f=o.jsxs("div",{className:"flex items-center h-full",children:[l,a,u]}),t[9]=a,t[10]=u,t[11]=f):f=t[11];let p;t[12]!==e?(p=()=>e(void 0),t[12]=e,t[13]=p):p=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(gt,{className:"w-4 h-4 text-muted-foreground"}),t[14]=x):x=t[14];let m;t[15]!==p?(m=o.jsx(K,{variant:"ghost",size:"xs",onClick:p,children:x}),t[15]=p,t[16]=m):m=t[16];let h;return t[17]!==f||t[18]!==m?(h=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[f,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function Il(t){const e=N.c(18),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=oe(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l,update:c,isUpdating:a}=fs(r);let d;e[3]!==l?(d=JSON.stringify(l),e[3]=l,e[4]=d):d=e[4];const u=d;if(!l){let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Et,{icon:o.jsx(Nn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})}),e[5]=m):m=e[5];let h;return e[6]!==n?(h=o.jsx(Ne,{onBack:n,children:m}),e[6]=n,e[7]=h):h=e[7],h}let f;e[8]!==l?(f={workflow:l,trackingExecutionId:void 0,currentStepTab:"input"},e[8]=l,e[9]=f):f=e[9];let p;e[10]!==a||e[11]!==n||e[12]!==c?(p=o.jsx(_l,{onBack:n,onUpdate:c,isUpdating:a}),e[10]=a,e[11]=n,e[12]=c,e[13]=p):p=e[13];let x;return e[14]!==u||e[15]!==f||e[16]!==p?(x=o.jsx(Xo,{initialState:f,children:p},u),e[14]=u,e[15]=f,e[16]=p,e[17]=x):x=e[17],x}function _l(t){const e=N.c(24),{onBack:n,onUpdate:s,isUpdating:i}=t,r=Ce(),l=B(),{viewMode:c,showExecutionsList:a}=zt(),d=Re();let u;e[0]!==s||e[1]!==r?(u=async()=>{await s(r)},e[0]=s,e[1]=r,e[2]=u):u=e[2];const f=u,p=d&&"toolName"in d.action,x=p?d.action.toolName:null,m=p&&!x&&!l,h=!m&&(d||l||!a);let g;e[3]!==f||e[4]!==i||e[5]!==r.description||e[6]!==r.title?(g=o.jsx(mi,{title:r.title,description:r.description,onSave:f,isSaving:i}),e[3]=f,e[4]=i,e[5]=r.description,e[6]=r.title,e[7]=g):g=e[7];let b;e[8]!==l?(b=l&&o.jsx(Cl,{}),e[8]=l,e[9]=b):b=e[9];let j;e[10]!==s||e[11]!==a||e[12]!==h||e[13]!==m||e[14]!==c||e[15]!==r?(j=o.jsx("div",{className:"flex-1 overflow-hidden",children:c==="code"?o.jsx(wl,{workflow:r,onUpdate:s}):o.jsxs(Bs,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(Ut,{defaultSize:50,minSize:30,children:o.jsx(Oi,{})}),o.jsx(Us,{}),o.jsxs(Ut,{defaultSize:50,minSize:25,children:[m&&o.jsx(Ai,{className:"border-l border-border"}),a&&o.jsx(vl,{}),h&&o.jsx(rl,{className:"border-l border-border"})]})]})}),e[10]=s,e[11]=a,e[12]=h,e[13]=m,e[14]=c,e[15]=r,e[16]=j):j=e[16];let y;e[17]!==g||e[18]!==b||e[19]!==j?(y=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[g,b,j]}),e[17]=g,e[18]=b,e[19]=j,e[20]=y):y=e[20];let w;return e[21]!==n||e[22]!==y?(w=o.jsx(Ne,{onBack:n,children:y}),e[21]=n,e[22]=y,e[23]=w):w=e[23],w}function Tl(t){const e=N.c(3),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=oe(s),l=bt(i??"no-connection","WORKFLOW_EXECUTION",n,i);let c;return e[1]!==l?(c={item:l},e[1]=l,e[2]=c):c=e[2],c}function $l(t){const e=N.c(13),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=oe(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l}=Tl(r);if(!l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Et,{icon:o.jsx(Nn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})}),e[3]=u):u=e[3];let f;return e[4]!==n?(f=o.jsx(Ne,{onBack:n,children:u}),e[4]=n,e[5]=f):f=e[5],f}let c;e[6]!==l?(c=JSON.stringify(l,null,2),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==c?(a=o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(ke,{height:"100%",code:c,language:"json",readOnly:!0})}),e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(Ne,{onBack:n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}const El={workflow:Il,workflow_execution:$l,prompt:To};function Ol(){const t=N.c(6),e=cn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=oe(n),i=decodeURIComponent(s.itemId);let r;t[1]!==e.history?(r=()=>{e.history.back()},t[1]=e.history,t[2]=r):r=t[2];const l=r,c=Rl;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Lo,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function Rl(t){return Promise.resolve()}function Ml(){const t=N.c(19),e=cn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=oe(n),i=s.connectionId,r=decodeURIComponent(s.collectionName),l=decodeURIComponent(s.itemId);let c;t[1]!==e.history?(c=()=>{e.history.back()},t[1]=e.history,t[2]=c):c=t[2];const a=c,d=i??"no-connection",{org:u}=Y(),f=i??null;let p;t[3]!==u.id||t[4]!==f?(p={connectionId:f,orgId:u.id},t[3]=u.id,t[4]=f,t[5]=p):p=t[5];const x=ee(p),m=jt(d,r,x);let h;t[6]!==m||t[7]!==l?(h=async S=>{l&&await m.update.mutateAsync({id:l,data:S})},t[6]=m,t[7]=l,t[8]=h):h=t[8];const g=h;let b;t[9]!==r?(b=r?.toLowerCase(),t[9]=r,t[10]=b):b=t[10];const j=b,y=j&&El[j];if(y){let S;return t[11]!==y||t[12]!==a||t[13]!==g||t[14]!==l?(S=o.jsx(y,{itemId:l,onBack:a,onUpdate:g}),t[11]=y,t[12]=a,t[13]=g,t[14]=l,t[15]=S):S=t[15],S}let w;t[16]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(Ts,{size:36,className:"text-muted-foreground"}),t[16]=w):w=t[16];let v;return t[17]!==a?(v=o.jsx(Et,{icon:w,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[17]=a,t[18]=v):v=t[18],v}function Al(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=oe(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ol,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Ml,{}),t[2]=r):r=t[2],r}function Xc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(dn,{children:o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Al,{})})}),t[0]=e):e=t[0],e}export{Xc as default};
@@ -1 +0,0 @@
1
- import{c as Q,j as o,f as H,bg as X,r as q,a as ce,u as ae,g as le,bq as me}from"./index-CSKo3AB-.js";import{E as G,I as Y}from"./empty-state-D5F6myv7.js";import{E as Z}from"./error-boundary-BOGwopZ8.js";import{b as de}from"./use-binding-DWMAlJMq.js";import{u as ue,S as pe}from"./index-C8qswj69.js";import{f as fe}from"./use-collections-DxVui4KR.js";import{u as J,a as he}from"./use-connection-M951sLQc.js";import{u as xe}from"./constants-00bCXGh6.js";import{b as ge,c as be}from"./use-mcp-prompts-B8x8i4pO.js";import{B as je}from"./button-CFAZeZNj.js";import{R as ye}from"./resource-tabs-C_5hrBh-.js";import{i as ee}from"./Loading01-DQ8Kn5fo.js";import{V as te,a as Se,b as Ce}from"./layout-eAPYoLHe.js";import{C as ve}from"./collection-tab-DaMZyMNK.js";import{C as oe}from"./collection-display-button-KL6yy337.js";import{C as se}from"./collection-search-38g04oQk.js";import{C as ne}from"./collection-table-wrapper-a4UtkhWO.js";import{P as re}from"./pin-to-sidebar-button-DTtHVcuw.js";import{C as ie}from"./card-BNUgm4Cj.js";import{R as Ne,T as Te}from"./tools-list-DmtwoEPt.js";import"./binder-D0pyLP77.js";import"./mcp-oauth-Dyuau07a.js";import"./env-vars-editor-B5RFEwRD.js";import"./input-dDHeSId1.js";import"./Plus-BcDBhW0L.js";import"./Trash01-BvTKgpoJ.js";import"./File06-CR5y5_r6.js";import"./Key01-CtWWv5DE.js";import"./badge-BGQ828q4.js";import"./dropdown-menu-BSCcMvpq.js";import"./Grid01-z7B51opS.js";import"./form-D2fsSg1B.js";import"./select-DIh_ARVf.js";import"./tooltip-C6p3ZTWD.js";import"./Check-Dl4vgpiq.js";import"./ChevronDown-Bw360URq.js";import"./extract-connection-data-ArbtrUUq.js";import"./constants-DViIPxIH.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CbzWp9OX.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-jAK3hIr0.js";import"./Terminal-ByvCcEAl.js";import"./use-virtual-mcp-sMRp6Cch.js";import"./index-DOPyUYPA.js";import"./index-iYJsRKb1.js";import"./index-DHEzlhNG.js";import"./X-VemvUJYi.js";import"./monaco-editor-CoGmzjgM.js";import"./infiniteQueryObserver-DITl44kb.js";import"./spinner-D29bareA.js";import"./localstorage-keys-RorudcE2.js";import"./useQuery-CErcyT2z.js";import"./useMutation-B-hML37f.js";import"./popover-7buvgRdj.js";import"./Image01-DaJkh8SV.js";import"./SearchMd-HI2aO3Sf.js";import"./dialog-DM-upVuo.js";import"./AlertCircle-BFx0e2Kg.js";import"./ArrowUp-R0MaTaQm.js";import"./Edit01-eTcj7luW.js";import"./Copy01-Dwxl1_b8.js";import"./use-create-virtual-mcp-jExGASGt.js";import"./ArrowLeft-CXYe7OQX.js";import"./DotsVertical-7fR0Oh92.js";import"./use-list-state-6d2DWIZc.js";import"./use-mobile-npvaN7oN.js";import"./empty-state-MJclvS0E.js";import"./Inbox01-DN0A5urx.js";import"./avatar-Cbkc6T1n.js";import"./alert-dialog-UkKJZN3T.js";import"./List-DjfxyLsa.js";import"./view-mode-toggle-CHe5z87O.js";import"./use-organization-settings-D2PS4P0Y.js";function we(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:l,onPromptClick:b,showToolbar:T,emptyMessage:E}=t,I=T===void 0?!0:T,R=E===void 0?"This connection doesn't have any prompts yet.":E,u=H(),x=X().location.href,[j,f]=q.useState(""),[g,i]=q.useState("table"),[p,w]=q.useState("name"),[m,D]=q.useState("asc");let V;e[0]!==m||e[1]!==p?(V=h=>{p===h?(D(_e),m==="desc"&&w(void 0)):(w(h),D("asc"))},e[0]=m,e[1]=p,e[2]=V):V=e[2];const v=V;let k;e[3]!==s||e[4]!==u||e[5]!==b||e[6]!==r?(k=h=>{b?b(h):s&&r&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=u,e[5]=b,e[6]=r,e[7]=k):k=e[7];const _=k;let $;if(e[8]!==n||e[9]!==j||e[10]!==m||e[11]!==p){const h=!n||n.length===0?[]:j.trim()?(()=>{const K=j.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():n;$=!p||!m?h:[...h].sort((K,B)=>{const F=K[p]||"",U=B[p]||"",W=String(F).localeCompare(String(U));return m==="asc"?W:-W}),e[8]=n,e[9]=j,e[10]=m,e[11]=p,e[12]=$}else $=e[12];const N=$;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:ke,sortable:!0},{id:"description",header:"Description",render:Re,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L.filter(Ie).map($e),e[14]=a):a=e[14];const A=a;let y;e[15]!==l||e[16]!==d||e[17]!==v||e[18]!==I||e[19]!==m||e[20]!==p||e[21]!==x||e[22]!==g?(y=I&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:g,onViewModeChange:i,sortKey:p,sortDirection:m,onSort:v,sortOptions:A}),o.jsx(re,{title:d?`${d}: Prompts`:"Prompts",url:x,icon:l??"description"})]}),e[15]=l,e[16]=d,e[17]=v,e[18]=I,e[19]=m,e[20]=p,e[21]=x,e[22]=g,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[24]=S):S=e[24];let C;e[25]!==j?(C=o.jsx(se,{value:j,onChange:f,placeholder:"Search prompts...",onKeyDown:S}),e[25]=j,e[26]=C):C=e[26];let c;e[27]!==R||e[28]!==_||e[29]!==v||e[30]!==j||e[31]!==m||e[32]!==p||e[33]!==N||e[34]!==g?(c=g==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(h=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>_(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ne,{columns:L,data:N,isLoading:!1,sortKey:p,sortDirection:m,onSort:v,onRowClick:h=>_(h),emptyState:o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R})}),e[27]=R,e[28]=_,e[29]=v,e[30]=j,e[31]=m,e[32]=p,e[33]=N,e[34]=g,e[35]=c):c=e[35];let P;e[36]!==C||e[37]!==c?(P=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,c]}),e[36]=C,e[37]=c,e[38]=P):P=e[38];let M;return e[39]!==P||e[40]!==y?(M=o.jsxs(o.Fragment,{children:[y,P]}),e[39]=P,e[40]=y,e[41]=M):M=e[41],M}function $e(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ie(t){return t.sortable}function Re(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function ke(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _e(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Le(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(we,{prompts:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function Pe(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Ne,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function Me(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:d,showToolbar:l,emptyMessage:b}=t,T=l===void 0?!0:l,E=b===void 0?"This connection doesn't have any resources yet.":b,R=X().location.href,[u,z]=q.useState(""),[x,j]=q.useState("table"),[f,g]=q.useState("name"),[i,p]=q.useState("asc");let w;e[0]!==i||e[1]!==f?(w=c=>{f===c?(p(Ue),i==="desc"&&g(void 0)):(g(c),p("asc"))},e[0]=i,e[1]=f,e[2]=w):w=e[2];const m=w;let D;e[3]!==d?(D=c=>{d&&d(c)},e[3]=d,e[4]=D):D=e[4];const V=D;let v;if(e[5]!==n||e[6]!==u||e[7]!==i||e[8]!==f){const c=!n||n.length===0?[]:u.trim()?(()=>{const P=u.toLowerCase();return n.filter(M=>M.uri.toLowerCase().includes(P)||M.name&&M.name.toLowerCase().includes(P)||M.description&&M.description.toLowerCase().includes(P))})():n;v=!f||!i?c:[...c].sort((P,M)=>{const h=P[f]||"",K=M[f]||"",B=String(h).localeCompare(String(K));return i==="asc"?B:-B}),e[5]=n,e[6]=u,e[7]=i,e[8]=f,e[9]=v}else v=e[9];const k=v;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:Be,sortable:!0},{id:"uri",header:"URI",render:Oe,sortable:!0},{id:"description",header:"Description",render:De,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=_):_=e[10];const $=_;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=$.filter(Ae).map(Ve),e[11]=N):N=e[11];const O=N;let L;e[12]!==r||e[13]!==s||e[14]!==m||e[15]!==T||e[16]!==i||e[17]!==f||e[18]!==R||e[19]!==x?(L=T&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:x,onViewModeChange:j,sortKey:f,sortDirection:i,onSort:m,sortOptions:O}),o.jsx(re,{title:s?`${s}: Resources`:"Resources",url:R,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=m,e[15]=T,e[16]=i,e[17]=f,e[18]=R,e[19]=x,e[20]=L):L=e[20];let a;e[21]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{c.key==="Escape"&&(z(""),c.target.blur())},e[21]=a):a=e[21];let A;e[22]!==u?(A=o.jsx(se,{value:u,onChange:z,placeholder:"Search resources...",onKeyDown:a}),e[22]=u,e[23]=A):A=e[23];let y;e[24]!==E||e[25]!==V||e[26]!==m||e[27]!==u||e[28]!==i||e[29]!==f||e[30]!==k||e[31]!==x?(y=x==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(c=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>V(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(ne,{columns:$,data:k,isLoading:!1,sortKey:f,sortDirection:i,onSort:m,onRowClick:c=>V(c),emptyState:o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E})}),e[24]=E,e[25]=V,e[26]=m,e[27]=u,e[28]=i,e[29]=f,e[30]=k,e[31]=x,e[32]=y):y=e[32];let S;e[33]!==A||e[34]!==y?(S=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,y]}),e[33]=A,e[34]=y,e[35]=S):S=e[35];let C;return e[36]!==S||e[37]!==L?(C=o.jsxs(o.Fragment,{children:[L,S]}),e[36]=S,e[37]=L,e[38]=C):C=e[38],C}function Ve(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ae(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function De(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Oe(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Be(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ue(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ke(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(Me,{resources:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function ze(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:d}=t;let l;return e[0]!==s||e[1]!==d||e[2]!==r||e[3]!==n?(l=o.jsx(Te,{tools:n,connectionId:s,org:r,isLoading:d}),e[0]=s,e[1]=d,e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function qe(t){const e=Q.c(66),{connection:n,connectionId:s,org:r,requestedTabId:d,collections:l,onUpdate:b,isUpdating:T,prompts:E,resources:I,tools:R,isLoadingTools:u}=t,z=me();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const j=H(x);let f;e[1]!==s?(f={connectionId:s},e[1]=s,e[2]=f):f=e[2];const g=ue(f),i=g.isAuthenticated,p=n?.metadata?.repository,w=!!p?.url,m=R.length,D=E.length,V=I.length,v=m>0||u;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let _;e[4]!==u||e[5]!==i||e[6]!==v||e[7]!==m?(_=i&&v?[{id:"tools",label:"Tools",count:u?void 0:m}]:[],e[4]=u,e[5]=i,e[6]=v,e[7]=m,e[8]=_):_=e[8];let $;e[9]!==i||e[10]!==D?($=i&&D>0?[{id:"prompts",label:"Prompts",count:D}]:[],e[9]=i,e[10]=D,e[11]=$):$=e[11];let N;e[12]!==i||e[13]!==V?(N=i&&V>0?[{id:"resources",label:"Resources",count:V}]:[],e[12]=i,e[13]=V,e[14]=N):N=e[14];let O;if(e[15]!==l||e[16]!==w||e[17]!==i||e[18]!==_||e[19]!==$||e[20]!==N){let U;e[22]!==w?(U=w?[{id:"readme",label:"README"}]:[],e[22]=w,e[23]=U):U=e[23],O=[k,..._,...$,...N,...i?(l||[]).map(Qe):[],...U],e[15]=l,e[16]=w,e[17]=i,e[18]=_,e[19]=$,e[20]=N,e[21]=O}else O=e[21];const L=O,a=L.some(U=>U.id===d)?d:"settings";let A;e[24]!==j?(A=U=>{j({search:W=>({...W,tab:U}),replace:!0})},e[24]=j,e[25]=A):A=e[25];const y=A;let S;e[26]!==l?(S=l||[],e[26]=l,e[27]=S):S=e[27];let C;if(e[28]!==a||e[29]!==S){let U;e[31]!==a?(U=W=>W.name===a,e[31]=a,e[32]=U):U=e[32],C=S.find(U),e[28]=a,e[29]=S,e[30]=C}else C=e[30];const c=C;let P;e[33]!==z.history?(P=()=>z.history.back(),e[33]=z.history,e[34]=P):P=e[34];let M;e[35]!==a||e[36]!==y||e[37]!==L?(M=o.jsx(Se,{children:o.jsx(ye,{tabs:L,activeTab:a,onTabChange:y})}),e[35]=a,e[36]=y,e[37]=L,e[38]=M):M=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[39]=h):h=e[39];let K;e[40]!==c||e[41]!==a||e[42]!==g.hasOAuthToken||e[43]!==g.isServerError||e[44]!==g.supportsOAuth||e[45]!==n||e[46]!==s||e[47]!==y||e[48]!==w||e[49]!==u||e[50]!==i||e[51]!==T||e[52]!==b||e[53]!==r||e[54]!==E||e[55]!==p||e[56]!==I||e[57]!==R?(K=o.jsx(q.Suspense,{fallback:h,children:a==="tools"?o.jsx(ze,{tools:R,connectionId:s,org:r,isLoading:u}):a==="prompts"?o.jsx(Le,{prompts:E,connectionId:s,org:r}):a==="resources"?o.jsx(Ke,{resources:I,connectionId:s,org:r}):a==="settings"?o.jsx(pe,{connection:n,onUpdate:b,isUpdating:T,isMCPAuthenticated:i,supportsOAuth:g.supportsOAuth,hasOAuthToken:g.hasOAuthToken,isServerError:g.isServerError,onViewReadme:w?()=>y("readme"):void 0}):a==="readme"&&w?o.jsx(Pe,{repository:p}):c&&i?o.jsx(ve,{connectionId:s,org:r,activeCollection:c},a):o.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[40]=c,e[41]=a,e[42]=g.hasOAuthToken,e[43]=g.isServerError,e[44]=g.supportsOAuth,e[45]=n,e[46]=s,e[47]=y,e[48]=w,e[49]=u,e[50]=i,e[51]=T,e[52]=b,e[53]=r,e[54]=E,e[55]=p,e[56]=I,e[57]=R,e[58]=K):K=e[58];let B;e[59]!==a||e[60]!==K?(B=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Z,{children:K},a)})}),e[59]=a,e[60]=K,e[61]=B):B=e[61];let F;return e[62]!==P||e[63]!==M||e[64]!==B?(F=o.jsxs(Ce,{onBack:P,children:[M,B]}),e[62]=P,e[63]=M,e[64]=B,e[65]=F):F=e[65],F}function Qe(t){return{id:t.name,label:t.displayName}}function Fe(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=H(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:d}=ce(s),{org:l}=ae();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/shell/$org/mcps/$connectionId"},t[2]=b):b=t[2];const E=le(b).tab||"settings",I=J(r),R=he(),u=de(I??void 0);let z;t[3]!==r||t[4]!==l.id?(z={connectionId:r,orgId:l.id},t[3]=r,t[4]=l.id,t[5]=z):z=t[5];const x=xe(z);let j;t[6]!==x?(j={client:x},t[6]=x,t[7]=j):j=t[7];const{data:f}=ge(j);let g;t[8]!==x?(g={client:x},t[8]=x,t[9]=g):g=t[9];const{data:i}=be(g),p=I?.tools&&I.tools.length>0,w=!p;let m;t[10]!==x||t[11]!==w?(m={client:x,enabled:w},t[10]=x,t[11]=w,t[12]=m):m=t[12];const{data:D,isLoading:V}=fe(m);let v;t[13]!==f?.prompts?(v=f?.prompts??[],t[13]=f?.prompts,t[14]=v):v=t[14];let k;t[15]!==v?(k=v.map(He),t[15]=v,t[16]=k):k=t[16];const _=k;let $;t[17]!==i?.resources?($=i?.resources??[],t[17]=i?.resources,t[18]=$):$=t[18];let N;t[19]!==$?(N=$.map(Ge),t[19]=$,t[20]=N):N=t[20];const O=N;let L;t[21]!==I||t[22]!==p||t[23]!==D?.tools?(L=p?I.tools??[]:(D?.tools??[]).map(We),t[21]=I,t[22]=p,t[23]=D?.tools,t[24]=L):L=t[24];const a=L;let A;t[25]!==R.update||t[26]!==r?(A=async C=>{await R.update.mutateAsync({id:r,data:C})},t[25]=R.update,t[26]=r,t[27]=A):A=t[27];const y=A;if(!I){let C;return t[28]!==n||t[29]!==d?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(je,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:d}}),children:"Back to connections"})})}),t[28]=n,t[29]=d,t[30]=C):C=t[30],C}let S;return t[31]!==R.update.isPending||t[32]!==u||t[33]!==I||t[34]!==r||t[35]!==y||t[36]!==V||t[37]!==d||t[38]!==_||t[39]!==E||t[40]!==O||t[41]!==a?(S=o.jsx(qe,{org:d,connection:I,connectionId:r,requestedTabId:E,collections:u,onUpdate:y,isUpdating:R.update.isPending,prompts:_,resources:O,tools:a,isLoadingTools:V}),t[31]=R.update.isPending,t[32]=u,t[33]=I,t[34]=r,t[35]=y,t[36]=V,t[37]=d,t[38]=_,t[39]=E,t[40]=O,t[41]=a,t[42]=S):S=t[42],S}function We(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Ge(t){return{uri:t.uri,name:t.name,description:t.description}}function He(t){return{name:t.name,description:t.description}}function Je(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Z,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Fe,{})})}),t[0]=e):e=t[0],e}function bo(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Je,{}),t[0]=e):e=t[0],e}export{bo as default};
@@ -1 +0,0 @@
1
- import{x as t,B as a}from"./index-CSKo3AB-.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{r as y,c as C,j as l}from"./index-CSKo3AB-.js";import{c as I}from"./button-CFAZeZNj.js";const _=({size:o=24,color:e="currentColor",...t})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},y.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));_.displayName="Container";const L={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},$={"2xs":8,xs:12,sm:16,md:24,lg:32};function R(o){const e=C.c(7),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,g=t??"no-icon";let s;return e[0]!==a||e[1]!==m||e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==g?(s=l.jsx(M,{icon:t,name:r,size:n,className:a,fallbackIcon:m},g),e[0]=a,e[1]=m,e[2]=t,e[3]=r,e[4]=n,e[5]=g,e[6]=s):s=e[6],s}function M(o){const e=C.c(24),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,[g,s]=y.useState(!1),j=!!t&&g,d=L[n],f=z[n];let c;e[0]!==a||e[1]!==d||e[2]!==f?(c=I("rounded-lg border border-border shrink-0 overflow-hidden",d,f,a),e[0]=a,e[1]=d,e[2]=f,e[3]=c):c=e[3];const x=t||void 0,u=!j&&"hidden";let i;e[4]!==u?(i=I("h-full w-full object-cover",u),e[4]=u,e[5]=i):i=e[5];let p,E;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>s(!1),E=()=>s(!0),e[6]=p,e[7]=E):(p=e[6],E=e[7]);let N;e[8]!==r||e[9]!==x||e[10]!==i?(N=l.jsx("img",{src:x,alt:r,className:i,onError:p,onLoad:E}),e[8]=r,e[9]=x,e[10]=i,e[11]=N):N=e[11];const k=j&&"hidden";let w;e[12]!==k?(w=I("h-full w-full flex items-center justify-center bg-muted/20",k),e[12]=k,e[13]=w):w=e[13];let v;e[14]!==m||e[15]!==n?(v=m??l.jsx(_,{size:$[n],className:"text-muted-foreground"}),e[14]=m,e[15]=n,e[16]=v):v=e[16];let S;e[17]!==w||e[18]!==v?(S=l.jsx("div",{className:w,children:v}),e[17]=w,e[18]=v,e[19]=S):S=e[19];let b;return e[20]!==N||e[21]!==S||e[22]!==c?(b=l.jsxs("div",{className:c,children:[N,S]}),e[20]=N,e[21]=S,e[22]=c,e[23]=b):b=e[23],b}function Z(){const o=C.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function W(o){const e=C.c(24),{image:t,title:r,description:h,actions:a,className:m,descriptionClassName:n,actionsClassName:g}=o;let s;e[0]!==m?(s=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",m),e[0]=m,e[1]=s):s=e[1];let j;e[2]!==t?(j=t!==null&&l.jsx("div",{className:"flex items-center justify-center",children:t??l.jsx(Z,{})}),e[2]=t,e[3]=j):j=e[3];let d;e[4]!==r?(d=l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==n?(f=I("text-sm text-muted-foreground text-center max-w-[300px]",n),e[6]=n,e[7]=f):f=e[7];let c;e[8]!==h||e[9]!==f?(c=l.jsx("div",{className:f,children:h}),e[8]=h,e[9]=f,e[10]=c):c=e[10];let x;e[11]!==d||e[12]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=x):x=e[13];let u;e[14]!==a||e[15]!==g?(u=a&&l.jsx("div",{className:I("flex items-center gap-2",g),children:a}),e[14]=a,e[15]=g,e[16]=u):u=e[16];let i;e[17]!==x||e[18]!==u?(i=l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,u]}),e[17]=x,e[18]=u,e[19]=i):i=e[19];let p;return e[20]!==s||e[21]!==j||e[22]!==i?(p=l.jsxs("div",{className:s,children:[j,i]}),e[20]=s,e[21]=j,e[22]=i,e[23]=p):p=e[23],p}export{W as E,R as I,_ as n};