decocms 4.390.2 → 4.390.3

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 (352) hide show
  1. package/dist/client/assets/{AlertCircle-DamanO0X.js → AlertCircle-Plbq3B-q.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DAjzIUVt.js → AreaChart-B_NHmXx3.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-SpZlA2bb.js → ArrowLeft-DrGT8UWu.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DAZKfxXh.js → ArrowRight-CbriRBrq.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BtBGOCWY.js → ArrowUp-6u2hUOnH.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-C4cSotGX.js → CartesianChart-COgbk__t.js} +1 -1
  7. package/dist/client/assets/{Check-CeoOppXe.js → Check-C99gsNHm.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-CaiMiFDe.js → CheckCircle-CKcxanRZ.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DeResoiH.js → ChevronUp-DSQ_1BER.js} +1 -1
  10. package/dist/client/assets/{Copy01-CF3qS6LP.js → Copy01-BenS5ro_.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DGTLrWaP.js → CreditCard01-YK1yCS4W.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DKsMx6HW.js → DotsVertical-CQ6LBNOP.js} +1 -1
  13. package/dist/client/assets/{Download01-CgN_oEm1.js → Download01-Bp4nnCQ1.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-BU77D7cf.js → ErrorBarContext-CIx228C0.js} +1 -1
  15. package/dist/client/assets/{Eye-C56Lk2NI.js → Eye-DbFIyI2n.js} +1 -1
  16. package/dist/client/assets/{Globe04-u4Rssq_0.js → Globe04-CGVAMpAe.js} +1 -1
  17. package/dist/client/assets/{Image01-BBs4WVyw.js → Image01-BggoPRkg.js} +1 -1
  18. package/dist/client/assets/{Key01-DSGm0aza.js → Key01-BV_ymGg3.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-BN-mFj8G.js → LayoutLeft-DpIebcC-.js} +1 -1
  20. package/dist/client/assets/{Line-DHWVZx2q.js → Line-DmECL8mT.js} +1 -1
  21. package/dist/client/assets/{Link01-BqaeC2vU.js → Link01-OIIXb7cI.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-LsY731Ce.js → LinkExternal01-CPCL9Cco.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Wv2_lYrq.js → Monitor01-CDgu8CIt.js} +1 -1
  24. package/dist/client/assets/{Package-BpLpYayL.js → Package-Ci_Iuppc.js} +1 -1
  25. package/dist/client/assets/{Palette-zNU-Z5w1.js → Palette-IB6rbtm1.js} +1 -1
  26. package/dist/client/assets/{Plus-BJXRYkOi.js → Plus-40Vqbuez.js} +1 -1
  27. package/dist/client/assets/{SearchLg-CfdMUZPl.js → SearchLg-CAy6qghA.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DYmOASVZ.js → SearchMd-kVGeqQ7a.js} +1 -1
  29. package/dist/client/assets/{Sector-Bq5ZB3Ar.js → Sector-BvGNn9CG.js} +1 -1
  30. package/dist/client/assets/{Share07-CYv18Ut8.js → Share07-CcQxNSX3.js} +1 -1
  31. package/dist/client/assets/{Stars01-qZBU4wqC.js → Stars01-BMd1nnPj.js} +1 -1
  32. package/dist/client/assets/{Sun-CzrsJre-.js → Sun-Be8FNPF2.js} +1 -1
  33. package/dist/client/assets/{Tool01-UcpZc1Ld.js → Tool01-C-oe4aXW.js} +1 -1
  34. package/dist/client/assets/{Trash01-BKZ4yEpo.js → Trash01-Byz0_Sy5.js} +1 -1
  35. package/dist/client/assets/{Upload01-BRaprouM.js → Upload01-C2s_RH4H.js} +1 -1
  36. package/dist/client/assets/{User01-BSxIafNg.js → User01-XeAWOYXy.js} +1 -1
  37. package/dist/client/assets/{UserSquare--C8Iia3e.js → UserSquare-D-qt0de_.js} +1 -1
  38. package/dist/client/assets/{Users01-B2oROtAL.js → Users01-C3on152s.js} +1 -1
  39. package/dist/client/assets/{X-LWyEp2XB.js → X-RprAX0Ua.js} +1 -1
  40. package/dist/client/assets/{XCircle-DedN3aZE.js → XCircle-CQMzne_o.js} +1 -1
  41. package/dist/client/assets/{XClose-BlVZtXd9.js → XClose-CVQLXZni.js} +1 -1
  42. package/dist/client/assets/{Zap-C-Muwsv6.js → Zap-DzoV5VQ9.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-AvI_Dq16.js → ZoomOut-BWCMlmIP.js} +1 -1
  44. package/dist/client/assets/{access-gate-m0zDXVj7.js → access-gate-Bgyfx_br.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-BiKX4PXE.js → add-connection-dialog-DXEwYeqS.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-B_ci0URg.js → agent-analytics-BuqEjr-s.js} +1 -1
  47. package/dist/client/assets/agent-app-Cv7i7dBd.js +1 -0
  48. package/dist/client/assets/{agent-assets-BzoN_gMM.js → agent-assets-D1tKS8pa.js} +1 -1
  49. package/dist/client/assets/{agent-automation-Dmy3s50D.js → agent-automation-DSMp2kQn.js} +1 -1
  50. package/dist/client/assets/{agent-automations-D31L4_Mi.js → agent-automations-vUhw7tV_.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-De_J8Bsc.js → agent-connect-sources-_vAJW22D.js} +1 -1
  52. package/dist/client/assets/agent-deck-CUWrc_nt.js +1 -0
  53. package/dist/client/assets/{agent-e2e-Z4oZKkm4.js → agent-e2e-Bga4rsrF.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B3cD_qx8.js → agent-experiments-B7PIi2l-.js} +1 -1
  55. package/dist/client/assets/agent-file-DQVohtnZ.js +1 -0
  56. package/dist/client/assets/{agent-git-Bchws8e_.js → agent-git-DBDT-hIL.js} +1 -1
  57. package/dist/client/assets/{agent-hosting-Dazy2DCD.js → agent-hosting-CjnG0XIl.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CPxPcoq5.js → agent-icon-yvE2OrmS.js} +1 -1
  59. package/dist/client/assets/agent-library-file-Cz2ztsCV.js +1 -0
  60. package/dist/client/assets/{agent-monitor-Cj7LgZDo.js → agent-monitor-BDXfL2vI.js} +1 -1
  61. package/dist/client/assets/{agent-overview-Ds8-BVsG.js → agent-overview-UpXocDJH.js} +1 -1
  62. package/dist/client/assets/agent-settings-Ae05XcIC.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BW9PhmFL.js → agent-site-editor-CzhIp9D-.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-B79SiqEb.js +2 -0
  65. package/dist/client/assets/{agent-site-editor-content-BQxGoqPl.js → agent-site-editor-content-DgrOyzJ9.js} +2 -2
  66. package/dist/client/assets/agent-site-editor-preview-CBi5Tbv1.js +518 -0
  67. package/dist/client/assets/agent-view-Bk7GmWwZ.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C8R1CHth.js → agent-view-guard-BL5Hr88U.js} +1 -1
  69. package/dist/client/assets/{agents-list-DSIIP3XZ.js → agents-list-C2VF3tm2.js} +1 -1
  70. package/dist/client/assets/{ai-providers-Dct1QzzE.js → ai-providers-eLd1_N3b.js} +1 -1
  71. package/dist/client/assets/{alert-ybxZR-_H.js → alert-_voqqPHC.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-i1rWKvRm.js → alert-dialog-BCduxUz6.js} +1 -1
  73. package/dist/client/assets/api-keys-CtGsw_Gs.js +1 -0
  74. package/dist/client/assets/{api-keys-DmWjHAe8.js → api-keys-Dw8-fWJ8.js} +1 -1
  75. package/dist/client/assets/app-editor-D_-0_IQ_.js +1 -0
  76. package/dist/client/assets/{asset-utils-BgRAe4M3.js → asset-utils-CYVxOjk-.js} +1 -1
  77. package/dist/client/assets/{auth-tf_g8iMx.js → auth-DbhfOiDD.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-C16Xey8R.js → auth-catchall-bR4cEBQ7.js} +1 -1
  79. package/dist/client/assets/{auth-entry-Dgu2wJP7.js → auth-entry-BtyUVFkH.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DJ0hv-R1.js → auth-split-layout-OXkozary.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-BicDqk1l.js → authenticate-and-persist-oauth-CTqF0T3I.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-w0CSDHI8.js → automation-list-row-CWKGol7C.js} +1 -1
  83. package/dist/client/assets/{automation-runs-rkj7KELU.js → automation-runs-B0iVRx_v.js} +1 -1
  84. package/dist/client/assets/{automations-DnFKJ6bm.js → automations-drGOc5kF.js} +1 -1
  85. package/dist/client/assets/{autosend-BIORjgyl.js → autosend-DnpV-gpp.js} +1 -1
  86. package/dist/client/assets/{avatar-BbSwUQyb.js → avatar-BEChGFx_.js} +1 -1
  87. package/dist/client/assets/{badge-uMQ2OSUk.js → badge-DlwIZhYt.js} +1 -1
  88. package/dist/client/assets/{block-document-DAIAQG-x.js → block-document-CVQgWXY1.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-BtvKAriM.js → blocks-preview-workspace-context-LIf6Y3Wf.js} +1 -1
  90. package/dist/client/assets/{breadcrumb-BVc9LdQK.js → breadcrumb-CVBoYVDa.js} +1 -1
  91. package/dist/client/assets/{buckets-0jHe56LN.js → buckets-BNxfJUdD.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-xdV3Tlej.js → build-improve-prompt-doc-BojueIPy.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CO-Kfl87.js → bulk-category-panel--Sd4y8I1.js} +1 -1
  94. package/dist/client/assets/{calendar-C1IdNLA-.js → calendar---myt21s.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CInYqvLQ.js → capability-load-error-DE4nXkTf.js} +1 -1
  96. package/dist/client/assets/{category-editor-CF1CmT95.js → category-editor-Bm1OhVXt.js} +1 -1
  97. package/dist/client/assets/{chart-BFWDjh6T.js → chart-CQz-sp9S.js} +1 -1
  98. package/dist/client/assets/{chat-context-CD2t905l.js → chat-context-CigQFIrF.js} +1 -1
  99. package/dist/client/assets/{chat-draft-l_u8rYm5.js → chat-draft-DowTsQ5a.js} +1 -1
  100. package/dist/client/assets/{checkbox-CUWuaZGT.js → checkbox-ul_qDXO_.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Bz1SjYXJ.js → choose-editor-CnrA1-KS.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-1wO5q55y.js → claim-phase-copy-BYAB1Czx.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-D1BosDTZ.js → cli-auth-success-DDGa-14a.js} +1 -1
  104. package/dist/client/assets/{client-icons-CeAdASOH.js → client-icons-B6K_h_1z.js} +1 -1
  105. package/dist/client/assets/{collapsible-C549VSAh.js → collapsible-HcQLf87E.js} +1 -1
  106. package/dist/client/assets/{collection-detail-lQn0BuV4.js → collection-detail-D67vLPqg.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-CbpEAZR9.js → collection-display-button-RAuDavRQ.js} +1 -1
  108. package/dist/client/assets/{collection-search-BY_D-4Xu.js → collection-search-icw3NOdm.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-BZawHAOe.js → collection-table-wrapper-WQa99W12.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-D3p6wXuz.js → collection-tabs-D98CiePG.js} +1 -1
  111. package/dist/client/assets/{combobox-BR9S1uNJ.js → combobox-CDqgOlRO.js} +1 -1
  112. package/dist/client/assets/{command-Bc5s50z4.js → command-B8xkiuco.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-BdQdBU7y.js → companion-mcps-section-CeQtVwUw.js} +1 -1
  114. package/dist/client/assets/{connect-GXni-cDM.js → connect-CRzPLygu.js} +1 -1
  115. package/dist/client/assets/{connect-layout-ktsi_xnC.js → connect-layout-D0Wg9FJl.js} +1 -1
  116. package/dist/client/assets/{connection-TjS3izkF.js → connection-YU2qDPgo.js} +1 -1
  117. package/dist/client/assets/{connection-card-DNEz_R0k.js → connection-card-B0taizv-.js} +1 -1
  118. package/dist/client/assets/{connection-detail-DZhQtk0s.js → connection-detail-Bn0G4Wes.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CA2nMjJf.js → connection-form-helpers-CTaXx_AV.js} +1 -1
  120. package/dist/client/assets/{connections-DIJc1yUL.js → connections-M60VrJsO.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-CrlhgrRM.js → create-organization-dialog-Cyc1fSp9.js} +1 -1
  122. package/dist/client/assets/{decofile-api-D7ZHCNUy.js → decofile-api-0DF6BK8S.js} +1 -1
  123. package/dist/client/assets/{decopilot-4Rul2XdF.js → decopilot-bu1L070q.js} +1 -1
  124. package/dist/client/assets/{dialog-Mrm_FjPO.js → dialog-Cgb6nNga.js} +1 -1
  125. package/dist/client/assets/{discover-CF7nCkwv.js → discover-CAwJcBwl.js} +1 -1
  126. package/dist/client/assets/{domain-settings-CUKeC08b.js → domain-settings-BSR7qpN5.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-DTIeBDIH.js → download-app-dialog-Ca89v1sb.js} +1 -1
  128. package/dist/client/assets/{drawer-DfjSUJ0a.js → drawer-B9Ec8DO-.js} +1 -1
  129. package/dist/client/assets/{editor-uV92rbnR.js → editor-CGK-kOO1.js} +1 -1
  130. package/dist/client/assets/{empty-state-Q_WUfReS.js → empty-state-Dihk-JSs.js} +1 -1
  131. package/dist/client/assets/{empty-state-DVbnWIsr.js → empty-state-EvZtk0QO.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-CuwPMaw3.js → extract-connection-data-DIQBho2q.js} +1 -1
  133. package/dist/client/assets/{feature-gate-2LgTTjZY.js → feature-gate-DWxohdMP.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-DwvSEvIn.js → feature-paywall-BQ9_mpV-.js} +1 -1
  135. package/dist/client/assets/{file-explorer-C7qmBiQz.js → file-explorer--Hqae3zL.js} +1 -1
  136. package/dist/client/assets/{file-preview-sHM9JOsS.js → file-preview-DShpms1E.js} +1 -1
  137. package/dist/client/assets/{file-share-button-BY0Cu7BG.js → file-share-button-aNtwsWj1.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-D0g6iuIX.js → file-type-icon-TpiFmwkV.js} +1 -1
  139. package/dist/client/assets/{folder-icon-ByxAU6Yp.js → folder-icon-D4aLUwaZ.js} +1 -1
  140. package/dist/client/assets/{form-CLzrUZNk.js → form-Dx1-pFkl.js} +1 -1
  141. package/dist/client/assets/{gateway-client-Dhtlqu_k.js → gateway-client-RuR5Sgwm.js} +1 -1
  142. package/dist/client/assets/{general-knk_TeIm.js → general-D_pQn6h9.js} +1 -1
  143. package/dist/client/assets/{github-icon-DoIk_7id.js → github-icon-BCmmbu9G.js} +1 -1
  144. package/dist/client/assets/{home-oMo4RW6o.js → home-D5hbT3sC.js} +1 -1
  145. package/dist/client/assets/{hooks-BMOMofPN.js → hooks-C1_YzDjW.js} +1 -1
  146. package/dist/client/assets/{hooks-Bx2wDd6l.js → hooks-Dxf0iUx8.js} +1 -1
  147. package/dist/client/assets/{icon-button-DE6YwbX0.js → icon-button-DZaf2bob.js} +1 -1
  148. package/dist/client/assets/index-B7WbW8e4.css +1 -0
  149. package/dist/client/assets/{index-DqS2eDeC.js → index-B8rdF1mj.js} +1 -1
  150. package/dist/client/assets/{index-ovl7iN7e.js → index-BCWnemyS.js} +1 -1
  151. package/dist/client/assets/{index-BGSZ0_sE.js → index-C10vK9Gl.js} +1 -1
  152. package/dist/client/assets/{index-BGP_58ye.js → index-CCckg7jq.js} +1 -1
  153. package/dist/client/assets/{index-d9TZlbfN.js → index-CZgNJwMq.js} +1 -1
  154. package/dist/client/assets/{index-Dq4ETK4D.js → index-Ca5H_mlY.js} +1 -1
  155. package/dist/client/assets/{index-CIRfHbNo.js → index-CuKynvIK.js} +2 -2
  156. package/dist/client/assets/{index-CzMuJ5VR.js → index-DSfFiRiK.js} +1 -1
  157. package/dist/client/assets/{index-Bu2UvNKO.js → index-DZdHbrkX.js} +1 -1
  158. package/dist/client/assets/{index-C4h6JdMm.js → index-DsClCmX4.js} +1 -1
  159. package/dist/client/assets/{index-CDIKK8XE.js → index-NhsUUnWs.js} +1 -1
  160. package/dist/client/assets/{index-6OXJCbT4.js → index-Ou0kSF_4.js} +1 -1
  161. package/dist/client/assets/{index-C3yI-wPZ.js → index-m8M9XNiz.js} +1 -1
  162. package/dist/client/assets/{index-DVrVTpLB.js → index-mfLc4iDt.js} +1 -1
  163. package/dist/client/assets/{index-redirect-CzPTkmTV.js → index-redirect-cxGDeRou.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-Dtng7G3d.js → infiniteQueryObserver-DcexJUFl.js} +1 -1
  165. package/dist/client/assets/{infra-billing-Bw4GRy_4.js → infra-billing-Bm5byk8f.js} +1 -1
  166. package/dist/client/assets/{input-CHdcX8S5.js → input-CxixGGca.js} +1 -1
  167. package/dist/client/assets/{input-BT_0BgE5.js → input-D6xpm6o8.js} +1 -1
  168. package/dist/client/assets/{input-vVq9PHOi.js → input-DAhHA2Ec.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Dk--6q6l.js → integration-icon-V1IRIDo0.js} +1 -1
  170. package/dist/client/assets/{label-D50PwmJo.js → label-sXJ5lD1Q.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-Ay_yzntY.js → last-preview-page-D6_JHljG.js} +1 -1
  172. package/dist/client/assets/{layout-BSBqypiA.js → layout-B8Fn_UZq.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-BDEWrQHc.js → legacy-agents-deep-COHnfJ6M.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-CIB1MgqH.js → legacy-main-redirect-DC6wMjwz.js} +1 -1
  175. package/dist/client/assets/{library-n9grrWz3.js → library-CbGeI6nu.js} +1 -1
  176. package/dist/client/assets/{login-BIRI0tX8.js → login-B6k_w5JI.js} +1 -1
  177. package/dist/client/assets/{markdown-D24pd38Z.js → markdown-ZsxJYTnA.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-DG3CrmIu.js → mcp-app-renderer-D3wIwpKO.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-Cry0Iydf.js → mcp-oauth-BlhNJxOC.js} +1 -1
  180. package/dist/client/assets/{members-Bv-_s4bC.js → members-dZGKLQ5m.js} +1 -1
  181. package/dist/client/assets/{message-templates-NTWQzKwa.js → message-templates-w495jgqF.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-Ciz9Dfjq.js → mini-report-page-wChiKqpe.js} +1 -1
  183. package/dist/client/assets/{mock-board-COHQ1ooL.js → mock-board-DzoQZT_5.js} +3 -3
  184. package/dist/client/assets/{monaco-editor-eaoEeVnH.js → monaco-editor--rfKIHsG.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-Bvlv58gP.js → monitoring-stats-row-Db18eFc1.js} +1 -1
  186. package/dist/client/assets/{multi-select-CzC0rEJJ.js → multi-select-Dmek7lz3.js} +1 -1
  187. package/dist/client/assets/{mustache-DPx1n11E.js → mustache-DeeFRL9O.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-DQz1nrgX.js → oauth-callback-C4VmqAGn.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-SzX3-OhZ.js → oauth-callback-ai-provider-DqNzsmsa.js} +1 -1
  190. package/dist/client/assets/{onboarding-DJHWCOJQ.js → onboarding-xllcE5pS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-DrV8hFzZ.js → optimistic-project-sidebar-views-CPPQ3FAG.js} +1 -1
  192. package/dist/client/assets/{org-file-open-context-CPc9Gmwl.js → org-file-open-context-C3GnNEyb.js} +1 -1
  193. package/dist/client/assets/{organization-choice-FsHJP5ly.js → organization-choice-BpJUZ9eE.js} +1 -1
  194. package/dist/client/assets/{orgs-oiIXpw2r.js → orgs-_F33P6Z2.js} +1 -1
  195. package/dist/client/assets/{page-seo-form-Cl4iQBHJ.js → page-seo-form-0ddI5t6v.js} +1 -1
  196. package/dist/client/assets/{pair-Cb-OQogc.js → pair-CbghiNzY.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-0h_s2Opb.js → plan-ladder-DEFdJtel.js} +1 -1
  198. package/dist/client/assets/{popover-BeMA1p6R.js → popover-C6yHcj70.js} +1 -1
  199. package/dist/client/assets/{post-calendar-CGYQt2F3.js → post-calendar-CdNsNph9.js} +1 -1
  200. package/dist/client/assets/{post-editor-jkJ4iVh0.js → post-editor-CPeRSjBp.js} +1 -1
  201. package/dist/client/assets/{preview-content-CLDea9bT.js → preview-content-CpOQvNwD.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-CNhc9GEX.js → preview-dialog-C-feCeog.js} +1 -1
  203. package/dist/client/assets/{primitives-BgF4Jb6N.js → primitives-ChmMfj9v.js} +1 -1
  204. package/dist/client/assets/{profile-CXuZoTDK.js → profile-V2BmVtCD.js} +1 -1
  205. package/dist/client/assets/{project-app-view-CrMbD3xy.js → project-app-view-Df3nXMqu.js} +1 -1
  206. package/dist/client/assets/{project-feed-CSAt8TDH.js → project-feed-DP96GA1D.js} +1 -1
  207. package/dist/client/assets/{project-icon-wLSVGikU.js → project-icon-DpLJ2_Oe.js} +1 -1
  208. package/dist/client/assets/project-reports-D63nlO5g.js +1 -0
  209. package/dist/client/assets/project-tasks-_N74f8SM.js +1 -0
  210. package/dist/client/assets/{prompts-FczZDZhL.js → prompts-DqZkMgF_.js} +1 -1
  211. package/dist/client/assets/record-editor-B-lKG-xN.js +1 -0
  212. package/dist/client/assets/{redirect-editor-C8CXeIKx.js → redirect-editor-BzITPvLZ.js} +1 -1
  213. package/dist/client/assets/reports-BcKOR84m.js +1 -0
  214. package/dist/client/assets/{reports-BnpzgMUZ.js → reports-C04RdVL2.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-BjA0RUmv.js → reports-onboarding-Bu10YnNN.js} +1 -1
  216. package/dist/client/assets/{reports-tab-6kIPzfDa.js → reports-tab-DbjnZZdG.js} +2 -2
  217. package/dist/client/assets/{repositories-UyvGNZyE.js → repositories-TQS3oe_Z.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-DGMV6v91.js → repository-import-picker-ir5lpemT.js} +1 -1
  219. package/dist/client/assets/{repository-picker-CAnr38vT.js → repository-picker-8uzqMUSJ.js} +1 -1
  220. package/dist/client/assets/{require-capability-C3pocO29.js → require-capability-DR84qrNv.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-CRoz7eVL.js → required-auth-layout-BiKqBIJR.js} +1 -1
  222. package/dist/client/assets/{reset-password-BcTo1zVh.js → reset-password-4NRQIi8T.js} +1 -1
  223. package/dist/client/assets/{resizable-DMdqS7KS.js → resizable-g50QqQLR.js} +1 -1
  224. package/dist/client/assets/{review-settings-Dos4EaZT.js → review-settings-D8BQ_JzW.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-ChhDCbLg.js → rich-text-link-control-BEQwt7AM.js} +1 -1
  226. package/dist/client/assets/{roles-Dso_rZka.js → roles-C5ucnXFf.js} +1 -1
  227. package/dist/client/assets/{route-BW7OU3VN.js → route-BYaroh6V.js} +1 -1
  228. package/dist/client/assets/{route-Dpgu6bM3.js → route-Cu9dUUX5.js} +1 -1
  229. package/dist/client/assets/{route-CAV5Iqq6.js → route-Dh7nT37A.js} +1 -1
  230. package/dist/client/assets/{route-page-header-szay9ZHs.js → route-page-header-BLIm8Sjw.js} +1 -1
  231. package/dist/client/assets/{runnable-block-editor-BMG0H3oq.js → runnable-block-editor-CsvQsGtO.js} +1 -1
  232. package/dist/client/assets/{sandbox-lifecycle-context-DQkSTq-X.js → sandbox-lifecycle-context-DpPd4Ppi.js} +1 -1
  233. package/dist/client/assets/{schema-CuA-4jkq.js → schema-BFAgc9vB.js} +1 -1
  234. package/dist/client/assets/{scroll-area-DULf_VBP.js → scroll-area-BlAA-Bao.js} +1 -1
  235. package/dist/client/assets/{search-input-PUZww2fu.js → search-input-Bh8Hda5I.js} +1 -1
  236. package/dist/client/assets/{search-toggle-DjiUvJCk.js → search-toggle-DizwDv5R.js} +1 -1
  237. package/dist/client/assets/{secret-picker-CtP3cGK6.js → secret-picker-DaPihddw.js} +1 -1
  238. package/dist/client/assets/{secrets-BFQYAqak.js → secrets-dO2-dm88.js} +1 -1
  239. package/dist/client/assets/{sections-editor-zyGXF2HJ.js → sections-editor-BJomHWUT.js} +1 -1
  240. package/dist/client/assets/{select-DopB4Bge.js → select-BanIfiiK.js} +1 -1
  241. package/dist/client/assets/{select-model-DwZgxu7Z.js → select-model-BEVKH5_m.js} +1 -1
  242. package/dist/client/assets/{seo-editor-BHduREOx.js → seo-editor-fZ9M3Gp-.js} +1 -1
  243. package/dist/client/assets/{separator-Dfqi-trY.js → separator-D5oH9Tc6.js} +1 -1
  244. package/dist/client/assets/{settings-tab-DHGTgDCA.js → settings-tab-BOSNM5xW.js} +1 -1
  245. package/dist/client/assets/{sheet-B07_w8Cy.js → sheet-JibTB_ju.js} +1 -1
  246. package/dist/client/assets/{shell-layout-CiIUdC3d.js → shell-layout-C9P3RmGa.js} +1 -1
  247. package/dist/client/assets/{sidebar-WPwPo4Mo.js → sidebar-CKW8SX5I.js} +1 -1
  248. package/dist/client/assets/{skill-preview-4uKeVlCE.js → skill-preview-CpSq5DoK.js} +1 -1
  249. package/dist/client/assets/{skills-Z8QbBG5G.js → skills-CR8unPX_.js} +1 -1
  250. package/dist/client/assets/{sso-D_WopQAs.js → sso-CE4LK0kP.js} +1 -1
  251. package/dist/client/assets/{switch-CcpcKSH6.js → switch-4HMgPUts.js} +1 -1
  252. package/dist/client/assets/{synced-repos-Dx3NDxK3.js → synced-repos-Ca7MHWA4.js} +1 -1
  253. package/dist/client/assets/{table-eWLURdnt.js → table-CJ1bijPH.js} +1 -1
  254. package/dist/client/assets/{tabs-C-VUdz3i.js → tabs-BhWYNgYG.js} +1 -1
  255. package/dist/client/assets/{task-board-C0tuJmTv.js → task-board-DEK9EtO8.js} +1 -1
  256. package/dist/client/assets/{task-route-K8xxtdH-.js → task-route-sectJiZr.js} +1 -1
  257. package/dist/client/assets/{task-status-DYCL1yMW.js → task-status-B0xsnDKH.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-DGqeyHZi.js → taskboard-analytics-CGcaGS9p.js} +1 -1
  259. package/dist/client/assets/{tasks-DW-13Om3.js → tasks-DMOF4nmk.js} +1 -1
  260. package/dist/client/assets/tasks-iUTJfP23.js +1 -0
  261. package/dist/client/assets/{textarea-DF8NPlrq.js → textarea-DMkTjvEF.js} +1 -1
  262. package/dist/client/assets/{thread-button-DfRqzbbf.js → thread-button-CuUIbUBd.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DrnToeJq.js → thread-intent-CxJrbPCr.js} +1 -1
  264. package/dist/client/assets/{thread-route-_5woxobJ.js → thread-route-B2U_o9C3.js} +1 -1
  265. package/dist/client/assets/{thread-route-oXaLzozB.js → thread-route-DKPQW82J.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-L3KiT5N3.js → thread-sheet-body-DSRzkXP7.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DS1tggto.js → toggle-group-CMNW4mwx.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-CHTgVRqh.js → toolbar-icon-button-NrY5UDrB.js} +1 -1
  269. package/dist/client/assets/{tooltip-D49FN_aN.js → tooltip-CxEILWvZ.js} +1 -1
  270. package/dist/client/assets/{track-C1nVqj6n.js → track-BDhbKfjd.js} +1 -1
  271. package/dist/client/assets/{types-xUlwJqmy.js → types-Dm2A_SzK.js} +1 -1
  272. package/dist/client/assets/{usage-stats-iRnsAutO.js → usage-stats-BUdPL4y7.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CvzsHl-J.js → use-ai-providers-WVDlQI7a.js} +1 -1
  274. package/dist/client/assets/{use-automations-SyRhYI2V.js → use-automations-DhMVIrbH.js} +1 -1
  275. package/dist/client/assets/{use-autosave-zQPr0q1b.js → use-autosave-Cs2l4kvH.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-C9x-d8Io.js → use-connect-companion-C8XtHv_z.js} +1 -1
  277. package/dist/client/assets/{use-connection-DJ_-6CKa.js → use-connection-BE5RGCED.js} +1 -1
  278. package/dist/client/assets/{use-copy-BcYXDKFV.js → use-copy-CQHz89FX.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-Bq_y-eu_.js → use-create-virtual-mcp-Clu3kTW-.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-D0LsXuaH.js → use-date-fns-locale-CsbCUQol.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-CuCDxLLJ.js → use-debounced-autosave-CELzcq38.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-BHs38KlD.js → use-debounced-value-CYsH4FnM.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DlkNmD5l.js → use-deco-credits-BNjDojPM.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-bFNJbvta.js → use-decopilot-events-BZRpbXtL.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-9eqhDSAH.js → use-delete-connection-DZGvcwH6.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-C6RecmX2.js → use-deployment-admin-3CKmN4Dm.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-Czw7GDek.js → use-entitlements-CtDOlLOz.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-BVc9QL4W.js → use-fast-preview-draft-url-h1FQgacX.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-HQwDeDNl.js → use-file-configs-CCC51CiC.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-5HBhdptJ.js → use-in-settings-D6Jf8r1J.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-CN_tSwpY.js → use-infinite-scroll-DPL5T_J6.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-b5UAVNZB.js → use-join-requests-xYwPRZaP.js} +1 -1
  293. package/dist/client/assets/{use-main-panel-tabs-Cwhf_l7Z.js → use-main-panel-tabs-DFsNbB7_.js} +1 -1
  294. package/dist/client/assets/{use-mcp-auth-status-CP_j-a5t.js → use-mcp-auth-status-C814rz9a.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-CnIZ_wv0.js → use-mcp-client-DVdW13n2.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-eemqvkiM.js → use-mcp-prompts-B2lNJtI0.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-DViJqpMQ.js → use-mcp-tools-yL6ngJhN.js} +1 -1
  298. package/dist/client/assets/{use-members-D2JQSmob.js → use-members-BWGnt3xz.js} +1 -1
  299. package/dist/client/assets/{use-mobile-B5qpDLZq.js → use-mobile-uPe7iIqt.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-DSnSYxD2.js → use-navigate-to-agent-SCyHTgIX.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-4fzqiTvB.js → use-open-billing-url-Cg1ys7hu.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-D6LbyZqv.js → use-org-auth-client-CFw5de6Q.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-YTzVKtQ-.js → use-org-fs-Bn_T0aJ_.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-CiMWpZzV.js → use-org-repo-syncs-DU8DfREe.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-B_sUEO3Y.js → use-org-sso-BE_oQrhh.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-E9lBVhF9.js → use-organization-roles-Dux9hCaf.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-DpV4hf3B.js → use-organization-settings-DxdRLAFr.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-ClgRa3d3.js → use-panel-navigate-Cv7gWgrI.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-ojMcETii.js → use-project-native-view-presence-Bb7AFTdc.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-Y_iTk8Hz.js → use-project-scope--f8QE0rR.js} +1 -1
  311. package/dist/client/assets/{use-releases-Dx4mnL7m.js → use-releases-DVpnjCc7.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-XVMvTq7T.js → use-reports-diagnostic-CG79-ua-.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-BhDdbyHl.js → use-route-default-main-GB9j_Yad.js} +1 -1
  314. package/dist/client/assets/{use-secrets-BB1Osv03.js → use-secrets-Bz4y4UnB.js} +1 -1
  315. package/dist/client/assets/{use-section-preview-base-DLktnSfm.js → use-section-preview-base-DPItNU2_.js} +1 -1
  316. package/dist/client/assets/{use-session-runtime-DO5r3w4m.js → use-session-runtime-D07OOfYZ.js} +1 -1
  317. package/dist/client/assets/{use-tags-CEeYoNdt.js → use-tags-ClvpULLx.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-D7G9K6PS.js → use-task-board-analytics-BbJwbe-h.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-BdSaCf9d.js → use-task-metadata-9BgABmJR.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DHTiy2SY.js → use-thread-outputs-BZFz5o_S.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-DfVXeR1f.js → use-virtual-mcp-CkNe2Ju7.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-vUhOQoVF.js +1 -0
  323. package/dist/client/assets/{useQueries-D83VS41L.js → useQueries-R9IL0RuG.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-B8mFqMTg.js +1 -0
  325. package/dist/client/assets/{users-DOJ2AeT_.js → users-BUKS5lBn.js} +1 -1
  326. package/dist/client/assets/{utils-Botpu0EJ.js → utils-DEVAjabd.js} +1 -1
  327. package/dist/client/assets/{variant-calendar-D8XdwW-M.js → variant-calendar-ChKxHp3R.js} +1 -1
  328. package/dist/client/assets/{variant-matcher-override-C8VoWaON.js → variant-matcher-override-DNboF61u.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-BPl38sGT.js → view-mode-toggle-BL5qLMml.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-RQTG-mIx.js → virtual-mcp-aM5OQNHZ.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-Bfmsm5RQ.js +0 -1
  336. package/dist/client/assets/agent-deck--dfvwlwZ.js +0 -1
  337. package/dist/client/assets/agent-file-C6zCpSBU.js +0 -1
  338. package/dist/client/assets/agent-library-file-Cak5Iflg.js +0 -1
  339. package/dist/client/assets/agent-settings-BGNj6VxT.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cm41tdxL.js +0 -2
  341. package/dist/client/assets/agent-site-editor-preview-DfKy_DS-.js +0 -518
  342. package/dist/client/assets/agent-view-B5dq3i8X.js +0 -1
  343. package/dist/client/assets/api-keys-5id7lbRp.js +0 -1
  344. package/dist/client/assets/app-editor-BpT90ZR4.js +0 -1
  345. package/dist/client/assets/index-B88q0man.css +0 -1
  346. package/dist/client/assets/project-reports-C57rGt8f.js +0 -1
  347. package/dist/client/assets/project-tasks-eJ1qu-Dh.js +0 -1
  348. package/dist/client/assets/record-editor-pT-KeZ17.js +0 -1
  349. package/dist/client/assets/reports-Cf79syUF.js +0 -1
  350. package/dist/client/assets/tasks-BXxuWADk.js +0 -1
  351. package/dist/client/assets/useInfiniteQuery-BjPoSioc.js +0 -1
  352. package/dist/client/assets/useSuspenseInfiniteQuery-nb02ukIZ.js +0 -1
@@ -1 +1 @@
1
- import{ap as ve,bQ as Oe,bR as Me,aq as de,bP as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eM as Re,Z as Ue,n as Fe,f6 as ue,Y as Le,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,ff as Ke,o as Qe,ao as Xe,an as We,t as J}from"./index-CIRfHbNo.js";import{g as Ye}from"./extract-connection-data-CuwPMaw3.js";import{E as _e}from"./empty-state-DVbnWIsr.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-CA2nMjJf.js";import{c as nt,S as it,D as ot}from"./index-C3yI-wPZ.js";import{u as we,T as at}from"./use-mcp-auth-status-CP_j-a5t.js";import{a as lt}from"./use-members-D2JQSmob.js";import{A as rt}from"./avatar-BbSwUQyb.js";import{a as ke,b as Ie,u as ct}from"./use-connection-DJ_-6CKa.js";import{u as Te}from"./use-mcp-client-CnIZ_wv0.js";import{u as dt}from"./use-mcp-tools-DViJqpMQ.js";import{a as mt}from"./use-mcp-prompts-eemqvkiM.js";import{i as ut,a as xt}from"./mcp-oauth-Cry0Iydf.js";import{I as ae}from"./integration-icon-Dk--6q6l.js";import{s as pt}from"./Plus-BJXRYkOi.js";import{b6 as ft,ak as ht,L as gt,bk as jt,j as ne,aj as bt}from"./agent-icon-CPxPcoq5.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-UcpZc1Ld.js";import{s as re}from"./Trash01-BKZ4yEpo.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-B07_w8Cy.js";import{F as G,b as H,c as K,d as V,f as Q,e as kt,a as It}from"./form-CLzrUZNk.js";import{I as W}from"./input-CHdcX8S5.js";import{u as Tt,D as At}from"./use-delete-connection-9eqhDSAH.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-Bvlv58gP.js";import{b as Mt,c as zt,d as Et}from"./chart-BFWDjh6T.js";import{b as Rt}from"./use-virtual-mcp-DfVXeR1f.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-C-VUdz3i.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-xUlwJqmy.js";import{M as Lt}from"./mcp-app-renderer-DG3CrmIu.js";import{C as Vt}from"./collection-search-BY_D-4Xu.js";import{B as Bt}from"./badge-uMQ2OSUk.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-DopB4Bge.js";import{i as qt}from"./CheckCircle-CaiMiFDe.js";import{t as Gt}from"./ChevronUp-DeResoiH.js";import{a as Ht}from"./UserSquare--C8Iia3e.js";import{s as Kt}from"./XClose-BlVZtXd9.js";import{p as Qt,i as Xt}from"./connection-TjS3izkF.js";import"./metadata-D72DunRR.js";import"./sidebar-WPwPo4Mo.js";import"./LayoutLeft-BN-mFj8G.js";import"./use-mobile-B5qpDLZq.js";import"./tooltip-D49FN_aN.js";import"./index-ovl7iN7e.js";import"./Key01-DSGm0aza.js";import"./auth-tf_g8iMx.js";import"./index-C4h6JdMm.js";import"./index-6OXJCbT4.js";import"./index-BGP_58ye.js";import"./index-d9TZlbfN.js";import"./popover-BeMA1p6R.js";import"./Check-CeoOppXe.js";import"./SearchMd-DYmOASVZ.js";import"./use-create-virtual-mcp-Bq_y-eu_.js";import"./use-navigate-to-agent-DSnSYxD2.js";import"./hooks-Bx2wDd6l.js";import"./backoff-8mStPHYB.js";import"./task-board-C0tuJmTv.js";import"./schema-CuA-4jkq.js";import"./thread-intent-DrnToeJq.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-C56Lk2NI.js";import"./use-org-auth-client-D6LbyZqv.js";import"./User01-BSxIafNg.js";import"./AlertCircle-DamanO0X.js";import"./ArrowUp-BtBGOCWY.js";import"./ArrowLeft-SpZlA2bb.js";import"./ArrowRight-DAZKfxXh.js";import"./XCircle-DedN3aZE.js";import"./ZoomOut-AvI_Dq16.js";import"./Globe04-u4Rssq_0.js";import"./Copy01-CF3qS6LP.js";import"./CreditCard01-DGTLrWaP.js";import"./DotsVertical-DKsMx6HW.js";import"./Download01-CgN_oEm1.js";import"./Share07-CYv18Ut8.js";import"./Image01-BBs4WVyw.js";import"./Link01-BqaeC2vU.js";import"./LinkExternal01-LsY731Ce.js";import"./Monitor01-Wv2_lYrq.js";import"./Sun-CzrsJre-.js";import"./Package-BpLpYayL.js";import"./Palette-zNU-Z5w1.js";import"./SearchLg-CfdMUZPl.js";import"./Stars01-qZBU4wqC.js";import"./Upload01-BRaprouM.js";import"./Users01-B2oROtAL.js";import"./X-LWyEp2XB.js";import"./Zap-C-Muwsv6.js";import"./label-D50PwmJo.js";import"./alert-dialog-i1rWKvRm.js";import"./CartesianChart-C4cSotGX.js";import"./AreaChart-DAjzIUVt.js";import"./ErrorBarContext-BU77D7cf.js";import"./Sector-Bq5ZB3Ar.js";const Wt=ve({scopes:ze(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:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,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 S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,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]!==I||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":b,children:E}),e[47]=I,e[48]=v,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=k):k=e[55];let P;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();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 o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();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 m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const 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:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=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")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.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:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.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")})}),x.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:x.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(Ot,{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=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=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]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{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]!==o||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:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=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=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}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]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=ke(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==I?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{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]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}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"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=ke(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,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 S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let I;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(I=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=I):I=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>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(N.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(vt,{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(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&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]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let k;e[56]!==z?(k=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=k):k=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==I||e[63]!==b||e[64]!==E||e[65]!==k||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[I,b,E,k,R]})}),e[62]=I,e[63]=b,e[64]=E,e[65]=k,e[66]=R,e[67]=f):f=e[67],f}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(jt,{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(gt,{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(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?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")})]}),p&&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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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:x.value,onValueChange:x.onChange,children:[t.jsx(V,{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(V,{children:t.jsx(W,{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:x.value,onValueChange:x.onChange,children:[t.jsx(V,{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(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),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:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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(Ve,{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(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.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:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(kt,{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(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(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"&&Xt(s.connection_headers)){const c=s.connection_headers,a=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:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=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),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=Ie(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},I=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},k=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>k(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{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(It,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,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 f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.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:o,onConfigure:f=>g(f),onAuthenticate:f=>k(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await k(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=Ie();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const k=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=k;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?k:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:k}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const I=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==k||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:k,description:P,actions:N})}),s[39]=k,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:I,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=I,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}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(Z.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 yi(){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{yi as default};
1
+ import{ap as ve,bQ as Oe,bR as Me,aq as de,bP as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eM as Re,Z as Ue,n as Fe,f6 as ue,Y as Le,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,ff as Ke,o as Qe,ao as Xe,an as We,t as J}from"./index-CuKynvIK.js";import{g as Ye}from"./extract-connection-data-DIQBho2q.js";import{E as _e}from"./empty-state-EvZtk0QO.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-CTaXx_AV.js";import{c as nt,S as it,D as ot}from"./index-m8M9XNiz.js";import{u as we,T as at}from"./use-mcp-auth-status-C814rz9a.js";import{a as lt}from"./use-members-BWGnt3xz.js";import{A as rt}from"./avatar-BEChGFx_.js";import{a as ke,b as Ie,u as ct}from"./use-connection-BE5RGCED.js";import{u as Te}from"./use-mcp-client-DVdW13n2.js";import{u as dt}from"./use-mcp-tools-yL6ngJhN.js";import{a as mt}from"./use-mcp-prompts-B2lNJtI0.js";import{i as ut,a as xt}from"./mcp-oauth-BlhNJxOC.js";import{I as ae}from"./integration-icon-V1IRIDo0.js";import{s as pt}from"./Plus-40Vqbuez.js";import{b6 as ft,ak as ht,L as gt,bk as jt,j as ne,aj as bt}from"./agent-icon-yvE2OrmS.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-C-oe4aXW.js";import{s as re}from"./Trash01-Byz0_Sy5.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-JibTB_ju.js";import{F as G,b as H,c as K,d as V,f as Q,e as kt,a as It}from"./form-Dx1-pFkl.js";import{I as W}from"./input-CxixGGca.js";import{u as Tt,D as At}from"./use-delete-connection-DZGvcwH6.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-Db18eFc1.js";import{b as Mt,c as zt,d as Et}from"./chart-CQz-sp9S.js";import{b as Rt}from"./use-virtual-mcp-CkNe2Ju7.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-BhWYNgYG.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-Dm2A_SzK.js";import{M as Lt}from"./mcp-app-renderer-D3wIwpKO.js";import{C as Vt}from"./collection-search-icw3NOdm.js";import{B as Bt}from"./badge-DlwIZhYt.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BanIfiiK.js";import{i as qt}from"./CheckCircle-CKcxanRZ.js";import{t as Gt}from"./ChevronUp-DSQ_1BER.js";import{a as Ht}from"./UserSquare-D-qt0de_.js";import{s as Kt}from"./XClose-CVQLXZni.js";import{p as Qt,i as Xt}from"./connection-YU2qDPgo.js";import"./metadata-D72DunRR.js";import"./sidebar-CKW8SX5I.js";import"./LayoutLeft-DpIebcC-.js";import"./use-mobile-uPe7iIqt.js";import"./tooltip-CxEILWvZ.js";import"./index-BCWnemyS.js";import"./Key01-BV_ymGg3.js";import"./auth-DbhfOiDD.js";import"./index-DsClCmX4.js";import"./index-Ou0kSF_4.js";import"./index-CCckg7jq.js";import"./index-CZgNJwMq.js";import"./popover-C6yHcj70.js";import"./Check-C99gsNHm.js";import"./SearchMd-kVGeqQ7a.js";import"./use-create-virtual-mcp-Clu3kTW-.js";import"./use-navigate-to-agent-SCyHTgIX.js";import"./hooks-Dxf0iUx8.js";import"./backoff-8mStPHYB.js";import"./task-board-DEK9EtO8.js";import"./schema-BFAgc9vB.js";import"./thread-intent-CxJrbPCr.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-DbFIyI2n.js";import"./use-org-auth-client-CFw5de6Q.js";import"./User01-XeAWOYXy.js";import"./AlertCircle-Plbq3B-q.js";import"./ArrowUp-6u2hUOnH.js";import"./ArrowLeft-DrGT8UWu.js";import"./ArrowRight-CbriRBrq.js";import"./XCircle-CQMzne_o.js";import"./ZoomOut-BWCMlmIP.js";import"./Globe04-CGVAMpAe.js";import"./Copy01-BenS5ro_.js";import"./CreditCard01-YK1yCS4W.js";import"./DotsVertical-CQ6LBNOP.js";import"./Download01-Bp4nnCQ1.js";import"./Share07-CcQxNSX3.js";import"./Image01-BggoPRkg.js";import"./Link01-OIIXb7cI.js";import"./LinkExternal01-CPCL9Cco.js";import"./Monitor01-CDgu8CIt.js";import"./Sun-Be8FNPF2.js";import"./Package-Ci_Iuppc.js";import"./Palette-IB6rbtm1.js";import"./SearchLg-CAy6qghA.js";import"./Stars01-BMd1nnPj.js";import"./Upload01-C2s_RH4H.js";import"./Users01-C3on152s.js";import"./X-RprAX0Ua.js";import"./Zap-DzoV5VQ9.js";import"./label-sXJ5lD1Q.js";import"./alert-dialog-BCduxUz6.js";import"./CartesianChart-COgbk__t.js";import"./AreaChart-B_NHmXx3.js";import"./ErrorBarContext-CIx228C0.js";import"./Sector-BvGNn9CG.js";const Wt=ve({scopes:ze(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:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,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 S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,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]!==I||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":b,children:E}),e[47]=I,e[48]=v,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=k):k=e[55];let P;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();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 o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();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 m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const 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:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=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")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.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:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.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")})}),x.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:x.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(Ot,{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=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=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]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{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]!==o||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:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=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=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}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]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=ke(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==I?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{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]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}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"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=ke(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,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 S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let I;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(I=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=I):I=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>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(N.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(vt,{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(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&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]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let k;e[56]!==z?(k=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=k):k=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==I||e[63]!==b||e[64]!==E||e[65]!==k||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[I,b,E,k,R]})}),e[62]=I,e[63]=b,e[64]=E,e[65]=k,e[66]=R,e[67]=f):f=e[67],f}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(jt,{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(gt,{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(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?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")})]}),p&&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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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:x.value,onValueChange:x.onChange,children:[t.jsx(V,{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(V,{children:t.jsx(W,{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:x.value,onValueChange:x.onChange,children:[t.jsx(V,{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(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),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:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{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(Ve,{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(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.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:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(kt,{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(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(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"&&Xt(s.connection_headers)){const c=s.connection_headers,a=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:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=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),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=Ie(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},I=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},k=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>k(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{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(It,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,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 f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.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:o,onConfigure:f=>g(f),onAuthenticate:f=>k(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await k(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=Ie();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const k=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=k;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?k:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:k}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const I=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==k||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:k,description:P,actions:N})}),s[39]=k,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:I,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=I,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}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(Z.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 yi(){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{yi as default};
@@ -1 +1 @@
1
- import{ap as H,bQ as A,bR as I,aq as o,bP as j,bO as z,c as L,j as u,B as C}from"./index-CIRfHbNo.js";import{I as R}from"./input-CHdcX8S5.js";import{s as W}from"./Plus-BJXRYkOi.js";import{s as q}from"./Trash01-BKZ4yEpo.js";const K=H({key:o().min(1,"Key is required"),value:o()}),M=H({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(K).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 O(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(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;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,s)=>s!==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 s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},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 s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},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,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(R,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(R,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),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(C,{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 D(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 F(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(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(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 Q(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(i=>(i.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 Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,Q as a,J as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{ap as H,bQ as A,bR as I,aq as o,bP as j,bO as z,c as L,j as u,B as C}from"./index-CuKynvIK.js";import{I as R}from"./input-CxixGGca.js";import{s as W}from"./Plus-40Vqbuez.js";import{s as q}from"./Trash01-Byz0_Sy5.js";const K=H({key:o().min(1,"Key is required"),value:o()}),M=H({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(K).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 O(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(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;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,s)=>s!==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 s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},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 s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},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,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(R,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(R,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),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(C,{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 D(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 F(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(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(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 Q(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(i=>(i.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 Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,Q as a,J as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,Z as qe,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,ao as et,an as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-CIRfHbNo.js";import{a as we,g as it,e as ct}from"./extract-connection-data-CuwPMaw3.js";import{C as lt}from"./collection-display-button-CbpEAZR9.js";import{S as rt}from"./search-input-PUZww2fu.js";import{C as at}from"./collection-tabs-D3p6wXuz.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-DNEz_R0k.js";import{E as ut}from"./empty-state-DVbnWIsr.js";import{u as gt,D as mt}from"./use-delete-connection-9eqhDSAH.js";import{u as pt}from"./use-infinite-scroll-CN_tSwpY.js";import{u as Ie}from"./use-mobile-B5qpDLZq.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-i1rWKvRm.js";import{aj as xe,bj as bt,ak as _t,b6 as Dt,j as Se}from"./agent-icon-CPxPcoq5.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-Mrm_FjPO.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-DfjSUJ0a.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-CLzrUZNk.js";import{I as se}from"./input-CHdcX8S5.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-DopB4Bge.js";import{T as Lt}from"./textarea-DF8NPlrq.js";import{b as Ve,u as zt}from"./use-connection-DJ_-6CKa.js";import{m as Et}from"./use-mcp-client-CnIZ_wv0.js";import{b as Bt}from"./use-virtual-mcp-DfVXeR1f.js";import{g as Kt}from"./types-xUlwJqmy.js";import{s as Le}from"./Plus-BJXRYkOi.js";import{a as Ht}from"./UserSquare--C8Iia3e.js";import{s as ze}from"./XClose-BlVZtXd9.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-CA2nMjJf.js";import{a as Qt}from"./authenticate-and-persist-oauth-BicDqk1l.js";import{I as Yt}from"./integration-icon-Dk--6q6l.js";import{C as Ee}from"./checkbox-CUWuaZGT.js";import{i as Jt}from"./DotsVertical-DKsMx6HW.js";import{s as Be}from"./Eye-C56Lk2NI.js";import{s as Ke}from"./Trash01-BKZ4yEpo.js";import"./connection-TjS3izkF.js";import"./ArrowUp-BtBGOCWY.js";import"./Check-CeoOppXe.js";import"./tooltip-D49FN_aN.js";import"./index-ovl7iN7e.js";import"./view-mode-toggle-BPl38sGT.js";import"./badge-uMQ2OSUk.js";import"./SearchMd-DYmOASVZ.js";import"./useInfiniteQuery-BjPoSioc.js";import"./infiniteQueryObserver-Dtng7G3d.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-DamanO0X.js";import"./Tool01-UcpZc1Ld.js";import"./ArrowLeft-SpZlA2bb.js";import"./ArrowRight-DAZKfxXh.js";import"./XCircle-DedN3aZE.js";import"./ZoomOut-AvI_Dq16.js";import"./Globe04-u4Rssq_0.js";import"./CheckCircle-CaiMiFDe.js";import"./ChevronUp-DeResoiH.js";import"./Copy01-CF3qS6LP.js";import"./CreditCard01-DGTLrWaP.js";import"./Download01-CgN_oEm1.js";import"./Share07-CYv18Ut8.js";import"./Image01-BBs4WVyw.js";import"./Key01-DSGm0aza.js";import"./LayoutLeft-BN-mFj8G.js";import"./Link01-BqaeC2vU.js";import"./LinkExternal01-LsY731Ce.js";import"./Monitor01-Wv2_lYrq.js";import"./Sun-CzrsJre-.js";import"./Package-BpLpYayL.js";import"./Palette-zNU-Z5w1.js";import"./SearchLg-CfdMUZPl.js";import"./Stars01-qZBU4wqC.js";import"./Upload01-BRaprouM.js";import"./User01-BSxIafNg.js";import"./Users01-B2oROtAL.js";import"./X-LWyEp2XB.js";import"./Zap-C-Muwsv6.js";import"./label-D50PwmJo.js";import"./auth-tf_g8iMx.js";import"./mcp-oauth-Cry0Iydf.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=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,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{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(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),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:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function Ls(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};
1
+ import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,Z as qe,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,ao as et,an as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-CuKynvIK.js";import{a as we,g as it,e as ct}from"./extract-connection-data-DIQBho2q.js";import{C as lt}from"./collection-display-button-RAuDavRQ.js";import{S as rt}from"./search-input-Bh8Hda5I.js";import{C as at}from"./collection-tabs-D98CiePG.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-B0taizv-.js";import{E as ut}from"./empty-state-EvZtk0QO.js";import{u as gt,D as mt}from"./use-delete-connection-DZGvcwH6.js";import{u as pt}from"./use-infinite-scroll-DPL5T_J6.js";import{u as Ie}from"./use-mobile-uPe7iIqt.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-BCduxUz6.js";import{aj as xe,bj as bt,ak as _t,b6 as Dt,j as Se}from"./agent-icon-yvE2OrmS.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-Cgb6nNga.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-B9Ec8DO-.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-Dx1-pFkl.js";import{I as se}from"./input-CxixGGca.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-BanIfiiK.js";import{T as Lt}from"./textarea-DMkTjvEF.js";import{b as Ve,u as zt}from"./use-connection-BE5RGCED.js";import{m as Et}from"./use-mcp-client-DVdW13n2.js";import{b as Bt}from"./use-virtual-mcp-CkNe2Ju7.js";import{g as Kt}from"./types-Dm2A_SzK.js";import{s as Le}from"./Plus-40Vqbuez.js";import{a as Ht}from"./UserSquare-D-qt0de_.js";import{s as ze}from"./XClose-CVQLXZni.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-CTaXx_AV.js";import{a as Qt}from"./authenticate-and-persist-oauth-CTqF0T3I.js";import{I as Yt}from"./integration-icon-V1IRIDo0.js";import{C as Ee}from"./checkbox-ul_qDXO_.js";import{i as Jt}from"./DotsVertical-CQ6LBNOP.js";import{s as Be}from"./Eye-DbFIyI2n.js";import{s as Ke}from"./Trash01-Byz0_Sy5.js";import"./connection-YU2qDPgo.js";import"./ArrowUp-6u2hUOnH.js";import"./Check-C99gsNHm.js";import"./tooltip-CxEILWvZ.js";import"./index-BCWnemyS.js";import"./view-mode-toggle-BL5qLMml.js";import"./badge-DlwIZhYt.js";import"./SearchMd-kVGeqQ7a.js";import"./useInfiniteQuery-vUhOQoVF.js";import"./infiniteQueryObserver-DcexJUFl.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-Plbq3B-q.js";import"./Tool01-C-oe4aXW.js";import"./ArrowLeft-DrGT8UWu.js";import"./ArrowRight-CbriRBrq.js";import"./XCircle-CQMzne_o.js";import"./ZoomOut-BWCMlmIP.js";import"./Globe04-CGVAMpAe.js";import"./CheckCircle-CKcxanRZ.js";import"./ChevronUp-DSQ_1BER.js";import"./Copy01-BenS5ro_.js";import"./CreditCard01-YK1yCS4W.js";import"./Download01-Bp4nnCQ1.js";import"./Share07-CcQxNSX3.js";import"./Image01-BggoPRkg.js";import"./Key01-BV_ymGg3.js";import"./LayoutLeft-DpIebcC-.js";import"./Link01-OIIXb7cI.js";import"./LinkExternal01-CPCL9Cco.js";import"./Monitor01-CDgu8CIt.js";import"./Sun-Be8FNPF2.js";import"./Package-Ci_Iuppc.js";import"./Palette-IB6rbtm1.js";import"./SearchLg-CAy6qghA.js";import"./Stars01-BMd1nnPj.js";import"./Upload01-C2s_RH4H.js";import"./User01-XeAWOYXy.js";import"./Users01-C3on152s.js";import"./X-RprAX0Ua.js";import"./Zap-DzoV5VQ9.js";import"./label-sXJ5lD1Q.js";import"./auth-DbhfOiDD.js";import"./mcp-oauth-BlhNJxOC.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=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,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{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(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),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:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function Ls(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};
@@ -1 +1 @@
1
- import{c as G,b as H,an as P,ao as J,e as K,j as i,h as Q,ap as U,aq as W,a as X,B as Y}from"./index-CIRfHbNo.js";import{A as Z,a as ee,b as te,c as ae,d as ie,e as oe,f as re}from"./alert-dialog-i1rWKvRm.js";import{F as ne,a as se,b as le,c as ce,d as me,e as ge,f as fe}from"./form-CLzrUZNk.js";import{I as ue}from"./input-CHdcX8S5.js";function V(v){return v.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const de=v=>U({name:W().min(2,v("common.createOrganizationDialog.nameRequired"))});function be(v){const e=G.c(72),{open:B,onOpenChange:I,onCreated:y}=v,t=H();let s;e[0]!==t?(s=P(de(t)),e[0]=t,e[1]=s):s=e[1];let E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E={name:""},e[2]=E):E=e[2];let T;e[3]!==s?(T={resolver:s,defaultValues:E},e[3]=s,e[4]=T):T=e[4];const a=J(T);let l;e[5]!==t?(l=async n=>{const r=V(n.name);if(!r)throw new Error(t("common.createOrganizationDialog.invalidSlug"));const $=await X.organization.create({name:n.name,slug:r});if($?.error)throw new Error($.error.message||t("common.createOrganizationDialog.failedToCreate"));const q=$?.data?.slug??r;if(!q)throw new Error(t("common.createOrganizationDialog.failedToCreate"));return{orgSlug:q}},e[5]=t,e[6]=l):l=e[6];let c;e[7]!==y?(c=n=>{const{orgSlug:r}=n;if(y){y(r);return}window.location.href=`/${r}`},e[7]=y,e[8]=c):c=e[8];let N;e[9]!==l||e[10]!==c?(N={mutationFn:l,onSuccess:c},e[9]=l,e[10]=c,e[11]=N):N=e[11];const o=K(N);let _;e[12]!==o.error||e[13]!==t?(_=o.error instanceof Error?o.error.message:o.error?t("common.createOrganizationDialog.failedToCreateGeneric"):null,e[12]=o.error,e[13]=t,e[14]=_):_=e[14];const L=_;let m;e[15]!==t?(m=t("common.createOrganizationDialog.title"),e[15]=t,e[16]=m):m=e[16];let g;e[17]!==m?(g=i.jsx(Z,{children:m}),e[17]=m,e[18]=g):g=e[18];let f;e[19]!==t?(f=t("common.createOrganizationDialog.description"),e[19]=t,e[20]=f):f=e[20];let u;e[21]!==f?(u=i.jsx(ee,{children:f}),e[21]=f,e[22]=u):u=e[22];let d;e[23]!==u||e[24]!==g?(d=i.jsxs(te,{children:[g,u]}),e[23]=u,e[24]=g,e[25]=d):d=e[25];let x;if(e[26]!==o||e[27]!==a){let n;e[29]!==o?(n=r=>o.mutateAsync(r),e[29]=o,e[30]=n):n=e[30],x=a.handleSubmit(n),e[26]=o,e[27]=a,e[28]=x}else x=e[28];let S;e[31]!==a.formState.isSubmitting||e[32]!==t?(S=n=>{const{field:r}=n;return i.jsxs(le,{children:[i.jsx(ce,{children:t("common.createOrganizationDialog.nameLabel")}),i.jsx(me,{children:i.jsx(ue,{...r,placeholder:t("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),i.jsx(ge,{children:t("common.createOrganizationDialog.nameDescription")}),r.value&&i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[t("common.createOrganizationDialog.urlLabel")," ",i.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",V(r.value)]})]}),i.jsx(fe,{})]})},e[31]=a.formState.isSubmitting,e[32]=t,e[33]=S):S=e[33];let h;e[34]!==a.control||e[35]!==S?(h=i.jsx(ne,{control:a.control,name:"name",render:S}),e[34]=a.control,e[35]=S,e[36]=h):h=e[36];let p;e[37]!==L?(p=L&&i.jsx("div",{className:"text-destructive text-sm mt-2",children:L}),e[37]=L,e[38]=p):p=e[38];const k=a.formState.isSubmitting;let b;e[39]!==o||e[40]!==a?(b=()=>{o.reset(),a.reset()},e[39]=o,e[40]=a,e[41]=b):b=e[41];let j;e[42]!==t?(j=t("common.createOrganizationDialog.cancel"),e[42]=t,e[43]=j):j=e[43];let D;e[44]!==a.formState.isSubmitting||e[45]!==b||e[46]!==j?(D=i.jsx(ae,{disabled:k,onClick:b,children:j}),e[44]=a.formState.isSubmitting,e[45]=b,e[46]=j,e[47]=D):D=e[47];const R=!a.formState.isValid||a.formState.isSubmitting;let z;e[48]!==a.formState.isSubmitting||e[49]!==t?(z=a.formState.isSubmitting?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Q,{size:"xs"})," ",t("common.createOrganizationDialog.creating")]}):t("common.createOrganizationDialog.createButton"),e[48]=a.formState.isSubmitting,e[49]=t,e[50]=z):z=e[50];let O;e[51]!==R||e[52]!==z?(O=i.jsx(Y,{type:"submit",variant:"default",disabled:R,children:z}),e[51]=R,e[52]=z,e[53]=O):O=e[53];let C;e[54]!==D||e[55]!==O?(C=i.jsxs(ie,{children:[D,O]}),e[54]=D,e[55]=O,e[56]=C):C=e[56];let w;e[57]!==x||e[58]!==h||e[59]!==p||e[60]!==C?(w=i.jsxs("form",{className:"space-y-6",onSubmit:x,autoComplete:"off",children:[h,p,C]}),e[57]=x,e[58]=h,e[59]=p,e[60]=C,e[61]=w):w=e[61];let F;e[62]!==a||e[63]!==w?(F=i.jsx(se,{...a,children:w}),e[62]=a,e[63]=w,e[64]=F):F=e[64];let A;e[65]!==d||e[66]!==F?(A=i.jsxs(oe,{children:[d,F]}),e[65]=d,e[66]=F,e[67]=A):A=e[67];let M;return e[68]!==I||e[69]!==B||e[70]!==A?(M=i.jsx(re,{open:B,onOpenChange:I,children:A}),e[68]=I,e[69]=B,e[70]=A,e[71]=M):M=e[71],M}export{be as C};
1
+ import{c as G,b as H,an as P,ao as J,e as K,j as i,h as Q,ap as U,aq as W,a as X,B as Y}from"./index-CuKynvIK.js";import{A as Z,a as ee,b as te,c as ae,d as ie,e as oe,f as re}from"./alert-dialog-BCduxUz6.js";import{F as ne,a as se,b as le,c as ce,d as me,e as ge,f as fe}from"./form-Dx1-pFkl.js";import{I as ue}from"./input-CxixGGca.js";function V(v){return v.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const de=v=>U({name:W().min(2,v("common.createOrganizationDialog.nameRequired"))});function be(v){const e=G.c(72),{open:B,onOpenChange:I,onCreated:y}=v,t=H();let s;e[0]!==t?(s=P(de(t)),e[0]=t,e[1]=s):s=e[1];let E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E={name:""},e[2]=E):E=e[2];let T;e[3]!==s?(T={resolver:s,defaultValues:E},e[3]=s,e[4]=T):T=e[4];const a=J(T);let l;e[5]!==t?(l=async n=>{const r=V(n.name);if(!r)throw new Error(t("common.createOrganizationDialog.invalidSlug"));const $=await X.organization.create({name:n.name,slug:r});if($?.error)throw new Error($.error.message||t("common.createOrganizationDialog.failedToCreate"));const q=$?.data?.slug??r;if(!q)throw new Error(t("common.createOrganizationDialog.failedToCreate"));return{orgSlug:q}},e[5]=t,e[6]=l):l=e[6];let c;e[7]!==y?(c=n=>{const{orgSlug:r}=n;if(y){y(r);return}window.location.href=`/${r}`},e[7]=y,e[8]=c):c=e[8];let N;e[9]!==l||e[10]!==c?(N={mutationFn:l,onSuccess:c},e[9]=l,e[10]=c,e[11]=N):N=e[11];const o=K(N);let _;e[12]!==o.error||e[13]!==t?(_=o.error instanceof Error?o.error.message:o.error?t("common.createOrganizationDialog.failedToCreateGeneric"):null,e[12]=o.error,e[13]=t,e[14]=_):_=e[14];const L=_;let m;e[15]!==t?(m=t("common.createOrganizationDialog.title"),e[15]=t,e[16]=m):m=e[16];let g;e[17]!==m?(g=i.jsx(Z,{children:m}),e[17]=m,e[18]=g):g=e[18];let f;e[19]!==t?(f=t("common.createOrganizationDialog.description"),e[19]=t,e[20]=f):f=e[20];let u;e[21]!==f?(u=i.jsx(ee,{children:f}),e[21]=f,e[22]=u):u=e[22];let d;e[23]!==u||e[24]!==g?(d=i.jsxs(te,{children:[g,u]}),e[23]=u,e[24]=g,e[25]=d):d=e[25];let x;if(e[26]!==o||e[27]!==a){let n;e[29]!==o?(n=r=>o.mutateAsync(r),e[29]=o,e[30]=n):n=e[30],x=a.handleSubmit(n),e[26]=o,e[27]=a,e[28]=x}else x=e[28];let S;e[31]!==a.formState.isSubmitting||e[32]!==t?(S=n=>{const{field:r}=n;return i.jsxs(le,{children:[i.jsx(ce,{children:t("common.createOrganizationDialog.nameLabel")}),i.jsx(me,{children:i.jsx(ue,{...r,placeholder:t("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),i.jsx(ge,{children:t("common.createOrganizationDialog.nameDescription")}),r.value&&i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[t("common.createOrganizationDialog.urlLabel")," ",i.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",V(r.value)]})]}),i.jsx(fe,{})]})},e[31]=a.formState.isSubmitting,e[32]=t,e[33]=S):S=e[33];let h;e[34]!==a.control||e[35]!==S?(h=i.jsx(ne,{control:a.control,name:"name",render:S}),e[34]=a.control,e[35]=S,e[36]=h):h=e[36];let p;e[37]!==L?(p=L&&i.jsx("div",{className:"text-destructive text-sm mt-2",children:L}),e[37]=L,e[38]=p):p=e[38];const k=a.formState.isSubmitting;let b;e[39]!==o||e[40]!==a?(b=()=>{o.reset(),a.reset()},e[39]=o,e[40]=a,e[41]=b):b=e[41];let j;e[42]!==t?(j=t("common.createOrganizationDialog.cancel"),e[42]=t,e[43]=j):j=e[43];let D;e[44]!==a.formState.isSubmitting||e[45]!==b||e[46]!==j?(D=i.jsx(ae,{disabled:k,onClick:b,children:j}),e[44]=a.formState.isSubmitting,e[45]=b,e[46]=j,e[47]=D):D=e[47];const R=!a.formState.isValid||a.formState.isSubmitting;let z;e[48]!==a.formState.isSubmitting||e[49]!==t?(z=a.formState.isSubmitting?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Q,{size:"xs"})," ",t("common.createOrganizationDialog.creating")]}):t("common.createOrganizationDialog.createButton"),e[48]=a.formState.isSubmitting,e[49]=t,e[50]=z):z=e[50];let O;e[51]!==R||e[52]!==z?(O=i.jsx(Y,{type:"submit",variant:"default",disabled:R,children:z}),e[51]=R,e[52]=z,e[53]=O):O=e[53];let C;e[54]!==D||e[55]!==O?(C=i.jsxs(ie,{children:[D,O]}),e[54]=D,e[55]=O,e[56]=C):C=e[56];let w;e[57]!==x||e[58]!==h||e[59]!==p||e[60]!==C?(w=i.jsxs("form",{className:"space-y-6",onSubmit:x,autoComplete:"off",children:[h,p,C]}),e[57]=x,e[58]=h,e[59]=p,e[60]=C,e[61]=w):w=e[61];let F;e[62]!==a||e[63]!==w?(F=i.jsx(se,{...a,children:w}),e[62]=a,e[63]=w,e[64]=F):F=e[64];let A;e[65]!==d||e[66]!==F?(A=i.jsxs(oe,{children:[d,F]}),e[65]=d,e[66]=F,e[67]=A):A=e[67];let M;return e[68]!==I||e[69]!==B||e[70]!==A?(M=i.jsx(re,{open:B,onOpenChange:I,children:A}),e[68]=I,e[69]=B,e[70]=A,e[71]=M):M=e[71],M}export{be as C};
@@ -1 +1 @@
1
- import{K as r,c as f,m as u}from"./index-CIRfHbNo.js";function c(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function p(e,t,o){return["decofile-write",e,t,o]}function s(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function a(e,t){const o=await e.json().catch(()=>({}));throw new Error(o.error??`${t} failed (${e.status})`)}function l(e,t,o){e.setQueryData(r.decofileDraft(c(t)),o)}function S(e){const t=f.c(4);let o;t[0]!==e?(o=r.decofileDraft(e?c(e):""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==o?(n={queryKey:o,enabled:!1,queryFn:d,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=o,t[3]=n):n=t[3];const{data:i}=u(n);return i??null}async function d(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function I(e,t){const o=await fetch(s(t),{cache:"no-store"});if(!o.ok){const i=new Error(`Failed to fetch decofile: ${o.status}`);throw i.status=o.status,i}const n=await o.json();return n.token&&l(e,t,{version:n.version,token:n.token,apiHost:n.apiHost??window.location.host}),n.decofile}const h=2880*60*1e3;function D(e,t,o=h){if(!e)return!1;const n=new Date(e).getTime();return Number.isNaN(n)?!1:t-n>o}async function y(e){const t=await fetch(`${s(e)}/status`,{cache:"no-store"});return t.ok?await t.json():a(t,"Status")}function b(e){return{queryKey:r.decofileStatus(c(e)),queryFn:()=>y(e),staleTime:3e4}}async function N(e,t){const o=await fetch(s(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!o.ok)return a(o,"Save");const n=await o.json();return{...n,apiHost:n.apiHost??window.location.host}}export{p as a,b as d,I as f,D as i,N as p,l as s,a as t,S as u};
1
+ import{K as r,c as f,m as u}from"./index-CuKynvIK.js";function c(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function p(e,t,o){return["decofile-write",e,t,o]}function s(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function a(e,t){const o=await e.json().catch(()=>({}));throw new Error(o.error??`${t} failed (${e.status})`)}function l(e,t,o){e.setQueryData(r.decofileDraft(c(t)),o)}function S(e){const t=f.c(4);let o;t[0]!==e?(o=r.decofileDraft(e?c(e):""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==o?(n={queryKey:o,enabled:!1,queryFn:d,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=o,t[3]=n):n=t[3];const{data:i}=u(n);return i??null}async function d(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function I(e,t){const o=await fetch(s(t),{cache:"no-store"});if(!o.ok){const i=new Error(`Failed to fetch decofile: ${o.status}`);throw i.status=o.status,i}const n=await o.json();return n.token&&l(e,t,{version:n.version,token:n.token,apiHost:n.apiHost??window.location.host}),n.decofile}const h=2880*60*1e3;function D(e,t,o=h){if(!e)return!1;const n=new Date(e).getTime();return Number.isNaN(n)?!1:t-n>o}async function y(e){const t=await fetch(`${s(e)}/status`,{cache:"no-store"});return t.ok?await t.json():a(t,"Status")}function b(e){return{queryKey:r.decofileStatus(c(e)),queryFn:()=>y(e),staleTime:3e4}}async function N(e,t){const o=await fetch(s(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!o.ok)return a(o,"Save");const n=await o.json();return{...n,apiHost:n.apiHost??window.location.host}}export{p as a,b as d,I as f,D as i,N as p,l as s,a as t,S as u};