decocms 4.145.4 → 4.146.1

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 (244) hide show
  1. package/dist/README.md +1 -0
  2. package/dist/client/assets/{AlertCircle-CSQCPj_V.js → AlertCircle-iV-9b6L0.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BMJ7Mtx-.js → AreaChart-CLS5JyIR.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-B6IlW6Qi.js → ArrowUp-Bq8_Goa-.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-eD5g-cFd.js → ArrowUpRight-VAC5WbVQ.js} +1 -1
  6. package/dist/client/assets/{Check-CWNssTV8.js → Check-BEwZK4by.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DDuWLqUq.js → CheckCircle-C_arAhXi.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BWHEr7M7.js → ChevronDown-DwSeIJwx.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Bqyf0yi2.js → ChevronRight-Dj7ZibPe.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-ROaBb_s7.js → ChevronUp-D8sHMRlA.js} +1 -1
  11. package/dist/client/assets/{Copy01-_e4tlhaR.js → Copy01-CDiyMmNu.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C-UD1H-W.js → DotsVertical-h00tBGpG.js} +1 -1
  13. package/dist/client/assets/{Eye-BZEDG_yV.js → Eye-CoS_dEFv.js} +1 -1
  14. package/dist/client/assets/{FilterLines-B2iuWHYg.js → FilterLines-B7A0MwUa.js} +1 -1
  15. package/dist/client/assets/{HardDrive-1qI5HKiO.js → HardDrive-D5hWkPW7.js} +1 -1
  16. package/dist/client/assets/{Key01-AWbv_wld.js → Key01-Co7CW7jv.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CGP9_srE.js → LayoutLeft-CQ5Zq-C7.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BHxU7hA5.js → LinkExternal01-BuQ3C4t9.js} +1 -1
  19. package/dist/client/assets/{LogOut01-BHFIF5pV.js → LogOut01-CEARG2vU.js} +1 -1
  20. package/dist/client/assets/{Monitor01-kMl_aKHS.js → Monitor01-BeDlFKTq.js} +1 -1
  21. package/dist/client/assets/{Palette-BStHvqZ6.js → Palette-C749bZK9.js} +1 -1
  22. package/dist/client/assets/{Play-CgnGl0Ls.js → Play-Bfbh5D9o.js} +1 -1
  23. package/dist/client/assets/{Plus-CSNWQMMp.js → Plus-BifB3M1m.js} +1 -1
  24. package/dist/client/assets/{SearchLg-LtdaD4ZG.js → SearchLg---BxTKhv.js} +1 -1
  25. package/dist/client/assets/{SearchMd-BEvxAPyw.js → SearchMd-DXm95nAk.js} +1 -1
  26. package/dist/client/assets/{Settings02-DWHb-lRw.js → Settings02-BTjZquNj.js} +1 -1
  27. package/dist/client/assets/{Shield01-T-UpndO1.js → Shield01-Dfy37vyR.js} +1 -1
  28. package/dist/client/assets/{Star01-qAZqSHYs.js → Star01-QaWR6Ezs.js} +1 -1
  29. package/dist/client/assets/{Stars01-CO4iRFT5.js → Stars01-DNx-fPjC.js} +1 -1
  30. package/dist/client/assets/{Stars02-DLFxhacf.js → Stars02-Bf4G2ysf.js} +1 -1
  31. package/dist/client/assets/{Sun-Bmj9T9Hs.js → Sun-DXJuSD-H.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-SFOutJ0F.js → SwitchHorizontal01-WXmWF2vt.js} +1 -1
  33. package/dist/client/assets/{Tool01-DluxhvbR.js → Tool01-CLVcZjYh.js} +1 -1
  34. package/dist/client/assets/{Tool02-5oU4U7Oz.js → Tool02-DD5PhqNn.js} +1 -1
  35. package/dist/client/assets/{Trash01-BecpyKSB.js → Trash01-DcCzRKAW.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-DxZS9i5H.js → TrendUp01-CLrU39GK.js} +1 -1
  37. package/dist/client/assets/{Upload01-D6mhS0Il.js → Upload01-poa1D0uh.js} +1 -1
  38. package/dist/client/assets/{User01-CAYZjCBh.js → User01-XcUJMrMi.js} +1 -1
  39. package/dist/client/assets/{Users01-CJn3nv4f.js → Users01-DAMvzaJN.js} +1 -1
  40. package/dist/client/assets/{Users03-DgykpOrm.js → Users03-oO2BbmYc.js} +1 -1
  41. package/dist/client/assets/{X-CalOG8rP.js → X-D-S1FaYS.js} +1 -1
  42. package/dist/client/assets/{XCircle-CfbsFoSm.js → XCircle-tG0FSbc_.js} +1 -1
  43. package/dist/client/assets/{XClose-BFk0sz9G.js → XClose-C_8ss2IS.js} +1 -1
  44. package/dist/client/assets/{Zap-BNdcgXgA.js → Zap-6vuFSHAi.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-Dm2_KtgV.js → ZapSquare-DGtIJhBt.js} +1 -1
  46. package/dist/client/assets/{access-gate-BPcsz4E2.js → access-gate-DmF9tuil.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-BV6Pejty.js → add-section-modal-BcqHymBd.js} +1 -1
  48. package/dist/client/assets/{agent-icon-aWRSFV3S.js → agent-icon-DmqrLJlK.js} +1 -1
  49. package/dist/client/assets/{agents-list-Doi_CXpl.js → agents-list-CRlFP1zC.js} +1 -1
  50. package/dist/client/assets/ai-providers-Bk-h6KpB.js +1 -0
  51. package/dist/client/assets/{alert-C7dLb2xM.js → alert-Cm_H6_i3.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CI_jOgZR.js → alert-dialog-KLO3EI5S.js} +2 -2
  53. package/dist/client/assets/app-editor-CMmq69Qs.js +1 -0
  54. package/dist/client/assets/{auth-ByPgJhb1.js → auth-NUgT0GrU.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BrR9Uohz.js → auth-catchall-CMFyQZGD.js} +1 -1
  56. package/dist/client/assets/auth-entry-CjvvaG5T.js +1 -0
  57. package/dist/client/assets/{auth-split-layout-WhFDNx9E.js → auth-split-layout-B94HleBq.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BjOG3bpy.js → authenticate-and-persist-oauth-uyGMJLSI.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-xT8oiUOD.js → automation-list-row-Bf5-MRN4.js} +1 -1
  60. package/dist/client/assets/{automation-runs-BZROadaX.js → automation-runs-CO-bNTHb.js} +1 -1
  61. package/dist/client/assets/{automations-B0GAyss_.js → automations-DRd61XcH.js} +1 -1
  62. package/dist/client/assets/{avatar-2NkvJFhn.js → avatar-BFl9MhjQ.js} +1 -1
  63. package/dist/client/assets/{badge-BkDtGQCF.js → badge-BwV-4Vi4.js} +1 -1
  64. package/dist/client/assets/{block-document-5TIiP0i6.js → block-document-C7QgL-nH.js} +1 -1
  65. package/dist/client/assets/{brand-context-BMuLBGKb.js → brand-context-CEj_IAjQ.js} +1 -1
  66. package/dist/client/assets/{buckets-DhwsPAZ0.js → buckets-CitrcBgj.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-B9VFn-91.js +1 -0
  68. package/dist/client/assets/{calendar-Cd5zs7es.js → calendar-BsW-wV9E.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-C0MHRICc.js → capability-load-error-CsUJ-j9z.js} +1 -1
  70. package/dist/client/assets/{card-yJEtZ44f.js → card-DryaE2W3.js} +1 -1
  71. package/dist/client/assets/category-editor-CKTVtRkM.js +1 -0
  72. package/dist/client/assets/chat-context-CJprnyAF.js +36 -0
  73. package/dist/client/assets/{checkbox-5E1V-xvi.js → checkbox-Dkt6rnMp.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BoXabKLI.js → cli-auth-success-ClTvzLlY.js} +1 -1
  75. package/dist/client/assets/{collection-detail-6rxSJkCq.js → collection-detail-Cu1dUGi0.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-CBvgEV5M.js → collection-display-button-CJtMzYEM.js} +1 -1
  77. package/dist/client/assets/{collection-search-vT5mWioA.js → collection-search-BjtQL6OR.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CEpWE0F9.js → collection-table-wrapper-Brisqdfn.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-Cm8oTUd7.js → collection-tabs-Bz3MwbKN.js} +1 -1
  80. package/dist/client/assets/{command-Dq6iipS5.js → command-CJ4FB8IT.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CdsU1n7i.js → commerce-onboarding-psQ6nNs1.js} +1 -1
  82. package/dist/client/assets/{companions-core-DBWG3_HY.js → companions-core-nqUtc9ST.js} +1 -1
  83. package/dist/client/assets/connect-D2r1foh7.js +8 -0
  84. package/dist/client/assets/{connection-C42PVCSd.js → connection-D01AN8S5.js} +1 -1
  85. package/dist/client/assets/{connection-card-CK8a5ay6.js → connection-card-uHCGfuCP.js} +1 -1
  86. package/dist/client/assets/connection-detail-BA4CJnKD.js +1 -0
  87. package/dist/client/assets/{connection-form-helpers-C2rTDrzA.js → connection-form-helpers-PGV3rmgF.js} +1 -1
  88. package/dist/client/assets/connections-BDnPKD3v.js +1 -0
  89. package/dist/client/assets/{decopilot-sse-pool-C1RJsJS0.js → decopilot-sse-pool-Bbz6JSxH.js} +1 -1
  90. package/dist/client/assets/{dialog-Dq_peVG0.js → dialog-X9BweWBo.js} +1 -1
  91. package/dist/client/assets/{domain-settings-CtzeSPRr.js → domain-settings-CNIzVuor.js} +1 -1
  92. package/dist/client/assets/{drawer-BSvXGda-.js → drawer-H9uYjyJO.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BuPKJUY8.js → dropdown-menu-DhiwoSOv.js} +1 -1
  94. package/dist/client/assets/{empty-state-BZSpYvM0.js → empty-state-Bbi0wmo_.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-ZTR7xcCD.js → extract-connection-data-Drdn1Nzd.js} +1 -1
  96. package/dist/client/assets/file-explorer-O9SHRUaw.js +2 -0
  97. package/dist/client/assets/{form-Da6Pak5q.js → form-B_AMb5Fz.js} +1 -1
  98. package/dist/client/assets/{general-Dxp-Gk6z.js → general-B19Tu2dd.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-BjY_cbDW.js → github-repo-picker-BWo0mStf.js} +1 -1
  100. package/dist/client/assets/{hooks-CiBCHAEU.js → hooks-HM6-OmCU.js} +2 -2
  101. package/dist/client/assets/{index-k6yNjC6u.js → index-B7AdfWqS.js} +1 -1
  102. package/dist/client/assets/index-BBcnt_Gc.js +8 -0
  103. package/dist/client/assets/{index-Bl2gwdpO.js → index-BsCcyOa9.js} +1 -1
  104. package/dist/client/assets/{index-sd38S2ER.js → index-CSpVJ_t8.js} +27 -27
  105. package/dist/client/assets/{index-CHt7Tdc5.js → index-CUcIQeNw.js} +1 -1
  106. package/dist/client/assets/{index-SsOp9DoN.js → index-CawOud0u.js} +1 -1
  107. package/dist/client/assets/{index-luz2_Kqi.js → index-DPXYtC7p.js} +1 -1
  108. package/dist/client/assets/{index-CXiIkJNe.js → index-DY3aCwd-.js} +1 -1
  109. package/dist/client/assets/index-DolLSrq-.css +1 -0
  110. package/dist/client/assets/{index-fII9c_kY.js → index-DzeUBs5H.js} +37 -37
  111. package/dist/client/assets/{index-CVc4ITjm.js → index-Tblji67m.js} +1 -1
  112. package/dist/client/assets/index-dCzAbkDl.js +1 -0
  113. package/dist/client/assets/{index-redirect-DJUUAT-x.js → index-redirect-CPophITp.js} +1 -1
  114. package/dist/client/assets/{input-Df5WqCIh.js → input-nIRBYIuI.js} +1 -1
  115. package/dist/client/assets/{integration-icon-D-DwNzR1.js → integration-icon-D6bgSpK1.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-Rie9X6aX.js → invite-member-dialog-eUyxVvzk.js} +1 -1
  117. package/dist/client/assets/{label-q5RWAz3v.js → label-BrWXm0oL.js} +1 -1
  118. package/dist/client/assets/{layout-4S09taad.js → layout-C1JWCDS_.js} +1 -1
  119. package/dist/client/assets/{login-BT0MtgCn.js → login-DhQoKLuv.js} +1 -1
  120. package/dist/client/assets/mcp-oauth-Dbphkt3b.js +1 -0
  121. package/dist/client/assets/{members-BFl3wg6J.js → members-ajbEjWHb.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-Cxpp-hMU.js → monaco-editor-CI4sJdLM.js} +4 -4
  123. package/dist/client/assets/{monitoring-stats-row-C_ZvOQMg.js → monitoring-stats-row-DJQ5u-3I.js} +1 -1
  124. package/dist/client/assets/{multi-select-BLzsq679.js → multi-select-hVoAgZf8.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-CiK488OV.js → oauth-callback-ai-provider-CdtmM1gN.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-DW7fVwr1.js → oauth-callback-uW0tx16Y.js} +1 -1
  127. package/dist/client/assets/{onboarding-BG6NzFm2.js → onboarding-FVt6pQE7.js} +1 -1
  128. package/dist/client/assets/{org-install-DGkz2TMa.js → org-install-BXbdMz_B.js} +1 -1
  129. package/dist/client/assets/{org-layout-B-rNRqK1.js → org-layout-szLkAsz4.js} +1 -1
  130. package/dist/client/assets/{organization-choice-CeiMbljd.js → organization-choice-DdFEl8C9.js} +1 -1
  131. package/dist/client/assets/{orgs-KwuNkzmk.js → orgs-Bm3q5r5W.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-soQoyhZq.js → page-seo-form-CCHnBA0A.js} +1 -1
  133. package/dist/client/assets/{popover-BxXBf9EH.js → popover-DPzcVRI9.js} +1 -1
  134. package/dist/client/assets/post-editor-Bo0o8qVA.js +1 -0
  135. package/dist/client/assets/{primitives-hG3gzivQ.js → primitives-9JtZslKi.js} +1 -1
  136. package/dist/client/assets/{profile-0GWHiBFp.js → profile-DNOq-C7l.js} +1 -1
  137. package/dist/client/assets/project-app-view-VkJg7Is0.js +1 -0
  138. package/dist/client/assets/record-editor-2HUsOqp-.js +1 -0
  139. package/dist/client/assets/redirect-editor-CEQ_rNB1.js +1 -0
  140. package/dist/client/assets/registry-Bm4WSfLH.js +2 -0
  141. package/dist/client/assets/{registry-layout-BPmkJ_es.js → registry-layout-O8eFjdsj.js} +1 -1
  142. package/dist/client/assets/{reports-9uRBgUwC.js → reports-rdNAsKIl.js} +1 -1
  143. package/dist/client/assets/{require-capability-CqQ6B0ux.js → require-capability-BqW2O8tQ.js} +1 -1
  144. package/dist/client/assets/{required-auth-layout-CIVjmrI-.js → required-auth-layout-CZcGkbeo.js} +1 -1
  145. package/dist/client/assets/{reset-password-CWGs2cLw.js → reset-password-NAnSgMCU.js} +1 -1
  146. package/dist/client/assets/{roles-CdAcWw-W.js → roles-DAwDB-aN.js} +1 -1
  147. package/dist/client/assets/{search-input-C0Tu8jAx.js → search-input-B33sM_et.js} +1 -1
  148. package/dist/client/assets/{secrets-rhPict2d.js → secrets-1vFLdoMt.js} +1 -1
  149. package/dist/client/assets/{sections-editor-CVy2fhWn.js → sections-editor-DYTM43Ec.js} +2 -2
  150. package/dist/client/assets/{select-BaiNHGHX.js → select-Bumes-Pu.js} +1 -1
  151. package/dist/client/assets/select-model-B-YMm1Vb.js +4 -0
  152. package/dist/client/assets/{self-tool-result-DKMkJU4m.js → self-tool-result-pTasFl_J.js} +1 -1
  153. package/dist/client/assets/seo-editor-HPjahBFt.js +1 -0
  154. package/dist/client/assets/{settings-layout-C5m3Vodh.js → settings-layout-j1oEnNh-.js} +1 -1
  155. package/dist/client/assets/{settings-section-BzmRZGKV.js → settings-section-BhK0tyVv.js} +1 -1
  156. package/dist/client/assets/{shell-controls-zNdpglpf.js → shell-controls-COEu759Q.js} +1 -1
  157. package/dist/client/assets/{shell-layout-OumtAwy1.js → shell-layout-ntvgQban.js} +1 -1
  158. package/dist/client/assets/{sidebar-DTxjIJ56.js → sidebar-DX7dXJWd.js} +1 -1
  159. package/dist/client/assets/{skeleton-Bqf4wcUq.js → skeleton-CLiDBsAg.js} +1 -1
  160. package/dist/client/assets/{sso-y15zIhWp.js → sso-CQAbUFs8.js} +1 -1
  161. package/dist/client/assets/{store-Bdo34j2n.js → store-BrOCEq1y.js} +1 -1
  162. package/dist/client/assets/store-registry-BhTGP20T.js +2 -0
  163. package/dist/client/assets/{studio-tools-C9O5T6hk.js → studio-tools-C3gmiGRu.js} +1 -1
  164. package/dist/client/assets/{switch-DzR4USnH.js → switch-CnJXP7aS.js} +1 -1
  165. package/dist/client/assets/{tab-id-D67TyC-3.js → tab-id-8jbcMQB2.js} +1 -1
  166. package/dist/client/assets/{table-CW9azojk.js → table-BptDOtwb.js} +1 -1
  167. package/dist/client/assets/{tabs-Dg2fovl2.js → tabs-Ba77uRY9.js} +1 -1
  168. package/dist/client/assets/{textarea-B-mbIfJP.js → textarea-BDkMfXcP.js} +1 -1
  169. package/dist/client/assets/{toggle-group-Bd_5HjJ1.js → toggle-group-B2gOWe_x.js} +1 -1
  170. package/dist/client/assets/{toolbar-BQhumIzA.js → toolbar-pRr49cDw.js} +1 -1
  171. package/dist/client/assets/{tooltip-Bjx5IK0l.js → tooltip-7Y1XKgM6.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-Dsmt_TQY.js → use-ai-providers-GhlvaZHT.js} +1 -1
  173. package/dist/client/assets/{use-automations-DAZgpS9S.js → use-automations-BFjJHCwS.js} +1 -1
  174. package/dist/client/assets/{use-autosave-B5hezYu8.js → use-autosave-Y3QhO529.js} +1 -1
  175. package/dist/client/assets/{use-capability-DbSBzq4m.js → use-capability-NOX9q9Tg.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-9uLrrBUm.js → use-clock-tick-Bq0LVZ1e.js} +1 -1
  177. package/dist/client/assets/{use-connection-DtVPu3zH.js → use-connection-B7zY84qP.js} +1 -1
  178. package/dist/client/assets/{use-copy-BmXjtpVk.js → use-copy-DxAhFzR7.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-CZZVOBEo.js → use-create-virtual-mcp-CIa8P0o6.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-CV9YJ4dj.js → use-debounced-autosave-W3stCruS.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-BhoOs69E.js → use-debounced-value-D9N08iAn.js} +1 -1
  182. package/dist/client/assets/use-deco-credits-D_5oaYT8.js +1 -0
  183. package/dist/client/assets/{use-decopilot-events-Hca5p5mu.js → use-decopilot-events-CvJ5QuPg.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-BA2vzFXU.js → use-delete-connection-BYjHzqqG.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-DmRm5A9N.js → use-deployment-admin-CT92EahJ.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-giwXdJFa.js → use-file-configs-3Uf1EEcc.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-BOm4DukJ.js → use-infinite-scroll-AOUN3CPT.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-DamNnIat.js → use-join-requests-e475sqGw.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-BggNWMN0.js → use-mcp-auth-status-CAkd4rc7.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-Cav0AiKw.js → use-mcp-client-BAxUImLq.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-BvTay4jb.js → use-mcp-tools-B4eBN42P.js} +1 -1
  192. package/dist/client/assets/{use-members-1alkNMLr.js → use-members-CeV_DCBs.js} +1 -1
  193. package/dist/client/assets/{use-mobile-DxvpAkbd.js → use-mobile-CP8WVgC_.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-DWHbwpLC.js → use-navigate-to-agent-DlWN4wRt.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-HGMDWZ37.js → use-org-auth-client-CRpx9rm3.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-elnfvOdJ.js → use-org-sso-DzwCD9iO.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Dlno3YRH.js → use-organization-roles-DG5uo6GW.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-C8aPcOm4.js → use-organization-settings-Cf8P9suD.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BJ4Y5FI-.js → use-registry-connections-DNDwHCwV.js} +1 -1
  200. package/dist/client/assets/{use-secrets-5yqKG0Fz.js → use-secrets-BLupskDm.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-BkECfwLj.js → use-status-sounds-CEZanElm.js} +1 -1
  202. package/dist/client/assets/{use-tags-DhH7fJ9n.js → use-tags-BTuO09cc.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-QVi8YiL9.js → use-view-mode-CfIlJShN.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-DzUwFLTQ.js → use-virtual-mcp-Bo1jQyKL.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-DqqVvrJC.js +1 -0
  206. package/dist/client/assets/{useQueries-CHVnUdBY.js → useQueries-BTlMxElZ.js} +1 -1
  207. package/dist/client/assets/{useRouterState-CJgrSpoY.js → useRouterState-DWJuYUgm.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-DnbYqVs7.js +1 -0
  209. package/dist/client/assets/{users-BHNa2I19.js → users-BTyK8-ey.js} +1 -1
  210. package/dist/client/assets/variant-calendar-z9rvrTbS.js +1 -0
  211. package/dist/client/assets/{view-mode-toggle-CeRa3z7B.js → view-mode-toggle-CR-SHm8O.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/client/native-boot.js +20 -0
  214. package/dist/server/cli.js +93 -94
  215. package/dist/server/server.js +75 -75
  216. package/package.json +2 -2
  217. package/dist/client/assets/ai-providers-CmDhk4US.js +0 -1
  218. package/dist/client/assets/app-editor-Chpkqa2F.js +0 -1
  219. package/dist/client/assets/auth-entry-BFtkZTwu.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-C5e6mdWG.js +0 -1
  221. package/dist/client/assets/category-editor-BB1Wibnh.js +0 -1
  222. package/dist/client/assets/chat-context-DoK0lfG3.js +0 -36
  223. package/dist/client/assets/connect-B_S04Bfy.js +0 -8
  224. package/dist/client/assets/connect-desktop-dialog-BUp1haXa.js +0 -1
  225. package/dist/client/assets/connection-detail-DP-88uz5.js +0 -1
  226. package/dist/client/assets/connections-PwhMV6Az.js +0 -1
  227. package/dist/client/assets/file-explorer-DOrJ6I00.js +0 -2
  228. package/dist/client/assets/index-CIJ4b6SD.js +0 -8
  229. package/dist/client/assets/index-CaPJLPSU.js +0 -1
  230. package/dist/client/assets/index-DSghpBCP.css +0 -1
  231. package/dist/client/assets/mcp-oauth-C159CTqw.js +0 -1
  232. package/dist/client/assets/post-editor-BOGVp1SK.js +0 -1
  233. package/dist/client/assets/project-app-view-DGcbWl7X.js +0 -1
  234. package/dist/client/assets/record-editor-BKkPOez0.js +0 -1
  235. package/dist/client/assets/redirect-editor-n2iW7SHJ.js +0 -1
  236. package/dist/client/assets/registry-CfztJypZ.js +0 -2
  237. package/dist/client/assets/select-model-C_5UqaCI.js +0 -4
  238. package/dist/client/assets/seo-editor-CbwzBxXD.js +0 -1
  239. package/dist/client/assets/store-registry-DscNaxt3.js +0 -2
  240. package/dist/client/assets/use-api-keys-CSaFJXfD.js +0 -1
  241. package/dist/client/assets/use-deco-credits-CWhdUeI9.js +0 -1
  242. package/dist/client/assets/useInfiniteQuery-cI69eqxa.js +0 -1
  243. package/dist/client/assets/useSuspenseInfiniteQuery-DXLjl_Ue.js +0 -1
  244. package/dist/client/assets/variant-calendar-Dx1J5lqR.js +0 -1
@@ -1 +0,0 @@
1
- import{X as be,a4 as $e,b0 as De,Y as me,a2 as Oe,c as R,b as H,j as t,k as ve,B,r as Z,m as Ne,F as te,x as Me,K as ae,d as se,av as ue,D as ze,E as Ee,f as Ue,b1 as Re,o as Ve,_ as Fe,Z as Le,t as J}from"./index-sd38S2ER.js";import{g as Be}from"./extract-connection-data-ZTR7xcCD.js";import{E as Se}from"./empty-state-BZSpYvM0.js";import{E as He,c as Xe,r as qe,b as Ge,d as Ke}from"./connection-form-helpers-C2rTDrzA.js";import{c as Qe,S as We,V as Ye}from"./index-CVc4ITjm.js";import{u as ye,T as Je}from"./use-mcp-auth-status-BggNWMN0.js";import{u as Ze}from"./use-members-1alkNMLr.js";import{A as et}from"./avatar-2NkvJFhn.js";import{a as Ce,b as _e,u as tt}from"./use-connection-DtVPu3zH.js";import{u as we}from"./use-mcp-client-Cav0AiKw.js";import{a as st}from"./use-mcp-tools-BvTay4jb.js";import{c as nt,C as it,a as ot,d as at}from"./AreaChart-BMJ7Mtx-.js";import{i as lt,a as rt}from"./mcp-oauth-C159CTqw.js";import{I as le}from"./integration-icon-D-DwNzR1.js";import{s as ct}from"./Plus-CSNWQMMp.js";import{X as dt,a as mt,aL as ut,d as xt}from"./agent-icon-aWRSFV3S.js";import{a as ke,s as pt}from"./Settings02-DWHb-lRw.js";import{s as ce}from"./Trash01-BecpyKSB.js";import{q as ft,p as ht,o as gt,m as jt,n as bt}from"./sidebar-DTxjIJ56.js";import{F as G,b as K,c as Q,d as L,e as W,f as vt,a as Nt}from"./form-Da6Pak5q.js";import{I as Y}from"./input-Df5WqCIh.js";import{u as St,D as yt}from"./use-delete-connection-BA2vzFXU.js";import{c as Ct,B as _t,a as wt,C as kt}from"./monitoring-stats-row-C_ZvOQMg.js";import{u as It}from"./studio-tools-C9O5T6hk.js";import{a as Tt}from"./use-virtual-mcp-DzUwFLTQ.js";import{i as Ie}from"./ChevronRight-Bqyf0yi2.js";import{a as Te}from"./Users03-DgykpOrm.js";import{b as ne,c as At,T as ie,a as Pt}from"./tabs-Dg2fovl2.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-Dm2_KtgV.js";import{d as Dt}from"./Tool01-DluxhvbR.js";import{g as de,M as Ot}from"./index-luz2_Kqi.js";import{C as Mt}from"./collection-search-vT5mWioA.js";import{C as zt}from"./card-yJEtZ44f.js";import{B as Et}from"./badge-BkDtGQCF.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-BuPKJUY8.js";import{S as pe,a as fe,b as he,c as ge,d as q}from"./select-BaiNHGHX.js";import{i as Ft}from"./CheckCircle-DDuWLqUq.js";import{t as Lt}from"./ChevronDown-BWHEr7M7.js";import{a as Bt}from"./Tool02-5oU4U7Oz.js";import{s as oe}from"./Star01-qAZqSHYs.js";import{s as Ht}from"./XClose-BFk0sz9G.js";import{p as Xt,i as qt}from"./connection-C42PVCSd.js";import"./metadata-dUsYcpuu.js";import"./index-Bl2gwdpO.js";import"./Key01-AWbv_wld.js";import"./auth-ByPgJhb1.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./use-organization-settings-C8aPcOm4.js";import"./index-k6yNjC6u.js";import"./popover-BxXBf9EH.js";import"./tooltip-Bjx5IK0l.js";import"./Check-CWNssTV8.js";import"./SearchMd-BEvxAPyw.js";import"./use-mobile-DxvpAkbd.js";import"./use-create-virtual-mcp-CZZVOBEo.js";import"./use-navigate-to-agent-DWHbwpLC.js";import"./hooks-CiBCHAEU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-BZEDG_yV.js";import"./use-org-auth-client-HGMDWZ37.js";import"./User01-CAYZjCBh.js";import"./AlertCircle-CSQCPj_V.js";import"./ArrowUp-B6IlW6Qi.js";import"./XCircle-CfbsFoSm.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ChevronUp-ROaBb_s7.js";import"./DotsVertical-C-UD1H-W.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./FilterLines-B2iuWHYg.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./LayoutLeft-CGP9_srE.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./SearchLg-LtdaD4ZG.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Upload01-D6mhS0Il.js";import"./Users01-CJn3nv4f.js";import"./X-CalOG8rP.js";import"./Zap-BNdcgXgA.js";import"./label-q5RWAz3v.js";import"./alert-dialog-CI_jOgZR.js";const Gt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Kt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Gt}];function Qt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Yt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Qt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Jt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=It(),o=es(a),{data:r}=Me({queryKey:ae.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=Ct(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Jt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(nt,{config:ts,className:"h-16 w-full",children:t.jsxs(_t,{data:p,barCategoryGap:"4%",children:[t.jsx(it,{content:t.jsx(ot,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(wt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(kt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(rs,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=Tt(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.name}),t.jsx(Je,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=H();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let X;e[20]!==d?(X=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=X):X=e[21];let F;e[22]!==X?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[22]=X,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ne,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ne,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ne,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ne,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(At,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(ie,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(ie,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(ie,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(ie,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Pt,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=ze(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?Xt(e.connection_url):null;return d?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(K,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(He,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Y,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(vt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&qt(s.connection_headers)){const c=s.connection_headers,a=qe(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Ve(),d=_e(),{org:f}=te(),u=St({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=Ze(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=Qe(D,Kt),v=Fe({resolver:Le(Xe),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await rt({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){J.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const X=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(X.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();J.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...u}),t.jsx(ft,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(et,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(Nt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:x})=>t.jsxs(K,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(Y,{...x})}),t.jsx(W,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:x})=>t.jsxs(K,{children:[t.jsx(Q,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(Y,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(We,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(Ye,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Yt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),J.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=Be("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await lt({url:X.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ue(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=tt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=st(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=at(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Re(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ee,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function ji(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{ji as default};
@@ -1 +0,0 @@
1
- import{r as K,c as re,b as ae,j as t,B as G,k as ge,p as ce,m as xe,E as Je,F as De,d as Ne,u as Ye,a as ke,D as Ze,I as et,G as tt,_ as nt,Z as st,o as ot,t as Q,K as it}from"./index-sd38S2ER.js";import{a as Te,b as ct,g as rt,e as lt}from"./extract-connection-data-ZTR7xcCD.js";import{C as at}from"./collection-display-button-CBvgEV5M.js";import{S as dt}from"./search-input-C0Tu8jAx.js";import{C as ut}from"./collection-tabs-Cm8oTUd7.js";import{C as ve,u as mt,a as Ae,g as gt}from"./connection-card-CK8a5ay6.js";import{E as pt}from"./empty-state-BZSpYvM0.js";import{P as pe}from"./index-Bl2gwdpO.js";import{u as ft,D as ht}from"./use-delete-connection-BA2vzFXU.js";import{u as Ce}from"./use-capability-DbSBzq4m.js";import{u as xt}from"./use-infinite-scroll-BOm4DukJ.js";import{u as jt}from"./use-view-mode-QVi8YiL9.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as we,d as Ie,b as Pe,f as Le,g as Oe,e as Me,a as Fe,A as $e}from"./alert-dialog-CI_jOgZR.js";import{a as je}from"./Tool02-5oU4U7Oz.js";import{g as yt}from"./metadata-dUsYcpuu.js";import{b as Ue,h as Ve,a as ze,c as Ee,d as Be,e as Ke}from"./dialog-Dq_peVG0.js";import{D as St,a as Ct,c as vt,b as bt,e as _t,f as Dt,g as Nt}from"./drawer-BSvXGda-.js";import{u as kt}from"./use-mobile-DxvpAkbd.js";import{F as te,b as ne,c as se,d as oe,e as ie,a as be}from"./form-Da6Pak5q.js";import{I as de}from"./input-Df5WqCIh.js";import{S as Tt,a as At,b as wt,c as It,d as me}from"./select-BaiNHGHX.js";import{T as Pt}from"./textarea-B-mbIfJP.js";import{b as He,u as Lt}from"./use-connection-DtVPu3zH.js";import{a as Ot}from"./use-virtual-mcp-DzUwFLTQ.js";import{u as Mt}from"./studio-tools-C9O5T6hk.js";import{s as Se}from"./Star01-qAZqSHYs.js";import{s as Re}from"./Plus-CSNWQMMp.js";import{aK as Ft,a as $t,X as Ut,d as Vt}from"./agent-icon-aWRSFV3S.js";import{s as We}from"./XClose-BFk0sz9G.js";import{i as fe,a as _e,E as zt,c as Et,p as Bt,b as Kt,d as Ht}from"./connection-form-helpers-C2rTDrzA.js";import{a as Rt}from"./authenticate-and-persist-oauth-BjOG3bpy.js";import{I as Wt}from"./integration-icon-D-DwNzR1.js";import{C as Xe}from"./checkbox-5E1V-xvi.js";import{a as ue,D as Xt,c as Gt,b as qt}from"./dropdown-menu-BuPKJUY8.js";import{a as Qt}from"./DotsVertical-C-UD1H-W.js";import{s as Ge}from"./Eye-BZEDG_yV.js";import{s as qe}from"./Trash01-BecpyKSB.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./ArrowUp-B6IlW6Qi.js";import"./Check-CWNssTV8.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./tooltip-Bjx5IK0l.js";import"./view-mode-toggle-CeRa3z7B.js";import"./badge-BkDtGQCF.js";import"./SearchMd-BEvxAPyw.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./use-organization-settings-C8aPcOm4.js";import"./useInfiniteQuery-cI69eqxa.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-yJEtZ44f.js";import"./sidebar-DTxjIJ56.js";import"./LayoutLeft-CGP9_srE.js";import"./X-CalOG8rP.js";import"./label-q5RWAz3v.js";import"./ChevronDown-BWHEr7M7.js";import"./ChevronUp-ROaBb_s7.js";import"./AlertCircle-CSQCPj_V.js";import"./Tool01-DluxhvbR.js";import"./Settings02-DWHb-lRw.js";import"./XCircle-CfbsFoSm.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./CheckCircle-DDuWLqUq.js";import"./ChevronRight-Bqyf0yi2.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./FilterLines-B2iuWHYg.js";import"./Palette-BStHvqZ6.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./SearchLg-LtdaD4ZG.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./Zap-BNdcgXgA.js";import"./mcp-oauth-C159CTqw.js";function Jt(s){const e=`deco-filters-${s}`,[n,g]=K.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{g(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Yt(s){const e=re.c(7),[n,g]=K.useState(s),[l,c]=K.useState(s?"desc":null);let o;e[0]!==l||e[1]!==n?(o=a=>{n!==a?(g(a),c("asc")):l==="asc"?c("desc"):l==="desc"&&(g(void 0),c(null))},e[0]=l,e[1]=n,e[2]=o):o=e[2];const r=o;let d;return e[3]!==r||e[4]!==l||e[5]!==n?(d={sortKey:n,sortDirection:l,handleSort:r},e[3]=r,e[4]=l,e[5]=n,e[6]=d):d=e[6],d}function Zt(s){const e=re.c(20),{namespace:n,resource:g,defaultSortKey:l,defaultViewMode:c}=s,o=l===void 0?"title":l,r=c===void 0?"table":c,[d,a]=K.useState(""),N=K.useDeferredValue(d),h=`${n}-${g}`,[p,v]=Jt(h),x=`studio-${g}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[m,S]=K.useState(_);let j;e[2]!==x?(j=U=>{S(U),globalThis.localStorage?.setItem(x,String(U))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==m||e[5]!==D?(b=()=>{D(!m)},e[4]=m,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=jt(`studio-${g}-${n}`,r),{sortKey:L,sortDirection:$,handleSort:A}=Yt(o),V=L;let O;return e[7]!==m||e[8]!==p||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==$||e[16]!==V||e[17]!==k||e[18]!==i?(O={search:d,searchTerm:N,setSearch:a,filters:p,setFilters:v,filterBarVisible:m,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:V,sortDirection:$,handleSort:A},e[7]=m,e[8]=p,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=$,e[16]=V,e[17]=k,e[18]=i,e[19]=O):O=e[19],O}function en(s){const e=re.c(35),{open:n,onOpenChange:g,count:l,onConfirm:c}=s,o=ae(),r=l!==1?"s":"";let d;e[0]!==l||e[1]!==o||e[2]!==r?(d=o("orgs.bulkDeleteDialog.deleteTitle",{count:l,plural:r}),e[0]=l,e[1]=o,e[2]=r,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(we,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=l!==1?"s":"";let h;e[6]!==o||e[7]!==N?(h=o("orgs.bulkDeleteDialog.deleteDescription",{plural:N}),e[6]=o,e[7]=N,e[8]=h):h=e[8];let p;e[9]!==h?(p=t.jsx(Ie,{children:h}),e[9]=h,e[10]=p):p=e[10];let v;e[11]!==a||e[12]!==p?(v=t.jsxs(Pe,{children:[a,p]}),e[11]=a,e[12]=p,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Le,{children:x}),e[16]=x,e[17]=_):_=e[17];const m=l!==1?"s":"";let S;e[18]!==l||e[19]!==o||e[20]!==m?(S=o("orgs.bulkDeleteDialog.deleteButton",{count:l,plural:m}),e[18]=l,e[19]=o,e[20]=m,e[21]=S):S=e[21];let j;e[22]!==c||e[23]!==S?(j=t.jsx(Oe,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:S}),e[22]=c,e[23]=S,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Me,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs(Fe,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==g||e[32]!==n||e[33]!==b?(k=t.jsx($e,{open:n,onOpenChange:g,children:b}),e[31]=g,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function tn(s){return s._registryId?.includes("community-registry")===!0}function nn(s){const e=re.c(83),{item:n,canManage:g,allConnections:l,connectedAppNames:c,connectingItemId:o,onNavigateConnected:r,onConnect:d}=s,a=ae(),[N,h]=K.useState(!1),[p,v]=K.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Te(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const m=_;let S;e[4]!==n._meta?(S=yt(n._meta),e[4]=n._meta,e[5]=S):S=e[5];const j=S,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||ct(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==l||e[10]!==x){let E;e[12]!==x?(E=le=>le.connection_type!=="VIRTUAL"&&le.app_name===x,e[12]=x,e[13]=E):E=e[13],T=l.filter(E),e[9]=l,e[10]=x,e[11]=T}else T=e[11];const L=T;let $;e[14]!==n?($=tn(n),e[14]=n,e[15]=$):$=e[15];const A=$;let V,O;e[16]!==L||e[17]!==g||e[18]!==A||e[19]!==m||e[20]!==n||e[21]!==d||e[22]!==r?(V=()=>{if(m){const E=L[0];E&&r(E);return}g&&O()},O=()=>{A?(v("connect"),h(!0)):d(n)},e[16]=L,e[17]=g,e[18]=A,e[19]=m,e[20]=n,e[21]=d,e[22]=r,e[23]=V,e[24]=O):(V=e[23],O=e[24]);let U;e[25]!==n||e[26]!==d||e[27]!==p?(U=()=>{ce("connections_community_warning_confirmed",{registry_item_id:n.id}),h(!1),p==="connect"&&d(n),v(null)},e[25]=n,e[26]=d,e[27]=p,e[28]=U):U=e[28];const B=U;let I;e[29]!==b||e[30]!==i||e[31]!==D?(I={title:D,description:b,icon:i},e[29]=b,e[30]=i,e[31]=D,e[32]=I):I=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(je,{}),e[33]=q):q=e[33];let J;e[34]!==A||e[35]!==n._sourceIcon?(J=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[34]=A,e[35]=n._sourceIcon,e[36]=J):J=e[36];let y;e[37]!==g||e[38]!==o||e[39]!==O||e[40]!==m||e[41]!==n.id||e[42]!==a?(y=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):g&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:E=>{E.stopPropagation(),O()},children:o===n.id?t.jsx(ge,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[37]=g,e[38]=o,e[39]=O,e[40]=m,e[41]=n.id,e[42]=a,e[43]=y):y=e[43];let w;e[44]!==y||e[45]!==J?(w=t.jsxs("div",{className:"flex items-center gap-2",children:[J,y]}),e[44]=y,e[45]=J,e[46]=w):w=e[46];let z;e[47]!==V||e[48]!==w||e[49]!==I?(z=t.jsx(ve,{connection:I,fallbackIcon:q,onClick:V,headerActionsAlwaysVisible:!0,headerActions:w}),e[47]=V,e[48]=w,e[49]=I,e[50]=z):z=e[50];let R;e[51]!==a?(R=a("orgs.catalogItemCard.communityMcpServerTitle"),e[51]=a,e[52]=R):R=e[52];let H;e[53]!==R?(H=t.jsx(we,{children:R}),e[53]=R,e[54]=H):H=e[54];let C;e[55]!==a?(C=a("orgs.catalogItemCard.communityMcpServerDescription"),e[55]=a,e[56]=C):C=e[56];let M;e[57]!==C?(M=t.jsx(Ie,{children:C}),e[57]=C,e[58]=M):M=e[58];let P;e[59]!==H||e[60]!==M?(P=t.jsxs(Pe,{children:[H,M]}),e[59]=H,e[60]=M,e[61]=P):P=e[61];let Y;e[62]!==a?(Y=a("orgs.catalogItemCard.cancel"),e[62]=a,e[63]=Y):Y=e[63];let ee;e[64]!==Y?(ee=t.jsx(Le,{children:Y}),e[64]=Y,e[65]=ee):ee=e[65];let Z;e[66]!==a?(Z=a("orgs.catalogItemCard.continue"),e[66]=a,e[67]=Z):Z=e[67];let u;e[68]!==B||e[69]!==Z?(u=t.jsx(Oe,{onClick:B,children:Z}),e[68]=B,e[69]=Z,e[70]=u):u=e[70];let f;e[71]!==ee||e[72]!==u?(f=t.jsxs(Me,{children:[ee,u]}),e[71]=ee,e[72]=u,e[73]=f):f=e[73];let F;e[74]!==P||e[75]!==f?(F=t.jsxs(Fe,{children:[P,f]}),e[74]=P,e[75]=f,e[76]=F):F=e[76];let W;e[77]!==N||e[78]!==F?(W=t.jsx($e,{open:N,onOpenChange:h,children:F}),e[77]=N,e[78]=F,e[79]=W):W=e[79];let X;return e[80]!==z||e[81]!==W?(X=t.jsxs(t.Fragment,{children:[z,W]}),e[80]=z,e[81]=W,e[82]=X):X=e[82],X}function Qe(s){const e=re.c(8),{selectionMode:n,children:g}=s,l=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==l?(c=xe("overflow-hidden transition-all duration-150 ease-out",l),e[0]=l,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Xt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:on,children:t.jsx(Qt,{size:20})})}),e[2]=o):o=e[2];let r;e[3]!==g?(r=t.jsxs(Gt,{children:[o,t.jsx(qt,{align:"end",onClick:sn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==c||e[6]!==r?(d=t.jsx("div",{className:c,children:r}),e[5]=c,e[6]=r,e[7]=d):d=e[7],d}function sn(s){return s.stopPropagation()}function on(s){return s.stopPropagation()}function cn(s){const e=re.c(56),{group:n,onOpen:g,selectionMode:l,selectedIds:c,onToggleSelect:o}=s,r=ae();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=q=>c.has(q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=q=>c.has(q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const h=N;let p;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(p=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=p):p=e[14];const v=p,x=n.title,_=n.icon;let m;e[15]!==n.connections.length||e[16]!==r?(m=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=m):m=e[17];let S;e[18]!==n.icon||e[19]!==n.title||e[20]!==m?(S={title:x,icon:_,description:m},e[18]=n.icon,e[19]=n.title,e[20]=m,e[21]=S):S=e[21];let j;e[22]!==g||e[23]!==l||e[24]!==v?(j=()=>l?v():g(),e[22]=g,e[23]=l,e[24]=v,e[25]=j):j=e[25];const D=l&&a&&"ring-2 ring-primary",b=l&&h&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=xe(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];let i;e[29]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(je,{}),e[29]=i):i=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==l||e[33]!==h||e[34]!==r||e[35]!==v?(T=l?t.jsx(Xe,{checked:a?!0:h?"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:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=l,e[33]=h,e[34]=r,e[35]=v,e[36]=T):T=e[36];let L;e[37]!==g?(L=I=>{I.stopPropagation(),g()},e[37]=g,e[38]=L):L=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ge,{size:16}),e[39]=$):$=e[39];let A;e[40]!==r?(A=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=A):A=e[41];let V;e[42]!==L||e[43]!==A?(V=t.jsxs(ue,{onClick:L,children:[$,A]}),e[42]=L,e[43]=A,e[44]=V):V=e[44];let O;e[45]!==l||e[46]!==V?(O=t.jsx(Qe,{selectionMode:l,children:V}),e[45]=l,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==T||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[T,O]}),e[48]=T,e[49]=O,e[50]=U):U=e[50];let B;return e[51]!==k||e[52]!==U||e[53]!==S||e[54]!==j?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:S,onClick:j,className:k,fallbackIcon:i,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=k,e[52]=U,e[53]=S,e[54]=j,e[55]=B):B=e[55],B}function rn(s){const e=re.c(36),{connection:n,isSelected:g,selectionMode:l,canManage:c,canManageAgents:o,onToggleSelect:r,onOpen:d,onToggleStatus:a,onDelete:N}=s,h=ae();let p;e[0]!==g||e[1]!==r||e[2]!==l||e[3]!==h?(p=l?t.jsx(Xe,{checked:g,onCheckedChange:r,onClick:ln}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:h("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=l,e[3]=h,e[4]=p):p=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ge,{size:16}),e[7]=x):x=e[7];let _;e[8]!==h?(_=h("orgs.connectionSelectionUi.open"),e[8]=h,e[9]=_):_=e[9];let m;e[10]!==v||e[11]!==_?(m=t.jsxs(ue,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=m):m=e[12];let S;e[13]!==c||e[14]!==o||e[15]!==r||e[16]!==h?(S=(c||o)&&t.jsxs(ue,{onClick:i=>{i.stopPropagation(),r()},children:[t.jsx(Ft,{size:16}),h("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=r,e[16]=h,e[17]=S):S=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==h?(j=c&&(n.status==="active"?t.jsxs(ue,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx($t,{size:16}),h("orgs.connectionSelectionUi.disable")]}):t.jsxs(ue,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Ut,{size:16}),h("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=h,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==h?(D=c&&t.jsxs(ue,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(qe,{size:16}),h("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=h,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==m||e[29]!==S||e[30]!==j||e[31]!==D?(b=t.jsxs(Qe,{selectionMode:l,children:[m,S,j,D]}),e[27]=l,e[28]=m,e[29]=S,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==p||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[p,b]}),e[33]=p,e[34]=b,e[35]=k):k=e[35],k}function ln(s){return s.stopPropagation()}function an(s){const e=re.c(29),{count:n,total:g,canManage:l,canManageAgents:c,onSelectAll:o,onDeselectAll:r,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:h}=s,p=ae();if(n===0)return null;let v;e[0]!==n||e[1]!==p?(v=p("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=p,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==p||e[9]!==g?(_=n<g?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:p("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:p("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=o,e[8]=p,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==c||e[12]!==a||e[13]!==p?(m=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Re,{size:13}),p("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=p,e[14]=m):m=e[14];let S;e[15]!==l||e[16]!==d||e[17]!==N||e[18]!==p?(S=l&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:p("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:p("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(qe,{size:13}),p("orgs.connectionSelectionUi.delete")]})]}),e[15]=l,e[16]=d,e[17]=N,e[18]=p,e[19]=S):S=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(We,{size:13}),e[20]=j):j=e[20];let D;e[21]!==h?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:j}),e[21]=h,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==m||e[26]!==S||e[27]!==D?(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:[x,_,m,S,D]})}),e[23]=x,e[24]=_,e[25]=m,e[26]=S,e[27]=D,e[28]=b):b=e[28],b}function dn(s){const e=re.c(45),{open:n,onOpenChange:g,agents:l,onConfirm:c}=s,o=ae(),[r,d]=K.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ue,{children:a}),e[2]=a,e[3]=N):N=e[3];let h;e[4]!==o?(h=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=h):h=e[5];let p;e[6]!==h?(p=t.jsx(Ve,{children:h}),e[6]=h,e[7]=p):p=e[7];let v;e[8]!==N||e[9]!==p?(v=t.jsxs(ze,{children:[N,p]}),e[8]=N,e[9]=p,e[10]=v):v=e[10];let x;e[11]!==l||e[12]!==r||e[13]!==o?(x=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):l.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:xe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Wt,{icon:A.icon,name:A.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:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=l,e[12]=r,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let m;e[17]!==g?(m=()=>g(!1),e[17]=g,e[18]=m):m=e[18];let S;e[19]!==o?(S=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=S):S=e[20];let j;e[21]!==m||e[22]!==S?(j=t.jsx(G,{variant:"outline",onClick:m,children:S}),e[21]=m,e[22]=S,e[23]=j):j=e[23];const D=!r;let b;e[24]!==c||e[25]!==g||e[26]!==r?(b=()=>{r&&(c(r),g(!1),d(null))},e[24]=c,e[25]=g,e[26]=r,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Ee,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let $;return e[41]!==g||e[42]!==n||e[43]!==L?($=t.jsx(Ke,{open:n,onOpenChange:g,children:L}),e[41]=g,e[42]=n,e[43]=L,e[44]=$):$=e[44],$}function un({listState:s,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:l,enabledRegistries:c}){const o=ae(),{org:r}=De(),d=ot(),a=Ne(),{data:N}=ke.useSession(),h=He(),p=Lt(s),v=ft(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[m,S]=K.useState(new Set),j=m.size>0,[D,b]=K.useState(!1),[k,i]=K.useState(!1),[T,L]=K.useState(null),$=Ot(),A=p.filter(u=>!(n!=="ALL"&&u.connection_type!==n||g!=="ALL"&&u.status!==g)),V=gt(A),O=u=>{S(f=>{const F=new Set(f);return F.has(u)?F.delete(u):F.add(u),F})},U=()=>{S(new Set)},B=Ae(c,s.searchTerm),I=B.items,q=xt(B.loadMore,B.hasMore,B.isLoadingMore),J=new Set(p.filter(u=>u.app_name).map(u=>u.app_name)),y=l==="ALL"||c.some(u=>u.id===l)?l:"ALL",w=s.search.length>0,z=e==="all"||w?I.filter(u=>{if(y!=="ALL"&&u._registryId!==y)return!1;if(w){const f=Te(u);if(f&&J.has(f))return!1}return!0}):[],R=e==="connected"||w?V:[],H=async u=>{if(!(!r||!N?.user?.id)){ce("connection_add_clicked",{action:"connect_new",registry_item_id:u.id,source:"connections_page"}),L(u.id);try{const f=lt(u,r.id,N.user.id,{remoteIndex:0}),F=f.connection_type==="STDIO",W=!!f.connection_url,X=F&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!W&&!X){Q.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:E}=await h.create.mutateAsync(f),le=await Rt({connectionId:E,orgId:r.id,orgSlug:r.slug,persistFallback:ye=>h.update.mutateAsync({id:E,data:{connection_token:ye}}).then(()=>{})});if(le.ran&&!le.ok){ce("connection_oauth_failed",{connection_id:E,flow:"connections_page_connect",error:le.error??"no_token"}),Q.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ce("connection_oauth_succeeded",{connection_id:E,flow:"connections_page_connect"});const ye=new URL(`/api/${r.slug}/mcp/${E}`,window.location.origin);await d.invalidateQueries({queryKey:it.isMCPAuthenticated(ye.href,null)}),M(),Q.success(o("orgs.connections.authenticationSuccessful"))}Q.success(o("orgs.connections.connectedSuccessfully"))}catch(f){Q.error(o("orgs.connections.failedToConnect",{error:f instanceof Error?f.message:String(f)}))}finally{L(null)}}},C=Mt(),M=()=>{d.invalidateQueries({predicate:u=>{const f=u.queryKey;return f[1]===r.id&&f[3]==="collection"&&f[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const u=[...m];ce("connections_bulk_delete",{count:u.length});let f=0;for(const F of u)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:F,force:!0}),f++}catch{}M(),Q.success(o("orgs.connections.deletedConnections",{count:f})),U()},Y=async(u,f)=>{try{await h.update.mutateAsync({id:u,data:{status:f}}),M(),Q.success(o(f==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Q.error(o("orgs.connections.failedToUpdateConnection"))}},ee=async u=>{const f=[...m];ce("connections_bulk_status_toggled",{count:f.length,to_status:u});let F=0;for(const W of f)try{await h.update.mutateAsync({id:W,data:{status:u}}),F++}catch{}M(),Q.success(u==="active"?o("orgs.connections.enabledConnections",{count:F}):o("orgs.connections.disabledConnections",{count:F})),U()},Z=async u=>{const f=$.find(X=>X.id===u);if(!f)return;ce("connections_bulk_add_to_agent",{agent_id:u,count:m.size});const F=new Set(f.connections.map(X=>X.connection_id)),W=[...m].filter(X=>!F.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Q.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:u,data:{connections:[...f.connections,...W]}}),d.invalidateQueries({predicate:X=>{const E=X.queryKey;return E[1]===r.id&&E[3]==="collection"&&E[4]==="VIRTUAL_MCP"}}),Q.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:f.title})),U()}catch{Q.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...v}),t.jsx(en,{open:D,onOpenChange:b,count:m.size,onConfirm:P}),t.jsx(dn,{open:k,onOpenChange:i,agents:$,onConfirm:Z}),B.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(pt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(u=>{if(u.type==="group")return t.jsx(cn,{group:u,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:u.key}})},selectionMode:j,selectedIds:m,onToggleSelect:O},u.key);const f=u.connection,F=m.has(f.id);return t.jsx(ve,{connection:f,fallbackIcon:t.jsx(je,{}),onClick:()=>j?O(f.id):a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),className:xe(F&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:f,isSelected:F,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>O(f.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),onToggleStatus:W=>Y(f.id,W),onDelete:()=>v.requestDelete(f)})},f.id)}),z.map(u=>t.jsx(nn,{item:u,canManage:x,allConnections:p,connectedAppNames:J,connectingItemId:T,onNavigateConnected:f=>a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),onConnect:H},`catalog-${u._registryId}:${u.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:q,className:"col-span-full h-4"}),(e==="all"||w)&&B.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(an,{count:m.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{S(new Set(A.map(u=>u.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:ee,onCancel:U})]})}function mn(){const s=ae(),{org:e}=De(),n=Ne(),g=Ye({strict:!1}),{data:l}=ke.useSession(),{stdioEnabled:c}=Ze(),o=kt(),{granted:r}=Ce("connections:manage"),d=Zt({namespace:e.slug,resource:"connections"}),a=He(),[N,h]=et(tt.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[p,v]=K.useState("ALL"),[x,_]=K.useState("ALL"),[m,S]=K.useState("ALL"),j=mt(),b=Ae(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=nt({resolver:st(Et),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),$=i.watch("npx_package"),A=fe({uiType:T,connectionUrl:L??"",npxPackage:$??""})??_e({uiType:T,connectionUrl:L??"",registryItems:b}),V=r&&g.action==="create",O=()=>{ce("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},U=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},B=async y=>{let w,z=null,R=null,H=null;y.ui_type==="NPX"?(w="STDIO",z="",H=Kt(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?(w="STDIO",z="",H=Ht(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):(w=y.ui_type,z=y.connection_url||"",R=y.connection_token||null);const C=rt("conn");ce("connection_custom_created",{connection_type:w,ui_type:y.ui_type}),await a.create.mutateAsync({id:C,title:y.title,description:y.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),U(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:he({app_name:null,connection_url:z,title:y.title,id:C})}})},I=y=>{y||(V&&U(),i.reset())},q=y=>{const w=y.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Y=i.getValues("env_vars")??[],ee=new Set(Y.map(u=>u.key)),Z=P.envVarKeys.filter(u=>!ee.has(u));Z.length>0&&i.setValue("env_vars",[...Y,...Z.map(u=>({key:u,value:""}))],{shouldDirty:!0})}},M=Bt(w);if(M&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",M.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(fe({uiType:"NPX",npxPackage:M.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(fe({uiType:P,connectionUrl:w})??_e({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(fe({uiType:"NPX",npxPackage:w}))},J=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:O,children:[t.jsx(Re,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const y=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(te,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.type")}),t.jsxs(Tt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(oe,{children:t.jsx(At,{children:t.jsx(wt,{})})}),t.jsxs(It,{children:[t.jsx(me,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(me,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(me,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(me,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(me,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Vt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ie,{})]})}),T==="NPX"&&t.jsx(te,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.npmPackage")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:M=>{const P=M.clipboardData.getData("text");P&&(M.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),q(P))},onBlur:M=>{q(M.target.value),C.onBlur()}})}),t.jsx(ie,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(te,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.command")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.arguments")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(ie,{})]})})]}),t.jsx(te,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.workingDirectory")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ie,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(te,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.environmentVariables")}),t.jsx(oe,{children:t.jsx(zt,{value:C.value??[],onChange:C.onChange})}),t.jsx(ie,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(te,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.url")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:M=>{const P=M.clipboardData.getData("text");P&&(M.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),q(P))},onBlur:M=>{q(M.target.value),C.onBlur()}})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(oe,{children:t.jsx(de,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(ie,{})]})})]}),t.jsx(te,{control:i.control,name:"title",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.name")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"description",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.description")}),t.jsx(oe,{children:t.jsx(Pt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(ie,{})]})})]}),H=V;return o?t.jsx(St,{open:H,onOpenChange:I,children:t.jsxs(Ct,{className:"max-h-[90vh]",children:[t.jsx(vt,{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(bt,{children:y}),t.jsx(_t,{className:"mt-1",children:w})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(We,{size:16})})})]})}),t.jsx(be,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(B),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(Nt,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Ke,{open:H,onOpenChange:I,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(ze,{children:[t.jsx(Ue,{children:y}),t.jsx(Ve,{children:w})]}),t.jsx(be,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(B),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ee,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:s("orgs.connections.pageTitle")}),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(dt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(d.setSearch(""),y.target.blur())}}),t.jsx(at,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:p,onChange:y=>v(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:y=>_(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:m,onChange:y=>S(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(y=>({id:y.id,label:y.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):y.title}))]}]:[]]})]}),J]}),t.jsx(ut,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:y=>{const w=y;w!==N&&ce("connections_page_tab_changed",{to_tab:w}),h(w)}}),t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(un,{listState:d,activeTab:N,typeFilter:p,statusFilter:x,registryFilter:m,enabledRegistries:j})})})]})})})]})})}function Gs(){const s=re.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Je,{children:t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(mn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};
@@ -1,2 +0,0 @@
1
- import{c as se,b as Me,r as u,j as r,k as fe,B as De,d_ as Jt,az as Zt,aF as xe,d$ as en,e0 as tn,e1 as nn,e2 as rn,bI as on,e3 as sn,e4 as lt,aB as an,e5 as ln,e6 as cn,e7 as dn,e8 as un,e9 as fn,ea as pn,eb as mn,ec as xn,ed as hn,m as le,o as gn,t as ne,K as Ze}from"./index-sd38S2ER.js";import{F as bn,l as yn}from"./monaco-editor-Cxpp-hMU.js";import{F as vn,h as Cn,a$ as wn,b0 as Nn}from"./agent-icon-aWRSFV3S.js";import{s as jn}from"./XClose-BFk0sz9G.js";import{n as En}from"./automation-runs-BZROadaX.js";import{c as et,T as tt,a as nt}from"./tooltip-Bjx5IK0l.js";import{b as Sn}from"./chat-context-DoK0lfG3.js";import{u as Dn}from"./shell-layout-OumtAwy1.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as Fn,c as kn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as je,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-fII9c_kY.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-Dq_peVG0.js";import{I as ot}from"./input-Df5WqCIh.js";import{c as Wn,d as Qn,b as Xn,f as Yn,g as Jn,e as Zn,a as er,A as tr}from"./alert-dialog-CI_jOgZR.js";import{t as nr}from"./ChevronDown-BWHEr7M7.js";import{i as rr}from"./ChevronRight-Bqyf0yi2.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-CSQCPj_V.js";import"./Tool01-DluxhvbR.js";import"./ArrowUp-B6IlW6Qi.js";import"./Settings02-DWHb-lRw.js";import"./Tool02-5oU4U7Oz.js";import"./XCircle-CfbsFoSm.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./CheckCircle-DDuWLqUq.js";import"./Check-CWNssTV8.js";import"./ChevronUp-ROaBb_s7.js";import"./DotsVertical-C-UD1H-W.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./Eye-BZEDG_yV.js";import"./FilterLines-B2iuWHYg.js";import"./Star01-qAZqSHYs.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LayoutLeft-CGP9_srE.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./Plus-CSNWQMMp.js";import"./SearchLg-LtdaD4ZG.js";import"./SearchMd-BEvxAPyw.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Trash01-BecpyKSB.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./X-CalOG8rP.js";import"./Zap-BNdcgXgA.js";import"./select-BaiNHGHX.js";import"./useInfiniteQuery-cI69eqxa.js";import"./use-infinite-scroll-BOm4DukJ.js";import"./use-connection-DtVPu3zH.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./use-virtual-mcp-DzUwFLTQ.js";import"./card-yJEtZ44f.js";import"./sidebar-DTxjIJ56.js";import"./use-mobile-DxvpAkbd.js";import"./table-CW9azojk.js";import"./empty-state-BZSpYvM0.js";import"./use-members-1alkNMLr.js";import"./use-org-auth-client-HGMDWZ37.js";import"./use-clock-tick-9uLrrBUm.js";import"./use-automations-DAZgpS9S.js";import"./studio-tools-C9O5T6hk.js";import"./useSuspenseInfiniteQuery-DXLjl_Ue.js";import"./avatar-2NkvJFhn.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BmXjtpVk.js";import"./tab-id-D67TyC-3.js";import"./hooks-CiBCHAEU.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./index-luz2_Kqi.js";import"./calendar-Cd5zs7es.js";import"./integration-icon-D-DwNzR1.js";import"./use-navigate-to-agent-DWHbwpLC.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BMJ7Mtx-.js";import"./form-Da6Pak5q.js";import"./label-q5RWAz3v.js";import"./use-ai-providers-Dsmt_TQY.js";import"./use-decopilot-events-Hca5p5mu.js";import"./use-organization-settings-C8aPcOm4.js";import"./required-auth-layout-CIVjmrI-.js";import"./use-org-sso-elnfvOdJ.js";import"./drawer-BSvXGda-.js";import"./collection-search-vT5mWioA.js";import"./index-CIJ4b6SD.js";import"./get-initials-D-f_fDFw.js";import"./popover-BxXBf9EH.js";import"./dropdown-menu-BuPKJUY8.js";import"./github-repo-picker-BjY_cbDW.js";import"./use-debounced-value-BhoOs69E.js";import"./authenticate-and-persist-oauth-BjOG3bpy.js";import"./mcp-oauth-C159CTqw.js";import"./use-mcp-tools-BvTay4jb.js";import"./extract-connection-data-ZTR7xcCD.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-DhH7fJ9n.js";import"./command-Dq6iipS5.js";import"./index-k6yNjC6u.js";import"./companions-core-DBWG3_HY.js";import"./tabs-Dg2fovl2.js";import"./toggle-group-Bd_5HjJ1.js";import"./use-deco-credits-CWhdUeI9.js";import"./toolbar-BQhumIzA.js";import"./skeleton-Bqf4wcUq.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CK8a5ay6.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B-mbIfJP.js";import"./connection-form-helpers-C2rTDrzA.js";import"./collection-tabs-Cm8oTUd7.js";import"./badge-BkDtGQCF.js";import"./connect-desktop-dialog-BUp1haXa.js";import"./select-model-C_5UqaCI.js";import"./checkbox-5E1V-xvi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BzmRZGKV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkECfwLj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DbSBzq4m.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BggNWMN0.js";import"./use-debounced-autosave-CV9YJ4dj.js";import"./index-Bl2gwdpO.js";import"./search-input-C0Tu8jAx.js";import"./switch-DzR4USnH.js";import"./use-secrets-5yqKG0Fz.js";import"./useQueries-CHVnUdBY.js";import"./use-file-configs-giwXdJFa.js";import"./automation-list-row-xT8oiUOD.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,F]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&F(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const k=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>F(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==k||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:k,children:U}),e[67]=k,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let F;e[5]!==f?(F=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=F):F=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let k;e[15]!==F||e[16]!==q||e[17]!==y||e[18]!==b?(k=r.jsxs(Qn,{children:[F," ",q,y,b]}),e[15]=F,e[16]=q,e[17]=y,e[18]=b,e[19]=k):k=e[19];let A;e[20]!==k||e[21]!==g?(A=r.jsxs(Xn,{children:[g,k]}),e[20]=k,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Zn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(tr,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.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)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...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)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,Fr=pt,kr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.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(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.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(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.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 l;e[3]!==s?(l=le("notranslate 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]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Fr,{children:r.jsx(kr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("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]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.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 l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:F,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),k=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==k||e[10]!==l||e[11]!==y?(R=k?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=k,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==F||e[40]!==z?(B=r.jsx(ue,{onSelect:F,children:z}),e[39]=F,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(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 Ta({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,F]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[k,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),F(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 Nt(t){const n=we(t);F(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),F({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function Fe(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await Fe({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function Ft(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await Fe({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function kt(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Fe({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){kt();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),F({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await Ft(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),ke=k?.length??0,Ye=Fn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
2
- `)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{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(Cn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),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(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(Nn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(En,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=kn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>F(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&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:w("sandbox.fileExplorer.files")}),ke>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[ke,ke>=it?"+":""]})]}),k!==null&&k.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),k?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),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)})]}),y&&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:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(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:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.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:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),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:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(jn,{size:12})})]},t)})}),ae&&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()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(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:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.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&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{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&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{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:w("sandbox.fileExplorer.selectFileToEdit")})}),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:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{Ta as FileExplorer};