decocms 4.86.0 → 4.86.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/client/assets/{AlertCircle-DriHvGW8.js → AlertCircle-DfZqGdIO.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BU465nht.js → AreaChart-DXIhupUU.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BHLBiz0J.js → ArrowUp-mYUQI3ny.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CsopTrXA.js → ArrowUpRight-D7jEUphZ.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BSSfIVDh.js → CheckCircle-BA3THiSr.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DnuZlbXl.js → ChevronDown-BpKPHxDG.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D8z61LL4.js → ChevronRight-ByVxw7yb.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-SvG4tBeC.js → ChevronUp-DKgNoV7g.js} +1 -1
  9. package/dist/client/assets/{Copy01-8RoWdlIb.js → Copy01-AuaMhdvh.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-ByzWfjph.js → DotsVertical-Ctyi_Fcj.js} +1 -1
  11. package/dist/client/assets/{Eye-BMB6Dsvc.js → Eye-CaHkvWGU.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Cb5gzr5c.js → FilterLines-B_F076bt.js} +1 -1
  13. package/dist/client/assets/{Globe01-C6g7oQ38.js → Globe01-9M3ZtnRh.js} +1 -1
  14. package/dist/client/assets/{Globe04-CYEWS6xQ.js → Globe04-BBu3oRiw.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Dv77s3h5.js → HardDrive-Czo8EXKT.js} +1 -1
  16. package/dist/client/assets/{Image01-YE-JCd5P.js → Image01-C8aqMMC0.js} +1 -1
  17. package/dist/client/assets/{Key01-C9Hax98L.js → Key01-HpKP7kjq.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-CoMgIDfR.js → LayoutLeft-BZQmnN4U.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BYMM_QSD.js → LinkExternal01-wLaoE2BO.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CDUuvvya.js → Monitor01-CCqvvSCN.js} +1 -1
  21. package/dist/client/assets/{Package-BwfmB-wY.js → Package-DXwLO7TZ.js} +1 -1
  22. package/dist/client/assets/{Palette-wIBeqOmX.js → Palette-BOYYX-x4.js} +1 -1
  23. package/dist/client/assets/{Play-CmeXDhbv.js → Play-Bhc_0wGz.js} +1 -1
  24. package/dist/client/assets/{Plus-DErQhYMo.js → Plus-BFo0Fsne.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BcyXaR5Z.js → SearchLg-D_s4Wx9C.js} +1 -1
  26. package/dist/client/assets/{SearchMd-B2xdLkpr.js → SearchMd-DnmtefV6.js} +1 -1
  27. package/dist/client/assets/{Settings02-BQIoToME.js → Settings02-DcvdDwJo.js} +1 -1
  28. package/dist/client/assets/{Shield01-BnV0ErmL.js → Shield01-hx04AF4i.js} +1 -1
  29. package/dist/client/assets/{Star01-BvPb97r4.js → Star01-DVFgs_0J.js} +1 -1
  30. package/dist/client/assets/{Stars01-Dq_ij1vd.js → Stars01-B5Wh8soo.js} +1 -1
  31. package/dist/client/assets/{Stars02-D0dtbcP0.js → Stars02-PuKOl8z5.js} +1 -1
  32. package/dist/client/assets/{Sun-BNn7fIcF.js → Sun-Cw5YUhig.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-B5xg5r1q.js → SwitchHorizontal01-DYptKpyt.js} +1 -1
  34. package/dist/client/assets/{Tool01-1JY4WdfO.js → Tool01-CpROxlr0.js} +1 -1
  35. package/dist/client/assets/{Tool02-CJRfU6-e.js → Tool02-C8iwn6Q8.js} +1 -1
  36. package/dist/client/assets/{Trash01-D68y5OFq.js → Trash01-zPnxi6aE.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-Be3cv-nx.js → TrendUp01-ryekGRAe.js} +1 -1
  38. package/dist/client/assets/{Upload01-CPQnKMdb.js → Upload01-L8Z9Doey.js} +1 -1
  39. package/dist/client/assets/{User01-BErqEcB8.js → User01-DewcmwdK.js} +1 -1
  40. package/dist/client/assets/{Users01-CdOl2233.js → Users01-Dc2haknw.js} +1 -1
  41. package/dist/client/assets/{Users03-01ZOLPet.js → Users03-DmiDj7OC.js} +1 -1
  42. package/dist/client/assets/{X-DXgmI1I4.js → X-DvSaCzV-.js} +1 -1
  43. package/dist/client/assets/{XCircle-DY497Rjn.js → XCircle-C6mRHoZP.js} +1 -1
  44. package/dist/client/assets/{XClose-C4EmtqAA.js → XClose-CnDiE4wN.js} +1 -1
  45. package/dist/client/assets/{Zap-BPdmVchQ.js → Zap-B7fiN40E.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-DiXc_WiU.js → ZapSquare-BAQcu1iA.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DO1ABQMU.js → ZoomOut-shbGcJgg.js} +1 -1
  48. package/dist/client/assets/{access-gate-Du5lQEFN.js → access-gate-BQ5nV9CM.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-Cj2upX49.js → add-section-modal-CDMDYlK5.js} +1 -1
  50. package/dist/client/assets/{agent-icon-D4a2yQAy.js → agent-icon-CzJVw_PS.js} +1 -1
  51. package/dist/client/assets/{agents-list-CbWCKvO8.js → agents-list-CdJFtIq2.js} +1 -1
  52. package/dist/client/assets/{ai-providers-CTkmKKCc.js → ai-providers-DluYZyyW.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-C0dmYQwl.js → alert-dialog-Y1XXElMo.js} +1 -1
  54. package/dist/client/assets/{alert-ZjKFCE6g.js → alert-j08TigIF.js} +1 -1
  55. package/dist/client/assets/{app-editor-C9vstOJe.js → app-editor-D8GIAPUq.js} +1 -1
  56. package/dist/client/assets/{auth-z6bL2iLM.js → auth-DGbJKtcV.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-CTUsNjBA.js → auth-catchall-CiycU9Fr.js} +1 -1
  58. package/dist/client/assets/{auth-entry-DhkhuzaY.js → auth-entry-CYNZqOOw.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-BlG-p1RQ.js → auth-split-layout-BrESDdg5.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-C7P5en8H.js → authenticate-and-persist-oauth-tUtbW76M.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-Bu9C738j.js → automation-list-row-Ci-vo0Ok.js} +1 -1
  62. package/dist/client/assets/automation-runs-BdqIedR2.js +87 -0
  63. package/dist/client/assets/{automations-Bnj3R1rO.js → automations-B5nmIsQw.js} +1 -1
  64. package/dist/client/assets/{autosend-DViO44x-.js → autosend-C5LHLeko.js} +1 -1
  65. package/dist/client/assets/{avatar-f9PWmWko.js → avatar-DBnOObMJ.js} +1 -1
  66. package/dist/client/assets/{badge-D-j0sOs9.js → badge-C6MoaNaP.js} +1 -1
  67. package/dist/client/assets/{block-document-Bp1KtsqP.js → block-document-aXxr97-G.js} +1 -1
  68. package/dist/client/assets/{brand-context-Ce4eNHs8.js → brand-context-CtFfSAiC.js} +1 -1
  69. package/dist/client/assets/{buckets-DFmFwZCi.js → buckets-BGwcc7oD.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CkjZ2spD.js → bulk-category-panel-C8XqXeAU.js} +1 -1
  71. package/dist/client/assets/{calendar-CL1lHfJI.js → calendar-DX2eI8nn.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DifNtXec.js → capability-load-error-C6Zz4eJ1.js} +1 -1
  73. package/dist/client/assets/{card-D4CJeQSR.js → card-CMA-4CeN.js} +1 -1
  74. package/dist/client/assets/{category-editor-DPATJKY9.js → category-editor-C6Be1dfI.js} +1 -1
  75. package/dist/client/assets/{chat-context-0yEIHZ6c.js → chat-context-CWKEbJVu.js} +1 -1
  76. package/dist/client/assets/{checkbox-JCl8QP8q.js → checkbox-BZmlCGR-.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-BfTlukPl.js → cli-auth-success-D834jweo.js} +1 -1
  78. package/dist/client/assets/{collection-detail-Bd8G9LY3.js → collection-detail-jPNP5mzy.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-DRoGXo78.js → collection-display-button-DrgpSLTZ.js} +1 -1
  80. package/dist/client/assets/{collection-search-C0RNwRHs.js → collection-search-CwZ01sWP.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-ByMEj5PE.js → collection-table-wrapper-DaIANWjI.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-Dhx2wMNU.js → collection-tabs-BtxGuG1G.js} +1 -1
  83. package/dist/client/assets/{command-DjqCY9Vi.js → command-Sec7WA_A.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-D5J7bOeb.js → commerce-onboarding-DOH59RlG.js} +1 -1
  85. package/dist/client/assets/{companions-core-Bn5T5Kw9.js → companions-core-CXq5b4GI.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-D_e_16jN.js → connect-desktop-dialog-aCqZE31x.js} +1 -1
  87. package/dist/client/assets/{connection-card-FP7DKtbx.js → connection-card-DNDrESB-.js} +1 -1
  88. package/dist/client/assets/{connection-detail-Cr17GhO0.js → connection-detail-CPrWbBFM.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-C7V7pVnH.js → connection-form-helpers-l_ijwaHD.js} +1 -1
  90. package/dist/client/assets/{connections-WWFvOY1G.js → connections-F5mve2lg.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-BNj5yLz-.js → decopilot-sse-pool-BOQSRcee.js} +1 -1
  92. package/dist/client/assets/{dialog-pxztKdM4.js → dialog-CvsnsHc6.js} +1 -1
  93. package/dist/client/assets/{domain-settings-IJTQ43bo.js → domain-settings-B9EhJQUW.js} +1 -1
  94. package/dist/client/assets/{drawer-eINF-fuO.js → drawer-D8dHZiX8.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-CRae2C9x.js → dropdown-menu-C1qlOMZ7.js} +1 -1
  96. package/dist/client/assets/{empty-state-DvObzH8u.js → empty-state-DA8bHc-1.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CeFGCUkk.js → extract-connection-data-CTvABTjg.js} +1 -1
  98. package/dist/client/assets/{file-explorer-3SJ4vb--.js → file-explorer-DLyQqFEm.js} +1 -1
  99. package/dist/client/assets/{file-type-icon-zSQ0dOtZ.js → file-type-icon-DnyFLF_v.js} +1 -1
  100. package/dist/client/assets/{files-CjIuQ02f.js → files-SyN3ok5O.js} +1 -1
  101. package/dist/client/assets/{form--yMAb3ro.js → form-DWLFR7nn.js} +1 -1
  102. package/dist/client/assets/{general-B9pSq-fb.js → general-CBHFRb3j.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-Cgx6amzW.js → github-repo-picker-BnPj766W.js} +1 -1
  104. package/dist/client/assets/{hooks-C8ac-vFI.js → hooks-DPnPW1Ib.js} +1 -1
  105. package/dist/client/assets/{index-Bb03HxpV.js → index-B4M08Kup.js} +1 -1
  106. package/dist/client/assets/{index-SNB4eexL.js → index-BOTjGzy-.js} +1 -1
  107. package/dist/client/assets/{index-BeXgUXox.js → index-BP1MoKqU.js} +2 -2
  108. package/dist/client/assets/{index-CDvq8kTD.js → index-BS_H3vZJ.js} +1 -1
  109. package/dist/client/assets/{index-BSVi3cEY.js → index-BvCHxsMv.js} +1 -1
  110. package/dist/client/assets/{index-32Z_4GES.js → index-C2u4siS5.js} +3 -3
  111. package/dist/client/assets/{index-CmqIldWF.js → index-C652yWgR.js} +1 -1
  112. package/dist/client/assets/{index-xVsqSBJP.js → index-C8qWG1s1.js} +1 -1
  113. package/dist/client/assets/{index-BsOcdcPy.js → index-CfPj3M1l.js} +1 -1
  114. package/dist/client/assets/{index-CyCC6Kib.js → index-Cg3sR771.js} +5 -5
  115. package/dist/client/assets/{index-Cx9R0N8d.js → index-CnYXLAS2.js} +1 -1
  116. package/dist/client/assets/{index-3nwYTcZz.js → index-CuO_-GZV.js} +1 -1
  117. package/dist/client/assets/{index-BFiY8eXY.js → index-D3xpdmzO.js} +1 -1
  118. package/dist/client/assets/{index-ZgzVcEPr.js → index-gs_-K8Xc.js} +1 -1
  119. package/dist/client/assets/{index-redirect-CiTCXVUI.js → index-redirect-B0vIbjhT.js} +1 -1
  120. package/dist/client/assets/{input-DNRaDhXk.js → input-Cb7CGqPN.js} +1 -1
  121. package/dist/client/assets/{integration-icon-Bj_L5G59.js → integration-icon-J19ZNMb3.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-DTrnC4Ns.js → invite-member-dialog-BktkDK4v.js} +1 -1
  123. package/dist/client/assets/{label-DqJN0Zl6.js → label-DhK5GRHz.js} +1 -1
  124. package/dist/client/assets/{layout-BkG06DbR.js → layout-mvz0VkGf.js} +1 -1
  125. package/dist/client/assets/{login-C9VxLGwl.js → login-DnHBlyYy.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-ClvvvmOF.js → mcp-oauth-BC7utMST.js} +1 -1
  127. package/dist/client/assets/{members-CkIyByQ6.js → members-CtWVlKsQ.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-D20TtRkQ.js → monaco-editor-BIYcRCql.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-DZJthgJ6.js → monitoring-stats-row-IQKypVBe.js} +1 -1
  130. package/dist/client/assets/{multi-select-DypU6S8g.js → multi-select-34xx2CMv.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-CU0eKEdH.js → oauth-callback-BGOH4D8o.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-4FUqXMlc.js → oauth-callback-ai-provider-PRHGkPfW.js} +1 -1
  133. package/dist/client/assets/{onboarding-C98UvNP1.js → onboarding-DLxx1gWn.js} +1 -1
  134. package/dist/client/assets/{org-install-DxjPueVj.js → org-install-Dwpb1igA.js} +1 -1
  135. package/dist/client/assets/{org-layout--0dYF5Rt.js → org-layout-bdr-vVje.js} +1 -1
  136. package/dist/client/assets/{organization-choice-BtDkbSqS.js → organization-choice-CIPEZcwe.js} +1 -1
  137. package/dist/client/assets/{orgs-Cau5_2Ta.js → orgs-od-Pv3L_.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-DUIIg46E.js → page-seo-form-Dki7TfnI.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-IGjlhmAS.js +1 -0
  140. package/dist/client/assets/{popover-RIaRL7oB.js → popover-DfzsvCwC.js} +1 -1
  141. package/dist/client/assets/{post-editor-CSFQcBXM.js → post-editor-D9D6bmBX.js} +1 -1
  142. package/dist/client/assets/{primitives-CcasBN-m.js → primitives-BldH5G0Y.js} +1 -1
  143. package/dist/client/assets/{profile-CGP5jgHZ.js → profile-p6-RhyAf.js} +1 -1
  144. package/dist/client/assets/project-app-view-jcmOJAzs.js +1 -0
  145. package/dist/client/assets/record-editor-mYDnFPKa.js +1 -0
  146. package/dist/client/assets/redirect-editor-DDOBLKqx.js +1 -0
  147. package/dist/client/assets/registry-Cwg8k1bk.js +2 -0
  148. package/dist/client/assets/{registry-layout-DTfv4xqc.js → registry-layout-B0C8DhKi.js} +1 -1
  149. package/dist/client/assets/{reports-CGJDic-D.js → reports-zyK4duNr.js} +1 -1
  150. package/dist/client/assets/{require-capability-Dl7MMUtS.js → require-capability-1lcUjA-x.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-BN9gLlS8.js → required-auth-layout-B1JMkrdm.js} +1 -1
  152. package/dist/client/assets/{reset-password-Btk86aOM.js → reset-password-BqQSf4XO.js} +1 -1
  153. package/dist/client/assets/{roles-p1k02HxK.js → roles-lEZwMitt.js} +1 -1
  154. package/dist/client/assets/{search-input-DrcJxljH.js → search-input-CFD2CbeL.js} +1 -1
  155. package/dist/client/assets/{secrets-tpvThXzx.js → secrets-Duyv1ctC.js} +1 -1
  156. package/dist/client/assets/{sections-editor-BuHOy4hR.js → sections-editor-BvKO1Jmq.js} +1 -1
  157. package/dist/client/assets/{select-B_NF3ir8.js → select-DMy4CZEM.js} +1 -1
  158. package/dist/client/assets/{select-model-CD-bNwFP.js → select-model-CeH3eiDd.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-CQ9Oidp5.js → self-tool-result-CrTztwJC.js} +1 -1
  160. package/dist/client/assets/{seo-editor-tD1KbIp4.js → seo-editor-C8dIZ0r1.js} +1 -1
  161. package/dist/client/assets/{settings-layout-CIwY5Rcg.js → settings-layout-DYLu6KAT.js} +1 -1
  162. package/dist/client/assets/{settings-section-qHo4Kia8.js → settings-section-C9wxXn_P.js} +1 -1
  163. package/dist/client/assets/{shell-controls-DJ7fzt-b.js → shell-controls-Dn6r6Au7.js} +1 -1
  164. package/dist/client/assets/{shell-layout-gqjfXR2N.js → shell-layout-BBgOrDIL.js} +1 -1
  165. package/dist/client/assets/{sidebar-ChQMKige.js → sidebar-odBC32K5.js} +1 -1
  166. package/dist/client/assets/{skeleton-TPY4BgOd.js → skeleton-BTXeFNOv.js} +1 -1
  167. package/dist/client/assets/{sso-DwXA1_HM.js → sso-_Rhk71dv.js} +1 -1
  168. package/dist/client/assets/{store-DrJy9eqh.js → store-BHQI7MeI.js} +1 -1
  169. package/dist/client/assets/store-registry-E2glxuZA.js +2 -0
  170. package/dist/client/assets/{studio-tools-n8590dlO.js → studio-tools-DScMFawl.js} +1 -1
  171. package/dist/client/assets/{switch-Vi8KqJDK.js → switch-Ds8K2Lh_.js} +1 -1
  172. package/dist/client/assets/{table-4z3VGMcV.js → table-BW9KHE3_.js} +1 -1
  173. package/dist/client/assets/{tabs-C1aAnItW.js → tabs-DVwZBWMX.js} +1 -1
  174. package/dist/client/assets/{textarea-BIQq3kPx.js → textarea-CTeZ2lal.js} +1 -1
  175. package/dist/client/assets/{toggle-group-Buak4Ijq.js → toggle-group-BSTIOzYn.js} +1 -1
  176. package/dist/client/assets/{toolbar-ChkgagFk.js → toolbar-CgZE309S.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-D0eZmrE1.js → toolbar-icon-button-8zS2muhz.js} +1 -1
  178. package/dist/client/assets/{tooltip-CpOqB12v.js → tooltip-DK2r83_Q.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-DcaGLvIS.js → use-ai-providers-DHwTb1GL.js} +1 -1
  180. package/dist/client/assets/{use-automations-CuxMc1af.js → use-automations-BJ1_8SDs.js} +1 -1
  181. package/dist/client/assets/{use-autosave-CKpQpnkI.js → use-autosave-CY_dkvOM.js} +1 -1
  182. package/dist/client/assets/{use-capability-x8vfxJ7c.js → use-capability-ML8qbFhc.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-BXhg46lH.js → use-clock-tick-D6R8tdxE.js} +1 -1
  184. package/dist/client/assets/{use-collections-CRs3mssF.js → use-collections-D6OYG-wc.js} +1 -1
  185. package/dist/client/assets/{use-connection-TbmZTa2Q.js → use-connection-B5YB38XE.js} +1 -1
  186. package/dist/client/assets/{use-copy-GJ89hYnU.js → use-copy-BkTOsha4.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-D4A9sXWT.js → use-create-virtual-mcp-mhzGZuKh.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-DxPGO2nZ.js → use-debounced-autosave-sFFdGAPI.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-D3KV6ORm.js → use-debounced-value-BWIL-1on.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-FWA0HDvb.js → use-deco-credits-Sg-ppvw1.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-BAuSsk9W.js → use-decopilot-events-D35HEWEA.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-DP2vl3YF.js → use-delete-connection-Cv3MGM8b.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-DxJ9HX0C.js → use-deployment-admin-C3okapNs.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-CuD4x2Qa.js → use-file-configs-BCPI-hCq.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DDA5AXOs.js → use-infinite-scroll-CAmtVNGd.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-Bv2XJLBI.js → use-join-requests-mb4WWMEm.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-DlG18-0i.js → use-mcp-auth-status-AcbyV1My.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-Y-YAGLhv.js → use-mcp-client-ioNtd9Ao.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-UKnbu9YR.js → use-mcp-tools-DC9bMhqt.js} +1 -1
  200. package/dist/client/assets/{use-members-DSdmplcs.js → use-members-C5fA1N1j.js} +1 -1
  201. package/dist/client/assets/{use-mobile-Dfj2nxpB.js → use-mobile-Xv_R9Qvv.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-DYHGQgra.js → use-navigate-to-agent-6EBjGP72.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-DSB0aKlT.js → use-org-auth-client-17utjSn0.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-e8s6CsXn.js → use-org-sso-DL3XEgfJ.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-Bq0KJEFt.js → use-organization-roles-CNET-j1d.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-Bj1mes2i.js → use-organization-settings-AW4Wtsqe.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-UpQczPyM.js → use-registry-app-DboVWLxl.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-HQz0dDkM.js → use-registry-connections-Chwp5-AC.js} +1 -1
  209. package/dist/client/assets/{use-secrets-CyDme1l0.js → use-secrets-oaZoGdZ_.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-t_gRyaZh.js → use-status-sounds-DBpucGQh.js} +1 -1
  211. package/dist/client/assets/{use-view-mode-BE4pCHrP.js → use-view-mode-BVrJNwcR.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-1CuGEk-Q.js → use-virtual-mcp-ak6oQOpL.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-DNnEgm4S.js +1 -0
  214. package/dist/client/assets/{useRouterState-B5TWQiWs.js → useRouterState-Dx8mQ23z.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-BX2_Qxr6.js +1 -0
  216. package/dist/client/assets/{users-BcJP-c4R.js → users-CCS1SYP5.js} +1 -1
  217. package/dist/client/assets/{variant-calendar-Caqpyytx.js → variant-calendar-WXrlvvRY.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-DhFesbxw.js → view-mode-toggle-DoOv5WAT.js} +1 -1
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +195 -195
  221. package/dist/server/server.js +159 -159
  222. package/package.json +1 -1
  223. package/dist/client/assets/automation-runs-B-V_i0FR.js +0 -87
  224. package/dist/client/assets/page-seo-sheet-ta7l_YbU.js +0 -1
  225. package/dist/client/assets/project-app-view-DmcoaFOE.js +0 -1
  226. package/dist/client/assets/record-editor-Dd2x-h5p.js +0 -1
  227. package/dist/client/assets/redirect-editor-CNwZ4fIt.js +0 -1
  228. package/dist/client/assets/registry-BLbhzFCc.js +0 -2
  229. package/dist/client/assets/store-registry-Bsp3lSub.js +0 -2
  230. package/dist/client/assets/useInfiniteQuery-BYifa8Cc.js +0 -1
  231. package/dist/client/assets/useSuspenseInfiniteQuery-CgX7veRN.js +0 -1
@@ -1 +1 @@
1
- import{r as V,c as ne,j as t,B as K,i as ae,p as te,l as ge,E as Ge,C as be,b as _e,u as Qe,a as Ne,z as Je,G as Ye,D as Ze,M as et,J as tt,n as nt,t as R,K as st}from"./index-32Z_4GES.js";import{a as De,b as ot,g as it,e as lt}from"./extract-connection-data-CeFGCUkk.js";import{C as rt}from"./collection-display-button-DRoGXo78.js";import{S as ct}from"./search-input-DrcJxljH.js";import{C as at}from"./collection-tabs-Dhx2wMNU.js";import{C as Ce,u as dt,a as ke,g as mt}from"./connection-card-FP7DKtbx.js";import{E as ut}from"./empty-state-DvObzH8u.js";import{P as me}from"./index-BFiY8eXY.js";import{u as pt,D as gt}from"./use-delete-connection-DP2vl3YF.js";import{u as ye}from"./use-capability-x8vfxJ7c.js";import{u as ht}from"./use-infinite-scroll-DDA5AXOs.js";import{u as xt}from"./use-view-mode-BE4pCHrP.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as Te,b as we,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-C0dmYQwl.js";import{n as he}from"./Tool02-CJRfU6-e.js";import{D as Me,a as Fe,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-pxztKdM4.js";import{D as ft,a as jt,c as yt,b as Ct,d as vt,e as St,f as bt}from"./drawer-eINF-fuO.js";import{u as _t}from"./use-mobile-Dfj2nxpB.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form--yMAb3ro.js";import{I as ie}from"./input-DNRaDhXk.js";import{S as Nt,a as Dt,b as kt,c as At,d as ce}from"./select-B_NF3ir8.js";import{T as Tt}from"./textarea-BIQq3kPx.js";import{b as Ke,u as wt}from"./use-connection-TbmZTa2Q.js";import{u as It}from"./use-virtual-mcp-1CuGEk-Q.js";import{u as Pt}from"./studio-tools-n8590dlO.js";import{s as je}from"./Star01-BvPb97r4.js";import{s as He}from"./Plus-DErQhYMo.js";import{N as $t,M as Ot,av as Lt,am as Mt}from"./agent-icon-D4a2yQAy.js";import{s as Ue}from"./XClose-C4EmtqAA.js";import{i as ue,a as Se,E as Ft,c as zt,p as Vt,b as Et,d as Bt}from"./connection-form-helpers-C7V7pVnH.js";import{a as Kt}from"./authenticate-and-persist-oauth-C7P5en8H.js";import{I as Ht}from"./integration-icon-Bj_L5G59.js";import{C as Re}from"./checkbox-JCl8QP8q.js";import{d as le,a as Ut,D as Rt,c as Wt}from"./dropdown-menu-CRae2C9x.js";import{i as Xt}from"./DotsVertical-ByzWfjph.js";import{s as We}from"./Eye-BMB6Dsvc.js";import{s as Xe}from"./Trash01-D68y5OFq.js";import"./use-mcp-client-Y-YAGLhv.js";import"./auth-z6bL2iLM.js";import"./ArrowUp-BHLBiz0J.js";import"./ChevronUp-SvG4tBeC.js";import"./SwitchHorizontal01-B5xg5r1q.js";import"./tooltip-CpOqB12v.js";import"./view-mode-toggle-DhFesbxw.js";import"./badge-D-j0sOs9.js";import"./SearchMd-B2xdLkpr.js";import"./use-registry-connections-HQz0dDkM.js";import"./use-organization-settings-Bj1mes2i.js";import"./useInfiniteQuery-BYifa8Cc.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-D4CJeQSR.js";import"./sidebar-ChQMKige.js";import"./LayoutLeft-CoMgIDfR.js";import"./X-DXgmI1I4.js";import"./label-DqJN0Zl6.js";import"./ChevronDown-DnuZlbXl.js";import"./use-collections-CRs3mssF.js";import"./AlertCircle-DriHvGW8.js";import"./Tool01-1JY4WdfO.js";import"./Settings02-BQIoToME.js";import"./XCircle-DY497Rjn.js";import"./ArrowUpRight-CsopTrXA.js";import"./TrendUp01-Be3cv-nx.js";import"./ZapSquare-DiXc_WiU.js";import"./ZoomOut-DO1ABQMU.js";import"./Users03-01ZOLPet.js";import"./CheckCircle-BSSfIVDh.js";import"./ChevronRight-D8z61LL4.js";import"./Stars02-D0dtbcP0.js";import"./Copy01-8RoWdlIb.js";import"./Globe01-C6g7oQ38.js";import"./FilterLines-Cb5gzr5c.js";import"./Globe04-CYEWS6xQ.js";import"./HardDrive-Dv77s3h5.js";import"./Image01-YE-JCd5P.js";import"./Key01-C9Hax98L.js";import"./LinkExternal01-BYMM_QSD.js";import"./Monitor01-CDUuvvya.js";import"./Sun-BNn7fIcF.js";import"./Package-BwfmB-wY.js";import"./Palette-wIBeqOmX.js";import"./Play-CmeXDhbv.js";import"./SearchLg-BcyXaR5Z.js";import"./Shield01-BnV0ErmL.js";import"./Stars01-Dq_ij1vd.js";import"./Upload01-CPQnKMdb.js";import"./User01-BErqEcB8.js";import"./Users01-CdOl2233.js";import"./Zap-BPdmVchQ.js";import"./mcp-oauth-ClvvvmOF.js";function qt(f){const e=`deco-filters-${f}`,[n,a]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{a(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function Gt(f){const e=ne.c(7),[n,a]=V.useState(f),[o,s]=V.useState(f?"desc":null);let i;e[0]!==o||e[1]!==n?(i=j=>{n!==j?(a(j),s("asc")):o==="asc"?s("desc"):o==="desc"&&(a(void 0),s(null))},e[0]=o,e[1]=n,e[2]=i):i=e[2];const r=i;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function Qt(f){const e=ne.c(20),{namespace:n,resource:a,defaultSortKey:o,defaultViewMode:s}=f,i=o===void 0?"title":o,r=s===void 0?"table":s,[d,j]=V.useState(""),y=V.useDeferredValue(d),C=`${n}-${a}`,[v,u]=qt(C),p=`mesh-${a}-filter-visible-${n}`;let c;e[0]!==p?(c=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=c):c=e[1];const[S,_]=V.useState(c);let b;e[2]!==p?(b=F=>{_(F),globalThis.localStorage?.setItem(p,String(F))},e[2]=p,e[3]=b):b=e[3];const w=b;let D;e[4]!==S||e[5]!==w?(D=()=>{w(!S)},e[4]=S,e[5]=w,e[6]=D):D=e[6];const l=D,[I,$]=xt(`mesh-${a}-${n}`,r),{sortKey:L,sortDirection:T,handleSort:O}=Gt(i),k=L;let M;return e[7]!==S||e[8]!==v||e[9]!==O||e[10]!==d||e[11]!==y||e[12]!==w||e[13]!==u||e[14]!==$||e[15]!==T||e[16]!==k||e[17]!==l||e[18]!==I?(M={search:d,searchTerm:y,setSearch:j,filters:v,setFilters:u,filterBarVisible:S,setFilterBarVisible:w,toggleFilterBar:l,viewMode:I,setViewMode:$,sortKey:k,sortDirection:T,handleSort:O},e[7]=S,e[8]=v,e[9]=O,e[10]=d,e[11]=y,e[12]=w,e[13]=u,e[14]=$,e[15]=T,e[16]=k,e[17]=l,e[18]=I,e[19]=M):M=e[19],M}function Jt(f){const e=ne.c(20),{open:n,onOpenChange:a,count:o,onConfirm:s}=f,i=o!==1?"s":"";let r;e[0]!==o||e[1]!==i?(r=t.jsxs(Ae,{children:["Delete ",o," connection",i,"?"]}),e[0]=o,e[1]=i,e[2]=r):r=e[2];const d=o!==1?"s":"";let j;e[3]!==d?(j=t.jsxs(Te,{children:["This will permanently delete the selected connection",d,". This action cannot be undone."]}),e[3]=d,e[4]=j):j=e[4];let y;e[5]!==r||e[6]!==j?(y=t.jsxs(we,{children:[r,j]}),e[5]=r,e[6]=j,e[7]=y):y=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{children:"Cancel"}),e[8]=C):C=e[8];const v=o!==1?"s":"";let u;e[9]!==o||e[10]!==s||e[11]!==v?(u=t.jsxs(Pe,{children:[C,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",o," connection",v]})]}),e[9]=o,e[10]=s,e[11]=v,e[12]=u):u=e[12];let p;e[13]!==y||e[14]!==u?(p=t.jsxs(Oe,{children:[y,u]}),e[13]=y,e[14]=u,e[15]=p):p=e[15];let c;return e[16]!==a||e[17]!==n||e[18]!==p?(c=t.jsx(Le,{open:n,onOpenChange:a,children:p}),e[16]=a,e[17]=n,e[18]=p,e[19]=c):c=e[19],c}function Yt(f){return f._registryId?.includes("community-registry")===!0}function Zt(f){const e=ne.c(58),{item:n,canManage:a,allConnections:o,connectedAppNames:s,connectingItemId:i,onNavigateConnected:r,onConnect:d}=f,[j,y]=V.useState(!1),[C,v]=V.useState(null);let u,p;e[0]!==s||e[1]!==n?(u=De(n)??"",p=s.has(u),e[0]=s,e[1]=n,e[2]=u,e[3]=p):(u=e[2],p=e[3]);const c=p,S=n._meta?.["mcp.mesh"],_=S?.friendlyName||S?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let w;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(w=n.server?.icons?.[0]?.src||ot(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=w):w=e[6];const D=w;let l;if(e[7]!==o||e[8]!==u){let A;e[10]!==u?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===u,e[10]=u,e[11]=A):A=e[11],l=o.filter(A),e[7]=o,e[8]=u,e[9]=l}else l=e[9];const I=l;let $;e[12]!==n?($=Yt(n),e[12]=n,e[13]=$):$=e[13];const L=$;let T,O;e[14]!==I||e[15]!==a||e[16]!==L||e[17]!==c||e[18]!==n||e[19]!==d||e[20]!==r?(T=()=>{if(c){const A=I[0];A&&r(A);return}a&&O()},O=()=>{L?(v("connect"),y(!0)):d(n)},e[14]=I,e[15]=a,e[16]=L,e[17]=c,e[18]=n,e[19]=d,e[20]=r,e[21]=T,e[22]=O):(T=e[21],O=e[22]);let k;e[23]!==n||e[24]!==d||e[25]!==C?(k=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),C==="connect"&&d(n),v(null)},e[23]=n,e[24]=d,e[25]=C,e[26]=k):k=e[26];const M=k;let F;e[27]!==b||e[28]!==D||e[29]!==_?(F={title:_,description:b,icon:D},e[27]=b,e[28]=D,e[29]=_,e[30]=F):F=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(he,{}),e[31]=q):q=e[31];let U;e[32]!==L||e[33]!==n._sourceIcon?(U=L&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=L,e[33]=n._sourceIcon,e[34]=U):U=e[34];let W;e[35]!==a||e[36]!==i||e[37]!==O||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):a&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),O()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=a,e[36]=i,e[37]=O,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let g;e[41]!==U||e[42]!==W?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[U,W]}),e[41]=U,e[42]=W,e[43]=g):g=e[43];let N;e[44]!==T||e[45]!==g||e[46]!==F?(N=t.jsx(Ce,{connection:F,fallbackIcon:q,onClick:T,headerActionsAlwaysVisible:!0,headerActions:g}),e[44]=T,e[45]=g,e[46]=F,e[47]=N):N=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(we,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(Te,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Ie,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==M?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[H,t.jsx($e,{onClick:M,children:"Continue"})]})]}),e[50]=M,e[51]=E):E=e[51];let h;e[52]!==j||e[53]!==E?(h=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=h):h=e[54];let P;return e[55]!==N||e[56]!==h?(P=t.jsxs(t.Fragment,{children:[N,h]}),e[55]=N,e[56]=h,e[57]=P):P=e[57],P}function qe(f){const e=ne.c(8),{selectionMode:n,children:a}=f,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[0]!==o?(s=ge("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ut,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Xt,{size:20})})}),e[2]=i):i=e[2];let r;e[3]!==a?(r=t.jsxs(Rt,{children:[i,t.jsx(Wt,{align:"end",onClick:en,children:a})]}),e[3]=a,e[4]=r):r=e[4];let d;return e[5]!==s||e[6]!==r?(d=t.jsx("div",{className:s,children:r}),e[5]=s,e[6]=r,e[7]=d):d=e[7],d}function en(f){return f.stopPropagation()}function tn(f){return f.stopPropagation()}function nn(f){const e=ne.c(49),{group:n,onOpen:a,selectionMode:o,selectedIds:s,onToggleSelect:i}=f;let r;if(e[0]!==n.connections||e[1]!==s){let k;e[3]!==s?(k=M=>s.has(M.id),e[3]=s,e[4]=k):k=e[4],r=n.connections.every(k),e[0]=n.connections,e[1]=s,e[2]=r}else r=e[2];const d=r;let j;if(e[5]!==n.connections||e[6]!==s){let k;e[8]!==s?(k=M=>s.has(M.id),e[8]=s,e[9]=k):k=e[9],j=n.connections.some(k),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j;let C;e[10]!==d||e[11]!==n.connections||e[12]!==i||e[13]!==s?(C=()=>{for(const k of n.connections)d?s.has(k.id)&&i(k.id):s.has(k.id)||i(k.id)},e[10]=d,e[11]=n.connections,e[12]=i,e[13]=s,e[14]=C):C=e[14];const v=C,u=`${n.connections.length} instances`;let p;e[15]!==n.icon||e[16]!==n.title||e[17]!==u?(p={title:n.title,icon:n.icon,description:u},e[15]=n.icon,e[16]=n.title,e[17]=u,e[18]=p):p=e[18];let c;e[19]!==a||e[20]!==o||e[21]!==v?(c=()=>o?v():a(),e[19]=a,e[20]=o,e[21]=v,e[22]=c):c=e[22];const S=o&&d&&"ring-2 ring-primary",_=o&&y&&!d&&"ring-1 ring-primary/50";let b;e[23]!==S||e[24]!==_?(b=ge(S,_),e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(he,{}),e[26]=w):w=e[26];let D;e[27]!==d||e[28]!==n.connections.length||e[29]!==o||e[30]!==y||e[31]!==v?(D=o?t.jsx(Re,{checked:d?!0:y?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[27]=d,e[28]=n.connections.length,e[29]=o,e[30]=y,e[31]=v,e[32]=D):D=e[32];let l;e[33]!==a?(l=k=>{k.stopPropagation(),a()},e[33]=a,e[34]=l):l=e[34];let I;e[35]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(We,{size:16}),e[35]=I):I=e[35];let $;e[36]!==l?($=t.jsxs(le,{onClick:l,children:[I,"Open"]}),e[36]=l,e[37]=$):$=e[37];let L;e[38]!==o||e[39]!==$?(L=t.jsx(qe,{selectionMode:o,children:$}),e[38]=o,e[39]=$,e[40]=L):L=e[40];let T;e[41]!==D||e[42]!==L?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[D,L]}),e[41]=D,e[42]=L,e[43]=T):T=e[43];let O;return e[44]!==T||e[45]!==p||e[46]!==c||e[47]!==b?(O=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:p,onClick:c,className:b,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:T})}),e[44]=T,e[45]=p,e[46]=c,e[47]=b,e[48]=O):O=e[48],O}function sn(f){const e=ne.c(29),{connection:n,isSelected:a,selectionMode:o,canManage:s,canManageAgents:i,onToggleSelect:r,onOpen:d,onToggleStatus:j,onDelete:y}=f;let C;e[0]!==a||e[1]!==r||e[2]!==o?(C=o?t.jsx(Re,{checked:a,onCheckedChange:r,onClick:on}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=a,e[1]=r,e[2]=o,e[3]=C):C=e[3];let v;e[4]!==d?(v=D=>{D.stopPropagation(),d()},e[4]=d,e[5]=v):v=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{size:16}),e[6]=u):u=e[6];let p;e[7]!==v?(p=t.jsxs(le,{onClick:v,children:[u,"Open"]}),e[7]=v,e[8]=p):p=e[8];let c;e[9]!==s||e[10]!==i||e[11]!==r?(c=(s||i)&&t.jsxs(le,{onClick:D=>{D.stopPropagation(),r()},children:[t.jsx(Lt,{size:16}),"Select"]}),e[9]=s,e[10]=i,e[11]=r,e[12]=c):c=e[12];let S;e[13]!==s||e[14]!==n||e[15]!==j?(S=s&&(n.status==="active"?t.jsxs(le,{onClick:D=>{D.stopPropagation(),j("inactive")},children:[t.jsx($t,{size:16}),"Disable"]}):t.jsxs(le,{onClick:D=>{D.stopPropagation(),j("active")},children:[t.jsx(Ot,{size:16}),"Enable"]})),e[13]=s,e[14]=n,e[15]=j,e[16]=S):S=e[16];let _;e[17]!==s||e[18]!==y?(_=s&&t.jsxs(le,{variant:"destructive",onClick:D=>{D.stopPropagation(),y()},children:[t.jsx(Xe,{size:16}),"Delete"]}),e[17]=s,e[18]=y,e[19]=_):_=e[19];let b;e[20]!==o||e[21]!==p||e[22]!==c||e[23]!==S||e[24]!==_?(b=t.jsxs(qe,{selectionMode:o,children:[p,c,S,_]}),e[20]=o,e[21]=p,e[22]=c,e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;return e[26]!==C||e[27]!==b?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[C,b]}),e[26]=C,e[27]=b,e[28]=w):w=e[28],w}function on(f){return f.stopPropagation()}function ln(f){const e=ne.c(23),{count:n,total:a,canManage:o,canManageAgents:s,onSelectAll:i,onDeselectAll:r,onDelete:d,onAddToAgent:j,onToggleStatus:y,onCancel:C}=f;if(n===0)return null;let v;e[0]!==n?(v=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=v):v=e[1];let u;e[2]!==n||e[3]!==r||e[4]!==i||e[5]!==a?(u=n<a?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",a,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:"Clear selection"}),e[2]=n,e[3]=r,e[4]=i,e[5]=a,e[6]=u):u=e[6];let p;e[7]!==s||e[8]!==j?(p=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(He,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=p):p=e[9];let c;e[10]!==o||e[11]!==d||e[12]!==y?(c=o&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Xe,{size:13}),"Delete"]})]}),e[10]=o,e[11]=d,e[12]=y,e[13]=c):c=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ue,{size:13}),e[14]=S):S=e[14];let _;e[15]!==C?(_=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:C,children:S}),e[15]=C,e[16]=_):_=e[16];let b;return e[17]!==v||e[18]!==u||e[19]!==p||e[20]!==c||e[21]!==_?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[v,u,p,c,_]})}),e[17]=v,e[18]=u,e[19]=p,e[20]=c,e[21]=_,e[22]=b):b=e[22],b}function rn(f){const e=ne.c(25),{open:n,onOpenChange:a,agents:o,onConfirm:s}=f,[i,r]=V.useState(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs(Me,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=d):d=e[0];let j;e[1]!==o||e[2]!==i?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):o.map(b=>t.jsxs("button",{type:"button",onClick:()=>r(b.id),className:ge("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ht,{icon:b.icon,name:b.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=o,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let C;e[6]!==a?(C=t.jsx(K,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e[6]=a,e[7]=C):C=e[7];const v=!i;let u;e[8]!==s||e[9]!==a||e[10]!==i?(u=()=>{i&&(s(i),a(!1),r(null))},e[8]=s,e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]!==v||e[13]!==u?(p=t.jsx(K,{disabled:v,onClick:u,children:"Add"}),e[12]=v,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==C||e[16]!==p?(c=t.jsxs(Ve,{children:[C,p]}),e[15]=C,e[16]=p,e[17]=c):c=e[17];let S;e[18]!==y||e[19]!==c?(S=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[d,y,c]}),e[18]=y,e[19]=c,e[20]=S):S=e[20];let _;return e[21]!==a||e[22]!==n||e[23]!==S?(_=t.jsx(Be,{open:n,onOpenChange:a,children:S}),e[21]=a,e[22]=n,e[23]=S,e[24]=_):_=e[24],_}function cn({listState:f,activeTab:e,typeFilter:n,statusFilter:a,registryFilter:o,enabledRegistries:s}){const{org:i}=be(),r=nt(),d=_e(),{data:j}=Ne.useSession(),y=Ke(),C=wt(f),v=pt(),{granted:u}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[c,S]=V.useState(new Set),_=c.size>0,[b,w]=V.useState(!1),[D,l]=V.useState(!1),[I,$]=V.useState(null),L=It(),T=C.filter(m=>!(n!=="ALL"&&m.connection_type!==n||a!=="ALL"&&m.status!==a)),O=mt(T),k=m=>{S(x=>{const B=new Set(x);return B.has(m)?B.delete(m):B.add(m),B})},M=()=>{S(new Set)},F=ke(s,f.searchTerm),q=F.items,U=ht(F.loadMore,F.hasMore,F.isLoadingMore),W=new Set(C.filter(m=>m.app_name).map(m=>m.app_name)),g=o==="ALL"||s.some(m=>m.id===o)?o:"ALL",N=f.search.length>0,z=e==="all"||N?q.filter(m=>{if(g!=="ALL"&&m._registryId!==g)return!1;if(N){const x=De(m);if(x&&W.has(x))return!1}return!0}):[],H=e==="connected"||N?O:[],E=async m=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),$(m.id);try{const x=lt(m,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:se}=await y.create.mutateAsync(x),re=await Kt({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:se,data:{connection_token:fe}}).then(()=>{})});if(re.ran&&!re.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:re.error??"no_token"}),R.error(`Authentication failed: ${re.error??"no token received"}`);return}if(re.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await r.invalidateQueries({queryKey:st.isMCPAuthenticated(fe.href,null)}),P(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},h=Pt(),P=()=>{r.invalidateQueries({predicate:m=>{const x=m.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{w(!1);const m=[...c];te("connections_bulk_delete",{count:m.length});let x=0;for(const B of m)try{await h.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}P(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),M()},oe=async(m,x)=>{try{await y.update.mutateAsync({id:m,data:{status:x}}),P(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async m=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:m});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:m}}),B++}catch{}P(),R.success(`${m==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),M()},de=async m=>{const x=L.find(X=>X.id===m);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:m,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await h.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...x.connections,...G]}}),r.invalidateQueries({predicate:X=>{const se=X.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),M()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...v}),t.jsx(Jt,{open:b,onOpenChange:w,count:c.size,onConfirm:A}),t.jsx(rn,{open:D,onOpenChange:l,agents:L,onConfirm:de}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(N?z.length===0&&T.length===0:e==="all"?z.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:u?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(m=>{if(m.type==="group")return t.jsx(nn,{group:m,onOpen:()=>{d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:m.key}})},selectionMode:_,selectedIds:c,onToggleSelect:k},m.key);const x=m.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(he,{}),onClick:()=>_?k(x.id):d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),className:ge(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(sn,{connection:x,isSelected:B,selectionMode:_,canManage:u,canManageAgents:p,onToggleSelect:()=>k(x.id),onOpen:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>v.requestDelete(x)})},x.id)}),z.map(m=>t.jsx(Zt,{item:m,canManage:u,allConnections:C,connectedAppNames:W,connectingItemId:I,onNavigateConnected:x=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onConnect:E},`catalog-${m._registryId}:${m.id}`)),(e==="all"||N)&&s.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||N)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(ln,{count:c.size,total:T.length,canManage:u,canManageAgents:p,onSelectAll:()=>{S(new Set(T.map(m=>m.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>w(!0),onAddToAgent:()=>l(!0),onToggleStatus:xe,onCancel:M})]})}function an(){const{org:f}=be(),e=_e(),n=Qe({strict:!1}),{data:a}=Ne.useSession(),{stdioEnabled:o}=Je(),s=_t(),{granted:i}=ye("connections:manage"),r=Qt({namespace:f.slug,resource:"connections"}),d=Ke(),[j,y]=Ye(Ze.connectionsTab(f.slug),g=>n.tab==="all"||n.tab==="connected"?n.tab:g??"all"),[C,v]=V.useState("ALL"),[u,p]=V.useState("ALL"),[c,S]=V.useState("ALL"),_=dt(),w=ke(_,r.searchTerm).items,D=r.search!==r.searchTerm,l=et({resolver:tt(zt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),I=l.watch("ui_type"),$=l.watch("connection_url"),L=l.watch("npx_package"),T=ue({uiType:I,connectionUrl:$??"",npxPackage:L??""})??Se({uiType:I,connectionUrl:$??"",registryItems:w}),O=i&&n.action==="create",k=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},M=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},F=async g=>{let N,z=null,H=null,E=null;g.ui_type==="NPX"?(N="STDIO",z="",E=Et(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(N="STDIO",z="",E=Bt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(N=g.ui_type,z=g.connection_url||"",H=g.connection_token||null);const h=it("conn");te("connection_custom_created",{connection_type:N,ui_type:g.ui_type}),await d.create.mutateAsync({id:h,title:g.title,description:g.description||null,connection_type:N,connection_url:z,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:f.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),l.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:pe({app_name:null,connection_url:z,title:g.title,id:h})}})},q=g=>{g||(O&&M(),l.reset())},U=g=>{const N=g.trim();if(!N)return;const z=!!l.formState.dirtyFields.title,H=!!l.formState.dirtyFields.description,E=!!l.formState.dirtyFields.env_vars,h=A=>{if(A&&(!z&&!l.getValues("title").trim()&&A.title&&l.setValue("title",A.title,{shouldDirty:!1}),!H&&!(l.getValues("description")??"").trim()&&A.description&&l.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=l.getValues("env_vars")??[],xe=new Set(oe.map(m=>m.key)),de=A.envVarKeys.filter(m=>!xe.has(m));de.length>0&&l.setValue("env_vars",[...oe,...de.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},P=Vt(N);if(P&&o){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",P.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),h(ue({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const A=I==="HTTP"||I==="SSE"||I==="Websocket"?I:"HTTP";l.setValue("ui_type",A,{shouldDirty:!0}),l.setValue("connection_url",N,{shouldDirty:!0}),h(ue({uiType:A,connectionUrl:N})??Se({uiType:A,connectionUrl:N,registryItems:w}));return}I==="NPX"&&h(ue({uiType:"NPX",npxPackage:N}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:k,children:[t.jsx(He,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const g="Create Connection",N="Create a custom connection in your organization. Fill in the details below.",z=l.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(Nt,{value:h.value,onValueChange:h.onChange,children:[t.jsx(Z,{children:t.jsx(Dt,{children:t.jsx(kt,{})})}),t.jsxs(At,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),o&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),I==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),l.setValue("npx_package",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),I==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...h,value:h.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...h,value:h.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(I==="NPX"||I==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Ft,{value:h.value??[],onChange:h.onChange})}),t.jsx(ee,{})]})}),I!=="NPX"&&I!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),l.setValue("connection_url",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:T?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:T?.token?.placeholder??"Bearer token or API key",...h,value:h.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...h})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Tt,{placeholder:"A brief description of this connection",rows:3,...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),E=O;return s?t.jsx(ft,{open:E,onOpenChange:q,children:t.jsxs(jt,{className:"max-h-[90vh]",children:[t.jsx(yt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ct,{children:g}),t.jsx(vt,{className:"mt-1",children:N})]}),t.jsx(St,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ue,{size:16})})})]})}),t.jsx(ve,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(F),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(bt,{children:t.jsx(K,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Me,{children:[t.jsx(Fe,{children:g}),t.jsx(ze,{children:N})]}),t.jsx(ve,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(F),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ct,{value:r.search,onChange:r.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(r.setSearch(""),g.target.blur())}}),t.jsx(rt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:C,onChange:g=>v(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:u,onChange:g=>p(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:c,onChange:g=>S(g||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(g=>({id:g.id,label:g.id.includes("community-registry")?"Community MCP Registry":g.title}))]}]:[]]})]}),W]}),t.jsx(at,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:g=>{const N=g;N!==j&&te("connections_page_tab_changed",{to_tab:N}),y(N)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:D?.5:1,transition:D?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:D?"none":"auto"},children:t.jsx(cn,{listState:r,activeTab:j,typeFilter:C,statusFilter:u,registryFilter:c,enabledRegistries:_})})})]})})})]})})}function qs(){const f=ne.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(an,{})})}),f[0]=e):e=f[0],e}export{qs as default};
1
+ import{r as V,c as ne,j as t,B as K,i as ae,p as te,l as ge,E as Ge,C as be,b as _e,u as Qe,a as Ne,z as Je,G as Ye,D as Ze,M as et,J as tt,n as nt,t as R,K as st}from"./index-C2u4siS5.js";import{a as De,b as ot,g as it,e as lt}from"./extract-connection-data-CTvABTjg.js";import{C as rt}from"./collection-display-button-DrgpSLTZ.js";import{S as ct}from"./search-input-CFD2CbeL.js";import{C as at}from"./collection-tabs-BtxGuG1G.js";import{C as Ce,u as dt,a as ke,g as mt}from"./connection-card-DNDrESB-.js";import{E as ut}from"./empty-state-DA8bHc-1.js";import{P as me}from"./index-D3xpdmzO.js";import{u as pt,D as gt}from"./use-delete-connection-Cv3MGM8b.js";import{u as ye}from"./use-capability-ML8qbFhc.js";import{u as ht}from"./use-infinite-scroll-CAmtVNGd.js";import{u as xt}from"./use-view-mode-BVrJNwcR.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as Te,b as we,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-Y1XXElMo.js";import{n as he}from"./Tool02-C8iwn6Q8.js";import{D as Me,a as Fe,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-CvsnsHc6.js";import{D as ft,a as jt,c as yt,b as Ct,d as vt,e as St,f as bt}from"./drawer-D8dHZiX8.js";import{u as _t}from"./use-mobile-Xv_R9Qvv.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-DWLFR7nn.js";import{I as ie}from"./input-Cb7CGqPN.js";import{S as Nt,a as Dt,b as kt,c as At,d as ce}from"./select-DMy4CZEM.js";import{T as Tt}from"./textarea-CTeZ2lal.js";import{b as Ke,u as wt}from"./use-connection-B5YB38XE.js";import{u as It}from"./use-virtual-mcp-ak6oQOpL.js";import{u as Pt}from"./studio-tools-DScMFawl.js";import{s as je}from"./Star01-DVFgs_0J.js";import{s as He}from"./Plus-BFo0Fsne.js";import{N as $t,M as Ot,av as Lt,am as Mt}from"./agent-icon-CzJVw_PS.js";import{s as Ue}from"./XClose-CnDiE4wN.js";import{i as ue,a as Se,E as Ft,c as zt,p as Vt,b as Et,d as Bt}from"./connection-form-helpers-l_ijwaHD.js";import{a as Kt}from"./authenticate-and-persist-oauth-tUtbW76M.js";import{I as Ht}from"./integration-icon-J19ZNMb3.js";import{C as Re}from"./checkbox-BZmlCGR-.js";import{d as le,a as Ut,D as Rt,c as Wt}from"./dropdown-menu-C1qlOMZ7.js";import{i as Xt}from"./DotsVertical-Ctyi_Fcj.js";import{s as We}from"./Eye-CaHkvWGU.js";import{s as Xe}from"./Trash01-zPnxi6aE.js";import"./use-mcp-client-ioNtd9Ao.js";import"./auth-DGbJKtcV.js";import"./ArrowUp-mYUQI3ny.js";import"./ChevronUp-DKgNoV7g.js";import"./SwitchHorizontal01-DYptKpyt.js";import"./tooltip-DK2r83_Q.js";import"./view-mode-toggle-DoOv5WAT.js";import"./badge-C6MoaNaP.js";import"./SearchMd-DnmtefV6.js";import"./use-registry-connections-Chwp5-AC.js";import"./use-organization-settings-AW4Wtsqe.js";import"./useInfiniteQuery-DNnEgm4S.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-CMA-4CeN.js";import"./sidebar-odBC32K5.js";import"./LayoutLeft-BZQmnN4U.js";import"./X-DvSaCzV-.js";import"./label-DhK5GRHz.js";import"./ChevronDown-BpKPHxDG.js";import"./use-collections-D6OYG-wc.js";import"./AlertCircle-DfZqGdIO.js";import"./Tool01-CpROxlr0.js";import"./Settings02-DcvdDwJo.js";import"./XCircle-C6mRHoZP.js";import"./ArrowUpRight-D7jEUphZ.js";import"./TrendUp01-ryekGRAe.js";import"./ZapSquare-BAQcu1iA.js";import"./ZoomOut-shbGcJgg.js";import"./Users03-DmiDj7OC.js";import"./CheckCircle-BA3THiSr.js";import"./ChevronRight-ByVxw7yb.js";import"./Stars02-PuKOl8z5.js";import"./Copy01-AuaMhdvh.js";import"./Globe01-9M3ZtnRh.js";import"./FilterLines-B_F076bt.js";import"./Globe04-BBu3oRiw.js";import"./HardDrive-Czo8EXKT.js";import"./Image01-C8aqMMC0.js";import"./Key01-HpKP7kjq.js";import"./LinkExternal01-wLaoE2BO.js";import"./Monitor01-CCqvvSCN.js";import"./Sun-Cw5YUhig.js";import"./Package-DXwLO7TZ.js";import"./Palette-BOYYX-x4.js";import"./Play-Bhc_0wGz.js";import"./SearchLg-D_s4Wx9C.js";import"./Shield01-hx04AF4i.js";import"./Stars01-B5Wh8soo.js";import"./Upload01-L8Z9Doey.js";import"./User01-DewcmwdK.js";import"./Users01-Dc2haknw.js";import"./Zap-B7fiN40E.js";import"./mcp-oauth-BC7utMST.js";function qt(f){const e=`deco-filters-${f}`,[n,a]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{a(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function Gt(f){const e=ne.c(7),[n,a]=V.useState(f),[o,s]=V.useState(f?"desc":null);let i;e[0]!==o||e[1]!==n?(i=j=>{n!==j?(a(j),s("asc")):o==="asc"?s("desc"):o==="desc"&&(a(void 0),s(null))},e[0]=o,e[1]=n,e[2]=i):i=e[2];const r=i;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function Qt(f){const e=ne.c(20),{namespace:n,resource:a,defaultSortKey:o,defaultViewMode:s}=f,i=o===void 0?"title":o,r=s===void 0?"table":s,[d,j]=V.useState(""),y=V.useDeferredValue(d),C=`${n}-${a}`,[v,u]=qt(C),p=`mesh-${a}-filter-visible-${n}`;let c;e[0]!==p?(c=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=c):c=e[1];const[S,_]=V.useState(c);let b;e[2]!==p?(b=F=>{_(F),globalThis.localStorage?.setItem(p,String(F))},e[2]=p,e[3]=b):b=e[3];const w=b;let D;e[4]!==S||e[5]!==w?(D=()=>{w(!S)},e[4]=S,e[5]=w,e[6]=D):D=e[6];const l=D,[I,$]=xt(`mesh-${a}-${n}`,r),{sortKey:L,sortDirection:T,handleSort:O}=Gt(i),k=L;let M;return e[7]!==S||e[8]!==v||e[9]!==O||e[10]!==d||e[11]!==y||e[12]!==w||e[13]!==u||e[14]!==$||e[15]!==T||e[16]!==k||e[17]!==l||e[18]!==I?(M={search:d,searchTerm:y,setSearch:j,filters:v,setFilters:u,filterBarVisible:S,setFilterBarVisible:w,toggleFilterBar:l,viewMode:I,setViewMode:$,sortKey:k,sortDirection:T,handleSort:O},e[7]=S,e[8]=v,e[9]=O,e[10]=d,e[11]=y,e[12]=w,e[13]=u,e[14]=$,e[15]=T,e[16]=k,e[17]=l,e[18]=I,e[19]=M):M=e[19],M}function Jt(f){const e=ne.c(20),{open:n,onOpenChange:a,count:o,onConfirm:s}=f,i=o!==1?"s":"";let r;e[0]!==o||e[1]!==i?(r=t.jsxs(Ae,{children:["Delete ",o," connection",i,"?"]}),e[0]=o,e[1]=i,e[2]=r):r=e[2];const d=o!==1?"s":"";let j;e[3]!==d?(j=t.jsxs(Te,{children:["This will permanently delete the selected connection",d,". This action cannot be undone."]}),e[3]=d,e[4]=j):j=e[4];let y;e[5]!==r||e[6]!==j?(y=t.jsxs(we,{children:[r,j]}),e[5]=r,e[6]=j,e[7]=y):y=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{children:"Cancel"}),e[8]=C):C=e[8];const v=o!==1?"s":"";let u;e[9]!==o||e[10]!==s||e[11]!==v?(u=t.jsxs(Pe,{children:[C,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",o," connection",v]})]}),e[9]=o,e[10]=s,e[11]=v,e[12]=u):u=e[12];let p;e[13]!==y||e[14]!==u?(p=t.jsxs(Oe,{children:[y,u]}),e[13]=y,e[14]=u,e[15]=p):p=e[15];let c;return e[16]!==a||e[17]!==n||e[18]!==p?(c=t.jsx(Le,{open:n,onOpenChange:a,children:p}),e[16]=a,e[17]=n,e[18]=p,e[19]=c):c=e[19],c}function Yt(f){return f._registryId?.includes("community-registry")===!0}function Zt(f){const e=ne.c(58),{item:n,canManage:a,allConnections:o,connectedAppNames:s,connectingItemId:i,onNavigateConnected:r,onConnect:d}=f,[j,y]=V.useState(!1),[C,v]=V.useState(null);let u,p;e[0]!==s||e[1]!==n?(u=De(n)??"",p=s.has(u),e[0]=s,e[1]=n,e[2]=u,e[3]=p):(u=e[2],p=e[3]);const c=p,S=n._meta?.["mcp.mesh"],_=S?.friendlyName||S?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let w;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(w=n.server?.icons?.[0]?.src||ot(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=w):w=e[6];const D=w;let l;if(e[7]!==o||e[8]!==u){let A;e[10]!==u?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===u,e[10]=u,e[11]=A):A=e[11],l=o.filter(A),e[7]=o,e[8]=u,e[9]=l}else l=e[9];const I=l;let $;e[12]!==n?($=Yt(n),e[12]=n,e[13]=$):$=e[13];const L=$;let T,O;e[14]!==I||e[15]!==a||e[16]!==L||e[17]!==c||e[18]!==n||e[19]!==d||e[20]!==r?(T=()=>{if(c){const A=I[0];A&&r(A);return}a&&O()},O=()=>{L?(v("connect"),y(!0)):d(n)},e[14]=I,e[15]=a,e[16]=L,e[17]=c,e[18]=n,e[19]=d,e[20]=r,e[21]=T,e[22]=O):(T=e[21],O=e[22]);let k;e[23]!==n||e[24]!==d||e[25]!==C?(k=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),C==="connect"&&d(n),v(null)},e[23]=n,e[24]=d,e[25]=C,e[26]=k):k=e[26];const M=k;let F;e[27]!==b||e[28]!==D||e[29]!==_?(F={title:_,description:b,icon:D},e[27]=b,e[28]=D,e[29]=_,e[30]=F):F=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(he,{}),e[31]=q):q=e[31];let U;e[32]!==L||e[33]!==n._sourceIcon?(U=L&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=L,e[33]=n._sourceIcon,e[34]=U):U=e[34];let W;e[35]!==a||e[36]!==i||e[37]!==O||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):a&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),O()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=a,e[36]=i,e[37]=O,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let g;e[41]!==U||e[42]!==W?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[U,W]}),e[41]=U,e[42]=W,e[43]=g):g=e[43];let N;e[44]!==T||e[45]!==g||e[46]!==F?(N=t.jsx(Ce,{connection:F,fallbackIcon:q,onClick:T,headerActionsAlwaysVisible:!0,headerActions:g}),e[44]=T,e[45]=g,e[46]=F,e[47]=N):N=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(we,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(Te,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Ie,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==M?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[H,t.jsx($e,{onClick:M,children:"Continue"})]})]}),e[50]=M,e[51]=E):E=e[51];let h;e[52]!==j||e[53]!==E?(h=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=h):h=e[54];let P;return e[55]!==N||e[56]!==h?(P=t.jsxs(t.Fragment,{children:[N,h]}),e[55]=N,e[56]=h,e[57]=P):P=e[57],P}function qe(f){const e=ne.c(8),{selectionMode:n,children:a}=f,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[0]!==o?(s=ge("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ut,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Xt,{size:20})})}),e[2]=i):i=e[2];let r;e[3]!==a?(r=t.jsxs(Rt,{children:[i,t.jsx(Wt,{align:"end",onClick:en,children:a})]}),e[3]=a,e[4]=r):r=e[4];let d;return e[5]!==s||e[6]!==r?(d=t.jsx("div",{className:s,children:r}),e[5]=s,e[6]=r,e[7]=d):d=e[7],d}function en(f){return f.stopPropagation()}function tn(f){return f.stopPropagation()}function nn(f){const e=ne.c(49),{group:n,onOpen:a,selectionMode:o,selectedIds:s,onToggleSelect:i}=f;let r;if(e[0]!==n.connections||e[1]!==s){let k;e[3]!==s?(k=M=>s.has(M.id),e[3]=s,e[4]=k):k=e[4],r=n.connections.every(k),e[0]=n.connections,e[1]=s,e[2]=r}else r=e[2];const d=r;let j;if(e[5]!==n.connections||e[6]!==s){let k;e[8]!==s?(k=M=>s.has(M.id),e[8]=s,e[9]=k):k=e[9],j=n.connections.some(k),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j;let C;e[10]!==d||e[11]!==n.connections||e[12]!==i||e[13]!==s?(C=()=>{for(const k of n.connections)d?s.has(k.id)&&i(k.id):s.has(k.id)||i(k.id)},e[10]=d,e[11]=n.connections,e[12]=i,e[13]=s,e[14]=C):C=e[14];const v=C,u=`${n.connections.length} instances`;let p;e[15]!==n.icon||e[16]!==n.title||e[17]!==u?(p={title:n.title,icon:n.icon,description:u},e[15]=n.icon,e[16]=n.title,e[17]=u,e[18]=p):p=e[18];let c;e[19]!==a||e[20]!==o||e[21]!==v?(c=()=>o?v():a(),e[19]=a,e[20]=o,e[21]=v,e[22]=c):c=e[22];const S=o&&d&&"ring-2 ring-primary",_=o&&y&&!d&&"ring-1 ring-primary/50";let b;e[23]!==S||e[24]!==_?(b=ge(S,_),e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(he,{}),e[26]=w):w=e[26];let D;e[27]!==d||e[28]!==n.connections.length||e[29]!==o||e[30]!==y||e[31]!==v?(D=o?t.jsx(Re,{checked:d?!0:y?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[27]=d,e[28]=n.connections.length,e[29]=o,e[30]=y,e[31]=v,e[32]=D):D=e[32];let l;e[33]!==a?(l=k=>{k.stopPropagation(),a()},e[33]=a,e[34]=l):l=e[34];let I;e[35]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(We,{size:16}),e[35]=I):I=e[35];let $;e[36]!==l?($=t.jsxs(le,{onClick:l,children:[I,"Open"]}),e[36]=l,e[37]=$):$=e[37];let L;e[38]!==o||e[39]!==$?(L=t.jsx(qe,{selectionMode:o,children:$}),e[38]=o,e[39]=$,e[40]=L):L=e[40];let T;e[41]!==D||e[42]!==L?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[D,L]}),e[41]=D,e[42]=L,e[43]=T):T=e[43];let O;return e[44]!==T||e[45]!==p||e[46]!==c||e[47]!==b?(O=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:p,onClick:c,className:b,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:T})}),e[44]=T,e[45]=p,e[46]=c,e[47]=b,e[48]=O):O=e[48],O}function sn(f){const e=ne.c(29),{connection:n,isSelected:a,selectionMode:o,canManage:s,canManageAgents:i,onToggleSelect:r,onOpen:d,onToggleStatus:j,onDelete:y}=f;let C;e[0]!==a||e[1]!==r||e[2]!==o?(C=o?t.jsx(Re,{checked:a,onCheckedChange:r,onClick:on}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=a,e[1]=r,e[2]=o,e[3]=C):C=e[3];let v;e[4]!==d?(v=D=>{D.stopPropagation(),d()},e[4]=d,e[5]=v):v=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{size:16}),e[6]=u):u=e[6];let p;e[7]!==v?(p=t.jsxs(le,{onClick:v,children:[u,"Open"]}),e[7]=v,e[8]=p):p=e[8];let c;e[9]!==s||e[10]!==i||e[11]!==r?(c=(s||i)&&t.jsxs(le,{onClick:D=>{D.stopPropagation(),r()},children:[t.jsx(Lt,{size:16}),"Select"]}),e[9]=s,e[10]=i,e[11]=r,e[12]=c):c=e[12];let S;e[13]!==s||e[14]!==n||e[15]!==j?(S=s&&(n.status==="active"?t.jsxs(le,{onClick:D=>{D.stopPropagation(),j("inactive")},children:[t.jsx($t,{size:16}),"Disable"]}):t.jsxs(le,{onClick:D=>{D.stopPropagation(),j("active")},children:[t.jsx(Ot,{size:16}),"Enable"]})),e[13]=s,e[14]=n,e[15]=j,e[16]=S):S=e[16];let _;e[17]!==s||e[18]!==y?(_=s&&t.jsxs(le,{variant:"destructive",onClick:D=>{D.stopPropagation(),y()},children:[t.jsx(Xe,{size:16}),"Delete"]}),e[17]=s,e[18]=y,e[19]=_):_=e[19];let b;e[20]!==o||e[21]!==p||e[22]!==c||e[23]!==S||e[24]!==_?(b=t.jsxs(qe,{selectionMode:o,children:[p,c,S,_]}),e[20]=o,e[21]=p,e[22]=c,e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;return e[26]!==C||e[27]!==b?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[C,b]}),e[26]=C,e[27]=b,e[28]=w):w=e[28],w}function on(f){return f.stopPropagation()}function ln(f){const e=ne.c(23),{count:n,total:a,canManage:o,canManageAgents:s,onSelectAll:i,onDeselectAll:r,onDelete:d,onAddToAgent:j,onToggleStatus:y,onCancel:C}=f;if(n===0)return null;let v;e[0]!==n?(v=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=v):v=e[1];let u;e[2]!==n||e[3]!==r||e[4]!==i||e[5]!==a?(u=n<a?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",a,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:"Clear selection"}),e[2]=n,e[3]=r,e[4]=i,e[5]=a,e[6]=u):u=e[6];let p;e[7]!==s||e[8]!==j?(p=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(He,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=p):p=e[9];let c;e[10]!==o||e[11]!==d||e[12]!==y?(c=o&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Xe,{size:13}),"Delete"]})]}),e[10]=o,e[11]=d,e[12]=y,e[13]=c):c=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ue,{size:13}),e[14]=S):S=e[14];let _;e[15]!==C?(_=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:C,children:S}),e[15]=C,e[16]=_):_=e[16];let b;return e[17]!==v||e[18]!==u||e[19]!==p||e[20]!==c||e[21]!==_?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[v,u,p,c,_]})}),e[17]=v,e[18]=u,e[19]=p,e[20]=c,e[21]=_,e[22]=b):b=e[22],b}function rn(f){const e=ne.c(25),{open:n,onOpenChange:a,agents:o,onConfirm:s}=f,[i,r]=V.useState(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs(Me,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=d):d=e[0];let j;e[1]!==o||e[2]!==i?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):o.map(b=>t.jsxs("button",{type:"button",onClick:()=>r(b.id),className:ge("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ht,{icon:b.icon,name:b.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=o,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let C;e[6]!==a?(C=t.jsx(K,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e[6]=a,e[7]=C):C=e[7];const v=!i;let u;e[8]!==s||e[9]!==a||e[10]!==i?(u=()=>{i&&(s(i),a(!1),r(null))},e[8]=s,e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]!==v||e[13]!==u?(p=t.jsx(K,{disabled:v,onClick:u,children:"Add"}),e[12]=v,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==C||e[16]!==p?(c=t.jsxs(Ve,{children:[C,p]}),e[15]=C,e[16]=p,e[17]=c):c=e[17];let S;e[18]!==y||e[19]!==c?(S=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[d,y,c]}),e[18]=y,e[19]=c,e[20]=S):S=e[20];let _;return e[21]!==a||e[22]!==n||e[23]!==S?(_=t.jsx(Be,{open:n,onOpenChange:a,children:S}),e[21]=a,e[22]=n,e[23]=S,e[24]=_):_=e[24],_}function cn({listState:f,activeTab:e,typeFilter:n,statusFilter:a,registryFilter:o,enabledRegistries:s}){const{org:i}=be(),r=nt(),d=_e(),{data:j}=Ne.useSession(),y=Ke(),C=wt(f),v=pt(),{granted:u}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[c,S]=V.useState(new Set),_=c.size>0,[b,w]=V.useState(!1),[D,l]=V.useState(!1),[I,$]=V.useState(null),L=It(),T=C.filter(m=>!(n!=="ALL"&&m.connection_type!==n||a!=="ALL"&&m.status!==a)),O=mt(T),k=m=>{S(x=>{const B=new Set(x);return B.has(m)?B.delete(m):B.add(m),B})},M=()=>{S(new Set)},F=ke(s,f.searchTerm),q=F.items,U=ht(F.loadMore,F.hasMore,F.isLoadingMore),W=new Set(C.filter(m=>m.app_name).map(m=>m.app_name)),g=o==="ALL"||s.some(m=>m.id===o)?o:"ALL",N=f.search.length>0,z=e==="all"||N?q.filter(m=>{if(g!=="ALL"&&m._registryId!==g)return!1;if(N){const x=De(m);if(x&&W.has(x))return!1}return!0}):[],H=e==="connected"||N?O:[],E=async m=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),$(m.id);try{const x=lt(m,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:se}=await y.create.mutateAsync(x),re=await Kt({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:se,data:{connection_token:fe}}).then(()=>{})});if(re.ran&&!re.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:re.error??"no_token"}),R.error(`Authentication failed: ${re.error??"no token received"}`);return}if(re.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await r.invalidateQueries({queryKey:st.isMCPAuthenticated(fe.href,null)}),P(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},h=Pt(),P=()=>{r.invalidateQueries({predicate:m=>{const x=m.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{w(!1);const m=[...c];te("connections_bulk_delete",{count:m.length});let x=0;for(const B of m)try{await h.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}P(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),M()},oe=async(m,x)=>{try{await y.update.mutateAsync({id:m,data:{status:x}}),P(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async m=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:m});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:m}}),B++}catch{}P(),R.success(`${m==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),M()},de=async m=>{const x=L.find(X=>X.id===m);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:m,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await h.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...x.connections,...G]}}),r.invalidateQueries({predicate:X=>{const se=X.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),M()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...v}),t.jsx(Jt,{open:b,onOpenChange:w,count:c.size,onConfirm:A}),t.jsx(rn,{open:D,onOpenChange:l,agents:L,onConfirm:de}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(N?z.length===0&&T.length===0:e==="all"?z.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:u?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(m=>{if(m.type==="group")return t.jsx(nn,{group:m,onOpen:()=>{d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:m.key}})},selectionMode:_,selectedIds:c,onToggleSelect:k},m.key);const x=m.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(he,{}),onClick:()=>_?k(x.id):d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),className:ge(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(sn,{connection:x,isSelected:B,selectionMode:_,canManage:u,canManageAgents:p,onToggleSelect:()=>k(x.id),onOpen:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>v.requestDelete(x)})},x.id)}),z.map(m=>t.jsx(Zt,{item:m,canManage:u,allConnections:C,connectedAppNames:W,connectingItemId:I,onNavigateConnected:x=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onConnect:E},`catalog-${m._registryId}:${m.id}`)),(e==="all"||N)&&s.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||N)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(ln,{count:c.size,total:T.length,canManage:u,canManageAgents:p,onSelectAll:()=>{S(new Set(T.map(m=>m.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>w(!0),onAddToAgent:()=>l(!0),onToggleStatus:xe,onCancel:M})]})}function an(){const{org:f}=be(),e=_e(),n=Qe({strict:!1}),{data:a}=Ne.useSession(),{stdioEnabled:o}=Je(),s=_t(),{granted:i}=ye("connections:manage"),r=Qt({namespace:f.slug,resource:"connections"}),d=Ke(),[j,y]=Ye(Ze.connectionsTab(f.slug),g=>n.tab==="all"||n.tab==="connected"?n.tab:g??"all"),[C,v]=V.useState("ALL"),[u,p]=V.useState("ALL"),[c,S]=V.useState("ALL"),_=dt(),w=ke(_,r.searchTerm).items,D=r.search!==r.searchTerm,l=et({resolver:tt(zt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),I=l.watch("ui_type"),$=l.watch("connection_url"),L=l.watch("npx_package"),T=ue({uiType:I,connectionUrl:$??"",npxPackage:L??""})??Se({uiType:I,connectionUrl:$??"",registryItems:w}),O=i&&n.action==="create",k=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},M=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},F=async g=>{let N,z=null,H=null,E=null;g.ui_type==="NPX"?(N="STDIO",z="",E=Et(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(N="STDIO",z="",E=Bt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(N=g.ui_type,z=g.connection_url||"",H=g.connection_token||null);const h=it("conn");te("connection_custom_created",{connection_type:N,ui_type:g.ui_type}),await d.create.mutateAsync({id:h,title:g.title,description:g.description||null,connection_type:N,connection_url:z,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:f.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),l.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:pe({app_name:null,connection_url:z,title:g.title,id:h})}})},q=g=>{g||(O&&M(),l.reset())},U=g=>{const N=g.trim();if(!N)return;const z=!!l.formState.dirtyFields.title,H=!!l.formState.dirtyFields.description,E=!!l.formState.dirtyFields.env_vars,h=A=>{if(A&&(!z&&!l.getValues("title").trim()&&A.title&&l.setValue("title",A.title,{shouldDirty:!1}),!H&&!(l.getValues("description")??"").trim()&&A.description&&l.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=l.getValues("env_vars")??[],xe=new Set(oe.map(m=>m.key)),de=A.envVarKeys.filter(m=>!xe.has(m));de.length>0&&l.setValue("env_vars",[...oe,...de.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},P=Vt(N);if(P&&o){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",P.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),h(ue({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const A=I==="HTTP"||I==="SSE"||I==="Websocket"?I:"HTTP";l.setValue("ui_type",A,{shouldDirty:!0}),l.setValue("connection_url",N,{shouldDirty:!0}),h(ue({uiType:A,connectionUrl:N})??Se({uiType:A,connectionUrl:N,registryItems:w}));return}I==="NPX"&&h(ue({uiType:"NPX",npxPackage:N}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:k,children:[t.jsx(He,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const g="Create Connection",N="Create a custom connection in your organization. Fill in the details below.",z=l.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(Nt,{value:h.value,onValueChange:h.onChange,children:[t.jsx(Z,{children:t.jsx(Dt,{children:t.jsx(kt,{})})}),t.jsxs(At,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),o&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),I==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),l.setValue("npx_package",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),I==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...h,value:h.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...h,value:h.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(I==="NPX"||I==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Ft,{value:h.value??[],onChange:h.onChange})}),t.jsx(ee,{})]})}),I!=="NPX"&&I!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),l.setValue("connection_url",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:T?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:T?.token?.placeholder??"Bearer token or API key",...h,value:h.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...h})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Tt,{placeholder:"A brief description of this connection",rows:3,...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),E=O;return s?t.jsx(ft,{open:E,onOpenChange:q,children:t.jsxs(jt,{className:"max-h-[90vh]",children:[t.jsx(yt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ct,{children:g}),t.jsx(vt,{className:"mt-1",children:N})]}),t.jsx(St,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ue,{size:16})})})]})}),t.jsx(ve,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(F),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(bt,{children:t.jsx(K,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Me,{children:[t.jsx(Fe,{children:g}),t.jsx(ze,{children:N})]}),t.jsx(ve,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(F),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ct,{value:r.search,onChange:r.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(r.setSearch(""),g.target.blur())}}),t.jsx(rt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:C,onChange:g=>v(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:u,onChange:g=>p(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:c,onChange:g=>S(g||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(g=>({id:g.id,label:g.id.includes("community-registry")?"Community MCP Registry":g.title}))]}]:[]]})]}),W]}),t.jsx(at,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:g=>{const N=g;N!==j&&te("connections_page_tab_changed",{to_tab:N}),y(N)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:D?.5:1,transition:D?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:D?"none":"auto"},children:t.jsx(cn,{listState:r,activeTab:j,typeFilter:C,statusFilter:u,registryFilter:c,enabledRegistries:_})})})]})})})]})})}function qs(){const f=ne.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(an,{})})}),f[0]=e):e=f[0],e}export{qs as default};
@@ -1 +1 @@
1
- import"./index-32Z_4GES.js";import{e as k}from"./backoff-CrEUbyZT.js";const v={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},h=Object.values(v),R="super-agent",S="task-board.item.updated",b="task-board.item.deleted",N=3e4,g=1e3;function O(n){const{buildUrl:d,eventTypes:u,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of u)t.addEventListener(r,s)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(N,g,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function w(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function D(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>w(s,c.data),s.channel=r}return L(s),s}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=D(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&y(r))}}}}function A(n,d){const u=new Set(d);return{subscribe(a,f,o){const i=l=>{u.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const _=[...h,S,b],M=_,P=_,C=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${M.join(",")}`,eventTypes:P,crossTab:!0}),H=A(C,[...h]),U=A(C,[S,b]),V=H;export{v as D,R as S,b as T,V as d,U as t};
1
+ import"./index-C2u4siS5.js";import{e as k}from"./backoff-CrEUbyZT.js";const v={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},h=Object.values(v),R="super-agent",S="task-board.item.updated",b="task-board.item.deleted",N=3e4,g=1e3;function O(n){const{buildUrl:d,eventTypes:u,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of u)t.addEventListener(r,s)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(N,g,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function w(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function D(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>w(s,c.data),s.channel=r}return L(s),s}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=D(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&y(r))}}}}function A(n,d){const u=new Set(d);return{subscribe(a,f,o){const i=l=>{u.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const _=[...h,S,b],M=_,P=_,C=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${M.join(",")}`,eventTypes:P,crossTab:!0}),H=A(C,[...h]),U=A(C,[S,b]),V=H;export{v as D,R as S,b as T,V as d,U as t};
@@ -1 +1 @@
1
- import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-32Z_4GES.js";import{i as h}from"./X-DXgmI1I4.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,R as a,k as b,P as c,T as d,z as e,y as f,v as g,B as h,w as i};
1
+ import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-C2u4siS5.js";import{i as h}from"./X-DvSaCzV-.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,R as a,k as b,P as c,T as d,z as e,y as f,v as g,B as h,w as i};
@@ -1 +1 @@
1
- import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-32Z_4GES.js";import{u as ie}from"./studio-tools-n8590dlO.js";import{b as se,S as ne,a as oe}from"./settings-section-qHo4Kia8.js";import{B as Q}from"./badge-D-j0sOs9.js";import{I as ae}from"./input-DNRaDhXk.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-B_NF3ir8.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-C2u4siS5.js";import{u as ie}from"./studio-tools-DScMFawl.js";import{b as se,S as ne,a as oe}from"./settings-section-C9wxXn_P.js";import{B as Q}from"./badge-C6MoaNaP.js";import{I as ae}from"./input-Cb7CGqPN.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-DMy4CZEM.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cr as i,l as c}from"./index-32Z_4GES.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{c as d,j as s,cr as i,l as c}from"./index-C2u4siS5.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-32Z_4GES.js";import{i as $}from"./ChevronUp-SvG4tBeC.js";import{i as D}from"./ChevronRight-D8z61LL4.js";import{a as M}from"./DotsVertical-ByzWfjph.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function G(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
1
+ import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-C2u4siS5.js";import{i as $}from"./ChevronUp-DKgNoV7g.js";import{i as D}from"./ChevronRight-ByVxw7yb.js";import{a as M}from"./DotsVertical-Ctyi_Fcj.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function G(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-32Z_4GES.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-center text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,l as N,j as t}from"./index-C2u4siS5.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-center text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import"./index-32Z_4GES.js";import{W as T,j as O}from"./use-mcp-client-Y-YAGLhv.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function q(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[t]??t.toUpperCase():null}function J(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function Q(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";let j="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",G=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=j[n[t]&63];return e};function $(t){return`${t}_${G()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(t,e,n,a){const r=t.server,o=t._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,w=o?.configuration_state,A=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:$("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,Q as c,J as d,X as e,B as f,$ as g,q as i};
1
+ import"./index-C2u4siS5.js";import{W as T,j as O}from"./use-mcp-client-ioNtd9Ao.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function q(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[t]??t.toUpperCase():null}function J(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function Q(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";let j="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",G=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=j[n[t]&63];return e};function $(t){return`${t}_${G()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(t,e,n,a){const r=t.server,o=t._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,w=o?.configuration_state,A=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:$("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,Q as c,J as d,X as e,B as f,$ as g,q as i};
@@ -1,2 +1,2 @@
1
- import{c as J,r as u,j as r,i as se,B as Ne,d$ as Qt,aO as Xt,aU as ue,e0 as Jt,e1 as Yt,e2 as Zt,e3 as en,bL as tn,e4 as nn,e5 as at,aQ as rn,e6 as on,e7 as sn,e8 as an,e9 as ln,ea as cn,eb as dn,ec as un,ed as fn,ee as mn,l as ee,n as pn,t as W,K as Je}from"./index-32Z_4GES.js";import{F as xn,l as hn}from"./index-BsOcdcPy.js";import{e as gn,aJ as vn,aK as yn}from"./agent-icon-D4a2yQAy.js";import{s as Cn}from"./XClose-C4EmtqAA.js";import{m as wn}from"./automation-runs-B-V_i0FR.js";import{b as Ye,T as Ze,a as et}from"./tooltip-CpOqB12v.js";import{b as jn}from"./chat-context-0yEIHZ6c.js";import{u as Nn}from"./shell-layout-gqjfXR2N.js";import{s as ve,a as tt,f as bn}from"./index-CyCC6Kib.js";import{a as Sn,h as Mn,D as Rn,c as Dn,d as Pn,e as En}from"./dialog-pxztKdM4.js";import{I as nt}from"./input-DNRaDhXk.js";import{c as kn,d as Tn,b as An,A as On,g as Fn,e as In,a as Ln,f as $n}from"./alert-dialog-C0dmYQwl.js";import{t as _n}from"./ChevronDown-DnuZlbXl.js";import{i as zn}from"./ChevronRight-D8z61LL4.js";import{a as Gn}from"./ZoomOut-DO1ABQMU.js";import{v as Kn,E as Bn,w as ke,x as Te,y as Un,z as Vn,A as Hn,C as Wn,D as Q,G as ye,I as Ae,J as Ce,g as Oe,K as Fe,M as qn,N as Qn,O as Xn,P as we,Q as Ie,U as Jn,V as Yn,W as Zn,X as er}from"./index-xVsqSBJP.js";import"./AlertCircle-DriHvGW8.js";import"./Tool01-1JY4WdfO.js";import"./ArrowUp-BHLBiz0J.js";import"./Settings02-BQIoToME.js";import"./Tool02-CJRfU6-e.js";import"./XCircle-DY497Rjn.js";import"./ArrowUpRight-CsopTrXA.js";import"./TrendUp01-Be3cv-nx.js";import"./ZapSquare-DiXc_WiU.js";import"./Users03-01ZOLPet.js";import"./CheckCircle-BSSfIVDh.js";import"./ChevronUp-SvG4tBeC.js";import"./DotsVertical-ByzWfjph.js";import"./Stars02-D0dtbcP0.js";import"./Copy01-8RoWdlIb.js";import"./Globe01-C6g7oQ38.js";import"./Eye-BMB6Dsvc.js";import"./FilterLines-Cb5gzr5c.js";import"./Star01-BvPb97r4.js";import"./Globe04-CYEWS6xQ.js";import"./SwitchHorizontal01-B5xg5r1q.js";import"./HardDrive-Dv77s3h5.js";import"./Image01-YE-JCd5P.js";import"./Key01-C9Hax98L.js";import"./LayoutLeft-CoMgIDfR.js";import"./LinkExternal01-BYMM_QSD.js";import"./Monitor01-CDUuvvya.js";import"./Sun-BNn7fIcF.js";import"./Package-BwfmB-wY.js";import"./Palette-wIBeqOmX.js";import"./Play-CmeXDhbv.js";import"./Plus-DErQhYMo.js";import"./SearchLg-BcyXaR5Z.js";import"./SearchMd-B2xdLkpr.js";import"./Shield01-BnV0ErmL.js";import"./Stars01-Dq_ij1vd.js";import"./Trash01-D68y5OFq.js";import"./Upload01-CPQnKMdb.js";import"./User01-BErqEcB8.js";import"./Users01-CdOl2233.js";import"./X-DXgmI1I4.js";import"./Zap-BPdmVchQ.js";import"./select-B_NF3ir8.js";import"./useInfiniteQuery-BYifa8Cc.js";import"./use-infinite-scroll-DDA5AXOs.js";import"./use-connection-TbmZTa2Q.js";import"./use-collections-CRs3mssF.js";import"./use-mcp-client-Y-YAGLhv.js";import"./auth-z6bL2iLM.js";import"./use-virtual-mcp-1CuGEk-Q.js";import"./card-D4CJeQSR.js";import"./sidebar-ChQMKige.js";import"./use-mobile-Dfj2nxpB.js";import"./table-4z3VGMcV.js";import"./empty-state-DvObzH8u.js";import"./use-members-DSdmplcs.js";import"./use-org-auth-client-DSB0aKlT.js";import"./use-clock-tick-BXhg46lH.js";import"./use-automations-CuxMc1af.js";import"./studio-tools-n8590dlO.js";import"./useSuspenseInfiniteQuery-CgX7veRN.js";import"./avatar-f9PWmWko.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-GJ89hYnU.js";import"./file-type-icon-zSQ0dOtZ.js";import"./tab-id-BijBBRwE.js";import"./hooks-C8ac-vFI.js";import"./decopilot-sse-pool-BNj5yLz-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-D20TtRkQ.js";import"./index-SNB4eexL.js";import"./calendar-CL1lHfJI.js";import"./integration-icon-Bj_L5G59.js";import"./use-navigate-to-agent-DYHGQgra.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BU465nht.js";import"./form--yMAb3ro.js";import"./label-DqJN0Zl6.js";import"./autosend-DViO44x-.js";import"./use-ai-providers-DcaGLvIS.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-BAuSsk9W.js";import"./use-organization-settings-Bj1mes2i.js";import"./required-auth-layout-BN9gLlS8.js";import"./use-org-sso-e8s6CsXn.js";import"./drawer-eINF-fuO.js";import"./collection-search-C0RNwRHs.js";import"./index-BeXgUXox.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-UpQczPyM.js";import"./use-mcp-tools-UKnbu9YR.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-C7P5en8H.js";import"./mcp-oauth-ClvvvmOF.js";import"./extract-connection-data-CeFGCUkk.js";import"./dropdown-menu-CRae2C9x.js";import"./popover-RIaRL7oB.js";import"./command-DjqCY9Vi.js";import"./index-BSVi3cEY.js";import"./tabs-C1aAnItW.js";import"./toggle-group-Buak4Ijq.js";import"./use-deco-credits-FWA0HDvb.js";import"./connection-card-FP7DKtbx.js";import"./use-registry-connections-HQz0dDkM.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BIQq3kPx.js";import"./connection-form-helpers-C7V7pVnH.js";import"./collection-tabs-Dhx2wMNU.js";import"./badge-D-j0sOs9.js";import"./connect-desktop-dialog-D_e_16jN.js";import"./select-model-CD-bNwFP.js";import"./checkbox-JCl8QP8q.js";import"./skeleton-TPY4BgOd.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-qHo4Kia8.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-t_gRyaZh.js";import"./toolbar-ChkgagFk.js";import"./use-capability-x8vfxJ7c.js";import"./toolbar-icon-button-D0eZmrE1.js";import"./use-debounced-autosave-DxPGO2nZ.js";import"./index-BFiY8eXY.js";import"./search-input-DrcJxljH.js";import"./use-mcp-auth-status-DlG18-0i.js";import"./switch-Vi8KqJDK.js";import"./github-repo-picker-Cgx6amzW.js";import"./use-debounced-value-D3KV6ORm.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-CyDme1l0.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-Bn5T5Kw9.js";import"./use-file-configs-CuD4x2Qa.js";import"./automation-list-row-Bu9C738j.js";const tr={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function nr(i){const e=J.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,y=c===void 0?"":c,d=x===void 0?!1:x,[h,w]=u.useState(y),[R,k]=u.useState(s),v=tr[a];s!==R&&(k(s),s&&w(y));let j;e[0]!==d||e[1]!==g?(j=O=>{!O&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=j):j=e[2];const U=j;let S;e[3]!==d||e[4]!==h||e[5]!==p?(S=async O=>{O.preventDefault();const q=h.trim();!q||d||await p(q)},e[3]=d,e[4]=h,e[5]=p,e[6]=S):S=e[6];const D=S;let b;e[7]!==v.title?(b=r.jsx(Sn,{children:v.title}),e[7]=v.title,e[8]=b):b=e[8];let C;e[9]!==v.description?(C=r.jsx(Mn,{children:v.description}),e[9]=v.description,e[10]=C):C=e[10];let P;e[11]!==b||e[12]!==C?(P=r.jsxs(Rn,{children:[b,C]}),e[11]=b,e[12]=C,e[13]=P):P=e[13];let M;e[14]!==m?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(nt,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=M):M=e[15];let V;e[16]===Symbol.for("react.memo_cache_sentinel")?(V=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=V):V=e[16];let I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=O=>w(O.target.value),e[17]=I):I=e[17];let z;e[18]!==v.placeholder||e[19]!==d||e[20]!==h?(z=r.jsxs("div",{className:"space-y-1.5",children:[V,r.jsx(nt,{id:"file-explorer-name",value:h,onChange:I,placeholder:v.placeholder,autoFocus:!0,disabled:d})]}),e[18]=v.placeholder,e[19]=d,e[20]=h,e[21]=z):z=e[21];let L;e[22]!==z||e[23]!==M?(L=r.jsxs("div",{className:"space-y-4 py-4",children:[M,z]}),e[22]=z,e[23]=M,e[24]=L):L=e[24];let T;e[25]!==g?(T=()=>g(!1),e[25]=g,e[26]=T):T=e[26];let G;e[27]!==d||e[28]!==T?(G=r.jsx(Ne,{type:"button",variant:"outline",onClick:T,disabled:d,children:"Cancel"}),e[27]=d,e[28]=T,e[29]=G):G=e[29];let H;e[30]!==d||e[31]!==h?(H=!h.trim()||d,e[30]=d,e[31]=h,e[32]=H):H=e[32];let K;e[33]!==v.submit||e[34]!==d?(K=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):v.submit,e[33]=v.submit,e[34]=d,e[35]=K):K=e[35];let A;e[36]!==H||e[37]!==K?(A=r.jsx(Ne,{type:"submit",disabled:H,children:K}),e[36]=H,e[37]=K,e[38]=A):A=e[38];let E;e[39]!==G||e[40]!==A?(E=r.jsxs(Dn,{children:[G,A]}),e[39]=G,e[40]=A,e[41]=E):E=e[41];let $;e[42]!==D||e[43]!==L||e[44]!==E||e[45]!==P?($=r.jsx(Pn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:D,children:[P,L,E]})}),e[42]=D,e[43]=L,e[44]=E,e[45]=P,e[46]=$):$=e[46];let _;return e[47]!==U||e[48]!==s||e[49]!==$?(_=r.jsx(En,{open:s,onOpenChange:U,children:$}),e[47]=U,e[48]=s,e[49]=$,e[50]=_):_=e[50],_}function rr(i){const e=J.c(31),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:m,onConfirm:x}=i,p=s!==null,g=s?.kind==="directory"?"folder":"file";let y;e[0]!==g?(y=r.jsxs(kn,{children:["Delete ",g,"?"]}),e[0]=g,e[1]=y):y=e[1];const d=s?.name;let h;e[2]!==d?(h=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=h):h=e[3];const w=s?.kind==="directory"?" and everything inside it.":".";let R;e[4]!==a.length?(R=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=R):R=e[5];let k;e[6]!==h||e[7]!==w||e[8]!==R?(k=r.jsxs(Tn,{children:["This will permanently delete"," ",h,w,R]}),e[6]=h,e[7]=w,e[8]=R,e[9]=k):k=e[9];let v;e[10]!==y||e[11]!==k?(v=r.jsxs(An,{children:[y,k]}),e[10]=y,e[11]=k,e[12]=v):v=e[12];let j;e[13]!==c?(j=r.jsx(On,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=j):j=e[14];const U=c||!s;let S;e[15]!==s||e[16]!==x?(S=M=>{M.preventDefault(),s&&x(s)},e[15]=s,e[16]=x,e[17]=S):S=e[17];let D;e[18]!==U||e[19]!==S?(D=r.jsx(Fn,{disabled:U,onClick:S,children:"Delete"}),e[18]=U,e[19]=S,e[20]=D):D=e[20];let b;e[21]!==j||e[22]!==D?(b=r.jsxs(In,{children:[j,D]}),e[21]=j,e[22]=D,e[23]=b):b=e[23];let C;e[24]!==b||e[25]!==v?(C=r.jsxs(Ln,{children:[v,b]}),e[24]=b,e[25]=v,e[26]=C):C=e[26];let P;return e[27]!==m||e[28]!==p||e[29]!==C?(P=r.jsx($n,{open:p,onOpenChange:m,children:C}),e[27]=m,e[28]=p,e[29]=C,e[30]=P):P=e[30],P}var Le="ContextMenu",[or]=rn(Le,[at]),B=at(),[sr,it]=or(Le),lt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=B(e),y=tn(a),d=u.useCallback(h=>{p(h),y(h)},[y]);return r.jsx(sr,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(nn,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};lt.displayName=Le;var ct="ContextMenuTrigger",dt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=it(ct,s),x=B(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),y=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(y.current),[]),h=w=>{p.current={x:w.clientX,y:w.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Qt,{...x,virtualRef:g}),r.jsx(Xt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ue(i.onContextMenu,w=>{d(),h(w),w.preventDefault()}),onPointerDown:a?i.onPointerDown:ue(i.onPointerDown,je(w=>{d(),y.current=window.setTimeout(()=>h(w),700)})),onPointerMove:a?i.onPointerMove:ue(i.onPointerMove,je(d)),onPointerCancel:a?i.onPointerCancel:ue(i.onPointerCancel,je(d)),onPointerUp:a?i.onPointerUp:ue(i.onPointerUp,je(d))})]})});dt.displayName=ct;var ar="ContextMenuPortal",ut=i=>{const{__scopeContextMenu:e,...s}=i,a=B(e);return r.jsx(Zt,{...a,...s})};ut.displayName=ar;var ft="ContextMenuContent",mt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=it(ft,s),m=B(s),x=u.useRef(!1);return r.jsx(en,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mt.displayName=ft;var ir="ContextMenuGroup",lr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(on,{...c,...a,ref:e})});lr.displayName=ir;var cr="ContextMenuLabel",dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(sn,{...c,...a,ref:e})});dr.displayName=cr;var ur="ContextMenuItem",pt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(Jt,{...c,...a,ref:e})});pt.displayName=ur;var fr="ContextMenuCheckboxItem",mr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(an,{...c,...a,ref:e})});mr.displayName=fr;var pr="ContextMenuRadioGroup",xr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(ln,{...c,...a,ref:e})});xr.displayName=pr;var hr="ContextMenuRadioItem",gr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(cn,{...c,...a,ref:e})});gr.displayName=hr;var vr="ContextMenuItemIndicator",yr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(dn,{...c,...a,ref:e})});yr.displayName=vr;var Cr="ContextMenuSeparator",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(Yt,{...c,...a,ref:e})});xt.displayName=Cr;var wr="ContextMenuArrow",jr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(un,{...c,...a,ref:e})});jr.displayName=wr;var Nr="ContextMenuSubTrigger",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(fn,{...c,...a,ref:e})});br.displayName=Nr;var Sr="ContextMenuSubContent",Mr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(mn,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mr.displayName=Sr;function je(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Rr=lt,Dr=dt,Pr=ut,Er=mt,kr=pt,Tr=xt;function Ar(i){const e=J.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Rr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Or(i){const e=J.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Dr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Fr(i){const e=J.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ee("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(Pr,{children:r.jsx(Er,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function oe(i){const e=J.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(kr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function rt(i){const e=J.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ee("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(Tr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const Ir="#d9a441";function Lr(i){const e=J.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:y,onNewFile:d,onNewFolder:h,onCopyPath:w,onCopyRelativePath:R,onRename:k,onDelete:v}=i,j=x===void 0?!1:x,U=s.kind==="directory",{Icon:S,color:D}=p,b=m&&"bg-accent";let C;e[0]!==b?(C=ee("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",b),e[0]=b,e[1]=C):C=e[1];const P=`${a*14+8}px`;let M;e[2]!==P?(M={paddingLeft:P},e[2]=P,e[3]=M):M=e[3];let V;e[4]!==g||e[5]!==y?(V=()=>{y(),g()},e[4]=g,e[5]=y,e[6]=V):V=e[6];let I;e[7]!==S||e[8]!==D||e[9]!==U||e[10]!==c||e[11]!==j?(I=U?r.jsxs(r.Fragment,{children:[j?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(_n,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(zn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Gn,{size:16,className:"shrink-0",style:{color:Ir}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(S,{size:16,className:"shrink-0",style:{color:D}})]}),e[7]=S,e[8]=D,e[9]=U,e[10]=c,e[11]=j,e[12]=I):I=e[12];let z;e[13]!==s.name?(z=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=z):z=e[14];let L;e[15]!==C||e[16]!==M||e[17]!==V||e[18]!==I||e[19]!==z?(L=r.jsx(Or,{asChild:!0,children:r.jsxs("button",{type:"button",className:C,style:M,onClick:V,children:[I,z]})}),e[15]=C,e[16]=M,e[17]=V,e[18]=I,e[19]=z,e[20]=L):L=e[20];let T;e[21]!==d?(T=r.jsx(oe,{onSelect:d,children:"New File"}),e[21]=d,e[22]=T):T=e[22];let G;e[23]!==h?(G=r.jsx(oe,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=G):G=e[24];let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=r.jsx(rt,{}),e[25]=H):H=e[25];let K;e[26]!==w?(K=r.jsx(oe,{onSelect:w,children:"Copy Path"}),e[26]=w,e[27]=K):K=e[27];let A;e[28]!==R?(A=r.jsx(oe,{onSelect:R,children:"Copy Relative Path"}),e[28]=R,e[29]=A):A=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(rt,{}),e[30]=E):E=e[30];let $;e[31]!==k?($=r.jsx(oe,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=$):$=e[32];let _;e[33]!==v?(_=r.jsx(oe,{variant:"destructive",onSelect:v,children:"Delete"}),e[33]=v,e[34]=_):_=e[34];let O;e[35]!==T||e[36]!==G||e[37]!==K||e[38]!==A||e[39]!==$||e[40]!==_?(O=r.jsxs(Fr,{className:"w-52",children:[T,G,H,K,A,E,$,_]}),e[35]=T,e[36]=G,e[37]=K,e[38]=A,e[39]=$,e[40]=_,e[41]=O):O=e[41];let q;return e[42]!==O||e[43]!==L?(q=r.jsxs(Ar,{children:[L,O]}),e[42]=O,e[43]=L,e[44]=q):q=e[44],q}hn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const ot=200,$r=2,_r=250,st=200;function zr(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Gr(i){const e=J.c(9),{text:s,query:a}=i;let c,m,x;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:g,segments:y}=qn(s,a);c="truncate font-mono text-muted-foreground",m=g&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),x=y.map(Kr),e[0]=a,e[1]=s,e[2]=c,e[3]=m,e[4]=x}else c=e[2],m=e[3],x=e[4];let p;return e[5]!==c||e[6]!==m||e[7]!==x?(p=r.jsxs("span",{className:c,children:[m,x]}),e[5]=c,e[6]=m,e[7]=x,e[8]=p):p=e[8],p}function Kr(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Oa({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,y]=u.useState(new Set),[d,h]=u.useState(null),[w,R]=u.useState(null),[k,v]=u.useState([]),[j,U]=u.useState(""),[S,D]=u.useState(null),[b,C]=u.useState(null),[P,M]=u.useState(!1),[V,I]=u.useState(!1),[z,L]=u.useState(!1),[T,G]=u.useState(!1),[,H]=u.useState(new Set),[K,A]=u.useState(new Set),E=u.useRef(0),$=u.useRef(null),_=u.useRef(new Set),O=u.useRef(new Map),q=u.useRef(null),te=u.useRef(0),be=u.useRef(null),ae=u.useRef(null),Se=u.useRef(null);function $e(t){H(n=>{const o=typeof t=="function"?t(n):t;return _.current=o,o})}const[ie,ne]=u.useState(new Map),Me=u.useRef(null),[Y,fe]=u.useState(null),{sendMessage:ht}=jn(),{openSidePanel:gt}=Nn(),me=pn(),[F,X]=u.useState(null),[Re,De]=u.useState(null),[pe,xe]=u.useState(!1);async function Z(t,n){const o=await fetch(zr(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function he(){me.invalidateQueries({queryKey:tt(i,e,s)})}function _e(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function vt(t){const n=Zn(t);if(!n)return;const o=`${i}/${e}/${s}`;me.setQueryData(Je.decofile(o),l=>{if(!l)return l;const{[n]:f,...N}=l;return N}),me.invalidateQueries({queryKey:Je.liveMeta(i,e,s)})}function yt(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ye(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function Ct(t){const n=ye(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=ie.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function ze(t){v(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),ne(n=>{const o=new Map;for(const[l,f]of n){const N=t(l);N&&o.set(N,f)}return o}),R(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function wt(t){const n=ye(t);R(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),ze(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t){if(!F)return;const n=we(F.parentDir,t);if(Ie(n,x,p))throw new Error(`"${t}" already exists`);await Z("write",{path:Q(n),content:""}),await le(),await he(),X(null),ce(n)}async function Nt(t){if(!F)return;const n=we(F.parentDir,t);if(Ie(n,x,p))throw new Error(`"${t}" already exists`);const o=Q(n);await Z("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await le(),await he(),X(null),y(l=>{const f=new Set(l);for(const N of Te(n))f.add(N);return f.add(n),f}),R({name:t,path:n,kind:"directory",children:[]})}async function bt(t){if(!F)return;const n=F.node.path,o=Ce(n),l=we(o,t);if(l===n){X(null);return}if(Ie(l,x,p))throw new Error(`"${t}" already exists`);await Z("rename",{from:Q(n),to:Q(l)}),ze(f=>f===n?l:f.startsWith(`${n}/`)?we(l,f.slice(n.length+1)):f),await le(),await he(),X(null)}async function St(t){xe(!0);try{await Z("unlink",{path:Q(t.path),recursive:t.kind==="directory"}),yt(t),wt(t.path),await le(),await he(),De(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{xe(!1)}}async function Mt(t){const n=Xn(t);if(n){W.error(n);return}xe(!0);try{F?.mode==="new-file"?(await jt(t),W.success(`Created "${t}"`)):F?.mode==="new-folder"?(await Nt(t),W.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await bt(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{xe(!1)}}const Ge=u.useRef(!1);Ge.current||(Ge.current=!0,$.current=le());const[Rt,Dt]=u.useState(null);if(a&&a!==Rt){Dt(a);const t=a;queueMicrotask(()=>{Kn(t)&&ce(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Pe(t){const n=await Z("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ke(t,n,o){if(o!==E.current)return!1;let l=!1;return m(f=>{const N=n?er(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!N.truncated,{files:N.files,directories:N.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function Pt(t){const n=O.current.get(t);if(n)return n;const o=E.current,l=(async()=>{const f=await Pe({pattern:"**/*",path:Q(t),limit:ke}),N=Ke(f,!0,o);return!N&&o===E.current&&$e(de=>{const ge=new Set(de);return ge.add(t),ge}),N})();O.current.set(t,l);try{return await l}finally{O.current.delete(t)}}async function Be(t){if(!Fe(t,_.current))return!1;A(n=>new Set(n).add(t));try{return await Pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function Et(t){const n=new Set(_.current);for(const o of Te(t)){if(!Fe(o,n))continue;if(await Be(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function le(){const t=++E.current;be.current=null,ae.current=null,O.current.clear(),L(!0),$e(new Set),y(new Set),A(new Set);try{const n=await Pe({pattern:"**/*",limit:ke,maxDepth:Bn});Ke(n,!1,t),G(!0)}catch{T&&W.error("Failed to refresh file tree")}finally{L(!1)}}async function Ue(t){if(!ie.get(t)?.loaded){ne(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await Z("read",{path:Q(t),full:!0}),l=Qn(o.content??"");ne(f=>{const N=new Map(f);return N.set(t,{savedContent:l,editorValue:l,loaded:!0}),N})}catch{}}}function kt(){te.current++,D(null),C(null),M(!1),I(!1)}async function Tt(){const t=E.current,n=be.current;if(n&&n.generation===t)return n.files;const o=ae.current;if(o&&o.generation===t)return o.promise;const l=(async()=>{const f=await Pe({pattern:"**/*",limit:ke});return E.current===t&&(be.current={generation:t,files:f.files}),f.files})();ae.current={generation:t,promise:l};try{return await l}finally{ae.current?.generation===t&&(ae.current=null)}}async function At(t,n){try{const o=await Tt();if(n!==te.current)return;D(Jn(o,t,st))}catch{if(n!==te.current)return;D([])}}async function Ot(t,n){M(!0);try{const o=await Z("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:ot});if(n!==te.current)return;C(Yn(o.results??"")),I((o.matchCount??0)>=ot)}catch{if(n!==te.current)return;C([]),I(!1)}finally{n===te.current&&M(!1)}}function Ft(t){const n=t.trim(),o=++te.current;At(n,o),n.length<$r?(C(null),M(!1),I(!1)):Ot(n,o)}function It(t){if(U(t),q.current&&clearTimeout(q.current),!t.trim()){kt();return}q.current=setTimeout(()=>{Ft(t)},_r)}function Ve(t){const n=Se.current;if(!n||n.path!==d)return;Se.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Lt(t){Se.current={path:t.path,line:t.line};const n=d===t.path&&ie.get(t.path)?.loaded;ce(t.path),n&&Me.current&&Ve(Me.current)}async function $t(t,n){try{await Z("write",{path:Q(t),content:n}),ve("file saved via sandbox /write",{path:t}),me.invalidateQueries({queryKey:tt(i,e,s)});try{const o=await bn(i,e,s);ve("git status after save",o)}catch(o){ve("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}ne(o=>{const l=new Map(o),f=l.get(t);return f&&l.set(t,{...f,savedContent:n}),l})}catch(o){ve("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){h(t),R({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),fe(null),k.includes(t)||v(n=>[...n,t]),Ue(t)}function zt(t){v(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),ne(n=>{const o=new Map(n);return o.delete(t),o})}function He(t){y(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Gt(t){if(Fe(t,_.current))try{if(await Be(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}He(t)}async function Kt(t,n){if(n){He(t);return}await Gt(t)}async function ce(t){await $.current,await Et(t);const n=Te(t);y(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),_t(t)}function Bt(){return w?.kind==="directory"?w.path:w?.kind==="file"?Ce(w.path):d?Ce(d):"/"}function We(t){const n=Bt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Ut=Un(x,p),qe=Vn(Ut,g),Ee=S?.length??0,Qe=Hn(b??[]),Xe=b?.length??0,re=d?ie.get(d):null,Vt=re?.loaded&&re.editorValue!==re.savedContent,Ht=Re?Ct(Re.path):[],Wt=(t,n)=>{Me.current=t,Ve(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await $t(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);fe({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function qt(t){if(!Y)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${Y.filePath}\``,`**Lines:** ${Y.lineStart}–${Y.lineEnd}`];if(Y.selectedCode){const o=Oe(Y.filePath),l=Y.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),gt("chat"),ht({parts:[{type:"text",text:n.join(`
1
+ import{c as J,r as u,j as r,i as se,B as Ne,d$ as Qt,aO as Xt,aU as ue,e0 as Jt,e1 as Yt,e2 as Zt,e3 as en,bL as tn,e4 as nn,e5 as at,aQ as rn,e6 as on,e7 as sn,e8 as an,e9 as ln,ea as cn,eb as dn,ec as un,ed as fn,ee as mn,l as ee,n as pn,t as W,K as Je}from"./index-C2u4siS5.js";import{F as xn,l as hn}from"./index-CfPj3M1l.js";import{e as gn,aJ as vn,aK as yn}from"./agent-icon-CzJVw_PS.js";import{s as Cn}from"./XClose-CnDiE4wN.js";import{m as wn}from"./automation-runs-BdqIedR2.js";import{b as Ye,T as Ze,a as et}from"./tooltip-DK2r83_Q.js";import{b as jn}from"./chat-context-CWKEbJVu.js";import{u as Nn}from"./shell-layout-BBgOrDIL.js";import{s as ve,a as tt,f as bn}from"./index-Cg3sR771.js";import{a as Sn,h as Mn,D as Rn,c as Dn,d as Pn,e as En}from"./dialog-CvsnsHc6.js";import{I as nt}from"./input-Cb7CGqPN.js";import{c as kn,d as Tn,b as An,A as On,g as Fn,e as In,a as Ln,f as $n}from"./alert-dialog-Y1XXElMo.js";import{t as _n}from"./ChevronDown-BpKPHxDG.js";import{i as zn}from"./ChevronRight-ByVxw7yb.js";import{a as Gn}from"./ZoomOut-shbGcJgg.js";import{v as Kn,E as Bn,w as ke,x as Te,y as Un,z as Vn,A as Hn,C as Wn,D as Q,G as ye,I as Ae,J as Ce,g as Oe,K as Fe,M as qn,N as Qn,O as Xn,P as we,Q as Ie,U as Jn,V as Yn,W as Zn,X as er}from"./index-C8qWG1s1.js";import"./AlertCircle-DfZqGdIO.js";import"./Tool01-CpROxlr0.js";import"./ArrowUp-mYUQI3ny.js";import"./Settings02-DcvdDwJo.js";import"./Tool02-C8iwn6Q8.js";import"./XCircle-C6mRHoZP.js";import"./ArrowUpRight-D7jEUphZ.js";import"./TrendUp01-ryekGRAe.js";import"./ZapSquare-BAQcu1iA.js";import"./Users03-DmiDj7OC.js";import"./CheckCircle-BA3THiSr.js";import"./ChevronUp-DKgNoV7g.js";import"./DotsVertical-Ctyi_Fcj.js";import"./Stars02-PuKOl8z5.js";import"./Copy01-AuaMhdvh.js";import"./Globe01-9M3ZtnRh.js";import"./Eye-CaHkvWGU.js";import"./FilterLines-B_F076bt.js";import"./Star01-DVFgs_0J.js";import"./Globe04-BBu3oRiw.js";import"./SwitchHorizontal01-DYptKpyt.js";import"./HardDrive-Czo8EXKT.js";import"./Image01-C8aqMMC0.js";import"./Key01-HpKP7kjq.js";import"./LayoutLeft-BZQmnN4U.js";import"./LinkExternal01-wLaoE2BO.js";import"./Monitor01-CCqvvSCN.js";import"./Sun-Cw5YUhig.js";import"./Package-DXwLO7TZ.js";import"./Palette-BOYYX-x4.js";import"./Play-Bhc_0wGz.js";import"./Plus-BFo0Fsne.js";import"./SearchLg-D_s4Wx9C.js";import"./SearchMd-DnmtefV6.js";import"./Shield01-hx04AF4i.js";import"./Stars01-B5Wh8soo.js";import"./Trash01-zPnxi6aE.js";import"./Upload01-L8Z9Doey.js";import"./User01-DewcmwdK.js";import"./Users01-Dc2haknw.js";import"./X-DvSaCzV-.js";import"./Zap-B7fiN40E.js";import"./select-DMy4CZEM.js";import"./useInfiniteQuery-DNnEgm4S.js";import"./use-infinite-scroll-CAmtVNGd.js";import"./use-connection-B5YB38XE.js";import"./use-collections-D6OYG-wc.js";import"./use-mcp-client-ioNtd9Ao.js";import"./auth-DGbJKtcV.js";import"./use-virtual-mcp-ak6oQOpL.js";import"./card-CMA-4CeN.js";import"./sidebar-odBC32K5.js";import"./use-mobile-Xv_R9Qvv.js";import"./table-BW9KHE3_.js";import"./empty-state-DA8bHc-1.js";import"./use-members-C5fA1N1j.js";import"./use-org-auth-client-17utjSn0.js";import"./use-clock-tick-D6R8tdxE.js";import"./use-automations-BJ1_8SDs.js";import"./studio-tools-DScMFawl.js";import"./useSuspenseInfiniteQuery-BX2_Qxr6.js";import"./avatar-DBnOObMJ.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BkTOsha4.js";import"./file-type-icon-DnyFLF_v.js";import"./tab-id-BijBBRwE.js";import"./hooks-DPnPW1Ib.js";import"./decopilot-sse-pool-BOQSRcee.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-BIYcRCql.js";import"./index-BOTjGzy-.js";import"./calendar-DX2eI8nn.js";import"./integration-icon-J19ZNMb3.js";import"./use-navigate-to-agent-6EBjGP72.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DXIhupUU.js";import"./form-DWLFR7nn.js";import"./label-DhK5GRHz.js";import"./autosend-C5LHLeko.js";import"./use-ai-providers-DHwTb1GL.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-D35HEWEA.js";import"./use-organization-settings-AW4Wtsqe.js";import"./required-auth-layout-B1JMkrdm.js";import"./use-org-sso-DL3XEgfJ.js";import"./drawer-D8dHZiX8.js";import"./collection-search-CwZ01sWP.js";import"./index-BP1MoKqU.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-DboVWLxl.js";import"./use-mcp-tools-DC9bMhqt.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-tUtbW76M.js";import"./mcp-oauth-BC7utMST.js";import"./extract-connection-data-CTvABTjg.js";import"./dropdown-menu-C1qlOMZ7.js";import"./popover-DfzsvCwC.js";import"./command-Sec7WA_A.js";import"./index-BvCHxsMv.js";import"./tabs-DVwZBWMX.js";import"./toggle-group-BSTIOzYn.js";import"./use-deco-credits-Sg-ppvw1.js";import"./connection-card-DNDrESB-.js";import"./use-registry-connections-Chwp5-AC.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CTeZ2lal.js";import"./connection-form-helpers-l_ijwaHD.js";import"./collection-tabs-BtxGuG1G.js";import"./badge-C6MoaNaP.js";import"./connect-desktop-dialog-aCqZE31x.js";import"./select-model-CeH3eiDd.js";import"./checkbox-BZmlCGR-.js";import"./skeleton-BTXeFNOv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C9wxXn_P.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DBpucGQh.js";import"./toolbar-CgZE309S.js";import"./use-capability-ML8qbFhc.js";import"./toolbar-icon-button-8zS2muhz.js";import"./use-debounced-autosave-sFFdGAPI.js";import"./index-D3xpdmzO.js";import"./search-input-CFD2CbeL.js";import"./use-mcp-auth-status-AcbyV1My.js";import"./switch-Ds8K2Lh_.js";import"./github-repo-picker-BnPj766W.js";import"./use-debounced-value-BWIL-1on.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-oaZoGdZ_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-CXq5b4GI.js";import"./use-file-configs-BCPI-hCq.js";import"./automation-list-row-Ci-vo0Ok.js";const tr={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function nr(i){const e=J.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,y=c===void 0?"":c,d=x===void 0?!1:x,[h,w]=u.useState(y),[R,k]=u.useState(s),v=tr[a];s!==R&&(k(s),s&&w(y));let j;e[0]!==d||e[1]!==g?(j=O=>{!O&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=j):j=e[2];const U=j;let S;e[3]!==d||e[4]!==h||e[5]!==p?(S=async O=>{O.preventDefault();const q=h.trim();!q||d||await p(q)},e[3]=d,e[4]=h,e[5]=p,e[6]=S):S=e[6];const D=S;let b;e[7]!==v.title?(b=r.jsx(Sn,{children:v.title}),e[7]=v.title,e[8]=b):b=e[8];let C;e[9]!==v.description?(C=r.jsx(Mn,{children:v.description}),e[9]=v.description,e[10]=C):C=e[10];let P;e[11]!==b||e[12]!==C?(P=r.jsxs(Rn,{children:[b,C]}),e[11]=b,e[12]=C,e[13]=P):P=e[13];let M;e[14]!==m?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(nt,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=M):M=e[15];let V;e[16]===Symbol.for("react.memo_cache_sentinel")?(V=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=V):V=e[16];let I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=O=>w(O.target.value),e[17]=I):I=e[17];let z;e[18]!==v.placeholder||e[19]!==d||e[20]!==h?(z=r.jsxs("div",{className:"space-y-1.5",children:[V,r.jsx(nt,{id:"file-explorer-name",value:h,onChange:I,placeholder:v.placeholder,autoFocus:!0,disabled:d})]}),e[18]=v.placeholder,e[19]=d,e[20]=h,e[21]=z):z=e[21];let L;e[22]!==z||e[23]!==M?(L=r.jsxs("div",{className:"space-y-4 py-4",children:[M,z]}),e[22]=z,e[23]=M,e[24]=L):L=e[24];let T;e[25]!==g?(T=()=>g(!1),e[25]=g,e[26]=T):T=e[26];let G;e[27]!==d||e[28]!==T?(G=r.jsx(Ne,{type:"button",variant:"outline",onClick:T,disabled:d,children:"Cancel"}),e[27]=d,e[28]=T,e[29]=G):G=e[29];let H;e[30]!==d||e[31]!==h?(H=!h.trim()||d,e[30]=d,e[31]=h,e[32]=H):H=e[32];let K;e[33]!==v.submit||e[34]!==d?(K=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):v.submit,e[33]=v.submit,e[34]=d,e[35]=K):K=e[35];let A;e[36]!==H||e[37]!==K?(A=r.jsx(Ne,{type:"submit",disabled:H,children:K}),e[36]=H,e[37]=K,e[38]=A):A=e[38];let E;e[39]!==G||e[40]!==A?(E=r.jsxs(Dn,{children:[G,A]}),e[39]=G,e[40]=A,e[41]=E):E=e[41];let $;e[42]!==D||e[43]!==L||e[44]!==E||e[45]!==P?($=r.jsx(Pn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:D,children:[P,L,E]})}),e[42]=D,e[43]=L,e[44]=E,e[45]=P,e[46]=$):$=e[46];let _;return e[47]!==U||e[48]!==s||e[49]!==$?(_=r.jsx(En,{open:s,onOpenChange:U,children:$}),e[47]=U,e[48]=s,e[49]=$,e[50]=_):_=e[50],_}function rr(i){const e=J.c(31),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:m,onConfirm:x}=i,p=s!==null,g=s?.kind==="directory"?"folder":"file";let y;e[0]!==g?(y=r.jsxs(kn,{children:["Delete ",g,"?"]}),e[0]=g,e[1]=y):y=e[1];const d=s?.name;let h;e[2]!==d?(h=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=h):h=e[3];const w=s?.kind==="directory"?" and everything inside it.":".";let R;e[4]!==a.length?(R=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=R):R=e[5];let k;e[6]!==h||e[7]!==w||e[8]!==R?(k=r.jsxs(Tn,{children:["This will permanently delete"," ",h,w,R]}),e[6]=h,e[7]=w,e[8]=R,e[9]=k):k=e[9];let v;e[10]!==y||e[11]!==k?(v=r.jsxs(An,{children:[y,k]}),e[10]=y,e[11]=k,e[12]=v):v=e[12];let j;e[13]!==c?(j=r.jsx(On,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=j):j=e[14];const U=c||!s;let S;e[15]!==s||e[16]!==x?(S=M=>{M.preventDefault(),s&&x(s)},e[15]=s,e[16]=x,e[17]=S):S=e[17];let D;e[18]!==U||e[19]!==S?(D=r.jsx(Fn,{disabled:U,onClick:S,children:"Delete"}),e[18]=U,e[19]=S,e[20]=D):D=e[20];let b;e[21]!==j||e[22]!==D?(b=r.jsxs(In,{children:[j,D]}),e[21]=j,e[22]=D,e[23]=b):b=e[23];let C;e[24]!==b||e[25]!==v?(C=r.jsxs(Ln,{children:[v,b]}),e[24]=b,e[25]=v,e[26]=C):C=e[26];let P;return e[27]!==m||e[28]!==p||e[29]!==C?(P=r.jsx($n,{open:p,onOpenChange:m,children:C}),e[27]=m,e[28]=p,e[29]=C,e[30]=P):P=e[30],P}var Le="ContextMenu",[or]=rn(Le,[at]),B=at(),[sr,it]=or(Le),lt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=B(e),y=tn(a),d=u.useCallback(h=>{p(h),y(h)},[y]);return r.jsx(sr,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(nn,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};lt.displayName=Le;var ct="ContextMenuTrigger",dt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=it(ct,s),x=B(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),y=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(y.current),[]),h=w=>{p.current={x:w.clientX,y:w.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Qt,{...x,virtualRef:g}),r.jsx(Xt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ue(i.onContextMenu,w=>{d(),h(w),w.preventDefault()}),onPointerDown:a?i.onPointerDown:ue(i.onPointerDown,je(w=>{d(),y.current=window.setTimeout(()=>h(w),700)})),onPointerMove:a?i.onPointerMove:ue(i.onPointerMove,je(d)),onPointerCancel:a?i.onPointerCancel:ue(i.onPointerCancel,je(d)),onPointerUp:a?i.onPointerUp:ue(i.onPointerUp,je(d))})]})});dt.displayName=ct;var ar="ContextMenuPortal",ut=i=>{const{__scopeContextMenu:e,...s}=i,a=B(e);return r.jsx(Zt,{...a,...s})};ut.displayName=ar;var ft="ContextMenuContent",mt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=it(ft,s),m=B(s),x=u.useRef(!1);return r.jsx(en,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mt.displayName=ft;var ir="ContextMenuGroup",lr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(on,{...c,...a,ref:e})});lr.displayName=ir;var cr="ContextMenuLabel",dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(sn,{...c,...a,ref:e})});dr.displayName=cr;var ur="ContextMenuItem",pt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(Jt,{...c,...a,ref:e})});pt.displayName=ur;var fr="ContextMenuCheckboxItem",mr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(an,{...c,...a,ref:e})});mr.displayName=fr;var pr="ContextMenuRadioGroup",xr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(ln,{...c,...a,ref:e})});xr.displayName=pr;var hr="ContextMenuRadioItem",gr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(cn,{...c,...a,ref:e})});gr.displayName=hr;var vr="ContextMenuItemIndicator",yr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(dn,{...c,...a,ref:e})});yr.displayName=vr;var Cr="ContextMenuSeparator",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(Yt,{...c,...a,ref:e})});xt.displayName=Cr;var wr="ContextMenuArrow",jr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(un,{...c,...a,ref:e})});jr.displayName=wr;var Nr="ContextMenuSubTrigger",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(fn,{...c,...a,ref:e})});br.displayName=Nr;var Sr="ContextMenuSubContent",Mr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=B(s);return r.jsx(mn,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mr.displayName=Sr;function je(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Rr=lt,Dr=dt,Pr=ut,Er=mt,kr=pt,Tr=xt;function Ar(i){const e=J.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Rr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Or(i){const e=J.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Dr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Fr(i){const e=J.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ee("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(Pr,{children:r.jsx(Er,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function oe(i){const e=J.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(kr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function rt(i){const e=J.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ee("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(Tr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const Ir="#d9a441";function Lr(i){const e=J.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:y,onNewFile:d,onNewFolder:h,onCopyPath:w,onCopyRelativePath:R,onRename:k,onDelete:v}=i,j=x===void 0?!1:x,U=s.kind==="directory",{Icon:S,color:D}=p,b=m&&"bg-accent";let C;e[0]!==b?(C=ee("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",b),e[0]=b,e[1]=C):C=e[1];const P=`${a*14+8}px`;let M;e[2]!==P?(M={paddingLeft:P},e[2]=P,e[3]=M):M=e[3];let V;e[4]!==g||e[5]!==y?(V=()=>{y(),g()},e[4]=g,e[5]=y,e[6]=V):V=e[6];let I;e[7]!==S||e[8]!==D||e[9]!==U||e[10]!==c||e[11]!==j?(I=U?r.jsxs(r.Fragment,{children:[j?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(_n,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(zn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Gn,{size:16,className:"shrink-0",style:{color:Ir}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(S,{size:16,className:"shrink-0",style:{color:D}})]}),e[7]=S,e[8]=D,e[9]=U,e[10]=c,e[11]=j,e[12]=I):I=e[12];let z;e[13]!==s.name?(z=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=z):z=e[14];let L;e[15]!==C||e[16]!==M||e[17]!==V||e[18]!==I||e[19]!==z?(L=r.jsx(Or,{asChild:!0,children:r.jsxs("button",{type:"button",className:C,style:M,onClick:V,children:[I,z]})}),e[15]=C,e[16]=M,e[17]=V,e[18]=I,e[19]=z,e[20]=L):L=e[20];let T;e[21]!==d?(T=r.jsx(oe,{onSelect:d,children:"New File"}),e[21]=d,e[22]=T):T=e[22];let G;e[23]!==h?(G=r.jsx(oe,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=G):G=e[24];let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=r.jsx(rt,{}),e[25]=H):H=e[25];let K;e[26]!==w?(K=r.jsx(oe,{onSelect:w,children:"Copy Path"}),e[26]=w,e[27]=K):K=e[27];let A;e[28]!==R?(A=r.jsx(oe,{onSelect:R,children:"Copy Relative Path"}),e[28]=R,e[29]=A):A=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(rt,{}),e[30]=E):E=e[30];let $;e[31]!==k?($=r.jsx(oe,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=$):$=e[32];let _;e[33]!==v?(_=r.jsx(oe,{variant:"destructive",onSelect:v,children:"Delete"}),e[33]=v,e[34]=_):_=e[34];let O;e[35]!==T||e[36]!==G||e[37]!==K||e[38]!==A||e[39]!==$||e[40]!==_?(O=r.jsxs(Fr,{className:"w-52",children:[T,G,H,K,A,E,$,_]}),e[35]=T,e[36]=G,e[37]=K,e[38]=A,e[39]=$,e[40]=_,e[41]=O):O=e[41];let q;return e[42]!==O||e[43]!==L?(q=r.jsxs(Ar,{children:[L,O]}),e[42]=O,e[43]=L,e[44]=q):q=e[44],q}hn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const ot=200,$r=2,_r=250,st=200;function zr(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Gr(i){const e=J.c(9),{text:s,query:a}=i;let c,m,x;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:g,segments:y}=qn(s,a);c="truncate font-mono text-muted-foreground",m=g&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),x=y.map(Kr),e[0]=a,e[1]=s,e[2]=c,e[3]=m,e[4]=x}else c=e[2],m=e[3],x=e[4];let p;return e[5]!==c||e[6]!==m||e[7]!==x?(p=r.jsxs("span",{className:c,children:[m,x]}),e[5]=c,e[6]=m,e[7]=x,e[8]=p):p=e[8],p}function Kr(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Oa({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,y]=u.useState(new Set),[d,h]=u.useState(null),[w,R]=u.useState(null),[k,v]=u.useState([]),[j,U]=u.useState(""),[S,D]=u.useState(null),[b,C]=u.useState(null),[P,M]=u.useState(!1),[V,I]=u.useState(!1),[z,L]=u.useState(!1),[T,G]=u.useState(!1),[,H]=u.useState(new Set),[K,A]=u.useState(new Set),E=u.useRef(0),$=u.useRef(null),_=u.useRef(new Set),O=u.useRef(new Map),q=u.useRef(null),te=u.useRef(0),be=u.useRef(null),ae=u.useRef(null),Se=u.useRef(null);function $e(t){H(n=>{const o=typeof t=="function"?t(n):t;return _.current=o,o})}const[ie,ne]=u.useState(new Map),Me=u.useRef(null),[Y,fe]=u.useState(null),{sendMessage:ht}=jn(),{openSidePanel:gt}=Nn(),me=pn(),[F,X]=u.useState(null),[Re,De]=u.useState(null),[pe,xe]=u.useState(!1);async function Z(t,n){const o=await fetch(zr(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function he(){me.invalidateQueries({queryKey:tt(i,e,s)})}function _e(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function vt(t){const n=Zn(t);if(!n)return;const o=`${i}/${e}/${s}`;me.setQueryData(Je.decofile(o),l=>{if(!l)return l;const{[n]:f,...N}=l;return N}),me.invalidateQueries({queryKey:Je.liveMeta(i,e,s)})}function yt(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ye(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function Ct(t){const n=ye(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=ie.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function ze(t){v(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),ne(n=>{const o=new Map;for(const[l,f]of n){const N=t(l);N&&o.set(N,f)}return o}),R(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function wt(t){const n=ye(t);R(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),ze(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t){if(!F)return;const n=we(F.parentDir,t);if(Ie(n,x,p))throw new Error(`"${t}" already exists`);await Z("write",{path:Q(n),content:""}),await le(),await he(),X(null),ce(n)}async function Nt(t){if(!F)return;const n=we(F.parentDir,t);if(Ie(n,x,p))throw new Error(`"${t}" already exists`);const o=Q(n);await Z("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await le(),await he(),X(null),y(l=>{const f=new Set(l);for(const N of Te(n))f.add(N);return f.add(n),f}),R({name:t,path:n,kind:"directory",children:[]})}async function bt(t){if(!F)return;const n=F.node.path,o=Ce(n),l=we(o,t);if(l===n){X(null);return}if(Ie(l,x,p))throw new Error(`"${t}" already exists`);await Z("rename",{from:Q(n),to:Q(l)}),ze(f=>f===n?l:f.startsWith(`${n}/`)?we(l,f.slice(n.length+1)):f),await le(),await he(),X(null)}async function St(t){xe(!0);try{await Z("unlink",{path:Q(t.path),recursive:t.kind==="directory"}),yt(t),wt(t.path),await le(),await he(),De(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{xe(!1)}}async function Mt(t){const n=Xn(t);if(n){W.error(n);return}xe(!0);try{F?.mode==="new-file"?(await jt(t),W.success(`Created "${t}"`)):F?.mode==="new-folder"?(await Nt(t),W.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await bt(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{xe(!1)}}const Ge=u.useRef(!1);Ge.current||(Ge.current=!0,$.current=le());const[Rt,Dt]=u.useState(null);if(a&&a!==Rt){Dt(a);const t=a;queueMicrotask(()=>{Kn(t)&&ce(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Pe(t){const n=await Z("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ke(t,n,o){if(o!==E.current)return!1;let l=!1;return m(f=>{const N=n?er(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!N.truncated,{files:N.files,directories:N.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function Pt(t){const n=O.current.get(t);if(n)return n;const o=E.current,l=(async()=>{const f=await Pe({pattern:"**/*",path:Q(t),limit:ke}),N=Ke(f,!0,o);return!N&&o===E.current&&$e(de=>{const ge=new Set(de);return ge.add(t),ge}),N})();O.current.set(t,l);try{return await l}finally{O.current.delete(t)}}async function Be(t){if(!Fe(t,_.current))return!1;A(n=>new Set(n).add(t));try{return await Pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function Et(t){const n=new Set(_.current);for(const o of Te(t)){if(!Fe(o,n))continue;if(await Be(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function le(){const t=++E.current;be.current=null,ae.current=null,O.current.clear(),L(!0),$e(new Set),y(new Set),A(new Set);try{const n=await Pe({pattern:"**/*",limit:ke,maxDepth:Bn});Ke(n,!1,t),G(!0)}catch{T&&W.error("Failed to refresh file tree")}finally{L(!1)}}async function Ue(t){if(!ie.get(t)?.loaded){ne(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await Z("read",{path:Q(t),full:!0}),l=Qn(o.content??"");ne(f=>{const N=new Map(f);return N.set(t,{savedContent:l,editorValue:l,loaded:!0}),N})}catch{}}}function kt(){te.current++,D(null),C(null),M(!1),I(!1)}async function Tt(){const t=E.current,n=be.current;if(n&&n.generation===t)return n.files;const o=ae.current;if(o&&o.generation===t)return o.promise;const l=(async()=>{const f=await Pe({pattern:"**/*",limit:ke});return E.current===t&&(be.current={generation:t,files:f.files}),f.files})();ae.current={generation:t,promise:l};try{return await l}finally{ae.current?.generation===t&&(ae.current=null)}}async function At(t,n){try{const o=await Tt();if(n!==te.current)return;D(Jn(o,t,st))}catch{if(n!==te.current)return;D([])}}async function Ot(t,n){M(!0);try{const o=await Z("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:ot});if(n!==te.current)return;C(Yn(o.results??"")),I((o.matchCount??0)>=ot)}catch{if(n!==te.current)return;C([]),I(!1)}finally{n===te.current&&M(!1)}}function Ft(t){const n=t.trim(),o=++te.current;At(n,o),n.length<$r?(C(null),M(!1),I(!1)):Ot(n,o)}function It(t){if(U(t),q.current&&clearTimeout(q.current),!t.trim()){kt();return}q.current=setTimeout(()=>{Ft(t)},_r)}function Ve(t){const n=Se.current;if(!n||n.path!==d)return;Se.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Lt(t){Se.current={path:t.path,line:t.line};const n=d===t.path&&ie.get(t.path)?.loaded;ce(t.path),n&&Me.current&&Ve(Me.current)}async function $t(t,n){try{await Z("write",{path:Q(t),content:n}),ve("file saved via sandbox /write",{path:t}),me.invalidateQueries({queryKey:tt(i,e,s)});try{const o=await bn(i,e,s);ve("git status after save",o)}catch(o){ve("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}ne(o=>{const l=new Map(o),f=l.get(t);return f&&l.set(t,{...f,savedContent:n}),l})}catch(o){ve("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){h(t),R({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),fe(null),k.includes(t)||v(n=>[...n,t]),Ue(t)}function zt(t){v(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),ne(n=>{const o=new Map(n);return o.delete(t),o})}function He(t){y(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Gt(t){if(Fe(t,_.current))try{if(await Be(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}He(t)}async function Kt(t,n){if(n){He(t);return}await Gt(t)}async function ce(t){await $.current,await Et(t);const n=Te(t);y(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),_t(t)}function Bt(){return w?.kind==="directory"?w.path:w?.kind==="file"?Ce(w.path):d?Ce(d):"/"}function We(t){const n=Bt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Ut=Un(x,p),qe=Vn(Ut,g),Ee=S?.length??0,Qe=Hn(b??[]),Xe=b?.length??0,re=d?ie.get(d):null,Vt=re?.loaded&&re.editorValue!==re.savedContent,Ht=Re?Ct(Re.path):[],Wt=(t,n)=>{Me.current=t,Ve(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await $t(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);fe({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function qt(t){if(!Y)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${Y.filePath}\``,`**Lines:** ${Y.lineStart}–${Y.lineEnd}`];if(Y.selectedCode){const o=Oe(Y.filePath),l=Y.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),gt("chat"),ht({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),fe(null)}return z&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(gn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:j,onChange:t=>It(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(Ye,{children:[r.jsx(Ze,{asChild:!0,children:r.jsx(Ne,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>We("new-file"),children:r.jsx(vn,{size:14})})}),r.jsx(et,{side:"bottom",children:"New file"})]}),r.jsxs(Ye,{children:[r.jsx(Ze,{asChild:!0,children:r.jsx(Ne,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>We("new-folder"),children:r.jsx(yn,{size:14})})}),r.jsx(et,{side:"bottom",children:"New folder"})]})]}),r.jsx(wn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!j&&qe.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),N=w?.path===n.path,de=Wn(n.path,n.kind),ge=l&&K.has(n.path);return r.jsx(Lr,{node:n,depth:o,isExpanded:f,isSelected:N,isLoading:ge,fileVisual:Ae(n.name),onSelect:()=>R(n),onOpen:()=>{l?Kt(n.path,f):ce(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:de}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:de}),onCopyPath:()=>_e("Path",ye(n.path)),onCopyRelativePath:()=>_e("Relative path",Q(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:de}),onDelete:()=>De(n)},n.path)}),!j&&T&&qe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No files found"}),j&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:"Files"}),Ee>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Ee,Ee>=st?"+":""]})]}),S!==null&&S.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"No file names match"}),S?.map(t=>{const n=t.split("/").pop()??t,o=Ce(t),{Icon:l,color:f}=Ae(n),N=d===t;return r.jsxs("button",{type:"button",onClick:()=>{ce(t)},title:t,className:ee("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",N&&"bg-accent"),children:[r.jsx(l,{size:14,className:ee("shrink-0",f)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),j&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:"In files"}),Xe>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Xe,V?"+":""]}),P&&r.jsx(se,{size:10,className:"animate-spin"})]}),!P&&b!==null&&Qe.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"No matches in file contents"}),Qe.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:l}=Ae(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:ee("shrink-0",l)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(f=>r.jsxs("button",{type:"button",onClick:()=>Lt(f),title:`${t.path}:${f.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:f.line}),r.jsx(Gr,{text:f.text,query:j})]},`${t.path}:${f.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=ie.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ee("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Ue(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:N=>{N.stopPropagation(),zt(t)},children:r.jsx(Cn,{size:12})})]},t)})}),Y&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&qt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&fe(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&re?.loaded?r.jsx(xn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:re.editorValue,path:d,onChange:t=>{const n=d;n&&ne(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Wt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!re?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[Vt?"Modified":"Saved"," ·"," ",Oe(d)]})]})]}),r.jsx(nr,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":Q(F.parentDir):void 0,isPending:pe,onSubmit:Mt,onOpenChange:t=>{!t&&!pe&&X(null)}}),r.jsx(rr,{deleteTarget:Re,deleteDirtyPaths:Ht,fsActionPending:pe,onOpenChange:t=>{!t&&!pe&&De(null)},onConfirm:t=>{St(t)}})]})}export{Oa as FileExplorer};