@decocms/mesh 2.136.0 → 2.137.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 (229) hide show
  1. package/dist/client/assets/{AlertCircle-BmterM6-.js → AlertCircle-Bz0Gu2J2.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D-24Asic.js → AlignLeft-cTDyunvB.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-DhmtNBCn.js → ArrowDown-DA10fwsF.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BwnRcCxk.js → ArrowLeft-bHzBiXiT.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B2lliNjJ.js → ArrowUp-DNV5Voek.js} +1 -1
  6. package/dist/client/assets/{Check-Dy5Jwsdl.js → Check-e1LxjlnS.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DCJamcsS.js → CheckCircle-aG4ywA2O.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-BMlUtSk0.js → CheckDone01-BbDxR0le.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-BEvXxeXZ.js → CheckVerified02-BSRvrUwy.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-B8UJn4iH.js → ChevronDown-BjWhsewG.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-LqDMtl3T.js → ChevronLeft-bfDO3afT.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UHmTzu6U.js → ChevronRight-DZwFOSrA.js} +1 -1
  13. package/dist/client/assets/{Clock-CHKtyQRJ.js → Clock-BDkBqrq2.js} +1 -1
  14. package/dist/client/assets/{Code01-Ce_GLriH.js → Code01-Den27Mse.js} +1 -1
  15. package/dist/client/assets/{Container-nefPC-Vi.js → Container-w8ZJjmnR.js} +1 -1
  16. package/dist/client/assets/{Copy01-DTrKcR-Q.js → Copy01-BCJxa3pS.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-DMAzBi98.js → Dataflow03-C3PCJs5S.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-BmF1jyTg.js → DotsHorizontal-DdpEu4kv.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-N7qtMw5m.js → DotsVertical-D65a3izp.js} +1 -1
  20. package/dist/client/assets/{Download01-C8dWfeAI.js → Download01-AELYrpVY.js} +1 -1
  21. package/dist/client/assets/{Edit01-CMeQdBcS.js → Edit01-CPphoQZI.js} +1 -1
  22. package/dist/client/assets/{Edit05-DZ_UN_S5.js → Edit05-Bxh4QPsk.js} +1 -1
  23. package/dist/client/assets/{Eye-DxLOh0i-.js → Eye-B65VnOsY.js} +1 -1
  24. package/dist/client/assets/{File02-vPAwJvd9.js → File02-DbPhqcQA.js} +1 -1
  25. package/dist/client/assets/{File06-CJFI46Rj.js → File06-DI2DTxDK.js} +1 -1
  26. package/dist/client/assets/{FilterLines-BfBD1RVS.js → FilterLines-BWEMXQRq.js} +1 -1
  27. package/dist/client/assets/{Globe01-CFu5KWUK.js → Globe01-0k9H0lE8.js} +1 -1
  28. package/dist/client/assets/{Globe02-KBI1AO62.js → Globe02-C7u-Ldxq.js} +1 -1
  29. package/dist/client/assets/{Grid01-CqnSySeu.js → Grid01-CMrNK-TY.js} +1 -1
  30. package/dist/client/assets/{Hash02-DJ4pr-VX.js → Hash02-DhotVIqT.js} +1 -1
  31. package/dist/client/assets/{Home02-Do5D--q6.js → Home02-CSmINeMq.js} +1 -1
  32. package/dist/client/assets/{Image01-C8E_92eh.js → Image01-HHGXqEyS.js} +1 -1
  33. package/dist/client/assets/{Inbox01-DFatNHSu.js → Inbox01-BVd6Ufjh.js} +1 -1
  34. package/dist/client/assets/{InfoCircle-BbDPfNIr.js → InfoCircle-CBee5-NO.js} +1 -1
  35. package/dist/client/assets/{Key01-5M9GOooO.js → Key01-DY7k7KSd.js} +1 -1
  36. package/dist/client/assets/{LayersTwo01-D3z_72X4.js → LayersTwo01-CuCFLmbR.js} +1 -1
  37. package/dist/client/assets/{LayoutLeft-CuouUkb7.js → LayoutLeft-D-Sd6nh5.js} +1 -1
  38. package/dist/client/assets/{Link01-phTHWMEc.js → Link01-C0RF1TkY.js} +1 -1
  39. package/dist/client/assets/{LinkExternal01-3GykVej2.js → LinkExternal01-DUHpfLmD.js} +1 -1
  40. package/dist/client/assets/{List-C81A8jh_.js → List-DFmwlXqV.js} +1 -1
  41. package/dist/client/assets/{Loading01-BWjBCSBL.js → Loading01-By16fsIj.js} +1 -1
  42. package/dist/client/assets/{Lock01-BF4OPECE.js → Lock01-CJOMXMAI.js} +1 -1
  43. package/dist/client/assets/{Play-CGCsuB7w.js → Play-DYSuo3bc.js} +1 -1
  44. package/dist/client/assets/{Plus-CK3qvOs-.js → Plus-jLReB_Bt.js} +1 -1
  45. package/dist/client/assets/{RefreshCcw01-DCU1xktc.js → RefreshCcw01-CJTVrN2f.js} +1 -1
  46. package/dist/client/assets/{Save01-sMmuMs88.js → Save01-B5XsnIBD.js} +1 -1
  47. package/dist/client/assets/{SearchMd-CpD1Xdqo.js → SearchMd-DF5i6zVs.js} +1 -1
  48. package/dist/client/assets/{Settings01-Bhz_Vu7B.js → Settings01-B3dw12xC.js} +1 -1
  49. package/dist/client/assets/{Shield01-B4VkgvZ4.js → Shield01-B801SPcx.js} +1 -1
  50. package/dist/client/assets/{Terminal-EynP_hYL.js → Terminal-DvZ2cYHA.js} +1 -1
  51. package/dist/client/assets/{Trash01-p1zJKNMp.js → Trash01-BZm-kVJv.js} +1 -1
  52. package/dist/client/assets/{Upload01-CuSBdknv.js → Upload01-B_Zc3fui.js} +1 -1
  53. package/dist/client/assets/{Users03-C4-0uA3w.js → Users03-CUtoEpN2.js} +1 -1
  54. package/dist/client/assets/{X-C0j62Xtl.js → X-DZCW78jV.js} +1 -1
  55. package/dist/client/assets/{XCircle-BtpMj0Vx.js → XCircle-BRYqxNwU.js} +1 -1
  56. package/dist/client/assets/{XClose-BoXt6_S8.js → XClose-CuKHHhHx.js} +1 -1
  57. package/dist/client/assets/{Zap-D7Nzarh3.js → Zap-D7ItB-QC.js} +1 -1
  58. package/dist/client/assets/{agent-connections-preview-CHU0g32U.js → agent-connections-preview-NrV6TyCn.js} +1 -1
  59. package/dist/client/assets/agent-detail-CTx9BMRL.js +2 -0
  60. package/dist/client/assets/agents-DtA7iPv8.js +1 -0
  61. package/dist/client/assets/{alert-dialog-D1XudKG9.js → alert-dialog-BY3oMun9.js} +2 -2
  62. package/dist/client/assets/{auth-catchall-BgPC7rSe.js → auth-catchall-DM7vkLcv.js} +1 -1
  63. package/dist/client/assets/{avatar-DNxsCl6r.js → avatar-Bp7Qjpgt.js} +1 -1
  64. package/dist/client/assets/{badge-D8RzvYJ4.js → badge-CU_zbIXX.js} +1 -1
  65. package/dist/client/assets/{binder-Blih3Yob.js → binder-D8RBAvqy.js} +1 -1
  66. package/dist/client/assets/{breadcrumb-N-YM-0qC.js → breadcrumb-J-4TPKpB.js} +1 -1
  67. package/dist/client/assets/{card-DpIJfsV8.js → card-ekU23Imm.js} +1 -1
  68. package/dist/client/assets/{chart-ClRGWH0O.js → chart-B5BozNmG.js} +1 -1
  69. package/dist/client/assets/{checkbox-CUOTkCKW.js → checkbox-Dkby6oH1.js} +1 -1
  70. package/dist/client/assets/{circle-alert-D8ryfTOx.js → circle-alert-Dmir_dX9.js} +1 -1
  71. package/dist/client/assets/{collapsible-CpgZSwBN.js → collapsible-C32NLu9h.js} +1 -1
  72. package/dist/client/assets/{collection-detail-B3RGhDtS.js → collection-detail-CVcRRgDT.js} +3 -3
  73. package/dist/client/assets/{collection-display-button-DrtKZPsB.js → collection-display-button-Cep9T1dy.js} +1 -1
  74. package/dist/client/assets/{collection-search-Cq4rjP0Z.js → collection-search-D8Kd7sE4.js} +1 -1
  75. package/dist/client/assets/collection-tab-BkZUIpwh.js +1 -0
  76. package/dist/client/assets/{collection-table-wrapper-CyGYWMWl.js → collection-table-wrapper-j8x7CZEu.js} +1 -1
  77. package/dist/client/assets/{collection-tabs-r7GKXx3H.js → collection-tabs-_pBQ3xqw.js} +1 -1
  78. package/dist/client/assets/{command-DazlgUs5.js → command-dR8rnu75.js} +1 -1
  79. package/dist/client/assets/{connect-CvX0kEdi.js → connect-DIFUIUeS.js} +1 -1
  80. package/dist/client/assets/{connection-card-BEmi4FHw.js → connection-card-Da4urKr2.js} +1 -1
  81. package/dist/client/assets/connection-detail-_mYJNdTe.js +1 -0
  82. package/dist/client/assets/connection-status-D-gHs_bI.js +1 -0
  83. package/dist/client/assets/connections-z3dfk98Y.js +1 -0
  84. package/dist/client/assets/{constants-BLSLjUCX.js → constants-B_iiTUip.js} +1 -1
  85. package/dist/client/assets/constants-DWucmYRT.js +1 -0
  86. package/dist/client/assets/{create-organization-dialog-_OZHP19d.js → create-organization-dialog-Dp3eW5BV.js} +1 -1
  87. package/dist/client/assets/{create-project-dialog-CBSHMrrx.js → create-project-dialog-wLCAgffa.js} +1 -1
  88. package/dist/client/assets/{danger-CPETFW7T.js → danger-DN20H7Jv.js} +1 -1
  89. package/dist/client/assets/{danger-zone-LxdCiZtW.js → danger-zone-BlpO_iQ-.js} +1 -1
  90. package/dist/client/assets/{decopilot-events-BEPzMc6y.js → decopilot-events-Dczeyumg.js} +1 -1
  91. package/dist/client/assets/dependencies-Uah1lriA.js +1 -0
  92. package/dist/client/assets/{dialog-BEh9NHdw.js → dialog-BuY4tTjY.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BBy53YtY.js → dropdown-menu-CF9W86LV.js} +1 -1
  94. package/dist/client/assets/dynamic-plugin-layout-DbZjG_ew.js +1 -0
  95. package/dist/client/assets/{editable-task-title-CQx9B12m.js → editable-task-title-Po1P2Wd0.js} +1 -1
  96. package/dist/client/assets/{empty-state-Cd-Y6dcy.js → empty-state-COL4jrg3.js} +1 -1
  97. package/dist/client/assets/{env-vars-editor-CFN3JqN6.js → env-vars-editor-KGRYrftY.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-Bjwt_XIu.js → extract-connection-data-BbBDZhaA.js} +1 -1
  99. package/dist/client/assets/{file-browser-B3GXvhIi.js → file-browser-B2axtg2i.js} +2 -2
  100. package/dist/client/assets/{form-DKOen-4i.js → form-Ci0uQFmj.js} +1 -1
  101. package/dist/client/assets/{general-i_n7wxur.js → general-DaCshnBc.js} +1 -1
  102. package/dist/client/assets/{grid-view-1tJniq0A.js → grid-view-Cs9Fsjar.js} +1 -1
  103. package/dist/client/assets/{home-B-4A2LlA.js → home-CiAMHjmh.js} +1 -1
  104. package/dist/client/assets/{icon-picker-BXWmqDNl.js → icon-picker-5o9r59w2.js} +1 -1
  105. package/dist/client/assets/{index-CrfXnuko.js → index-B5u30SQw.js} +1 -1
  106. package/dist/client/assets/index-CBuDQZ5c.js +1 -0
  107. package/dist/client/assets/{index-DYkmX0JZ.js → index-CNLrMiMB.js} +1 -1
  108. package/dist/client/assets/{index-xQ2t379n.js → index-Cb17fVaO.js} +3 -3
  109. package/dist/client/assets/{index-9MR1Aak3.js → index-Ch67qqnf.js} +1 -1
  110. package/dist/client/assets/index-ClZvg-b8.js +1 -0
  111. package/dist/client/assets/{index-D3pPaynQ.js → index-CvxrBAxY.js} +1 -1
  112. package/dist/client/assets/{index-C79VipEf.js → index-DLDRkAi_.js} +1 -1
  113. package/dist/client/assets/{index-Bxe5mObN.js → index-DlboOjMX.js} +1 -1
  114. package/dist/client/assets/{infiniteQueryObserver-bwcxH-lX.js → infiniteQueryObserver-CiekiSCa.js} +1 -1
  115. package/dist/client/assets/{input-CquIDQAg.js → input-Cch0IC2D.js} +1 -1
  116. package/dist/client/assets/{integration-icon-CyNzGslP.js → integration-icon-BtE6qqXO.js} +1 -1
  117. package/dist/client/assets/{label-DgKgIZIr.js → label-BLzrK_Rs.js} +1 -1
  118. package/dist/client/assets/layout-BDCv6fVK.js +1 -0
  119. package/dist/client/assets/{layout-BaoRfV41.js → layout-JuxaRCBK.js} +1 -1
  120. package/dist/client/assets/{localstorage-keys-BVjc41qz.js → localstorage-keys-CxWEzkpK.js} +1 -1
  121. package/dist/client/assets/login-4Ej4TxT2.js +1 -0
  122. package/dist/client/assets/{markdown-Ba8nOSsK.js → markdown-B9U6C-Vk.js} +1 -1
  123. package/dist/client/assets/{mcp-app-renderer-DYp1_awD.js → mcp-app-renderer-vWTHzC-y.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-BKgRq621.js → mcp-oauth-D_4U_dE3.js} +1 -1
  125. package/dist/client/assets/{mcp-server-card-CpB9f-pn.js → mcp-server-card-xdUT5WQB.js} +1 -1
  126. package/dist/client/assets/mcp-server-detail-CZ73zkO0.js +2 -0
  127. package/dist/client/assets/members-CNen9UaM.js +3 -0
  128. package/dist/client/assets/{monaco-editor-Bqq988E3.js → monaco-editor-CYwLLnlJ.js} +1 -1
  129. package/dist/client/assets/{monitoring-Cw8c9SQ5.js → monitoring-BoQ3xY78.js} +2 -2
  130. package/dist/client/assets/monitoring-dashboard-edit-BdndwDLO.js +1 -0
  131. package/dist/client/assets/{monitoring-dashboard-view-CmbMs5N1.js → monitoring-dashboard-view-C4LyubYv.js} +2 -2
  132. package/dist/client/assets/{oauth-callback-3thxiCVs.js → oauth-callback-B6grmhGw.js} +1 -1
  133. package/dist/client/assets/page-BEtq2_NI.js +1 -0
  134. package/dist/client/assets/page-BnZfgb1H.js +1 -0
  135. package/dist/client/assets/{plugin-empty-state-CgwqeTLL.js → plugin-empty-state-CJi_lWXP.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-n7cn669C.js → plugin-empty-state-DyUfvnh_.js} +1 -1
  137. package/dist/client/assets/{plugin-header-BxEyDthP.js → plugin-header-B7DjR-EV.js} +1 -1
  138. package/dist/client/assets/{plugin-header-AGaevBZn.js → plugin-header-UTo9wubo.js} +1 -1
  139. package/dist/client/assets/plugins-HjXVX3kj.js +1 -0
  140. package/dist/client/assets/{popover-BGz1EQnh.js → popover-CH5Uw6Js.js} +1 -1
  141. package/dist/client/assets/project-app-view-DdBfbyq8.js +1 -0
  142. package/dist/client/assets/project-layout-hj30-COK.js +1 -0
  143. package/dist/client/assets/{project-plugins-R_POmKuz.js → project-plugins-DiXNjiNd.js} +1 -1
  144. package/dist/client/assets/{projects-list-DvHzim4C.js → projects-list-BhN8iQTZ.js} +1 -1
  145. package/dist/client/assets/{readme-viewer-CSo2KaPk.js → readme-viewer-D1bVaWvP.js} +1 -1
  146. package/dist/client/assets/{registry-layout-BRpD6JKO.js → registry-layout-vtzlbvnH.js} +2 -2
  147. package/dist/client/assets/{registry-utils-Cjdxmsng.js → registry-utils-M1yY8DgS.js} +1 -1
  148. package/dist/client/assets/{reports-layout-WypzA6IP.js → reports-layout-BiNtHVIg.js} +2 -2
  149. package/dist/client/assets/{reset-password-C2yglusd.js → reset-password-CVwZZFPi.js} +1 -1
  150. package/dist/client/assets/{resizable-BeoLLDMu.js → resizable-taukBI4-.js} +1 -1
  151. package/dist/client/assets/{save-actions-OW6B8GGT.js → save-actions-DkD1FHqW.js} +1 -1
  152. package/dist/client/assets/{scroll-area-BlV5UvCB.js → scroll-area-nyuwfJ38.js} +1 -1
  153. package/dist/client/assets/{select-CDsJtNMV.js → select-iAQ1JGAr.js} +1 -1
  154. package/dist/client/assets/shell-layout-hy8oqx1b.js +3 -0
  155. package/dist/client/assets/{sidebar-settings-CYmJoaNT.js → sidebar-settings-DQE_2wSn.js} +1 -1
  156. package/dist/client/assets/{skeleton-Ct9swv0n.js → skeleton-BavbnGik.js} +1 -1
  157. package/dist/client/assets/{spinner-DfUcLZCl.js → spinner-BsdcXRt-.js} +1 -1
  158. package/dist/client/assets/{store-invite-ZCHtOCWs.js → store-invite-BlSnhDpm.js} +1 -1
  159. package/dist/client/assets/switch-BYETmQBd.js +1 -0
  160. package/dist/client/assets/{table-BCfVNRpI.js → table-5KSUgwco.js} +1 -1
  161. package/dist/client/assets/tabs-BCXNMT0l.js +1 -0
  162. package/dist/client/assets/tasks-BEHJWLwK.js +1 -0
  163. package/dist/client/assets/{tasks-panel-Bcd4i-z8.js → tasks-panel-DXBfZcDd.js} +1 -1
  164. package/dist/client/assets/{textarea-BvEkv28R.js → textarea-D4QsZZY2.js} +1 -1
  165. package/dist/client/assets/{time-range-picker-CTYo_Gy_.js → time-range-picker-LYFa1sSz.js} +1 -1
  166. package/dist/client/assets/{toggle-group-BuwLTYBs.js → toggle-group-CnLXoLRJ.js} +1 -1
  167. package/dist/client/assets/tools-list-CWpIc2sG.js +1 -0
  168. package/dist/client/assets/tooltip-Bb66VFhj.js +1 -0
  169. package/dist/client/assets/{topbar-portal-CUBonFlI.js → topbar-portal-DBCM_jc6.js} +1 -1
  170. package/dist/client/assets/{types-CnPYT6I7.js → types-CGMnrrVy.js} +1 -1
  171. package/dist/client/assets/use-binding-Bi9qdfAY.js +1 -0
  172. package/dist/client/assets/use-collections-BF-71bZg.js +1 -0
  173. package/dist/client/assets/use-connection-Bv6BgTqI.js +1 -0
  174. package/dist/client/assets/{use-copy-oq5GkYwB.js → use-copy-QwK_lQBK.js} +1 -1
  175. package/dist/client/assets/{use-create-virtual-mcp-COKyzJBE.js → use-create-virtual-mcp-wYKTF_rl.js} +1 -1
  176. package/dist/client/assets/use-install-from-registry-CM7KAiir.js +1 -0
  177. package/dist/client/assets/{use-list-state-DhRtf36X.js → use-list-state-CB-KMJqf.js} +1 -1
  178. package/dist/client/assets/use-llm-lZx_FT_g.js +1 -0
  179. package/dist/client/assets/{use-mcp-resources-B792gs6l.js → use-mcp-resources-MU6kxIry.js} +1 -1
  180. package/dist/client/assets/{use-mcp-tools-DScmBuoc.js → use-mcp-tools-q5O9mXfB.js} +1 -1
  181. package/dist/client/assets/{use-members-Chfn3LoP.js → use-members-xNw9MWgV.js} +1 -1
  182. package/dist/client/assets/{use-mobile-CZlm25dt.js → use-mobile-By224gq0.js} +1 -1
  183. package/dist/client/assets/{use-project-BUsmU3t_.js → use-project-Dr0Nftxm.js} +1 -1
  184. package/dist/client/assets/{use-settings-modal-D18j_l44.js → use-settings-modal-5estZr-G.js} +1 -1
  185. package/dist/client/assets/{use-view-mode-5Lt8g0uo.js → use-view-mode-Dd5y7aaP.js} +1 -1
  186. package/dist/client/assets/use-virtual-mcp-T76ZkZ-8.js +1 -0
  187. package/dist/client/assets/useInfiniteQuery-DGesCtT2.js +1 -0
  188. package/dist/client/assets/{useMutation-tQLZk7P3.js → useMutation-DRjp2Nl5.js} +1 -1
  189. package/dist/client/assets/useQuery-BcAK4m0m.js +1 -0
  190. package/dist/client/assets/useSuspenseInfiniteQuery-B9EajsfN.js +1 -0
  191. package/dist/client/assets/{user-CI081yAV.js → user-CkBLhwlg.js} +1 -1
  192. package/dist/client/assets/workflow-C8yX97ao.js +1 -0
  193. package/dist/client/index.html +1 -1
  194. package/package.json +1 -1
  195. package/dist/client/assets/agent-detail-DURsxgC5.js +0 -2
  196. package/dist/client/assets/agents-Cl7pGBMM.js +0 -1
  197. package/dist/client/assets/collection-tab-CDCwjyV8.js +0 -1
  198. package/dist/client/assets/connection-detail-CJDHlEwZ.js +0 -1
  199. package/dist/client/assets/connections-DZjwaIPT.js +0 -1
  200. package/dist/client/assets/constants-D_mJYCD9.js +0 -1
  201. package/dist/client/assets/dependencies-Cz-sRh-1.js +0 -1
  202. package/dist/client/assets/dynamic-plugin-layout-p6ER6wNw.js +0 -1
  203. package/dist/client/assets/index-C6W9eJZm.js +0 -1
  204. package/dist/client/assets/index-DVmCBhSl.js +0 -1
  205. package/dist/client/assets/layout-Dknw5WOk.js +0 -1
  206. package/dist/client/assets/login-CbUqOEDM.js +0 -1
  207. package/dist/client/assets/mcp-server-detail-CCUSuXBZ.js +0 -2
  208. package/dist/client/assets/members-C3L37RaV.js +0 -3
  209. package/dist/client/assets/monitoring-dashboard-edit-BMa2OOFc.js +0 -1
  210. package/dist/client/assets/page-D6s6DLQp.js +0 -1
  211. package/dist/client/assets/page-DojbxRSJ.js +0 -1
  212. package/dist/client/assets/plugins-DPuuPP05.js +0 -1
  213. package/dist/client/assets/project-app-view-B5525387.js +0 -1
  214. package/dist/client/assets/project-layout-DDwGJ0ig.js +0 -1
  215. package/dist/client/assets/shell-layout-DfbBuM37.js +0 -3
  216. package/dist/client/assets/switch-a3WrSRQb.js +0 -1
  217. package/dist/client/assets/tabs-DN8uQx_4.js +0 -1
  218. package/dist/client/assets/tasks-Bgtg3aZ6.js +0 -1
  219. package/dist/client/assets/tools-list-DKmevE2X.js +0 -1
  220. package/dist/client/assets/tooltip-B6yKYOIf.js +0 -1
  221. package/dist/client/assets/use-binding-BSjPQ0Be.js +0 -1
  222. package/dist/client/assets/use-connection-Dtj63U01.js +0 -1
  223. package/dist/client/assets/use-install-from-registry-DD_AL_1f.js +0 -1
  224. package/dist/client/assets/use-llm-5n5wwCT_.js +0 -1
  225. package/dist/client/assets/use-virtual-mcp-COkdNvVv.js +0 -1
  226. package/dist/client/assets/useInfiniteQuery-fRddscS9.js +0 -1
  227. package/dist/client/assets/useQuery-BLe-0FCm.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-D0p_NlPn.js +0 -1
  229. package/dist/client/assets/workflow-Bu6-o0iD.js +0 -1
@@ -1,10 +1,10 @@
1
- import{b9 as re,r as k,o as Qs,s as Et,c as N,j as o,E as $n,u as Z,l as Ys,v as R,z as eo,e as pe,a as to,aD as Ye,O as et,B as X,t as On,bF as K,cf as no,cg as so,aU as oo,H as Ht,M as de,T as Rn,aV as ro,G as Vt,aW as io,aX as An,I as Mn,aY as lo,aZ as co,U as Pn,a$ as ao,ch as Ut,ci as uo,aF as fo,bE as mo,D as po,n as xo,cj as ho,ck as go,cl as Ln}from"./index-xQ2t379n.js";import{E as Dn}from"./collection-search-Cq4rjP0Z.js";import{d as Bt,u as qt,f as dt,h as bo}from"./use-connection-Dtj63U01.js";import{u as ie,g as Ue,i as jo}from"./constants-BLSLjUCX.js";import{F as Tt,a as vo,b as Kt,d as Jt}from"./form-DKOen-4i.js";import{I as Gt}from"./input-CquIDQAg.js";import{T as Lt}from"./textarea-BvEkv28R.js";import{V as zn,b as Wn,a as he}from"./layout-BaoRfV41.js";import{S as Fn}from"./save-actions-OW6B8GGT.js";import{M as So}from"./mcp-app-renderer-DYp1_awD.js";import{g as yo,M as gn}from"./types-CnPYT6I7.js";import{S as Hn,a as Vn,b as Un,c as Bn,d as tt}from"./select-CDsJtNMV.js";import{c as Xt,T as nt,a as st,b as ot}from"./tooltip-B6yKYOIf.js";import{i as wo}from"./AlertCircle-BmterM6-.js";import{s as No}from"./Clock-CHKtyQRJ.js";import{i as bn}from"./Code01-Ce_GLriH.js";import{a as Co}from"./Copy01-DTrKcR-Q.js";import{s as ko}from"./LayersTwo01-D3z_72X4.js";import{i as ut}from"./Loading01-BWjBCSBL.js";import{i as Zt}from"./Play-CGCsuB7w.js";import{B as qn,a as Kn,b as Pe,d as rt,e as it,c as Jn}from"./breadcrumb-N-YM-0qC.js";import{u as Io,O as _o,M as Eo,F as To,v as $o}from"./index-9MR1Aak3.js";import{d as Qt,b as Yt,a as en}from"./use-mcp-tools-DScmBuoc.js";import{I as ft}from"./integration-icon-CyNzGslP.js";import{a as Oo}from"./tools-list-DKmevE2X.js";import{M as Le,n as Ro}from"./monaco-editor-Bqq988E3.js";import{E as tn}from"./empty-state-Cd-Y6dcy.js";import{n as Ao}from"./Container-nefPC-Vi.js";import{b as Gn}from"./use-virtual-mcp-COkdNvVv.js";import{b as Mo,R as jn,a as Po}from"./resizable-BeoLLDMu.js";import{B as me}from"./badge-D8RzvYJ4.js";import{S as mt}from"./spinner-DfUcLZCl.js";import{V as Lo}from"./collection-display-button-DrtKZPsB.js";import{N as Do,S as zo,a as Wo,c as Fo,m as Xe,P as Ho,i as Vo,R as Uo,u as Bo,b as qo,d as vn,E as Ko,e as Jo}from"./index-D3pPaynQ.js";import{a as Go}from"./use-binding-BSjPQ0Be.js";import{b as Xo,c as Zo,d as Qo,e as Yo,a as er,D as tr}from"./dialog-BEh9NHdw.js";import"./index-DYkmX0JZ.js";import{s as Xn}from"./Plus-CK3qvOs-.js";import{i as pt}from"./Check-Dy5Jwsdl.js";import{i as nr}from"./DotsHorizontal-BmF1jyTg.js";import{b as sr,T as or,R as rr,g as ir,h as Zn,j as lr}from"./collapsible-CpgZSwBN.js";import{s as nn}from"./XClose-BoXt6_S8.js";import{D as cr,a as ar,b as dr,c as Sn}from"./dropdown-menu-BBy53YtY.js";import{i as ur}from"./ChevronRight-UHmTzu6U.js";import{a as fr,S as mr}from"./scroll-area-BlV5UvCB.js";import{i as Qn}from"./X-C0j62Xtl.js";import"./SearchMd-CpD1Xdqo.js";import"./useMutation-tQLZk7P3.js";import"./label-DgKgIZIr.js";import"./index-C79VipEf.js";import"./localstorage-keys-BVjc41qz.js";import"./useQuery-BLe-0FCm.js";import"./Save01-sMmuMs88.js";import"./use-mcp-resources-B792gs6l.js";import"./index-CrfXnuko.js";import"./ChevronDown-B8UJn4iH.js";import"./mcp-oauth-BKgRq621.js";import"./File06-CJFI46Rj.js";import"./Key01-5M9GOooO.js";import"./constants-D_mJYCD9.js";import"./registry-utils-Cjdxmsng.js";import"./extract-connection-data-Bjwt_XIu.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-DD_AL_1f.js";import"./circle-alert-D8ryfTOx.js";import"./index-DVmCBhSl.js";import"./index-Bxe5mObN.js";import"./collection-table-wrapper-CyGYWMWl.js";import"./table-BCfVNRpI.js";import"./ArrowDown-DhmtNBCn.js";import"./ArrowUp-B2lliNjJ.js";import"./card-DpIJfsV8.js";import"./Eye-DxLOh0i-.js";import"./Globe02-KBI1AO62.js";import"./Grid01-CqnSySeu.js";import"./List-C81A8jh_.js";import"./popover-BGz1EQnh.js";import"./skeleton-Ct9swv0n.js";import"./decopilot-events-BEPzMc6y.js";import"./usage-B8eRkRZY.js";import"./Edit01-CMeQdBcS.js";import"./Users03-C4-0uA3w.js";import"./XCircle-BtpMj0Vx.js";import"./tabs-DN8uQx_4.js";import"./ArrowLeft-BwnRcCxk.js";import"./use-copy-oq5GkYwB.js";import"./use-create-virtual-mcp-COKyzJBE.js";import"./marked.esm-BaswSlok.js";import"./markdown-Ba8nOSsK.js";import"./Trash01-p1zJKNMp.js";import"./binder-Blih3Yob.js";import"./use-llm-5n5wwCT_.js";import"./checkbox-CUOTkCKW.js";import"./AlignLeft-D-24Asic.js";import"./Image01-C8E_92eh.js";import"./RefreshCcw01-DCU1xktc.js";import"./Settings01-Bhz_Vu7B.js";import"./useSuspenseInfiniteQuery-D0p_NlPn.js";import"./infiniteQueryObserver-bwcxH-lX.js";const Yn=re("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 es=re("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 sn=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const on=re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const pr=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const xr=re("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const hr=re("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 ts=re("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 ns=re("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 ss=re("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 gr=re("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const os=re("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 rs=re("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"}]]),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:"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"}));rn.displayName="AlertOctagon";const is=({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"}));is.displayName="Box";const ls=({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"}));ls.displayName="ClockFastForward";const cs=({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"}));cs.displayName="Code02";const Ze=({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"}));Ze.displayName="Columns01";const as=({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"}));as.displayName="CornerDownRight";const ds=({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"}));ds.displayName="Database01";const us=({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:"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"}));us.displayName="GitBranch01";const fs=({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"}));fs.displayName="Repeat03";const ms=({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 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),k.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));ms.displayName="StopCircle";Qs({title:Et().min(1),description:Et().nullable(),body:Et()});function $t(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function br(){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 jr(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:yr}),o.jsx(Tt,{control:n.control,name:"description",render:Sr})]})]}),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:vr})]}),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(vo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function vr(t){const{field:e}=t;return o.jsx(Kt,{children:o.jsx(Jt,{children:o.jsx(Lt,{...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 Sr(t){const{field:e}=t;return o.jsxs(Kt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Jt,{children:o.jsx(Gt,{...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 yr(t){const{field:e}=t;return o.jsxs(Kt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Jt,{children:o.jsx(Gt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wr(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ie(l),a=Bt(n,"PROMPT",s,c),d=qt(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:$t(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ys(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:$t(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const $=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:$.title,description:$.description??null,body:$t($)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.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:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(zn,{children:o.jsx(Fn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(jr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let _;return e[31]!==w||e[32]!==C||e[33]!==y?(_=o.jsxs(he,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=_):_=e[34],_}function Nr(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=br(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(wr,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Cr=eo("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 kr(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=R(Cr({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 Ir(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=R("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 _r(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=R("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 Er=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Tr(t){const e=N.c(9),{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=Io(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(_o,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(Eo,{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]!==c||e[7]!==n?(a=o.jsx($r,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function $r({toolName:t,connectionId:e}){const{replayId:n}=to({strict:!1}),s=(()=>{if(!n)return null;const E=`replay-${n}`,O=sessionStorage.getItem(E);if(!O)return null;sessionStorage.removeItem(E);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!s)return null;const E={};for(const[O,P]of Object.entries(s))P!==null&&typeof P=="object"?E[O]=JSON.stringify(P,null,2):E[O]=P;return E})(),[r,l]=k.useState(i??{}),[c,a]=k.useState(s?JSON.stringify(s,null,2):"{}"),[d,u]=k.useState(null),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(null),[b,j]=k.useState(!1),[S,y]=k.useState(null),{org:v}=Z(),w=dt(e),C=ie({connectionId:e,orgId:v.id}),_=Qt({client:C}),I=_.data?.tools?.find(E=>E.name===t),$=yo(I?._meta),[A,W]=k.useState("json"),[T,M]=k.useState(!1);$&&!T&&(W("ui"),M(!0));const H=I?.inputSchema?.properties,F=H?Object.keys(H):[],B=F.length>0,V={};if(B&&I?.inputSchema?.properties)for(const E of F)V[E]=I.inputSchema.required?.includes(E)?"":void 0;const z=E=>Object.prototype.hasOwnProperty.call(r,E),Q=async()=>{j(!0),g(null),u(null),m(null),p(null),y(null);const E=performance.now();try{if(!C)throw new Error("MCP client is not available");const O=B?{...V,...r}:(()=>{const G=c.trim();if(!G)return{};const D=JSON.parse(G);if(D&&typeof D=="object")return D;throw new Error("Raw JSON input must be an object.")})();B&&I?.inputSchema?.properties&&Object.entries(I.inputSchema.properties).forEach(([G,D])=>{if((D.type==="object"||D.type==="array")&&typeof O[G]=="string")try{O[G]=JSON.parse(O[G])}catch{}});const P=await C.callTool({name:t,arguments:O}),Y=P.structuredContent??P,le=performance.now(),oe=Math.round(le-E);u(Y),m(P),p(O);const ce=JSON.stringify(Y),te=new TextEncoder().encode(ce).length;y({duration:`${oe}ms`,bytes:`${te} bytes`,tokens:`~${Math.ceil(te/4)} tokens`,cost:"$0.0000"})}catch(O){const P=O instanceof Error?O.message:String(O);g(P||"Unknown error occurred");const Y=performance.now();y({duration:`${Math.round(Y-E)}ms`})}finally{j(!1)}},se=(E,O)=>{l(P=>({...P,[E]:O}))},ee=()=>{u(null),m(null),p(null),g(null),y(null)},U=I?.name??Er(t),J=o.jsx(qn,{children:o.jsxs(Kn,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps",params:{org:v.slug,project:et},children:"Connections"})})}),o.jsx(it,{}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps/$connectionId",params:{org:v.slug,project:et,connectionId:e},search:{tab:"tools"},children:w.title})})}),o.jsx(it,{})]}),o.jsx(Pe,{children:o.jsx(Jn,{children:U})})]})});return o.jsx(he,{breadcrumb:J,children: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(ft,{icon:w?.icon||null,name:w?.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:[_.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):_.isLoading?o.jsx(ut,{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:_.isSuccess?"ready":_.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:I?.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"}),I?.inputSchema?.required&&I.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:B&&I?.inputSchema?.properties?Object.entries(I.inputSchema.properties).map(([E,O])=>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:[E,I.inputSchema?.required?.includes(E)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?o.jsx(Lt,{className:"font-mono text-xs",value:z(E)?r[E]??"":V[E]??"",onChange:P=>se(E,P.target.value),placeholder:`Enter ${E} as JSON...`,rows:3}):O.type==="boolean"?o.jsxs(Hn,{value:z(E)?String(r[E]??""):"",onValueChange:P=>se(E,P==="true"),children:[o.jsx(Vn,{children:o.jsx(Un,{placeholder:"Select true or false..."})}),o.jsxs(Bn,{children:[o.jsx(tt,{value:"true",children:"true"}),o.jsx(tt,{value:"false",children:"false"})]})]}):o.jsx(Gt,{value:z(E)?r[E]??"":V[E]??"",onChange:P=>se(E,P.target.value),placeholder:`Enter ${E}...`})]},E)):I?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Lt,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:E=>a(E.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.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsx(Oo,{annotations:I?.annotations,_meta:I?._meta})]}),S&&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(No,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ds,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),o.jsxs("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:b?o.jsxs(X,{size:"sm",variant:"destructive",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:ee,children:[o.jsx(ms,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(X,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:Q,children:[o.jsx(Zt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),$&&o.jsx(Xt,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(nt,{children:[o.jsx(st,{asChild:!0,children:o.jsx(X,{size:"icon",variant:A==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>W("ui"),children:o.jsx(ko,{size:14})})}),o.jsx(ot,{children:"Interactive view"})]}),o.jsxs(nt,{children:[o.jsx(st,{asChild:!0,children:o.jsx(X,{size:"icon",variant:A==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>W("json"),children:o.jsx(bn,{size:14})})}),o.jsx(ot,{children:"JSON view"})]})]})})]}),h&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(kr,{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(wo,{className:"h-4 w-4"}),o.jsx(Ir,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(_r,{className:"text-xs text-destructive",children:h})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:$&&A==="ui"&&C?o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(So,{resourceURI:$,toolInfo:I?{tool:I}:void 0,toolInput:x??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:gn.view.minHeight,maxHeight:gn.view.maxHeight,client:C,className:"h-full"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(Le,{code:JSON.stringify(d,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(X,{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(d,null,2)),On.success("Copied to clipboard")},children:o.jsx(Co,{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(bn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})})}function Or(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=pe(i).connectionId;if(!dt(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(ut,{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(Tr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const yn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},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},ln=(t=>t?yn(t):yn),Rr=t=>t;function Dt(t,e=Rr){const n=K.useSyncExternalStore(t.subscribe,K.useCallback(()=>e(t.getState()),[t,e]),K.useCallback(()=>e(t.getInitialState()),[t,e]));return K.useDebugValue(n),n}const Ar=t=>{const e=ln(t),n=s=>Dt(e,s);return Object.assign(n,e),n},Mr=(t=>Ar);function ps(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 zt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return zt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return zt(s)(n)}}}},Pr=(t,e)=>(n,s,i)=>{let r={storage:ps(()=>window.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})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return zt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};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(),p||x},xs=Pr,{useSyncExternalStoreWithSelector:Lr}=no,Dr=t=>t;function zr(t,e=Dr,n){const s=Lr(t.subscribe,t.getState,t.getInitialState,e,n);return K.useDebugValue(s),s}const wn=t=>Symbol.iterator in t,Nn=t=>"entries"in t,Cn=(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},Wr=(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 Fr(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:wn(t)&&wn(e)?Nn(t)&&Nn(e)?Cn(t,e):Wr(t,e):Cn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Hr(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`{
1
+ import{bb as re,r as k,o as Qs,s as Et,c as N,j as o,E as $n,u as Z,l as Ys,v as R,G as eo,e as pe,a as to,aF as Ye,O as et,B as X,t as On,bF as K,cf as no,cg as so,aW as oo,J as Ht,T as de,W as Rn,aX as ro,I as Vt,aY as io,aZ as An,M as Mn,a_ as lo,a$ as co,X as Pn,b1 as ao,ch as Ut,ci as uo,aH as fo,bE as mo,H as po,n as xo,cj as ho,ck as go,cl as Ln}from"./index-Cb17fVaO.js";import{E as Dn}from"./collection-search-D8Kd7sE4.js";import{d as Bt,u as qt}from"./use-collections-BF-71bZg.js";import{u as ie,g as Ue,i as bo}from"./constants-B_iiTUip.js";import{F as Tt,a as jo,b as Kt,d as Jt}from"./form-Ci0uQFmj.js";import{I as Gt}from"./input-Cch0IC2D.js";import{T as Lt}from"./textarea-D4QsZZY2.js";import{V as zn,b as Wn,a as he}from"./layout-JuxaRCBK.js";import{S as Fn}from"./save-actions-DkD1FHqW.js";import{M as vo}from"./mcp-app-renderer-vWTHzC-y.js";import{g as So,M as gn}from"./types-CGMnrrVy.js";import{S as Hn,a as Vn,b as Un,c as Bn,d as tt}from"./select-iAQ1JGAr.js";import{c as Xt,T as nt,a as st,b as ot}from"./tooltip-Bb66VFhj.js";import{i as yo}from"./AlertCircle-Bz0Gu2J2.js";import{s as wo}from"./Clock-BDkBqrq2.js";import{i as bn}from"./Code01-Den27Mse.js";import{a as No}from"./Copy01-BCJxa3pS.js";import{s as Co}from"./LayersTwo01-CuCFLmbR.js";import{i as dt}from"./Loading01-By16fsIj.js";import{i as Zt}from"./Play-DYSuo3bc.js";import{B as qn,a as Kn,b as Pe,d as rt,e as it,c as Jn}from"./breadcrumb-J-4TPKpB.js";import{u as ko,O as Io,M as _o,F as Eo,v as To}from"./index-Ch67qqnf.js";import{u as ut,b as $o}from"./use-connection-Bv6BgTqI.js";import{d as Qt,b as Yt,a as en}from"./use-mcp-tools-q5O9mXfB.js";import{I as ft}from"./integration-icon-BtE6qqXO.js";import{a as Oo}from"./tools-list-CWpIc2sG.js";import{M as Le,n as Ro}from"./monaco-editor-CYwLLnlJ.js";import{E as tn}from"./empty-state-COL4jrg3.js";import{n as Ao}from"./Container-w8ZJjmnR.js";import{b as Gn}from"./use-virtual-mcp-T76ZkZ-8.js";import{b as Mo,R as jn,a as Po}from"./resizable-taukBI4-.js";import{B as me}from"./badge-CU_zbIXX.js";import{S as mt}from"./spinner-BsdcXRt-.js";import{V as Lo}from"./collection-display-button-Cep9T1dy.js";import{N as Do,S as zo,a as Wo,c as Fo,m as Xe,P as Ho,i as Vo,R as Uo,u as Bo,b as qo,d as vn,E as Ko,e as Jo}from"./index-CvxrBAxY.js";import{a as Go}from"./use-binding-Bi9qdfAY.js";import{b as Xo,c as Zo,d as Qo,e as Yo,a as er,D as tr}from"./dialog-BuY4tTjY.js";import"./index-CNLrMiMB.js";import{s as Xn}from"./Plus-jLReB_Bt.js";import{i as pt}from"./Check-e1LxjlnS.js";import{i as nr}from"./DotsHorizontal-DdpEu4kv.js";import{b as sr,T as or,R as rr,g as ir,h as Zn,j as lr}from"./collapsible-C32NLu9h.js";import{s as nn}from"./XClose-CuKHHhHx.js";import{D as cr,a as ar,b as dr,c as Sn}from"./dropdown-menu-CF9W86LV.js";import{i as ur}from"./ChevronRight-DZwFOSrA.js";import{a as fr,S as mr}from"./scroll-area-nyuwfJ38.js";import{i as Qn}from"./X-DZCW78jV.js";import"./SearchMd-DF5i6zVs.js";import"./useMutation-DRjp2Nl5.js";import"./label-BLzrK_Rs.js";import"./index-DLDRkAi_.js";import"./localstorage-keys-CxWEzkpK.js";import"./useQuery-BcAK4m0m.js";import"./Save01-B5XsnIBD.js";import"./use-mcp-resources-MU6kxIry.js";import"./index-B5u30SQw.js";import"./ChevronDown-BjWhsewG.js";import"./mcp-oauth-D_4U_dE3.js";import"./File06-DI2DTxDK.js";import"./Key01-DY7k7KSd.js";import"./constants-DWucmYRT.js";import"./registry-utils-M1yY8DgS.js";import"./extract-connection-data-BbBDZhaA.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-CM7KAiir.js";import"./circle-alert-Dmir_dX9.js";import"./index-ClZvg-b8.js";import"./index-DlboOjMX.js";import"./collection-table-wrapper-j8x7CZEu.js";import"./table-5KSUgwco.js";import"./ArrowDown-DA10fwsF.js";import"./ArrowUp-DNV5Voek.js";import"./card-ekU23Imm.js";import"./Eye-B65VnOsY.js";import"./Globe02-C7u-Ldxq.js";import"./Grid01-CMrNK-TY.js";import"./List-DFmwlXqV.js";import"./popover-CH5Uw6Js.js";import"./skeleton-BavbnGik.js";import"./decopilot-events-Dczeyumg.js";import"./usage-B8eRkRZY.js";import"./Edit01-CPphoQZI.js";import"./Users03-CUtoEpN2.js";import"./XCircle-BRYqxNwU.js";import"./tabs-BCXNMT0l.js";import"./ArrowLeft-bHzBiXiT.js";import"./use-copy-QwK_lQBK.js";import"./use-create-virtual-mcp-wYKTF_rl.js";import"./marked.esm-BaswSlok.js";import"./markdown-B9U6C-Vk.js";import"./Trash01-BZm-kVJv.js";import"./binder-D8RBAvqy.js";import"./use-llm-lZx_FT_g.js";import"./checkbox-Dkby6oH1.js";import"./AlignLeft-cTDyunvB.js";import"./Image01-HHGXqEyS.js";import"./RefreshCcw01-CJTVrN2f.js";import"./Settings01-B3dw12xC.js";import"./useSuspenseInfiniteQuery-B9EajsfN.js";import"./infiniteQueryObserver-CiekiSCa.js";const Yn=re("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 es=re("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 sn=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const on=re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const pr=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const xr=re("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const hr=re("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 ts=re("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 ns=re("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 ss=re("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 gr=re("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const os=re("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 rs=re("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"}]]),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:"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"}));rn.displayName="AlertOctagon";const is=({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"}));is.displayName="Box";const ls=({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"}));ls.displayName="ClockFastForward";const cs=({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"}));cs.displayName="Code02";const Ze=({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"}));Ze.displayName="Columns01";const as=({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"}));as.displayName="CornerDownRight";const ds=({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"}));ds.displayName="Database01";const us=({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:"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"}));us.displayName="GitBranch01";const fs=({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"}));fs.displayName="Repeat03";const ms=({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 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),k.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));ms.displayName="StopCircle";Qs({title:Et().min(1),description:Et().nullable(),body:Et()});function $t(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function br(){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 jr(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:yr}),o.jsx(Tt,{control:n.control,name:"description",render:Sr})]})]}),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:vr})]}),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(jo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function vr(t){const{field:e}=t;return o.jsx(Kt,{children:o.jsx(Jt,{children:o.jsx(Lt,{...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 Sr(t){const{field:e}=t;return o.jsxs(Kt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Jt,{children:o.jsx(Gt,{...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 yr(t){const{field:e}=t;return o.jsxs(Kt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Jt,{children:o.jsx(Gt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wr(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ie(l),a=Bt(n,"PROMPT",s,c),d=qt(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:$t(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ys(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:$t(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const $=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:$.title,description:$.description??null,body:$t($)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.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:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(zn,{children:o.jsx(Fn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(jr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let _;return e[31]!==w||e[32]!==C||e[33]!==y?(_=o.jsxs(he,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=_):_=e[34],_}function Nr(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=br(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Dn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(wr,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Cr=eo("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 kr(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=R(Cr({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 Ir(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=R("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 _r(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=R("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 Er=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Tr(t){const e=N.c(9),{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=ko(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(Io,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(_o,{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]!==c||e[7]!==n?(a=o.jsx($r,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function $r({toolName:t,connectionId:e}){const{replayId:n}=to({strict:!1}),s=(()=>{if(!n)return null;const E=`replay-${n}`,O=sessionStorage.getItem(E);if(!O)return null;sessionStorage.removeItem(E);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!s)return null;const E={};for(const[O,P]of Object.entries(s))P!==null&&typeof P=="object"?E[O]=JSON.stringify(P,null,2):E[O]=P;return E})(),[r,l]=k.useState(i??{}),[c,a]=k.useState(s?JSON.stringify(s,null,2):"{}"),[d,u]=k.useState(null),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(null),[b,j]=k.useState(!1),[S,y]=k.useState(null),{org:v}=Z(),w=ut(e),C=ie({connectionId:e,orgId:v.id}),_=Qt({client:C}),I=_.data?.tools?.find(E=>E.name===t),$=So(I?._meta),[A,W]=k.useState("json"),[T,M]=k.useState(!1);$&&!T&&(W("ui"),M(!0));const H=I?.inputSchema?.properties,F=H?Object.keys(H):[],B=F.length>0,V={};if(B&&I?.inputSchema?.properties)for(const E of F)V[E]=I.inputSchema.required?.includes(E)?"":void 0;const z=E=>Object.prototype.hasOwnProperty.call(r,E),Q=async()=>{j(!0),g(null),u(null),m(null),p(null),y(null);const E=performance.now();try{if(!C)throw new Error("MCP client is not available");const O=B?{...V,...r}:(()=>{const G=c.trim();if(!G)return{};const D=JSON.parse(G);if(D&&typeof D=="object")return D;throw new Error("Raw JSON input must be an object.")})();B&&I?.inputSchema?.properties&&Object.entries(I.inputSchema.properties).forEach(([G,D])=>{if((D.type==="object"||D.type==="array")&&typeof O[G]=="string")try{O[G]=JSON.parse(O[G])}catch{}});const P=await C.callTool({name:t,arguments:O}),Y=P.structuredContent??P,le=performance.now(),oe=Math.round(le-E);u(Y),m(P),p(O);const ce=JSON.stringify(Y),te=new TextEncoder().encode(ce).length;y({duration:`${oe}ms`,bytes:`${te} bytes`,tokens:`~${Math.ceil(te/4)} tokens`,cost:"$0.0000"})}catch(O){const P=O instanceof Error?O.message:String(O);g(P||"Unknown error occurred");const Y=performance.now();y({duration:`${Math.round(Y-E)}ms`})}finally{j(!1)}},se=(E,O)=>{l(P=>({...P,[E]:O}))},ee=()=>{u(null),m(null),p(null),g(null),y(null)},U=I?.name??Er(t),J=o.jsx(qn,{children:o.jsxs(Kn,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps",params:{org:v.slug,project:et},children:"Connections"})})}),o.jsx(it,{}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps/$connectionId",params:{org:v.slug,project:et,connectionId:e},search:{tab:"tools"},children:w.title})})}),o.jsx(it,{})]}),o.jsx(Pe,{children:o.jsx(Jn,{children:U})})]})});return o.jsx(he,{breadcrumb:J,children: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(ft,{icon:w?.icon||null,name:w?.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:[_.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):_.isLoading?o.jsx(dt,{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:_.isSuccess?"ready":_.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:I?.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"}),I?.inputSchema?.required&&I.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:B&&I?.inputSchema?.properties?Object.entries(I.inputSchema.properties).map(([E,O])=>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:[E,I.inputSchema?.required?.includes(E)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?o.jsx(Lt,{className:"font-mono text-xs",value:z(E)?r[E]??"":V[E]??"",onChange:P=>se(E,P.target.value),placeholder:`Enter ${E} as JSON...`,rows:3}):O.type==="boolean"?o.jsxs(Hn,{value:z(E)?String(r[E]??""):"",onValueChange:P=>se(E,P==="true"),children:[o.jsx(Vn,{children:o.jsx(Un,{placeholder:"Select true or false..."})}),o.jsxs(Bn,{children:[o.jsx(tt,{value:"true",children:"true"}),o.jsx(tt,{value:"false",children:"false"})]})]}):o.jsx(Gt,{value:z(E)?r[E]??"":V[E]??"",onChange:P=>se(E,P.target.value),placeholder:`Enter ${E}...`})]},E)):I?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Lt,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:E=>a(E.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.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsx(Oo,{annotations:I?.annotations,_meta:I?._meta})]}),S&&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(wo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ds,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),o.jsxs("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:b?o.jsxs(X,{size:"sm",variant:"destructive",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:ee,children:[o.jsx(ms,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(X,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:Q,children:[o.jsx(Zt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),$&&o.jsx(Xt,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(nt,{children:[o.jsx(st,{asChild:!0,children:o.jsx(X,{size:"icon",variant:A==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>W("ui"),children:o.jsx(Co,{size:14})})}),o.jsx(ot,{children:"Interactive view"})]}),o.jsxs(nt,{children:[o.jsx(st,{asChild:!0,children:o.jsx(X,{size:"icon",variant:A==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>W("json"),children:o.jsx(bn,{size:14})})}),o.jsx(ot,{children:"JSON view"})]})]})})]}),h&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(kr,{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(yo,{className:"h-4 w-4"}),o.jsx(Ir,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(_r,{className:"text-xs text-destructive",children:h})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:$&&A==="ui"&&C?o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(vo,{resourceURI:$,toolInfo:I?{tool:I}:void 0,toolInput:x??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:gn.view.minHeight,maxHeight:gn.view.maxHeight,client:C,className:"h-full"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(Le,{code:JSON.stringify(d,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(X,{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(d,null,2)),On.success("Copied to clipboard")},children:o.jsx(No,{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(bn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})})}function Or(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=pe(i).connectionId;if(!ut(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(dt,{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(Tr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const yn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},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},ln=(t=>t?yn(t):yn),Rr=t=>t;function Dt(t,e=Rr){const n=K.useSyncExternalStore(t.subscribe,K.useCallback(()=>e(t.getState()),[t,e]),K.useCallback(()=>e(t.getInitialState()),[t,e]));return K.useDebugValue(n),n}const Ar=t=>{const e=ln(t),n=s=>Dt(e,s);return Object.assign(n,e),n},Mr=(t=>Ar);function ps(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 zt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return zt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return zt(s)(n)}}}},Pr=(t,e)=>(n,s,i)=>{let r={storage:ps(()=>window.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})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return zt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};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(),p||x},xs=Pr,{useSyncExternalStoreWithSelector:Lr}=no,Dr=t=>t;function zr(t,e=Dr,n){const s=Lr(t.subscribe,t.getState,t.getInitialState,e,n);return K.useDebugValue(s),s}const wn=t=>Symbol.iterator in t,Nn=t=>"entries"in t,Cn=(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},Wr=(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 Fr(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:wn(t)&&wn(e)?Nn(t)&&Nn(e)?Cn(t,e):Wr(t,e):Cn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Hr(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
2
  ${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
3
3
  `:""} ${d}${f}: ${n(u)};`}).join(`
4
4
  `)}
5
5
  }`}return`interface ${e} ${n(t)}`}function Ot(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 Vr(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
6
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 Rt(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...so,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const hs=k.createContext(null),Ur=t=>ln()(xs(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??Rt(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:Ot(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 m=r.steps.find(x=>x.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=Rt("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Hr(a,"Input"),m=d.action,x=Vr(m.code,f);d={...d,action:{...m,code:x}}}const u=Ot(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=Rt("tool",Number((Math.random()*1e6).toFixed(0)));const i=Ot(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:ps(()=>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 Br(t){const e=N.c(11),{children:n,initialState:s}=t,i=Gn(),{org:r}=Z();let l;e[0]!==r||e[1]!==i?.[0]?.id?(l=i?.[0]?.id??Ue(r.id),e[0]=r,e[1]=i?.[0]?.id,e[2]=l):l=e[2];const c=l;let a;e[3]!==c||e[4]!==s.currentStepTab||e[5]!==s.trackingExecutionId||e[6]!==s.workflow?(a=()=>Ur({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:c,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[3]=c,e[4]=s.currentStepTab,e[5]=s.trackingExecutionId,e[6]=s.workflow,e[7]=a):a=e[7];const[d]=k.useState(a);let u;return e[8]!==n||e[9]!==d?(u=o.jsx(hs.Provider,{value:d,children:n}),e[8]=n,e[9]=d,e[10]=u):u=e[10],u}function Be(t,e){const n=k.useContext(hs);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return zr(n,t,Fr)}function De(){return Be(qr)}function qr(t){return t.workflow}function ne(){return Be(Kr)}function Kr(t){return t.actions}function gs(){const t=Ke();return Be(Jr)??t[0]?.name}function Jr(t){return t.currentStepName}function qe(){const t=N.c(5),e=gs(),n=Ke();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 Ke(){return De().steps}function Wt(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(!Wt(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)||!Wt(n[l],s[l]))return!1;return!0}return!1}function bs(){const t=N.c(5),e=De();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=qs(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=Wt(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function q(){return Be(Gr)}function Gr(t){return t.trackingExecutionId}function Je(){return Be(Xr)}function Xr(t){return t.selectedVirtualMcpId}function Zr(t){const e=N.c(23),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=Gn()??[],{org:a}=Z();let d;e[0]!==a.id?(d=Ue(a.id),e[0]=a.id,e[1]=d):d=e[1];const u=d,f=c.filter(Yr),m=Hn,x=n??u;let p;e[2]!==s?(p=C=>s(C===""?void 0:C),e[2]=s,e[3]=p):p=e[3];let h;e[4]!==i?(h=R("text-xs",i),e[4]=i,e[5]=h):h=e[5];let g;e[6]!==l?(g=o.jsx(Un,{placeholder:l}),e[6]=l,e[7]=g):g=e[7];let b;e[8]!==h||e[9]!==g?(b=o.jsx(Vn,{size:"sm",className:h,children:g}),e[8]=h,e[9]=g,e[10]=b):b=e[10];const j=Bn;let S;e[11]!==u?(S=o.jsx(tt,{value:u,children:"All tools (Decopilot)"}),e[11]=u,e[12]=S):S=e[12];const y=f.map(Qr);let v;e[13]!==j||e[14]!==S||e[15]!==y?(v=o.jsxs(j,{children:[S,y]}),e[13]=j,e[14]=S,e[15]=y,e[16]=v):v=e[16];let w;return e[17]!==m||e[18]!==v||e[19]!==x||e[20]!==p||e[21]!==b?(w=o.jsxs(m,{value:x,onValueChange:p,children:[b,v]}),e[17]=m,e[18]=v,e[19]=x,e[20]=p,e[21]=b,e[22]=w):w=e[22],w}function Qr(t){return o.jsx(tt,{value:t.id,children:t.title},t.id)}function Yr(t){return t.id!==null&&!jo(t.id)}function ze(){const t=N.c(2),e=bo();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=Go(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}function fe(t){const e=N.c(12),{org:n}=Z(),s=ze();let i;e[0]!==s.id||e[1]!==n.id?(i={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=i):i=e[2];const r=ie(i);let l;e[3]!==t?(l={id:t},e[3]=t,e[4]=l):l=e[4];const c=!!t;let a;e[5]!==r||e[6]!==l||e[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:l,enabled:c,select:ei},e[5]=r,e[6]=l,e[7]=c,e[8]=a):a=e[8];const{data:d,isLoading:u}=Yt(a),f=d?.item;let m;return e[9]!==u||e[10]!==f?(m={item:f,isLoading:u},e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function ei(t){return t.structuredContent??t}function js(t,e,n){const s=N.c(14),{org:i}=Z(),r=ze();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ie(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];let u;s[6]!==c||s[7]!==a||s[8]!==d?(u={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,select:ti},s[6]=c,s[7]=a,s[8]=d,s[9]=u):u=s[9];const{data:f,isLoading:m}=Yt(u),x=f?.output,p=f?.error;let h;return s[10]!==m||s[11]!==x||s[12]!==p?(h={output:x,error:p,isLoading:m},s[10]=m,s[11]=x,s[12]=p,s[13]=h):h=s[13],h}function ti(t){return t.structuredContent??t}function ni(){const t=N.c(19),{org:e}=Z(),n=ze(),s=De();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=ie(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:si},t[9]=r,t[10]=d,t[11]=u,t[12]=f):f=t[12];const{data:m,isLoading:x,refetch:p}=Yt(f);let h;t[13]!==m?.items?(h=m?.items??[],t[13]=m?.items,t[14]=h):h=t[14];let g;return t[15]!==x||t[16]!==p||t[17]!==h?(g={executions:h,isLoading:x,refetch:p},t[15]=x,t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function si(t){return t.structuredContent??t}function vs(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 oi(t){const e=[];for(const n of t){const s=vs(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function ri(t){for(const e of t)if(vs(e.input).includes("__entire_input__"))return!0;return!1}function ii(t){const e=oi(t);if(e.length===0)return ri(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 li(){const t=N.c(2),e=De();let n;return t[0]!==e.steps?(n=ii(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function ci(){const t=N.c(16),{org:e}=Z(),{id:n}=ze(),{setTrackingExecutionId:s}=ne(),i=De(),r=Je(),l=li();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=ie(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=en(d);let m;t[5]!==e.id||t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==i?(m=async g=>{const b=g===void 0?{}:g,j=r??Ue(e.id),S=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:j,start_at_epoch_ms:S,workflow_collection_id:i.id}}),w=(y.structuredContent??y)?.item?.id??void 0;return s(w),w},t[5]=e.id,t[6]=r,t[7]=s,t[8]=u,t[9]=i,t[10]=m):m=t[10];const x=m,p=l!==null;let h;return t[11]!==x||t[12]!==l||t[13]!==f||t[14]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[11]=x,t[12]=l,t[13]=f,t[14]=p,t[15]=h):h=t[15],h}function ai(){const t=N.c(10),{org:e}=Z(),{id:n}=ze();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=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=en(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 di(){const t=N.c(10),{org:e}=Z(),{id:n}=ze();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=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=en(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.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 ui(){const t=N.c(3),e=q(),{item:n}=fe(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 fi(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 cn=Mr()(xs(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"})),Ss=k.createContext([]);function ys(){return k.useContext(Ss)}function mi({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Ho;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 ws(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>mi({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function kn(t,e){const n=ws(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var pi=Do.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",Xe(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=kn(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Xe({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Xe({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Xe({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Fo({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:kn(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 Wo,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 ws(this).map(zo)}}),xi=pi,At,xt="HoverCard",[Ns]=Pn(xt,[An]),ht=An(),[hi,gt]=Ns(xt),Cs=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=ht(e),d=k.useRef(0),u=k.useRef(0),f=k.useRef(!1),m=k.useRef(!1),[x,p]=Vt({prop:s,defaultProp:i??!1,onChange:r,caller:xt}),h=k.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=k.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=k.useCallback(()=>p(!1),[p]);return k.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(hi,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(io,{...a,children:n})})};Cs.displayName=xt;var ks="HoverCardTrigger",Is=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=gt(ks,n),r=ht(n);return o.jsx(oo,{asChild:!0,...r,children:o.jsx(Ht.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:de(t.onPointerEnter,ct(i.onOpen)),onPointerLeave:de(t.onPointerLeave,ct(i.onClose)),onFocus:de(t.onFocus,i.onOpen),onBlur:de(t.onBlur,i.onClose),onTouchStart:de(t.onTouchStart,l=>l.preventDefault())})})});Is.displayName=ks;var an="HoverCardPortal",[gi,bi]=Ns(an,{forceMount:void 0}),_s=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=gt(an,e);return o.jsx(gi,{scope:e,forceMount:n,children:o.jsx(Rn,{present:n||r.open,children:o.jsx(ro,{asChild:!0,container:i,children:s})})})};_s.displayName=an;var lt="HoverCardContent",Es=k.forwardRef((t,e)=>{const n=bi(lt,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=gt(lt,t.__scopeHoverCard);return o.jsx(Rn,{present:s||r.open,children:o.jsx(ji,{"data-state":r.open?"open":"closed",...i,onPointerEnter:de(t.onPointerEnter,ct(r.onOpen)),onPointerLeave:de(t.onPointerLeave,ct(r.onClose)),ref:e})})});Es.displayName=lt;var ji=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=gt(lt,n),d=ht(n),u=k.useRef(null),f=Mn(e,u),[m,x]=k.useState(!1);return k.useEffect(()=>{if(m){const p=document.body;return At=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=At,p.style.webkitUserSelect=At}}},[m]),k.useEffect(()=>{if(u.current){const p=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),k.useEffect(()=>{u.current&&yi(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(lo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:de(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(co,{...d,...c,onPointerDown:de(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"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)"}})})}),vi="HoverCardArrow",Si=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=ht(n);return o.jsx(ao,{...i,...s,ref:e})});Si.displayName=vi;function ct(t){return e=>e.pointerType==="touch"?void 0:t()}function yi(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 wi=Cs,Ni=Is,Ci=_s,ki=Es;function Ii(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(wi,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function _i(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(Ni,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Ei(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=R("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(Ci,{"data-slot":"hover-card-portal",children:o.jsx(ki,{"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 Ts=k.createContext(void 0);function Ti(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 $i(t){const e=N.c(20),{node:n}=t,s=k.useContext(Ts),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?Ti(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(vn,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(_i,{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 m;e[12]!==c?(m=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]=m):m=e[13];let x;e[14]!==f||e[15]!==m?(x=o.jsx(Ei,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=x):x=e[16];let p;return e[17]!==u||e[18]!==x?(p=o.jsx(vn,{as:"span",children:o.jsxs(Ii,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function $s(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 ue=Os();function Os(){return ln(()=>({items:[],selectedIndex:0,command:null}))}function In(t,e){ue.setState({items:t,command:e,selectedIndex:0})}function Oi(){const{items:t,selectedIndex:e}=ue.getState();t.length&&ue.setState({selectedIndex:(e-1+t.length)%t.length})}function Ri(){const{items:t,selectedIndex:e}=ue.getState();t.length&&ue.setState({selectedIndex:(e+1)%t.length})}function Rs(){const{items:t,selectedIndex:e,command:n}=ue.getState(),s=t[e];return s?(n?.(s),!0):!1}function _n(){ue=Os()}function Ai(){const t=N.c(7),e=Dt(ue,Pi),n=Dt(ue,Mi);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:()=>{ue.setState({selectedIndex:c}),Rs()},className:R("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 Mi(t){return t.selectedIndex}function Pi(t){return t.items}function Li(){let t=null,e=null;return{onStart:n=>{In(n.items,n.command),t=new qo(Ai,{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=>{In(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(),_n(),!0):n.key==="ArrowUp"?(Oi(),!0):n.key==="ArrowDown"?(Ri(),!0):n.key==="Enter"?Rs():!1,onExit:()=>{e?.remove(),t?.destroy(),_n()}}}const Mt=/@([\w.]+)/g;function Di(t,e){if(!t)return null;const n=$s(e),s=new Map(n.map(a=>[a.id,a]));if(!Mt.test(t))return t;Mt.lastIndex=0;const r=[];let l=0,c;for(;(c=Mt.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 dn(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=ui();let d;e[0]!==n||e[1]!==s?(d=Di(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=Vo.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let p;if(e[4]!==n||e[5]!==f){let I;e[7]!==n?(I=$=>{const{query:A}=$;return $s(n).filter(T=>T.label.toLowerCase().includes(A.toLowerCase())||T.id.toLowerCase().includes(A.toLowerCase()))},e[7]=n,e[8]=I):I=e[8],p=xi.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Hi,renderHTML:Fi,suggestion:{items:I,render:Li,command:Wi}}).extend(f?{addNodeView(){return Uo($i)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let h;e[9]!==p?(h=[x,p],e[9]=p,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:zi},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=I=>{const{editor:$}=I;return i?.($.getText().trim())},e[13]=i,e[14]=j):j=e[14];let S;e[15]!==u||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==j?(S={content:u,editable:m,extensions:h,editorProps:b,onUpdate:j},e[15]=u,e[16]=m,e[17]=h,e[18]=b,e[19]=j,e[20]=S):S=e[20];const y=Bo(S);let v;e[21]!==l?(v=R("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 w;e[23]!==y?(w=o.jsx(Ko,{editor:y}),e[23]=y,e[24]=w):w=e[24];let C;e[25]!==v||e[26]!==w?(C=o.jsx("div",{className:v,children:w}),e[25]=v,e[26]=w,e[27]=C):C=e[27];const _=C;if(a!==void 0){let I;return e[28]!==_||e[29]!==a?(I=o.jsx(Ts.Provider,{value:a,children:_}),e[28]=_,e[29]=a,e[30]=I):I=e[30],I}return _}function zi(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Wi(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function Fi(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Hi(t){const{node:e}=t;return`@${e.attrs.id}`}function Vi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ys(),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(dn,{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 Ui(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ys(),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(dn,{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 Bi(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=R("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 qi(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=m=>s(m.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 Ki(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,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=R("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"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let x;e[6]!==a?(x=a.map(Ji),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=p):p=e[13],p}function Ji(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Gi={TextWidget:Vi,TextareaWidget:Ui,NumberWidget:Bi,CheckboxWidget:qi,SelectWidget:Ki};function Xi(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:rs,color:"text-blue-500"};case"number":case"integer":return{Icon:ss,color:"text-blue-500"};case"array":return{Icon:es,color:"text-purple-500"};case"object":return{Icon:Yn,color:"text-orange-500"};case"boolean":return{Icon:os,color:"text-pink-500"};case"null":return{Icon:Ut,color:"text-gray-500"};default:return{Icon:ts,color:"text-muted-foreground"}}}function Zi(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,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:v,color:w}=Xi(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=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,m=R(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else u=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let j;e[24]!==x||e[25]!==p||e[26]!==h||e[27]!==b?(j=o.jsxs("div",{className:x,children:[p,h,b]}),e[24]=x,e[25]=p,e[26]=h,e[27]=b,e[28]=j):j=e[28];let S;e[29]!==r?(S=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=S):S=e[30];let y;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==S?(y=o.jsxs("div",{className:g,children:[j,S,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=S,e[35]=y):y=e[35],y}function Qi(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(el),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(Yi),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 Yi(t){return o.jsx("div",{children:t.content},t.name)}function el(t){return o.jsx("div",{children:t.content},t.name)}function tl(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(nl),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(X,{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 nl(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 sl(){return null}function ol(){return null}const rl={FieldTemplate:Zi,ObjectFieldTemplate:Qi,ArrayFieldTemplate:tl,UnsupportedFieldTemplate:sl,ErrorListTemplate:ol};function il(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??""),m=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:m})]}),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(dn,{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 As({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(il,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=k.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[x,p]of Object.entries(f))m[x]!==p&&s(x,p);for(const x of Object.keys(m))x in f||s(x,void 0)}a.current=f};return o.jsx(Ss.Provider,{value:l,children:o.jsx(To,{schema:c,formData:e,onChange:d,validator:$o,widgets:Gi,templates:rl,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function ll(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 m;e[5]!==s?(m=_=>{_||d({}),s(_)},e[5]=s,e[6]=m):m=e[6];const x=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(Xo,{children:[o.jsx(Zo,{children:"Workflow Input"}),o.jsx(Qo,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=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(As,{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(X,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let S;e[17]!==l?(S=l?o.jsx(mt,{size:"xs"}):o.jsx(Zt,{size:14}),e[17]=l,e[18]=S):S=e[18];let y;e[19]!==f||e[20]!==l||e[21]!==S?(y=o.jsxs(X,{onClick:f,disabled:l,className:"gap-2",children:[S,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=S,e[22]=y):y=e[22];let v;e[23]!==y||e[24]!==j?(v=o.jsxs(Yo,{children:[j,y]}),e[23]=y,e[24]=j,e[25]=v):v=e[25];let w;e[26]!==v||e[27]!==g?(w=o.jsxs(er,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,v]}),e[26]=v,e[27]=g,e[28]=w):w=e[28];let C;return e[29]!==x||e[30]!==n||e[31]!==w?(C=o.jsx(tr,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=C):C=e[32],C}function cl(t){const e=N.c(25),{title:n,description:s,onSave:i,isSaving:r}=t,{viewMode:l,setViewMode:c,showExecutionsList:a,toggleExecutionsList:d}=cn(),{resetToOriginalWorkflow:u,setSelectedVirtualMcpId:f}=ne(),m=bs(),x=Je(),p=q();let h;e[0]!==n?(h=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=h):h=e[1];let g;e[2]!==s?(g=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]=g):g=e[3];let b;e[4]!==h||e[5]!==g?(b=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h,g]})}),e[4]=h,e[5]=g,e[6]=b):b=e[6];let j;e[7]!==m||e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==x||e[12]!==f||e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==p||e[17]!==l?(j=!p&&o.jsxs(o.Fragment,{children:[o.jsx(Fn,{onSave:i,onUndo:u,isDirty:m,isSaving:r,saveLabel:"Save workflow",undoLabel:"Reset changes"}),o.jsx(k.Suspense,{fallback:o.jsx(mt,{size:"xs"}),children:o.jsx(Zr,{selectedVirtualMcpId:x,onVirtualMcpChange:f,placeholder:"Select Agent"})}),o.jsx(Lo,{value:l,onValueChange:c,size:"sm",options:[{value:"visual",icon:o.jsx(us,{})},{value:"code",icon:o.jsx(cs,{})}]}),o.jsx(Xt,{children:o.jsxs(nt,{delayDuration:0,children:[o.jsx(st,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(X,{variant:a?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:d,"aria-label":a?"Hide runs":"Show runs",children:o.jsx(ls,{size:14})})})}),o.jsx(ot,{side:"bottom",children:a?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=r,e[9]=i,e[10]=u,e[11]=x,e[12]=f,e[13]=c,e[14]=a,e[15]=d,e[16]=p,e[17]=l,e[18]=j):j=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ul,{}),e[19]=S):S=e[19];let y;e[20]!==j?(y=o.jsxs(zn,{children:[j,S]}),e[20]=j,e[21]=y):y=e[21];let v;return e[22]!==b||e[23]!==y?(v=o.jsxs(o.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=v):v=e[24],v}function al(){const t=q(),{item:e}=fe(t);return e?.completed_at_epoch_ms!=null}function dl(){const t=q(),{item:e}=fe(t);return e?.status==="cancelled"}function ul(){const t=N.c(58),e=bs(),n=al(),s=dl(),i=q(),r=Je(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=ci(),u=Ke(),[f,m]=k.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=ai(),{handleResumeWorkflow:h,isResuming:g}=di(),b=i&&!n;let j;t[0]!==u?(j=u.some(fl),t[0]=u,t[1]=j):j=t[1];const S=j,y=!r,v=u.length===0,w=e||v||S||y||c||p,C=b||c;let _;t[2]!==S||t[3]!==y||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":y?"Select an Agent first":v||S?"Add at least one step to the workflow":null,t[2]=S,t[3]=y,t[4]=e,t[5]=s,t[6]=C,t[7]=v,t[8]=_):_=t[8];const $=_();let A;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==C||t[15]!==a||t[16]!==i?(A=async()=>{if(a&&d){m(!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]=A):A=t[17];const W=A;let T;t[18]!==l?(T=async P=>{await l(P)},t[18]=l,t[19]=T):T=t[19];const M=T,H=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",F=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let B;t[20]!==F?(B=R("gap-2 h-7 px-3",F),t[20]=F,t[21]=B):B=t[21];let V;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(V=(!b&&!c&&!p&&!g||s)&&o.jsx(Zt,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=V):V=t[27];let z;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(z=b&&!c&&!p&&!g&&!s&&o.jsx(Jo,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=z):z=t[33];let Q;t[34]!==p||t[35]!==c||t[36]!==g?(Q=(c||p||g)&&o.jsx(mt,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=Q):Q=t[37];let se;t[38]!==H||t[39]!==W||t[40]!==w||t[41]!==B||t[42]!==V||t[43]!==z||t[44]!==Q?(se=o.jsxs(X,{variant:"default",size:"sm",className:B,disabled:w,onClick:W,children:[V,z,Q,H]}),t[38]=H,t[39]=W,t[40]=w,t[41]=B,t[42]=V,t[43]=z,t[44]=Q,t[45]=se):se=t[45];const ee=se;let U;t[46]!==ee||t[47]!==$?(U=$?o.jsx(Xt,{children:o.jsxs(nt,{delayDuration:0,children:[o.jsx(st,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:ee})}),o.jsx(ot,{side:"bottom",children:$})]})}):ee,t[46]=ee,t[47]=$,t[48]=U):U=t[48];const J=U;let E;t[49]!==M||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(E=a&&d&&o.jsx(ll,{open:f,onOpenChange:m,inputSchema:d,onSubmit:M,isPending:c}),t[49]=M,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=E):E=t[54];let O;return t[55]!==J||t[56]!==E?(O=o.jsxs(o.Fragment,{children:[J,E]}),t[55]=J,t[56]=E,t[57]=O):O=t[57],O}function fl(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function En(t,e){for(const n of e)if(n===t||n.startsWith(`${t}[`))return!0;return!1}function ml(){const t=N.c(13),e=q(),n=Ke(),{item:s}=fe(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.error||t[3]!==s.running_steps||t[4]!==s.status||t[5]!==n){i={};let r;t[7]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(pl)??[]),t[7]=s.completed_steps?.success,t[8]=r):r=t[8];const l=r,c=s.completed_steps?.error??[];let a;t[9]!==s.running_steps?(a=s.running_steps??[],t[9]=s.running_steps,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d,f=s.status,m=s.error!=null?typeof s.error=="string"?s.error:JSON.stringify(s.error):void 0;let x=-1;n.forEach((p,h)=>{(l.has(p.name)||En(p.name,c))&&(x=h)}),n.forEach((p,h)=>{let g="pending",b;En(p.name,c)?(g="error",b=m):l.has(p.name)?g="success":(f==="error"||f==="failed")&&u.has(p.name)?(g="error",b=m):f==="running"&&h===x+1&&(g="running"),i[p.name]={status:g,output:void 0,error:b,stepIndex:h}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.error,t[3]=s.running_steps,t[4]=s.status,t[5]=n,t[6]=i}else i=t[6];return i}function pl(t){return t.name}function xl(t){const e=N.c(97),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=q(),{item:m}=fe(f),x=m?.completed_steps,p=x?.success,h=x?.error??[];let g;e[0]!==n.name||e[1]!==p?(g=p?.find(L=>L.name===n.name),e[0]=n.name,e[1]=p,e[2]=g):g=e[2];const b=g,j=b?.completed_at_epoch_ms,S=b!=null;let y;e[3]!==n.name?(y=L=>L===n.name||L.startsWith(`${n.name}[`),e[3]=n.name,e[4]=y):y=e[4];const v=h.some(y),w="toolName"in n.action,C=w&&"connectionId"in n.action?n.action.connectionId:null,I=!!(w&&"toolName"in n.action?n.action.toolName:null),$=kl(n),W=(m?.status==="error"||m?.status==="failed")&&m?.running_steps?.includes(n.name),T=S?"success":v||W?"error":r?.status,M=r!==void 0,H=T==="success"||T==="error";let F=$.length>0?60:12;(T==="success"||T==="error")&&(F=F+32);const B=bl(T);let V;e[5]!==T?(V=jl(T),e[5]=T,e[6]=V):V=e[6];const z=V;let Q;e[7]===Symbol.for("react.memo_cache_sentinel")?(Q=function(_t,Xs){const hn=Xs.split(".").slice(1);if(hn.length===0)return Array.isArray(_t)?_t:void 0;let xe=_t;for(const Zs of hn){if(xe==null)return;if(typeof xe=="object")xe=xe[Zs];else return}return Array.isArray(xe)?xe:void 0},e[7]=Q):Q=e[7];const se=Q,ee=n.forEach!==void 0,U=n.forEach?.ref;let J;e[8]!==U?(J=U?.replace("@","").split(".")[0],e[8]=U,e[9]=J):J=e[9];const E=J,O=m?.status==="running"||m?.status==="enqueued";let P;e[10]!==p||e[11]!==E?(P=p?.some(L=>L.name===E),e[10]=p,e[11]=E,e[12]=P):P=e[12];const Y=P,le=O?500:!1;let oe;e[13]!==Y||e[14]!==le?(oe={refetchInterval:le,enabled:Y},e[13]=Y,e[14]=le,e[15]=oe):oe=e[15];const{output:ce}=js(f,E,oe);let te;if(e[16]!==ce||e[17]!==U){const L=U?.replace("@","");te=L?se(ce,L):void 0,e[16]=ce,e[17]=U,e[18]=te}else te=e[18];const G=te;let D;if(e[19]!==n.name){let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=/[.*+?^${}()|[\]\\]/g,e[21]=L):L=e[21],D=n.name.replace(L,"\\$&"),e[19]=n.name,e[20]=D}else D=e[20];const We=D,xn=new RegExp(`^${We}\\[\\d+\\]$`),vt=m?.completed_steps?.success?.filter(L=>xn.test(L.name)),Fe=h.filter(L=>xn.test(L)),St=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",yt=T==="running"&&"bg-accent/50",wt=l&&"opacity-50";let ge;e[22]!==St||e[23]!==yt||e[24]!==wt?(ge=R("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",St,yt,wt),e[22]=St,e[23]=yt,e[24]=wt,e[25]=ge):ge=e[25];const Ks="button",Js=0;let be;e[26]!==a?(be=L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),a())},e[26]=a,e[27]=be):be=e[27];const Nt=R("text-xs font-mono opacity-75 h-8 flex items-center",B),Ct=s+1;let je;e[28]!==Nt||e[29]!==Ct?(je=o.jsx("div",{className:"w-5 flex flex-col items-center justify-center shrink-0 pt-3",children:o.jsxs("span",{className:Nt,children:[Ct,"."]})}),e[28]=Nt,e[29]=Ct,e[30]=je):je=e[30];let ve;e[31]!==z||e[32]!==s?(ve=s>0?o.jsx(Pt,{height:12,color:z}):o.jsx("div",{className:"h-3"}),e[31]=z,e[32]=s,e[33]=ve):ve=e[33];let Se;e[34]!==C||e[35]!==I||e[36]!==w||e[37]!==n.name?(Se=o.jsx(Nl,{connectionId:C,isToolStep:w,hasToolSelected:I,stepName:n.name}),e[34]=C,e[35]=I,e[36]=w,e[37]=n.name,e[38]=Se):Se=e[38];let ye;e[39]!==z||e[40]!==H||e[41]!==T?(ye=H&&o.jsxs(o.Fragment,{children:[o.jsx(Pt,{height:8,color:z}),o.jsx(vl,{status:T})]}),e[39]=z,e[40]=H,e[41]=T,e[42]=ye):ye=e[42];let we;e[43]!==z||e[44]!==F||e[45]!==c||e[46]!==f?(we=c&&f?null:o.jsx(Pt,{height:F,color:z}),e[43]=z,e[44]=F,e[45]=c,e[46]=f,e[47]=we):we=e[47];let Ne;e[48]!==ve||e[49]!==Se||e[50]!==ye||e[51]!==we?(Ne=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[ve,Se,ye,we]}),e[48]=ve,e[49]=Se,e[50]=ye,e[51]=we,e[52]=Ne):Ne=e[52];const Gs="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",kt=I?"font-medium text-foreground":"text-foreground";let Ce;e[53]!==kt?(Ce=R("text-sm truncate flex-1",kt),e[53]=kt,e[54]=Ce):Ce=e[54];let ke;e[55]!==n?(ke=Cl(n),e[55]=n,e[56]=ke):ke=e[56];let Ie;e[57]!==Ce||e[58]!==ke?(Ie=o.jsx("span",{className:Ce,children:ke}),e[57]=Ce,e[58]=ke,e[59]=Ie):Ie=e[59];let _e;e[60]!==vt?.length||e[61]!==Fe||e[62]!==ee||e[63]!==G?(_e=ee&&G&&G.length>0&&o.jsxs("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center gap-1",children:[`${(vt?.length??0)+Fe.length} / ${G.length}`,Fe.length>0&&o.jsxs("span",{className:"text-destructive",children:["(",Fe.length," failed)"]})]}),e[60]=vt?.length,e[61]=Fe,e[62]=ee,e[63]=G,e[64]=_e):_e=e[64];let Ee;e[65]!==M||e[66]!==T?(Ee=M&&o.jsx(Sl,{status:T}),e[65]=M,e[66]=T,e[67]=Ee):Ee=e[67];let Te;e[68]!==_e||e[69]!==Ee?(Te=o.jsxs("div",{className:"flex items-center gap-2",children:[_e,Ee]}),e[68]=_e,e[69]=Ee,e[70]=Te):Te=e[70];let $e;e[71]!==M||e[72]!==d||e[73]!==u?($e=!M&&o.jsxs(cr,{children:[o.jsx(ar,{asChild:!0,children:o.jsx(X,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:gl,children:o.jsx(nr,{size:14})})}),o.jsxs(dr,{align:"end",children:[o.jsxs(Sn,{onClick:L=>{L.stopPropagation(),u()},children:[o.jsx(hr,{size:14}),"Duplicate"]}),o.jsxs(Sn,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:L=>{L.stopPropagation(),d()},children:[o.jsx(uo,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[71]=M,e[72]=d,e[73]=u,e[74]=$e):$e=e[74];let Oe;e[75]!==Ie||e[76]!==Te||e[77]!==$e?(Oe=o.jsxs("div",{className:"flex items-center h-8",children:[Ie,Te,$e]}),e[75]=Ie,e[76]=Te,e[77]=$e,e[78]=Oe):Oe=e[78];const It=$.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:$.map(hl)});let Re;e[79]!==T||e[80]!==j?(Re=T==="success"&&o.jsx(yl,{completedAtEpochMs:j}),e[79]=T,e[80]=j,e[81]=Re):Re=e[81];let Ae;e[82]!==r?.error||e[83]!==T?(Ae=T==="error"&&o.jsx(wl,{error:r?.error}),e[82]=r?.error,e[83]=T,e[84]=Ae):Ae=e[84];let Me;e[85]!==Oe||e[86]!==It||e[87]!==Re||e[88]!==Ae?(Me=o.jsxs("div",{className:Gs,children:[Oe,It,Re,Ae]}),e[85]=Oe,e[86]=It,e[87]=Re,e[88]=Ae,e[89]=Me):Me=e[89];let Ge;return e[90]!==a||e[91]!==ge||e[92]!==be||e[93]!==je||e[94]!==Ne||e[95]!==Me?(Ge=o.jsxs("div",{className:ge,onClick:a,role:Ks,tabIndex:Js,onKeyDown:be,children:[je,Ne,Me]}),e[90]=a,e[91]=ge,e[92]=be,e[93]=je,e[94]=Ne,e[95]=Me,e[96]=Ge):Ge=e[96],Ge}function hl(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 gl(t){return t.stopPropagation()}function bl(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function jl(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function vl(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(pt,{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(nn,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function Sl(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(pt,{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(nn,{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(ut,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function yl(t){const e=N.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null&&n>0?new Date(n):null,d=a&&!Number.isNaN(a.getTime());s=d?a.toISOString().split("T")[0]:null,i=d?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(Ro,{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 wl(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(rn,{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 Nl(t){const e=N.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=dt(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(ft,{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(sr,{size:16,className:"text-muted-foreground"}):o.jsx(xr,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function Pt(t){const e=N.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=R("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 Cl(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 kl(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Il(t){const e=N.c(32),{className:n}=t,s=Ke(),i=gs(),r=ml(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=ne(),d=q();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(S=>r[S.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let x;e[4]!==n?(x=R("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let p;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let S;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(S=(y,v)=>{const w=r?.[y.name],C=f!==-1&&v>f&&w?.status==="pending",_=v===s.length-1;return o.jsx(xl,{step:y,index:v,isSelected:y.name===i,executionStatus:w,isSkipped:C,isLastStep:_,onSelect:()=>l(y.name),onDelete:()=>c(y.name),onDuplicate:()=>a(y.name)},y.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]=S):S=e[21],p=s.map(S),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=p}else p=e[13];let h;e[22]!==p?(h=o.jsx("div",{className:"pt-3 -space-y-1",children:p}),e[22]=p,e[23]=h):h=e[23];let g;e[24]!==d?(g=d?null:o.jsx(_l,{}),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:m,children:o.jsx("div",{className:x,children:b})}),e[29]=x,e[30]=b,e[31]=j):j=e[31],j}function _l(){const t=N.c(8),{addToolStep:e}=ne();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(Xn,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(X,{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 El(){const t=N.c(14),{org:e}=Z(),n=Je();let s;t[0]!==e.id||t[1]!==n?(s=n??Ue(e.id),t[0]=e.id,t[1]=n,t[2]=s):s=t[2];const i=s;let r;t[3]!==e.id||t[4]!==i?(r={connectionId:i,orgId:e.id},t[3]=e.id,t[4]=i,t[5]=r):r=t[5];const l=ie(r);let c;t[6]!==l?(c={client:l},t[6]=l,t[7]=c):c=t[7];const a=Qt(c);let d;t[8]!==a.data?.tools?(d=a.data?.tools??[],t[8]=a.data?.tools,t[9]=d):d=t[9];let u;return t[10]!==d||t[11]!==a.error||t[12]!==a.isLoading?(u={tools:d,isLoading:a.isLoading,error:a.error},t[10]=d,t[11]=a.error,t[12]=a.isLoading,t[13]=u):u=t[13],u}function Tl(t){const e=N.c(2),{className:n}=t;let s;return e[0]!==n?(s=o.jsx($l,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function $l(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=El(),l=qe(),{updateStep:c}=ne(),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=w=>w.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 m=fi(s,u??null,Rl,Ol);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 p=x;if(i){let v;e[8]!==n?(v=R("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=v):v=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(mt,{size:"sm"})}),e[10]=w):w=e[10];let C;return e[11]!==v?(C=o.jsx("div",{className:v,children:w}),e[11]=v,e[12]=C):C=e[12],C}if(r){let v;e[13]!==n?(v=R("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=v):v=e[14];let w;e[15]!==r.message?(w=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]=w):w=e[16];let C;return e[17]!==v||e[18]!==w?(C=o.jsx("div",{className:v,children:w}),e[17]=v,e[18]=w,e[19]=C):C=e[19],C}let h;e[20]!==n?(h=R("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]!==p||e[26]!==m||e[27]!==d){let v;e[29]!==p||e[30]!==d?(v=w=>o.jsx(Al,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=v):v=e[31],j=m.map(v),e[25]=p,e[26]=m,e[27]=d,e[28]=j}else j=e[28];let S;e[32]!==j?(S=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=S):S=e[33];let y;return e[34]!==h||e[35]!==b||e[36]!==S?(y=o.jsxs("div",{className:h,children:[b,S]}),e[34]=h,e[35]=b,e[36]=S,e[37]=y):y=e[37],y}function Ol(t,e){return t.name.localeCompare(e.name)}function Rl(t){return t.name}function Al(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=R("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(ft,{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 m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let x;e[11]!==f||e[12]!==m?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=x):x=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(p=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]=p):p=e[19],p}var ae="Accordion",Ml=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[un,Pl,Ll]=mo(ae),[bt]=Pn(ae,[Ll,Zn]),fn=Zn(),Ms=K.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(un.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(Fl,{...r,ref:e}):o.jsx(Wl,{...i,ref:e})})});Ms.displayName=ae;var[Ps,Dl]=bt(ae),[Ls,zl]=bt(ae,{collapsible:!1}),Wl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=Vt({prop:n,defaultProp:s??"",onChange:i,caller:ae});return o.jsx(Ps,{scope:t.__scopeAccordion,value:K.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:K.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(Ls,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(Ds,{...l,ref:e})})})}),Fl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=Vt({prop:n,defaultProp:s??[],onChange:i,caller:ae}),a=K.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=K.useCallback(u=>c((f=[])=>f.filter(m=>m!==u)),[c]);return o.jsx(Ps,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(Ls,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(Ds,{...r,ref:e})})})}),[Hl,jt]=bt(ae),Ds=K.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=K.useRef(null),a=Mn(c,e),d=Pl(n),f=po(i)==="ltr",m=de(t.onKeyDown,x=>{if(!Ml.includes(x.key))return;const p=x.target,h=d().filter(_=>!_.ref.current?.disabled),g=h.findIndex(_=>_.ref.current===p),b=h.length;if(g===-1)return;x.preventDefault();let j=g;const S=0,y=b-1,v=()=>{j=g+1,j>y&&(j=S)},w=()=>{j=g-1,j<S&&(j=y)};switch(x.key){case"Home":j=S;break;case"End":j=y;break;case"ArrowRight":r==="horizontal"&&(f?v():w());break;case"ArrowDown":r==="vertical"&&v();break;case"ArrowLeft":r==="horizontal"&&(f?w():v());break;case"ArrowUp":r==="vertical"&&w();break}const C=j%b;h[C].ref.current?.focus()});return o.jsx(Hl,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(un.Slot,{scope:n,children:o.jsx(Ht.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:m})})})}),at="AccordionItem",[Vl,mn]=bt(at),zs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=jt(at,n),l=Dl(at,n),c=fn(n),a=fo(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(Vl,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(rr,{"data-orientation":r.orientation,"data-state":Bs(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});zs.displayName=at;var Ws="AccordionHeader",Fs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Ws,n);return o.jsx(Ht.h3,{"data-orientation":i.orientation,"data-state":Bs(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});Fs.displayName=Ws;var Ft="AccordionTrigger",Hs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Ft,n),l=zl(Ft,n),c=fn(n);return o.jsx(un.ItemSlot,{scope:n,children:o.jsx(or,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});Hs.displayName=Ft;var Vs="AccordionContent",Us=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Vs,n),l=fn(n);return o.jsx(ir,{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}})});Us.displayName=Vs;function Bs(t){return t?"open":"closed"}var Ul=Ms,Bl=zs,ql=Fs,Kl=Hs,Jl=Us;function Gl(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(Ul,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function Xl(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=R("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(Bl,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Zl(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=R("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(ur,{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(ql,{className:"flex",children:o.jsxs(Kl,{"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 Ql(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=R("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(Jl,{"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 Yl(t){const{updateStep:e}=ne(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=pn(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function ec(t){const e=N.c(48),{className:n}=t,s=qe(),{appendStep:i}=ne();Yl(s);const r=q(),{item:l}=fe(r);if(!s){let $;e[0]!==n?($=R("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=$):$=e[1];let A;e[2]!==i?(A=()=>{i({type:"tool"})},e[2]=i,e[3]=A):A=e[3];let W;e[4]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx(Xn,{size:14}),e[4]=W):W=e[4];let T;e[5]!==A?(T=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(X,{variant:"ghost",size:"icon",className:"size-7",onClick:A,children:W})]}),e[5]=A,e[6]=T):T=e[6];let M;return e[7]!==$||e[8]!==T?(M=o.jsx("div",{className:$,children:T}),e[7]=$,e[8]=T,e[9]=M):M=e[9],M}const c=s?.name;let a;e[10]!==l?.completed_steps?.error?(a=l?.completed_steps?.error??[],e[10]=l?.completed_steps?.error,e[11]=a):a=e[11];const d=a;let u;if(e[12]!==c||e[13]!==d){let $;e[15]!==c?($=A=>A===c||A.startsWith(`${c}[`),e[15]=c,e[16]=$):$=e[16],u=d.some($),e[12]=c,e[13]=d,e[14]=u}else u=e[14];const f=u,m=l?.status==="error"||l?.status==="failed";let x;e[17]!==c||e[18]!==m||e[19]!==l?.running_steps?(x=m&&l?.running_steps?.includes(c??""),e[17]=c,e[18]=m,e[19]=l?.running_steps,e[20]=x):x=e[20];const p=x,h=!!(l?.completed_steps?.success?.some($=>$.name===c)||f||p),g=f||p;let b;e[21]!==n?(b=R("flex flex-col h-full bg-sidebar overflow-scroll",n),e[21]=n,e[22]=b):b=e[22];let j,S;e[23]!==s?(j=o.jsx(tc,{step:s}),S=o.jsx(sc,{step:s}),e[23]=s,e[24]=j,e[25]=S):(j=e[24],S=e[25]);const y=`${c}-${h?"open":"closed"}`;let v;e[26]!==l||e[27]!==g?(v=g&&l?.error!=null?typeof l.error=="string"?l.error:JSON.stringify(l.error):void 0,e[26]=l,e[27]=g,e[28]=v):v=e[28];let w;e[29]!==s||e[30]!==h||e[31]!==g||e[32]!==y||e[33]!==v?(w=o.jsx(rc,{step:s,defaultOpen:h,isStepErrored:g,executionError:v},y),e[29]=s,e[30]=h,e[31]=g,e[32]=y,e[33]=v,e[34]=w):w=e[34];let C;e[35]!==s||e[36]!==r?(C=!r&&o.jsx(uc,{step:s}),e[35]=s,e[36]=r,e[37]=C):C=e[37];let _;e[38]!==s||e[39]!==r?(_=!r&&o.jsx(pc,{step:s}),e[38]=s,e[39]=r,e[40]=_):_=e[40];let I;return e[41]!==C||e[42]!==_||e[43]!==b||e[44]!==j||e[45]!==S||e[46]!==w?(I=o.jsxs("div",{className:b,children:[j,S,w,C,_]}),e[41]=C,e[42]=_,e[43]=b,e[44]=j,e[45]=S,e[46]=w,e[47]=I):I=e[47],I}function tc(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=q(),l=i??"";let c;e[0]!==l?(c=o.jsx(ft,{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(nc,{}),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 m;return e[12]!==u||e[13]!==f?(m=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]=m):m=e[14],m}function nc(){const t=N.c(9),e=qe(),{updateStep:n,startReplacingTool:s}=ne(),i=q(),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){On.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(fs,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(X,{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 pn(t){const e=N.c(16),{org:n}=Z(),s=Je();let i;e[0]!==n.id||e[1]!==s?(i=s??Ue(n.id),e[0]=n.id,e[1]=s,e[2]=i):i=e[2];const r=i;let l;e[3]!==n.id||e[4]!==r?(l={connectionId:r,orgId:n.id},e[3]=n.id,e[4]=r,e[5]=l):l=e[5];const c=ie(l);let a;e[6]!==c?(a={client:c},e[6]=c,e[7]=a):a=e[7];const d=Qt(a);let u;e[8]!==t||e[9]!==d.data?.tools?(u=d.data?.tools?.find(x=>x.name===t),e[8]=t,e[9]=d.data?.tools,e[10]=u):u=e[10];const f=u;let m;return e[11]!==f||e[12]!==d.error||e[13]!==d.isLoading||e[14]!==d.isSuccess?(m={tool:f,isLoading:d.isLoading,isReady:d.isSuccess,error:d.error},e[11]=f,e[12]=d.error,e[13]=d.isLoading,e[14]=d.isSuccess,e[15]=m):m=e[15],m}function sc(t){const e=N.c(18),{step:n}=t,{updateStep:s}=ne(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=q(),{tool:c}=pn(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?oc(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,m=l?"output":"input";let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Zl,{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 p=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 S;e[9]!==d||e[10]!==p||e[11]!==h||e[12]!==g||e[13]!==b?(S=o.jsxs(Xl,{value:"input",className:"border-b-0",children:[x,o.jsx(Ql,{className:"px-5 pt-2",children:o.jsx(As,{readOnly:h,inputSchema:g,inputParams:b,setInputParams:d,mentions:j},p)})]}),e[9]=d,e[10]=p,e[11]=h,e[12]=g,e[13]=b,e[14]=S):S=e[14];let y;return e[15]!==S||e[16]!==m?(y=o.jsx(Gl,{type:"single",collapsible:!0,defaultValue:m,className:"border-b border-border shrink-0",children:S}),e[15]=S,e[16]=m,e[17]=y):y=e[17],y}function oc(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function rc(t){const e=N.c(42),{step:n,defaultOpen:s,isStepErrored:i,executionError:r}=t,l=n.outputSchema,c=q(),{item:a}=fe(c),d=a?.completed_steps?.error??[];let u;e[0]!==n.name?(u=D=>D===n.name||D.startsWith(`${n.name}[`),e[0]=n.name,e[1]=u):u=e[1];const f=d.some(u),x=(a?.status==="error"||a?.status==="failed")&&a?.running_steps?.includes(n.name),p=!!(a?.completed_steps?.success?.some(D=>D.name===n.name)||f||x),[h,g]=k.useState(s),b=n.forEach!==void 0,[j,S]=k.useState("all"),y=b?new RegExp(`^${n.name}\\[(\\d+)\\]$`):null,v=b?(a?.completed_steps?.success??[]).filter(D=>y.test(D.name)).map(D=>{const We=D.name.match(y);return{index:Number(We[1]),status:"success"}}):[],C=(b?d.filter(D=>y.test(D)):[]).map(D=>{const We=D.match(y);return{index:Number(We[1]),status:"error"}}),_=[...v,...C].sort(lc),I=_.length>0,$=b&&j!=="all"?`${n.name}[${j}]`:void 0,A=p?n.name:void 0,W=$??A,{output:T,error:M}=js(c,W);let H;e[2]!==M||e[3]!==r||e[4]!==i||e[5]!==T?(H=T||(M?{error:M}:i&&r?{error:r}:void 0),e[2]=M,e[3]=r,e[4]=i,e[5]=T,e[6]=H):H=e[6];const F=H,B=l&&typeof l=="object"?l.properties:void 0;let V;e[7]!==B?(V=B?Object.entries(B):[],e[7]=B,e[8]=V):V=e[8];const z=V,Q=j!=="all"&&C.some(D=>D.index===j),se=j==="all"?i||f||x:Q,ee=h?"flex-1 min-h-0 overflow-hidden":"shrink-0";let U;e[9]!==ee?(U=R("flex flex-col border-b border-border",ee),e[9]=ee,e[10]=U):U=e[10];let J;e[11]!==h||e[12]!==g?(J=()=>g(!h),e[11]=h,e[12]=g,e[13]=J):J=e[13];const E=se?"text-destructive":"text-muted-foreground";let O;e[14]!==E?(O=R("text-sm font-medium",E),e[14]=E,e[15]=O):O=e[15];const P=se?"Error":"Output";let Y;e[16]!==O||e[17]!==P?(Y=o.jsx("h3",{className:O,children:P}),e[16]=O,e[17]=P,e[18]=Y):Y=e[18];let le;e[19]!==h?(le=h?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"}),e[19]=h,e[20]=le):le=e[20];let oe;e[21]!==Y||e[22]!==le?(oe=o.jsxs("div",{className:"flex items-center justify-between",children:[Y,le]}),e[21]=Y,e[22]=le,e[23]=oe):oe=e[23];let ce;e[24]!==oe||e[25]!==J?(ce=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:J,children:oe}),e[24]=oe,e[25]=J,e[26]=ce):ce=e[26];let te;e[27]!==_||e[28]!==F||e[29]!==I||e[30]!==b||e[31]!==h||e[32]!==z||e[33]!==j||e[34]!==S||e[35]!==n.name||e[36]!==c?(te=h&&o.jsxs(o.Fragment,{children:[c&&b&&I&&o.jsx(cc,{iterations:_,selectedIteration:j,onSelect:S}),c&&F?o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Le,{code:JSON.stringify(F,null,2),language:"json",height:"100%",readOnly:!0},`output-${n.name}-${j}`)}):null,!c&&z.length>0&&o.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:z.map(ic)})]}),e[27]=_,e[28]=F,e[29]=I,e[30]=b,e[31]=h,e[32]=z,e[33]=j,e[34]=S,e[35]=n.name,e[36]=c,e[37]=te):te=e[37];let G;return e[38]!==ce||e[39]!==te||e[40]!==U?(G=o.jsxs("div",{className:U,children:[ce,te]}),e[38]=ce,e[39]=te,e[40]=U,e[41]=G):G=e[41],G}function ic(t){const[e,n]=t;return o.jsx(dc,{name:e,schema:n},e)}function lc(t,e){return t.index-e.index}function cc(t){const e=N.c(21),{iterations:n,selectedIteration:s,onSelect:i}=t,r=s==="all"?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground";let l;e[0]!==r?(l=R("h-7 px-3 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",r),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==i?(c=()=>i("all"),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==l||e[5]!==c?(a=o.jsx("button",{type:"button",className:l,onClick:c,children:"All Results"}),e[4]=l,e[5]=c,e[6]=a):a=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"w-px h-4 bg-border mx-1"}),e[7]=d):d=e[7];let u;if(e[8]!==n||e[9]!==i||e[10]!==s){let p;e[12]!==i||e[13]!==s?(p=h=>{const g=s===h.index;return o.jsxs("button",{type:"button",className:R("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",g?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(h.index),children:[h.status==="success"?o.jsx(pt,{size:12,className:"text-success"}):o.jsx(nn,{size:12,className:"text-destructive"}),o.jsxs("span",{className:"font-mono",children:["#",h.index]})]},h.index)},e[12]=i,e[13]=s,e[14]=p):p=e[14],u=n.map(p),e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];let f;e[15]!==a||e[16]!==u?(f=o.jsxs("div",{className:"flex w-max items-center gap-2 pb-3",children:[a,d,u]}),e[15]=a,e[16]=u,e[17]=f):f=e[17];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(fr,{orientation:"horizontal"}),e[18]=m):m=e[18];let x;return e[19]!==f?(x=o.jsx("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:o.jsxs(mr,{className:"w-full whitespace-nowrap",children:[f,m]})}),e[19]=f,e[20]=x):x=e[20],x}function ac(t){switch(t){case"string":return{Icon:rs,color:"text-blue-500"};case"number":case"integer":return{Icon:ss,color:"text-blue-500"};case"array":return{Icon:es,color:"text-purple-500"};case"object":return{Icon:Yn,color:"text-orange-500"};case"boolean":return{Icon:os,color:"text-pink-500"};case"null":return{Icon:Ut,color:"text-gray-500"};default:return{Icon:ts,color:"text-muted-foreground"}}}function dc(t){const e=N.c(28),{name:n,schema:s}=t,i=qe(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:y,color:v}=ac(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=y,c=14,a=R(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 m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=x):x=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(as,{size:14,className:"opacity-50"}),e[16]=p):p=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:[p,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let S;return e[24]!==j||e[25]!==u||e[26]!==x?(S=o.jsxs("div",{className:u,children:[x,j]}),e[24]=j,e[25]=u,e[26]=x,e[27]=S):S=e[27],S}function uc(t){const e=N.c(29),{step:n}=t,{updateStep:s}=ne(),i=q(),[r,l]=k.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=pn(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
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 Rt(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...so,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const hs=k.createContext(null),Ur=t=>ln()(xs(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??Rt(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:Ot(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 m=r.steps.find(x=>x.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=Rt("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Hr(a,"Input"),m=d.action,x=Vr(m.code,f);d={...d,action:{...m,code:x}}}const u=Ot(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=Rt("tool",Number((Math.random()*1e6).toFixed(0)));const i=Ot(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:ps(()=>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 Br(t){const e=N.c(11),{children:n,initialState:s}=t,i=Gn(),{org:r}=Z();let l;e[0]!==r||e[1]!==i?.[0]?.id?(l=i?.[0]?.id??Ue(r.id),e[0]=r,e[1]=i?.[0]?.id,e[2]=l):l=e[2];const c=l;let a;e[3]!==c||e[4]!==s.currentStepTab||e[5]!==s.trackingExecutionId||e[6]!==s.workflow?(a=()=>Ur({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:c,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[3]=c,e[4]=s.currentStepTab,e[5]=s.trackingExecutionId,e[6]=s.workflow,e[7]=a):a=e[7];const[d]=k.useState(a);let u;return e[8]!==n||e[9]!==d?(u=o.jsx(hs.Provider,{value:d,children:n}),e[8]=n,e[9]=d,e[10]=u):u=e[10],u}function Be(t,e){const n=k.useContext(hs);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return zr(n,t,Fr)}function De(){return Be(qr)}function qr(t){return t.workflow}function ne(){return Be(Kr)}function Kr(t){return t.actions}function gs(){const t=Ke();return Be(Jr)??t[0]?.name}function Jr(t){return t.currentStepName}function qe(){const t=N.c(5),e=gs(),n=Ke();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 Ke(){return De().steps}function Wt(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(!Wt(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)||!Wt(n[l],s[l]))return!1;return!0}return!1}function bs(){const t=N.c(5),e=De();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=qs(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=Wt(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function q(){return Be(Gr)}function Gr(t){return t.trackingExecutionId}function Je(){return Be(Xr)}function Xr(t){return t.selectedVirtualMcpId}function Zr(t){const e=N.c(23),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=Gn()??[],{org:a}=Z();let d;e[0]!==a.id?(d=Ue(a.id),e[0]=a.id,e[1]=d):d=e[1];const u=d,f=c.filter(Yr),m=Hn,x=n??u;let p;e[2]!==s?(p=C=>s(C===""?void 0:C),e[2]=s,e[3]=p):p=e[3];let h;e[4]!==i?(h=R("text-xs",i),e[4]=i,e[5]=h):h=e[5];let g;e[6]!==l?(g=o.jsx(Un,{placeholder:l}),e[6]=l,e[7]=g):g=e[7];let b;e[8]!==h||e[9]!==g?(b=o.jsx(Vn,{size:"sm",className:h,children:g}),e[8]=h,e[9]=g,e[10]=b):b=e[10];const j=Bn;let S;e[11]!==u?(S=o.jsx(tt,{value:u,children:"All tools (Decopilot)"}),e[11]=u,e[12]=S):S=e[12];const y=f.map(Qr);let v;e[13]!==j||e[14]!==S||e[15]!==y?(v=o.jsxs(j,{children:[S,y]}),e[13]=j,e[14]=S,e[15]=y,e[16]=v):v=e[16];let w;return e[17]!==m||e[18]!==v||e[19]!==x||e[20]!==p||e[21]!==b?(w=o.jsxs(m,{value:x,onValueChange:p,children:[b,v]}),e[17]=m,e[18]=v,e[19]=x,e[20]=p,e[21]=b,e[22]=w):w=e[22],w}function Qr(t){return o.jsx(tt,{value:t.id,children:t.title},t.id)}function Yr(t){return t.id!==null&&!bo(t.id)}function ze(){const t=N.c(2),e=$o();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=Go(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}function fe(t){const e=N.c(12),{org:n}=Z(),s=ze();let i;e[0]!==s.id||e[1]!==n.id?(i={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=i):i=e[2];const r=ie(i);let l;e[3]!==t?(l={id:t},e[3]=t,e[4]=l):l=e[4];const c=!!t;let a;e[5]!==r||e[6]!==l||e[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:l,enabled:c,select:ei},e[5]=r,e[6]=l,e[7]=c,e[8]=a):a=e[8];const{data:d,isLoading:u}=Yt(a),f=d?.item;let m;return e[9]!==u||e[10]!==f?(m={item:f,isLoading:u},e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function ei(t){return t.structuredContent??t}function js(t,e,n){const s=N.c(14),{org:i}=Z(),r=ze();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ie(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];let u;s[6]!==c||s[7]!==a||s[8]!==d?(u={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,select:ti},s[6]=c,s[7]=a,s[8]=d,s[9]=u):u=s[9];const{data:f,isLoading:m}=Yt(u),x=f?.output,p=f?.error;let h;return s[10]!==m||s[11]!==x||s[12]!==p?(h={output:x,error:p,isLoading:m},s[10]=m,s[11]=x,s[12]=p,s[13]=h):h=s[13],h}function ti(t){return t.structuredContent??t}function ni(){const t=N.c(19),{org:e}=Z(),n=ze(),s=De();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=ie(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:si},t[9]=r,t[10]=d,t[11]=u,t[12]=f):f=t[12];const{data:m,isLoading:x,refetch:p}=Yt(f);let h;t[13]!==m?.items?(h=m?.items??[],t[13]=m?.items,t[14]=h):h=t[14];let g;return t[15]!==x||t[16]!==p||t[17]!==h?(g={executions:h,isLoading:x,refetch:p},t[15]=x,t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function si(t){return t.structuredContent??t}function vs(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 oi(t){const e=[];for(const n of t){const s=vs(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function ri(t){for(const e of t)if(vs(e.input).includes("__entire_input__"))return!0;return!1}function ii(t){const e=oi(t);if(e.length===0)return ri(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 li(){const t=N.c(2),e=De();let n;return t[0]!==e.steps?(n=ii(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function ci(){const t=N.c(16),{org:e}=Z(),{id:n}=ze(),{setTrackingExecutionId:s}=ne(),i=De(),r=Je(),l=li();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=ie(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=en(d);let m;t[5]!==e.id||t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==i?(m=async g=>{const b=g===void 0?{}:g,j=r??Ue(e.id),S=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:j,start_at_epoch_ms:S,workflow_collection_id:i.id}}),w=(y.structuredContent??y)?.item?.id??void 0;return s(w),w},t[5]=e.id,t[6]=r,t[7]=s,t[8]=u,t[9]=i,t[10]=m):m=t[10];const x=m,p=l!==null;let h;return t[11]!==x||t[12]!==l||t[13]!==f||t[14]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[11]=x,t[12]=l,t[13]=f,t[14]=p,t[15]=h):h=t[15],h}function ai(){const t=N.c(10),{org:e}=Z(),{id:n}=ze();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=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=en(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 di(){const t=N.c(10),{org:e}=Z(),{id:n}=ze();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=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=en(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.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 ui(){const t=N.c(3),e=q(),{item:n}=fe(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 fi(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 cn=Mr()(xs(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"})),Ss=k.createContext([]);function ys(){return k.useContext(Ss)}function mi({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Ho;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 ws(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>mi({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function kn(t,e){const n=ws(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var pi=Do.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",Xe(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=kn(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Xe({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Xe({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Xe({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Fo({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:kn(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 Wo,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 ws(this).map(zo)}}),xi=pi,At,xt="HoverCard",[Ns]=Pn(xt,[An]),ht=An(),[hi,gt]=Ns(xt),Cs=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=ht(e),d=k.useRef(0),u=k.useRef(0),f=k.useRef(!1),m=k.useRef(!1),[x,p]=Vt({prop:s,defaultProp:i??!1,onChange:r,caller:xt}),h=k.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=k.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=k.useCallback(()=>p(!1),[p]);return k.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(hi,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(io,{...a,children:n})})};Cs.displayName=xt;var ks="HoverCardTrigger",Is=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=gt(ks,n),r=ht(n);return o.jsx(oo,{asChild:!0,...r,children:o.jsx(Ht.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:de(t.onPointerEnter,ct(i.onOpen)),onPointerLeave:de(t.onPointerLeave,ct(i.onClose)),onFocus:de(t.onFocus,i.onOpen),onBlur:de(t.onBlur,i.onClose),onTouchStart:de(t.onTouchStart,l=>l.preventDefault())})})});Is.displayName=ks;var an="HoverCardPortal",[gi,bi]=Ns(an,{forceMount:void 0}),_s=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=gt(an,e);return o.jsx(gi,{scope:e,forceMount:n,children:o.jsx(Rn,{present:n||r.open,children:o.jsx(ro,{asChild:!0,container:i,children:s})})})};_s.displayName=an;var lt="HoverCardContent",Es=k.forwardRef((t,e)=>{const n=bi(lt,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=gt(lt,t.__scopeHoverCard);return o.jsx(Rn,{present:s||r.open,children:o.jsx(ji,{"data-state":r.open?"open":"closed",...i,onPointerEnter:de(t.onPointerEnter,ct(r.onOpen)),onPointerLeave:de(t.onPointerLeave,ct(r.onClose)),ref:e})})});Es.displayName=lt;var ji=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=gt(lt,n),d=ht(n),u=k.useRef(null),f=Mn(e,u),[m,x]=k.useState(!1);return k.useEffect(()=>{if(m){const p=document.body;return At=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=At,p.style.webkitUserSelect=At}}},[m]),k.useEffect(()=>{if(u.current){const p=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),k.useEffect(()=>{u.current&&yi(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(lo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:de(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(co,{...d,...c,onPointerDown:de(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"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)"}})})}),vi="HoverCardArrow",Si=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=ht(n);return o.jsx(ao,{...i,...s,ref:e})});Si.displayName=vi;function ct(t){return e=>e.pointerType==="touch"?void 0:t()}function yi(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 wi=Cs,Ni=Is,Ci=_s,ki=Es;function Ii(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(wi,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function _i(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(Ni,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Ei(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=R("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(Ci,{"data-slot":"hover-card-portal",children:o.jsx(ki,{"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 Ts=k.createContext(void 0);function Ti(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 $i(t){const e=N.c(20),{node:n}=t,s=k.useContext(Ts),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?Ti(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(vn,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(_i,{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 m;e[12]!==c?(m=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]=m):m=e[13];let x;e[14]!==f||e[15]!==m?(x=o.jsx(Ei,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=x):x=e[16];let p;return e[17]!==u||e[18]!==x?(p=o.jsx(vn,{as:"span",children:o.jsxs(Ii,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function $s(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 ue=Os();function Os(){return ln(()=>({items:[],selectedIndex:0,command:null}))}function In(t,e){ue.setState({items:t,command:e,selectedIndex:0})}function Oi(){const{items:t,selectedIndex:e}=ue.getState();t.length&&ue.setState({selectedIndex:(e-1+t.length)%t.length})}function Ri(){const{items:t,selectedIndex:e}=ue.getState();t.length&&ue.setState({selectedIndex:(e+1)%t.length})}function Rs(){const{items:t,selectedIndex:e,command:n}=ue.getState(),s=t[e];return s?(n?.(s),!0):!1}function _n(){ue=Os()}function Ai(){const t=N.c(7),e=Dt(ue,Pi),n=Dt(ue,Mi);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:()=>{ue.setState({selectedIndex:c}),Rs()},className:R("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 Mi(t){return t.selectedIndex}function Pi(t){return t.items}function Li(){let t=null,e=null;return{onStart:n=>{In(n.items,n.command),t=new qo(Ai,{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=>{In(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(),_n(),!0):n.key==="ArrowUp"?(Oi(),!0):n.key==="ArrowDown"?(Ri(),!0):n.key==="Enter"?Rs():!1,onExit:()=>{e?.remove(),t?.destroy(),_n()}}}const Mt=/@([\w.]+)/g;function Di(t,e){if(!t)return null;const n=$s(e),s=new Map(n.map(a=>[a.id,a]));if(!Mt.test(t))return t;Mt.lastIndex=0;const r=[];let l=0,c;for(;(c=Mt.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 dn(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=ui();let d;e[0]!==n||e[1]!==s?(d=Di(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=Vo.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let p;if(e[4]!==n||e[5]!==f){let I;e[7]!==n?(I=$=>{const{query:A}=$;return $s(n).filter(T=>T.label.toLowerCase().includes(A.toLowerCase())||T.id.toLowerCase().includes(A.toLowerCase()))},e[7]=n,e[8]=I):I=e[8],p=xi.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Hi,renderHTML:Fi,suggestion:{items:I,render:Li,command:Wi}}).extend(f?{addNodeView(){return Uo($i)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let h;e[9]!==p?(h=[x,p],e[9]=p,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:zi},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=I=>{const{editor:$}=I;return i?.($.getText().trim())},e[13]=i,e[14]=j):j=e[14];let S;e[15]!==u||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==j?(S={content:u,editable:m,extensions:h,editorProps:b,onUpdate:j},e[15]=u,e[16]=m,e[17]=h,e[18]=b,e[19]=j,e[20]=S):S=e[20];const y=Bo(S);let v;e[21]!==l?(v=R("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 w;e[23]!==y?(w=o.jsx(Ko,{editor:y}),e[23]=y,e[24]=w):w=e[24];let C;e[25]!==v||e[26]!==w?(C=o.jsx("div",{className:v,children:w}),e[25]=v,e[26]=w,e[27]=C):C=e[27];const _=C;if(a!==void 0){let I;return e[28]!==_||e[29]!==a?(I=o.jsx(Ts.Provider,{value:a,children:_}),e[28]=_,e[29]=a,e[30]=I):I=e[30],I}return _}function zi(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Wi(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function Fi(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Hi(t){const{node:e}=t;return`@${e.attrs.id}`}function Vi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ys(),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(dn,{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 Ui(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ys(),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(dn,{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 Bi(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=R("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 qi(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=m=>s(m.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 Ki(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,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=R("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"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let x;e[6]!==a?(x=a.map(Ji),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=p):p=e[13],p}function Ji(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Gi={TextWidget:Vi,TextareaWidget:Ui,NumberWidget:Bi,CheckboxWidget:qi,SelectWidget:Ki};function Xi(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:rs,color:"text-blue-500"};case"number":case"integer":return{Icon:ss,color:"text-blue-500"};case"array":return{Icon:es,color:"text-purple-500"};case"object":return{Icon:Yn,color:"text-orange-500"};case"boolean":return{Icon:os,color:"text-pink-500"};case"null":return{Icon:Ut,color:"text-gray-500"};default:return{Icon:ts,color:"text-muted-foreground"}}}function Zi(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,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:v,color:w}=Xi(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=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,m=R(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else u=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let j;e[24]!==x||e[25]!==p||e[26]!==h||e[27]!==b?(j=o.jsxs("div",{className:x,children:[p,h,b]}),e[24]=x,e[25]=p,e[26]=h,e[27]=b,e[28]=j):j=e[28];let S;e[29]!==r?(S=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=S):S=e[30];let y;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==S?(y=o.jsxs("div",{className:g,children:[j,S,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=S,e[35]=y):y=e[35],y}function Qi(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(el),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(Yi),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 Yi(t){return o.jsx("div",{children:t.content},t.name)}function el(t){return o.jsx("div",{children:t.content},t.name)}function tl(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(nl),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(X,{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 nl(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 sl(){return null}function ol(){return null}const rl={FieldTemplate:Zi,ObjectFieldTemplate:Qi,ArrayFieldTemplate:tl,UnsupportedFieldTemplate:sl,ErrorListTemplate:ol};function il(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??""),m=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:m})]}),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(dn,{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 As({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(il,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=k.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[x,p]of Object.entries(f))m[x]!==p&&s(x,p);for(const x of Object.keys(m))x in f||s(x,void 0)}a.current=f};return o.jsx(Ss.Provider,{value:l,children:o.jsx(Eo,{schema:c,formData:e,onChange:d,validator:To,widgets:Gi,templates:rl,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function ll(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 m;e[5]!==s?(m=_=>{_||d({}),s(_)},e[5]=s,e[6]=m):m=e[6];const x=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(Xo,{children:[o.jsx(Zo,{children:"Workflow Input"}),o.jsx(Qo,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=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(As,{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(X,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let S;e[17]!==l?(S=l?o.jsx(mt,{size:"xs"}):o.jsx(Zt,{size:14}),e[17]=l,e[18]=S):S=e[18];let y;e[19]!==f||e[20]!==l||e[21]!==S?(y=o.jsxs(X,{onClick:f,disabled:l,className:"gap-2",children:[S,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=S,e[22]=y):y=e[22];let v;e[23]!==y||e[24]!==j?(v=o.jsxs(Yo,{children:[j,y]}),e[23]=y,e[24]=j,e[25]=v):v=e[25];let w;e[26]!==v||e[27]!==g?(w=o.jsxs(er,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,v]}),e[26]=v,e[27]=g,e[28]=w):w=e[28];let C;return e[29]!==x||e[30]!==n||e[31]!==w?(C=o.jsx(tr,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=C):C=e[32],C}function cl(t){const e=N.c(25),{title:n,description:s,onSave:i,isSaving:r}=t,{viewMode:l,setViewMode:c,showExecutionsList:a,toggleExecutionsList:d}=cn(),{resetToOriginalWorkflow:u,setSelectedVirtualMcpId:f}=ne(),m=bs(),x=Je(),p=q();let h;e[0]!==n?(h=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=h):h=e[1];let g;e[2]!==s?(g=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]=g):g=e[3];let b;e[4]!==h||e[5]!==g?(b=o.jsx(Wn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h,g]})}),e[4]=h,e[5]=g,e[6]=b):b=e[6];let j;e[7]!==m||e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==x||e[12]!==f||e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==p||e[17]!==l?(j=!p&&o.jsxs(o.Fragment,{children:[o.jsx(Fn,{onSave:i,onUndo:u,isDirty:m,isSaving:r,saveLabel:"Save workflow",undoLabel:"Reset changes"}),o.jsx(k.Suspense,{fallback:o.jsx(mt,{size:"xs"}),children:o.jsx(Zr,{selectedVirtualMcpId:x,onVirtualMcpChange:f,placeholder:"Select Agent"})}),o.jsx(Lo,{value:l,onValueChange:c,size:"sm",options:[{value:"visual",icon:o.jsx(us,{})},{value:"code",icon:o.jsx(cs,{})}]}),o.jsx(Xt,{children:o.jsxs(nt,{delayDuration:0,children:[o.jsx(st,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(X,{variant:a?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:d,"aria-label":a?"Hide runs":"Show runs",children:o.jsx(ls,{size:14})})})}),o.jsx(ot,{side:"bottom",children:a?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=r,e[9]=i,e[10]=u,e[11]=x,e[12]=f,e[13]=c,e[14]=a,e[15]=d,e[16]=p,e[17]=l,e[18]=j):j=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ul,{}),e[19]=S):S=e[19];let y;e[20]!==j?(y=o.jsxs(zn,{children:[j,S]}),e[20]=j,e[21]=y):y=e[21];let v;return e[22]!==b||e[23]!==y?(v=o.jsxs(o.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=v):v=e[24],v}function al(){const t=q(),{item:e}=fe(t);return e?.completed_at_epoch_ms!=null}function dl(){const t=q(),{item:e}=fe(t);return e?.status==="cancelled"}function ul(){const t=N.c(58),e=bs(),n=al(),s=dl(),i=q(),r=Je(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=ci(),u=Ke(),[f,m]=k.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=ai(),{handleResumeWorkflow:h,isResuming:g}=di(),b=i&&!n;let j;t[0]!==u?(j=u.some(fl),t[0]=u,t[1]=j):j=t[1];const S=j,y=!r,v=u.length===0,w=e||v||S||y||c||p,C=b||c;let _;t[2]!==S||t[3]!==y||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":y?"Select an Agent first":v||S?"Add at least one step to the workflow":null,t[2]=S,t[3]=y,t[4]=e,t[5]=s,t[6]=C,t[7]=v,t[8]=_):_=t[8];const $=_();let A;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==C||t[15]!==a||t[16]!==i?(A=async()=>{if(a&&d){m(!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]=A):A=t[17];const W=A;let T;t[18]!==l?(T=async P=>{await l(P)},t[18]=l,t[19]=T):T=t[19];const M=T,H=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",F=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let B;t[20]!==F?(B=R("gap-2 h-7 px-3",F),t[20]=F,t[21]=B):B=t[21];let V;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(V=(!b&&!c&&!p&&!g||s)&&o.jsx(Zt,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=V):V=t[27];let z;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(z=b&&!c&&!p&&!g&&!s&&o.jsx(Jo,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=z):z=t[33];let Q;t[34]!==p||t[35]!==c||t[36]!==g?(Q=(c||p||g)&&o.jsx(mt,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=Q):Q=t[37];let se;t[38]!==H||t[39]!==W||t[40]!==w||t[41]!==B||t[42]!==V||t[43]!==z||t[44]!==Q?(se=o.jsxs(X,{variant:"default",size:"sm",className:B,disabled:w,onClick:W,children:[V,z,Q,H]}),t[38]=H,t[39]=W,t[40]=w,t[41]=B,t[42]=V,t[43]=z,t[44]=Q,t[45]=se):se=t[45];const ee=se;let U;t[46]!==ee||t[47]!==$?(U=$?o.jsx(Xt,{children:o.jsxs(nt,{delayDuration:0,children:[o.jsx(st,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:ee})}),o.jsx(ot,{side:"bottom",children:$})]})}):ee,t[46]=ee,t[47]=$,t[48]=U):U=t[48];const J=U;let E;t[49]!==M||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(E=a&&d&&o.jsx(ll,{open:f,onOpenChange:m,inputSchema:d,onSubmit:M,isPending:c}),t[49]=M,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=E):E=t[54];let O;return t[55]!==J||t[56]!==E?(O=o.jsxs(o.Fragment,{children:[J,E]}),t[55]=J,t[56]=E,t[57]=O):O=t[57],O}function fl(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function En(t,e){for(const n of e)if(n===t||n.startsWith(`${t}[`))return!0;return!1}function ml(){const t=N.c(13),e=q(),n=Ke(),{item:s}=fe(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.error||t[3]!==s.running_steps||t[4]!==s.status||t[5]!==n){i={};let r;t[7]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(pl)??[]),t[7]=s.completed_steps?.success,t[8]=r):r=t[8];const l=r,c=s.completed_steps?.error??[];let a;t[9]!==s.running_steps?(a=s.running_steps??[],t[9]=s.running_steps,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d,f=s.status,m=s.error!=null?typeof s.error=="string"?s.error:JSON.stringify(s.error):void 0;let x=-1;n.forEach((p,h)=>{(l.has(p.name)||En(p.name,c))&&(x=h)}),n.forEach((p,h)=>{let g="pending",b;En(p.name,c)?(g="error",b=m):l.has(p.name)?g="success":(f==="error"||f==="failed")&&u.has(p.name)?(g="error",b=m):f==="running"&&h===x+1&&(g="running"),i[p.name]={status:g,output:void 0,error:b,stepIndex:h}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.error,t[3]=s.running_steps,t[4]=s.status,t[5]=n,t[6]=i}else i=t[6];return i}function pl(t){return t.name}function xl(t){const e=N.c(97),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=q(),{item:m}=fe(f),x=m?.completed_steps,p=x?.success,h=x?.error??[];let g;e[0]!==n.name||e[1]!==p?(g=p?.find(L=>L.name===n.name),e[0]=n.name,e[1]=p,e[2]=g):g=e[2];const b=g,j=b?.completed_at_epoch_ms,S=b!=null;let y;e[3]!==n.name?(y=L=>L===n.name||L.startsWith(`${n.name}[`),e[3]=n.name,e[4]=y):y=e[4];const v=h.some(y),w="toolName"in n.action,C=w&&"connectionId"in n.action?n.action.connectionId:null,I=!!(w&&"toolName"in n.action?n.action.toolName:null),$=kl(n),W=(m?.status==="error"||m?.status==="failed")&&m?.running_steps?.includes(n.name),T=S?"success":v||W?"error":r?.status,M=r!==void 0,H=T==="success"||T==="error";let F=$.length>0?60:12;(T==="success"||T==="error")&&(F=F+32);const B=bl(T);let V;e[5]!==T?(V=jl(T),e[5]=T,e[6]=V):V=e[6];const z=V;let Q;e[7]===Symbol.for("react.memo_cache_sentinel")?(Q=function(_t,Xs){const hn=Xs.split(".").slice(1);if(hn.length===0)return Array.isArray(_t)?_t:void 0;let xe=_t;for(const Zs of hn){if(xe==null)return;if(typeof xe=="object")xe=xe[Zs];else return}return Array.isArray(xe)?xe:void 0},e[7]=Q):Q=e[7];const se=Q,ee=n.forEach!==void 0,U=n.forEach?.ref;let J;e[8]!==U?(J=U?.replace("@","").split(".")[0],e[8]=U,e[9]=J):J=e[9];const E=J,O=m?.status==="running"||m?.status==="enqueued";let P;e[10]!==p||e[11]!==E?(P=p?.some(L=>L.name===E),e[10]=p,e[11]=E,e[12]=P):P=e[12];const Y=P,le=O?500:!1;let oe;e[13]!==Y||e[14]!==le?(oe={refetchInterval:le,enabled:Y},e[13]=Y,e[14]=le,e[15]=oe):oe=e[15];const{output:ce}=js(f,E,oe);let te;if(e[16]!==ce||e[17]!==U){const L=U?.replace("@","");te=L?se(ce,L):void 0,e[16]=ce,e[17]=U,e[18]=te}else te=e[18];const G=te;let D;if(e[19]!==n.name){let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=/[.*+?^${}()|[\]\\]/g,e[21]=L):L=e[21],D=n.name.replace(L,"\\$&"),e[19]=n.name,e[20]=D}else D=e[20];const We=D,xn=new RegExp(`^${We}\\[\\d+\\]$`),vt=m?.completed_steps?.success?.filter(L=>xn.test(L.name)),Fe=h.filter(L=>xn.test(L)),St=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",yt=T==="running"&&"bg-accent/50",wt=l&&"opacity-50";let ge;e[22]!==St||e[23]!==yt||e[24]!==wt?(ge=R("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",St,yt,wt),e[22]=St,e[23]=yt,e[24]=wt,e[25]=ge):ge=e[25];const Ks="button",Js=0;let be;e[26]!==a?(be=L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),a())},e[26]=a,e[27]=be):be=e[27];const Nt=R("text-xs font-mono opacity-75 h-8 flex items-center",B),Ct=s+1;let je;e[28]!==Nt||e[29]!==Ct?(je=o.jsx("div",{className:"w-5 flex flex-col items-center justify-center shrink-0 pt-3",children:o.jsxs("span",{className:Nt,children:[Ct,"."]})}),e[28]=Nt,e[29]=Ct,e[30]=je):je=e[30];let ve;e[31]!==z||e[32]!==s?(ve=s>0?o.jsx(Pt,{height:12,color:z}):o.jsx("div",{className:"h-3"}),e[31]=z,e[32]=s,e[33]=ve):ve=e[33];let Se;e[34]!==C||e[35]!==I||e[36]!==w||e[37]!==n.name?(Se=o.jsx(Nl,{connectionId:C,isToolStep:w,hasToolSelected:I,stepName:n.name}),e[34]=C,e[35]=I,e[36]=w,e[37]=n.name,e[38]=Se):Se=e[38];let ye;e[39]!==z||e[40]!==H||e[41]!==T?(ye=H&&o.jsxs(o.Fragment,{children:[o.jsx(Pt,{height:8,color:z}),o.jsx(vl,{status:T})]}),e[39]=z,e[40]=H,e[41]=T,e[42]=ye):ye=e[42];let we;e[43]!==z||e[44]!==F||e[45]!==c||e[46]!==f?(we=c&&f?null:o.jsx(Pt,{height:F,color:z}),e[43]=z,e[44]=F,e[45]=c,e[46]=f,e[47]=we):we=e[47];let Ne;e[48]!==ve||e[49]!==Se||e[50]!==ye||e[51]!==we?(Ne=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[ve,Se,ye,we]}),e[48]=ve,e[49]=Se,e[50]=ye,e[51]=we,e[52]=Ne):Ne=e[52];const Gs="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",kt=I?"font-medium text-foreground":"text-foreground";let Ce;e[53]!==kt?(Ce=R("text-sm truncate flex-1",kt),e[53]=kt,e[54]=Ce):Ce=e[54];let ke;e[55]!==n?(ke=Cl(n),e[55]=n,e[56]=ke):ke=e[56];let Ie;e[57]!==Ce||e[58]!==ke?(Ie=o.jsx("span",{className:Ce,children:ke}),e[57]=Ce,e[58]=ke,e[59]=Ie):Ie=e[59];let _e;e[60]!==vt?.length||e[61]!==Fe||e[62]!==ee||e[63]!==G?(_e=ee&&G&&G.length>0&&o.jsxs("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center gap-1",children:[`${(vt?.length??0)+Fe.length} / ${G.length}`,Fe.length>0&&o.jsxs("span",{className:"text-destructive",children:["(",Fe.length," failed)"]})]}),e[60]=vt?.length,e[61]=Fe,e[62]=ee,e[63]=G,e[64]=_e):_e=e[64];let Ee;e[65]!==M||e[66]!==T?(Ee=M&&o.jsx(Sl,{status:T}),e[65]=M,e[66]=T,e[67]=Ee):Ee=e[67];let Te;e[68]!==_e||e[69]!==Ee?(Te=o.jsxs("div",{className:"flex items-center gap-2",children:[_e,Ee]}),e[68]=_e,e[69]=Ee,e[70]=Te):Te=e[70];let $e;e[71]!==M||e[72]!==d||e[73]!==u?($e=!M&&o.jsxs(cr,{children:[o.jsx(ar,{asChild:!0,children:o.jsx(X,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:gl,children:o.jsx(nr,{size:14})})}),o.jsxs(dr,{align:"end",children:[o.jsxs(Sn,{onClick:L=>{L.stopPropagation(),u()},children:[o.jsx(hr,{size:14}),"Duplicate"]}),o.jsxs(Sn,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:L=>{L.stopPropagation(),d()},children:[o.jsx(uo,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[71]=M,e[72]=d,e[73]=u,e[74]=$e):$e=e[74];let Oe;e[75]!==Ie||e[76]!==Te||e[77]!==$e?(Oe=o.jsxs("div",{className:"flex items-center h-8",children:[Ie,Te,$e]}),e[75]=Ie,e[76]=Te,e[77]=$e,e[78]=Oe):Oe=e[78];const It=$.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:$.map(hl)});let Re;e[79]!==T||e[80]!==j?(Re=T==="success"&&o.jsx(yl,{completedAtEpochMs:j}),e[79]=T,e[80]=j,e[81]=Re):Re=e[81];let Ae;e[82]!==r?.error||e[83]!==T?(Ae=T==="error"&&o.jsx(wl,{error:r?.error}),e[82]=r?.error,e[83]=T,e[84]=Ae):Ae=e[84];let Me;e[85]!==Oe||e[86]!==It||e[87]!==Re||e[88]!==Ae?(Me=o.jsxs("div",{className:Gs,children:[Oe,It,Re,Ae]}),e[85]=Oe,e[86]=It,e[87]=Re,e[88]=Ae,e[89]=Me):Me=e[89];let Ge;return e[90]!==a||e[91]!==ge||e[92]!==be||e[93]!==je||e[94]!==Ne||e[95]!==Me?(Ge=o.jsxs("div",{className:ge,onClick:a,role:Ks,tabIndex:Js,onKeyDown:be,children:[je,Ne,Me]}),e[90]=a,e[91]=ge,e[92]=be,e[93]=je,e[94]=Ne,e[95]=Me,e[96]=Ge):Ge=e[96],Ge}function hl(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 gl(t){return t.stopPropagation()}function bl(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function jl(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function vl(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(pt,{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(nn,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function Sl(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(pt,{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(nn,{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(dt,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function yl(t){const e=N.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null&&n>0?new Date(n):null,d=a&&!Number.isNaN(a.getTime());s=d?a.toISOString().split("T")[0]:null,i=d?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(Ro,{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 wl(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(rn,{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 Nl(t){const e=N.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=ut(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(ft,{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(sr,{size:16,className:"text-muted-foreground"}):o.jsx(xr,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function Pt(t){const e=N.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=R("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 Cl(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 kl(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Il(t){const e=N.c(32),{className:n}=t,s=Ke(),i=gs(),r=ml(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=ne(),d=q();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(S=>r[S.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let x;e[4]!==n?(x=R("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let p;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let S;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(S=(y,v)=>{const w=r?.[y.name],C=f!==-1&&v>f&&w?.status==="pending",_=v===s.length-1;return o.jsx(xl,{step:y,index:v,isSelected:y.name===i,executionStatus:w,isSkipped:C,isLastStep:_,onSelect:()=>l(y.name),onDelete:()=>c(y.name),onDuplicate:()=>a(y.name)},y.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]=S):S=e[21],p=s.map(S),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=p}else p=e[13];let h;e[22]!==p?(h=o.jsx("div",{className:"pt-3 -space-y-1",children:p}),e[22]=p,e[23]=h):h=e[23];let g;e[24]!==d?(g=d?null:o.jsx(_l,{}),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:m,children:o.jsx("div",{className:x,children:b})}),e[29]=x,e[30]=b,e[31]=j):j=e[31],j}function _l(){const t=N.c(8),{addToolStep:e}=ne();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(Xn,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(X,{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 El(){const t=N.c(14),{org:e}=Z(),n=Je();let s;t[0]!==e.id||t[1]!==n?(s=n??Ue(e.id),t[0]=e.id,t[1]=n,t[2]=s):s=t[2];const i=s;let r;t[3]!==e.id||t[4]!==i?(r={connectionId:i,orgId:e.id},t[3]=e.id,t[4]=i,t[5]=r):r=t[5];const l=ie(r);let c;t[6]!==l?(c={client:l},t[6]=l,t[7]=c):c=t[7];const a=Qt(c);let d;t[8]!==a.data?.tools?(d=a.data?.tools??[],t[8]=a.data?.tools,t[9]=d):d=t[9];let u;return t[10]!==d||t[11]!==a.error||t[12]!==a.isLoading?(u={tools:d,isLoading:a.isLoading,error:a.error},t[10]=d,t[11]=a.error,t[12]=a.isLoading,t[13]=u):u=t[13],u}function Tl(t){const e=N.c(2),{className:n}=t;let s;return e[0]!==n?(s=o.jsx($l,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function $l(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=El(),l=qe(),{updateStep:c}=ne(),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=w=>w.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 m=fi(s,u??null,Rl,Ol);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 p=x;if(i){let v;e[8]!==n?(v=R("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=v):v=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(mt,{size:"sm"})}),e[10]=w):w=e[10];let C;return e[11]!==v?(C=o.jsx("div",{className:v,children:w}),e[11]=v,e[12]=C):C=e[12],C}if(r){let v;e[13]!==n?(v=R("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=v):v=e[14];let w;e[15]!==r.message?(w=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]=w):w=e[16];let C;return e[17]!==v||e[18]!==w?(C=o.jsx("div",{className:v,children:w}),e[17]=v,e[18]=w,e[19]=C):C=e[19],C}let h;e[20]!==n?(h=R("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]!==p||e[26]!==m||e[27]!==d){let v;e[29]!==p||e[30]!==d?(v=w=>o.jsx(Al,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=v):v=e[31],j=m.map(v),e[25]=p,e[26]=m,e[27]=d,e[28]=j}else j=e[28];let S;e[32]!==j?(S=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=S):S=e[33];let y;return e[34]!==h||e[35]!==b||e[36]!==S?(y=o.jsxs("div",{className:h,children:[b,S]}),e[34]=h,e[35]=b,e[36]=S,e[37]=y):y=e[37],y}function Ol(t,e){return t.name.localeCompare(e.name)}function Rl(t){return t.name}function Al(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=R("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(ft,{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 m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let x;e[11]!==f||e[12]!==m?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=x):x=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(p=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]=p):p=e[19],p}var ae="Accordion",Ml=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[un,Pl,Ll]=mo(ae),[bt]=Pn(ae,[Ll,Zn]),fn=Zn(),Ms=K.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(un.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(Fl,{...r,ref:e}):o.jsx(Wl,{...i,ref:e})})});Ms.displayName=ae;var[Ps,Dl]=bt(ae),[Ls,zl]=bt(ae,{collapsible:!1}),Wl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=Vt({prop:n,defaultProp:s??"",onChange:i,caller:ae});return o.jsx(Ps,{scope:t.__scopeAccordion,value:K.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:K.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(Ls,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(Ds,{...l,ref:e})})})}),Fl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=Vt({prop:n,defaultProp:s??[],onChange:i,caller:ae}),a=K.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=K.useCallback(u=>c((f=[])=>f.filter(m=>m!==u)),[c]);return o.jsx(Ps,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(Ls,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(Ds,{...r,ref:e})})})}),[Hl,jt]=bt(ae),Ds=K.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=K.useRef(null),a=Mn(c,e),d=Pl(n),f=po(i)==="ltr",m=de(t.onKeyDown,x=>{if(!Ml.includes(x.key))return;const p=x.target,h=d().filter(_=>!_.ref.current?.disabled),g=h.findIndex(_=>_.ref.current===p),b=h.length;if(g===-1)return;x.preventDefault();let j=g;const S=0,y=b-1,v=()=>{j=g+1,j>y&&(j=S)},w=()=>{j=g-1,j<S&&(j=y)};switch(x.key){case"Home":j=S;break;case"End":j=y;break;case"ArrowRight":r==="horizontal"&&(f?v():w());break;case"ArrowDown":r==="vertical"&&v();break;case"ArrowLeft":r==="horizontal"&&(f?w():v());break;case"ArrowUp":r==="vertical"&&w();break}const C=j%b;h[C].ref.current?.focus()});return o.jsx(Hl,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(un.Slot,{scope:n,children:o.jsx(Ht.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:m})})})}),at="AccordionItem",[Vl,mn]=bt(at),zs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=jt(at,n),l=Dl(at,n),c=fn(n),a=fo(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(Vl,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(rr,{"data-orientation":r.orientation,"data-state":Bs(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});zs.displayName=at;var Ws="AccordionHeader",Fs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Ws,n);return o.jsx(Ht.h3,{"data-orientation":i.orientation,"data-state":Bs(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});Fs.displayName=Ws;var Ft="AccordionTrigger",Hs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Ft,n),l=zl(Ft,n),c=fn(n);return o.jsx(un.ItemSlot,{scope:n,children:o.jsx(or,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});Hs.displayName=Ft;var Vs="AccordionContent",Us=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=jt(ae,n),r=mn(Vs,n),l=fn(n);return o.jsx(ir,{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}})});Us.displayName=Vs;function Bs(t){return t?"open":"closed"}var Ul=Ms,Bl=zs,ql=Fs,Kl=Hs,Jl=Us;function Gl(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(Ul,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function Xl(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=R("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(Bl,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Zl(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=R("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(ur,{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(ql,{className:"flex",children:o.jsxs(Kl,{"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 Ql(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=R("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(Jl,{"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 Yl(t){const{updateStep:e}=ne(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=pn(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function ec(t){const e=N.c(48),{className:n}=t,s=qe(),{appendStep:i}=ne();Yl(s);const r=q(),{item:l}=fe(r);if(!s){let $;e[0]!==n?($=R("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=$):$=e[1];let A;e[2]!==i?(A=()=>{i({type:"tool"})},e[2]=i,e[3]=A):A=e[3];let W;e[4]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx(Xn,{size:14}),e[4]=W):W=e[4];let T;e[5]!==A?(T=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(X,{variant:"ghost",size:"icon",className:"size-7",onClick:A,children:W})]}),e[5]=A,e[6]=T):T=e[6];let M;return e[7]!==$||e[8]!==T?(M=o.jsx("div",{className:$,children:T}),e[7]=$,e[8]=T,e[9]=M):M=e[9],M}const c=s?.name;let a;e[10]!==l?.completed_steps?.error?(a=l?.completed_steps?.error??[],e[10]=l?.completed_steps?.error,e[11]=a):a=e[11];const d=a;let u;if(e[12]!==c||e[13]!==d){let $;e[15]!==c?($=A=>A===c||A.startsWith(`${c}[`),e[15]=c,e[16]=$):$=e[16],u=d.some($),e[12]=c,e[13]=d,e[14]=u}else u=e[14];const f=u,m=l?.status==="error"||l?.status==="failed";let x;e[17]!==c||e[18]!==m||e[19]!==l?.running_steps?(x=m&&l?.running_steps?.includes(c??""),e[17]=c,e[18]=m,e[19]=l?.running_steps,e[20]=x):x=e[20];const p=x,h=!!(l?.completed_steps?.success?.some($=>$.name===c)||f||p),g=f||p;let b;e[21]!==n?(b=R("flex flex-col h-full bg-sidebar overflow-scroll",n),e[21]=n,e[22]=b):b=e[22];let j,S;e[23]!==s?(j=o.jsx(tc,{step:s}),S=o.jsx(sc,{step:s}),e[23]=s,e[24]=j,e[25]=S):(j=e[24],S=e[25]);const y=`${c}-${h?"open":"closed"}`;let v;e[26]!==l||e[27]!==g?(v=g&&l?.error!=null?typeof l.error=="string"?l.error:JSON.stringify(l.error):void 0,e[26]=l,e[27]=g,e[28]=v):v=e[28];let w;e[29]!==s||e[30]!==h||e[31]!==g||e[32]!==y||e[33]!==v?(w=o.jsx(rc,{step:s,defaultOpen:h,isStepErrored:g,executionError:v},y),e[29]=s,e[30]=h,e[31]=g,e[32]=y,e[33]=v,e[34]=w):w=e[34];let C;e[35]!==s||e[36]!==r?(C=!r&&o.jsx(uc,{step:s}),e[35]=s,e[36]=r,e[37]=C):C=e[37];let _;e[38]!==s||e[39]!==r?(_=!r&&o.jsx(pc,{step:s}),e[38]=s,e[39]=r,e[40]=_):_=e[40];let I;return e[41]!==C||e[42]!==_||e[43]!==b||e[44]!==j||e[45]!==S||e[46]!==w?(I=o.jsxs("div",{className:b,children:[j,S,w,C,_]}),e[41]=C,e[42]=_,e[43]=b,e[44]=j,e[45]=S,e[46]=w,e[47]=I):I=e[47],I}function tc(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=q(),l=i??"";let c;e[0]!==l?(c=o.jsx(ft,{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(nc,{}),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 m;return e[12]!==u||e[13]!==f?(m=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]=m):m=e[14],m}function nc(){const t=N.c(9),e=qe(),{updateStep:n,startReplacingTool:s}=ne(),i=q(),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){On.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(fs,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(X,{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 pn(t){const e=N.c(16),{org:n}=Z(),s=Je();let i;e[0]!==n.id||e[1]!==s?(i=s??Ue(n.id),e[0]=n.id,e[1]=s,e[2]=i):i=e[2];const r=i;let l;e[3]!==n.id||e[4]!==r?(l={connectionId:r,orgId:n.id},e[3]=n.id,e[4]=r,e[5]=l):l=e[5];const c=ie(l);let a;e[6]!==c?(a={client:c},e[6]=c,e[7]=a):a=e[7];const d=Qt(a);let u;e[8]!==t||e[9]!==d.data?.tools?(u=d.data?.tools?.find(x=>x.name===t),e[8]=t,e[9]=d.data?.tools,e[10]=u):u=e[10];const f=u;let m;return e[11]!==f||e[12]!==d.error||e[13]!==d.isLoading||e[14]!==d.isSuccess?(m={tool:f,isLoading:d.isLoading,isReady:d.isSuccess,error:d.error},e[11]=f,e[12]=d.error,e[13]=d.isLoading,e[14]=d.isSuccess,e[15]=m):m=e[15],m}function sc(t){const e=N.c(18),{step:n}=t,{updateStep:s}=ne(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=q(),{tool:c}=pn(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?oc(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,m=l?"output":"input";let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Zl,{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 p=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 S;e[9]!==d||e[10]!==p||e[11]!==h||e[12]!==g||e[13]!==b?(S=o.jsxs(Xl,{value:"input",className:"border-b-0",children:[x,o.jsx(Ql,{className:"px-5 pt-2",children:o.jsx(As,{readOnly:h,inputSchema:g,inputParams:b,setInputParams:d,mentions:j},p)})]}),e[9]=d,e[10]=p,e[11]=h,e[12]=g,e[13]=b,e[14]=S):S=e[14];let y;return e[15]!==S||e[16]!==m?(y=o.jsx(Gl,{type:"single",collapsible:!0,defaultValue:m,className:"border-b border-border shrink-0",children:S}),e[15]=S,e[16]=m,e[17]=y):y=e[17],y}function oc(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function rc(t){const e=N.c(42),{step:n,defaultOpen:s,isStepErrored:i,executionError:r}=t,l=n.outputSchema,c=q(),{item:a}=fe(c),d=a?.completed_steps?.error??[];let u;e[0]!==n.name?(u=D=>D===n.name||D.startsWith(`${n.name}[`),e[0]=n.name,e[1]=u):u=e[1];const f=d.some(u),x=(a?.status==="error"||a?.status==="failed")&&a?.running_steps?.includes(n.name),p=!!(a?.completed_steps?.success?.some(D=>D.name===n.name)||f||x),[h,g]=k.useState(s),b=n.forEach!==void 0,[j,S]=k.useState("all"),y=b?new RegExp(`^${n.name}\\[(\\d+)\\]$`):null,v=b?(a?.completed_steps?.success??[]).filter(D=>y.test(D.name)).map(D=>{const We=D.name.match(y);return{index:Number(We[1]),status:"success"}}):[],C=(b?d.filter(D=>y.test(D)):[]).map(D=>{const We=D.match(y);return{index:Number(We[1]),status:"error"}}),_=[...v,...C].sort(lc),I=_.length>0,$=b&&j!=="all"?`${n.name}[${j}]`:void 0,A=p?n.name:void 0,W=$??A,{output:T,error:M}=js(c,W);let H;e[2]!==M||e[3]!==r||e[4]!==i||e[5]!==T?(H=T||(M?{error:M}:i&&r?{error:r}:void 0),e[2]=M,e[3]=r,e[4]=i,e[5]=T,e[6]=H):H=e[6];const F=H,B=l&&typeof l=="object"?l.properties:void 0;let V;e[7]!==B?(V=B?Object.entries(B):[],e[7]=B,e[8]=V):V=e[8];const z=V,Q=j!=="all"&&C.some(D=>D.index===j),se=j==="all"?i||f||x:Q,ee=h?"flex-1 min-h-0 overflow-hidden":"shrink-0";let U;e[9]!==ee?(U=R("flex flex-col border-b border-border",ee),e[9]=ee,e[10]=U):U=e[10];let J;e[11]!==h||e[12]!==g?(J=()=>g(!h),e[11]=h,e[12]=g,e[13]=J):J=e[13];const E=se?"text-destructive":"text-muted-foreground";let O;e[14]!==E?(O=R("text-sm font-medium",E),e[14]=E,e[15]=O):O=e[15];const P=se?"Error":"Output";let Y;e[16]!==O||e[17]!==P?(Y=o.jsx("h3",{className:O,children:P}),e[16]=O,e[17]=P,e[18]=Y):Y=e[18];let le;e[19]!==h?(le=h?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"}),e[19]=h,e[20]=le):le=e[20];let oe;e[21]!==Y||e[22]!==le?(oe=o.jsxs("div",{className:"flex items-center justify-between",children:[Y,le]}),e[21]=Y,e[22]=le,e[23]=oe):oe=e[23];let ce;e[24]!==oe||e[25]!==J?(ce=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:J,children:oe}),e[24]=oe,e[25]=J,e[26]=ce):ce=e[26];let te;e[27]!==_||e[28]!==F||e[29]!==I||e[30]!==b||e[31]!==h||e[32]!==z||e[33]!==j||e[34]!==S||e[35]!==n.name||e[36]!==c?(te=h&&o.jsxs(o.Fragment,{children:[c&&b&&I&&o.jsx(cc,{iterations:_,selectedIteration:j,onSelect:S}),c&&F?o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Le,{code:JSON.stringify(F,null,2),language:"json",height:"100%",readOnly:!0},`output-${n.name}-${j}`)}):null,!c&&z.length>0&&o.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:z.map(ic)})]}),e[27]=_,e[28]=F,e[29]=I,e[30]=b,e[31]=h,e[32]=z,e[33]=j,e[34]=S,e[35]=n.name,e[36]=c,e[37]=te):te=e[37];let G;return e[38]!==ce||e[39]!==te||e[40]!==U?(G=o.jsxs("div",{className:U,children:[ce,te]}),e[38]=ce,e[39]=te,e[40]=U,e[41]=G):G=e[41],G}function ic(t){const[e,n]=t;return o.jsx(dc,{name:e,schema:n},e)}function lc(t,e){return t.index-e.index}function cc(t){const e=N.c(21),{iterations:n,selectedIteration:s,onSelect:i}=t,r=s==="all"?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground";let l;e[0]!==r?(l=R("h-7 px-3 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",r),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==i?(c=()=>i("all"),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==l||e[5]!==c?(a=o.jsx("button",{type:"button",className:l,onClick:c,children:"All Results"}),e[4]=l,e[5]=c,e[6]=a):a=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"w-px h-4 bg-border mx-1"}),e[7]=d):d=e[7];let u;if(e[8]!==n||e[9]!==i||e[10]!==s){let p;e[12]!==i||e[13]!==s?(p=h=>{const g=s===h.index;return o.jsxs("button",{type:"button",className:R("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",g?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(h.index),children:[h.status==="success"?o.jsx(pt,{size:12,className:"text-success"}):o.jsx(nn,{size:12,className:"text-destructive"}),o.jsxs("span",{className:"font-mono",children:["#",h.index]})]},h.index)},e[12]=i,e[13]=s,e[14]=p):p=e[14],u=n.map(p),e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];let f;e[15]!==a||e[16]!==u?(f=o.jsxs("div",{className:"flex w-max items-center gap-2 pb-3",children:[a,d,u]}),e[15]=a,e[16]=u,e[17]=f):f=e[17];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(fr,{orientation:"horizontal"}),e[18]=m):m=e[18];let x;return e[19]!==f?(x=o.jsx("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:o.jsxs(mr,{className:"w-full whitespace-nowrap",children:[f,m]})}),e[19]=f,e[20]=x):x=e[20],x}function ac(t){switch(t){case"string":return{Icon:rs,color:"text-blue-500"};case"number":case"integer":return{Icon:ss,color:"text-blue-500"};case"array":return{Icon:es,color:"text-purple-500"};case"object":return{Icon:Yn,color:"text-orange-500"};case"boolean":return{Icon:os,color:"text-pink-500"};case"null":return{Icon:Ut,color:"text-gray-500"};default:return{Icon:ts,color:"text-muted-foreground"}}}function dc(t){const e=N.c(28),{name:n,schema:s}=t,i=qe(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:y,color:v}=ac(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=y,c=14,a=R(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 m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=x):x=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(as,{size:14,className:"opacity-50"}),e[16]=p):p=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:[p,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let S;return e[24]!==j||e[25]!==u||e[26]!==x?(S=o.jsxs("div",{className:u,children:[x,j]}),e[24]=j,e[25]=u,e[26]=x,e[27]=S):S=e[27],S}function uc(t){const e=N.c(29),{step:n}=t,{updateStep:s}=ne(),i=q(),[r,l]=k.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=pn(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
8
  // Tool output schema not available
9
9
  }`;const _=d.outputSchema,I=_.properties;return I?`interface Input {
10
10
  ${Object.entries(I).map(A=>{const[W,T]=A,M=Qe(T),H=!_.required?.includes(W);return` ${W}${H?"?":""}: ${M};`}).join(`
@@ -23,4 +23,4 @@ export default async function(input: Input): Promise<Output> {
23
23
  return {
24
24
  result: input,
25
25
  };
26
- }`;s(n.name,{action:{...n.action,transformCode:I}}),l(fc)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(_,I)=>{s(n.name,{action:{...n.action,transformCode:_},...I?{outputSchema:I}:{}})},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=R("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 S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=S):S=e[13];let y;e[14]!==r?(y=o.jsxs("div",{className:"flex items-center justify-between",children:[S,r?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=y):y=e[15];let v;e[16]!==y||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:y}),e[16]=y,e[17]=p,e[18]=v):v=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Le,{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]=w):w=e[24];let C;return e[25]!==j||e[26]!==v||e[27]!==w?(C=o.jsxs("div",{className:j,children:[v,w]}),e[25]=j,e[26]=v,e[27]=w,e[28]=C):C=e[28],C}function fc(t){return!t}function mc(t){return!t}function pc(t){const e=N.c(24),{step:n}=t,[s,i]=k.useState(!1),{updateStep:r}=ne(),l="code"in n.action&&n.action.code?n.action.code:null,c=q();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,S)=>{r(n.name,{action:{...n.action,code:j},...S?{outputSchema:S}:{}})},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=R("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=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 p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==m||e[12]!==p?(h=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,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(Le,{onSave:(j,S)=>d(j,S),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 Qe(t){if(Array.isArray(t.type))return t.type.map(n=>Qe({...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?`${Qe(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Qe(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function xc(t){switch(t){case"success":return o.jsxs(me,{variant:"success",className:"gap-1",children:[o.jsx(pt,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(me,{variant:"destructive",className:"gap-1",children:[o.jsx(rn,{size:11}),"Error"]});case"running":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),"Running"]});case"enqueued":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),"On hold"]});case"cancelled":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Qn,{size:11}),"Cancelled"]});default:return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),t]})}}function hc(t){return`Run #${t.slice(-4).toUpperCase()}`}function gc(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=ni(),{setShowExecutionsList:r}=cn(),{setTrackingExecutionId:l}=ne(),c=q();let a;e[0]!==l?(a=S=>{l(S)},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 m;e[4]!==n?(m=R("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=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 p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Qn,{size:11}),e[7]=p):p=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(X,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),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((S,y)=>o.jsx(bc,{execution:S,isSelected:S.id===c,isFirst:y===0,onSelect:()=>d(S.id)},S.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]!==m||e[18]!==h||e[19]!==b?(j=o.jsxs("div",{className:m,children:[h,b]}),e[17]=m,e[18]=h,e[19]=b,e[20]=j):j=e[20],j}function bc(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=R("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=xc(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=hc(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}const jc=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],vc=lr({buildUrl:t=>`/org/${t}/watch?types=workflow.*`,eventTypes:jc}),Sc=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"],yc=500,Ve=new Map,He=new Map;function wc(t){const e=He.get(t);if(e)for(const n of e)n.invalidateQueries({predicate:s=>s.queryKey.some(i=>typeof i=="string"&&Sc.includes(i))})}function Nc(t){Ve.has(t)||Ve.set(t,setTimeout(()=>{Ve.delete(t),wc(t)},yc))}const Tn=()=>0;function Cc(){const t=N.c(3),{org:e}=Z(),n=xo(),s=e.id;let i;t[0]!==s||t[1]!==n?(i=l=>{let c=He.get(s);c||(c=new Set,He.set(s,c)),c.add(n);const a=()=>{Nc(s),l()},d=vc.subscribe(s,a);return()=>{d(),c.delete(n),c.size===0&&He.delete(s);const u=Ve.get(s);u&&!He.has(s)&&(clearTimeout(u),Ve.delete(s))}},t[0]=s,t[1]=n,t[2]=i):i=t[2];const r=i;k.useSyncExternalStore(r,Tn,Tn)}function qs(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/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=pe(r),c=l??"no-connection",{org:a}=Z(),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=ie(u),m=Bt(c,"WORKFLOW",n,f),x=qt(c,"WORKFLOW",f);let p;e[4]!==x||e[5]!==n?(p=async b=>{i(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{i(!1)})},e[4]=x,e[5]=n,e[6]=p):p=e[6];const h=p;let g;return e[7]!==s||e[8]!==m||e[9]!==h?(g={item:m,update:h,isUpdating:s},e[7]=s,e[8]=m,e[9]=h,e[10]=g):g=e[10],g}function kc(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=ne();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=Le,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 m=JSON.parse(f);i({...n,...m}),s(m)},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 Ic(){const t=N.c(9),e=q(),{item:n}=fe(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 _c;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,m=k.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let p=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],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??x}function _c(){}function Ec(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 Tc(){const t=N.c(26),{setTrackingExecutionId:e}=ne(),n=q(),{item:s}=fe(n),i=Ic();let r;t[0]!==i?(r=i!=null?Ec(i):null,t[0]=i,t[1]=r):r=t[1];const l=r,c=s?.status,a=c==="error"||c==="failed",d=c==="success";let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(ho,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=u):u=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=f):f=t[3];let m;t[4]!==n?(m=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[f,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=m):m=t[5];let x;t[6]!==d?(x=d&&o.jsxs(me,{variant:"success",className:"gap-1 ml-3",children:[o.jsx(go,{size:11}),"Success"]}),t[6]=d,t[7]=x):x=t[7];let p;t[8]!==a?(p=a&&o.jsxs(me,{variant:"destructive",className:"gap-1 ml-3",children:[o.jsx(gr,{size:11}),"Failed"]}),t[8]=a,t[9]=p):p=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(pr,{className:"w-4 h-4 text-muted-foreground"}),t[10]=h):h=t[10];let g;t[11]!==l?(g=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[h,o.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),t[11]=l,t[12]=g):g=t[12];let b;t[13]!==m||t[14]!==x||t[15]!==p||t[16]!==g?(b=o.jsxs("div",{className:"flex items-center h-full",children:[u,m,x,p,g]}),t[13]=m,t[14]=x,t[15]=p,t[16]=g,t[17]=b):b=t[17];let j;t[18]!==e?(j=()=>e(void 0),t[18]=e,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Ut,{className:"w-4 h-4 text-muted-foreground"}),t[20]=S):S=t[20];let y;t[21]!==j?(y=o.jsx(X,{variant:"ghost",size:"xs",onClick:j,children:S}),t[21]=j,t[22]=y):y=t[22];let v;return t[23]!==y||t[24]!==b?(v=o.jsx("div",{className:"flex flex-col border-b border-border",children:o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between",children:[b,y]})}),t[23]=y,t[24]=b,t[25]=v):v=t[25],v}function $c(){const t=N.c(15);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=pe(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i,update:r,isUpdating:l}=qs(s);let c;t[3]!==i?(c=JSON.stringify(i),t[3]=i,t[4]=c):c=t[4];const a=c;if(!i){let m;return t[5]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(he,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(tn,{icon:o.jsx(ns,{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."})})}),t[5]=m):m=t[5],m}let d;t[6]!==i?(d={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},t[6]=i,t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==r?(u=o.jsx(Oc,{onUpdate:r,isUpdating:l}),t[8]=l,t[9]=r,t[10]=u):u=t[10];let f;return t[11]!==a||t[12]!==d||t[13]!==u?(f=o.jsx(Br,{initialState:d,children:u},a),t[11]=a,t[12]=d,t[13]=u,t[14]=f):f=t[14],f}function Oc(t){const e=N.c(21),{onUpdate:n,isUpdating:s}=t;Cc();const i=De(),r=q(),{viewMode:l,showExecutionsList:c}=cn(),a=qe();let d;e[0]!==n||e[1]!==i?(d=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=d):d=e[2];const u=d,f=a&&"toolName"in a.action,m=f?a.action.toolName:null,x=f&&!m&&!r,p=!x&&(a||r||!c);let h;e[3]!==u||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(h=o.jsx(cl,{title:i.title,description:i.description,onSave:u,isSaving:s}),e[3]=u,e[4]=s,e[5]=i.description,e[6]=i.title,e[7]=h):h=e[7];let g;e[8]!==r?(g=r&&o.jsx(Tc,{}),e[8]=r,e[9]=g):g=e[9];let b;e[10]!==n||e[11]!==c||e[12]!==p||e[13]!==x||e[14]!==l||e[15]!==i?(b=o.jsx("div",{className:"flex-1 overflow-hidden",children:l==="code"?o.jsx(kc,{workflow:i,onUpdate:n}):o.jsxs(Mo,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(jn,{defaultSize:50,minSize:30,children:o.jsx(Il,{})}),o.jsx(Po,{}),o.jsxs(jn,{defaultSize:50,minSize:25,children:[x&&o.jsx(Tl,{className:"border-l border-border"}),c&&o.jsx(gc,{}),p&&o.jsx(ec,{className:"border-l border-border"})]})]})}),e[10]=n,e[11]=c,e[12]=p,e[13]=x,e[14]=l,e[15]=i,e[16]=b):b=e[16];let j;return e[17]!==h||e[18]!==g||e[19]!==b?(j=o.jsx(he,{children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[h,g,b]})}),e[17]=h,e[18]=g,e[19]=b,e[20]=j):j=e[20],j}function Rc(t){const e=N.c(6),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=pe(s),r=i??"no-connection",{org:l}=Z(),c=i??null;let a;e[1]!==l.id||e[2]!==c?(a={connectionId:c,orgId:l.id},e[1]=l.id,e[2]=c,e[3]=a):a=e[3];const d=ie(a),u=Bt(r,"WORKFLOW_EXECUTION",n,d);let f;return e[4]!==u?(f={item:u},e[4]=u,e[5]=f):f=e[5],f}function Ac(){const t=N.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=pe(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i}=Rc(s);if(!i){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(he,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(tn,{icon:o.jsx(ns,{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."})})}),t[3]=c):c=t[3],c}let r;t[4]!==i?(r=JSON.stringify(i,null,2),t[4]=i,t[5]=r):r=t[5];let l;return t[6]!==r?(l=o.jsx(he,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(Le,{height:"100%",code:r,language:"json",readOnly:!0})})}),t[6]=r,t[7]=l):l=t[7],l}const Mc={workflow:$c,workflow_execution:Ac,prompt:Nr};function Pc(){const t=N.c(6),e=Ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=pe(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=Lc;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Or,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function Lc(t){return Promise.resolve()}function Dc(t){return t.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function zc(){const t=N.c(38),e=Ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=pe(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}=Z(),f=dt(i),m=i??null;let x;t[3]!==u.id||t[4]!==m?(x={connectionId:m,orgId:u.id},t[3]=u.id,t[4]=m,t[5]=x):x=t[5];const p=ie(x),h=qt(d,r,p);let g;t[6]!==h||t[7]!==l?(g=async F=>{l&&await h.update.mutateAsync({id:l,data:F})},t[6]=h,t[7]=l,t[8]=g):g=t[8];const b=g;let j;t[9]!==r?(j=r?.toLowerCase(),t[9]=r,t[10]=j):j=t[10];const S=j,y=S&&Mc[S];let v;t[11]!==r?(v=Dc(r),t[11]=r,t[12]=v):v=t[12];const w=v;let C;t[13]!==u.slug?(C=o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps",params:{org:u.slug,project:et},children:"Connections"})})}),t[13]=u.slug,t[14]=C):C=t[14];let _;t[15]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(it,{}),t[15]=_):_=t[15];let I;t[16]!==r||t[17]!==f||t[18]!==i||t[19]!==u.slug?(I=f&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps/$connectionId",params:{org:u.slug,project:et,connectionId:i},search:{tab:r},children:f.title})})}),o.jsx(it,{})]}),t[16]=r,t[17]=f,t[18]=i,t[19]=u.slug,t[20]=I):I=t[20];let $;t[21]!==w?($=o.jsx(Pe,{children:o.jsx(Jn,{children:w})}),t[21]=w,t[22]=$):$=t[22];let A;t[23]!==$||t[24]!==C||t[25]!==I?(A=o.jsx(qn,{children:o.jsxs(Kn,{children:[C,_,I,$]})}),t[23]=$,t[24]=C,t[25]=I,t[26]=A):A=t[26];const W=A;if(y){let F;return t[27]!==y||t[28]!==a||t[29]!==b||t[30]!==l?(F=o.jsx(y,{itemId:l,onBack:a,onUpdate:b}),t[27]=y,t[28]=a,t[29]=b,t[30]=l,t[31]=F):F=t[31],F}let T;t[32]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ao,{size:36,className:"text-muted-foreground"}),t[32]=T):T=t[32];let M;t[33]!==a?(M=o.jsx(tn,{icon:T,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[33]=a,t[34]=M):M=t[34];let H;return t[35]!==W||t[36]!==M?(H=o.jsx(he,{breadcrumb:W,children:M}),t[35]=W,t[36]=M,t[37]=H):H=t[37],H}function Wc(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=pe(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Pc,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(zc,{}),t[2]=r):r=t[2],r}function Ad(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ut,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Wc,{})})}),t[0]=e):e=t[0],e}export{Ad as default};
26
+ }`;s(n.name,{action:{...n.action,transformCode:I}}),l(fc)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(_,I)=>{s(n.name,{action:{...n.action,transformCode:_},...I?{outputSchema:I}:{}})},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=R("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 S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=S):S=e[13];let y;e[14]!==r?(y=o.jsxs("div",{className:"flex items-center justify-between",children:[S,r?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=y):y=e[15];let v;e[16]!==y||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:y}),e[16]=y,e[17]=p,e[18]=v):v=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Le,{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]=w):w=e[24];let C;return e[25]!==j||e[26]!==v||e[27]!==w?(C=o.jsxs("div",{className:j,children:[v,w]}),e[25]=j,e[26]=v,e[27]=w,e[28]=C):C=e[28],C}function fc(t){return!t}function mc(t){return!t}function pc(t){const e=N.c(24),{step:n}=t,[s,i]=k.useState(!1),{updateStep:r}=ne(),l="code"in n.action&&n.action.code?n.action.code:null,c=q();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,S)=>{r(n.name,{action:{...n.action,code:j},...S?{outputSchema:S}:{}})},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=R("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=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 p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx(on,{size:14,className:"text-muted-foreground"}):o.jsx(sn,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==m||e[12]!==p?(h=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,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(Le,{onSave:(j,S)=>d(j,S),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 Qe(t){if(Array.isArray(t.type))return t.type.map(n=>Qe({...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?`${Qe(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Qe(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function xc(t){switch(t){case"success":return o.jsxs(me,{variant:"success",className:"gap-1",children:[o.jsx(pt,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(me,{variant:"destructive",className:"gap-1",children:[o.jsx(rn,{size:11}),"Error"]});case"running":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),"Running"]});case"enqueued":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),"On hold"]});case"cancelled":return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Qn,{size:11}),"Cancelled"]});default:return o.jsxs(me,{variant:"secondary",className:"gap-1",children:[o.jsx(Ze,{size:11}),t]})}}function hc(t){return`Run #${t.slice(-4).toUpperCase()}`}function gc(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=ni(),{setShowExecutionsList:r}=cn(),{setTrackingExecutionId:l}=ne(),c=q();let a;e[0]!==l?(a=S=>{l(S)},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 m;e[4]!==n?(m=R("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=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 p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Qn,{size:11}),e[7]=p):p=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(X,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),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((S,y)=>o.jsx(bc,{execution:S,isSelected:S.id===c,isFirst:y===0,onSelect:()=>d(S.id)},S.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]!==m||e[18]!==h||e[19]!==b?(j=o.jsxs("div",{className:m,children:[h,b]}),e[17]=m,e[18]=h,e[19]=b,e[20]=j):j=e[20],j}function bc(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=R("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=xc(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=hc(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}const jc=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],vc=lr({buildUrl:t=>`/org/${t}/watch?types=workflow.*`,eventTypes:jc}),Sc=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"],yc=500,Ve=new Map,He=new Map;function wc(t){const e=He.get(t);if(e)for(const n of e)n.invalidateQueries({predicate:s=>s.queryKey.some(i=>typeof i=="string"&&Sc.includes(i))})}function Nc(t){Ve.has(t)||Ve.set(t,setTimeout(()=>{Ve.delete(t),wc(t)},yc))}const Tn=()=>0;function Cc(){const t=N.c(3),{org:e}=Z(),n=xo(),s=e.id;let i;t[0]!==s||t[1]!==n?(i=l=>{let c=He.get(s);c||(c=new Set,He.set(s,c)),c.add(n);const a=()=>{Nc(s),l()},d=vc.subscribe(s,a);return()=>{d(),c.delete(n),c.size===0&&He.delete(s);const u=Ve.get(s);u&&!He.has(s)&&(clearTimeout(u),Ve.delete(s))}},t[0]=s,t[1]=n,t[2]=i):i=t[2];const r=i;k.useSyncExternalStore(r,Tn,Tn)}function qs(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/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=pe(r),c=l??"no-connection",{org:a}=Z(),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=ie(u),m=Bt(c,"WORKFLOW",n,f),x=qt(c,"WORKFLOW",f);let p;e[4]!==x||e[5]!==n?(p=async b=>{i(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{i(!1)})},e[4]=x,e[5]=n,e[6]=p):p=e[6];const h=p;let g;return e[7]!==s||e[8]!==m||e[9]!==h?(g={item:m,update:h,isUpdating:s},e[7]=s,e[8]=m,e[9]=h,e[10]=g):g=e[10],g}function kc(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=ne();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=Le,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 m=JSON.parse(f);i({...n,...m}),s(m)},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 Ic(){const t=N.c(9),e=q(),{item:n}=fe(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 _c;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,m=k.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let p=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],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??x}function _c(){}function Ec(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 Tc(){const t=N.c(26),{setTrackingExecutionId:e}=ne(),n=q(),{item:s}=fe(n),i=Ic();let r;t[0]!==i?(r=i!=null?Ec(i):null,t[0]=i,t[1]=r):r=t[1];const l=r,c=s?.status,a=c==="error"||c==="failed",d=c==="success";let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(ho,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=u):u=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=f):f=t[3];let m;t[4]!==n?(m=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[f,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=m):m=t[5];let x;t[6]!==d?(x=d&&o.jsxs(me,{variant:"success",className:"gap-1 ml-3",children:[o.jsx(go,{size:11}),"Success"]}),t[6]=d,t[7]=x):x=t[7];let p;t[8]!==a?(p=a&&o.jsxs(me,{variant:"destructive",className:"gap-1 ml-3",children:[o.jsx(gr,{size:11}),"Failed"]}),t[8]=a,t[9]=p):p=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(pr,{className:"w-4 h-4 text-muted-foreground"}),t[10]=h):h=t[10];let g;t[11]!==l?(g=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[h,o.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),t[11]=l,t[12]=g):g=t[12];let b;t[13]!==m||t[14]!==x||t[15]!==p||t[16]!==g?(b=o.jsxs("div",{className:"flex items-center h-full",children:[u,m,x,p,g]}),t[13]=m,t[14]=x,t[15]=p,t[16]=g,t[17]=b):b=t[17];let j;t[18]!==e?(j=()=>e(void 0),t[18]=e,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Ut,{className:"w-4 h-4 text-muted-foreground"}),t[20]=S):S=t[20];let y;t[21]!==j?(y=o.jsx(X,{variant:"ghost",size:"xs",onClick:j,children:S}),t[21]=j,t[22]=y):y=t[22];let v;return t[23]!==y||t[24]!==b?(v=o.jsx("div",{className:"flex flex-col border-b border-border",children:o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between",children:[b,y]})}),t[23]=y,t[24]=b,t[25]=v):v=t[25],v}function $c(){const t=N.c(15);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=pe(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i,update:r,isUpdating:l}=qs(s);let c;t[3]!==i?(c=JSON.stringify(i),t[3]=i,t[4]=c):c=t[4];const a=c;if(!i){let m;return t[5]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(he,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(tn,{icon:o.jsx(ns,{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."})})}),t[5]=m):m=t[5],m}let d;t[6]!==i?(d={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},t[6]=i,t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==r?(u=o.jsx(Oc,{onUpdate:r,isUpdating:l}),t[8]=l,t[9]=r,t[10]=u):u=t[10];let f;return t[11]!==a||t[12]!==d||t[13]!==u?(f=o.jsx(Br,{initialState:d,children:u},a),t[11]=a,t[12]=d,t[13]=u,t[14]=f):f=t[14],f}function Oc(t){const e=N.c(21),{onUpdate:n,isUpdating:s}=t;Cc();const i=De(),r=q(),{viewMode:l,showExecutionsList:c}=cn(),a=qe();let d;e[0]!==n||e[1]!==i?(d=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=d):d=e[2];const u=d,f=a&&"toolName"in a.action,m=f?a.action.toolName:null,x=f&&!m&&!r,p=!x&&(a||r||!c);let h;e[3]!==u||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(h=o.jsx(cl,{title:i.title,description:i.description,onSave:u,isSaving:s}),e[3]=u,e[4]=s,e[5]=i.description,e[6]=i.title,e[7]=h):h=e[7];let g;e[8]!==r?(g=r&&o.jsx(Tc,{}),e[8]=r,e[9]=g):g=e[9];let b;e[10]!==n||e[11]!==c||e[12]!==p||e[13]!==x||e[14]!==l||e[15]!==i?(b=o.jsx("div",{className:"flex-1 overflow-hidden",children:l==="code"?o.jsx(kc,{workflow:i,onUpdate:n}):o.jsxs(Mo,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(jn,{defaultSize:50,minSize:30,children:o.jsx(Il,{})}),o.jsx(Po,{}),o.jsxs(jn,{defaultSize:50,minSize:25,children:[x&&o.jsx(Tl,{className:"border-l border-border"}),c&&o.jsx(gc,{}),p&&o.jsx(ec,{className:"border-l border-border"})]})]})}),e[10]=n,e[11]=c,e[12]=p,e[13]=x,e[14]=l,e[15]=i,e[16]=b):b=e[16];let j;return e[17]!==h||e[18]!==g||e[19]!==b?(j=o.jsx(he,{children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[h,g,b]})}),e[17]=h,e[18]=g,e[19]=b,e[20]=j):j=e[20],j}function Rc(t){const e=N.c(6),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=pe(s),r=i??"no-connection",{org:l}=Z(),c=i??null;let a;e[1]!==l.id||e[2]!==c?(a={connectionId:c,orgId:l.id},e[1]=l.id,e[2]=c,e[3]=a):a=e[3];const d=ie(a),u=Bt(r,"WORKFLOW_EXECUTION",n,d);let f;return e[4]!==u?(f={item:u},e[4]=u,e[5]=f):f=e[5],f}function Ac(){const t=N.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=pe(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i}=Rc(s);if(!i){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(he,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(tn,{icon:o.jsx(ns,{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."})})}),t[3]=c):c=t[3],c}let r;t[4]!==i?(r=JSON.stringify(i,null,2),t[4]=i,t[5]=r):r=t[5];let l;return t[6]!==r?(l=o.jsx(he,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(Le,{height:"100%",code:r,language:"json",readOnly:!0})})}),t[6]=r,t[7]=l):l=t[7],l}const Mc={workflow:$c,workflow_execution:Ac,prompt:Nr};function Pc(){const t=N.c(6),e=Ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=pe(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=Lc;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Or,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function Lc(t){return Promise.resolve()}function Dc(t){return t.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function zc(){const t=N.c(38),e=Ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=pe(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}=Z(),f=ut(i),m=i??null;let x;t[3]!==u.id||t[4]!==m?(x={connectionId:m,orgId:u.id},t[3]=u.id,t[4]=m,t[5]=x):x=t[5];const p=ie(x),h=qt(d,r,p);let g;t[6]!==h||t[7]!==l?(g=async F=>{l&&await h.update.mutateAsync({id:l,data:F})},t[6]=h,t[7]=l,t[8]=g):g=t[8];const b=g;let j;t[9]!==r?(j=r?.toLowerCase(),t[9]=r,t[10]=j):j=t[10];const S=j,y=S&&Mc[S];let v;t[11]!==r?(v=Dc(r),t[11]=r,t[12]=v):v=t[12];const w=v;let C;t[13]!==u.slug?(C=o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps",params:{org:u.slug,project:et},children:"Connections"})})}),t[13]=u.slug,t[14]=C):C=t[14];let _;t[15]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(it,{}),t[15]=_):_=t[15];let I;t[16]!==r||t[17]!==f||t[18]!==i||t[19]!==u.slug?(I=f&&o.jsxs(o.Fragment,{children:[o.jsx(Pe,{children:o.jsx(rt,{asChild:!0,children:o.jsx(Ye,{to:"/$org/$project/mcps/$connectionId",params:{org:u.slug,project:et,connectionId:i},search:{tab:r},children:f.title})})}),o.jsx(it,{})]}),t[16]=r,t[17]=f,t[18]=i,t[19]=u.slug,t[20]=I):I=t[20];let $;t[21]!==w?($=o.jsx(Pe,{children:o.jsx(Jn,{children:w})}),t[21]=w,t[22]=$):$=t[22];let A;t[23]!==$||t[24]!==C||t[25]!==I?(A=o.jsx(qn,{children:o.jsxs(Kn,{children:[C,_,I,$]})}),t[23]=$,t[24]=C,t[25]=I,t[26]=A):A=t[26];const W=A;if(y){let F;return t[27]!==y||t[28]!==a||t[29]!==b||t[30]!==l?(F=o.jsx(y,{itemId:l,onBack:a,onUpdate:b}),t[27]=y,t[28]=a,t[29]=b,t[30]=l,t[31]=F):F=t[31],F}let T;t[32]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ao,{size:36,className:"text-muted-foreground"}),t[32]=T):T=t[32];let M;t[33]!==a?(M=o.jsx(tn,{icon:T,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[33]=a,t[34]=M):M=t[34];let H;return t[35]!==W||t[36]!==M?(H=o.jsx(he,{breadcrumb:W,children:M}),t[35]=W,t[36]=M,t[37]=H):H=t[37],H}function Wc(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=pe(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Pc,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(zc,{}),t[2]=r):r=t[2],r}function Md(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(dt,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Wc,{})})}),t[0]=e):e=t[0],e}export{Md as default};