decocms 4.495.0 → 4.495.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 (367) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DCHlcSOh.js → ActiveShapeUtils-h1pqy1tf.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-9YsZUjmj.js → AlertCircle-CIcaLchq.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CeW2QCC3.js → AreaChart-CZ-42bmk.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-ZHARsvy9.js → ArrowLeft-DfXjYrQi.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D1danNae.js → ArrowUp-B8mx1ol5.js} +1 -1
  6. package/dist/client/assets/{BarChart-DdrNiWaE.js → BarChart-CEMnTLeo.js} +1 -1
  7. package/dist/client/assets/{Building02-ssxWkdBl.js → Building02-BPQ9fMgU.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-ClYHeQF6.js → CategoricalChart-M1P6vf9W.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DiKVJkkJ.js → CheckCircle-ChTvVqPO.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-Dkzqp5pp.js → ChevronSelectorVertical-zoEWZ9sC.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-wLOc_NTT.js → ChevronUp-DckC0O5o.js} +1 -1
  12. package/dist/client/assets/{Copy01-Cr5x9Tlu.js → Copy01-Corfj4_5.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DCL7xzU2.js → CreditCard01-DlMgd9ia.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DZE2ktIm.js → DotsVertical-uTiOtqeH.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-D4j8kFWO.js → ErrorBarContext-B19L0BAB.js} +1 -1
  16. package/dist/client/assets/{Globe04-DLL93yaf.js → Globe04-CL3-GeAh.js} +1 -1
  17. package/dist/client/assets/{Image01-Doh_epPd.js → Image01-gtPlqhVq.js} +1 -1
  18. package/dist/client/assets/{Key01-rqwReuZQ.js → Key01-BQnNEHGn.js} +1 -1
  19. package/dist/client/assets/{Link01-DiFWbMaR.js → Link01-BSAGxXho.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-DGQh_3WZ.js → LinkBroken01-t0qEt8Lb.js} +1 -1
  21. package/dist/client/assets/{Monitor01-Cp7iEwN0.js → Monitor01-BIhKjgAf.js} +1 -1
  22. package/dist/client/assets/{Play-C2hvYOyw.js → Play-Ba5tQ65L.js} +1 -1
  23. package/dist/client/assets/{Plus-v0YpByfM.js → Plus-4vFTW30B.js} +1 -1
  24. package/dist/client/assets/{SearchMd-Bendi2p8.js → SearchMd-DqzvTdT2.js} +1 -1
  25. package/dist/client/assets/{Sector-Clpc9eH-.js → Sector-CdUfaAFg.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-BG-1Jwuh.js → ShoppingBag01-C6V1h_2Z.js} +1 -1
  27. package/dist/client/assets/{Sun-CJr96mBh.js → Sun-DlWI3pkK.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Dv53_XOE.js → SwitchHorizontal01-DN4m9K18.js} +1 -1
  29. package/dist/client/assets/{Tool01-B-kpMrMZ.js → Tool01-BJxIe84T.js} +1 -1
  30. package/dist/client/assets/{Trash01-3M9m1iIs.js → Trash01-Dvqfc9le.js} +1 -1
  31. package/dist/client/assets/{Upload01-DBgIGKf8.js → Upload01-BxWCGLDw.js} +1 -1
  32. package/dist/client/assets/{User01-CT2R-iHD.js → User01-Dh_l7uq-.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BuJqx7Ns.js → UserSquare-B4EnRc3E.js} +1 -1
  34. package/dist/client/assets/{Users01-gQNjKybb.js → Users01-CIo5W1LA.js} +1 -1
  35. package/dist/client/assets/{XAxis-DBRxAeUY.js → XAxis-B_TwRkrI.js} +1 -1
  36. package/dist/client/assets/{XClose-Bpws6cjk.js → XClose-D59UZ-3l.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-CVwCO-_8.js → ZoomOut-BwebNTOr.js} +1 -1
  38. package/dist/client/assets/{access-gate-DlhD9I9N.js → access-gate-gXgyWrzR.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-CQiSl-Qe.js → add-connection-dialog-BWXm_ufM.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-Dlpy_544.js → agent-analytics-C-L1VtQz.js} +1 -1
  41. package/dist/client/assets/agent-app-DdLgacxL.js +1 -0
  42. package/dist/client/assets/{agent-assets-Ba_4hhfI.js → agent-assets-C7fUNq2M.js} +1 -1
  43. package/dist/client/assets/{agent-automation-DuF9ZiWS.js → agent-automation-Dpa5yDG5.js} +1 -1
  44. package/dist/client/assets/{agent-automations-BV2eTHQr.js → agent-automations-BP9tDs5d.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-C_fgxaTV.js → agent-connect-sources-DpyMUK1-.js} +1 -1
  46. package/dist/client/assets/agent-deck-BYEYsFu3.js +1 -0
  47. package/dist/client/assets/{agent-e2e-CgGLFkHe.js → agent-e2e-C-WfEm6u.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-CpXLJckI.js → agent-experiments-eTfavUjm.js} +1 -1
  49. package/dist/client/assets/{agent-file-Cak5KHUl.js → agent-file-DQ-Axvcs.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-2pI_IIlr.js → agent-hosting-DnmQYnCT.js} +1 -1
  51. package/dist/client/assets/{agent-icon-BTsTGfvr.js → agent-icon-B6BGlN8Z.js} +1 -1
  52. package/dist/client/assets/agent-library-587LhhOs.js +1 -0
  53. package/dist/client/assets/agent-library-file-DYqQlnsg.js +1 -0
  54. package/dist/client/assets/{agent-monitor-BRq8qrkU.js → agent-monitor-DVgP3QNe.js} +1 -1
  55. package/dist/client/assets/{agent-overview-UU6Y44eX.js → agent-overview-d4b3y6_i.js} +1 -1
  56. package/dist/client/assets/agent-settings-Df-14Bch.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-LLur_-_o.js → agent-site-editor-BwrjcFt1.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-BS_mQuFD.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-DXvV_eiy.js → agent-site-editor-content-2sl9AU9q.js} +3 -3
  60. package/dist/client/assets/{agent-site-editor-preview-5ii-TR0s.js → agent-site-editor-preview-CXCXzBai.js} +3 -3
  61. package/dist/client/assets/agent-view-BhxMS98G.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-CyNRuQw7.js → agent-view-guard-CGvorA84.js} +1 -1
  63. package/dist/client/assets/{agents-list-BVqV3SYd.js → agents-list-DoqG_xIw.js} +1 -1
  64. package/dist/client/assets/{ai-providers-jNZBkRl5.js → ai-providers-D4PaL9-3.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-Dr31Gqkz.js → alert-dialog-G7y5OQF6.js} +1 -1
  66. package/dist/client/assets/{alert-B2FW115A.js → alert-sNWraY0q.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-DOFncpfM.js → analytics-sections-BjxK3DaP.js} +1 -1
  68. package/dist/client/assets/{api-keys-DPKcfTUa.js → api-keys-DWxZSE3m.js} +1 -1
  69. package/dist/client/assets/api-keys-Dd4XvmOL.js +1 -0
  70. package/dist/client/assets/app-editor-D525MffA.js +1 -0
  71. package/dist/client/assets/{asset-utils-CX1te1rQ.js → asset-utils-C3b9KJ52.js} +1 -1
  72. package/dist/client/assets/{auth-CM-DdMTE.js → auth-CK5qaIjH.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-D9Jl5rTX.js → auth-catchall-CBQrYLJa.js} +1 -1
  74. package/dist/client/assets/{auth-entry-Cn0jyyw6.js → auth-entry-5fZpsKca.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-DiVs6WJ3.js → auth-split-layout-_2GxCjhr.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-DEaKhdcs.js → authenticate-and-persist-oauth-BqWfXARS.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-CG7kU51M.js → automation-list-row-DkLqeS2t.js} +1 -1
  78. package/dist/client/assets/{automation-runs-CGQu-nIx.js → automation-runs-KOVQ8ghD.js} +1 -1
  79. package/dist/client/assets/{automations-D9LXua4J.js → automations-GiLoIizc.js} +1 -1
  80. package/dist/client/assets/{autosend-B7QA12Tw.js → autosend-CACWNbxC.js} +1 -1
  81. package/dist/client/assets/{avatar-ByGDtOvp.js → avatar-CFdg60BT.js} +1 -1
  82. package/dist/client/assets/{badge-XA4dRNYq.js → badge-2H20v0nO.js} +1 -1
  83. package/dist/client/assets/{block-document-B0n4B4IP.js → block-document-BJBufMup.js} +1 -1
  84. package/dist/client/assets/{blocks-preview-workspace-context-C7bCK2dG.js → blocks-preview-workspace-context-45OWUgi1.js} +1 -1
  85. package/dist/client/assets/{blog-schema-D2K9lxFN.js → blog-schema-C3v2xT_H.js} +1 -1
  86. package/dist/client/assets/{board-analytics-B5mmzmBe.js → board-analytics-DXWCCmjm.js} +1 -1
  87. package/dist/client/assets/{buckets-Qu8B15tT.js → buckets-C4_hXb9P.js} +1 -1
  88. package/dist/client/assets/{build-improve-prompt-doc-on-tpDMo.js → build-improve-prompt-doc-D_-kPQOz.js} +1 -1
  89. package/dist/client/assets/{calendar-CRpUCA4p.js → calendar-BYqJ2k4j.js} +1 -1
  90. package/dist/client/assets/{capability-load-error-Cwp75ry8.js → capability-load-error-D-0oMipl.js} +1 -1
  91. package/dist/client/assets/{category-editor-B9myg9lh.js → category-editor-Bq4nzviJ.js} +1 -1
  92. package/dist/client/assets/{chart-CvxQFl1V.js → chart-BPIcOkoH.js} +1 -1
  93. package/dist/client/assets/{chat-context-Cwuqjrlx.js → chat-context-Dh5tO9W1.js} +1 -1
  94. package/dist/client/assets/{chat-draft-D0btcSjz.js → chat-draft-Bck3d8Ok.js} +1 -1
  95. package/dist/client/assets/{checkbox-DSNt2gzr.js → checkbox-BRl2nVIa.js} +1 -1
  96. package/dist/client/assets/{choose-editor-BKZj3uPE.js → choose-editor-BOSYr3Y3.js} +1 -1
  97. package/dist/client/assets/{claim-phase-copy-DWZtPw6h.js → claim-phase-copy-De8hliCj.js} +1 -1
  98. package/dist/client/assets/{cli-auth-success-C6o7zJ2p.js → cli-auth-success-BHU-QcJX.js} +1 -1
  99. package/dist/client/assets/{client-icons-BpKVWun3.js → client-icons-9yzx81xM.js} +1 -1
  100. package/dist/client/assets/{collapsible-DOY0YL_H.js → collapsible-CQEd_xSV.js} +1 -1
  101. package/dist/client/assets/{collection-detail--7z4uSdQ.js → collection-detail-DRnSuti2.js} +1 -1
  102. package/dist/client/assets/{collection-display-button-Dtu1j77F.js → collection-display-button-B_HjtsMm.js} +1 -1
  103. package/dist/client/assets/{collection-search-DdqYzjim.js → collection-search-BPtx8G1f.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-8VyRclLN.js → collection-table-wrapper-BryChMzP.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-CWwn3uMq.js → collection-tabs-rDrGFt87.js} +1 -1
  106. package/dist/client/assets/{column-rules-_Ma8ZWf4.js → column-rules-CBDddx-X.js} +1 -1
  107. package/dist/client/assets/{combobox-D7N8SC25.js → combobox-CUJidMCM.js} +1 -1
  108. package/dist/client/assets/{command-Crl7raeC.js → command-CdSfLL9P.js} +1 -1
  109. package/dist/client/assets/{companion-mcps-section-DkjOETuc.js → companion-mcps-section-CapqSyeR.js} +1 -1
  110. package/dist/client/assets/{config-YLu1LJhW.js → config-DYtJAhTs.js} +1 -1
  111. package/dist/client/assets/{connect-BbV6U_hr.js → connect-DzC_JY0O.js} +1 -1
  112. package/dist/client/assets/{connect-layout-CQuvObDD.js → connect-layout-CwfCc-Yp.js} +1 -1
  113. package/dist/client/assets/{connection-BVvM5npe.js → connection-KGhvUETQ.js} +1 -1
  114. package/dist/client/assets/{connection-card-sWgF9uUo.js → connection-card-CmOjRIm5.js} +1 -1
  115. package/dist/client/assets/{connection-detail-AG67uG4I.js → connection-detail-8IXvecot.js} +1 -1
  116. package/dist/client/assets/{connection-form-helpers-Je0bq7c_.js → connection-form-helpers-DwH5XcOW.js} +1 -1
  117. package/dist/client/assets/{connections-Dc6s7_rq.js → connections-Bl-ms1sl.js} +1 -1
  118. package/dist/client/assets/{context-DgLSgDvh.js → context-CQ5RUVRk.js} +1 -1
  119. package/dist/client/assets/{context-menu-JVsCdcDt.js → context-menu-BONDmMvs.js} +1 -1
  120. package/dist/client/assets/{core.esm-CIWIcR9H.js → core.esm-gbvtUb0d.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Ddjs5dmA.js → create-organization-dialog--_vdq0__.js} +1 -1
  122. package/dist/client/assets/{daily-pulse-Dpe4FA_b.js → daily-pulse-BBYJtLUK.js} +1 -1
  123. package/dist/client/assets/{device-hint-D9SLM9ag.js → device-hint-C3mf2rBk.js} +1 -1
  124. package/dist/client/assets/{discover-DlwaiXCQ.js → discover-Dg3bEYIg.js} +1 -1
  125. package/dist/client/assets/{domain-settings-CwEiepSy.js → domain-settings-BLJaGYt5.js} +1 -1
  126. package/dist/client/assets/{drawer-3zPC7EI9.js → drawer-C9byc45q.js} +1 -1
  127. package/dist/client/assets/{editor-BMb1eAhF.js → editor-vTtvQU6U.js} +1 -1
  128. package/dist/client/assets/{empty-state-DUChmUAz.js → empty-state-MzgkrW8i.js} +1 -1
  129. package/dist/client/assets/{empty-state-DuauqtRJ.js → empty-state-OuooYiXX.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-DQ0ThsQw.js → extract-connection-data-DKxAapkS.js} +1 -1
  131. package/dist/client/assets/{feature-gate-DGH8G4ta.js → feature-gate-DthOZE3T.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-Cdd2Shxl.js → feature-paywall-B43OWr6s.js} +1 -1
  133. package/dist/client/assets/{file-explorer-DPT-Gdf2.js → file-explorer-BK6CBYkh.js} +1 -1
  134. package/dist/client/assets/{file-preview-wTY5J2MC.js → file-preview-Cp_wgKZ4.js} +1 -1
  135. package/dist/client/assets/{file-share-button-D4Hp3Pwr.js → file-share-button-BFJJKHR1.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-7-3yF331.js → file-type-icon-D_YzVdyI.js} +1 -1
  137. package/dist/client/assets/flat-project-OqAYQvXi.js +1 -0
  138. package/dist/client/assets/{folder-icon-H82laJL_.js → folder-icon-DDtGpklD.js} +1 -1
  139. package/dist/client/assets/{form-BUOiUceD.js → form-CJ_Xz43P.js} +1 -1
  140. package/dist/client/assets/{general-BHuT0FSK.js → general-BZXk3K5d.js} +1 -1
  141. package/dist/client/assets/{home-BZZrU9O7.js → home-BujtXmg1.js} +1 -1
  142. package/dist/client/assets/{icon-button-DMzM4KWP.js → icon-button-HZupTrz9.js} +1 -1
  143. package/dist/client/assets/{index-gHDeYn5U.js → index-ABTatWfQ.js} +1 -1
  144. package/dist/client/assets/{index-D_aXURjc.js → index-BRlpwCN0.js} +1 -1
  145. package/dist/client/assets/{index-CerQwuGf.js → index-BZvXKYts.js} +1 -1
  146. package/dist/client/assets/{index-x-BjYR-J.js → index-BpzCwtjK.js} +1 -1
  147. package/dist/client/assets/{index-D5kx2mq6.js → index-C-fX0RCG.js} +1 -1
  148. package/dist/client/assets/{index-BVCIU8Mk.js → index-C759w8PG.js} +1 -1
  149. package/dist/client/assets/{index-eP3gZugt.js → index-CcyJ-5NJ.js} +1 -1
  150. package/dist/client/assets/{index-V8pRA7Xy.js → index-CsOndfWq.js} +2 -2
  151. package/dist/client/assets/{index-PaA2bHVT.js → index-D3DgX6eB.js} +1 -1
  152. package/dist/client/assets/{index-DIbARVXx.js → index-D6j44vfq.js} +3 -3
  153. package/dist/client/assets/{index-CvkEcM9-.js → index-DLLBoYqS.js} +1 -1
  154. package/dist/client/assets/{index-BmBVOCXW.js → index-DWDW9ng6.js} +1 -1
  155. package/dist/client/assets/{index-redirect-6gCqz6Y5.js → index-redirect-BQZIR8Rn.js} +1 -1
  156. package/dist/client/assets/{index-D_C9gk4l.js → index-vXsAhBzz.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-Bni-1Rrc.js → infiniteQueryObserver-pU9pZci3.js} +1 -1
  158. package/dist/client/assets/{infra-billing-hHO33Bt1.js → infra-billing-CJ1SDWNW.js} +1 -1
  159. package/dist/client/assets/{input-C7fKNsaf.js → input-D_3UHFsb.js} +1 -1
  160. package/dist/client/assets/{input-ynU6Ij5H.js → input-EIjvUWwG.js} +3 -3
  161. package/dist/client/assets/{integration-icon-D-qpZQt8.js → integration-icon-D2n5_i5E.js} +1 -1
  162. package/dist/client/assets/{jira-icon-B4wDBFAC.js → jira-icon-BtEsLcr1.js} +1 -1
  163. package/dist/client/assets/{label-3hwvsVXP.js → label-PMOCFxAK.js} +1 -1
  164. package/dist/client/assets/{layout-DHC2Bj1E.js → layout-ChMyQ0My.js} +1 -1
  165. package/dist/client/assets/{legacy-agents-deep-BSzJqFgZ.js → legacy-agents-deep-CPBbZTxM.js} +1 -1
  166. package/dist/client/assets/{legacy-main-redirect-R36lgGCg.js → legacy-main-redirect-uv67id5O.js} +1 -1
  167. package/dist/client/assets/library-C5qrWpgG.js +1 -0
  168. package/dist/client/assets/{library-tab-DiWbCdAf.js → library-tab-De6d8NXP.js} +1 -1
  169. package/dist/client/assets/{login-BPcnReJQ.js → login-ew7OWyIA.js} +1 -1
  170. package/dist/client/assets/{markdown-C_bpsjlQ.js → markdown-jtizwWYK.js} +1 -1
  171. package/dist/client/assets/{mcp-app-renderer-DSXHJ5Wt.js → mcp-app-renderer-URE_9VC7.js} +1 -1
  172. package/dist/client/assets/{mcp-oauth-DLnUq2f9.js → mcp-oauth-CS7wEky-.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-7pqu8EiB.js → mcp-oauth-CtduGE9o.js} +1 -1
  174. package/dist/client/assets/{members-Bunz7e6B.js → members-4nC3G4fN.js} +1 -1
  175. package/dist/client/assets/{memory-BLa9O78J.js → memory-DjFNyy0l.js} +1 -1
  176. package/dist/client/assets/{mini-report-page-BVO6pALW.js → mini-report-page-SXYfkfsJ.js} +1 -1
  177. package/dist/client/assets/{mock-board-B5k1LNJu.js → mock-board-DOPI9v1n.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-DMfRj7kt.js → monaco-editor--q8pYjVp.js} +1 -1
  179. package/dist/client/assets/{monitoring-stats-row-Bkq-86wh.js → monitoring-stats-row-CEOJr_Mr.js} +1 -1
  180. package/dist/client/assets/{multi-select-BwXBmTlI.js → multi-select-B5EYUvVe.js} +1 -1
  181. package/dist/client/assets/{mustache-CEXj2Yiz.js → mustache-CwOtagWC.js} +1 -1
  182. package/dist/client/assets/{new-project-dialog-BZdoOBOz.js → new-project-dialog-DNSDpVVm.js} +1 -1
  183. package/dist/client/assets/{oauth-callback-z1ZK2Q1I.js → oauth-callback-N9EX0dsT.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-CbuzeLlJ.js → oauth-callback-ai-provider-DYJWavL1.js} +1 -1
  185. package/dist/client/assets/{onboarding-BGszMdtv.js → onboarding-Cf4I151E.js} +1 -1
  186. package/dist/client/assets/{openai-conversation-B5OySV1i.js → openai-conversation-DGz26UPY.js} +1 -1
  187. package/dist/client/assets/{optimistic-project-sidebar-views-C2x-Aaxu.js → optimistic-project-sidebar-views-7KZes5Aj.js} +1 -1
  188. package/dist/client/assets/{organization-choice-xhN7Yznf.js → organization-choice-BjXMGiEn.js} +1 -1
  189. package/dist/client/assets/{orgs-CEeF7hFm.js → orgs-Co8dpTJE.js} +1 -1
  190. package/dist/client/assets/{page-seo-form-J-VUwESz.js → page-seo-form-BKnLWhFP.js} +1 -1
  191. package/dist/client/assets/{pair-Dha2uqa_.js → pair-B5n9SRL4.js} +1 -1
  192. package/dist/client/assets/{plan-ladder-BNRju_Rr.js → plan-ladder-Bue-fGj1.js} +1 -1
  193. package/dist/client/assets/{popover-CZB8RxoJ.js → popover-Cz5BF_3m.js} +1 -1
  194. package/dist/client/assets/{post-calendar-CfLX9e_7.js → post-calendar-CEBSrXXn.js} +1 -1
  195. package/dist/client/assets/{post-editor-BBmmo40q.js → post-editor-BnKzHRjp.js} +1 -1
  196. package/dist/client/assets/{preview-content-DCZG-NtD.js → preview-content-B68u7aBy.js} +1 -1
  197. package/dist/client/assets/{preview-dialog-DZmQ4_OU.js → preview-dialog-BrKZ8Eye.js} +1 -1
  198. package/dist/client/assets/{preview-panel-BOJOfHU6.js → preview-panel-hieScKI7.js} +1 -1
  199. package/dist/client/assets/{product-picker-dialog-BRcRXNTc.js → product-picker-dialog-DI1rZSm9.js} +1 -1
  200. package/dist/client/assets/{profile-CtDXcfuO.js → profile-DHWmm71D.js} +1 -1
  201. package/dist/client/assets/{project-app-view-Cnchb-Ig.js → project-app-view-DfvTxGtE.js} +1 -1
  202. package/dist/client/assets/{project-feed-Ctubs6D8.js → project-feed-DZ1W25Hn.js} +1 -1
  203. package/dist/client/assets/{project-icon-DXev8VIW.js → project-icon-EnEce15b.js} +1 -1
  204. package/dist/client/assets/project-reports-DkXaua8h.js +1 -0
  205. package/dist/client/assets/project-tasks-Bh6cwC6Y.js +1 -0
  206. package/dist/client/assets/{projects-DfF5wpqY.js → projects-QOPxi_mI.js} +1 -1
  207. package/dist/client/assets/{projects-empty-state-Bkvn9wBz.js → projects-empty-state-B0ZQBktO.js} +1 -1
  208. package/dist/client/assets/{prompts-JCRZXZfZ.js → prompts-CezqR9ud.js} +1 -1
  209. package/dist/client/assets/record-editor-C_Y1Wo0r.js +1 -0
  210. package/dist/client/assets/redirect-editor-CjFXK1kC.js +1 -0
  211. package/dist/client/assets/{reports-BiB14-w5.js → reports-BG-GKzeu.js} +1 -1
  212. package/dist/client/assets/reports-BoLey7zx.js +1 -0
  213. package/dist/client/assets/{reports-onboarding-Ci2eFzgb.js → reports-onboarding-5j0jaaNw.js} +1 -1
  214. package/dist/client/assets/{reports-tab-CfLfXENf.js → reports-tab-BkTRSHA7.js} +2 -2
  215. package/dist/client/assets/{repositories-Ddu7D_dm.js → repositories-BGagF1EN.js} +1 -1
  216. package/dist/client/assets/{repository-binding-CGM8Ow1W.js → repository-binding-CXF8Iqmd.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-DpjUG5YI.js → repository-import-picker-DqDsZx5W.js} +1 -1
  218. package/dist/client/assets/{repository-picker-XHsJQrRg.js → repository-picker-DLkKyJUN.js} +1 -1
  219. package/dist/client/assets/{require-capability-D5tJwX6A.js → require-capability-BM6Ybgn3.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-BKYCK4WE.js → required-auth-layout-CVWrBxoR.js} +1 -1
  221. package/dist/client/assets/{reset-password-BDIEd0mg.js → reset-password-CEx0Ff3M.js} +1 -1
  222. package/dist/client/assets/{resizable-DBUNvXp7.js → resizable-DyTZr2pU.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-C3-zJZHp.js → resolve-tab-icon-DfIQZFlu.js} +1 -1
  224. package/dist/client/assets/{review-settings-iKeIZIxh.js → review-settings-ClvQY-hD.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-B-mX9xD1.js → rich-text-link-control-mLwtvxkK.js} +1 -1
  226. package/dist/client/assets/{roles-B4ZkD532.js → roles-lRXToodJ.js} +1 -1
  227. package/dist/client/assets/{route-Dbrk4VYq.js → route-BhRw08bH.js} +1 -1
  228. package/dist/client/assets/route-CndEOl6m.js +1 -0
  229. package/dist/client/assets/{route-lCR_XMKF.js → route-DDzvkEDQ.js} +1 -1
  230. package/dist/client/assets/{runnable-block-editor-aENhZJE9.js → runnable-block-editor-Cr3HQlva.js} +1 -1
  231. package/dist/client/assets/{sandbox-lifecycle-context-BrrAiqEe.js → sandbox-lifecycle-context-CyWspjuL.js} +1 -1
  232. package/dist/client/assets/{schema-DstuA0HH.js → schema-D6ibRSPf.js} +1 -1
  233. package/dist/client/assets/{scroll-area-NCHj5pvE.js → scroll-area-C8BYcujI.js} +1 -1
  234. package/dist/client/assets/{search-input-CdXxg7YI.js → search-input-ChI_JhrH.js} +1 -1
  235. package/dist/client/assets/{search-toggle-BepIBc_s.js → search-toggle-CUWWqFsW.js} +1 -1
  236. package/dist/client/assets/{secret-picker-C6OYpb8W.js → secret-picker-CxU-8m-r.js} +1 -1
  237. package/dist/client/assets/{secrets-CZl02iRQ.js → secrets-BmlGwv-i.js} +1 -1
  238. package/dist/client/assets/{sections-editor-C91NghHX.js → sections-editor-DTefyMnC.js} +1 -1
  239. package/dist/client/assets/{select-XceA90ql.js → select-CMFCWFoG.js} +1 -1
  240. package/dist/client/assets/{select-model-Cn7hOiT6.js → select-model-BGcA4VFt.js} +1 -1
  241. package/dist/client/assets/{seo-editor-BFWV0Cx1.js → seo-editor-VyAPTq8i.js} +1 -1
  242. package/dist/client/assets/{separator-BTLDrzUc.js → separator-CF3-tizq.js} +1 -1
  243. package/dist/client/assets/{settings-tab-BqJQ3uPx.js → settings-tab-cuNoLFSI.js} +1 -1
  244. package/dist/client/assets/{sheet-wemU-aZ9.js → sheet-DDYhwyXr.js} +1 -1
  245. package/dist/client/assets/{shell-layout-C7bQvu8M.js → shell-layout-J-egCYHs.js} +1 -1
  246. package/dist/client/assets/{skills-BqpJ6duC.js → skills-DHf4Wnnh.js} +1 -1
  247. package/dist/client/assets/{slider-INBQ4Ci_.js → slider-BiFHboSa.js} +1 -1
  248. package/dist/client/assets/{sortable.esm-jUEYWtPl.js → sortable.esm-D8MkW_Mj.js} +1 -1
  249. package/dist/client/assets/{sso-D804RM9B.js → sso-B2O83AEI.js} +1 -1
  250. package/dist/client/assets/{suggestion-DIwPOBWx.js → suggestion-CzlBu15n.js} +1 -1
  251. package/dist/client/assets/{switch-J8K3vNdb.js → switch-CkoldjL2.js} +1 -1
  252. package/dist/client/assets/{symbol-lUKWgdXD.js → symbol-Bd69ZTHX.js} +1 -1
  253. package/dist/client/assets/{synced-repos-gT4FkxhN.js → synced-repos-Nygw9-io.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-DF33b7XO.js → tab-icon-glyph-DPo9bSSl.js} +1 -1
  255. package/dist/client/assets/{table-Bgls4vq9.js → table-CxKhFuEH.js} +1 -1
  256. package/dist/client/assets/{tabs-Duy7ODee.js → tabs-DLw8-jiv.js} +1 -1
  257. package/dist/client/assets/{task-board-DPQxW0jP.js → task-board-B6zg05l8.js} +1 -1
  258. package/dist/client/assets/{task-route-BQDNl_5C.js → task-route-Da1wUewT.js} +1 -1
  259. package/dist/client/assets/{task-status-BGLLtgDf.js → task-status-ENyxLffS.js} +1 -1
  260. package/dist/client/assets/taskboard-analytics-Bq1qJL1-.js +1 -0
  261. package/dist/client/assets/{tasks-IL-LS75-.js → tasks-CIFURdGc.js} +1 -1
  262. package/dist/client/assets/tasks-DK3Yxxu5.js +1 -0
  263. package/dist/client/assets/{textarea-NyzjT40N.js → textarea-DtmaxKHE.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-CtoXhN32.js → thread-analytics-DIbC04_x.js} +1 -1
  265. package/dist/client/assets/{thread-button-BdG_noMn.js → thread-button-VjZAd4E3.js} +1 -1
  266. package/dist/client/assets/{thread-intent-k2Km9Dmr.js → thread-intent-iex-fi8o.js} +1 -1
  267. package/dist/client/assets/{thread-route-Cx-o2xCf.js → thread-route-B-vRjZGb.js} +1 -1
  268. package/dist/client/assets/{thread-route-DbJLUn3d.js → thread-route-Cl51Xz5G.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-_3hMbQ_o.js → thread-sheet-body-C_srY05t.js} +1 -1
  270. package/dist/client/assets/{time-range-picker-CH7-gioV.js → time-range-picker-C5iiqrEW.js} +1 -1
  271. package/dist/client/assets/{toggle-group-m6bc6yjp.js → toggle-group-DlGyqAyH.js} +1 -1
  272. package/dist/client/assets/{tool-namespace-CPm912_s.js → tool-namespace-4DMlS5tP.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-BxO5B0Sy.js → toolbar-icon-button-D0koaCWD.js} +1 -1
  274. package/dist/client/assets/{tooltip-C2m8ePE-.js → tooltip-UhT0N_rD.js} +1 -1
  275. package/dist/client/assets/{tooltipContext-CxUJkkTI.js → tooltipContext-Cyn3L__C.js} +1 -1
  276. package/dist/client/assets/{track-C5Z44Ul6.js → track-BMoyL32N.js} +1 -1
  277. package/dist/client/assets/{types-ZqGSA7tu.js → types-DHDp1Ix5.js} +1 -1
  278. package/dist/client/assets/{url-slug-DEN8nCcZ.js → url-slug-QrQmlYwX.js} +1 -1
  279. package/dist/client/assets/{usage-stats-Dn2OeFoS.js → usage-stats-CC8M4nNz.js} +1 -1
  280. package/dist/client/assets/{use-ai-providers-jw2MMLa5.js → use-ai-providers-Cz8n-q9d.js} +1 -1
  281. package/dist/client/assets/{use-automations-D20-ruPj.js → use-automations-C_6nt9Zp.js} +1 -1
  282. package/dist/client/assets/{use-autosave-BYt2BXBs.js → use-autosave-BgX70Gz2.js} +1 -1
  283. package/dist/client/assets/{use-chat-layout-state-WRaaYm0y.js → use-chat-layout-state-C60DGNO2.js} +1 -1
  284. package/dist/client/assets/{use-chat-navigation-FGqN2bea.js → use-chat-navigation-CyFm8cEg.js} +1 -1
  285. package/dist/client/assets/{use-clock-tick-DWBHoA2Q.js → use-clock-tick-BKZqeY5S.js} +1 -1
  286. package/dist/client/assets/{use-connect-companion-m9MlzSIA.js → use-connect-companion-DTmLU6ot.js} +1 -1
  287. package/dist/client/assets/{use-connection-B2P9vQF_.js → use-connection-UE8r2cKi.js} +1 -1
  288. package/dist/client/assets/{use-copy-Cu3Byc8S.js → use-copy-qR80P2m5.js} +1 -1
  289. package/dist/client/assets/{use-create-virtual-mcp-C8rAImjt.js → use-create-virtual-mcp-DRMHi1dT.js} +1 -1
  290. package/dist/client/assets/{use-date-fns-locale-Beq3354R.js → use-date-fns-locale-CoZazUfP.js} +1 -1
  291. package/dist/client/assets/{use-debounced-autosave-DrUzoxBu.js → use-debounced-autosave-CYyabydu.js} +1 -1
  292. package/dist/client/assets/{use-debounced-value-SDDhu8Id.js → use-debounced-value-XS_u63Qy.js} +1 -1
  293. package/dist/client/assets/{use-deco-credits-sdJPRntH.js → use-deco-credits-BWgRmbgF.js} +1 -1
  294. package/dist/client/assets/{use-decopilot-events-CvdvLxq8.js → use-decopilot-events-BatPvp4V.js} +1 -1
  295. package/dist/client/assets/{use-delete-connection-BOHbZqa4.js → use-delete-connection-VV7G6Dis.js} +1 -1
  296. package/dist/client/assets/{use-deployment-admin-C-HUVf8B.js → use-deployment-admin-DW4_2QbY.js} +1 -1
  297. package/dist/client/assets/{use-ensure-project-folder-BS99-Vhk.js → use-ensure-project-folder-D3lq0ueh.js} +1 -1
  298. package/dist/client/assets/{use-fast-preview-draft-url-C5x2lifG.js → use-fast-preview-draft-url-mXiWjLYU.js} +1 -1
  299. package/dist/client/assets/{use-file-configs-CfW92ECv.js → use-file-configs-B6MWoy0P.js} +1 -1
  300. package/dist/client/assets/{use-infinite-scroll-lPN0NCUm.js → use-infinite-scroll-BD4__gTJ.js} +1 -1
  301. package/dist/client/assets/{use-join-requests-ChCzkc7_.js → use-join-requests-IoygYkkX.js} +1 -1
  302. package/dist/client/assets/{use-main-panel-tabs-Dsv5nepq.js → use-main-panel-tabs-z1NdoakW.js} +1 -1
  303. package/dist/client/assets/{use-mcp-auth-status-DRKL-P8f.js → use-mcp-auth-status-CDCKWbI3.js} +1 -1
  304. package/dist/client/assets/{use-mcp-client-CqsBL7uD.js → use-mcp-client-DaCLGUbW.js} +1 -1
  305. package/dist/client/assets/{use-mcp-prompts-1ZUYIWAu.js → use-mcp-prompts-Cj8TKxv6.js} +1 -1
  306. package/dist/client/assets/{use-mcp-tools-D_yHtzDx.js → use-mcp-tools-B_v6Xc8f.js} +1 -1
  307. package/dist/client/assets/{use-members-BTcdjICA.js → use-members-COPm4P5W.js} +1 -1
  308. package/dist/client/assets/{use-mobile-D2A_YY4A.js → use-mobile-CSIXbJHF.js} +1 -1
  309. package/dist/client/assets/{use-navigate-to-agent-RUWGGNCj.js → use-navigate-to-agent-CyIa0H8E.js} +1 -1
  310. package/dist/client/assets/use-new-blocks-editor-CFDJQWsr.js +1 -0
  311. package/dist/client/assets/{use-open-billing-url-tDUbFoyb.js → use-open-billing-url-ByV0ShcL.js} +1 -1
  312. package/dist/client/assets/{use-org-auth-client-qz-rdd-6.js → use-org-auth-client-DYKRjiNi.js} +1 -1
  313. package/dist/client/assets/{use-org-fs-Bpw1hkjS.js → use-org-fs-DcHowQO9.js} +1 -1
  314. package/dist/client/assets/{use-org-repo-syncs-Dgz3AX_E.js → use-org-repo-syncs-CpMqTwr0.js} +1 -1
  315. package/dist/client/assets/{use-org-sso-FN6Hp6_O.js → use-org-sso-Bhc1WrbS.js} +1 -1
  316. package/dist/client/assets/{use-organization-roles-lOM-6Cks.js → use-organization-roles-CPv4-j68.js} +1 -1
  317. package/dist/client/assets/{use-organization-settings-CvwbmZME.js → use-organization-settings-DxhpqnYO.js} +1 -1
  318. package/dist/client/assets/{use-panel-navigate-BcP-4Jk4.js → use-panel-navigate-B75ATwR5.js} +1 -1
  319. package/dist/client/assets/{use-project-scope-Ds7ag806.js → use-project-scope-YpfqNFMB.js} +1 -1
  320. package/dist/client/assets/{use-releases-DedSt3np.js → use-releases-DpsGlymp.js} +1 -1
  321. package/dist/client/assets/{use-reports-diagnostic-CO2atgBG.js → use-reports-diagnostic-BacLoY5G.js} +1 -1
  322. package/dist/client/assets/{use-sandbox-events-Cqb_Ym4F.js → use-sandbox-events-BnBgyYjB.js} +1 -1
  323. package/dist/client/assets/{use-secrets-BjvGVY7t.js → use-secrets-CkRBiULT.js} +1 -1
  324. package/dist/client/assets/{use-section-preview-base-CoG0-wMI.js → use-section-preview-base-Bzis1rCo.js} +1 -1
  325. package/dist/client/assets/{use-tags-ja0CaL2g.js → use-tags-D6F6hDK1.js} +1 -1
  326. package/dist/client/assets/{use-task-board-analytics-Dx24ixKr.js → use-task-board-analytics-DGP81lZo.js} +1 -1
  327. package/dist/client/assets/{use-task-board-events-CZieAk2g.js → use-task-board-events-CMdVOm7R.js} +1 -1
  328. package/dist/client/assets/{use-task-board-item-prs-C_5W7zcg.js → use-task-board-item-prs-DsMQwqER.js} +1 -1
  329. package/dist/client/assets/{use-task-board-items-CkoW6-bn.js → use-task-board-items-SO19iMil.js} +1 -1
  330. package/dist/client/assets/{use-task-metadata-C-eJemLF.js → use-task-metadata-DSX2LZld.js} +1 -1
  331. package/dist/client/assets/{use-thread-analytics-B8zFfdhr.js → use-thread-analytics-CVouJyNf.js} +1 -1
  332. package/dist/client/assets/{use-thread-outputs-CHIrdXyI.js → use-thread-outputs-PwDDA0de.js} +1 -1
  333. package/dist/client/assets/useInfiniteQuery-C6j7p53s.js +1 -0
  334. package/dist/client/assets/{useQueries-Dpxh6EqM.js → useQueries-DYlwY_7i.js} +1 -1
  335. package/dist/client/assets/useSuspenseInfiniteQuery-LN6pz4nD.js +1 -0
  336. package/dist/client/assets/{users-xDH1jmUT.js → users-CYFJuXuG.js} +1 -1
  337. package/dist/client/assets/{utils-BBHV2kqf.js → utils-VljhGZNh.js} +1 -1
  338. package/dist/client/assets/{variant-calendar-BJGksOpn.js → variant-calendar-CmxcC_ep.js} +1 -1
  339. package/dist/client/assets/{variant-matcher-override-3KgTJsm9.js → variant-matcher-override-wPBIsNi7.js} +1 -1
  340. package/dist/client/assets/{view-mode-toggle-5lUXeBq8.js → view-mode-toggle-Bsl9fIVT.js} +1 -1
  341. package/dist/client/assets/{virtual-mcp-CKveTc8W.js → virtual-mcp-DUsuHWMj.js} +1 -1
  342. package/dist/client/assets/{watch-sse-pool-SMEeDp6D.js → watch-sse-pool-BxFXPxOj.js} +1 -1
  343. package/dist/client/index.html +1 -1
  344. package/dist/server/server.js +3 -3
  345. package/package.json +1 -1
  346. package/dist/client/assets/agent-app-DtmEOrmX.js +0 -1
  347. package/dist/client/assets/agent-deck--kR-tnhH.js +0 -1
  348. package/dist/client/assets/agent-library-CGtmUhYD.js +0 -1
  349. package/dist/client/assets/agent-library-file-CZlCJsi6.js +0 -1
  350. package/dist/client/assets/agent-settings-_tzBjLDX.js +0 -1
  351. package/dist/client/assets/agent-site-editor-code-DA20Pk7L.js +0 -2
  352. package/dist/client/assets/agent-view-CgtvUhvS.js +0 -1
  353. package/dist/client/assets/api-keys-DXlZlPNT.js +0 -1
  354. package/dist/client/assets/app-editor-BlHRP4Rp.js +0 -1
  355. package/dist/client/assets/flat-project-CNnQaq5E.js +0 -1
  356. package/dist/client/assets/library-BfEEZWGX.js +0 -1
  357. package/dist/client/assets/project-reports-Ci_iYRrd.js +0 -1
  358. package/dist/client/assets/project-tasks-CzZdSRDI.js +0 -1
  359. package/dist/client/assets/record-editor-BmUK9heP.js +0 -1
  360. package/dist/client/assets/redirect-editor-DARWO6oY.js +0 -1
  361. package/dist/client/assets/reports-CJkqLIIg.js +0 -1
  362. package/dist/client/assets/route-DmXxzobK.js +0 -1
  363. package/dist/client/assets/taskboard-analytics-2fBMPAxC.js +0 -1
  364. package/dist/client/assets/tasks-CqyFd60l.js +0 -1
  365. package/dist/client/assets/use-new-blocks-editor-APcQuu-Z.js +0 -1
  366. package/dist/client/assets/useInfiniteQuery-Cyz1DFAa.js +0 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-B0qRbG8m.js +0 -1
@@ -1 +1 @@
1
- import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-V8pRA7Xy.js";import{g as Ye}from"./extract-connection-data-DQ0ThsQw.js";import{E as Ce}from"./empty-state-DUChmUAz.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-Je0bq7c_.js";import{c as nt,S as it,D as ot}from"./index-BmBVOCXW.js";import{u as we,T as at}from"./use-mcp-auth-status-DRKL-P8f.js";import{a as lt}from"./use-members-BTcdjICA.js";import{A as rt}from"./avatar-ByGDtOvp.js";import{a as ct}from"./mcp-oauth-DLnUq2f9.js";import{I as ae}from"./integration-icon-D-qpZQt8.js";import{s as dt}from"./Plus-v0YpByfM.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-BTsTGfvr.js";import{a as ke,e as pt,s as ft}from"./Tool01-B-kpMrMZ.js";import{s as re}from"./Trash01-3M9m1iIs.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-wemU-aZ9.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-BUOiUceD.js";import{a as Ie,b as Te,u as yt}from"./use-connection-B2P9vQF_.js";import{u as Ae}from"./use-mcp-client-CqsBL7uD.js";import{u as _t}from"./use-mcp-tools-D_yHtzDx.js";import{a as Ct}from"./use-mcp-prompts-1ZUYIWAu.js";import{i as wt}from"./mcp-oauth-7pqu8EiB.js";import{u as kt,D as It}from"./use-delete-connection-BOHbZqa4.js";import{c as Tt}from"./monitoring-stats-row-Bkq-86wh.js";import{d as At,C as Pt,a as Dt}from"./chart-CvxQFl1V.js";import{B as $t,a as Ot}from"./BarChart-DdrNiWaE.js";import{C as Mt}from"./tooltipContext-CxUJkkTI.js";import{b as Et}from"./repository-binding-CGM8Ow1W.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-Duy7ODee.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-BG-1Jwuh.js";import{g as ce}from"./types-ZqGSA7tu.js";import{M as Vt}from"./mcp-app-renderer-DSXHJ5Wt.js";import{C as Ft}from"./collection-search-DdqYzjim.js";import{B as Lt}from"./badge-XA4dRNYq.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-XceA90ql.js";import{i as Bt}from"./CheckCircle-DiKVJkkJ.js";import{t as qt}from"./ChevronUp-wLOc_NTT.js";import{n as Gt}from"./LinkBroken01-DGQh_3WZ.js";import{c as Ht}from"./UserSquare-BuJqx7Ns.js";import{s as Xt}from"./XClose-Bpws6cjk.js";import{p as Kt,i as Qt}from"./connection-BVvM5npe.js";import"./metadata-D72DunRR.js";import"./Key01-rqwReuZQ.js";import"./auth-CM-DdMTE.js";import"./index-D5kx2mq6.js";import"./index-gHDeYn5U.js";import"./index-BdQq_4o_.js";import"./index-BVCIU8Mk.js";import"./popover-CZB8RxoJ.js";import"./tooltip-C2m8ePE-.js";import"./index-CvkEcM9-.js";import"./SearchMd-Bendi2p8.js";import"./use-mobile-D2A_YY4A.js";import"./use-create-virtual-mcp-C8rAImjt.js";import"./use-navigate-to-agent-RUWGGNCj.js";import"./thread-intent-k2Km9Dmr.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-SMEeDp6D.js";import"./task-board-DPQxW0jP.js";import"./schema-DstuA0HH.js";import"./slugify-CEUa2lfQ.js";import"./Image01-Doh_epPd.js";import"./use-org-auth-client-qz-rdd-6.js";import"./User01-CT2R-iHD.js";import"./AlertCircle-9YsZUjmj.js";import"./ArrowUp-D1danNae.js";import"./ArrowLeft-ZHARsvy9.js";import"./ZoomOut-CVwCO-_8.js";import"./Building02-ssxWkdBl.js";import"./ChevronSelectorVertical-Dkzqp5pp.js";import"./Copy01-Cr5x9Tlu.js";import"./CreditCard01-DCL7xzU2.js";import"./DotsVertical-DZE2ktIm.js";import"./Globe04-DLL93yaf.js";import"./SwitchHorizontal01-Dv53_XOE.js";import"./Link01-DiFWbMaR.js";import"./Monitor01-Cp7iEwN0.js";import"./Sun-CJr96mBh.js";import"./Play-C2hvYOyw.js";import"./Upload01-DBgIGKf8.js";import"./Users01-gQNjKybb.js";import"./label-3hwvsVXP.js";import"./alert-dialog-Dr31Gqkz.js";import"./AreaChart-CeW2QCC3.js";import"./CategoricalChart-ClYHeQF6.js";import"./XAxis-DBRxAeUY.js";import"./symbol-lUKWgdXD.js";import"./ActiveShapeUtils-DCHlcSOh.js";import"./Sector-Clpc9eH-.js";import"./ErrorBarContext-D4j8kFWO.js";import"./url-slug-DEN8nCcZ.js";const Wt=ve({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{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 j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(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,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=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:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Mt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.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 ds(s){const e=U.c(22),{connectionId:n}=s,c=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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 d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==r?(u=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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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:()=>g(v.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(pt,{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:De(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(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(xt,{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 js(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:De(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 bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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(ye,{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:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.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(ne,{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")}),u&&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(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{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:m.value,onValueChange:m.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(ne,{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(ne,{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(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{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(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),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:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(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,o=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=st(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&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(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(St,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.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:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&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 p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
1
+ import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-CsOndfWq.js";import{g as Ye}from"./extract-connection-data-DKxAapkS.js";import{E as Ce}from"./empty-state-MzgkrW8i.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-DwH5XcOW.js";import{c as nt,S as it,D as ot}from"./index-DWDW9ng6.js";import{u as we,T as at}from"./use-mcp-auth-status-CDCKWbI3.js";import{a as lt}from"./use-members-COPm4P5W.js";import{A as rt}from"./avatar-CFdg60BT.js";import{a as ct}from"./mcp-oauth-CS7wEky-.js";import{I as ae}from"./integration-icon-D2n5_i5E.js";import{s as dt}from"./Plus-4vFTW30B.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-B6BGlN8Z.js";import{a as ke,e as pt,s as ft}from"./Tool01-BJxIe84T.js";import{s as re}from"./Trash01-Dvqfc9le.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-DDYhwyXr.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-CJ_Xz43P.js";import{a as Ie,b as Te,u as yt}from"./use-connection-UE8r2cKi.js";import{u as Ae}from"./use-mcp-client-DaCLGUbW.js";import{u as _t}from"./use-mcp-tools-B_v6Xc8f.js";import{a as Ct}from"./use-mcp-prompts-Cj8TKxv6.js";import{i as wt}from"./mcp-oauth-CtduGE9o.js";import{u as kt,D as It}from"./use-delete-connection-VV7G6Dis.js";import{c as Tt}from"./monitoring-stats-row-CEOJr_Mr.js";import{d as At,C as Pt,a as Dt}from"./chart-BPIcOkoH.js";import{B as $t,a as Ot}from"./BarChart-CEMnTLeo.js";import{C as Mt}from"./tooltipContext-Cyn3L__C.js";import{b as Et}from"./repository-binding-CXF8Iqmd.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-DLw8-jiv.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-C6V1h_2Z.js";import{g as ce}from"./types-DHDp1Ix5.js";import{M as Vt}from"./mcp-app-renderer-URE_9VC7.js";import{C as Ft}from"./collection-search-BPtx8G1f.js";import{B as Lt}from"./badge-2H20v0nO.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-CMFCWFoG.js";import{i as Bt}from"./CheckCircle-ChTvVqPO.js";import{t as qt}from"./ChevronUp-DckC0O5o.js";import{n as Gt}from"./LinkBroken01-t0qEt8Lb.js";import{c as Ht}from"./UserSquare-B4EnRc3E.js";import{s as Xt}from"./XClose-D59UZ-3l.js";import{p as Kt,i as Qt}from"./connection-KGhvUETQ.js";import"./metadata-D72DunRR.js";import"./Key01-BQnNEHGn.js";import"./auth-CK5qaIjH.js";import"./index-C-fX0RCG.js";import"./index-ABTatWfQ.js";import"./index-BdQq_4o_.js";import"./index-C759w8PG.js";import"./popover-Cz5BF_3m.js";import"./tooltip-UhT0N_rD.js";import"./index-DLLBoYqS.js";import"./SearchMd-DqzvTdT2.js";import"./use-mobile-CSIXbJHF.js";import"./use-create-virtual-mcp-DRMHi1dT.js";import"./use-navigate-to-agent-CyIa0H8E.js";import"./thread-intent-iex-fi8o.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BxFXPxOj.js";import"./task-board-B6zg05l8.js";import"./schema-D6ibRSPf.js";import"./slugify-CEUa2lfQ.js";import"./Image01-gtPlqhVq.js";import"./use-org-auth-client-DYKRjiNi.js";import"./User01-Dh_l7uq-.js";import"./AlertCircle-CIcaLchq.js";import"./ArrowUp-B8mx1ol5.js";import"./ArrowLeft-DfXjYrQi.js";import"./ZoomOut-BwebNTOr.js";import"./Building02-BPQ9fMgU.js";import"./ChevronSelectorVertical-zoEWZ9sC.js";import"./Copy01-Corfj4_5.js";import"./CreditCard01-DlMgd9ia.js";import"./DotsVertical-uTiOtqeH.js";import"./Globe04-CL3-GeAh.js";import"./SwitchHorizontal01-DN4m9K18.js";import"./Link01-BSAGxXho.js";import"./Monitor01-BIhKjgAf.js";import"./Sun-DlWI3pkK.js";import"./Play-Ba5tQ65L.js";import"./Upload01-BxWCGLDw.js";import"./Users01-CIo5W1LA.js";import"./label-PMOCFxAK.js";import"./alert-dialog-G7y5OQF6.js";import"./AreaChart-CZ-42bmk.js";import"./CategoricalChart-M1P6vf9W.js";import"./XAxis-B_TwRkrI.js";import"./symbol-Bd69ZTHX.js";import"./ActiveShapeUtils-h1pqy1tf.js";import"./Sector-CdUfaAFg.js";import"./ErrorBarContext-B19L0BAB.js";import"./url-slug-QrQmlYwX.js";const Wt=ve({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{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 j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(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,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=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:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Mt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.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 ds(s){const e=U.c(22),{connectionId:n}=s,c=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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 d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==r?(u=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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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:()=>g(v.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(pt,{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:De(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(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(xt,{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 js(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:De(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 bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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(ye,{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:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.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(ne,{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")}),u&&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(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{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:m.value,onValueChange:m.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(ne,{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(ne,{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(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{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(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),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:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(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,o=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=st(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&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(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(St,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.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:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&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 p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
@@ -1 +1 @@
1
- import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-V8pRA7Xy.js";import{s as W}from"./Plus-v0YpByfM.js";import{s as U}from"./Trash01-3M9m1iIs.js";const q=R({key:o().min(1,"Key is required"),value:o()}),B=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(q).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function G(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:s,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(C,{placeholder:m,value:p.key,onChange:c=>g(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(C,{type:K(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(i),children:u.jsx(U,{size:16})})]},i),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function M(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(s=>!s.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(a.envVars=s),a}export{G as E,Y as a,J as b,B as c,Q as d,F as i,D as p,M as r};
1
+ import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-CsOndfWq.js";import{s as W}from"./Plus-4vFTW30B.js";import{s as U}from"./Trash01-Dvqfc9le.js";const q=R({key:o().min(1,"Key is required"),value:o()}),B=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(q).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function G(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:s,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(C,{placeholder:m,value:p.key,onChange:c=>g(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(C,{type:K(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(i),children:u.jsx(U,{size:16})})]},i),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function M(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(s=>!s.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(a.envVars=s),a}export{G as E,Y as a,J as b,B as c,Q as d,F as i,D as p,M as r};
@@ -1 +1 @@
1
- import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-V8pRA7Xy.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-DQ0ThsQw.js";import{C as rt}from"./collection-display-button-Dtu1j77F.js";import{S as at}from"./search-input-CdXxg7YI.js";import{C as dt}from"./collection-tabs-CWwn3uMq.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-sWgF9uUo.js";import{E as gt}from"./empty-state-DUChmUAz.js";import{u as mt,D as pt}from"./use-delete-connection-BOHbZqa4.js";import{u as ft}from"./use-infinite-scroll-lPN0NCUm.js";import{u as Ve}from"./use-mobile-D2A_YY4A.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-Dr31Gqkz.js";import{n as xe}from"./LinkBroken01-DGQh_3WZ.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-3zPC7EI9.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-BUOiUceD.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-XceA90ql.js";import{T as Ut}from"./textarea-NyzjT40N.js";import{b as ze,u as Vt}from"./use-connection-B2P9vQF_.js";import{m as zt}from"./use-mcp-client-CqsBL7uD.js";import{b as Lt}from"./repository-binding-CGM8Ow1W.js";import{g as Et}from"./types-ZqGSA7tu.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-BTsTGfvr.js";import{s as Le}from"./Plus-v0YpByfM.js";import{c as Wt}from"./UserSquare-BuJqx7Ns.js";import{s as Ee}from"./XClose-Bpws6cjk.js";import{s as Xt}from"./use-project-scope-Ds7ag806.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-Je0bq7c_.js";import{a as Zt}from"./authenticate-and-persist-oauth-DEaKhdcs.js";import{I as en}from"./integration-icon-D-qpZQt8.js";import{C as Be}from"./checkbox-DSNt2gzr.js";import{i as tn}from"./DotsVertical-DZE2ktIm.js";import{s as Ke}from"./Image01-Doh_epPd.js";import{s as He}from"./Trash01-3M9m1iIs.js";import"./connection-BVvM5npe.js";import"./url-slug-DEN8nCcZ.js";import"./ArrowUp-D1danNae.js";import"./SwitchHorizontal01-Dv53_XOE.js";import"./tooltip-C2m8ePE-.js";import"./index-CvkEcM9-.js";import"./view-mode-toggle-5lUXeBq8.js";import"./badge-XA4dRNYq.js";import"./SearchMd-Bendi2p8.js";import"./useInfiniteQuery-Cyz1DFAa.js";import"./infiniteQueryObserver-Bni-1Rrc.js";import"./slugify-CEUa2lfQ.js";import"./label-3hwvsVXP.js";import"./index-BdQq_4o_.js";import"./ChevronUp-wLOc_NTT.js";import"./auth-CM-DdMTE.js";import"./AlertCircle-9YsZUjmj.js";import"./Tool01-B-kpMrMZ.js";import"./ArrowLeft-ZHARsvy9.js";import"./ShoppingBag01-BG-1Jwuh.js";import"./ZoomOut-CVwCO-_8.js";import"./Building02-ssxWkdBl.js";import"./CheckCircle-DiKVJkkJ.js";import"./ChevronSelectorVertical-Dkzqp5pp.js";import"./Copy01-Cr5x9Tlu.js";import"./CreditCard01-DCL7xzU2.js";import"./Globe04-DLL93yaf.js";import"./Key01-rqwReuZQ.js";import"./Link01-DiFWbMaR.js";import"./Monitor01-Cp7iEwN0.js";import"./Sun-CJr96mBh.js";import"./Play-C2hvYOyw.js";import"./Upload01-DBgIGKf8.js";import"./User01-CT2R-iHD.js";import"./Users01-gQNjKybb.js";import"./mcp-oauth-DLnUq2f9.js";import"./mcp-oauth-7pqu8EiB.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{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(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{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 b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{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:a,onChange:b=>x(b||"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:f,onChange:b=>j(b||"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")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
1
+ import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-CsOndfWq.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-DKxAapkS.js";import{C as rt}from"./collection-display-button-B_HjtsMm.js";import{S as at}from"./search-input-ChI_JhrH.js";import{C as dt}from"./collection-tabs-rDrGFt87.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-CmOjRIm5.js";import{E as gt}from"./empty-state-MzgkrW8i.js";import{u as mt,D as pt}from"./use-delete-connection-VV7G6Dis.js";import{u as ft}from"./use-infinite-scroll-BD4__gTJ.js";import{u as Ve}from"./use-mobile-CSIXbJHF.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-G7y5OQF6.js";import{n as xe}from"./LinkBroken01-t0qEt8Lb.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-C9byc45q.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-CJ_Xz43P.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-CMFCWFoG.js";import{T as Ut}from"./textarea-DtmaxKHE.js";import{b as ze,u as Vt}from"./use-connection-UE8r2cKi.js";import{m as zt}from"./use-mcp-client-DaCLGUbW.js";import{b as Lt}from"./repository-binding-CXF8Iqmd.js";import{g as Et}from"./types-DHDp1Ix5.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-B6BGlN8Z.js";import{s as Le}from"./Plus-4vFTW30B.js";import{c as Wt}from"./UserSquare-B4EnRc3E.js";import{s as Ee}from"./XClose-D59UZ-3l.js";import{s as Xt}from"./use-project-scope-YpfqNFMB.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-DwH5XcOW.js";import{a as Zt}from"./authenticate-and-persist-oauth-BqWfXARS.js";import{I as en}from"./integration-icon-D2n5_i5E.js";import{C as Be}from"./checkbox-BRl2nVIa.js";import{i as tn}from"./DotsVertical-uTiOtqeH.js";import{s as Ke}from"./Image01-gtPlqhVq.js";import{s as He}from"./Trash01-Dvqfc9le.js";import"./connection-KGhvUETQ.js";import"./url-slug-QrQmlYwX.js";import"./ArrowUp-B8mx1ol5.js";import"./SwitchHorizontal01-DN4m9K18.js";import"./tooltip-UhT0N_rD.js";import"./index-DLLBoYqS.js";import"./view-mode-toggle-Bsl9fIVT.js";import"./badge-2H20v0nO.js";import"./SearchMd-DqzvTdT2.js";import"./useInfiniteQuery-C6j7p53s.js";import"./infiniteQueryObserver-pU9pZci3.js";import"./slugify-CEUa2lfQ.js";import"./label-PMOCFxAK.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DckC0O5o.js";import"./auth-CK5qaIjH.js";import"./AlertCircle-CIcaLchq.js";import"./Tool01-BJxIe84T.js";import"./ArrowLeft-DfXjYrQi.js";import"./ShoppingBag01-C6V1h_2Z.js";import"./ZoomOut-BwebNTOr.js";import"./Building02-BPQ9fMgU.js";import"./CheckCircle-ChTvVqPO.js";import"./ChevronSelectorVertical-zoEWZ9sC.js";import"./Copy01-Corfj4_5.js";import"./CreditCard01-DlMgd9ia.js";import"./Globe04-CL3-GeAh.js";import"./Key01-BQnNEHGn.js";import"./Link01-BSAGxXho.js";import"./Monitor01-BIhKjgAf.js";import"./Sun-DlWI3pkK.js";import"./Play-Ba5tQ65L.js";import"./Upload01-BxWCGLDw.js";import"./User01-Dh_l7uq-.js";import"./Users01-CIo5W1LA.js";import"./mcp-oauth-CS7wEky-.js";import"./mcp-oauth-CtduGE9o.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{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(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{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 b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{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:a,onChange:b=>x(b||"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:f,onChange:b=>j(b||"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")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};