@decocms/mesh 2.59.7 → 2.61.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 (179) hide show
  1. package/dist/client/assets/{AlertCircle-BFXBDrUr.js → AlertCircle-DZft-TG2.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-BDaeP-ZF.js → ArrowUp-D5u5S04m.js} +1 -1
  3. package/dist/client/assets/{Calendar-Do1_EcNl.js → Calendar-D09MNLuS.js} +1 -1
  4. package/dist/client/assets/{Check-C7bGyGOC.js → Check-DCDAnqOU.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DY2hRH3P.js → ChevronDown-DutrckZC.js} +1 -1
  6. package/dist/client/assets/ChevronRight-DspCPj_w.js +1 -0
  7. package/dist/client/assets/{Code01-Bti_O9RL.js → Code01-DedonTWa.js} +1 -1
  8. package/dist/client/assets/{Copy01-Cql6iNiT.js → Copy01-BWDgSjt6.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-Bn70vF_C.js → DotsHorizontal-HzP-MqOT.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-55vBqpF9.js → DotsVertical-DiYKrTRi.js} +1 -1
  11. package/dist/client/assets/{Download01-CY_txTIU.js → Download01-b-4mb5pm.js} +1 -1
  12. package/dist/client/assets/{Edit01-BcXXA0Bn.js → Edit01-D7FAjBpe.js} +1 -1
  13. package/dist/client/assets/{File02-CZ_CP680.js → File02-DE5qRuoV.js} +1 -1
  14. package/dist/client/assets/{File06-OiAbO58I.js → File06-Dyp_EEPp.js} +1 -1
  15. package/dist/client/assets/{FilterLines-8ygYuAAi.js → FilterLines-DYs8Amde.js} +1 -1
  16. package/dist/client/assets/Grid01-hfoOS4OQ.js +1 -0
  17. package/dist/client/assets/{Home02-BeNorB_C.js → Home02-BftR1elJ.js} +1 -1
  18. package/dist/client/assets/{Image01-DvLyxsOA.js → Image01-BBnTxqKs.js} +1 -1
  19. package/dist/client/assets/{Inbox01-BPkfViyI.js → Inbox01-Br0-Fo7T.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-BJ2AMXf3.js → InfoCircle-4Gg1mCvl.js} +1 -1
  21. package/dist/client/assets/{Key01-D8HCSb8P.js → Key01-ImEEyxuW.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-BrLuchvz.js → LinkExternal01-f9rwgdRB.js} +1 -1
  23. package/dist/client/assets/{List-bC7xiZ2s.js → List-Byzk8GIH.js} +1 -1
  24. package/dist/client/assets/{Loading01-BiNUjLDw.js → Loading01-267RBTet.js} +1 -1
  25. package/dist/client/assets/{Lock01-Bg5yU8Wj.js → Lock01-h-Hl5Kq5.js} +1 -1
  26. package/dist/client/assets/{Pin01-iTXtWrRE.js → Pin01-DBrrq4D2.js} +1 -1
  27. package/dist/client/assets/{Play-C3Hph8xY.js → Play-DAIuzg5S.js} +1 -1
  28. package/dist/client/assets/{Plus-BuZ2XoBN.js → Plus-zV6WU4JB.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BeBVRrdw.js → SearchMd-7_DsxZht.js} +1 -1
  30. package/dist/client/assets/{Share07-DldJlk64.js → Share07-Cnrwf8Jg.js} +1 -1
  31. package/dist/client/assets/{Terminal-EcSYzT5u.js → Terminal-DyHs8Rf6.js} +1 -1
  32. package/dist/client/assets/{Tool01-CH0MYN-2.js → Tool01-BI-I3hYP.js} +1 -1
  33. package/dist/client/assets/{Trash01-DSwoFZY0.js → Trash01-DlcrlG40.js} +1 -1
  34. package/dist/client/assets/{Upload01-CpcqtTNa.js → Upload01-CEsNtyVM.js} +1 -1
  35. package/dist/client/assets/{Users03-B6orUjW9.js → Users03-b0Q6Esat.js} +1 -1
  36. package/dist/client/assets/{X-DLZk4kqC.js → X-BDbowDxs.js} +1 -1
  37. package/dist/client/assets/{XClose-C2SJXRFh.js → XClose-BU7t8GBR.js} +1 -1
  38. package/dist/client/assets/agent-detail-CMBzFEVK.js +1 -0
  39. package/dist/client/assets/agents-dsz6OFgr.js +1 -0
  40. package/dist/client/assets/{alert-dialog-Dllib4My.js → alert-dialog-DvH3np1K.js} +2 -2
  41. package/dist/client/assets/{auth-catchall-BOn2OyMJ.js → auth-catchall-RZI2QIfW.js} +1 -1
  42. package/dist/client/assets/{avatar-BfuaGHdb.js → avatar-DLsqU89S.js} +1 -1
  43. package/dist/client/assets/badge-D0aebo3b.js +1 -0
  44. package/dist/client/assets/{binder-CC8WnynZ.js → binder-DhS3ZsVD.js} +1 -1
  45. package/dist/client/assets/breadcrumb-DYzoaO6c.js +1 -0
  46. package/dist/client/assets/button-ClfTbYRX.js +1 -0
  47. package/dist/client/assets/{card-DFhzHX-B.js → card-D919Ye14.js} +1 -1
  48. package/dist/client/assets/{checkbox-JnNCVINs.js → checkbox-dmut6tGA.js} +1 -1
  49. package/dist/client/assets/{circle-alert-C96B7toE.js → circle-alert-O76dHf-6.js} +1 -1
  50. package/dist/client/assets/{collapsible-CDAezpyL.js → collapsible-CZO59QRP.js} +1 -1
  51. package/dist/client/assets/collection-detail-DfuPZ-Eh.js +26 -0
  52. package/dist/client/assets/{collection-search-rOPXHeEr.js → collection-search-imk5y1tl.js} +1 -1
  53. package/dist/client/assets/collection-tab-CqQprMKz.js +1 -0
  54. package/dist/client/assets/collection-table-wrapper-C7PJGoEH.js +1 -0
  55. package/dist/client/assets/connect-pBMimCL2.js +1 -0
  56. package/dist/client/assets/{connection-card-BLTFMSZS.js → connection-card-D2X3Om4T.js} +1 -1
  57. package/dist/client/assets/connection-detail-By8rfkHM.js +1 -0
  58. package/dist/client/assets/connections-Da_gf-d4.js +1 -0
  59. package/dist/client/assets/{constants-Mpett05j.js → constants-BZCTYQ-m.js} +1 -1
  60. package/dist/client/assets/constants-ClcoOK3l.js +1 -0
  61. package/dist/client/assets/{create-organization-dialog-WqiCWTM4.js → create-organization-dialog-Cwl_Gkel.js} +1 -1
  62. package/dist/client/assets/dialog-Btg4sCez.js +1 -0
  63. package/dist/client/assets/dropdown-menu-DN1Ltf10.js +1 -0
  64. package/dist/client/assets/dynamic-plugin-layout-DSctkXDf.js +1 -0
  65. package/dist/client/assets/empty-state-DYXlKoSr.js +1 -0
  66. package/dist/client/assets/{empty-state-7hq4AubF.js → empty-state-uG-DnAQb.js} +1 -1
  67. package/dist/client/assets/{env-vars-editor--TqeS791.js → env-vars-editor-ChPRpV0a.js} +1 -1
  68. package/dist/client/assets/{error-boundary-B6RXO2oI.js → error-boundary-BNlY9vIT.js} +1 -1
  69. package/dist/client/assets/{extract-connection-data-Cl2cHkSz.js → extract-connection-data-Bjn7AN9v.js} +1 -1
  70. package/dist/client/assets/file-browser-FSoZTHG-.js +2 -0
  71. package/dist/client/assets/form-CYYoaqIb.js +1 -0
  72. package/dist/client/assets/grid-view-DRczCiEv.js +1 -0
  73. package/dist/client/assets/home-DuoTXUw3.js +1 -0
  74. package/dist/client/assets/{index-6m1DUVC_.js → index-B8-fuOjQ.js} +1 -1
  75. package/dist/client/assets/{index-CXUcNyKS.js → index-B8Y83hFI.js} +1 -1
  76. package/dist/client/assets/{index-BDvGMi--.js → index-Bb-7JPLn.js} +1 -1
  77. package/dist/client/assets/{index-Ez2DTosS.js → index-Bk3VGbpH.js} +1 -1
  78. package/dist/client/assets/index-By5YaRHP.js +1 -0
  79. package/dist/client/assets/index-C4iufez8.css +1 -0
  80. package/dist/client/assets/{index-CymrbMj5.js → index-DQEC9k6R.js} +61 -61
  81. package/dist/client/assets/{index-DZqSbjFw.js → index-bZDjEZjy.js} +2 -2
  82. package/dist/client/assets/{infiniteQueryObserver-DmKtj9SR.js → infiniteQueryObserver-R-jPe69x.js} +1 -1
  83. package/dist/client/assets/{input-u1hHzCA4.js → input-Db3X6HvF.js} +1 -1
  84. package/dist/client/assets/layout-oEMg2tAu.js +1 -0
  85. package/dist/client/assets/{localstorage-keys-DpM3uKv7.js → localstorage-keys-Bdti-2mC.js} +1 -1
  86. package/dist/client/assets/{login-DoMEd-lv.js → login-CGsneu9K.js} +1 -1
  87. package/dist/client/assets/{mcp-oauth-C7tn4XA4.js → mcp-oauth-BmPwjDVD.js} +1 -1
  88. package/dist/client/assets/mcp-server-card-BcwB38uI.js +1 -0
  89. package/dist/client/assets/mcp-server-detail-ScZZDM2u.js +2 -0
  90. package/dist/client/assets/members-DrIeM1RI.js +3 -0
  91. package/dist/client/assets/{monaco-editor-CZ0mtshA.js → monaco-editor-B37z8w3N.js} +1 -1
  92. package/dist/client/assets/monitoring-IotTEObQ.js +49 -0
  93. package/dist/client/assets/{oauth-callback-BskSq0jW.js → oauth-callback-CtpbBZ0j.js} +1 -1
  94. package/dist/client/assets/page-BFuI9gLJ.js +1 -0
  95. package/dist/client/assets/page-Bm0zH9kR.js +1 -0
  96. package/dist/client/assets/pin-to-sidebar-button-Dz_XGqkX.js +1 -0
  97. package/dist/client/assets/{plugin-empty-state-rg6DAYSw.js → plugin-empty-state-ByGsbM_q.js} +1 -1
  98. package/dist/client/assets/{plugin-header-Cnc4tGD7.js → plugin-header-C_aZs0N6.js} +1 -1
  99. package/dist/client/assets/plugins-C4o2Tg3p.js +1 -0
  100. package/dist/client/assets/popover-CjjV7g4X.js +1 -0
  101. package/dist/client/assets/{registry-utils-BFBDFgyu.js → registry-utils-pqvn-SQ9.js} +1 -1
  102. package/dist/client/assets/{resizable-akHzriSj.js → resizable-Ds3XfyD1.js} +1 -1
  103. package/dist/client/assets/{resource-tabs-1el8gNET.js → resource-tabs-Ckk3ov-s.js} +1 -1
  104. package/dist/client/assets/select-DdPku9Z8.js +1 -0
  105. package/dist/client/assets/settings-RIVj-SMS.js +1 -0
  106. package/dist/client/assets/shell-layout-D5XFL0IE.js +12 -0
  107. package/dist/client/assets/{spinner-Bwqz03rl.js → spinner-Ch036S5x.js} +1 -1
  108. package/dist/client/assets/{store-invite-DJTXOg3a.js → store-invite-88nPipDW.js} +1 -1
  109. package/dist/client/assets/{switch-DNIxf6Z3.js → switch-D4uenvWn.js} +1 -1
  110. package/dist/client/assets/table-fsTaEaaU.js +1 -0
  111. package/dist/client/assets/{textarea-CLIBzUIu.js → textarea-CJUn3-Wq.js} +1 -1
  112. package/dist/client/assets/tools-list-D62d9csj.js +1 -0
  113. package/dist/client/assets/typewriter-title-BY44IAZn.js +16 -0
  114. package/dist/client/assets/{use-binding-B1LqCJr8.js → use-binding-a8EbFjQ8.js} +1 -1
  115. package/dist/client/assets/use-collections-C8m0cpJK.js +1 -0
  116. package/dist/client/assets/{use-connection-BzhGWFyL.js → use-connection-BsXZoJuC.js} +1 -1
  117. package/dist/client/assets/{use-create-virtual-mcp-D-7Y6G3j.js → use-create-virtual-mcp-C-dJH0KT.js} +1 -1
  118. package/dist/client/assets/use-deco-chat-open-DaZlP6gy.js +1 -0
  119. package/dist/client/assets/{use-list-state-BfmIALu7.js → use-list-state-BR0DnP45.js} +1 -1
  120. package/dist/client/assets/{use-mcp-prompts-C2Az2O1z.js → use-mcp-prompts-CauCdNEE.js} +1 -1
  121. package/dist/client/assets/{use-members-KzHxearI.js → use-members-C9xyUK_j.js} +1 -1
  122. package/dist/client/assets/{use-mobile-VtwOaDa5.js → use-mobile-BJaPqgO-.js} +1 -1
  123. package/dist/client/assets/{use-organization-settings-DMGaX8N0.js → use-organization-settings-C7v8TF4x.js} +1 -1
  124. package/dist/client/assets/{use-virtual-mcp-D3UgDP8i.js → use-virtual-mcp-Mo0Ax2sa.js} +1 -1
  125. package/dist/client/assets/useInfiniteQuery-DAahyMrR.js +1 -0
  126. package/dist/client/assets/{useMutation-BReaxe_W.js → useMutation-BUU-3CfS.js} +1 -1
  127. package/dist/client/assets/useQuery-CziyW3rA.js +1 -0
  128. package/dist/client/assets/useSuspenseInfiniteQuery-D9t8xGlB.js +1 -0
  129. package/dist/client/assets/{view-mode-toggle-DR9UFNqr.js → view-mode-toggle-BuBlE9kN.js} +1 -1
  130. package/dist/client/assets/workflow-BHUnmDkZ.js +1 -0
  131. package/dist/client/index.html +2 -2
  132. package/package.json +1 -1
  133. package/dist/client/assets/ArrowLeft-CDtoEGeL.js +0 -1
  134. package/dist/client/assets/Grid01-Bdrpv4xX.js +0 -1
  135. package/dist/client/assets/agent-detail-1edzdNo4.js +0 -1
  136. package/dist/client/assets/agents-CA-rSchF.js +0 -1
  137. package/dist/client/assets/badge-DF_3zhMz.js +0 -1
  138. package/dist/client/assets/button-0ydgHweE.js +0 -1
  139. package/dist/client/assets/collection-detail-ClXHe-PG.js +0 -26
  140. package/dist/client/assets/collection-display-button-C0Qj_mDn.js +0 -1
  141. package/dist/client/assets/collection-header-CHcRbSVg.js +0 -1
  142. package/dist/client/assets/collection-page-pQhPuVgo.js +0 -1
  143. package/dist/client/assets/collection-tab-e3o0S9Wa.js +0 -1
  144. package/dist/client/assets/collection-table-wrapper-C4t2ZZhF.js +0 -1
  145. package/dist/client/assets/connect-DP_OT-gv.js +0 -1
  146. package/dist/client/assets/connection-detail-C5TmRjj1.js +0 -1
  147. package/dist/client/assets/connections-I2Vy-typ.js +0 -1
  148. package/dist/client/assets/constants-OFVhPv4G.js +0 -1
  149. package/dist/client/assets/dialog-6FUpHXs_.js +0 -1
  150. package/dist/client/assets/dropdown-menu-CvHFB3Gz.js +0 -1
  151. package/dist/client/assets/dynamic-plugin-layout-Mnd5muQb.js +0 -1
  152. package/dist/client/assets/empty-state-BJnVPwS4.js +0 -1
  153. package/dist/client/assets/file-browser-EXbuz5vW.js +0 -2
  154. package/dist/client/assets/form-Bu0daHLu.js +0 -1
  155. package/dist/client/assets/grid-view-C6S8iSjv.js +0 -1
  156. package/dist/client/assets/home-2CTqvtNy.js +0 -1
  157. package/dist/client/assets/index-CqeIU8-o.css +0 -1
  158. package/dist/client/assets/layout-DspSCzsh.js +0 -1
  159. package/dist/client/assets/mcp-server-card-HpdQ81Kj.js +0 -1
  160. package/dist/client/assets/mcp-server-detail-DhHV0S77.js +0 -2
  161. package/dist/client/assets/members-NoyLiC53.js +0 -3
  162. package/dist/client/assets/monitoring-rg9mX2h3.js +0 -49
  163. package/dist/client/assets/page-BpnXhWf3.js +0 -1
  164. package/dist/client/assets/page-KXdqzJaF.js +0 -1
  165. package/dist/client/assets/pin-to-sidebar-button-Bsv2_7kr.js +0 -1
  166. package/dist/client/assets/plugins-CW7mTNa6.js +0 -1
  167. package/dist/client/assets/popover-DEmRxXmY.js +0 -1
  168. package/dist/client/assets/select-BKwPUbTK.js +0 -1
  169. package/dist/client/assets/settings-ZWpf163v.js +0 -1
  170. package/dist/client/assets/shell-layout-D0SSCuI2.js +0 -3
  171. package/dist/client/assets/tools-list-DopNeyHc.js +0 -1
  172. package/dist/client/assets/tooltip-9zLX7HP0.js +0 -1
  173. package/dist/client/assets/typewriter-title-BJariIWR.js +0 -16
  174. package/dist/client/assets/use-collections-DtjYeVzj.js +0 -1
  175. package/dist/client/assets/use-deco-chat-open-CrQFHW7J.js +0 -1
  176. package/dist/client/assets/useInfiniteQuery-CaX6JmUq.js +0 -1
  177. package/dist/client/assets/useQuery-KlPPWaKy.js +0 -1
  178. package/dist/client/assets/useSuspenseInfiniteQuery-jy6MmqiZ.js +0 -1
  179. package/dist/client/assets/workflow-B1lnmdqO.js +0 -1
@@ -1 +1 @@
1
- import{r as c}from"./index-DZqSbjFw.js";const h=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=y(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const w=c.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:p,...n},d)=>c.createElement("svg",{ref:d,...k,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",s),...!a&&!f(n)&&{"aria-hidden":"true"},...n},[...p.map(([m,C])=>c.createElement(m,C)),...Array.isArray(a)?a:[a]]));const u=(t,e)=>{const r=c.forwardRef(({className:o,...s},a)=>c.createElement(w,{ref:a,iconNode:e,className:l(`lucide-${h(i(t))}`,`lucide-${t}`,o),...s}));return r.displayName=i(t),r};const g=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",g);const x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],L=u("circle-alert",x);export{L as C,b as a,u as c};
1
+ import{r as c}from"./index-bZDjEZjy.js";const h=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=y(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const w=c.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:p,...n},d)=>c.createElement("svg",{ref:d,...k,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",s),...!a&&!f(n)&&{"aria-hidden":"true"},...n},[...p.map(([m,C])=>c.createElement(m,C)),...Array.isArray(a)?a:[a]]));const u=(t,e)=>{const r=c.forwardRef(({className:o,...s},a)=>c.createElement(w,{ref:a,iconNode:e,className:l(`lucide-${h(i(t))}`,`lucide-${t}`,o),...s}));return r.displayName=i(t),r};const g=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",g);const x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],L=u("circle-alert",x);export{L as C,b as a,u as c};
@@ -1,4 +1,4 @@
1
- import{r as C,bv as Na,bw as Ca,a0 as Ta,bd as B,s as h,bx as je,by as Ot,bh as Aa,bi as Ma,bc as Ra,be as U,b8 as Ie,n as Ne,o as R,bf as I,bg as re,bz as ja,bA as O,_ as Oa,bq as ka,c as D,u as Ce,a as kt,K as Pt,ab as Pa,ao as ze,j as d,g as Da,w as $a,x as Xe,aw as La,z as Za,E as Fa,D as Ua,y as za,b1 as Ba}from"./index-DZqSbjFw.js";import{u as ke,a as Ke,d as Va}from"./constants-Mpett05j.js";import{b as qa}from"./use-virtual-mcp-D3UgDP8i.js";import{b as Dt}from"./use-collections-DtjYeVzj.js";import{b as Ja}from"./use-connection-BzhGWFyL.js";import{a as Wa}from"./use-binding-B1LqCJr8.js";import{u as Ha}from"./useSuspenseInfiniteQuery-jy6MmqiZ.js";import{u as Be,L as $t}from"./localstorage-keys-DpM3uKv7.js";import{c as et,B as Ya}from"./button-0ydgHweE.js";import{I as Ga}from"./input-u1hHzCA4.js";import{P as Qa,a as Xa,b as Ka}from"./popover-DEmRxXmY.js";import{S as es,a as ts,b as as,c as ss,d as rs}from"./select-BKwPUbTK.js";import{t as ut}from"./ChevronDown-DY2hRH3P.js";import{i as ns}from"./File06-OiAbO58I.js";import{c as os}from"./Grid01-Bdrpv4xX.js";import{a as is}from"./Image01-DvLyxsOA.js";import{i as Lt}from"./SearchMd-BeBVRrdw.js";var Ee;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(Ee||(Ee={}));var dt;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(dt||(dt={}));Ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof Oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}Oe.create=t=>new Oe(t);var pt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(pt||(pt={}));var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Zt=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Zt.displayName="ChevronSelectorVertical";const Ft=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));Ft.displayName="CurrencyDollar";const Ut=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ut.displayName="LogOut04";const zt=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));zt.displayName="Stars01";var Bt="vercel.ai.error",ls=Symbol.for(Bt),mt,ft,Q=class Vt extends(ft=Error,mt=ls,ft){constructor({name:e,message:a,cause:s}){super(a),this[mt]=!0,this.name=e,this.cause=s}static isInstance(e){return Vt.hasMarker(e,Bt)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function qt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Jt="AI_InvalidArgumentError",Wt=`vercel.ai.error.${Jt}`,cs=Symbol.for(Wt),ht,gt,us=class extends(gt=Q,ht=cs,gt){constructor({message:t,cause:e,argument:a}){super({name:Jt,message:t,cause:e}),this[ht]=!0,this.argument=a}static isInstance(t){return Q.hasMarker(t,Wt)}},Ht="AI_JSONParseError",Yt=`vercel.ai.error.${Ht}`,ds=Symbol.for(Yt),vt,yt,bt=class extends(yt=Q,vt=ds,yt){constructor({text:t,cause:e}){super({name:Ht,message:`JSON parsing failed: Text: ${t}.
1
+ import{r as C,bu as Na,bv as Ca,a4 as Ta,bd as B,s as h,bw as je,bx as Ot,bh as Aa,bi as Ma,bc as Ra,be as U,b8 as Ie,n as Ne,o as R,bf as I,bg as re,by as ja,bz as O,_ as Oa,bp as ka,c as D,u as Ce,a as kt,K as Pt,af as Pa,v as ze,j as d,g as Da,B as $a,D as Xe,ay as La,F as Za,J as Fa,H as Ua,E as za,b1 as Ba}from"./index-bZDjEZjy.js";import{u as ke,a as Ke,d as Va}from"./constants-BZCTYQ-m.js";import{b as qa}from"./use-virtual-mcp-Mo0Ax2sa.js";import{b as Dt}from"./use-collections-C8m0cpJK.js";import{b as Ja}from"./use-connection-BsXZoJuC.js";import{a as Wa}from"./use-binding-a8EbFjQ8.js";import{u as Ha}from"./useSuspenseInfiniteQuery-D9t8xGlB.js";import{u as Be,L as $t}from"./localstorage-keys-Bdti-2mC.js";import{c as et,B as Ya}from"./button-ClfTbYRX.js";import{I as Ga}from"./input-Db3X6HvF.js";import{P as Qa,a as Xa,b as Ka}from"./popover-CjjV7g4X.js";import{S as es,a as ts,b as as,c as ss,d as rs}from"./select-DdPku9Z8.js";import{t as ut}from"./ChevronDown-DutrckZC.js";import{i as ns}from"./File06-Dyp_EEPp.js";import{c as os}from"./Grid01-hfoOS4OQ.js";import{a as is}from"./Image01-BBnTxqKs.js";import{i as Lt}from"./SearchMd-7_DsxZht.js";var Ee;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(Ee||(Ee={}));var dt;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(dt||(dt={}));Ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof Oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}Oe.create=t=>new Oe(t);var pt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(pt||(pt={}));var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Zt=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Zt.displayName="ChevronSelectorVertical";const Ft=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));Ft.displayName="CurrencyDollar";const Ut=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ut.displayName="LogOut04";const zt=({size:t=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));zt.displayName="Stars01";var Bt="vercel.ai.error",ls=Symbol.for(Bt),mt,ft,Q=class Vt extends(ft=Error,mt=ls,ft){constructor({name:e,message:a,cause:s}){super(a),this[mt]=!0,this.name=e,this.cause=s}static isInstance(e){return Vt.hasMarker(e,Bt)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function qt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Jt="AI_InvalidArgumentError",Wt=`vercel.ai.error.${Jt}`,cs=Symbol.for(Wt),ht,gt,us=class extends(gt=Q,ht=cs,gt){constructor({message:t,cause:e,argument:a}){super({name:Jt,message:t,cause:e}),this[ht]=!0,this.argument=a}static isInstance(t){return Q.hasMarker(t,Wt)}},Ht="AI_JSONParseError",Yt=`vercel.ai.error.${Ht}`,ds=Symbol.for(Yt),vt,yt,bt=class extends(yt=Q,vt=ds,yt){constructor({text:t,cause:e}){super({name:Ht,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${qt(e)}`,cause:e}),this[vt]=!0,this.text=t}static isInstance(t){return Q.hasMarker(t,Yt)}},Gt="AI_TypeValidationError",Qt=`vercel.ai.error.${Gt}`,ps=Symbol.for(Qt),xt,_t,ve=class Ve extends(_t=Q,xt=ps,_t){constructor({value:e,cause:a,context:s}){let r="Type validation failed";if(s?.field&&(r+=` for ${s.field}`),s?.entityName||s?.entityId){r+=" (";const n=[];s.entityName&&n.push(s.entityName),s.entityId&&n.push(`id: "${s.entityId}"`),r+=n.join(", "),r+=")"}super({name:Gt,message:`${r}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${qt(a)}`,cause:a}),this[xt]=!0,this.value=e,this.context=s}static isInstance(e){return Q.hasMarker(e,Qt)}static wrap({value:e,cause:a,context:s}){var r,n,i;return Ve.isInstance(a)&&a.value===e&&((r=a.context)==null?void 0:r.field)===s?.field&&((n=a.context)==null?void 0:n.entityName)===s?.entityName&&((i=a.context)==null?void 0:i.entityId)===s?.entityId?a:new Ve({value:e,cause:a,context:s})}},Te=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new us({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},ms=Te();function It(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function pe(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function Et(t,...e){const a=new Headers(pe(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var fs=/"__proto__"\s*:/,hs=/"constructor"\s*:/;function wt(t){const e=JSON.parse(t);return e===null||typeof e!="object"||fs.test(t)===!1&&hs.test(t)===!1?e:gs(e)}function gs(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const n=s[r];n&&typeof n=="object"&&e.push(n)}}}return t}function vs(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return wt(t)}try{return wt(t)}finally{Error.stackTraceLimit=e}}function tt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=de(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(de):de(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(de)),t.allOf!=null&&(t.allOf=t.allOf.map(de)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(de));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=de(e[a]);return t}function de(t){return typeof t=="boolean"?t:tt(t)}var ys=Symbol("Let zodToJsonSchema decide on which parser to use"),St={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},bs=t=>typeof t=="string"?{...St,name:t}:{...St,...t};function q(){return{}}function xs(t,e){var a,s,r;const n={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==w.ZodAny&&(n.items=M(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function _s(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Is(){return{type:"boolean"}}function Xt(t,e){return M(t.type._def,e)}var Es=(t,e)=>M(t.innerType._def,e);function Kt(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,n)=>Kt(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ws(t)}}var ws=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Ss(t,e){return{...M(t.innerType._def,e),default:t.defaultValue()}}function Ns(t,e){return e.effectStrategy==="input"?M(t.schema._def,e):q()}function Cs(t){return{type:"string",enum:Array.from(t.values)}}var Ts=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function As(t,e){const a=[M(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),M(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(Ts(r))s.push(...r.allOf);else{let n=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...o}=r;n=o}s.push(n)}}),s.length?{allOf:s}:void 0}function Ms(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Ze=void 0,H={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ze===void 0&&(Ze=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ze),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ea(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":Y(a,"email",s.message,e);break;case"format:idn-email":Y(a,"idn-email",s.message,e);break;case"pattern:zod":F(a,H.email,s.message,e);break}break;case"url":Y(a,"uri",s.message,e);break;case"uuid":Y(a,"uuid",s.message,e);break;case"regex":F(a,s.regex,s.message,e);break;case"cuid":F(a,H.cuid,s.message,e);break;case"cuid2":F(a,H.cuid2,s.message,e);break;case"startsWith":F(a,RegExp(`^${Fe(s.value,e)}`),s.message,e);break;case"endsWith":F(a,RegExp(`${Fe(s.value,e)}$`),s.message,e);break;case"datetime":Y(a,"date-time",s.message,e);break;case"date":Y(a,"date",s.message,e);break;case"time":Y(a,"time",s.message,e);break;case"duration":Y(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{F(a,RegExp(Fe(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&Y(a,"ipv4",s.message,e),s.version!=="v4"&&Y(a,"ipv6",s.message,e);break}case"base64url":F(a,H.base64url,s.message,e);break;case"jwt":F(a,H.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&F(a,H.ipv4Cidr,s.message,e),s.version!=="v4"&&F(a,H.ipv6Cidr,s.message,e);break}case"emoji":F(a,H.emoji(),s.message,e);break;case"ulid":{F(a,H.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Y(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{F(a,H.base64,s.message,e);break}}break}case"nanoid":F(a,H.nanoid,s.message,e)}return a}function Fe(t,e){return e.patternStrategy==="escape"?js(t):t}var Rs=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function js(t){let e="";for(let a=0;a<t.length;a++)Rs.has(t[a])||(e+="\\"),e+=t[a];return e}function Y(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function F(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Nt(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Nt(e,s)}function Nt(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,c=!1;for(let l=0;l<r.length;l++){if(i){n+=r[l],i=!1;continue}if(s.i){if(o){if(r[l].match(/[a-z]/)){c?(n+=r[l],n+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(n+=r[l],c=!0):n+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){n+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){n+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(r[l]==="$"){n+=`($|(?=[\r
@@ -0,0 +1,26 @@
1
+ import{bD as Q,r as k,o as Fs,s as bt,c as C,j as o,b6 as Ot,u as Y,k as Vs,y as Bs,a as re,f as Us,q as Ze,v as Sn,bt as F,bE as qs,az as Ks,D as Rt,F as ne,H as wn,aA as Js,B as At,ax as Gs,aB as Nn,E as Cn,aH as Xs,aI as Zs,J as kn,aJ as Qs,bF as Mt,bG as Ys,ay as eo,b2 as to,z as no,bH as so,bI as In}from"./index-bZDjEZjy.js";import{E as _n,T as ce,a as ae,b as de,c as ue,I as st,n as oo}from"./empty-state-DYXlKoSr.js";import{E as Tn}from"./error-boundary-BNlY9vIT.js";import{a as Pt,u as Lt,g as zt,e as Dt,d as Wt}from"./use-collections-C8m0cpJK.js";import{u as ee,i as ro}from"./constants-BZCTYQ-m.js";import{P as Ht}from"./pin-to-sidebar-button-Dz_XGqkX.js";import{B as V,c as R}from"./button-ClfTbYRX.js";import{F as jt,a as io,b as Ft,d as Vt}from"./form-CYYoaqIb.js";import{I as Bt}from"./input-Db3X6HvF.js";import{T as kt}from"./textarea-CJUn3-Wq.js";import{i as $n,a as lo}from"./Tool01-BI-I3hYP.js";import{a as En,V as Ut,b as fe}from"./layout-oEMg2tAu.js";import{S as On,a as Rn,b as An,c as Mn,d as It}from"./select-DdPku9Z8.js";import{i as co}from"./AlertCircle-DZft-TG2.js";import{s as ao,M as Ae}from"./monaco-editor-B37z8w3N.js";import{i as uo}from"./Code01-DedonTWa.js";import{a as fo}from"./Copy01-BWDgSjt6.js";import{i as De}from"./Loading01-267RBTet.js";import{i as qt}from"./Play-DAIuzg5S.js";import{s as Kt}from"./XClose-BU7t8GBR.js";import{B as Pn,a as Ln,b as Re,d as Qe,e as Ye,c as zn}from"./breadcrumb-DYzoaO6c.js";import{u as mo,O as po,M as xo,F as ho,v as go}from"./index-Bb-7JPLn.js";import{u as ot,b as bo}from"./use-connection-BsXZoJuC.js";import{E as Jt}from"./empty-state-uG-DnAQb.js";import{D as jo,a as vo}from"./use-binding-a8EbFjQ8.js";import{b as Dn}from"./use-virtual-mcp-Mo0Ax2sa.js";import{b as yo,a as dn,R as So}from"./resizable-Ds3XfyD1.js";import{S as We}from"./spinner-Ch036S5x.js";import{V as wo}from"./view-mode-toggle-BuBlE9kN.js";import{N as No,S as Co,a as ko,c as Io,m as Je,P as _o,i as To,R as $o,b as Eo,d as Oo,e as un,E as Ro,f as Ao}from"./index-DQEC9k6R.js";import{b as Mo,c as Po,d as Lo,e as zo,a as Do,D as Wo}from"./dialog-Btg4sCez.js";import"./index-B8-fuOjQ.js";import{s as Wn}from"./Plus-zV6WU4JB.js";import{n as Ho}from"./Calendar-D09MNLuS.js";import{i as Gt}from"./Check-DCDAnqOU.js";import{i as Fo}from"./DotsHorizontal-HzP-MqOT.js";import{D as Vo,a as Bo,b as Uo,c as fn}from"./dropdown-menu-DN1Ltf10.js";import{T as qo,R as Ko,b as Jo,c as Hn}from"./collapsible-CZO59QRP.js";import{i as Go}from"./ChevronRight-DspCPj_w.js";import{B as Oe}from"./badge-D0aebo3b.js";import{i as Fn}from"./X-BDbowDxs.js";import"./useMutation-BUU-3CfS.js";import"./useQuery-CziyW3rA.js";import"./Pin01-DBrrq4D2.js";import"./use-organization-settings-C7v8TF4x.js";import"./index-By5YaRHP.js";import"./ChevronDown-DutrckZC.js";import"./mcp-oauth-BmPwjDVD.js";import"./env-vars-editor-ChPRpV0a.js";import"./Trash01-DlcrlG40.js";import"./File06-Dyp_EEPp.js";import"./Key01-ImEEyxuW.js";import"./extract-connection-data-Bjn7AN9v.js";import"./constants-ClcoOK3l.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-pqvn-SQ9.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-DyHs8Rf6.js";import"./Users03-b0Q6Esat.js";import"./circle-alert-O76dHf-6.js";import"./index-B8Y83hFI.js";import"./binder-DhS3ZsVD.js";import"./popover-CjjV7g4X.js";import"./use-mcp-prompts-CauCdNEE.js";import"./ArrowUp-D5u5S04m.js";import"./Edit01-D7FAjBpe.js";import"./localstorage-keys-Bdti-2mC.js";import"./SearchMd-7_DsxZht.js";import"./use-create-virtual-mcp-C-dJH0KT.js";import"./useSuspenseInfiniteQuery-D9t8xGlB.js";import"./infiniteQueryObserver-R-jPe69x.js";import"./Grid01-hfoOS4OQ.js";import"./Image01-BBnTxqKs.js";const Vn=Q("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const Bn=Q("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Xt=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Zt=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Xo=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Zo=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Qo=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Un=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const qn=Q("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Kn=Q("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Jn=Q("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Gn=Q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Qt=({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"}));Qt.displayName="AlertOctagon";const Xn=({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"}));Xn.displayName="Box";const Zn=({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"}));Zn.displayName="ClockFastForward";const Qn=({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"}));Qn.displayName="Code02";const Ge=({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"}));Ge.displayName="Columns01";const Yn=({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"}));Yn.displayName="CornerDownRight";const es=({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"}));es.displayName="Database01";const ts=({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"}));ts.displayName="GitBranch01";const ns=({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"}));ns.displayName="Repeat03";const Yt=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Yt.displayName="Save02";Fs({title:bt().min(1),description:bt().nullable(),body:bt()});function vt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Yo(){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 er(t){const e=C.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(jt,{control:n.control,name:"title",render:sr}),o.jsx(jt,{control:n.control,name:"description",render:nr})]})]}),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(jt,{control:n.control,name:"body",render:tr})]}),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 u;return e[10]!==n||e[11]!==a?(u=o.jsx(io,{...n,children:a}),e[10]=n,e[11]=a,e[12]=u):u=e[12],u}function tr(t){const{field:e}=t;return o.jsx(Ft,{children:o.jsx(Vt,{children:o.jsx(kt,{...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 nr(t){const{field:e}=t;return o.jsxs(Ft,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Vt,{children:o.jsx(Bt,{...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 sr(t){const{field:e}=t;return o.jsxs(Ft,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Vt,{children:o.jsx(Bt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function or(t){const e=C.c(51),{providerId:n,promptId:s}=t,r=Ot().location.href,{org:l}=Y(),c=n||null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const u=ee(a),d=Pt(n,"PROMPT",s,u),f=Lt(n,"PROMPT",u),m=f.update.isPending;let x;e[3]!==d?(x=d?{title:d.title,description:d.description??null,body:vt(d)}:void 0,e[3]=d,e[4]=x):x=e[4];let p;e[5]!==x?(p={values:x},e[5]=x,e[6]=p):p=e[6];const h=Vs(p);let g;e[7]!==h||e[8]!==d?(g=()=>{d&&h.reset({title:d.title,description:d.description??null,body:vt(d)})},e[7]=h,e[8]=d,e[9]=g):g=e[9];const b=g;let j;e[10]!==f.update||e[11]!==h||e[12]!==s?(j=h.handleSubmit(async B=>{const J=await f.update.mutateAsync({id:s,data:{title:B.title,description:B.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:B.body}}]}});h.reset({title:J.title,description:J.description??null,body:vt(J)})}),e[10]=f.update,e[11]=h,e[12]=s,e[13]=j):j=e[13];const y=j;if(!d){let B;return e[14]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(_n,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=B):B=e[14],B}let S;e[15]!==d.title?(S=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:d.title}),e[15]=d.title,e[16]=S):S=e[16];let v;e[17]!==d.description?(v=d.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:d.description})]}):null,e[17]=d.description,e[18]=v):v=e[18];let w;e[19]!==S||e[20]!==v?(w=o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,v]})}),e[19]=S,e[20]=v,e[21]=w):w=e[21];let N;e[22]!==d.title||e[23]!==r?(N=o.jsx(Ht,{title:d.title,url:r,icon:"description"}),e[22]=d.title,e[23]=r,e[24]=N):N=e[24];const T=!h.formState.isDirty||m;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx($n,{size:14}),e[25]=I):I=e[25];let E;e[26]!==b||e[27]!==T?(E=o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:b,"aria-label":"Cancel",children:I})})}),e[26]=b,e[27]=T,e[28]=E):E=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(ae,{side:"bottom",children:"Cancel"}),e[29]=A):A=e[29];let M;e[30]!==E?(M=o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[E,A]})}),e[30]=E,e[31]=M):M=e[31];const D=!h.formState.isDirty||m;let P;e[32]!==y?(P=()=>{y()},e[32]=y,e[33]=P):P=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(Yt,{size:14}),e[34]=L):L=e[34];let z;e[35]!==D||e[36]!==P?(z=o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:D,onClick:P,"aria-label":"Save",children:L})})}),e[35]=D,e[36]=P,e[37]=z):z=e[37];let K;e[38]===Symbol.for("react.memo_cache_sentinel")?(K=o.jsx(ae,{side:"bottom",children:"Save"}),e[38]=K):K=e[38];let _;e[39]!==z?(_=o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[z,K]})}),e[39]=z,e[40]=_):_=e[40];let $;e[41]!==N||e[42]!==M||e[43]!==_?($=o.jsxs(Ut,{children:[N,M,_]}),e[41]=N,e[42]=M,e[43]=_,e[44]=$):$=e[44];let O;e[45]!==h?(O=o.jsx("div",{className:"h-full",children:o.jsx(er,{form:h})}),e[45]=h,e[46]=O):O=e[46];let W;return e[47]!==$||e[48]!==O||e[49]!==w?(W=o.jsxs(fe,{children:[w,$,O]}),e[47]=$,e[48]=O,e[49]=w,e[50]=W):W=e[50],W}function rr(t){const e=C.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Yo(),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(_n,{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(Tn,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(or,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const ir=Bs("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 lr(t){const e=C.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(ir({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 cr(t){const e=C.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 ar(t){const e=C.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 mn=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function dr(t){const e=C.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=mo(r);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==i?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(po,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(xo,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(ur,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function ur({toolName:t,connectionId:e}){const s=Ot().location.href,{replayId:i}=Us({strict:!1}),r=(()=>{if(!i)return null;const _=`replay-${i}`,$=sessionStorage.getItem(_);if(!$)return null;sessionStorage.removeItem(_);try{return JSON.parse($)}catch{return null}})(),l=(()=>{if(!r)return null;const _={};for(const[$,O]of Object.entries(r))O!==null&&typeof O=="object"?_[$]=JSON.stringify(O,null,2):_[$]=O;return _})(),[c,a]=k.useState(l??{}),[u,d]=k.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(!1),[b,j]=k.useState(null),{org:y}=Y(),S=ot(e),v=ee({connectionId:e,orgId:y.id}),w=zt({client:v}),N=w.data?.tools?.find(_=>_.name===t),T=N?.inputSchema?.properties,I=T?Object.keys(T):[],E=I.length>0,A={};if(E&&N?.inputSchema?.properties)for(const _ of I)A[_]=N.inputSchema.required?.includes(_)?"":void 0;const M=_=>Object.prototype.hasOwnProperty.call(c,_),D=async()=>{g(!0),p(null),m(null),j(null);const _=performance.now();try{if(!v)throw new Error("MCP client is not available");const $=E?{...A,...c}:(()=>{const q=u.trim();if(!q)return{};const Z=JSON.parse(q);if(Z&&typeof Z=="object")return Z;throw new Error("Raw JSON input must be an object.")})();E&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([q,Z])=>{if((Z.type==="object"||Z.type==="array")&&typeof $[q]=="string")try{$[q]=JSON.parse($[q])}catch{}});const O=await v.callTool({name:t,arguments:$}),W=O.structuredContent??O,B=performance.now(),J=Math.round(B-_);m(W);const oe=JSON.stringify(W),X=new TextEncoder().encode(oe).length;j({duration:`${J}ms`,bytes:`${X} bytes`,tokens:`~${Math.ceil(X/4)} tokens`,cost:"$0.0000"})}catch($){const O=$ instanceof Error?$.message:String($);p(O||"Unknown error occurred");const W=performance.now();j({duration:`${Math.round(W-_)}ms`})}finally{g(!1)}},P=(_,$)=>{a(O=>({...O,[_]:$}))},L=()=>{m(null),p(null),j(null)},z=N?.name??mn(t),K=o.jsx(Pn,{children:o.jsxs(Ln,{children:[o.jsx(Re,{children:o.jsx(Qe,{asChild:!0,children:o.jsx(Ze,{to:"/$org/mcps",params:{org:y.slug},children:"Connections"})})}),o.jsx(Ye,{}),S&&o.jsxs(o.Fragment,{children:[o.jsx(Re,{children:o.jsx(Qe,{asChild:!0,children:o.jsx(Ze,{to:"/$org/mcps/$connectionId",params:{org:y.slug,connectionId:e},search:{tab:"tools"},children:S.title})})}),o.jsx(Ye,{})]}),o.jsx(Re,{children:o.jsx(zn,{children:z})})]})});return o.jsxs(fe,{breadcrumb:K,children:[o.jsx(Ut,{children:o.jsx(Ht,{title:N?.name??mn(t),url:s,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(st,{icon:S?.icon||null,name:S?.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:[w.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.isLoading?o.jsx(De,{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:w.isSuccess?"ready":w.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.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"}),N?.inputSchema?.required&&N.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:E&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([_,$])=>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:[_,N.inputSchema?.required?.includes(_)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.type})]}),$.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.description}),$.type==="object"||$.type==="array"?o.jsx(kt,{className:"font-mono text-xs",value:M(_)?c[_]??"":A[_]??"",onChange:O=>P(_,O.target.value),placeholder:`Enter ${_} as JSON...`,rows:3}):$.type==="boolean"?o.jsxs(On,{value:M(_)?String(c[_]??""):"",onValueChange:O=>P(_,O==="true"),children:[o.jsx(Rn,{children:o.jsx(An,{placeholder:"Select true or false..."})}),o.jsxs(Mn,{children:[o.jsx(It,{value:"true",children:"true"}),o.jsx(It,{value:"false",children:"false"})]})]}):o.jsx(Bt,{value:M(_)?c[_]??"":A[_]??"",onChange:O=>P(_,O.target.value),placeholder:`Enter ${_}...`})]},_)):N?.inputSchema&&!E?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(kt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:_=>d(_.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),b&&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(ao,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Xn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(es,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(V,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:D,disabled:h,children:h?o.jsxs(o.Fragment,{children:[o.jsx(De,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(qt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(de,{children:o.jsxs(ue,{children:[o.jsx(ce,{asChild:!0,children:o.jsx(V,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:L,disabled:!f&&!x,children:o.jsx(Kt,{size:14})})}),o.jsx(ae,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),x&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(lr,{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(co,{className:"h-4 w-4"}),o.jsx(cr,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(ar,{className:"text-xs text-destructive",children:x})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:f?o.jsxs(o.Fragment,{children:[o.jsx(Ae,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(V,{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(f,null,2)),Sn.success("Copied to clipboard")},children:o.jsx(fo,{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(uo,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function fr(t){const e=C.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=re(i).connectionId;if(!ot(l)||!l){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[1],d}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(De,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let u;return e[3]!==l||e[4]!==s||e[5]!==n?(u=o.jsx(k.Suspense,{fallback:a,children:o.jsx(dr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=u):u=e[6],u}const pn=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(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:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},en=(t=>t?pn(t):pn),mr=t=>t;function _t(t,e=mr){const n=F.useSyncExternalStore(t.subscribe,F.useCallback(()=>e(t.getState()),[t,e]),F.useCallback(()=>e(t.getInitialState()),[t,e]));return F.useDebugValue(n),n}const pr=t=>{const e=en(t),n=s=>_t(e,s);return Object.assign(n,e),n},xr=(t=>pr);function ss(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 Tt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Tt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Tt(s)(n)}}}},hr=(t,e)=>(n,s,i)=>{let r={storage:ss(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)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 d.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(!d)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Tt(d.getItem.bind(d))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.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,S.state];return[!1,void 0]}).then(S=>{var v;if(j!==c)return;const[w,N]=S;if(p=r.merge(N,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(y?.(p,void 0),p=s(),l=!0,u.forEach(S=>S(p)))}).catch(S=>{j===c&&y?.(void 0,S)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},os=hr,{useSyncExternalStoreWithSelector:gr}=qs,br=t=>t;function jr(t,e=br,n){const s=gr(t.subscribe,t.getState,t.getInitialState,e,n);return F.useDebugValue(s),s}const xn=t=>Symbol.iterator in t,hn=t=>"entries"in t,gn=(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},vr=(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 yr(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:xn(t)&&xn(e)?hn(t)&&hn(e)?gn(t,e):vr(t,e):gn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Sr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
+ ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
+ `:""} ${u}${f}: ${n(d)};`}).join(`
4
+ `)}
5
+ }`}return`interface ${e} ${n(t)}`}function yt(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 wr(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
6
+
7
+ ${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function St(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...jo,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const rs=k.createContext(null),Nr=t=>en()(os(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??St(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:yt(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 u=St("code",Number((Math.random()*1e6).toFixed(0)));if(u={...u,input:l},a){const f=Sr(a,"Input"),m=u.action,x=wr(m.code,f);u={...u,action:{...m,code:x}}}const d=yt(u.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...u,name:d}]},currentStepName:d}}),addToolStep:()=>e(n=>{let s=St("tool",Number((Math.random()*1e6).toFixed(0)));const i=yt(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:ss(()=>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 Cr(t){const e=C.c(8),{children:n,initialState:s}=t,i=Dn();let r;e[0]!==s.currentStepTab||e[1]!==s.trackingExecutionId||e[2]!==s.workflow||e[3]!==i?.[0]?.id?(r=()=>Nr({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:i?.[0]?.id,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[0]=s.currentStepTab,e[1]=s.trackingExecutionId,e[2]=s.workflow,e[3]=i?.[0]?.id,e[4]=r):r=e[4];const[l]=k.useState(r);let c;return e[5]!==n||e[6]!==l?(c=o.jsx(rs.Provider,{value:l,children:n}),e[5]=n,e[6]=l,e[7]=c):c=e[7],c}function He(t,e){const n=k.useContext(rs);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return jr(n,t,yr)}function Me(){return He(kr)}function kr(t){return t.workflow}function G(){return He(Ir)}function Ir(t){return t.actions}function is(){const t=Ve();return He(_r)??t[0]?.name}function _r(t){return t.currentStepName}function Fe(){const t=C.c(5),e=is(),n=Ve();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 Ve(){return Me().steps}function $t(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(!$t(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)||!$t(n[l],s[l]))return!1;return!0}return!1}function ls(){const t=C.c(5),e=Me();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=Ms(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=$t(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function H(){return He(Tr)}function Tr(t){return t.trackingExecutionId}function Pe(){return He($r)}function $r(t){return t.selectedVirtualMcpId}function Er(t){const e=C.c(18),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=Dn()??[],a=On,u=n??void 0;let d;e[0]!==s?(d=j=>s(j===""?void 0:j),e[0]=s,e[1]=d):d=e[1];let f;e[2]!==i?(f=R("text-xs",i),e[2]=i,e[3]=f):f=e[3];let m;e[4]!==l?(m=o.jsx(An,{placeholder:l}),e[4]=l,e[5]=m):m=e[5];let x;e[6]!==f||e[7]!==m?(x=o.jsx(Rn,{size:"sm",className:f,children:m}),e[6]=f,e[7]=m,e[8]=x):x=e[8];const p=Mn,h=c.filter(Rr).map(Or);let g;e[9]!==p||e[10]!==h?(g=o.jsx(p,{children:h}),e[9]=p,e[10]=h,e[11]=g):g=e[11];let b;return e[12]!==a||e[13]!==u||e[14]!==d||e[15]!==x||e[16]!==g?(b=o.jsxs(a,{value:u,onValueChange:d,children:[x,g]}),e[12]=a,e[13]=u,e[14]=d,e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function Or(t){return o.jsx(It,{value:t.id,children:t.title},t.id)}function Rr(t){return t.id!==null&&!ro(t.id)}function Le(){const t=C.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=vo(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}const bn=[100,1e3,2e3];function ie(t){const e=C.c(15),{org:n}=Y(),s=Le(),i=k.useRef(0);let r;e[0]!==s.id||e[1]!==n.id?(r={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==t?(c={id:t},e[3]=t,e[4]=c):c=e[4];const a=!!t;let u;e[5]!==t?(u=t?h=>{const b=h.state?.data,y=(b?.structuredContent??b)?.item?.status;if(y==="running"||y==="enqueued"){const S=bn[i.current]??1;return i.current=(i.current+1)%bn.length,S}return i.current=0,!1}:!1,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==c||e[9]!==a||e[10]!==u?(d={client:l,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:c,gcTime:0,enabled:a,select:Ar,refetchInterval:u},e[7]=l,e[8]=c,e[9]=a,e[10]=u,e[11]=d):d=e[11];const{data:f,isLoading:m}=Dt(d),x=f?.item;let p;return e[12]!==m||e[13]!==x?(p={item:x,isLoading:m},e[12]=m,e[13]=x,e[14]=p):p=e[14],p}function Ar(t){return t.structuredContent??t}function cs(t,e,n){const s=C.c(15),{org:i}=Y(),r=Le();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=ee(l),a=(n?.enabled??!0)&&!!t&&!!e;let u;s[3]!==t||s[4]!==e?(u={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=u):u=s[5];const d=n?.refetchInterval;let f;s[6]!==c||s[7]!==a||s[8]!==u||s[9]!==d?(f={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:u,enabled:a,refetchInterval:d,select:Mr},s[6]=c,s[7]=a,s[8]=u,s[9]=d,s[10]=f):f=s[10];const{data:m,isLoading:x}=Dt(f),p=m?.output,h=m?.error;let g;return s[11]!==x||s[12]!==p||s[13]!==h?(g={output:p,error:h,isLoading:x},s[11]=x,s[12]=p,s[13]=h,s[14]=g):g=s[14],g}function Mr(t){return t.structuredContent??t}function Pr(){const t=C.c(19),{org:e}=Y(),n=Le(),s=Me();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ee(i);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=["workflow"],t[3]=l):l=t[3];let c;t[4]!==s.id?(c={field:l,operator:"eq",value:s.id},t[4]=s.id,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=[{field:["created_at"],direction:"desc"}],t[6]=a):a=t[6];let u;t[7]!==c?(u={where:c,orderBy:a,limit:100},t[7]=c,t[8]=u):u=t[8];const d=!!s.id;let f;t[9]!==r||t[10]!==u||t[11]!==d?(f={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:u,enabled:d,staleTime:5e3,select:Lr},t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];const{data:m,isLoading:x,refetch:p}=Dt(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 Lr(t){return t.structuredContent??t}function as(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 zr(t){const e=[];for(const n of t){const s=as(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function Dr(t){for(const e of t)if(as(e.input).includes("__entire_input__"))return!0;return!1}function Wr(t){const e=zr(t);if(e.length===0)return Dr(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function Hr(){const t=C.c(2),e=Me();let n;return t[0]!==e.steps?(n=Wr(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function Fr(){const t=C.c(15),{org:e}=Y(),{id:n}=Le(),{setTrackingExecutionId:s}=G(),i=Me(),r=Pe(),l=Hr();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ee(c);let u;t[3]!==a?(u={client:a},t[3]=a,t[4]=u):u=t[4];const{mutateAsync:d,isPending:f}=Wt(u);let m;t[5]!==r||t[6]!==s||t[7]!==d||t[8]!==i?(m=async g=>{const b=g===void 0?{}:g;if(!r)throw new Error("Please select an Agent before running the workflow");const j=Date.now(),y=await d({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:r,start_at_epoch_ms:j,workflow_collection_id:i.id}}),v=(y.structuredContent??y)?.item?.id??void 0;return s(v),v},t[5]=r,t[6]=s,t[7]=d,t[8]=i,t[9]=m):m=t[9];const x=m,p=l!==null;let h;return t[10]!==x||t[11]!==l||t[12]!==f||t[13]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[10]=x,t[11]=l,t[12]=f,t[13]=p,t[14]=h):h=t[14],h}function Vr(){const t=C.c(10),{org:e}=Y(),{id:n}=Le();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Wt(r);let a;t[5]!==l?(a=async f=>await l({name:"CANCEL_EXECUTION",arguments:{executionId:f}}),t[5]=l,t[6]=a):a=t[6];const u=a;let d;return t[7]!==u||t[8]!==c?(d={handleCancelWorkflow:u,isCancelling:c},t[7]=u,t[8]=c,t[9]=d):d=t[9],d}function Br(){const t=C.c(10),{org:e}=Y(),{id:n}=Le();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Wt(r);let a;t[5]!==l?(a=async f=>{const 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 u=a;let d;return t[7]!==u||t[8]!==c?(d={handleResumeWorkflow:u,isResuming:c},t[7]=u,t[8]=c,t[9]=d):d=t[9],d}function Ur(){const t=C.c(3),e=H(),{item:n}=ie(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 qr(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 tn=xr()(os(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"})),ds=k.createContext([]);function us(){return k.useContext(ds)}function Kr({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new _o;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,u,d;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(),(d=(u=r.view.dom.ownerDocument.defaultView)==null?void 0:u.getSelection())==null||d.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 fs(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>Kr({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function jn(t,e){const n=fs(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var Jr=No.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",Je(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=jn(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Je({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Je({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Je({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Io({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:jn(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 ko,c=0;return e.doc.nodesBetween(r-1,r,(a,u)=>{if(a.type.name===this.name)return n=!0,l=a,c=u,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return fs(this).map(Co)}}),Gr=Jr,wt,rt="HoverCard",[ms]=kn(rt,[Nn]),it=Nn(),[Xr,lt]=ms(rt),ps=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=it(e),u=k.useRef(0),d=k.useRef(0),f=k.useRef(!1),m=k.useRef(!1),[x,p]=At({prop:s,defaultProp:i??!1,onChange:r,caller:rt}),h=k.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=k.useCallback(()=>{clearTimeout(u.current),!f.current&&!m.current&&(d.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=k.useCallback(()=>p(!1),[p]);return k.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),o.jsx(Xr,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(Gs,{...a,children:n})})};ps.displayName=rt;var xs="HoverCardTrigger",hs=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=lt(xs,n),r=it(n);return o.jsx(Ks,{asChild:!0,...r,children:o.jsx(Rt.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:ne(t.onPointerEnter,tt(i.onOpen)),onPointerLeave:ne(t.onPointerLeave,tt(i.onClose)),onFocus:ne(t.onFocus,i.onOpen),onBlur:ne(t.onBlur,i.onClose),onTouchStart:ne(t.onTouchStart,l=>l.preventDefault())})})});hs.displayName=xs;var nn="HoverCardPortal",[Zr,Qr]=ms(nn,{forceMount:void 0}),gs=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=lt(nn,e);return o.jsx(Zr,{scope:e,forceMount:n,children:o.jsx(wn,{present:n||r.open,children:o.jsx(Js,{asChild:!0,container:i,children:s})})})};gs.displayName=nn;var et="HoverCardContent",bs=k.forwardRef((t,e)=>{const n=Qr(et,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=lt(et,t.__scopeHoverCard);return o.jsx(wn,{present:s||r.open,children:o.jsx(Yr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:ne(t.onPointerEnter,tt(r.onOpen)),onPointerLeave:ne(t.onPointerLeave,tt(r.onClose)),ref:e})})});bs.displayName=et;var Yr=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=lt(et,n),u=it(n),d=k.useRef(null),f=Cn(e,d),[m,x]=k.useState(!1);return k.useEffect(()=>{if(m){const p=document.body;return wt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=wt,p.style.webkitUserSelect=wt}}},[m]),k.useEffect(()=>{if(d.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(()=>{d.current&&ni(d.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(Xs,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ne(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(Zs,{...u,...c,onPointerDown:ne(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)"}})})}),ei="HoverCardArrow",ti=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=it(n);return o.jsx(Qs,{...i,...s,ref:e})});ti.displayName=ei;function tt(t){return e=>e.pointerType==="touch"?void 0:t()}function ni(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 si=ps,oi=hs,ri=gs,ii=bs;function li(t){const e=C.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(si,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function ci(t){const e=C.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(oi,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function ai(t){const e=C.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 u;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(u=o.jsx(ri,{"data-slot":"hover-card-portal",children:o.jsx(ii,{"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]=u):u=e[11],u}const js=k.createContext(void 0);function di(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 ui(t){const e=C.c(20),{node:n}=t,s=k.useContext(js),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?di(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 u=a;if(!r||c===void 0){let h;return e[6]!==u?(h=o.jsx(un,{as:"span",children:u}),e[6]=u,e[7]=h):h=e[7],h}let d;e[8]!==u?(d=o.jsx(ci,{asChild:!0,children:u}),e[8]=u,e[9]=d):d=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(ai,{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]!==d||e[18]!==x?(p=o.jsx(un,{as:"span",children:o.jsxs(li,{openDelay:200,children:[d,x]})}),e[17]=d,e[18]=x,e[19]=p):p=e[19],p}function vs(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let se=ys();function ys(){return en(()=>({items:[],selectedIndex:0,command:null}))}function vn(t,e){se.setState({items:t,command:e,selectedIndex:0})}function fi(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e-1+t.length)%t.length})}function mi(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e+1)%t.length})}function Ss(){const{items:t,selectedIndex:e,command:n}=se.getState(),s=t[e];return s?(n?.(s),!0):!1}function yn(){se=ys()}function pi(){const t=C.c(7),e=_t(se,hi),n=_t(se,xi);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{se.setState({selectedIndex:c}),Ss()},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 xi(t){return t.selectedIndex}function hi(t){return t.items}function gi(){let t=null,e=null;return{onStart:n=>{vn(n.items,n.command),t=new Oo(pi,{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=>{vn(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(),yn(),!0):n.key==="ArrowUp"?(fi(),!0):n.key==="ArrowDown"?(mi(),!0):n.key==="Enter"?Ss():!1,onExit:()=>{e?.remove(),t?.destroy(),yn()}}}const Nt=/@([\w.]+)/g;function bi(t,e){if(!t)return null;const n=vs(e),s=new Map(n.map(a=>[a.id,a]));if(!Nt.test(t))return t;Nt.lastIndex=0;const r=[];let l=0,c;for(;(c=Nt.exec(t))!==null;){const a=c[1]??"",u=c.index;u>l&&r.push({type:"text",text:t.slice(l,u)});const d=s.get(a);d?r.push({type:"mention",attrs:{id:d.id,label:d.label}}):r.push({type:"text",text:c[0]}),l=u+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 sn(t){const e=C.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=Ur();let u;e[0]!==n||e[1]!==s?(u=bi(s,n),e[0]=n,e[1]=s,e[2]=u):u=e[2];const d=u,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=To.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=E=>{const{query:A}=E;return vs(n).filter(D=>D.label.toLowerCase().includes(A.toLowerCase())||D.id.toLowerCase().includes(A.toLowerCase()))},e[7]=n,e[8]=I):I=e[8],p=Gr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Si,renderHTML:yi,suggestion:{items:I,render:gi,command:vi}}).extend(f?{addNodeView(){return $o(ui)}}:{}),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:ji},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=I=>{const{editor:E}=I;return i?.(E.getText().trim())},e[13]=i,e[14]=j):j=e[14];let y;e[15]!==d||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==j?(y={content:d,editable:m,extensions:h,editorProps:b,onUpdate:j},e[15]=d,e[16]=m,e[17]=h,e[18]=b,e[19]=j,e[20]=y):y=e[20];const S=Eo(y);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]!==S?(w=o.jsx(Ro,{editor:S}),e[23]=S,e[24]=w):w=e[24];let N;e[25]!==v||e[26]!==w?(N=o.jsx("div",{className:v,children:w}),e[25]=v,e[26]=w,e[27]=N):N=e[27];const T=N;if(a!==void 0){let I;return e[28]!==T||e[29]!==a?(I=o.jsx(js.Provider,{value:a,children:T}),e[28]=T,e[29]=a,e[30]=I):I=e[30],I}return T}function ji(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function vi(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function yi(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Si(t){const{node:e}=t;return`@${e.attrs.id}`}function wi(t){const e=C.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=us(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const u=i||"Enter value...";let d;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==u?(d=o.jsx(sn,{mentions:l,value:c,onChange:a,placeholder:u,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function Ni(t){const e=C.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=us(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const u=i||"Enter value...";let d;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==u?(d=o.jsx(sn,{mentions:l,value:c,onChange:a,placeholder:u,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function Ci(t){const e=C.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=d=>s(d.target.value===""?void 0:Number(d.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 u;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(u=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]=u):u=e[7],u}function ki(t){const e=C.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 u;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(u=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]=u):u=e[6];let d;e[7]!==l?(d=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=d):d=e[8];let f;return e[9]!==r||e[10]!==u||e[11]!==d?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[u,d]}),e[9]=r,e[10]=u,e[11]=d,e[12]=f):f=e[12],f}function Ii(t){const e=C.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,u=n??"";let d;e[2]!==s?(d=h=>s(h.target.value),e[2]=s,e[3]=d):d=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(_i),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==d||e[12]!==x?(p=o.jsxs("select",{id:r,value:u,onChange:d,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=u,e[11]=d,e[12]=x,e[13]=p):p=e[13],p}function _i(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Ti={TextWidget:wi,TextareaWidget:Ni,NumberWidget:Ci,CheckboxWidget:ki,SelectWidget:Ii};function $i(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:Gn,color:"text-blue-500"};case"number":case"integer":return{Icon:Kn,color:"text-blue-500"};case"array":return{Icon:Bn,color:"text-purple-500"};case"object":return{Icon:Vn,color:"text-orange-500"};case"boolean":return{Icon:Jn,color:"text-pink-500"};case"null":return{Icon:Mt,color:"text-gray-500"};default:return{Icon:Un,color:"text-muted-foreground"}}}function Ei(t){const e=C.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 u=Array.isArray(c.type)?c.type[0]:c.type??"string";let d,f,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==u){const{Icon:v,color:w}=$i(u);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],d=v,f=14,m=R(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=u,e[8]=d,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else d=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==d||e[21]!==f||e[22]!==m?(b=o.jsx(d,{size:f,className:m}),e[20]=d,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 y;e[29]!==r?(y=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=y):y=e[30];let S;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==y?(S=o.jsxs("div",{className:g,children:[j,y,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=y,e[35]=S):S=e[35],S}function Oi(t){const e=C.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(Ai),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(Ri),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 Ri(t){return o.jsx("div",{children:t.content},t.name)}function Ai(t){return o.jsx("div",{children:t.content},t.name)}function Mi(t){const e=C.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(Pi),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(V,{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 u;return e[8]!==c||e[9]!==a?(u=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=u):u=e[10],u}function Pi(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 Li(){return null}function zi(){return null}const Di={FieldTemplate:Ei,ObjectFieldTemplate:Oi,ArrayFieldTemplate:Mi,UnsupportedFieldTemplate:Li,ErrorListTemplate:zi};function Wi(t){const e=C.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,u,d)=>{const f=typeof u=="object"&&u!==null?JSON.stringify(u,null,2):String(u??""),m=Array.isArray(d.type)?d.type.join(" | "):d.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})]}),d.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:d.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(sn,{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[u,d]=a,f=s[u];return l(u,f,d)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function ws({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(Wi,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=k.useRef(e??{}),u=d=>{const f=d.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(ds.Provider,{value:l,children:o.jsx(ho,{schema:c,formData:e,onChange:u,validator:go,widgets:Ti,templates:Di,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function Hi(t){const e=C.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,u]=k.useState(c);let d;e[1]!==a||e[2]!==s||e[3]!==r?(d=async()=>{await r(a),s(!1),u({})},e[1]=a,e[2]=s,e[3]=r,e[4]=d):d=e[4];const f=d;let m;e[5]!==s?(m=T=>{T||u({}),s(T)},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(Mo,{children:[o.jsx(Po,{children:"Workflow Input"}),o.jsx(Lo,{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(ws,{inputSchema:i,inputParams:a,setInputParams:u,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(V,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let y;e[17]!==l?(y=l?o.jsx(We,{size:"xs"}):o.jsx(qt,{size:14}),e[17]=l,e[18]=y):y=e[18];let S;e[19]!==f||e[20]!==l||e[21]!==y?(S=o.jsxs(V,{onClick:f,disabled:l,className:"gap-2",children:[y,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=y,e[22]=S):S=e[22];let v;e[23]!==S||e[24]!==j?(v=o.jsxs(zo,{children:[j,S]}),e[23]=S,e[24]=j,e[25]=v):v=e[25];let w;e[26]!==v||e[27]!==g?(w=o.jsxs(Do,{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 N;return e[29]!==x||e[30]!==n||e[31]!==w?(N=o.jsx(Wo,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=N):N=e[32],N}function Fi(t){const e=C.c(27),{title:n,description:s,onSave:i,isSaving:r}=t,c=Ot().location.href,{viewMode:a,setViewMode:u,showExecutionsList:d,toggleExecutionsList:f}=tn(),{resetToOriginalWorkflow:m,setSelectedVirtualMcpId:x}=G(),p=ls(),h=Pe(),g=H();let b;e[0]!==n?(b=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==s?(j=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=j):j=e[3];let y;e[4]!==b||e[5]!==j?(y=o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,j]})}),e[4]=b,e[5]=j,e[6]=y):y=e[6];let S;e[7]!==p||e[8]!==r||e[9]!==i||e[10]!==m||e[11]!==h||e[12]!==x||e[13]!==u||e[14]!==d||e[15]!==n||e[16]!==f||e[17]!==g||e[18]!==c||e[19]!==a?(S=!g&&o.jsxs(o.Fragment,{children:[o.jsx(Ht,{title:n,url:c,icon:"workflow"}),o.jsx(k.Suspense,{fallback:o.jsx(We,{size:"xs"}),children:o.jsx(Er,{selectedVirtualMcpId:h,onVirtualMcpChange:x,placeholder:"Select Agent"})}),o.jsx(wo,{value:a,onValueChange:u,size:"sm",options:[{value:"visual",icon:o.jsx(ts,{})},{value:"code",icon:o.jsx(Qn,{})}]}),o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:m,disabled:!p,"aria-label":"Reset changes",children:o.jsx($n,{size:14})})})}),o.jsx(ae,{side:"bottom",children:"Reset changes"})]})}),o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:i,disabled:!p||r,"aria-label":"Save workflow",children:r?o.jsx(We,{size:"xs"}):o.jsx(Yt,{size:14})})})}),o.jsx(ae,{side:"bottom",children:"Save workflow"})]})}),o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:d?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:f,"aria-label":d?"Hide runs":"Show runs",children:o.jsx(Zn,{size:14})})})}),o.jsx(ae,{side:"bottom",children:d?"Hide runs":"Show runs"})]})})]}),e[7]=p,e[8]=r,e[9]=i,e[10]=m,e[11]=h,e[12]=x,e[13]=u,e[14]=d,e[15]=n,e[16]=f,e[17]=g,e[18]=c,e[19]=a,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Ui,{}),e[21]=v):v=e[21];let w;e[22]!==S?(w=o.jsxs(Ut,{children:[S,v]}),e[22]=S,e[23]=w):w=e[23];let N;return e[24]!==y||e[25]!==w?(N=o.jsxs(o.Fragment,{children:[y,w]}),e[24]=y,e[25]=w,e[26]=N):N=e[26],N}function Vi(){const t=H(),{item:e}=ie(t);return e?.completed_at_epoch_ms!=null}function Bi(){const t=H(),{item:e}=ie(t);return e?.status==="cancelled"}function Ui(){const t=C.c(58),e=ls(),n=Vi(),s=Bi(),i=H(),r=Pe(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:u}=Fr(),d=Ve(),[f,m]=k.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=Vr(),{handleResumeWorkflow:h,isResuming:g}=Br(),b=i&&!n;let j;t[0]!==d?(j=d.some(qi),t[0]=d,t[1]=j):j=t[1];const y=j,S=!r,v=d.length===0,w=e||v||y||S||c||p,N=b||c;let T;t[2]!==y||t[3]!==S||t[4]!==e||t[5]!==s||t[6]!==N||t[7]!==v?(T=()=>s?"Workflow is currently cancelled":N?"Workflow is currently running":e?"Save your changes before running":S?"Select an Agent first":v||y?"Add at least one step to the workflow":null,t[2]=y,t[3]=S,t[4]=e,t[5]=s,t[6]=N,t[7]=v,t[8]=T):T=t[8];const E=T();let A;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==u||t[13]!==s||t[14]!==N||t[15]!==a||t[16]!==i?(A=async()=>{if(a&&u){m(!0);return}if(s&&i){await h(i);return}if(N&&i){await x(i);return}await l({})},t[9]=x,t[10]=h,t[11]=l,t[12]=u,t[13]=s,t[14]=N,t[15]=a,t[16]=i,t[17]=A):A=t[17];const M=A;let D;t[18]!==l?(D=async Z=>{await l(Z)},t[18]=l,t[19]=D):D=t[19];const P=D,L=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",z=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let K;t[20]!==z?(K=R("gap-2 h-7 px-3",z),t[20]=z,t[21]=K):K=t[21];let _;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(_=(!b&&!c&&!p&&!g||s)&&o.jsx(qt,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=_):_=t[27];let $;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?($=b&&!c&&!p&&!g&&!s&&o.jsx(Ao,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=$):$=t[33];let O;t[34]!==p||t[35]!==c||t[36]!==g?(O=(c||p||g)&&o.jsx(We,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=O):O=t[37];let W;t[38]!==L||t[39]!==M||t[40]!==w||t[41]!==K||t[42]!==_||t[43]!==$||t[44]!==O?(W=o.jsxs(V,{variant:"default",size:"sm",className:K,disabled:w,onClick:M,children:[_,$,O,L]}),t[38]=L,t[39]=M,t[40]=w,t[41]=K,t[42]=_,t[43]=$,t[44]=O,t[45]=W):W=t[45];const B=W;let J;t[46]!==B||t[47]!==E?(J=E?o.jsx(de,{children:o.jsxs(ue,{delayDuration:0,children:[o.jsx(ce,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:B})}),o.jsx(ae,{side:"bottom",children:E})]})}):B,t[46]=B,t[47]=E,t[48]=J):J=t[48];const oe=J;let X;t[49]!==P||t[50]!==u||t[51]!==c||t[52]!==a||t[53]!==f?(X=a&&u&&o.jsx(Hi,{open:f,onOpenChange:m,inputSchema:u,onSubmit:P,isPending:c}),t[49]=P,t[50]=u,t[51]=c,t[52]=a,t[53]=f,t[54]=X):X=t[54];let q;return t[55]!==oe||t[56]!==X?(q=o.jsxs(o.Fragment,{children:[oe,X]}),t[55]=oe,t[56]=X,t[57]=q):q=t[57],q}function qi(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function Ki(){const t=C.c(15),e=H(),n=Ve(),{item:s}=ie(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.status||t[3]!==n){i={};let r;t[5]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(Ji)??[]),t[5]=s.completed_steps?.success,t[6]=r):r=t[6];const l=r;let c;t[7]!==s.completed_steps?.error?(c=s.completed_steps?.error??[],t[7]=s.completed_steps?.error,t[8]=c):c=t[8];let a;t[9]!==c?(a=new Set(c),t[9]=c,t[10]=a):a=t[10];const u=a;let d;t[11]!==u||t[12]!==n||t[13]!==l?(d=-1,n.forEach((f,m)=>{(l.has(f.name)||u.has(f.name))&&(d=m)}),t[11]=u,t[12]=n,t[13]=l,t[14]=d):d=t[14],n.forEach((f,m)=>{let x="pending";u.has(f.name)?x="error":l.has(f.name)?x="success":s.status==="running"&&m===d+1&&(x="running"),i[f.name]={status:x,output:void 0,error:void 0,stepIndex:m}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.status,t[3]=n,t[4]=i}else i=t[4];return i}function Ji(t){return t.name}function Gi(t){const e=C.c(94),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:u,onDuplicate:d}=t,f=H(),{item:m}=ie(f),x=m?.completed_steps,p=x?.success;let h;e[0]!==n.name||e[1]!==p?(h=p?.find(U=>U.name===n.name),e[0]=n.name,e[1]=p,e[2]=h):h=e[2];const g=h,b=g?.completed_at_epoch_ms,j=g!=null,y=x?.error?.includes(n.name),S="toolName"in n.action,v=S&&"connectionId"in n.action?n.action.connectionId:null,N=!!(S&&"toolName"in n.action?n.action.toolName:null),T=il(n),I=j?"success":y?"error":r?.status,E=r!==void 0,A=I==="success"||I==="error";let M=T.length>0?60:12;(I==="success"||I==="error")&&(M=M+32);const D=Qi(I);let P;e[3]!==I?(P=Yi(I),e[3]=I,e[4]=P):P=e[4];const L=P;let z;e[5]===Symbol.for("react.memo_cache_sentinel")?(z=function(Ke,Ws){const an=Ws.split(".").slice(1);if(an.length===0)return Array.isArray(Ke)?Ke:void 0;let le=Ke;for(const Hs of an){if(le==null)return;if(typeof le=="object")le=le[Hs];else return}return Array.isArray(le)?le:void 0},e[5]=z):z=e[5];const K=z,_=n.forEach!==void 0,$=n.forEach?.ref;let O;e[6]!==$?(O=$?.replace("@","").split(".")[0],e[6]=$,e[7]=O):O=e[7];const W=O,B=m?.status==="running"||m?.status==="enqueued";let J;e[8]!==p||e[9]!==W?(J=p?.some(U=>U.name===W),e[8]=p,e[9]=W,e[10]=J):J=e[10];const oe=J,X=B?500:!1;let q;e[11]!==oe||e[12]!==X?(q={refetchInterval:X,enabled:oe},e[11]=oe,e[12]=X,e[13]=q):q=e[13];const{output:Z}=cs(f,W,q);let Be;if(e[14]!==Z||e[15]!==$){const U=$?.replace("@","");Be=U?K(Z,U):void 0,e[14]=Z,e[15]=$,e[16]=Be}else Be=e[16];const ze=Be;let Ue;e[17]!==m?.completed_steps?.success||e[18]!==n.name?(Ue=m?.completed_steps?.success?.filter(U=>new RegExp(`^${n.name}\\[\\d+\\]$`).test(U.name)),e[17]=m?.completed_steps?.success,e[18]=n.name,e[19]=Ue):Ue=e[19];const dt=Ue,ut=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",ft=I==="running"&&"bg-accent/50",mt=l&&"opacity-50";let me;e[20]!==ut||e[21]!==ft||e[22]!==mt?(me=R("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",ut,ft,mt),e[20]=ut,e[21]=ft,e[22]=mt,e[23]=me):me=e[23];const Ps="button",Ls=0;let pe;e[24]!==a?(pe=U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),a())},e[24]=a,e[25]=pe):pe=e[25];const zs="w-5 flex flex-col items-center justify-center shrink-0 pt-3",pt=R("text-xs font-mono opacity-75 h-8 flex items-center",D),xt=s+1;let xe;e[26]!==pt||e[27]!==xt?(xe=o.jsx("div",{className:zs,children:o.jsxs("span",{className:pt,children:[xt,"."]})}),e[26]=pt,e[27]=xt,e[28]=xe):xe=e[28];let he;e[29]!==L||e[30]!==s?(he=s>0?o.jsx(Ct,{height:12,color:L}):o.jsx("div",{className:"h-3"}),e[29]=L,e[30]=s,e[31]=he):he=e[31];let ge;e[32]!==v||e[33]!==N||e[34]!==S||e[35]!==n.name?(ge=o.jsx(ol,{connectionId:v,isToolStep:S,hasToolSelected:N,stepName:n.name}),e[32]=v,e[33]=N,e[34]=S,e[35]=n.name,e[36]=ge):ge=e[36];let be;e[37]!==L||e[38]!==A||e[39]!==I?(be=A&&o.jsxs(o.Fragment,{children:[o.jsx(Ct,{height:8,color:L}),o.jsx(el,{status:I})]}),e[37]=L,e[38]=A,e[39]=I,e[40]=be):be=e[40];let je;e[41]!==L||e[42]!==M||e[43]!==c||e[44]!==f?(je=c&&f?null:o.jsx(Ct,{height:M,color:L}),e[41]=L,e[42]=M,e[43]=c,e[44]=f,e[45]=je):je=e[45];let ve;e[46]!==he||e[47]!==ge||e[48]!==be||e[49]!==je?(ve=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[he,ge,be,je]}),e[46]=he,e[47]=ge,e[48]=be,e[49]=je,e[50]=ve):ve=e[50];const Ds="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",ht=N?"font-medium text-foreground":"text-foreground";let ye;e[51]!==ht?(ye=R("text-sm truncate flex-1",ht),e[51]=ht,e[52]=ye):ye=e[52];let Se;e[53]!==n?(Se=rl(n),e[53]=n,e[54]=Se):Se=e[54];let we;e[55]!==ye||e[56]!==Se?(we=o.jsx("span",{className:ye,children:Se}),e[55]=ye,e[56]=Se,e[57]=we):we=e[57];let Ne;e[58]!==dt?.length||e[59]!==_||e[60]!==ze?(Ne=_&&ze&&ze.length>0&&o.jsx("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center",children:`${dt?.length??0} / ${ze.length}`}),e[58]=dt?.length,e[59]=_,e[60]=ze,e[61]=Ne):Ne=e[61];let Ce;e[62]!==E||e[63]!==I?(Ce=E&&o.jsx(tl,{status:I}),e[62]=E,e[63]=I,e[64]=Ce):Ce=e[64];let ke;e[65]!==Ne||e[66]!==Ce?(ke=o.jsxs("div",{className:"flex items-center gap-2",children:[Ne,Ce]}),e[65]=Ne,e[66]=Ce,e[67]=ke):ke=e[67];let Ie;e[68]!==E||e[69]!==u||e[70]!==d?(Ie=!E&&o.jsxs(Vo,{children:[o.jsx(Bo,{asChild:!0,children:o.jsx(V,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:Zi,children:o.jsx(Fo,{size:14})})}),o.jsxs(Uo,{align:"end",children:[o.jsxs(fn,{onClick:U=>{U.stopPropagation(),d()},children:[o.jsx(Qo,{size:14}),"Duplicate"]}),o.jsxs(fn,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:U=>{U.stopPropagation(),u()},children:[o.jsx(Ys,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[68]=E,e[69]=u,e[70]=d,e[71]=Ie):Ie=e[71];let _e;e[72]!==we||e[73]!==ke||e[74]!==Ie?(_e=o.jsxs("div",{className:"flex items-center h-8",children:[we,ke,Ie]}),e[72]=we,e[73]=ke,e[74]=Ie,e[75]=_e):_e=e[75];const gt=T.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.map(Xi)});let Te;e[76]!==I||e[77]!==b?(Te=I==="success"&&o.jsx(nl,{completedAtEpochMs:b}),e[76]=I,e[77]=b,e[78]=Te):Te=e[78];let $e;e[79]!==r?.error||e[80]!==I?($e=I==="error"&&o.jsx(sl,{error:r?.error}),e[79]=r?.error,e[80]=I,e[81]=$e):$e=e[81];let Ee;e[82]!==_e||e[83]!==gt||e[84]!==Te||e[85]!==$e?(Ee=o.jsxs("div",{className:Ds,children:[_e,gt,Te,$e]}),e[82]=_e,e[83]=gt,e[84]=Te,e[85]=$e,e[86]=Ee):Ee=e[86];let qe;return e[87]!==a||e[88]!==me||e[89]!==pe||e[90]!==xe||e[91]!==ve||e[92]!==Ee?(qe=o.jsxs("div",{className:me,onClick:a,role:Ps,tabIndex:Ls,onKeyDown:pe,children:[xe,ve,Ee]}),e[87]=a,e[88]=me,e[89]=pe,e[90]=xe,e[91]=ve,e[92]=Ee,e[93]=qe):qe=e[93],qe}function Xi(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 Zi(t){return t.stopPropagation()}function Qi(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function Yi(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function el(t){const e=C.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(Gt,{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(Kt,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function tl(t){const e=C.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(Gt,{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(Kt,{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(De,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function nl(t){const e=C.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null?new Date(n):null;s=a?a.toISOString().split("T")[0]:null,i=a?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Ho,{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 sl(t){const e=C.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Qt,{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 ol(t){const e=C.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=ot(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(st,{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(lo,{size:16,className:"text-muted-foreground"}):o.jsx(Zo,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function Ct(t){const e=C.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 rl(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 il(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 ll(t){const e=C.c(32),{className:n}=t,s=Ve(),i=is(),r=Ki(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=G(),u=H();let d;e[0]!==r||e[1]!==s?(d=r?s.findIndex(y=>r[y.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=d):d=e[2];const f=d;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 y;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(y=(S,v)=>{const w=r?.[S.name],N=f!==-1&&v>f&&w?.status==="pending",T=v===s.length-1;return o.jsx(Gi,{step:S,index:v,isSelected:S.name===i,executionStatus:w,isSkipped:N,isLastStep:T,onSelect:()=>l(S.name),onDelete:()=>c(S.name),onDuplicate:()=>a(S.name)},S.name)},e[14]=i,e[15]=c,e[16]=a,e[17]=f,e[18]=l,e[19]=r,e[20]=s.length,e[21]=y):y=e[21],p=s.map(y),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=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]!==u?(g=u?null:o.jsx(cl,{}),e[24]=u,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 cl(){const t=C.c(8),{addToolStep:e}=G();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(Wn,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(V,{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 al(){const t=C.c(11),{org:e}=Y(),s=Pe()??null;let i;t[0]!==e.id||t[1]!==s?(i={connectionId:s,orgId:e.id},t[0]=e.id,t[1]=s,t[2]=i):i=t[2];const r=ee(i);let l;t[3]!==r?(l={client:r},t[3]=r,t[4]=l):l=t[4];const c=zt(l);let a;t[5]!==c.data?.tools?(a=c.data?.tools??[],t[5]=c.data?.tools,t[6]=a):a=t[6];let u;return t[7]!==a||t[8]!==c.error||t[9]!==c.isLoading?(u={tools:a,isLoading:c.isLoading,error:c.error},t[7]=a,t[8]=c.error,t[9]=c.isLoading,t[10]=u):u=t[10],u}function dl(t){const e=C.c(7),{className:n}=t;if(!Pe()){let r;e[0]!==n?(r=R("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground p-4 text-center",children:"Select an agent to see available tools"}),e[2]=l):l=e[2];let c;return e[3]!==r?(c=o.jsx("div",{className:r,children:l}),e[3]=r,e[4]=c):c=e[4],c}let i;return e[5]!==n?(i=o.jsx(ul,{className:n}),e[5]=n,e[6]=i):i=e[6],i}function ul(t){const e=C.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=al(),l=Fe(),{updateStep:c}=G(),u=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let d;if(e[0]!==u||e[1]!==s){let v;e[3]!==u?(v=w=>w.name===u,e[3]=u,e[4]=v):v=e[4],d=s.find(v),e[0]=u,e[1]=s,e[2]=d}else d=e[2];const m=qr(s,d??null,ml,fl);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(We,{size:"sm"})}),e[10]=w):w=e[10];let N;return e[11]!==v?(N=o.jsx("div",{className:v,children:w}),e[11]=v,e[12]=N):N=e[12],N}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 N;return e[17]!==v||e[18]!==w?(N=o.jsx("div",{className:v,children:w}),e[17]=v,e[18]=w,e[19]=N):N=e[19],N}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]!==u){let v;e[29]!==p||e[30]!==u?(v=w=>o.jsx(pl,{icon:null,title:w.name,description:w.description,isSelected:w.name===u,onClick:()=>p(w)},w.name),e[29]=p,e[30]=u,e[31]=v):v=e[31],j=m.map(v),e[25]=p,e[26]=m,e[27]=u,e[28]=j}else j=e[28];let y;e[32]!==j?(y=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=y):y=e[33];let S;return e[34]!==h||e[35]!==b||e[36]!==y?(S=o.jsxs("div",{className:h,children:[b,y]}),e[34]=h,e[35]=b,e[36]=y,e[37]=S):S=e[37],S}function fl(t,e){return t.name.localeCompare(e.name)}function ml(t){return t.name}function pl(t){const e=C.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 u;e[2]!==l?(u=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},e[2]=l,e[3]=u):u=e[3];let d;e[4]!==n||e[5]!==s?(d=o.jsx(st,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=d):d=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]!==u||e[17]!==d||e[18]!==x?(p=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:u,children:[d,x]}),e[14]=l,e[15]=a,e[16]=u,e[17]=d,e[18]=x,e[19]=p):p=e[19],p}var te="Accordion",xl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[on,hl,gl]=to(te),[ct]=kn(te,[gl,Hn]),rn=Hn(),Ns=F.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(on.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(yl,{...r,ref:e}):o.jsx(vl,{...i,ref:e})})});Ns.displayName=te;var[Cs,bl]=ct(te),[ks,jl]=ct(te,{collapsible:!1}),vl=F.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=At({prop:n,defaultProp:s??"",onChange:i,caller:te});return o.jsx(Cs,{scope:t.__scopeAccordion,value:F.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:F.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(ks,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(Is,{...l,ref:e})})})}),yl=F.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=At({prop:n,defaultProp:s??[],onChange:i,caller:te}),a=F.useCallback(d=>c((f=[])=>[...f,d]),[c]),u=F.useCallback(d=>c((f=[])=>f.filter(m=>m!==d)),[c]);return o.jsx(Cs,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:u,children:o.jsx(ks,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(Is,{...r,ref:e})})})}),[Sl,at]=ct(te),Is=F.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=F.useRef(null),a=Cn(c,e),u=hl(n),f=no(i)==="ltr",m=ne(t.onKeyDown,x=>{if(!xl.includes(x.key))return;const p=x.target,h=u().filter(T=>!T.ref.current?.disabled),g=h.findIndex(T=>T.ref.current===p),b=h.length;if(g===-1)return;x.preventDefault();let j=g;const y=0,S=b-1,v=()=>{j=g+1,j>S&&(j=y)},w=()=>{j=g-1,j<y&&(j=S)};switch(x.key){case"Home":j=y;break;case"End":j=S;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 N=j%b;h[N].ref.current?.focus()});return o.jsx(Sl,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(on.Slot,{scope:n,children:o.jsx(Rt.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:m})})})}),nt="AccordionItem",[wl,ln]=ct(nt),_s=F.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=at(nt,n),l=bl(nt,n),c=rn(n),a=eo(),u=s&&l.value.includes(s)||!1,d=r.disabled||t.disabled;return o.jsx(wl,{scope:n,open:u,disabled:d,triggerId:a,children:o.jsx(Ko,{"data-orientation":r.orientation,"data-state":As(u),...c,...i,ref:e,disabled:d,open:u,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});_s.displayName=nt;var Ts="AccordionHeader",$s=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=at(te,n),r=ln(Ts,n);return o.jsx(Rt.h3,{"data-orientation":i.orientation,"data-state":As(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});$s.displayName=Ts;var Et="AccordionTrigger",Es=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=at(te,n),r=ln(Et,n),l=jl(Et,n),c=rn(n);return o.jsx(on.ItemSlot,{scope:n,children:o.jsx(qo,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});Es.displayName=Et;var Os="AccordionContent",Rs=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=at(te,n),r=ln(Os,n),l=rn(n);return o.jsx(Jo,{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}})});Rs.displayName=Os;function As(t){return t?"open":"closed"}var Nl=Ns,Cl=_s,kl=$s,Il=Es,_l=Rs;function Tl(t){const e=C.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(Nl,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function $l(t){const e=C.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(Cl,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function El(t){const e=C.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(Go,{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(kl,{className:"flex",children:o.jsxs(Il,{"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 Ol(t){const e=C.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(_l,{"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 Rl(t){const{updateStep:e}=G(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=cn(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function Al(t){const e=C.c(32),{className:n}=t,s=Fe(),{appendStep:i}=G();Rl(s);const r=H(),{item:l}=ie(r);if(!s){let b;e[0]!==n?(b=R("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==i?(j=()=>{i({type:"tool"})},e[2]=i,e[3]=j):j=e[3];let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Wn,{size:14}),e[4]=y):y=e[4];let S;e[5]!==j?(S=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(V,{variant:"ghost",size:"icon",className:"size-7",onClick:j,children:y})]}),e[5]=j,e[6]=S):S=e[6];let v;return e[7]!==b||e[8]!==S?(v=o.jsx("div",{className:b,children:S}),e[7]=b,e[8]=S,e[9]=v):v=e[9],v}const c=s?.name,a=!!(l?.completed_steps?.success?.some(b=>b.name===c)||l?.completed_steps?.error?.includes(c));let u;e[10]!==n?(u=R("flex flex-col h-full bg-sidebar overflow-scroll",n),e[10]=n,e[11]=u):u=e[11];let d,f;e[12]!==s?(d=o.jsx(Ml,{step:s}),f=o.jsx(Ll,{step:s}),e[12]=s,e[13]=d,e[14]=f):(d=e[13],f=e[14]);const m=a?"open":"closed";let x;e[15]!==s||e[16]!==a||e[17]!==m?(x=o.jsx(Dl,{step:s,defaultOpen:a},m),e[15]=s,e[16]=a,e[17]=m,e[18]=x):x=e[18];let p;e[19]!==s||e[20]!==r?(p=!r&&o.jsx(Vl,{step:s}),e[19]=s,e[20]=r,e[21]=p):p=e[21];let h;e[22]!==s||e[23]!==r?(h=!r&&o.jsx(ql,{step:s}),e[22]=s,e[23]=r,e[24]=h):h=e[24];let g;return e[25]!==u||e[26]!==d||e[27]!==f||e[28]!==x||e[29]!==p||e[30]!==h?(g=o.jsxs("div",{className:u,children:[d,f,x,p,h]}),e[25]=u,e[26]=d,e[27]=f,e[28]=x,e[29]=p,e[30]=h,e[31]=g):g=e[31],g}function Ml(t){const e=C.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=H(),l=i??"";let c;e[0]!==l?(c=o.jsx(st,{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 u;e[4]!==r?(u=r?null:o.jsx(Pl,{}),e[4]=r,e[5]=u):u=e[5];let d;e[6]!==c||e[7]!==a||e[8]!==u?(d=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,u]}),e[6]=c,e[7]=a,e[8]=u,e[9]=d):d=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]!==d||e[13]!==f?(m=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[d,f]}),e[12]=d,e[13]=f,e[14]=m):m=e[14],m}function Pl(){const t=C.c(9),e=Fe(),{updateStep:n,startReplacingTool:s}=G(),i=H(),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){Sn.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 u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(ns,{size:14}),t[6]=u):u=t[6];let d;return t[7]!==a?(d=o.jsx(V,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:u}),t[7]=a,t[8]=d):d=t[8],d}function cn(t){const e=C.c(13),{org:n}=Y(),i=Pe()??null;let r;e[0]!==n.id||e[1]!==i?(r={connectionId:i,orgId:n.id},e[0]=n.id,e[1]=i,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==l?(c={client:l},e[3]=l,e[4]=c):c=e[4];const a=zt(c);let u;e[5]!==t||e[6]!==a.data?.tools?(u=a.data?.tools?.find(m=>m.name===t),e[5]=t,e[6]=a.data?.tools,e[7]=u):u=e[7];const d=u;let f;return e[8]!==d||e[9]!==a.error||e[10]!==a.isLoading||e[11]!==a.isSuccess?(f={tool:d,isLoading:a.isLoading,isReady:a.isSuccess,error:a.error},e[8]=d,e[9]=a.error,e[10]=a.isLoading,e[11]=a.isSuccess,e[12]=f):f=e[12],f}function Ll(t){const e=C.c(18),{step:n}=t,{updateStep:s}=G(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=H(),{tool:c}=cn(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 u=a;let d;e[3]!==n.input||e[4]!==c.inputSchema||e[5]!==l?(d=l?zl(c.inputSchema,n.input):c.inputSchema,e[3]=n.input,e[4]=c.inputSchema,e[5]=l,e[6]=d):d=e[6];const f=d,m=l?"output":"input";let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(El,{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 y;e[9]!==u||e[10]!==p||e[11]!==h||e[12]!==g||e[13]!==b?(y=o.jsxs($l,{value:"input",className:"border-b-0",children:[x,o.jsx(Ol,{className:"px-5 pt-2",children:o.jsx(ws,{readOnly:h,inputSchema:g,inputParams:b,setInputParams:u,mentions:j},p)})]}),e[9]=u,e[10]=p,e[11]=h,e[12]=g,e[13]=b,e[14]=y):y=e[14];let S;return e[15]!==y||e[16]!==m?(S=o.jsx(Tl,{type:"single",collapsible:!0,defaultValue:m,className:"border-b border-border shrink-0",children:y}),e[15]=y,e[16]=m,e[17]=S):S=e[17],S}function zl(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function Dl(t){const e=C.c(24),{step:n,defaultOpen:s}=t,i=n.outputSchema,r=H(),{item:l}=ie(r),c=!!(l?.completed_steps?.success?.some(I=>I.name===n.name)||l?.completed_steps?.error?.includes(n.name)),[a,u]=k.useState(s),{output:d,error:f}=cs(r,c?n.name:void 0);let m;e[0]!==f||e[1]!==d?(m=d||(f?{error:f}:void 0),e[0]=f,e[1]=d,e[2]=m):m=e[2];const x=m,p=i&&typeof i=="object"?i.properties:void 0;let h;e[3]!==p?(h=p?Object.entries(p):[],e[3]=p,e[4]=h):h=e[4];const g=h,b=a?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[5]!==b?(j=R("flex flex-col border-b border-border",b),e[5]=b,e[6]=j):j=e[6];let y;e[7]!==a?(y=()=>u(!a),e[7]=a,e[8]=y):y=e[8];let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),e[9]=S):S=e[9];let v;e[10]!==a?(v=o.jsxs("div",{className:"flex items-center justify-between",children:[S,a?o.jsx(Zt,{size:14,className:"text-muted-foreground"}):o.jsx(Xt,{size:14,className:"text-muted-foreground"})]}),e[10]=a,e[11]=v):v=e[11];let w;e[12]!==y||e[13]!==v?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:y,children:v}),e[12]=y,e[13]=v,e[14]=w):w=e[14];let N;e[15]!==x||e[16]!==a||e[17]!==g||e[18]!==r?(N=a&&o.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:[r&&x?o.jsx(Ae,{code:JSON.stringify(x,null,2),language:"json",height:"100%",readOnly:!0}):null,!r&&g.map(Wl)]}),e[15]=x,e[16]=a,e[17]=g,e[18]=r,e[19]=N):N=e[19];let T;return e[20]!==j||e[21]!==w||e[22]!==N?(T=o.jsxs("div",{className:j,children:[w,N]}),e[20]=j,e[21]=w,e[22]=N,e[23]=T):T=e[23],T}function Wl(t){const[e,n]=t;return o.jsx(Fl,{name:e,schema:n},e)}function Hl(t){switch(t){case"string":return{Icon:Gn,color:"text-blue-500"};case"number":case"integer":return{Icon:Kn,color:"text-blue-500"};case"array":return{Icon:Bn,color:"text-purple-500"};case"object":return{Icon:Vn,color:"text-orange-500"};case"boolean":return{Icon:Jn,color:"text-pink-500"};case"null":return{Icon:Mt,color:"text-gray-500"};default:return{Icon:Un,color:"text-muted-foreground"}}}function Fl(t){const e=C.c(28),{name:n,schema:s}=t,i=Fe(),r=s.type??"unknown";let l,c,a,u,d;if(e[0]!==r){const{Icon:S,color:v}=Hl(r);d="flex items-center gap-2",u="flex-1 flex items-center gap-2",l=S,c=14,a=R(v),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=u,e[5]=d}else l=e[1],c=e[2],a=e[3],u=e[4],d=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]!==u||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:u,children:[f,m]}),e[12]=u,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(Yn,{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 y;return e[24]!==j||e[25]!==d||e[26]!==x?(y=o.jsxs("div",{className:d,children:[x,j]}),e[24]=j,e[25]=d,e[26]=x,e[27]=y):y=e[27],y}function Vl(t){const e=C.c(29),{step:n}=t,{updateStep:s}=G(),i=H(),[r,l]=k.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:u}=cn(a??""),d=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==u?(f=()=>{if(!u?.outputSchema)return`interface Input {
8
+ // Tool output schema not available
9
+ }`;const T=u.outputSchema,I=T.properties;return I?`interface Input {
10
+ ${Object.entries(I).map(A=>{const[M,D]=A,P=Xe(D),L=!T.required?.includes(M);return` ${M}${L?"?":""}: ${P};`}).join(`
11
+ `)}
12
+ }`:`interface Input {
13
+ [key: string]: unknown;
14
+ }`},e[0]=u,e[1]=f):f=e[1];const m=f;let x;e[2]!==m||e[3]!==n.action||e[4]!==n.name||e[5]!==s?(x=()=>{if("transformCode"in n.action&&n.action.transformCode){l(Ul);return}const I=`${m()}
15
+
16
+ interface Output {
17
+ // Define your output type here
18
+ result: unknown;
19
+ }
20
+
21
+ export default async function(input: Input): Promise<Output> {
22
+ // Transform the tool output
23
+ return {
24
+ result: input,
25
+ };
26
+ }`;s(n.name,{action:{...n.action,transformCode:I}}),l(Bl)},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=(T,I)=>{s(n.name,{action:{...n.action,transformCode:T},...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 y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=y):y=e[13];let S;e[14]!==r?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[y,r?o.jsx(Zt,{size:14,className:"text-muted-foreground"}):o.jsx(Xt,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=S):S=e[15];let v;e[16]!==S||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:S}),e[16]=S,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]!==d?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Ae,{code:d,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]=d,e[24]=w):w=e[24];let N;return e[25]!==j||e[26]!==v||e[27]!==w?(N=o.jsxs("div",{className:j,children:[v,w]}),e[25]=j,e[26]=v,e[27]=w,e[28]=N):N=e[28],N}function Bl(t){return!t}function Ul(t){return!t}function ql(t){const e=C.c(24),{step:n}=t,[s,i]=k.useState(!1),{updateStep:r}=G(),l="code"in n.action&&n.action.code?n.action.code:null,c=H();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,y)=>{r(n.name,{action:{...n.action,code:j},...y?{outputSchema:y}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const u=a;if(!l)return null;const d=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==d?(f=R("flex flex-col border-b border-border",d),e[4]=d,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(Zt,{size:14,className:"text-muted-foreground"}):o.jsx(Xt,{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]!==u||e[16]!==s||e[17]!==n.name||e[18]!==c?(g=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Ae,{onSave:(j,y)=>u(j,y),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=u,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 Xe(t){if(Array.isArray(t.type))return t.type.map(n=>Xe({...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?`${Xe(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Xe(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function Kl(t){switch(t){case"success":return o.jsxs(Oe,{variant:"success",className:"gap-1",children:[o.jsx(Gt,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(Oe,{variant:"destructive",className:"gap-1",children:[o.jsx(Qt,{size:11}),"Error"]});case"running":return o.jsxs(Oe,{variant:"secondary",className:"gap-1",children:[o.jsx(Ge,{size:11}),"Running"]});case"enqueued":return o.jsxs(Oe,{variant:"secondary",className:"gap-1",children:[o.jsx(Ge,{size:11}),"On hold"]});case"cancelled":return o.jsxs(Oe,{variant:"secondary",className:"gap-1",children:[o.jsx(Fn,{size:11}),"Cancelled"]});default:return o.jsxs(Oe,{variant:"secondary",className:"gap-1",children:[o.jsx(Ge,{size:11}),t]})}}function Jl(t){return`Run #${t.slice(-4).toUpperCase()}`}function Gl(t){const e=C.c(21),{className:n}=t,{executions:s,isLoading:i}=Pr(),{setShowExecutionsList:r}=tn(),{setTrackingExecutionId:l}=G(),c=H();let a;e[0]!==l?(a=y=>{l(y)},e[0]=l,e[1]=a):a=e[1];const u=a;let d;e[2]!==r?(d=()=>{r(!1)},e[2]=r,e[3]=d):d=e[3];const f=d;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(Fn,{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(V,{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]!==u||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((y,S)=>o.jsx(Xl,{execution:y,isSelected:y.id===c,isFirst:S===0,onSelect:()=>u(y.id)},y.id)),e[10]=s,e[11]=u,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 Xl(t){const e=C.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 u;e[0]!==l||e[1]!==c||e[2]!==a?(u=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]=u):u=e[3];let d;e[4]!==n.status?(d=Kl(n.status),e[4]=n.status,e[5]=d):d=e[5];let f;e[6]!==n.id?(f=Jl(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]!==d||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d,m]}),e[10]=d,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==u||e[15]!==x?(p=o.jsx("div",{className:u,onClick:r,children:x}),e[13]=r,e[14]=u,e[15]=x,e[16]=p):p=e[16],p}function Ms(t){const e=C.c(11),{itemId:n}=t,[s,i]=k.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=re(r),c=l??"no-connection",{org:a}=Y(),u=l??null;let d;e[1]!==a.id||e[2]!==u?(d={connectionId:u,orgId:a.id},e[1]=a.id,e[2]=u,e[3]=d):d=e[3];const f=ee(d),m=Pt(c,"WORKFLOW",n,f),x=Lt(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 Zl(t){const e=C.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=G();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=Ae,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 u;e[8]!==s||e[9]!==i||e[10]!==n?(u=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[8]=s,e[9]=i,e[10]=n,e[11]=u):u=e[11];let d;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==u?(d=o.jsx(r,{height:c,code:a,language:"json",onSave:u},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=u,e[17]=d):d=e[17],d}function Ql(){const t=C.c(9),e=H(),{item:n}=ie(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 Yl;const g=setInterval(()=>{c.current=Date.now(),h()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const u=a;let d;t[3]!==r?(d=()=>r?c.current:0,t[3]=r,t[4]=d):d=t[4];const f=d,m=k.useSyncExternalStore(u,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 Yl(){}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=C.c(20),{setTrackingExecutionId:e}=G(),n=H(),s=Ql();let i;t[0]!==s?(i=s!=null?ec(s):null,t[0]=s,t[1]=i):i=t[1];const r=i;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(so,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=l):l=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=c):c=t[3];let a;t[4]!==n?(a=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[c,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=a):a=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Xo,{className:"w-4 h-4 text-muted-foreground"}),t[6]=u):u=t[6];let d;t[7]!==r?(d=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[u,o.jsx("span",{className:"text-sm text-muted-foreground",children:r})]}),t[7]=r,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==d?(f=o.jsxs("div",{className:"flex items-center h-full",children:[l,a,d]}),t[9]=a,t[10]=d,t[11]=f):f=t[11];let m;t[12]!==e?(m=()=>e(void 0),t[12]=e,t[13]=m):m=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Mt,{className:"w-4 h-4 text-muted-foreground"}),t[14]=x):x=t[14];let p;t[15]!==m?(p=o.jsx(V,{variant:"ghost",size:"xs",onClick:m,children:x}),t[15]=m,t[16]=p):p=t[16];let h;return t[17]!==f||t[18]!==p?(h=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[f,p]}),t[17]=f,t[18]=p,t[19]=h):h=t[19],h}function nc(){const t=C.c(15);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=re(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}=Ms(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(fe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Jt,{icon:o.jsx(qn,{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 u;t[6]!==i?(u={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},t[6]=i,t[7]=u):u=t[7];let d;t[8]!==l||t[9]!==r?(d=o.jsx(sc,{onUpdate:r,isUpdating:l}),t[8]=l,t[9]=r,t[10]=d):d=t[10];let f;return t[11]!==a||t[12]!==u||t[13]!==d?(f=o.jsx(Cr,{initialState:u,children:d},a),t[11]=a,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function sc(t){const e=C.c(21),{onUpdate:n,isUpdating:s}=t,i=Me(),r=H(),{viewMode:l,showExecutionsList:c}=tn(),a=Fe();let u;e[0]!==n||e[1]!==i?(u=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=u):u=e[2];const d=u,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]!==d||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(h=o.jsx(Fi,{title:i.title,description:i.description,onSave:d,isSaving:s}),e[3]=d,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(Zl,{workflow:i,onUpdate:n}):o.jsxs(yo,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(dn,{defaultSize:50,minSize:30,children:o.jsx(ll,{})}),o.jsx(So,{}),o.jsxs(dn,{defaultSize:50,minSize:25,children:[x&&o.jsx(dl,{className:"border-l border-border"}),c&&o.jsx(Gl,{}),p&&o.jsx(Al,{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(fe,{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 oc(t){const e=C.c(3),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=re(s),l=Pt(i??"no-connection","WORKFLOW_EXECUTION",n,i);let c;return e[1]!==l?(c={item:l},e[1]=l,e[2]=c):c=e[2],c}function rc(){const t=C.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=re(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i}=oc(s);if(!i){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(fe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Jt,{icon:o.jsx(qn,{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(fe,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(Ae,{height:"100%",code:r,language:"json",readOnly:!0})})}),t[6]=r,t[7]=l):l=t[7],l}const ic={workflow:nc,workflow_execution:rc,prompt:rr};function lc(){const t=C.c(6),e=In();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=re(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=cc;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(fr,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function cc(t){return Promise.resolve()}function ac(t){return t.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function dc(){const t=C.c(38),e=In();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=re(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,u=i??"no-connection",{org:d}=Y(),f=ot(i),m=i??null;let x;t[3]!==d.id||t[4]!==m?(x={connectionId:m,orgId:d.id},t[3]=d.id,t[4]=m,t[5]=x):x=t[5];const p=ee(x),h=Lt(u,r,p);let g;t[6]!==h||t[7]!==l?(g=async z=>{l&&await h.update.mutateAsync({id:l,data:z})},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 y=j,S=y&&ic[y];let v;t[11]!==r?(v=ac(r),t[11]=r,t[12]=v):v=t[12];const w=v;let N;t[13]!==d.slug?(N=o.jsx(Re,{children:o.jsx(Qe,{asChild:!0,children:o.jsx(Ze,{to:"/$org/mcps",params:{org:d.slug},children:"Connections"})})}),t[13]=d.slug,t[14]=N):N=t[14];let T;t[15]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ye,{}),t[15]=T):T=t[15];let I;t[16]!==r||t[17]!==f||t[18]!==i||t[19]!==d.slug?(I=f&&o.jsxs(o.Fragment,{children:[o.jsx(Re,{children:o.jsx(Qe,{asChild:!0,children:o.jsx(Ze,{to:"/$org/mcps/$connectionId",params:{org:d.slug,connectionId:i},search:{tab:r},children:f.title})})}),o.jsx(Ye,{})]}),t[16]=r,t[17]=f,t[18]=i,t[19]=d.slug,t[20]=I):I=t[20];let E;t[21]!==w?(E=o.jsx(Re,{children:o.jsx(zn,{children:w})}),t[21]=w,t[22]=E):E=t[22];let A;t[23]!==E||t[24]!==N||t[25]!==I?(A=o.jsx(Pn,{children:o.jsxs(Ln,{children:[N,T,I,E]})}),t[23]=E,t[24]=N,t[25]=I,t[26]=A):A=t[26];const M=A;if(S){let z;return t[27]!==S||t[28]!==a||t[29]!==b||t[30]!==l?(z=o.jsx(S,{itemId:l,onBack:a,onUpdate:b}),t[27]=S,t[28]=a,t[29]=b,t[30]=l,t[31]=z):z=t[31],z}let D;t[32]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(oo,{size:36,className:"text-muted-foreground"}),t[32]=D):D=t[32];let P;t[33]!==a?(P=o.jsx(Jt,{icon:D,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[33]=a,t[34]=P):P=t[34];let L;return t[35]!==M||t[36]!==P?(L=o.jsx(fe,{breadcrumb:M,children:P}),t[35]=M,t[36]=P,t[37]=L):L=t[37],L}function uc(){const t=C.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=re(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(lc,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(dc,{}),t[2]=r):r=t[2],r}function Oa(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Tn,{children:o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(De,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(uc,{})})}),t[0]=e):e=t[0],e}export{Oa as default};
@@ -1 +1 @@
1
- import{c as v,j as i}from"./index-DZqSbjFw.js";import{i as w}from"./Loading01-BiNUjLDw.js";import{i as C}from"./SearchMd-BeBVRrdw.js";import{I as k}from"./input-u1hHzCA4.js";import{c as b}from"./button-0ydgHweE.js";function R(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let o;e[6]!==d?(o=N=>d(N.target.value),e[6]=d,e[7]=o):o=e[7];let l;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==o||e[12]!==m?(l=i.jsx(k,{value:m,onChange:o,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=o,e[12]=m,e[13]=l):l=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==l?(a=i.jsxs("label",{className:s,children:[r,l]}),e[14]=s,e[15]=r,e[16]=l,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{R as C};
1
+ import{c as v,j as i}from"./index-bZDjEZjy.js";import{i as w}from"./Loading01-267RBTet.js";import{i as C}from"./SearchMd-7_DsxZht.js";import{I as k}from"./input-Db3X6HvF.js";import{c as b}from"./button-ClfTbYRX.js";function R(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let o;e[6]!==d?(o=N=>d(N.target.value),e[6]=d,e[7]=o):o=e[7];let l;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==o||e[12]!==m?(l=i.jsx(k,{value:m,onChange:o,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=o,e[12]=m,e[13]=l):l=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==l?(a=i.jsxs("label",{className:s,children:[r,l]}),e[14]=s,e[15]=r,e[16]=l,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{R as C};
@@ -0,0 +1 @@
1
+ import{c as ne,j as t,u as Ve,K as rt,l as at,b6 as ct,g as dt,r as mt,v as ft}from"./index-bZDjEZjy.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{a as ut,C as qe}from"./collection-table-wrapper-C7PJGoEH.js";import{C as pt}from"./collection-search-imk5y1tl.js";import{C as ht}from"./card-D919Ye14.js";import{I as Ge,E as xt}from"./empty-state-DYXlKoSr.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-DN1Ltf10.js";import{B as ke,c as Oe}from"./button-ClfTbYRX.js";import{a as Qe}from"./Copy01-BWDgSjt6.js";import{i as Ye}from"./DotsVertical-DiYKrTRi.js";import{i as Xe}from"./Edit01-D7FAjBpe.js";import{s as Ze,u as gt}from"./use-list-state-BR0DnP45.js";import{s as et}from"./Trash01-DlcrlG40.js";import{E as Le}from"./empty-state-uG-DnAQb.js";import{n as Be}from"./Inbox01-Br0-Fo7T.js";import{A as Me}from"./avatar-DLsqU89S.js";import{u as jt}from"./useQuery-CziyW3rA.js";import{a as Ct,u as tt}from"./constants-BZCTYQ-m.js";import{P as vt}from"./pin-to-sidebar-button-Dz_XGqkX.js";import{u as bt,b as yt}from"./use-collections-C8m0cpJK.js";import{u as Nt}from"./use-connection-BsXZoJuC.js";import{B as wt}from"./constants-ClcoOK3l.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-DvH3np1K.js";import{s as Et}from"./Plus-zV6WU4JB.js";import{V as zt}from"./layout-oEMg2tAu.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(ht,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(ut,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function _s(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=gt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(pt,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(xt,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{_s as C};
@@ -0,0 +1 @@
1
+ import{r as k,c as T,j as t}from"./index-bZDjEZjy.js";import{c as y,B as L}from"./button-ClfTbYRX.js";import{c as E,a as V,D as B,b as $}from"./dropdown-menu-DN1Ltf10.js";import{i as D}from"./ArrowUp-D5u5S04m.js";import{i as R}from"./Check-DCDAnqOU.js";import{c as H}from"./Grid01-hfoOS4OQ.js";import{i as W}from"./List-Byzk8GIH.js";import{b as I,c as K,T as _,a as A}from"./empty-state-DYXlKoSr.js";import{V as O}from"./view-mode-toggle-BuBlE9kN.js";import{T as P,a as q,b as z,c as F,d as G,e as J}from"./table-fsTaEaaU.js";const S=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));S.displayName="ArrowDown";const M=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ie(p){const e=T.c(16),{viewMode:s,onViewModeChange:x,sortKey:u,sortDirection:d,onSort:a,sortOptions:i}=p;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(I,{children:t.jsxs(K,{children:[t.jsx(_,{asChild:!0,children:t.jsx(V,{asChild:!0,children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(A,{children:"Search filters"})]})}),e[2]=h):h=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(W,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(O,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(j=>{const w=u===j.id;return t.jsx(E,{onClick:()=>a(j.id),className:y("h-8 px-2 py-0 cursor-pointer",w&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!w&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),w&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(S,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=a,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let g;return e[13]!==o||e[14]!==f?(g=t.jsxs(B,{children:[h,t.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=g):g=e[15],g}function Q(p){const e=T.c(29),{columns:s,data:x,sortKey:u,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=p;let m;e[0]!==d?(m=function(n,N){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(S,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const h=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==h||e[6]!==u){let b;e[8]!==s.length||e[9]!==a||e[10]!==h||e[11]!==u?(b=(n,N)=>{const C=u===n.id;return t.jsx(P,{className:y(r(N,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&h(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=h,e[11]=u,e[12]=b):b=e[12],o=s.map(b),e[3]=s,e[4]=a,e[5]=h,e[6]=u,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(z,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let g;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let b;e[20]!==s||e[21]!==i||e[22]!==l?(b=(n,N)=>{const C=l?.(n);return t.jsx(z,{"data-row-index":N,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(v=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",v.cellClassName,v.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(v.wrap?"w-full":"min-w-0 w-full",!v.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:v.render?v.render(n):v.accessor?v.accessor(n):null})},v.id))},N)},e[20]=s,e[21]=i,e[22]=l,e[23]=b):b=e[23],g=x.map(b),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=g}else g=e[19];let j;e[24]!==g?(j=t.jsx(G,{children:g}),e[24]=g,e[25]=j):j=e[25];let w;return e[26]!==f||e[27]!==j?(w=t.jsxs(J,{className:"w-full border-collapse",children:[f,j]}),e[26]=f,e[27]=j,e[28]=w):w=e[28],w}function ae(p){const e=T.c(12),{columns:s,data:x,isLoading:u,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=p;if(u===void 0?!1:u){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ie as C,ae as a};
@@ -0,0 +1 @@
1
+ import{c as T,bn as M,j as e,bo as P,af as q,r as R,v as h,a as O}from"./index-bZDjEZjy.js";import{u as A}from"./useQuery-CziyW3rA.js";import{u as _}from"./useMutation-BUU-3CfS.js";import{B as y}from"./button-ClfTbYRX.js";import{C as N,a as v}from"./card-D919Ye14.js";import{i as L,a as U}from"./mcp-oauth-BmPwjDVD.js";import{c as C,C as K,a as k}from"./circle-alert-O76dHf-6.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-DZqSbjFw.js";import{C as _}from"./card-DFhzHX-B.js";import{c as j}from"./button-0ydgHweE.js";import{I as A}from"./empty-state-BJnVPwS4.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
1
+ import{c as S,j as s}from"./index-bZDjEZjy.js";import{C as _}from"./card-D919Ye14.js";import{c as j}from"./button-ClfTbYRX.js";import{I as A}from"./empty-state-DYXlKoSr.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};