decocms 4.237.0 → 4.238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/client/assets/{AlertCircle-CjFbPbXR.js → AlertCircle-NIgamkG1.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CF11UEYw.js → AreaChart-CRpc3cm7.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Dkou2oyv.js → ArrowLeft-vl2nEIkm.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BLV5slUU.js → ArrowUp-DPZSwvHJ.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BP30hDff.js → ArrowUpRight-EJcVnEQQ.js} +1 -1
  6. package/dist/client/assets/{Check-BSC6j_AW.js → Check-BjlTRmvp.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BJO_ypFA.js → CheckCircle-DJReLGxy.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-CVKkscg7.js → ChevronDown-BansJwMw.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-BnJ4c2IL.js → ChevronRight-8cwrWc6Q.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CVzJYnye.js → ChevronUp-CBwQlhRH.js} +1 -1
  11. package/dist/client/assets/{Copy01-BGs_9rA1.js → Copy01-DbAHd-uW.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BgStC_qv.js → CreditCard01-CYifPwC3.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-D-83qNJa.js → DotsVertical-DB5B45Uo.js} +1 -1
  14. package/dist/client/assets/{Eye-NTHABHlz.js → Eye-Bh6RageV.js} +1 -1
  15. package/dist/client/assets/{FilterLines-Bu45YNI1.js → FilterLines-C7Wg9yVb.js} +1 -1
  16. package/dist/client/assets/{Globe01-DarbWSch.js → Globe01-D0Oxc1LP.js} +1 -1
  17. package/dist/client/assets/{Globe04-BBpMsdiG.js → Globe04-BkQE9r8Q.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DCp-WUl5.js → HardDrive-BHaqV6HV.js} +1 -1
  19. package/dist/client/assets/{Key01-CNX_ptat.js → Key01-BwSFgo4R.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-D5nGLk_M.js → LayoutLeft-BSvhSrEB.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BZfOUq-Q.js → LinkExternal01-CyubGI-F.js} +1 -1
  22. package/dist/client/assets/{LogOut01-j4YaKBaR.js → LogOut01-BxGW4Z42.js} +1 -1
  23. package/dist/client/assets/{Monitor01-C38MaP2T.js → Monitor01-DQW548Gm.js} +1 -1
  24. package/dist/client/assets/{Palette-Borxdy0n.js → Palette-CwprQ-n3.js} +1 -1
  25. package/dist/client/assets/{Play-DtbV3l2x.js → Play-B9I77UtI.js} +1 -1
  26. package/dist/client/assets/{Plus-B75q72-Y.js → Plus-BeKip_ti.js} +1 -1
  27. package/dist/client/assets/{SearchLg-C01PHEsZ.js → SearchLg-CF3SVn_9.js} +1 -1
  28. package/dist/client/assets/{SearchMd-sYSLCAfX.js → SearchMd-B0Qlr1Gl.js} +1 -1
  29. package/dist/client/assets/{Settings02-DcwyvSXX.js → Settings02-ghlI4JM4.js} +1 -1
  30. package/dist/client/assets/{Share07-B2hvI558.js → Share07-Ccl5KX8-.js} +1 -1
  31. package/dist/client/assets/{Shield01-DQ1xPJLH.js → Shield01-BRqhsyWc.js} +1 -1
  32. package/dist/client/assets/{Stars01-DqNq041Y.js → Stars01-D2FUcwqw.js} +1 -1
  33. package/dist/client/assets/Stars02-IIISJrG5.js +1 -0
  34. package/dist/client/assets/{Sun-yZz6cey6.js → Sun-qDVj9t4s.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-6N0f6IEs.js → SwitchHorizontal01-BxCgeiYE.js} +1 -1
  36. package/dist/client/assets/{Tool01-CRPVUEI-.js → Tool01-DsnpIm7u.js} +1 -1
  37. package/dist/client/assets/{Tool02-BLLppoSv.js → Tool02-DK48uSLw.js} +1 -1
  38. package/dist/client/assets/{Trash01-DUcC_MrI.js → Trash01-BAawLpcp.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-Bxf23nqY.js → TrendUp01-C6Z_wcrx.js} +1 -1
  40. package/dist/client/assets/{Upload01-lDNoA7DY.js → Upload01-CpAD4hxw.js} +1 -1
  41. package/dist/client/assets/{User01-D_PtC3-l.js → User01-Ce4Fl6PE.js} +1 -1
  42. package/dist/client/assets/{Users01-RLx4pV7z.js → Users01-C5hyD2dw.js} +1 -1
  43. package/dist/client/assets/{Users03-CttOOkYC.js → Users03-CPZVCPK9.js} +1 -1
  44. package/dist/client/assets/{X-0jWoG5jx.js → X-lCHRulQP.js} +1 -1
  45. package/dist/client/assets/{XCircle-CMWuzD62.js → XCircle-BCbY6TY1.js} +1 -1
  46. package/dist/client/assets/{XClose-DiX97P-p.js → XClose-DjKz-D2Z.js} +1 -1
  47. package/dist/client/assets/{YAxis-Ddx55nav.js → YAxis-BgtuEn7S.js} +5 -5
  48. package/dist/client/assets/{Zap-CkkvDzJg.js → Zap-wuOCIL0m.js} +1 -1
  49. package/dist/client/assets/ZapSquare-CS3jzdYe.js +1 -0
  50. package/dist/client/assets/{access-gate-Yhz0WTWU.js → access-gate-CTxljPxC.js} +1 -1
  51. package/dist/client/assets/agent-icon-B14THc_Q.js +1 -0
  52. package/dist/client/assets/agents-list-69g8rJEQ.js +1 -0
  53. package/dist/client/assets/ai-providers-CH91MQGS.js +1 -0
  54. package/dist/client/assets/{alert-CWGupSwA.js → alert-DFcpZ-oA.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-C3fO6FiW.js → alert-dialog-D7IFH3T6.js} +1 -1
  56. package/dist/client/assets/api-keys-CrFPjis3.js +1 -0
  57. package/dist/client/assets/app-editor-CrEu8w54.js +1 -0
  58. package/dist/client/assets/{auth-BUKUv3gh.js → auth-aQ-S9sH7.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-J4YZ4zxa.js → auth-catchall-D-f5_sUZ.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CT1QE6om.js → auth-entry-BV0I_ZJc.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CnaGL49E.js → auth-split-layout-BMNFHPoj.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BL5kxXPR.js → authenticate-and-persist-oauth-Bf96RUCL.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-BZ2cPPd8.js → automation-list-row-GgPsGmLt.js} +1 -1
  64. package/dist/client/assets/{automation-runs-0zCTJHHe.js → automation-runs-BpvoOdRs.js} +15 -15
  65. package/dist/client/assets/automations-DrdpSq1s.js +1 -0
  66. package/dist/client/assets/{avatar-CoBdq5SX.js → avatar-CZVTnS3q.js} +1 -1
  67. package/dist/client/assets/{badge-BKlfRcKL.js → badge-Largeyp5.js} +1 -1
  68. package/dist/client/assets/billing-QSWxDvoo.js +6 -0
  69. package/dist/client/assets/{block-document-DxFvrhcf.js → block-document-BH_hCXmL.js} +1 -1
  70. package/dist/client/assets/{buckets-B1PmZgk3.js → buckets-DoVdPe7_.js} +1 -1
  71. package/dist/client/assets/bulk-category-panel-D4Kjb2t5.js +1 -0
  72. package/dist/client/assets/{capability-load-error-b09S7e_1.js → capability-load-error-By5RHmfh.js} +1 -1
  73. package/dist/client/assets/{card-Zz2koMwO.js → card-Y4Td6_qp.js} +1 -1
  74. package/dist/client/assets/{cards-DZhyxsHe.js → cards-v-ZQq690.js} +1 -1
  75. package/dist/client/assets/category-editor-CpamqiDH.js +1 -0
  76. package/dist/client/assets/{chart-Bnk_UfBL.js → chart-BQq8t5ba.js} +1 -1
  77. package/dist/client/assets/{chat-context-BWORVgD7.js → chat-context-D3_WI76a.js} +1 -1
  78. package/dist/client/assets/{checkbox-DpwUgoY2.js → checkbox-T7P3CSDd.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-BtBqcEC0.js → cli-auth-success-CUbHl1Z7.js} +1 -1
  80. package/dist/client/assets/collection-detail-eXDRP9Q8.js +1 -0
  81. package/dist/client/assets/{collection-display-button-CLPFB3_A.js → collection-display-button-BIyaULpN.js} +1 -1
  82. package/dist/client/assets/{collection-search-_zFY8-Cf.js → collection-search-mKgfv-P5.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-DPorXhXn.js → collection-table-wrapper-BiIkdzxw.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-Tu083PIR.js → collection-tabs-Ibp0SPgD.js} +1 -1
  85. package/dist/client/assets/{command-DI3FhUnx.js → command-CPY4g0vY.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-DSweCkSf.js +1 -0
  87. package/dist/client/assets/connect-Cr5eEYHn.js +8 -0
  88. package/dist/client/assets/{connection-CXwlAZgv.js → connection-B265IAJQ.js} +1 -1
  89. package/dist/client/assets/{connection-card-BHS6Mbjr.js → connection-card-C8ol51ZW.js} +1 -1
  90. package/dist/client/assets/connection-detail-ZyykQc7g.js +1 -0
  91. package/dist/client/assets/{connection-form-helpers-DsdyG005.js → connection-form-helpers-C7wyCDlb.js} +1 -1
  92. package/dist/client/assets/connections-BBbAjJre.js +1 -0
  93. package/dist/client/assets/{decopilot-sse-pool-DLZWceLm.js → decopilot-sse-pool-MiFwCFec.js} +1 -1
  94. package/dist/client/assets/{dialog-C0_VZPHC.js → dialog-XZdfEVkH.js} +1 -1
  95. package/dist/client/assets/{domain-settings-NyZzR6hV.js → domain-settings-B9j2Tomm.js} +1 -1
  96. package/dist/client/assets/{drawer-2KdGcrE6.js → drawer-CZRmN4Rl.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-CMTPZ7Ir.js → dropdown-menu-DVYqDP-D.js} +1 -1
  98. package/dist/client/assets/{empty-state-CQKPJKx2.js → empty-state-1FVnySPh.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DVi4pwNP.js → extract-connection-data-BpVTWK-J.js} +1 -1
  100. package/dist/client/assets/file-explorer-B8m_Ud7I.js +2 -0
  101. package/dist/client/assets/{file-type-icon-BaDll1C-.js → file-type-icon-C0Iwwc71.js} +1 -1
  102. package/dist/client/assets/{form-DApAFFn0.js → form-Dxx4h0K2.js} +1 -1
  103. package/dist/client/assets/general-4Cwh9qXG.js +1 -0
  104. package/dist/client/assets/{github-repo-picker-qhvXBKMo.js → github-repo-picker-BntApwLN.js} +1 -1
  105. package/dist/client/assets/{hooks-B7N1YIMG.js → hooks-D1ngLxRd.js} +1 -1
  106. package/dist/client/assets/{index-OxFtCYT-.js → index-ANK2LJtV.js} +1 -1
  107. package/dist/client/assets/index-B6at7pHi.js +1 -0
  108. package/dist/client/assets/{index-CuujNnv4.js → index-BW8Kh131.js} +1 -1
  109. package/dist/client/assets/index-BayJ_hOk.js +1 -0
  110. package/dist/client/assets/{index-DeD3quSS.js → index-CUMFdB46.js} +1 -1
  111. package/dist/client/assets/{index-BmKat3q_.js → index-CjHBTwzP.js} +1 -1
  112. package/dist/client/assets/{index-lbvtcVET.js → index-CtD8kCVB.js} +2 -2
  113. package/dist/client/assets/{index-DMDxsX36.js → index-DyK-1LHf.js} +1 -1
  114. package/dist/client/assets/{index-h0GcRHM1.js → index-P-GX8FW_.js} +21 -21
  115. package/dist/client/assets/{index-Gptoc_-0.js → index-dh0u4IqP.js} +47 -47
  116. package/dist/client/assets/index-iwXkDaR-.css +1 -0
  117. package/dist/client/assets/{index-redirect-kqqz9Pdm.js → index-redirect-Bs49GSOc.js} +1 -1
  118. package/dist/client/assets/infra-billing-DaFLqOb1.js +1 -0
  119. package/dist/client/assets/{input-BzvzuDaQ.js → input-CjE2QrUF.js} +1 -1
  120. package/dist/client/assets/{integration-icon-BtDBTwbu.js → integration-icon-DD2uGTto.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-D6at4Byp.js → invite-member-dialog-3RD7lTgh.js} +1 -1
  122. package/dist/client/assets/{label-DtVKw0n-.js → label-BYk5h4ou.js} +1 -1
  123. package/dist/client/assets/{layout-iYq7K1In.js → layout-CzV2Jg4F.js} +1 -1
  124. package/dist/client/assets/{login-DPnQy0ky.js → login-kOxWh4FL.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-DmlNibJW.js → mcp-oauth-YnIysQTC.js} +1 -1
  126. package/dist/client/assets/members-BWZup3yY.js +1 -0
  127. package/dist/client/assets/{monaco-editor-Bx-WJoCd.js → monaco-editor-CEqNg3BQ.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-DB1vTT_4.js → monitoring-stats-row-DO9FS6PN.js} +1 -1
  129. package/dist/client/assets/{multi-select-DRJAdNWW.js → multi-select-BheAE_Ti.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-BQzVHUp7.js → oauth-callback-Bxh-hXdQ.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-CvGIMomW.js → oauth-callback-ai-provider-3iVGzc8O.js} +1 -1
  132. package/dist/client/assets/{onboarding-CzCEX6lz.js → onboarding-EKkdot5C.js} +1 -1
  133. package/dist/client/assets/{org-layout-DFn4LDXk.js → org-layout-BxTmoEir.js} +1 -1
  134. package/dist/client/assets/{organization-choice-DHMqg0E7.js → organization-choice-Ci26Yd7s.js} +1 -1
  135. package/dist/client/assets/{orgs-DtNQhw-_.js → orgs-CQAUGc_3.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-DeB6ysXI.js → page-seo-form-rWml4KZv.js} +1 -1
  137. package/dist/client/assets/{popover-vEPjwNUl.js → popover-DH4sJ-hx.js} +1 -1
  138. package/dist/client/assets/post-editor-BX_oDQpj.js +1 -0
  139. package/dist/client/assets/{primitives-CWdeZIPO.js → primitives-DgKwbqlI.js} +1 -1
  140. package/dist/client/assets/{profile-DKOvg4Ys.js → profile-Drr6RyML.js} +1 -1
  141. package/dist/client/assets/project-app-view-C4uK-Ykh.js +1 -0
  142. package/dist/client/assets/record-editor-CNBghvNW.js +1 -0
  143. package/dist/client/assets/redirect-editor-DWVkIY5G.js +1 -0
  144. package/dist/client/assets/{registry-layout-DVU67Hav.js → registry-layout-Bu1cLH4_.js} +1 -1
  145. package/dist/client/assets/registry-yIvFz9E8.js +2 -0
  146. package/dist/client/assets/{reports-B5K5drg3.js → reports-5TYDahoh.js} +1 -1
  147. package/dist/client/assets/{require-capability-CbJhxJIS.js → require-capability-k_aaNrmG.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DF3apjeH.js → required-auth-layout-Dn81p7H8.js} +1 -1
  149. package/dist/client/assets/{reset-password-FnBbdloF.js → reset-password-DwRMgnq7.js} +1 -1
  150. package/dist/client/assets/roles-BvfzqM4Y.js +1 -0
  151. package/dist/client/assets/{search-input-DyFy1iK0.js → search-input-CAfA70t6.js} +1 -1
  152. package/dist/client/assets/{secrets-BVhh5Z-m.js → secrets-DQyg5IaG.js} +1 -1
  153. package/dist/client/assets/{sections-editor-afUyMuSx.js → sections-editor-1wvlg_V9.js} +2 -2
  154. package/dist/client/assets/{select-Tei14Zu4.js → select-KBOQqb5b.js} +1 -1
  155. package/dist/client/assets/{select-model-DotYsAqj.js → select-model-D2hJNEZf.js} +1 -1
  156. package/dist/client/assets/{self-tool-result-C9rWuUA9.js → self-tool-result-red_JJVZ.js} +1 -1
  157. package/dist/client/assets/seo-editor-DNfycddR.js +1 -0
  158. package/dist/client/assets/settings-layout-DH-EViOe.js +1 -0
  159. package/dist/client/assets/{settings-section-DhCcFHe0.js → settings-section-uyvyi36n.js} +1 -1
  160. package/dist/client/assets/settings-subnav-DfcYXylW.js +1 -0
  161. package/dist/client/assets/{shell-controls-Cnb_Nzjz.js → shell-controls-i0HidCqY.js} +1 -1
  162. package/dist/client/assets/shell-layout-Czubm3xQ.js +1 -0
  163. package/dist/client/assets/{sidebar-fE9arcNR.js → sidebar-DYOHjP73.js} +1 -1
  164. package/dist/client/assets/{skeleton-WByIIjEz.js → skeleton-BwaQyECl.js} +1 -1
  165. package/dist/client/assets/{spinner-C3SNk2G5.js → spinner-D7MklTbP.js} +1 -1
  166. package/dist/client/assets/{sso-CxdzdiLc.js → sso-Dg3_woQC.js} +1 -1
  167. package/dist/client/assets/{store-DtJopL5o.js → store-CTLRFju2.js} +1 -1
  168. package/dist/client/assets/store-registry-DFdXvC9d.js +2 -0
  169. package/dist/client/assets/{studio-tools-DaHRmNBg.js → studio-tools-rxH0R7lt.js} +1 -1
  170. package/dist/client/assets/{switch-HDj1d-W_.js → switch-B5ZbhCe0.js} +1 -1
  171. package/dist/client/assets/synced-repos-x16ha39u.js +1 -0
  172. package/dist/client/assets/{tab-id-DqxFWWKz.js → tab-id-CTjObiZn.js} +1 -1
  173. package/dist/client/assets/{table-BqUdzLQw.js → table-D-J833Vt.js} +1 -1
  174. package/dist/client/assets/{tabs-C2pF4tHl.js → tabs-BMNmvzpQ.js} +1 -1
  175. package/dist/client/assets/{textarea-kmGQrCWT.js → textarea-kMyew1mY.js} +1 -1
  176. package/dist/client/assets/{toggle-group-GAcLozzv.js → toggle-group-DRlvHVKj.js} +1 -1
  177. package/dist/client/assets/{toolbar-CPIussBe.js → toolbar-R-lbOcDk.js} +1 -1
  178. package/dist/client/assets/{tooltip-CAY4Un9y.js → tooltip-CCAgnlkx.js} +1 -1
  179. package/dist/client/assets/{track-poPKLD9c.js → track-BEQo3sFg.js} +1 -1
  180. package/dist/client/assets/{types-Ctr4Pq-Y.js → types-BAfCrx4S.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-Dw-i46pJ.js → use-ai-providers-BD3OpOyt.js} +1 -1
  182. package/dist/client/assets/{use-api-keys-Mb8ED3cS.js → use-api-keys-DNGO5UEj.js} +1 -1
  183. package/dist/client/assets/{use-automations-l3Ox7fHF.js → use-automations-5visjbRc.js} +1 -1
  184. package/dist/client/assets/{use-autosave-DajgHu_u.js → use-autosave-Chfu4jlL.js} +1 -1
  185. package/dist/client/assets/{use-capability-Bq8QIaAm.js → use-capability-BG5qAt9K.js} +1 -1
  186. package/dist/client/assets/{use-clock-tick-DQJlJSeJ.js → use-clock-tick-qO3IUhYy.js} +1 -1
  187. package/dist/client/assets/use-commerce-diagnostic-p8AlgPkx.js +1 -0
  188. package/dist/client/assets/{use-connection-CHvN0FBa.js → use-connection-DoE4VVnG.js} +1 -1
  189. package/dist/client/assets/{use-copy-BKbIPHzw.js → use-copy-DwKcHskz.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp-BiKtnPDO.js → use-create-virtual-mcp-CDZV5SRZ.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-C2C9GPgR.js → use-debounced-autosave-Bn---yMo.js} +1 -1
  192. package/dist/client/assets/{use-debounced-value-CGQ1MygG.js → use-debounced-value-CDap9oX0.js} +1 -1
  193. package/dist/client/assets/{use-decopilot-events-6yGSgNoz.js → use-decopilot-events-BqPh4BCN.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-CkqqL8Gd.js → use-delete-connection-CoZnx8cA.js} +1 -1
  195. package/dist/client/assets/{use-deployment-admin-HTXfV5V9.js → use-deployment-admin-3ODrcPns.js} +1 -1
  196. package/dist/client/assets/{use-file-configs-BeAzNpwF.js → use-file-configs-BTGiD983.js} +1 -1
  197. package/dist/client/assets/{use-infinite-scroll-N2WGSfb_.js → use-infinite-scroll-DV4nhJU-.js} +1 -1
  198. package/dist/client/assets/{use-join-requests-D2gK9tyz.js → use-join-requests-B8mo2OR6.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-CCJCYDxN.js → use-mcp-client-DMHWuHBR.js} +2 -2
  200. package/dist/client/assets/{use-mcp-tools-CGdKn1Fw.js → use-mcp-tools-Zd5Wb_Ox.js} +1 -1
  201. package/dist/client/assets/{use-members-BEOwJloH.js → use-members-fvuAoyah.js} +1 -1
  202. package/dist/client/assets/{use-mobile-uWMSI329.js → use-mobile-iNxeOMfx.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-zvAVYd41.js → use-navigate-to-agent-BgN8_rbc.js} +1 -1
  204. package/dist/client/assets/{use-open-billing-url-ptr76Hlr.js → use-open-billing-url-DhGvCL22.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BmiUk9g-.js → use-org-auth-client-Cag_S-a4.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-DoxFiQxq.js → use-org-sso-U6MQkVfh.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-BpQOPqCr.js → use-organization-roles-C3ByCKmB.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-BPPkEz7K.js → use-organization-settings-CXQEv0_d.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-CDunPWB9.js → use-registry-connections-DjSot7EF.js} +1 -1
  210. package/dist/client/assets/{use-secrets-Bb1WW8u5.js → use-secrets-Ct36JmLs.js} +1 -1
  211. package/dist/client/assets/{use-section-preview-base-DKdei54Z.js → use-section-preview-base-BijudAg1.js} +1 -1
  212. package/dist/client/assets/use-settings-tabs-DTQ00oCY.js +1 -0
  213. package/dist/client/assets/{use-status-sounds-BmimvYmS.js → use-status-sounds-9UZfO_tZ.js} +1 -1
  214. package/dist/client/assets/{use-tags-C0yWU0xy.js → use-tags-D4Bd-NDo.js} +1 -1
  215. package/dist/client/assets/{use-view-mode-CxVmDEL4.js → use-view-mode-DxkV0rAO.js} +1 -1
  216. package/dist/client/assets/use-virtual-mcp-DdZEMtY_.js +1 -0
  217. package/dist/client/assets/useInfiniteQuery-DTN5TRDI.js +1 -0
  218. package/dist/client/assets/useRouterState-WnRAdRHN.js +1 -0
  219. package/dist/client/assets/useSuspenseInfiniteQuery-QQYAakG4.js +1 -0
  220. package/dist/client/assets/{users-ClXzWwqs.js → users-CoIsMtRi.js} +1 -1
  221. package/dist/client/assets/variant-calendar-Cz-Z7Tjl.js +1 -0
  222. package/dist/client/assets/{view-mode-toggle-BKtHCADs.js → view-mode-toggle-D6PsJXd2.js} +1 -1
  223. package/dist/client/index.html +2 -2
  224. package/dist/server/cli.js +1 -1
  225. package/dist/server/server.js +1 -1
  226. package/package.json +1 -1
  227. package/dist/client/assets/CpuChip01-CWKZNd3u.js +0 -1
  228. package/dist/client/assets/Star01-CBnujI48.js +0 -1
  229. package/dist/client/assets/Stars02-OU17b3lp.js +0 -1
  230. package/dist/client/assets/ZapSquare-CGho5JH5.js +0 -1
  231. package/dist/client/assets/agent-icon-DpJzA7B2.js +0 -1
  232. package/dist/client/assets/agents-list-CoTSpffk.js +0 -1
  233. package/dist/client/assets/ai-providers-Bo0u0UsB.js +0 -1
  234. package/dist/client/assets/api-keys-Bk8viiTm.js +0 -1
  235. package/dist/client/assets/app-editor-DyWBYoo6.js +0 -1
  236. package/dist/client/assets/automations-BfZGOXE9.js +0 -1
  237. package/dist/client/assets/billing-Bpfymb_n.js +0 -6
  238. package/dist/client/assets/brand-context-Bibex5y6.js +0 -1
  239. package/dist/client/assets/bulk-category-panel-DvkBfAH7.js +0 -1
  240. package/dist/client/assets/category-editor-CU4nNr3w.js +0 -1
  241. package/dist/client/assets/collection-detail-BpdKLLyB.js +0 -1
  242. package/dist/client/assets/commerce-onboarding-DFnpw-BJ.js +0 -1
  243. package/dist/client/assets/connect-Bt8SyJ_D.js +0 -8
  244. package/dist/client/assets/connection-detail-D39SrwAZ.js +0 -1
  245. package/dist/client/assets/connections-Co_IqyZ-.js +0 -1
  246. package/dist/client/assets/file-explorer-Cb9zzD4a.js +0 -2
  247. package/dist/client/assets/general-BvDD0-Ck.js +0 -1
  248. package/dist/client/assets/index-BCveq62k.js +0 -1
  249. package/dist/client/assets/index-BX7x5P5r.css +0 -1
  250. package/dist/client/assets/index-Dd6uaRi9.js +0 -1
  251. package/dist/client/assets/infra-billing-CKP5HEPI.js +0 -1
  252. package/dist/client/assets/members-Dxp3M4JV.js +0 -1
  253. package/dist/client/assets/post-editor-CKk8bZhp.js +0 -1
  254. package/dist/client/assets/project-app-view-q7h-4L-m.js +0 -1
  255. package/dist/client/assets/record-editor-r-UV1jn9.js +0 -1
  256. package/dist/client/assets/redirect-editor-BQ9vpGwi.js +0 -1
  257. package/dist/client/assets/registry-BtYiGQ6_.js +0 -2
  258. package/dist/client/assets/roles-BjDS_mAv.js +0 -1
  259. package/dist/client/assets/seo-editor-BFI6VVV1.js +0 -1
  260. package/dist/client/assets/settings-layout-CLExdr_b.js +0 -1
  261. package/dist/client/assets/shell-layout-DKP_M-mD.js +0 -1
  262. package/dist/client/assets/store-registry-DAqmEdVe.js +0 -2
  263. package/dist/client/assets/synced-repos-Cbba0xP7.js +0 -1
  264. package/dist/client/assets/use-commerce-diagnostic-BVElM2RV.js +0 -1
  265. package/dist/client/assets/use-infra-billing-CRWMAvoz.js +0 -1
  266. package/dist/client/assets/use-virtual-mcp-bKqEnT_v.js +0 -1
  267. package/dist/client/assets/useInfiniteQuery-BcVwIHfG.js +0 -1
  268. package/dist/client/assets/useRouterState-faIY6mBF.js +0 -1
  269. package/dist/client/assets/useSuspenseInfiniteQuery-B_UTR4fd.js +0 -1
  270. package/dist/client/assets/variant-calendar-C0DMqVdE.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as N,b as Q,j as o,m as Te,p as ue,B as Ne,u as Xe,r as Y,a as Ae,q as st,d as nt,s as lt,e as Ze,v as Ee,w as Se,Q as at,E as ct,K as He,x as Be,N as mt}from"./index-dh0u4IqP.js";import{L as dt,s as Me,S as We,C as qe,i as ut,n as ze,a as et,p as Le}from"./self-tool-result-red_JJVZ.js";import{A as gt}from"./auth-entry-BV0I_ZJc.js";import{A as ft}from"./auth-split-layout-BMNFHPoj.js";import{O as Ve}from"./organization-choice-Ci26Yd7s.js";import{r as pt}from"./track-BEQo3sFg.js";import{I as ht}from"./input-CjE2QrUF.js";import{D as bt,a as Ke,b as xt,c as yt}from"./dropdown-menu-DVYqDP-D.js";import{S as Ct,u as jt,W as Ot,g as vt,a as St}from"./use-mcp-client-DMHWuHBR.js";import{i as _t}from"./XCircle-BCbY6TY1.js";import{i as wt}from"./ArrowUpRight-EJcVnEQQ.js";import"./alert-dialog-D7IFH3T6.js";import"./form-Dxx4h0K2.js";import"./label-BYk5h4ou.js";import"./spinner-D7MklTbP.js";import"./integration-icon-DD2uGTto.js";import"./Tool02-DK48uSLw.js";import"./agent-icon-B14THc_Q.js";import"./AlertCircle-NIgamkG1.js";import"./Tool01-DsnpIm7u.js";import"./ArrowUp-DPZSwvHJ.js";import"./ArrowLeft-vl2nEIkm.js";import"./TrendUp01-C6Z_wcrx.js";import"./ZapSquare-CS3jzdYe.js";import"./Users03-CPZVCPK9.js";import"./CheckCircle-DJReLGxy.js";import"./Check-BjlTRmvp.js";import"./ChevronDown-BansJwMw.js";import"./ChevronRight-8cwrWc6Q.js";import"./ChevronUp-CBwQlhRH.js";import"./DotsVertical-DB5B45Uo.js";import"./Stars02-IIISJrG5.js";import"./Copy01-DbAHd-uW.js";import"./CreditCard01-CYifPwC3.js";import"./Globe01-D0Oxc1LP.js";import"./Settings02-ghlI4JM4.js";import"./Eye-Bh6RageV.js";import"./FilterLines-C7Wg9yVb.js";import"./Share07-Ccl5KX8-.js";import"./Globe04-BkQE9r8Q.js";import"./SwitchHorizontal01-BxCgeiYE.js";import"./HardDrive-BHaqV6HV.js";import"./Key01-BwSFgo4R.js";import"./LayoutLeft-BSvhSrEB.js";import"./LinkExternal01-CyubGI-F.js";import"./LogOut01-BxGW4Z42.js";import"./Monitor01-DQW548Gm.js";import"./Sun-qDVj9t4s.js";import"./Palette-CwprQ-n3.js";import"./Play-B9I77UtI.js";import"./Plus-BeKip_ti.js";import"./SearchLg-CF3SVn_9.js";import"./SearchMd-B0Qlr1Gl.js";import"./Shield01-BRqhsyWc.js";import"./Stars01-D2FUcwqw.js";import"./Trash01-BAawLpcp.js";import"./Upload01-CpAD4hxw.js";import"./User01-Ce4Fl6PE.js";import"./Users01-C5hyD2dw.js";import"./XClose-DjKz-D2Z.js";import"./X-lCHRulQP.js";import"./Zap-wuOCIL0m.js";import"./dialog-XZdfEVkH.js";import"./tooltip-CCAgnlkx.js";import"./extract-connection-data-BpVTWK-J.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CDap9oX0.js";import"./authenticate-and-persist-oauth-Bf96RUCL.js";import"./mcp-oauth-YnIysQTC.js";import"./auth-aQ-S9sH7.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-CZVTnS3q.js";const Qe={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ge=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],Nt="var(--brand-green-dark)";function De({siteUrl:t,email:e,locale:s}){const i=(s&&Qe[s])??Qe["pt-BR"]??"https://decocms.com/agendar",r=new URL(i);return t&&r.searchParams.set("siteUrl",t),e&&r.searchParams.set("email",e),r.toString()}function Et(t){const e=N.c(15),{href:s,size:i,className:r,orgId:l}=t,a=i===void 0?"lg":i,n=Q();let c;e[0]!==r?(c=Te("w-full",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==l?(m=()=>ue("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:l}),e[2]=l,e[3]=m):m=e[3];let d;e[4]!==n?(d=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(wt,{size:16}),e[6]=u):u=e[6];let f;e[7]!==s||e[8]!==m||e[9]!==d?(f=o.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",onClick:m,children:[d,u]}),e[7]=s,e[8]=m,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==a||e[12]!==c||e[13]!==f?(p=o.jsx(Ne,{asChild:!0,variant:"outline",size:a,className:c,children:f}),e[11]=a,e[12]=c,e[13]=f,e[14]=p):p=e[14],p}function Ut(t){const e=N.c(13),{size:s}=t,i=s===void 0?72:s,r=Q();let l;e[0]!==r?(l=r("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=r,e[1]=l):l=e[1];const a=l;let n;e[2]!==i?(n=Math.round(i*.3),e[2]=i,e[3]=n):n=e[3];const c=n;let m;e[4]!==i?(m={height:i},e[4]=i,e[5]=m):m=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==i?(d=Ge.map((f,p)=>o.jsxs("div",{className:"relative shrink-0",style:{width:i,height:i,marginLeft:p===0?0:-c,zIndex:Ge.length-p},children:[o.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:o.jsx("img",{src:f,alt:a,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&o.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[o.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),o.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},f)),e[6]=a,e[7]=c,e[8]=i,e[9]=d):d=e[9];let u;return e[10]!==m||e[11]!==d?(u=o.jsx("div",{className:"flex items-end",style:m,children:d}),e[10]=m,e[11]=d,e[12]=u):u=e[12],u}function Fe(t){const e=N.c(19),{href:s,orgId:i}=t,r=Q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"h-20",style:{backgroundColor:Nt}}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"-mt-9 mb-4",children:o.jsx(Ut,{})}),e[1]=a):a=e[1];let n;e[2]!==r?(n=r("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=r,e[3]=n):n=e[3];let c;e[4]!==n?(c=o.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r?(m=r("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=r,e[7]=m):m=e[7];let d;e[8]!==m?(d=o.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=o.jsxs("div",{className:"grid gap-1.5",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let f;e[13]!==s||e[14]!==i?(f=o.jsx(Et,{href:s,size:"lg",className:"mt-6",orgId:i}),e[13]=s,e[14]=i,e[15]=f):f=e[15];let p;return e[16]!==u||e[17]!==f?(p=o.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:o.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[l,o.jsxs("div",{className:"px-8 pb-8",children:[a,u,f]})]})}),e[16]=u,e[17]=f,e[18]=p):p=e[18],p}function tt(t){const e=N.c(10),{host:s}=t,i=`https://www.google.com/s2/favicons?domain=${s}&sz=128`;let r,l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=o.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),a=o.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=r,e[1]=l,e[2]=a):(r=e[0],l=e[1],a=e[2]);let n;e[3]!==i?(n=o.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:o.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=n):n=e[4];let c;e[5]!==s?(c=o.jsx("span",{className:"text-lg font-medium text-foreground",children:s}),e[5]=s,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=o.jsxs("div",{className:"flex items-center gap-3",children:[r,l,a,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function $e(t){const e=N.c(5),{variant:s}=t,i=Q();let r;e[0]!==i||e[1]!==s?(r=i(s==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=i,e[1]=s,e[2]=r):r=e[2];const l=r;let a;return e[3]!==l?(a=o.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:o.jsx(dt,{label:l,className:"text-muted-foreground"})}),e[3]=l,e[4]=a):a=e[4],a}function mo(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Lt,{}),t[0]=e):e=t[0],e}const rt=Y.createContext(null),ot=()=>Y.useContext(rt);function Pt(){const t=N.c(22),[e,s]=Ee(),i=e.language==="pt-BR"?"PT-BR":"EN";let r;t[0]!==i?(r=o.jsx(bt,{asChild:!0,children:o.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:i})}),t[0]=i,t[1]=r):r=t[1];let l;t[2]!==s?(l=()=>{s(Rt)},t[2]=s,t[3]=l):l=t[3];const a=e.language==="en"&&"bg-accent";let n;t[4]!==a?(n=Te(a),t[4]=a,t[5]=n):n=t[5];let c;t[6]!==l||t[7]!==n?(c=o.jsx(Ke,{onClick:l,className:n,children:"English"}),t[6]=l,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==s?(m=()=>{s(It)},t[9]=s,t[10]=m):m=t[10];const d=e.language==="pt-BR"&&"bg-accent";let u;t[11]!==d?(u=Te(d),t[11]=d,t[12]=u):u=t[12];let f;t[13]!==m||t[14]!==u?(f=o.jsx(Ke,{onClick:m,className:u,children:"Português (Brasil)"}),t[13]=m,t[14]=u,t[15]=f):f=t[15];let p;t[16]!==c||t[17]!==f?(p=o.jsxs(xt,{align:"end",children:[c,f]}),t[16]=c,t[17]=f,t[18]=p):p=t[18];let O;return t[19]!==r||t[20]!==p?(O=o.jsxs(yt,{children:[r,p]}),t[19]=r,t[20]=p,t[21]=O):O=t[21],O}function It(t){return{...t,language:"pt-BR"}}function Rt(t){return{...t,language:"en"}}function B(t){const e=N.c(17);let s,i,r;e[0]!==t?({visual:r,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/commerce-onboarding"},e[4]=l):l=e[4];const a=Xe(l),{data:n}=Ae.useSession(),[c]=Ee(),m=n?.user?.email;let d;e[5]!==c.language||e[6]!==a.siteUrl||e[7]!==m?(d=De({siteUrl:a.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=a.siteUrl,e[7]=m,e[8]=d):d=e[8];const u=d;let f;e[9]!==u||e[10]!==r?(f=r??o.jsx(Fe,{href:u}),e[9]=u,e[10]=r,e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs("div",{className:"flex justify-between items-start mb-8",children:[o.jsx("div",{}),o.jsx(Pt,{})]}),e[12]=p):p=e[12];let O;return e[13]!==s||e[14]!==i||e[15]!==f?(O=o.jsxs(ft,{...i,visual:f,children:[p,s]}),e[13]=s,e[14]=i,e[15]=f,e[16]=O):O=e[16],O}function zt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}function Ye(t,e){switch(e){case"Enter a website URL.":return t("routes.commerceOnboarding.siteUrl.enterUrl");case"Use an HTTP or HTTPS website URL.":return t("routes.commerceOnboarding.siteUrl.useHttpOrHttps");case"Enter a valid website URL.":return t("routes.commerceOnboarding.siteUrl.enterValidUrl");case"__configurationFailed":return t("routes.commerceOnboarding.configurationFailed");default:return e}}let Je=!1;function Lt(){const t=Xe({from:"/commerce-onboarding"}),{org:e,siteUrl:s}=t,i=Me(s);if(!Je&&st()){Je=!0;const r=pt(window.location.search);ue("commerce_onboarding_viewed",{site_url:s,domain:i??void 0,...r,...i?{$set:{last_scanned_domain:i}}:{}})}return o.jsx(rt.Provider,{value:i,children:o.jsx(kt,{requestedOrgSlug:e,siteUrl:s})})}function kt(t){const e=N.c(14),{requestedOrgSlug:s,siteUrl:i}=t,r=Q(),{data:l,isPending:a}=Ae.useSession(),n=ot();if(a){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(B,{children:o.jsx($e,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!l){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r("routes.commerceOnboarding.unlockDiagnostic"),e[1]=r,e[2]=d):d=e[2];let u;e[3]!==n?(u=n?o.jsx(tt,{host:n}):void 0,e[3]=n,e[4]=u):u=e[4];let f;e[5]!==r?(f=zt(r),e[5]=r,e[6]=f):f=e[6];let p;return e[7]!==d||e[8]!==u||e[9]!==f?(p=o.jsx(B,{children:o.jsx(gt,{callbackUrl:m,allowAutoLogin:!1,title:d,subtitle:null,brand:u,copy:f})}),e[7]=d,e[8]=u,e[9]=f,e[10]=p):p=e[10],p}let c;return e[11]!==s||e[12]!==i?(c=o.jsx(Tt,{requestedOrgSlug:s,siteUrl:i}),e[11]=s,e[12]=i,e[13]=c):c=e[13],c}function Tt(t){const e=N.c(121),{requestedOrgSlug:s,siteUrl:i}=t,r=Q(),l=nt(),a=lt(),[n,c]=Y.useState(null),[m,d]=Y.useState(null),[u,f]=Y.useState(!1),p=a.data?.map(At)??[];let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O={mutationFn:Mt,retry:!1,onSuccess:g=>{d(g)}},e[0]=O):O=e[0];const v=Ze(O);if(a.isPending){let g;return e[1]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(B,{children:o.jsx($e,{variant:"workspace"})}),e[1]=g):g=e[1],g}if(a.error){let g;e[2]!==r?(g=r("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=r,e[3]=g):g=e[3];let h;e[4]!==r?(h=r("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=r,e[5]=h):h=e[5];let x;e[6]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=x):x=e[7];let b;e[8]!==a?(b=()=>a.refetch(),e[8]=a,e[9]=b):b=e[9];let _;return e[10]!==g||e[11]!==h||e[12]!==x||e[13]!==b?(_=o.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[10]=g,e[11]=h,e[12]=x,e[13]=b,e[14]=_):_=e[14],_}const w=s?p.find(g=>g.slug===s):null;if(w){let g;return e[15]!==w||e[16]!==i?(g=o.jsx(ve,{org:w,initialSiteUrl:i}),e[15]=w,e[16]=i,e[17]=g):g=e[17],g}if(s){let g;e[18]!==r?(g=r("routes.commerceOnboarding.orgNotFound"),e[18]=r,e[19]=g):g=e[19];let h;e[20]!==r?(h=r("routes.commerceOnboarding.couldNotFindOrg"),e[20]=r,e[21]=h):h=e[21];let x;e[22]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[22]=r,e[23]=x):x=e[23];let b;e[24]!==a?(b=()=>a.refetch(),e[24]=a,e[25]=b):b=e[25];let _;return e[26]!==g||e[27]!==h||e[28]!==x||e[29]!==b?(_=o.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[26]=g,e[27]=h,e[28]=x,e[29]=b,e[30]=_):_=e[30],_}if(n){let g;return e[31]!==n||e[32]!==i?(g=o.jsx(ve,{org:n,initialSiteUrl:i}),e[31]=n,e[32]=i,e[33]=g):g=e[33],g}if(p.length===1&&p[0]){let g;return e[34]!==p[0]||e[35]!==i?(g=o.jsx(ve,{org:p[0],initialSiteUrl:i}),e[34]=p[0],e[35]=i,e[36]=g):g=e[36],g}if(p.length>1){let g;e[37]!==r?(g=r("routes.commerceOnboarding.chooseOrg"),e[37]=r,e[38]=g):g=e[38];let h;e[39]!==r?(h=r("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=r,e[40]=h):h=e[40];let x;e[41]!==g||e[42]!==h?(x=o.jsx(J,{title:g,description:h}),e[41]=g,e[42]=h,e[43]=x):x=e[43];let b;e[44]!==r?(b=r("routes.commerceOnboarding.authCopy.continue"),e[44]=r,e[45]=b):b=e[45];let _;e[46]!==l||e[47]!==i?(_=j=>l({to:"/commerce-onboarding",search:{org:j.slug,siteUrl:i}}),e[46]=l,e[47]=i,e[48]=_):_=e[48];let T;e[49]===Symbol.for("react.memo_cache_sentinel")?(T=()=>f(!0),e[49]=T):T=e[49];let z;e[50]!==r?(z=r("routes.commerceOnboarding.createNewOrg"),e[50]=r,e[51]=z):z=e[51];let R;e[52]!==p||e[53]!==b||e[54]!==_||e[55]!==z?(R=o.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:o.jsx(Ve,{organizations:p,selectLabel:b,onSelected:_,onCreateNew:T,createNewLabel:z})}),e[52]=p,e[53]=b,e[54]=_,e[55]=z,e[56]=R):R=e[56];let U;e[57]!==x||e[58]!==R?(U=o.jsxs("div",{className:"grid gap-10",children:[x,R]}),e[57]=x,e[58]=R,e[59]=U):U=e[59];let M;e[60]!==l||e[61]!==i?(M=j=>{Se(),l({to:"/commerce-onboarding",search:{org:j,siteUrl:i}})},e[60]=l,e[61]=i,e[62]=M):M=e[62];let P;e[63]!==u||e[64]!==M?(P=o.jsx(qe,{open:u,onOpenChange:f,onCreated:M}),e[63]=u,e[64]=M,e[65]=P):P=e[65];let L;return e[66]!==U||e[67]!==P?(L=o.jsxs(B,{children:[U,P]}),e[66]=U,e[67]=P,e[68]=L):L=e[68],L}if(!m){let g;e[69]!==v?(g=()=>{v.reset(),v.mutate()},e[69]=v,e[70]=g):g=e[70];let h;return e[71]!==v||e[72]!==g?(h=o.jsx(Dt,{mutation:v,onRetry:g}),e[71]=v,e[72]=g,e[73]=h):h=e[73],h}const C=m;if(C?.success&&(C.status==="created"||C.status==="joined"||C.status==="already_has_organization")&&C.organization){let g;return e[74]!==C.organization||e[75]!==i?(g=o.jsx(ve,{org:C.organization,initialSiteUrl:i}),e[74]=C.organization,e[75]=i,e[76]=g):g=e[76],g}if(C?.status==="ambiguous"&&C.organizations&&C.organizations.length>0){let g;e[77]!==r?(g=r("routes.commerceOnboarding.chooseOrg"),e[77]=r,e[78]=g):g=e[78];let h;e[79]!==r?(h=r("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[79]=r,e[80]=h):h=e[80];let x;e[81]!==g||e[82]!==h?(x=o.jsx(J,{title:g,description:h}),e[81]=g,e[82]=h,e[83]=x):x=e[83];const b=C.organizations,_=C.domain??void 0;let T;e[84]!==l||e[85]!==i?(T=(X,Z)=>{Se(),c({...X,slug:Z}),l({to:"/commerce-onboarding",search:{org:Z,siteUrl:i}})},e[84]=l,e[85]=i,e[86]=T):T=e[86];let z;e[87]===Symbol.for("react.memo_cache_sentinel")?(z=()=>f(!0),e[87]=z):z=e[87];let R;e[88]!==r?(R=r("routes.commerceOnboarding.createNewOrg"),e[88]=r,e[89]=R):R=e[89];let U;e[90]!==C.organizations||e[91]!==_||e[92]!==T||e[93]!==R?(U=o.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:o.jsx(Ve,{organizations:b,domain:_,onJoined:T,onCreateNew:z,createNewLabel:R})}),e[90]=C.organizations,e[91]=_,e[92]=T,e[93]=R,e[94]=U):U=e[94];let M;e[95]!==U||e[96]!==x?(M=o.jsxs("div",{className:"grid gap-10",children:[x,U]}),e[95]=U,e[96]=x,e[97]=M):M=e[97];let P;e[98]!==l||e[99]!==i?(P=X=>{Se(),l({to:"/commerce-onboarding",search:{org:X,siteUrl:i}})},e[98]=l,e[99]=i,e[100]=P):P=e[100];let L;e[101]!==u||e[102]!==P?(L=o.jsx(qe,{open:u,onOpenChange:f,onCreated:P}),e[101]=u,e[102]=P,e[103]=L):L=e[103];let j;return e[104]!==M||e[105]!==L?(j=o.jsxs(B,{children:[M,L]}),e[104]=M,e[105]=L,e[106]=j):j=e[106],j}let I;e[107]!==r?(I=r("routes.commerceOnboarding.onboardingNeedsSupport"),e[107]=r,e[108]=I):I=e[108];let E;e[109]!==C?.error||e[110]!==r?(E=C?.error??r("routes.commerceOnboarding.couldNotDetermineOrg"),e[109]=C?.error,e[110]=r,e[111]=E):E=e[111];let A;e[112]!==r?(A=r("routes.commerceOnboarding.retryAgain"),e[112]=r,e[113]=A):A=e[113];let W;e[114]!==v?(W=()=>{d(null),v.reset()},e[114]=v,e[115]=W):W=e[115];let q;return e[116]!==I||e[117]!==E||e[118]!==A||e[119]!==W?(q=o.jsx(_e,{title:I,description:E,actionLabel:A,onRetry:W}),e[116]=I,e[117]=E,e[118]=A,e[119]=W,e[120]=q):q=e[120],q}async function Mt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Se(),e}function At(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Dt(t){const e=N.c(16),{mutation:s,onRetry:i}=t,r=Q(),l=Y.useRef(!1);let a;e[0]!==s?(a=d=>{!d||l.current||(l.current=!0,s.mutate())},e[0]=s,e[1]=a):a=e[1];const n=a;if(s.error){let d;e[2]!==r?(d=r("routes.commerceOnboarding.onboardingUnavailable"),e[2]=r,e[3]=d):d=e[3];let u;e[4]!==r?(u=r("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=r,e[5]=u):u=e[5];let f;e[6]!==r?(f=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=f):f=e[7];let p;return e[8]!==i||e[9]!==d||e[10]!==u||e[11]!==f?(p=o.jsx(_e,{title:d,description:u,actionLabel:f,onRetry:i}),e[8]=i,e[9]=d,e[10]=u,e[11]=f,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx($e,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=o.jsx(B,{children:o.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function J(t){const e=N.c(8),{title:s,description:i}=t,r=ot();let l;e[0]!==r?(l=r?o.jsx(tt,{host:r}):o.jsxs("div",{children:[o.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),o.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=r,e[1]=l):l=e[1];let a;e[2]!==i||e[3]!==s?(a=(s||i)&&o.jsxs("div",{className:"space-y-2",children:[s&&o.jsx("h1",{className:"text-2xl font-medium leading-8",children:s}),i&&o.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=s,e[4]=a):a=e[4];let n;return e[5]!==l||e[6]!==a?(n=o.jsxs("div",{className:"grid gap-10",children:[l,a]}),e[5]=l,e[6]=a,e[7]=n):n=e[7],n}function _e(t){const e=N.c(9),{title:s,description:i,actionLabel:r,onRetry:l}=t;let a;e[0]!==i||e[1]!==s?(a=o.jsx(J,{title:s,description:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let n;e[3]!==r||e[4]!==l?(n=o.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:l,children:r}),e[3]=r,e[4]=l,e[5]=n):n=e[5];let c;return e[6]!==a||e[7]!==n?(c=o.jsx(B,{children:o.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=c):c=e[8],c}function ve(t){const e=N.c(13),{org:s,initialSiteUrl:i}=t,r=Q(),{data:l}=Ae.useSession(),[a]=Ee(),n=l?.user?.email;let c;e[0]!==i||e[1]!==a.language||e[2]!==n?(c=De({siteUrl:i,email:n,locale:a.language}),e[0]=i,e[1]=a.language,e[2]=n,e[3]=c):c=e[3];const m=c;let d;e[4]!==m||e[5]!==s.id?(d=o.jsx(Fe,{href:m,orgId:s.id}),e[4]=m,e[5]=s.id,e[6]=d):d=e[6];const u=d;let f;return e[7]!==i||e[8]!==u||e[9]!==s||e[10]!==l?.user?.email||e[11]!==r?(f=o.jsx(at,{children:p=>{const{reset:O}=p;return o.jsx(ct,{fallback:v=>{const{error:w,resetError:C}=v;return o.jsx(B,{visual:u,children:o.jsx(Ft,{orgName:s.name,message:w instanceof Error?w.message:r("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{O(),C()}})})},children:o.jsx(Y.Suspense,{fallback:o.jsx(it,{visual:u}),children:o.jsx($t,{org:s,initialSiteUrl:i,sessionEmail:l?.user?.email},`${s.id}:${i??""}`)})})}}),e[7]=i,e[8]=u,e[9]=s,e[10]=l?.user?.email,e[11]=r,e[12]=f):f=e[12],f}function it(t){const e=N.c(3),{visual:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[o.jsx(J,{}),o.jsx(et,{})]}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=o.jsx(B,{align:"fill",visual:s,children:i}),e[1]=s,e[2]=r):r=e[2],r}function Ft(t){const e=N.c(19),{orgName:s,message:i,onRetry:r}=t,l=Q();let a;e[0]!==l?(a=l("routes.commerceOnboarding.commerceDiagnostic"),e[0]=l,e[1]=a):a=e[1];let n;e[2]!==s||e[3]!==l?(n=l("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s}),e[2]=s,e[3]=l,e[4]=n):n=e[4];let c;e[5]!==a||e[6]!==n?(c=o.jsx(J,{title:a,description:n}),e[5]=a,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==i?(m=o.jsx(we,{message:i}),e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l?(d=l("routes.commerceOnboarding.retryAgain"),e[10]=l,e[11]=d):d=e[11];let u;e[12]!==r||e[13]!==d?(u=o.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:r,children:d}),e[12]=r,e[13]=d,e[14]=u):u=e[14];let f;return e[15]!==c||e[16]!==m||e[17]!==u?(f=o.jsxs("div",{className:"grid gap-10",children:[c,m,u]}),e[15]=c,e[16]=m,e[17]=u,e[18]=f):f=e[18],f}function $t(t){const e=N.c(135),{org:s,initialSiteUrl:i,sessionEmail:r}=t;let l;e[0]!==s.id||e[1]!==s.slug?(l={connectionId:Ct,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l):l=e[2];const a=jt(l),[n,c]=Y.useState(i??""),[m,d]=Y.useState(null),u=Y.useRef(!1),f=Ot.COMMERCE_DISCOVERY(s.id),p=vt(s.id),O=He.commerceDiscoveryConnection(s.id,f);let v;e[3]!==f||e[4]!==a?(v=async()=>{const y=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return Le(y)},e[3]=f,e[4]=a,e[5]=v):v=e[5];let w;e[6]!==O||e[7]!==v?(w={queryKey:O,queryFn:v,retry:!1},e[6]=O,e[7]=v,e[8]=w):w=e[8];const C=Be(w),I=He.commerceDiscoveryVirtualMcp(s.id,p);let E;e[9]!==a||e[10]!==p?(E=async()=>{const y=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Le(y)},e[9]=a,e[10]=p,e[11]=E):E=e[11];let A;e[12]!==I||e[13]!==E?(A={queryKey:I,queryFn:E,retry:!1},e[12]=I,e[13]=E,e[14]=A):A=e[14];const W=Be(A);let q;e[15]!==a?(q=async y=>{const S=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Le(S)},e[15]=a,e[16]=q):q=e[16];let g;e[17]!==C||e[18]!==s.id||e[19]!==W?(g=(y,S)=>{ue("commerce_onboarding_setup_succeeded",{domain:Me(S)??void 0,organization_id:s.id}),d(null),C.refetch(),W.refetch()},e[17]=C,e[18]=s.id,e[19]=W,e[20]=g):g=e[20];let h;e[21]!==s.id?(h=(y,S)=>{ue("commerce_onboarding_setup_failed",{domain:Me(S)??void 0,organization_id:s.id,error:y instanceof Error?y.message:String(y)}),d(y instanceof Error?y.message:"__configurationFailed")},e[21]=s.id,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==q||e[25]!==g?(x={mutationFn:q,retry:!1,onSuccess:g,onError:h},e[23]=h,e[24]=q,e[25]=g,e[26]=x):x=e[26];const b=Ze(x),_=!!C.data.item&&!!W.data.item,T=C.data.item,z=typeof T?.metadata?.siteUrl=="string"?T.metadata.siteUrl:void 0,R=i||n||"";let U;e[27]!==z||e[28]!==R?(U=ut(R,z),e[27]=z,e[28]=R,e[29]=U):U=e[29];const P=_&&U,L=i||n||z||"",j=Q(),[X]=Ee();let Z;e[30]!==L||e[31]!==X.language||e[32]!==r?(Z=De({siteUrl:L,email:r,locale:X.language}),e[30]=L,e[31]=X.language,e[32]=r,e[33]=Z):Z=e[33];const Ue=Z;let ge;e[34]!==Ue||e[35]!==s.id?(ge=o.jsx(Fe,{href:Ue,orgId:s.id}),e[34]=Ue,e[35]=s.id,e[36]=ge):ge=e[36];const $=ge;let fe;e[37]!==m||e[38]!==j?(fe=m?Ye(j,m):null,e[37]=m,e[38]=j,e[39]=fe):fe=e[39];const H=fe;let pe;e[40]!==b?(pe=y=>{const S=ze(y);if(!S.ok){d(S.error);return}d(null),b.mutate(S.value)},e[40]=b,e[41]=pe):pe=e[41];const ee=pe;let he;e[42]!==i||e[43]!==ee||e[44]!==P?(he=y=>{!y||u.current||P||!i||(u.current=!0,ee(i))},e[42]=i,e[43]=ee,e[44]=P,e[45]=he):he=e[45];const Pe=he;let be;e[46]!==s.id||e[47]!==ee||e[48]!==n?(be=y=>{y.preventDefault();const S=ze(n);S.ok&&ue("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:s.id}),ee(n)},e[46]=s.id,e[47]=ee,e[48]=n,e[49]=be):be=e[49];const V=be;if(P){const y=s.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let k;e[51]!==s.slug?(k={org:y,taskId:S},e[51]=s.slug,e[52]=k):k=e[52];let D;e[53]!==s.id?(D=St(s.id),e[53]=s.id,e[54]=D):D=e[54];const G=L||void 0;let F;e[55]!==D.id||e[56]!==G?(F={virtualmcpid:D.id,connect:"1",siteUrl:G},e[55]=D.id,e[56]=G,e[57]=F):F=e[57];let K;return e[58]!==k||e[59]!==F?(K=o.jsx(mt,{to:"/$org/$taskId",params:k,search:F,replace:!0}),e[58]=k,e[59]=F,e[60]=K):K=e[60],K}if(b.isPending){let y;return e[61]!==$?(y=o.jsx(it,{visual:$}),e[61]=$,e[62]=y):y=e[62],y}if(i){let y,S,k,D,G,F,K,ne;if(e[63]!==$||e[64]!==V||e[65]!==i||e[66]!==s.name||e[67]!==b.isPending||e[68]!==n||e[69]!==j||e[70]!==H||e[71]!==Pe){ne=Symbol.for("react.early_return_sentinel");e:{const Ie=ze(i);if(!Ie.ok){let me;e[80]!==j?(me=j("routes.commerceOnboarding.commerceDiagnostic"),e[80]=j,e[81]=me):me=e[81];let de;e[82]!==s.name||e[83]!==j?(de=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[82]=s.name,e[83]=j,e[84]=de):de=e[84];let Ce;e[85]!==me||e[86]!==de?(Ce=o.jsx(J,{title:me,description:de}),e[85]=me,e[86]=de,e[87]=Ce):Ce=e[87];let je;e[88]!==V||e[89]!==b.isPending||e[90]!==n||e[91]!==H?(je=o.jsx(ke,{siteUrl:n,error:H,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[88]=V,e[89]=b.isPending,e[90]=n,e[91]=H,e[92]=je):je=e[92];const Re=o.jsxs("div",{className:"grid gap-10",children:[Ce,o.jsx(we,{message:Ye(j,Ie.error)}),je]});let Oe;e[93]!==$||e[94]!==Re?(Oe=o.jsx(B,{visual:$,children:Re}),e[93]=$,e[94]=Re,e[95]=Oe):Oe=e[95],ne=Oe;break e}S=B,K=$,G=Pe,F="grid gap-10",y=J,e[96]!==j?(k=j("routes.commerceOnboarding.commerceDiagnostic"),e[96]=j,e[97]=k):k=e[97],D=j("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Ie.value})}e[63]=$,e[64]=V,e[65]=i,e[66]=s.name,e[67]=b.isPending,e[68]=n,e[69]=j,e[70]=H,e[71]=Pe,e[72]=y,e[73]=S,e[74]=k,e[75]=D,e[76]=G,e[77]=F,e[78]=K,e[79]=ne}else y=e[72],S=e[73],k=e[74],D=e[75],G=e[76],F=e[77],K=e[78],ne=e[79];if(ne!==Symbol.for("react.early_return_sentinel"))return ne;let le;e[98]!==y||e[99]!==k||e[100]!==D?(le=o.jsx(y,{title:k,description:D}),e[98]=y,e[99]=k,e[100]=D,e[101]=le):le=e[101];let ae;e[102]!==V||e[103]!==b.isPending||e[104]!==n||e[105]!==H?(ae=H?o.jsxs(o.Fragment,{children:[o.jsx(we,{message:H}),o.jsx(ke,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V})]}):o.jsx(et,{}),e[102]=V,e[103]=b.isPending,e[104]=n,e[105]=H,e[106]=ae):ae=e[106];let ce;e[107]!==G||e[108]!==F||e[109]!==le||e[110]!==ae?(ce=o.jsxs("div",{ref:G,className:F,children:[le,ae]}),e[107]=G,e[108]=F,e[109]=le,e[110]=ae,e[111]=ce):ce=e[111];let ye;return e[112]!==S||e[113]!==K||e[114]!==ce?(ye=o.jsx(S,{visual:K,children:ce}),e[112]=S,e[113]=K,e[114]=ce,e[115]=ye):ye=e[115],ye}let te;e[116]!==j?(te=j("routes.commerceOnboarding.commerceDiagnostic"),e[116]=j,e[117]=te):te=e[117];let re;e[118]!==s.name||e[119]!==j?(re=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[118]=s.name,e[119]=j,e[120]=re):re=e[120];let oe;e[121]!==te||e[122]!==re?(oe=o.jsx(J,{title:te,description:re}),e[121]=te,e[122]=re,e[123]=oe):oe=e[123];let ie;e[124]!==V||e[125]!==b.isPending||e[126]!==n||e[127]!==H?(ie=o.jsx(ke,{siteUrl:n,error:H,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[124]=V,e[125]=b.isPending,e[126]=n,e[127]=H,e[128]=ie):ie=e[128];let se;e[129]!==oe||e[130]!==ie?(se=o.jsxs("div",{className:"grid gap-10",children:[oe,ie]}),e[129]=oe,e[130]=ie,e[131]=se):se=e[131];let xe;return e[132]!==$||e[133]!==se?(xe=o.jsx(B,{visual:$,children:se}),e[132]=$,e[133]=se,e[134]=xe):xe=e[134],xe}function ke(t){const e=N.c(30),{siteUrl:s,error:i,isSubmitting:r,onSiteUrlChange:l,onSubmit:a}=t,n=Q();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=o.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let d;e[4]!==l?(d=A=>l(A.target.value),e[4]=l,e[5]=d):d=e[5];let u;e[6]!==n?(u=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=u):u=e[7];const f=!!i;let p;e[8]!==r||e[9]!==s||e[10]!==d||e[11]!==u||e[12]!==f?(p=o.jsx(ht,{id:"commerce-site-url",type:"text",inputMode:"url",value:s,onChange:d,placeholder:u,"aria-invalid":f,disabled:r}),e[8]=r,e[9]=s,e[10]=d,e[11]=u,e[12]=f,e[13]=p):p=e[13];let O;e[14]!==i?(O=i?o.jsx(we,{message:i}):null,e[14]=i,e[15]=O):O=e[15];let v;e[16]!==m||e[17]!==p||e[18]!==O?(v=o.jsxs("div",{className:"grid gap-2",children:[m,p,O]}),e[16]=m,e[17]=p,e[18]=O,e[19]=v):v=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(_t,{size:16}),e[22]=C):C=e[22];let I;e[23]!==r||e[24]!==w?(I=o.jsxs(Ne,{type:"submit",size:"xl",className:"w-full",disabled:r,children:[w,C]}),e[23]=r,e[24]=w,e[25]=I):I=e[25];let E;return e[26]!==a||e[27]!==I||e[28]!==v?(E=o.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[v,I]}),e[26]=a,e[27]=I,e[28]=v,e[29]=E):E=e[29],E}function we(t){const e=N.c(2),{message:s}=t;let i;return e[0]!==s?(i=o.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:s}),e[0]=s,e[1]=i):i=e[1],i}export{mo as default};
@@ -0,0 +1,8 @@
1
+ import{c as D,j as s,B as R,b as U,F as oe,r as ae,z as ce,t as I}from"./index-dh0u4IqP.js";import{A as de,b as me}from"./alert-DFcpZ-oA.js";import{C as ue}from"./card-Y4Td6_qp.js";import{c as ee,T as X,b as q,a as te}from"./tabs-BMNmvzpQ.js";import{u as se}from"./use-copy-DwKcHskz.js";import{i as ne}from"./Check-BjlTRmvp.js";import{a as ie}from"./Copy01-DbAHd-uW.js";import{i as fe}from"./Key01-BwSFgo4R.js";import{n as pe}from"./LinkExternal01-CyubGI-F.js";import{s as xe}from"./Trash01-BAawLpcp.js";import{P as V}from"./index-CUMFdB46.js";import{c as he}from"./settings-section-uyvyi36n.js";import{u as ge,a as je,b as ye}from"./use-api-keys-DNGO5UEj.js";import{S as be}from"./settings-subnav-DfcYXylW.js";import"./sidebar-DYOHjP73.js";import"./LayoutLeft-BSvhSrEB.js";import"./use-mobile-iNxeOMfx.js";import"./X-lCHRulQP.js";import"./tooltip-CCAgnlkx.js";import"./ArrowUpRight-EJcVnEQQ.js";import"./use-mcp-client-DMHWuHBR.js";import"./auth-aQ-S9sH7.js";import"./useRouterState-WnRAdRHN.js";import"./use-settings-tabs-DTQ00oCY.js";import"./use-capability-BG5qAt9K.js";import"./studio-tools-rxH0R7lt.js";function Ce(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ve(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function Ne({client:e,mode:t,url:a,apiKey:m}){const r=m??"<paste-your-api-key>",c=Ce();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${a}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${a} \\
2
+ --header "Authorization: Bearer ${r}"`};if(e==="cursor"){const l={url:a};return t==="api-key"&&(l.headers={Authorization:`Bearer ${r}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}if(e==="codex"){const l=[`[mcp_servers.${c}]`,`url = "${a}"`];return t==="api-key"&&l.push(`http_headers = { "Authorization" = "Bearer ${r}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:l.join(`
3
+ `)}}if(e==="claude-desktop"){const l={type:"http",url:a};return t==="api-key"&&(l.headers={Authorization:`Bearer ${r}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}return t==="oauth"?{language:"text",code:`${a}
4
+
5
+ # OAuth: clients that support MCP OAuth 2.1 will discover
6
+ # the auth flow via the WWW-Authenticate header on 401.`}:{language:"text",code:`${a}
7
+
8
+ Authorization: Bearer ${r}`}}function Y(e){const t=D.c(23),{client:a,mode:m,url:r,apiKey:c}=e;let l;t[0]!==c||t[1]!==a||t[2]!==m||t[3]!==r?(l=Ne({client:a,mode:m,url:r,apiKey:c}),t[0]=c,t[1]=a,t[2]=m,t[3]=r,t[4]=l):l=t[4];const d=l,{handleCopy:i,copied:u}=se(),j=d.pathHint??d.language;let f;t[5]!==j?(f=s.jsx("span",{className:"text-[11px] text-muted-foreground font-medium uppercase tracking-wider",children:j}),t[5]=j,t[6]=f):f=t[6];let n;t[7]!==i||t[8]!==d.code?(n=()=>i(d.code),t[7]=i,t[8]=d.code,t[9]=n):n=t[9];let o;t[10]!==u?(o=u?s.jsx(ne,{size:14}):s.jsx(ie,{size:14}),t[10]=u,t[11]=o):o=t[11];let p;t[12]!==n||t[13]!==o?(p=s.jsx(R,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:n,"aria-label":"Copy snippet",children:o}),t[12]=n,t[13]=o,t[14]=p):p=t[14];let x;t[15]!==f||t[16]!==p?(x=s.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border",children:[f,p]}),t[15]=f,t[16]=p,t[17]=x):x=t[17];let h;t[18]!==d.code?(h=s.jsx("pre",{className:"p-3 text-xs overflow-x-auto font-mono",children:s.jsx("code",{children:d.code})}),t[18]=d.code,t[19]=h):h=t[19];let g;return t[20]!==x||t[21]!==h?(g=s.jsxs("div",{className:"relative rounded-md border border-border bg-muted/40",children:[x,h]}),t[20]=x,t[21]=h,t[22]=g):g=t[22],g}const G="Connect: ",Q=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude-desktop",label:"Claude Desktop"},{id:"raw",label:"Raw URL"}];function le(e){return Q.find(t=>t.id===e)?.label??e}function we(){return typeof window>"u"?"unknown":window.location.hostname}function Z(e){const t=D.c(11),{text:a}=e,m=U(),{handleCopy:r,copied:c}=se();let l;t[0]!==r||t[1]!==a?(l=()=>r(a),t[0]=r,t[1]=a,t[2]=l):l=t[2];let d;t[3]!==m?(d=m("settings.connectClients.copy"),t[3]=m,t[4]=d):d=t[4];let i;t[5]!==c?(i=c?s.jsx(ne,{size:14}):s.jsx(ie,{size:14}),t[5]=c,t[6]=i):i=t[6];let u;return t[7]!==l||t[8]!==d||t[9]!==i?(u=s.jsx(R,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:l,"aria-label":d,children:i}),t[7]=l,t[8]=d,t[9]=i,t[10]=u):u=t[10],u}function ke(e){const t=D.c(40),{client:a,url:m,newKey:r,onGenerate:c,isGenerating:l,onClearNewKey:d}=e,i=U();let u;t[0]!==i?(u=i("settings.connectClients.oauthTab"),t[0]=i,t[1]=u):u=t[1];let j;t[2]!==u?(j=s.jsx(q,{value:"oauth",children:u}),t[2]=u,t[3]=j):j=t[3];let f;t[4]!==i?(f=i("settings.connectClients.apiKeyTab"),t[4]=i,t[5]=f):f=t[5];let n;t[6]!==f?(n=s.jsx(q,{value:"api-key",children:f}),t[6]=f,t[7]=n):n=t[7];let o;t[8]!==j||t[9]!==n?(o=s.jsxs(ee,{children:[j,n]}),t[8]=j,t[9]=n,t[10]=o):o=t[10];let p;t[11]!==i?(p=i("settings.connectClients.oauthKeyHint"),t[11]=i,t[12]=p):p=t[12];let x;t[13]!==p?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[13]=p,t[14]=x):x=t[14];let h;t[15]!==a||t[16]!==m?(h=s.jsx(Y,{client:a,mode:"oauth",url:m}),t[15]=a,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==x||t[19]!==h?(g=s.jsxs(X,{value:"oauth",className:"mt-3 space-y-3",children:[x,h]}),t[18]=x,t[19]=h,t[20]=g):g=t[20];let y;t[21]!==i?(y=i("settings.connectClients.headlessKeyHint"),t[21]=i,t[22]=y):y=t[22];let b;t[23]!==y?(b=s.jsx("p",{className:"text-xs text-muted-foreground",children:y}),t[23]=y,t[24]=b):b=t[24];let C;t[25]!==a||t[26]!==l||t[27]!==r||t[28]!==d||t[29]!==c||t[30]!==i||t[31]!==m?(C=r?s.jsxs(s.Fragment,{children:[s.jsxs(de,{variant:"warning",className:"text-xs",children:[s.jsx(ce,{}),s.jsx(me,{children:i("settings.connectClients.snippetOneTimeWarning")})]}),s.jsx(Y,{client:a,mode:"api-key",url:m,apiKey:r}),s.jsx(R,{variant:"ghost",size:"sm",onClick:d,className:"text-xs",children:i("settings.connectClients.doneHideKey")})]}):s.jsxs(s.Fragment,{children:[s.jsx(Y,{client:a,mode:"api-key",url:m}),s.jsxs(R,{size:"sm",onClick:c,disabled:l,className:"gap-1.5",children:[s.jsx(fe,{size:14}),l?i("settings.connectClients.generatingKey"):i("settings.connectClients.generateKeyFor",{client:le(a)})]})]}),t[25]=a,t[26]=l,t[27]=r,t[28]=d,t[29]=c,t[30]=i,t[31]=m,t[32]=C):C=t[32];let v;t[33]!==b||t[34]!==C?(v=s.jsxs(X,{value:"api-key",className:"mt-3 space-y-3",children:[b,C]}),t[33]=b,t[34]=C,t[35]=v):v=t[35];let N;return t[36]!==v||t[37]!==o||t[38]!==g?(N=s.jsxs(te,{defaultValue:"oauth",className:"mt-4",children:[o,g,v]}),t[36]=v,t[37]=o,t[38]=g,t[39]=N):N=t[39],N}function $e(){const e=D.c(27),t=U(),{data:a,isLoading:m,error:r}=je(),c=ye();let l,d,i;if(e[0]!==a||e[1]!==c||e[2]!==r||e[3]!==m||e[4]!==t){i=Symbol.for("react.early_return_sentinel");e:{const j=a?.filter(ze)??[];if(m){let n;e[8]!==t?(n=t("settings.connectClients.loadingActiveKeys"),e[8]=t,e[9]=n):n=e[9];let o;e[10]!==n?(o=s.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[10]=n,e[11]=o):o=e[11],i=o;break e}if(r){let n;e[12]!==r.message||e[13]!==t?(n=t("settings.connectClients.failedToLoadKeys",{error:r.message}),e[12]=r.message,e[13]=t,e[14]=n):n=e[14];let o;e[15]!==n?(o=s.jsx("p",{className:"text-xs text-destructive",children:n}),e[15]=n,e[16]=o):o=e[16],i=o;break e}if(j.length===0){let n;e[17]!==t?(n=t("settings.connectClients.noConnectKeysYet"),e[17]=t,e[18]=n):n=e[18];let o;e[19]!==n?(o=s.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[19]=n,e[20]=o):o=e[20],i=o;break e}l="divide-y divide-border rounded-md border border-border";let f;e[21]!==c||e[22]!==t?(f=n=>s.jsxs("li",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"font-medium truncate",children:n.name.replace(G,"")}),s.jsx("div",{className:"text-muted-foreground",children:t("settings.connectClients.createdAt",{date:new Date(n.createdAt).toLocaleDateString()})})]}),s.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>{confirm(t("settings.connectClients.revokeConfirm",{name:n.name}))&&c.mutate(n.id,{onSuccess:()=>I.success(t("settings.connectClients.keyRevoked")),onError:Ke})},disabled:c.isPending,className:"gap-1 text-destructive hover:text-destructive",children:[s.jsx(xe,{size:14}),t("settings.connectClients.revoke")]})]},n.id),e[21]=c,e[22]=t,e[23]=f):f=e[23],d=j.map(f)}e[0]=a,e[1]=c,e[2]=r,e[3]=m,e[4]=t,e[5]=l,e[6]=d,e[7]=i}else l=e[5],d=e[6],i=e[7];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;return e[24]!==l||e[25]!==d?(u=s.jsx("ul",{className:l,children:d}),e[24]=l,e[25]=d,e[26]=u):u=e[26],u}function Ke(e){return I.error(e.message)}function ze(e){return e.name.startsWith(G)}function Se(){const e=D.c(67),t=U(),{org:a}=oe();let m;e[0]!==a.slug?(m=ve(a.slug),e[0]=a.slug,e[1]=m):m=e[1];const r=m,c=ge();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={},e[2]=l):l=e[2];const[d,i]=ae.useState(l);let u;e[3]!==c||e[4]!==t?(u=w=>{const J=`${G}${le(w)} on ${we()}`;c.mutate({name:J,permissions:{"*":["*"]}},{onSuccess:F=>{i(re=>({...re,[w]:F.key})),I.success(t("settings.connectClients.keyCreated"))},onError:Ae})},e[3]=c,e[4]=t,e[5]=u):u=e[5];const j=u,f=`${r}/.well-known/oauth-protected-resource`;let n;e[6]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(be,{group:"connect"}),e[6]=n):n=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-9 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground shrink-0",children:s.jsx(pe,{size:18})}),e[7]=o):o=e[7];let p;e[8]!==t?(p=t("settings.connectClients.orgUnifiedMcp"),e[8]=t,e[9]=p):p=e[9];let x;e[10]!==p?(x=s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:p}),e[10]=p,e[11]=x):x=e[11];let h;e[12]!==t?(h=t("settings.connectClients.orgUnifiedMcpDescription"),e[12]=t,e[13]=h):h=e[13];let g;e[14]!==h?(g=s.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-snug",children:h}),e[14]=h,e[15]=g):g=e[15];let y;e[16]!==x||e[17]!==g?(y=s.jsxs("div",{className:"flex items-start gap-3",children:[o,s.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]})]}),e[16]=x,e[17]=g,e[18]=y):y=e[18];let b;e[19]!==r?(b=s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/40 px-3 py-1.5",children:[s.jsx("code",{className:"text-xs flex-1 truncate",children:r}),s.jsx(Z,{text:r})]}),e[19]=r,e[20]=b):b=e[20];let C;e[21]!==t?(C=t("settings.connectClients.customClientHint"),e[21]=t,e[22]=C):C=e[22];let v;e[23]!==C?(v=s.jsx("summary",{className:"cursor-pointer hover:text-foreground",children:C}),e[23]=C,e[24]=v):v=e[24];let N;e[25]!==t?(N=t("settings.connectClients.oauthMetadataHint"),e[25]=t,e[26]=N):N=e[26];let k;e[27]!==N?(k=s.jsx("p",{children:N}),e[27]=N,e[28]=k):k=e[28];let $;e[29]!==f?($=s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-2 py-1",children:[s.jsx("code",{className:"text-[11px] flex-1 truncate",children:f}),s.jsx(Z,{text:f})]}),e[29]=f,e[30]=$):$=e[30];let K;e[31]!==k||e[32]!==$?(K=s.jsxs("div",{className:"mt-2 space-y-1",children:[k,$]}),e[31]=k,e[32]=$,e[33]=K):K=e[33];let z;e[34]!==v||e[35]!==K?(z=s.jsxs("details",{className:"text-xs text-muted-foreground",children:[v,K]}),e[34]=v,e[35]=K,e[36]=z):z=e[36];let S;e[37]!==b||e[38]!==z||e[39]!==y?(S=s.jsxs(ue,{className:"p-5 gap-3",children:[y,b,z]}),e[37]=b,e[38]=z,e[39]=y,e[40]=S):S=e[40];let M;e[41]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(ee,{variant:"underline",children:Q.map(_e)}),e[41]=M):M=e[41];let _;e[42]!==c||e[43]!==j||e[44]!==d||e[45]!==r?(_=Q.map(w=>s.jsx(X,{value:w.id,children:s.jsx(ke,{client:w.id,url:r,newKey:d[w.id]??null,onGenerate:()=>j(w.id),isGenerating:c.isPending&&c.variables?.name?.startsWith(`${G}${w.label}`)===!0,onClearNewKey:()=>i(J=>{const F={...J};return delete F[w.id],F})})},w.id)),e[42]=c,e[43]=j,e[44]=d,e[45]=r,e[46]=_):_=e[46];let A;e[47]!==_?(A=s.jsxs(te,{defaultValue:"claude-code",variant:"underline",children:[M,_]}),e[47]=_,e[48]=A):A=e[48];let T;e[49]!==t?(T=t("settings.connectClients.activeKeys"),e[49]=t,e[50]=T):T=e[50];let L;e[51]!==T?(L=s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:T}),e[51]=T,e[52]=L):L=e[52];let P;e[53]!==t?(P=t("settings.connectClients.activeKeysDescription"),e[53]=t,e[54]=P):P=e[54];let E;e[55]!==P?(E=s.jsx("p",{className:"text-sm text-muted-foreground leading-snug mt-1",children:P}),e[55]=P,e[56]=E):E=e[56];let H;e[57]!==L||e[58]!==E?(H=s.jsxs("div",{className:"px-4",children:[L,E]}),e[57]=L,e[58]=E,e[59]=H):H=e[59];let O;e[60]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx($e,{}),e[60]=O):O=e[60];let B;e[61]!==H?(B=s.jsxs("section",{className:"flex flex-col gap-3",children:[H,O]}),e[61]=H,e[62]=B):B=e[62];let W;return e[63]!==S||e[64]!==A||e[65]!==B?(W=s.jsx(V,{children:s.jsx(V.Content,{children:s.jsx(V.Body,{children:s.jsxs(he,{children:[n,S,A,B]})})})}),e[63]=S,e[64]=A,e[65]=B,e[66]=W):W=e[66],W}function _e(e){return s.jsx(q,{value:e.id,variant:"underline",children:e.label},e.id)}function Ae(e){return I.error(e.message)}function it(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Se,{}),e[0]=t):t=e[0],t}export{it as default};
@@ -1 +1 @@
1
- import{X as i,_ as r,Y as t,Z as e,a1 as o,ba as a,bl as d,cc as l,bk as u}from"./index-Gptoc_-0.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
1
+ import{X as i,_ as r,Y as t,Z as e,a1 as o,b7 as a,bj as d,ca as l,bi as u}from"./index-dh0u4IqP.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
@@ -1 +1 @@
1
- import{c as S,F as K,b9 as Q,K as H,b as q,m as $,j as x}from"./index-Gptoc_-0.js";import{u as G}from"./use-registry-connections-CDunPWB9.js";import{g as U}from"./use-organization-settings-BPPkEz7K.js";import{S as k,n as V}from"./use-mcp-client-CCJCYDxN.js";import{u as X}from"./useInfiniteQuery-BcVwIHfG.js";import{i as Y,f as z}from"./extract-connection-data-DVi4pwNP.js";import{r as B,R as W}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-eyAPH6o3.js";import{C as Z}from"./card-Zz2koMwO.js";import{I as J}from"./integration-icon-BtDBTwbu.js";function ye(){const s=S.c(6),e=G(),t=U(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let a;s[4]!==t?(a=r=>t(r.id),s[4]=t,s[5]=a):a=s[5],n=e.filter(a).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function F(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const a=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:b}=X({queryKey:H.storeDiscovery(e,`${a}:${n??""}`),queryFn:async({pageParam:l})=>{const c=l??{};return await Promise.all(s.map(async i=>{const y=c[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const C=Y(i.id,e);try{return await B(async()=>{let u=null;try{u=await V({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:C,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=z(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof W?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const c={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(c[i.registryId]=i.nextCursor,m=!0):c[i.registryId]="EXHAUSTED");return m?c:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const c of l)for(const m of c.items)I.push({...m,_sourceName:m._sourceName??c.registryTitle,_sourceIcon:m._sourceIcon??c.registryIcon,_registryId:m._registryId??c.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:b,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const a=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(a,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const C=[...f.items,...d.items];for(const u of C){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const b=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let c;t[7]!==d||t[8]!==f?(c=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=c):c=t[9];const m=c;let i;return t[10]!==l||t[11]!==b||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:b,loadMore:m},t[10]=l,t[11]=b,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return F(s)}function ie(s){return!F(s)}function xe(s){const e=new Map;for(const n of s){const a=A(n),r=e.get(a);r?r.push(n):e.set(a,[n])}const t=[],o=new Set;for(const n of s){const a=A(n);if(o.has(a))continue;o.add(a);const r=e.get(a),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:a,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:a,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=a===void 0?!1:a,b=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const c=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let C;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(C=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=C):C=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==C?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[C,h]}),e[14]=h,e[15]=C,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==b?(P=t.description||b("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=b,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==c||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(Z,{className:l,onClick:o,role:c,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=c,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
1
+ import{c as S,F as K,b6 as Q,K as H,b as q,m as $,j as x}from"./index-dh0u4IqP.js";import{u as G}from"./use-registry-connections-DjSot7EF.js";import{g as U}from"./use-organization-settings-CXQEv0_d.js";import{S as k,n as V}from"./use-mcp-client-DMHWuHBR.js";import{u as X}from"./useInfiniteQuery-DTN5TRDI.js";import{i as Y,f as z}from"./extract-connection-data-BpVTWK-J.js";import{r as B,R as W}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-eyAPH6o3.js";import{C as Z}from"./card-Y4Td6_qp.js";import{I as J}from"./integration-icon-DD2uGTto.js";function ye(){const s=S.c(6),e=G(),t=U(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let a;s[4]!==t?(a=r=>t(r.id),s[4]=t,s[5]=a):a=s[5],n=e.filter(a).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function F(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const a=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:b}=X({queryKey:H.storeDiscovery(e,`${a}:${n??""}`),queryFn:async({pageParam:l})=>{const c=l??{};return await Promise.all(s.map(async i=>{const y=c[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const C=Y(i.id,e);try{return await B(async()=>{let u=null;try{u=await V({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:C,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=z(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof W?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const c={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(c[i.registryId]=i.nextCursor,m=!0):c[i.registryId]="EXHAUSTED");return m?c:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const c of l)for(const m of c.items)I.push({...m,_sourceName:m._sourceName??c.registryTitle,_sourceIcon:m._sourceIcon??c.registryIcon,_registryId:m._registryId??c.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:b,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const a=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(a,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const C=[...f.items,...d.items];for(const u of C){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const b=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let c;t[7]!==d||t[8]!==f?(c=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=c):c=t[9];const m=c;let i;return t[10]!==l||t[11]!==b||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:b,loadMore:m},t[10]=l,t[11]=b,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return F(s)}function ie(s){return!F(s)}function xe(s){const e=new Map;for(const n of s){const a=A(n),r=e.get(a);r?r.push(n):e.set(a,[n])}const t=[],o=new Set;for(const n of s){const a=A(n);if(o.has(a))continue;o.add(a);const r=e.get(a),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:a,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:a,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=a===void 0?!1:a,b=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const c=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let C;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(C=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=C):C=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==C?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[C,h]}),e[14]=h,e[15]=C,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==b?(P=t.description||b("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=b,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==c||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(Z,{className:l,onClick:o,role:c,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=c,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
@@ -0,0 +1 @@
1
+ import{X as be,a1 as $e,b7 as De,Z as me,Y as Oe,c as R,b as H,j as t,k as ve,B,r as Z,m as Ne,F as te,x as Me,K as ae,d as se,ar as ue,D as ze,E as Ee,f as Ue,b8 as Re,o as Ve,$ as Fe,a0 as Le,t as J}from"./index-dh0u4IqP.js";import{g as Be}from"./extract-connection-data-BpVTWK-J.js";import{E as Se}from"./empty-state-1FVnySPh.js";import{E as He,c as qe,r as Xe,b as Ge,d as Ke}from"./connection-form-helpers-C7wyCDlb.js";import{c as Qe,S as We,V as Ye}from"./index-DyK-1LHf.js";import{u as ye,T as Je}from"./index-B6at7pHi.js";import{a as Ze}from"./use-members-fvuAoyah.js";import{A as et}from"./avatar-CZVTnS3q.js";import{a as Ce,b as _e,u as tt}from"./use-connection-DoE4VVnG.js";import{u as we}from"./use-mcp-client-DMHWuHBR.js";import{a as st}from"./use-mcp-tools-Zd5Wb_Ox.js";import{b as nt,C as it,a as ot,c as at}from"./chart-BQq8t5ba.js";import{i as lt,a as rt}from"./mcp-oauth-YnIysQTC.js";import{I as le}from"./integration-icon-DD2uGTto.js";import{s as ct}from"./Plus-BeKip_ti.js";import{T as dt,U as mt,r as ut,aP as xt,s as ne,aD as pt}from"./agent-icon-B14THc_Q.js";import{a as ke,s as ft}from"./Settings02-ghlI4JM4.js";import{s as ce}from"./Trash01-BAawLpcp.js";import{q as ht,p as gt,o as jt,m as bt,n as vt}from"./sidebar-DYOHjP73.js";import{d as G,a as K,e as Q,b as L,c as W,f as Nt,F as St}from"./form-Dxx4h0K2.js";import{I as Y}from"./input-CjE2QrUF.js";import{u as yt,D as Ct}from"./use-delete-connection-CoZnx8cA.js";import{c as _t,B as wt,a as kt,C as It}from"./monitoring-stats-row-DO9FS6PN.js";import{u as Tt}from"./studio-tools-rxH0R7lt.js";import{u as At}from"./use-virtual-mcp-DdZEMtY_.js";import{i as Ie}from"./ChevronRight-8cwrWc6Q.js";import{a as Te}from"./Users03-CPZVCPK9.js";import{b as ie,c as Pt,T as oe,a as $t}from"./tabs-BMNmvzpQ.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{d as Dt}from"./Tool01-DsnpIm7u.js";import{g as de,M as Ot}from"./types-BAfCrx4S.js";import{C as Mt}from"./collection-search-mKgfv-P5.js";import{C as zt}from"./card-Y4Td6_qp.js";import{B as Et}from"./badge-Largeyp5.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-DVYqDP-D.js";import{S as pe,a as fe,b as he,c as ge,d as X}from"./select-KBOQqb5b.js";import{i as Ft}from"./CheckCircle-DJReLGxy.js";import{t as Lt}from"./ChevronDown-BansJwMw.js";import{n as Bt}from"./Tool02-DK48uSLw.js";import{s as Ht}from"./XClose-DjKz-D2Z.js";import{p as qt,i as Xt}from"./connection-B265IAJQ.js";import"./metadata-dUsYcpuu.js";import"./index-CUMFdB46.js";import"./Key01-BwSFgo4R.js";import"./auth-aQ-S9sH7.js";import"./use-registry-connections-DjSot7EF.js";import"./use-organization-settings-CXQEv0_d.js";import"./index-ANK2LJtV.js";import"./index-BW8Kh131.js";import"./popover-DH4sJ-hx.js";import"./tooltip-CCAgnlkx.js";import"./Check-BjlTRmvp.js";import"./SearchMd-B0Qlr1Gl.js";import"./use-mobile-iNxeOMfx.js";import"./use-create-virtual-mcp-CDZV5SRZ.js";import"./use-navigate-to-agent-BgN8_rbc.js";import"./hooks-D1ngLxRd.js";import"./decopilot-sse-pool-MiFwCFec.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-Bh6RageV.js";import"./use-org-auth-client-Cag_S-a4.js";import"./User01-Ce4Fl6PE.js";import"./AlertCircle-NIgamkG1.js";import"./ArrowUp-DPZSwvHJ.js";import"./ArrowLeft-vl2nEIkm.js";import"./XCircle-BCbY6TY1.js";import"./ArrowUpRight-EJcVnEQQ.js";import"./TrendUp01-C6Z_wcrx.js";import"./ZapSquare-CS3jzdYe.js";import"./ChevronUp-CBwQlhRH.js";import"./DotsVertical-DB5B45Uo.js";import"./Stars02-IIISJrG5.js";import"./Copy01-DbAHd-uW.js";import"./CreditCard01-CYifPwC3.js";import"./Globe01-D0Oxc1LP.js";import"./FilterLines-C7Wg9yVb.js";import"./Share07-Ccl5KX8-.js";import"./Globe04-BkQE9r8Q.js";import"./SwitchHorizontal01-BxCgeiYE.js";import"./HardDrive-BHaqV6HV.js";import"./LayoutLeft-BSvhSrEB.js";import"./LinkExternal01-CyubGI-F.js";import"./LogOut01-BxGW4Z42.js";import"./Monitor01-DQW548Gm.js";import"./Sun-qDVj9t4s.js";import"./Palette-CwprQ-n3.js";import"./Play-B9I77UtI.js";import"./SearchLg-CF3SVn_9.js";import"./Shield01-BRqhsyWc.js";import"./Stars01-D2FUcwqw.js";import"./Upload01-CpAD4hxw.js";import"./Users01-C5hyD2dw.js";import"./X-lCHRulQP.js";import"./Zap-wuOCIL0m.js";import"./label-BYk5h4ou.js";import"./alert-dialog-D7IFH3T6.js";import"./YAxis-BgtuEn7S.js";import"./AreaChart-CRpc3cm7.js";const Gt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Kt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Gt}];function Qt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Yt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Qt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Jt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=Tt(),o=es(a),{data:r}=Me({queryKey:ae.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=_t(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Jt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(nt,{config:ts,className:"h-16 w-full",children:t.jsxs(wt,{data:p,barCategoryGap:"4%",children:[t.jsx(it,{content:t.jsx(ot,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(kt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(It,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(rs,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=At(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.annotations?.title??j.name}),t.jsx(Je,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=H();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let q;e[20]!==d?(q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=q):q=e[21];let F;e[22]!==q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[22]=q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs($t,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(xt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=ze(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?qt(e.connection_url):null;return d?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(X,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(X,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(X,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(X,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(K,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(X,{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(X,{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(X,{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")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(X,{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(X,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(pt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(He,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Y,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(Nt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Xe(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Ve(),d=_e(),{org:f}=te(),u=yt({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=Ze(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=Qe(D,Kt),v=Fe({resolver:Le(qe),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await rt({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){J.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const q=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(q.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();J.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{...u}),t.jsx(ht,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(et,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(St,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:x})=>t.jsxs(K,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(Y,{...x})}),t.jsx(W,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:x})=>t.jsxs(K,{children:[t.jsx(Q,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(Y,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(We,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(Ye,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Yt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),J.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=Be("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await lt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ue(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=tt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=st(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=at(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Re(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ee,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function _i(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{_i as default};
@@ -1 +1 @@
1
- import{X as R,a1 as A,ba as I,Z as o,Y as j,_ as z,c as L,j as u,B as C}from"./index-Gptoc_-0.js";import{I as H}from"./input-BzvzuDaQ.js";import{s as W}from"./Plus-B75q72-Y.js";import{s as q}from"./Trash01-DUcC_MrI.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(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 U(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 M(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(H,{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(H,{type:U(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 Y(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Z(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 Q(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{M as E,Z as a,J as b,G as c,Q as d,F as i,D as p,Y as r};
1
+ import{X as R,a1 as A,b7 as I,Z as o,Y as j,_ as z,c as L,j as u,B as C}from"./index-dh0u4IqP.js";import{I as H}from"./input-CjE2QrUF.js";import{s as W}from"./Plus-BeKip_ti.js";import{s as q}from"./Trash01-BAawLpcp.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(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 U(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 M(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(H,{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(H,{type:U(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 Y(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Z(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 Q(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{M as E,Z as a,J as b,G as c,Q as d,F as i,D as p,Y as r};
@@ -0,0 +1 @@
1
+ import{r as B,c as ae,b as de,j as t,B as G,k as pe,p as re,m as je,E as Ye,F as Ne,d as ke,u as Ze,a as Te,D as et,I as tt,G as nt,$ as st,a0 as ot,o as it,t as Y,K as ct}from"./index-dh0u4IqP.js";import{a as Ae,b as lt,g as rt,e as at}from"./extract-connection-data-BpVTWK-J.js";import{C as dt}from"./collection-display-button-BIyaULpN.js";import{S as ut}from"./search-input-CAfA70t6.js";import{C as mt}from"./collection-tabs-Ibp0SPgD.js";import{C as ve,u as gt,a as we,g as pt}from"./connection-card-C8ol51ZW.js";import{E as ft}from"./empty-state-1FVnySPh.js";import{P as fe}from"./index-CUMFdB46.js";import{u as ht,D as xt}from"./use-delete-connection-CoZnx8cA.js";import{u as Ce}from"./use-capability-BG5qAt9K.js";import{u as jt}from"./use-infinite-scroll-DV4nhJU-.js";import{u as yt}from"./use-view-mode-DxkV0rAO.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Oe,f as Le,g as Me,e as Fe,a as $e,A as Ue}from"./alert-dialog-D7IFH3T6.js";import{n as ye}from"./Tool02-DK48uSLw.js";import{g as St}from"./metadata-dUsYcpuu.js";import{b as Ve,h as ze,a as Ee,c as Be,d as Ke,e as He}from"./dialog-XZdfEVkH.js";import{D as Ct,a as vt,c as bt,b as _t,g as Dt,e as Nt,f as kt}from"./drawer-CZRmN4Rl.js";import{u as Tt}from"./use-mobile-iNxeOMfx.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-Dxx4h0K2.js";import{I as ue}from"./input-CjE2QrUF.js";import{S as At,a as wt,b as It,c as Pt,d as ge}from"./select-KBOQqb5b.js";import{T as Ot}from"./textarea-kMyew1mY.js";import{b as Re,u as Lt}from"./use-connection-DoE4VVnG.js";import{u as Mt}from"./use-virtual-mcp-DdZEMtY_.js";import{u as Ft}from"./studio-tools-rxH0R7lt.js";import{aO as $t,U as Ut,T as Vt,s as Se,aD as zt}from"./agent-icon-B14THc_Q.js";import{s as We}from"./Plus-BeKip_ti.js";import{s as Xe}from"./XClose-DjKz-D2Z.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-C7wyCDlb.js";import{a as Wt}from"./authenticate-and-persist-oauth-Bf96RUCL.js";import{I as Xt}from"./integration-icon-DD2uGTto.js";import{C as Ge}from"./checkbox-T7P3CSDd.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-DVYqDP-D.js";import{a as Jt}from"./DotsVertical-DB5B45Uo.js";import{s as qe}from"./Eye-Bh6RageV.js";import{s as Qe}from"./Trash01-BAawLpcp.js";import"./use-mcp-client-DMHWuHBR.js";import"./auth-aQ-S9sH7.js";import"./ArrowUp-DPZSwvHJ.js";import"./Check-BjlTRmvp.js";import"./SwitchHorizontal01-BxCgeiYE.js";import"./tooltip-CCAgnlkx.js";import"./view-mode-toggle-D6PsJXd2.js";import"./badge-Largeyp5.js";import"./SearchMd-B0Qlr1Gl.js";import"./use-registry-connections-DjSot7EF.js";import"./use-organization-settings-CXQEv0_d.js";import"./useInfiniteQuery-DTN5TRDI.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-Y4Td6_qp.js";import"./sidebar-DYOHjP73.js";import"./LayoutLeft-BSvhSrEB.js";import"./X-lCHRulQP.js";import"./label-BYk5h4ou.js";import"./ChevronDown-BansJwMw.js";import"./ChevronUp-CBwQlhRH.js";import"./AlertCircle-NIgamkG1.js";import"./Tool01-DsnpIm7u.js";import"./ArrowLeft-vl2nEIkm.js";import"./XCircle-BCbY6TY1.js";import"./ArrowUpRight-EJcVnEQQ.js";import"./TrendUp01-C6Z_wcrx.js";import"./ZapSquare-CS3jzdYe.js";import"./Users03-CPZVCPK9.js";import"./CheckCircle-DJReLGxy.js";import"./ChevronRight-8cwrWc6Q.js";import"./Stars02-IIISJrG5.js";import"./Copy01-DbAHd-uW.js";import"./CreditCard01-CYifPwC3.js";import"./Globe01-D0Oxc1LP.js";import"./Settings02-ghlI4JM4.js";import"./FilterLines-C7Wg9yVb.js";import"./Share07-Ccl5KX8-.js";import"./Globe04-BkQE9r8Q.js";import"./HardDrive-BHaqV6HV.js";import"./Key01-BwSFgo4R.js";import"./LinkExternal01-CyubGI-F.js";import"./LogOut01-BxGW4Z42.js";import"./Monitor01-DQW548Gm.js";import"./Sun-qDVj9t4s.js";import"./Palette-CwprQ-n3.js";import"./Play-B9I77UtI.js";import"./SearchLg-CF3SVn_9.js";import"./Shield01-BRqhsyWc.js";import"./Stars01-D2FUcwqw.js";import"./Upload01-CpAD4hxw.js";import"./User01-Ce4Fl6PE.js";import"./Users01-C5hyD2dw.js";import"./Zap-wuOCIL0m.js";import"./mcp-oauth-YnIysQTC.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=L=>{y(L),globalThis.localStorage?.setItem(x,String(L))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=yt(`studio-${p}-${n}`,l),{sortKey:O,sortDirection:M,handleSort:A}=Zt(o),K=O;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==M||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:M,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=M,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Oe,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Le,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Me,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=St(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||lt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const O=T;let M;e[14]!==n?(M=nn(n),e[14]=n,e[15]=M):M=e[15];const A=M,K=u||p;let U,L;e[16]!==O||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=O[0];J&&l(J);return}L()},L=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=O,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=L):(U=e[22],L=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==L||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),L()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=L,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Oe,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Le,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Me,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let O;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(O=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("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]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=O):O=e[36];let M;e[37]!==p?(M=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=M):M=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==M||e[43]!==K?(U=t.jsxs(me,{onClick:M,children:[A,K]}),e[42]=M,e[43]=K,e[44]=U):U=e[44];let L;e[45]!==r||e[46]!==U?(L=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=L):L=e[47];let V;e[48]!==O||e[49]!==L?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[O,L]}),e[48]=O,e[49]=L,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let O;e[37]!==T||e[38]!==v||e[39]!==_?(O=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=O):O=e[40];let M;return e[41]!==p||e[42]!==n||e[43]!==O?(M=t.jsx(He,{open:n,onOpenChange:p,children:O}),e[41]=p,e[42]=n,e[43]=O,e[44]=M):M=e[44],M}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=it(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Lt(s),v=ht(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,O]=B.useState(null),M=Mt(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=pt(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},L=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=jt(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),O(m.id);try{const h=at(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),O(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:ct.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{O(null)}}},C=Ft(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),L()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),L()},ee=async m=>{const h=M.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),L()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:M,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(ft,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:L})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=Tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=tt(nt.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=gt(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=st({resolver:ot(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),O=i.watch("connection_url"),M=i.watch("npx_package"),A=he({uiType:T,connectionUrl:O??"",npxPackage:M??""})??De({uiType:T,connectionUrl:O??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},L=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=rt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),L(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&L(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(At,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(wt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{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(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Ot,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(Ct,{open:H,onOpenChange:q,children:t.jsxs(vt,{className:"max-h-[90vh]",children:[t.jsx(bt,{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(_t,{children:S}),t.jsx(Dt,{className:"mt-1",children:w})]}),t.jsx(Nt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(dt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:g,onChange:S=>v(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:S=>_(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(mt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function Zs(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{Zs as default};
@@ -1 +1 @@
1
- import"./index-Gptoc_-0.js";import{e as R}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},w=Object.values(k),Y="super-agent",p=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],O=p[0];function x(r){return p[r%p.length]??O}function G(r){return r.createdBy==="system"}const K=["qa","code_review"],N={qa:"QA Agent",code_review:"Code Reviewer"};function j(r,s){return r?.startsWith(`${N[s]}:`)??!1}function I(r){let s=0;for(const l of r)l.action==="status_changed"&&l.data?.to==="in_review"&&(s=Math.max(s,new Date(l.occurredAt).getTime()));return s}function M(r,s){const l=I(r),a=new Map;for(const o of r){if(o.action!=="review_approved"&&o.action!=="review_changes_requested"||new Date(o.occurredAt).getTime()<l)continue;const i=o.data??{};i.reviewer!=="qa"&&i.reviewer!=="code_review"||(o.action==="review_approved"?a.set(i.reviewer,"approved"):a.set(i.reviewer,"changes_requested"))}return a}function F(r,s,l){if(s.length===0)return!1;const a=M(r);return s.every(o=>a.get(o)==="approved")}const S="task-board.item.updated",v="task-board.item.deleted",P=3e4,V=1e3;function B(r){const{buildUrl:s,eventTypes:l,name:a,crossTab:o=!1}=r,i=new Map,d=o&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(d&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function f(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function E(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function T(e){const t=new EventSource(s(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(E(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const n=u=>{e.channel?.postMessage({kind:"event",type:u.type,data:u.data}),f(e,u)};for(const u of l)t.addEventListener(u,n)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=R(P,V,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),T(e))},t)}function h(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,T(e)}function L(e){if(!d){h(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,h(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?f(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&E(e)}function g(e){const t=i.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(i.set(e,n),d){const u=new BroadcastChannel(`sse:${a}:${e}`);u.onmessage=c=>D(n,c.data),n.channel=u}return n}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,i.delete(e.key)}return{subscribe(e,t,n){const u=!i.has(e),c=g(e);c.refCount++,c.handlers.add(t),n&&c.reconnectHandlers.add(n),u&&L(c);let _=!1;return()=>{_||(_=!0,c.handlers.delete(t),n&&c.reconnectHandlers.delete(n),c.refCount--,c.refCount<=0&&y(c))}}}}function A(r,s){const l=new Set(s);return{subscribe(a,o,i){const d=f=>{l.has(f.type)&&o(f)};return r.subscribe(a,d,i)}}}const b=[...w,S,v],H=b,W=b,C=B({name:"watch",buildUrl:r=>`/api/${encodeURIComponent(r)}/watch?types=${H.join(",")}`,eventTypes:W,crossTab:!0}),q=A(C,[...w]),J=A(C,[S,v]),Q=q;export{O as D,K as R,Y as S,v as T,F as a,G as b,k as c,Q as d,j as i,x as n,J as t};
1
+ import"./index-dh0u4IqP.js";import{e as R}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},w=Object.values(k),Y="super-agent",p=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],O=p[0];function x(r){return p[r%p.length]??O}function G(r){return r.createdBy==="system"}const K=["qa","code_review"],N={qa:"QA Agent",code_review:"Code Reviewer"};function j(r,s){return r?.startsWith(`${N[s]}:`)??!1}function I(r){let s=0;for(const l of r)l.action==="status_changed"&&l.data?.to==="in_review"&&(s=Math.max(s,new Date(l.occurredAt).getTime()));return s}function M(r,s){const l=I(r),a=new Map;for(const o of r){if(o.action!=="review_approved"&&o.action!=="review_changes_requested"||new Date(o.occurredAt).getTime()<l)continue;const i=o.data??{};i.reviewer!=="qa"&&i.reviewer!=="code_review"||(o.action==="review_approved"?a.set(i.reviewer,"approved"):a.set(i.reviewer,"changes_requested"))}return a}function F(r,s,l){if(s.length===0)return!1;const a=M(r);return s.every(o=>a.get(o)==="approved")}const S="task-board.item.updated",v="task-board.item.deleted",P=3e4,V=1e3;function B(r){const{buildUrl:s,eventTypes:l,name:a,crossTab:o=!1}=r,i=new Map,d=o&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(d&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function f(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function E(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function T(e){const t=new EventSource(s(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(E(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const n=u=>{e.channel?.postMessage({kind:"event",type:u.type,data:u.data}),f(e,u)};for(const u of l)t.addEventListener(u,n)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=R(P,V,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),T(e))},t)}function h(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,T(e)}function L(e){if(!d){h(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,h(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?f(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&E(e)}function g(e){const t=i.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(i.set(e,n),d){const u=new BroadcastChannel(`sse:${a}:${e}`);u.onmessage=c=>D(n,c.data),n.channel=u}return n}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,i.delete(e.key)}return{subscribe(e,t,n){const u=!i.has(e),c=g(e);c.refCount++,c.handlers.add(t),n&&c.reconnectHandlers.add(n),u&&L(c);let _=!1;return()=>{_||(_=!0,c.handlers.delete(t),n&&c.reconnectHandlers.delete(n),c.refCount--,c.refCount<=0&&y(c))}}}}function A(r,s){const l=new Set(s);return{subscribe(a,o,i){const d=f=>{l.has(f.type)&&o(f)};return r.subscribe(a,d,i)}}}const b=[...w,S,v],H=b,W=b,C=B({name:"watch",buildUrl:r=>`/api/${encodeURIComponent(r)}/watch?types=${H.join(",")}`,eventTypes:W,crossTab:!0}),q=A(C,[...w]),J=A(C,[S,v]),Q=q;export{O as D,K as R,Y as S,v as T,F as a,G as b,k as c,Q as d,j as i,x as n,J as t};
@@ -1 +1 @@
1
- import{c as n,j as i,cV as u,m as c,H as m,cU as x,cW as j,cX as N,cZ as b,d6 as D,cY as g}from"./index-Gptoc_-0.js";import{i as h}from"./X-0jWoG5jx.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};
1
+ import{c as n,j as i,cV as u,m as c,H as m,cU as x,cW as j,cX as N,cZ as b,d6 as D,cY as g}from"./index-dh0u4IqP.js";import{i as h}from"./X-lCHRulQP.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};
@@ -1 +1 @@
1
- import{c as oe,b as ae,F as re,o as de,r as ce,K as ie,n as me,e as X,p as ge,t as N,j as s,B as te}from"./index-Gptoc_-0.js";import{u as ue}from"./studio-tools-DaHRmNBg.js";import{b as fe,a as xe,S as Se}from"./settings-section-DhCcFHe0.js";import{B as ne}from"./badge-BKlfRcKL.js";import{I as je}from"./input-BzvzuDaQ.js";import{S as pe,a as he,b as Ne,c as ve,d as se}from"./select-Tei14Zu4.js";function Me(e,t,o){switch(e){case"auto":return o("settings.domainSettings.joinModeHelpAuto",{domain:t});case"request":return o("settings.domainSettings.joinModeHelpRequest",{domain:t});default:return o("settings.domainSettings.joinModeHelpOff")}}function Re(){const e=oe.c(101),t=ae(),{org:o}=re(),p=de(),i=ue(),[r,v]=ce.useState("");let c;e[0]!==o.id?(c=ie.organizationDomains(o.id),e[0]=o.id,e[1]=c):c=e[1];let m;e[2]!==i?(m=()=>i.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==c||e[5]!==m?(x={queryKey:c,queryFn:m},e[4]=c,e[5]=m,e[6]=x):x=e[6];const{data:h,isPending:M}=me(x);let S;e[7]!==o.id||e[8]!==p?(S=()=>p.invalidateQueries({queryKey:ie.organizationDomains(o.id)}),e[7]=o.id,e[8]=p,e[9]=S):S=e[9];const a=S;let g;e[10]!==i?(g=n=>i.call("ORGANIZATION_DOMAIN_ADD",{domain:n}),e[10]=i,e[11]=g):g=e[11];let u;e[12]!==a||e[13]!==o.id||e[14]!==t?(u=()=>{ge("organization_domain_added",{organization_id:o.id}),v(""),a(),N.success(t("settings.domainSettings.domainAdded"))},e[12]=a,e[13]=o.id,e[14]=t,e[15]=u):u=e[15];let f;e[16]!==t?(f=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedAddDomain")),e[16]=t,e[17]=f):f=e[17];let j;e[18]!==g||e[19]!==u||e[20]!==f?(j={mutationFn:g,onSuccess:u,onError:f},e[18]=g,e[19]=u,e[20]=f,e[21]=j):j=e[21];const d=X(j);let I;e[22]!==i?(I=n=>{const{id:l,joinMode:D}=n;return i.call("ORGANIZATION_DOMAIN_UPDATE",{id:l,joinMode:D})},e[22]=i,e[23]=I):I=e[23];let A;e[24]!==a||e[25]!==t?(A=()=>{a(),N.success(t("settings.domainSettings.joinModeUpdated"))},e[24]=a,e[25]=t,e[26]=A):A=e[26];let b;e[27]!==t?(b=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedUpdate")),e[27]=t,e[28]=b):b=e[28];let U;e[29]!==b||e[30]!==I||e[31]!==A?(U={mutationFn:I,onSuccess:A,onError:b},e[29]=b,e[30]=I,e[31]=A,e[32]=U):U=e[32];const Q=X(U);let O;e[33]!==i?(O=n=>i.call("ORGANIZATION_DOMAIN_VERIFY",{id:n}),e[33]=i,e[34]=O):O=e[34];let y;e[35]!==a||e[36]!==t?(y=n=>{a(),n.verified?N.success(t("settings.domainSettings.domainVerified")):N.error(t("settings.domainSettings.txtRecordNotFound"))},e[35]=a,e[36]=t,e[37]=y):y=e[37];let E;e[38]!==t?(E=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedVerify")),e[38]=t,e[39]=E):E=e[39];let Y;e[40]!==O||e[41]!==y||e[42]!==E?(Y={mutationFn:O,onSuccess:y,onError:E},e[40]=O,e[41]=y,e[42]=E,e[43]=Y):Y=e[43];const R=X(Y);let C;e[44]!==i?(C=n=>i.call("ORGANIZATION_DOMAIN_REMOVE",{id:n}),e[44]=i,e[45]=C):C=e[45];let P;e[46]!==a||e[47]!==t?(P=()=>{a(),N.success(t("settings.domainSettings.domainRemoved"))},e[46]=a,e[47]=t,e[48]=P):P=e[48];let _;e[49]!==t?(_=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedRemove")),e[49]=t,e[50]=_):_=e[50];let $;e[51]!==C||e[52]!==P||e[53]!==_?($={mutationFn:C,onSuccess:P,onError:_},e[51]=C,e[52]=P,e[53]=_,e[54]=$):$=e[54];const T=X($);if(M)return null;let L;e[55]!==h?.domains?(L=h?.domains??[],e[55]=h?.domains,e[56]=L):L=e[56];const ee=L;let V;e[57]!==t?(V=t("settings.domainSettings.emailDomains"),e[57]=t,e[58]=V):V=e[58];let F;e[59]!==t?(F=t("settings.domainSettings.emailDomainsDescription"),e[59]=t,e[60]=F):F=e[60];let k;if(e[61]!==ee||e[62]!==T||e[63]!==t||e[64]!==Q||e[65]!==R){let n;e[67]!==T||e[68]!==t||e[69]!==Q||e[70]!==R?(n=l=>{const D=l.verificationStatus==="verified";return s.jsx(fe,{title:s.jsxs("span",{className:"flex items-center gap-2",children:[l.domain,D?s.jsx(ne,{variant:"secondary",children:t("settings.domainSettings.verified")}):s.jsx(ne,{variant:"outline",children:t("settings.domainSettings.pending")})]}),description:D?Me(l.joinMode,l.domain,t):t("settings.domainSettings.addDnsRecordInstruction"),action:s.jsxs("div",{className:"flex items-center gap-2",children:[D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:t("settings.domainSettings.joinMode")}),s.jsxs(pe,{value:l.joinMode,onValueChange:le=>Q.mutate({id:l.id,joinMode:le}),children:[s.jsx(he,{className:"w-44",size:"sm",children:s.jsx(Ne,{})}),s.jsxs(ve,{children:[s.jsx(se,{value:"off",children:t("settings.domainSettings.joinModeOff")}),s.jsx(se,{value:"auto",children:t("settings.domainSettings.joinModeAuto")}),s.jsx(se,{value:"request",children:t("settings.domainSettings.joinModeRequest")})]})]})]}),!D&&s.jsx(te,{size:"sm",variant:"outline",onClick:()=>R.mutate(l.id),disabled:R.isPending,children:t("settings.domainSettings.verify")}),s.jsx(te,{size:"sm",variant:"ghost",onClick:()=>T.mutate(l.id),disabled:T.isPending,children:t("settings.domainSettings.remove")})]}),children:!D&&l.recordName&&l.recordValue&&s.jsx(Ie,{recordName:l.recordName,recordValue:l.recordValue})},l.id)},e[67]=T,e[68]=t,e[69]=Q,e[70]=R,e[71]=n):n=e[71],k=ee.map(n),e[61]=ee,e[62]=T,e[63]=t,e[64]=Q,e[65]=R,e[66]=k}else k=e[66];let J;e[72]===Symbol.for("react.memo_cache_sentinel")?(J=n=>v(n.target.value),e[72]=J):J=e[72];let q;e[73]!==t?(q=t("settings.domainSettings.domainPlaceholder"),e[73]=t,e[74]=q):q=e[74];let z;e[75]!==r||e[76]!==q?(z=s.jsx(je,{value:r,onChange:J,placeholder:q,className:"max-w-xs"}),e[75]=r,e[76]=q,e[77]=z):z=e[77];let w;e[78]!==d||e[79]!==r?(w=()=>d.mutate(r.trim()),e[78]=d,e[79]=r,e[80]=w):w=e[80];let G;e[81]!==d.isPending||e[82]!==r?(G=!r.trim()||d.isPending,e[81]=d.isPending,e[82]=r,e[83]=G):G=e[83];let Z;e[84]!==d.isPending||e[85]!==t?(Z=d.isPending?t("settings.domainSettings.adding"):t("settings.domainSettings.addDomain"),e[84]=d.isPending,e[85]=t,e[86]=Z):Z=e[86];let B;e[87]!==w||e[88]!==G||e[89]!==Z?(B=s.jsx(te,{size:"sm",onClick:w,disabled:G,children:Z}),e[87]=w,e[88]=G,e[89]=Z,e[90]=B):B=e[90];let H;e[91]!==z||e[92]!==B?(H=s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[z,B]}),e[91]=z,e[92]=B,e[93]=H):H=e[93];let K;e[94]!==k||e[95]!==H?(K=s.jsxs(xe,{children:[k,H]}),e[94]=k,e[95]=H,e[96]=K):K=e[96];let W;return e[97]!==V||e[98]!==F||e[99]!==K?(W=s.jsx(Se,{title:V,description:F,children:K}),e[97]=V,e[98]=F,e[99]=K,e[100]=W):W=e[100],W}function Ie(e){const t=oe.c(34),{recordName:o,recordValue:p}=e,i=ae();let r;t[0]!==i?(r=I=>{navigator.clipboard?.writeText(I),N.success(i("settings.domainSettings.copied"))},t[0]=i,t[1]=r):r=t[1];const v=r;let c;t[2]!==i?(c=i("settings.domainSettings.dnsInstructions"),t[2]=i,t[3]=c):c=t[3];let m;t[4]!==c?(m=s.jsx("p",{className:"text-muted-foreground",children:c}),t[4]=c,t[5]=m):m=t[5];let x;t[6]!==v||t[7]!==o?(x=()=>v(o),t[6]=v,t[7]=o,t[8]=x):x=t[8];let h;t[9]!==i?(h=i("settings.domainSettings.txt"),t[9]=i,t[10]=h):h=t[10];let M;t[11]!==h?(M=s.jsxs("span",{className:"text-muted-foreground",children:[h," "]}),t[11]=h,t[12]=M):M=t[12];let S;t[13]!==o||t[14]!==x||t[15]!==M?(S=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:x,children:[M,o]}),t[13]=o,t[14]=x,t[15]=M,t[16]=S):S=t[16];let a;t[17]!==v||t[18]!==p?(a=()=>v(p),t[17]=v,t[18]=p,t[19]=a):a=t[19];let g;t[20]!==i?(g=i("settings.domainSettings.value"),t[20]=i,t[21]=g):g=t[21];let u;t[22]!==g?(u=s.jsxs("span",{className:"text-muted-foreground",children:[g," "]}),t[22]=g,t[23]=u):u=t[23];let f;t[24]!==p||t[25]!==u||t[26]!==a?(f=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:a,children:[u,p]}),t[24]=p,t[25]=u,t[26]=a,t[27]=f):f=t[27];let j;t[28]!==f||t[29]!==S?(j=s.jsxs("div",{className:"grid gap-1",children:[S,f]}),t[28]=f,t[29]=S,t[30]=j):j=t[30];let d;return t[31]!==j||t[32]!==m?(d=s.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[m,j]}),t[31]=j,t[32]=m,t[33]=d):d=t[33],d}export{Re as D};
1
+ import{c as oe,b as ae,F as re,o as de,r as ce,K as ie,n as me,e as X,p as ge,t as N,j as s,B as te}from"./index-dh0u4IqP.js";import{u as ue}from"./studio-tools-rxH0R7lt.js";import{b as fe,a as xe,S as Se}from"./settings-section-uyvyi36n.js";import{B as ne}from"./badge-Largeyp5.js";import{I as je}from"./input-CjE2QrUF.js";import{S as pe,a as he,b as Ne,c as ve,d as se}from"./select-KBOQqb5b.js";function Me(e,t,o){switch(e){case"auto":return o("settings.domainSettings.joinModeHelpAuto",{domain:t});case"request":return o("settings.domainSettings.joinModeHelpRequest",{domain:t});default:return o("settings.domainSettings.joinModeHelpOff")}}function Re(){const e=oe.c(101),t=ae(),{org:o}=re(),p=de(),i=ue(),[r,v]=ce.useState("");let c;e[0]!==o.id?(c=ie.organizationDomains(o.id),e[0]=o.id,e[1]=c):c=e[1];let m;e[2]!==i?(m=()=>i.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==c||e[5]!==m?(x={queryKey:c,queryFn:m},e[4]=c,e[5]=m,e[6]=x):x=e[6];const{data:h,isPending:M}=me(x);let S;e[7]!==o.id||e[8]!==p?(S=()=>p.invalidateQueries({queryKey:ie.organizationDomains(o.id)}),e[7]=o.id,e[8]=p,e[9]=S):S=e[9];const a=S;let g;e[10]!==i?(g=n=>i.call("ORGANIZATION_DOMAIN_ADD",{domain:n}),e[10]=i,e[11]=g):g=e[11];let u;e[12]!==a||e[13]!==o.id||e[14]!==t?(u=()=>{ge("organization_domain_added",{organization_id:o.id}),v(""),a(),N.success(t("settings.domainSettings.domainAdded"))},e[12]=a,e[13]=o.id,e[14]=t,e[15]=u):u=e[15];let f;e[16]!==t?(f=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedAddDomain")),e[16]=t,e[17]=f):f=e[17];let j;e[18]!==g||e[19]!==u||e[20]!==f?(j={mutationFn:g,onSuccess:u,onError:f},e[18]=g,e[19]=u,e[20]=f,e[21]=j):j=e[21];const d=X(j);let I;e[22]!==i?(I=n=>{const{id:l,joinMode:D}=n;return i.call("ORGANIZATION_DOMAIN_UPDATE",{id:l,joinMode:D})},e[22]=i,e[23]=I):I=e[23];let A;e[24]!==a||e[25]!==t?(A=()=>{a(),N.success(t("settings.domainSettings.joinModeUpdated"))},e[24]=a,e[25]=t,e[26]=A):A=e[26];let b;e[27]!==t?(b=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedUpdate")),e[27]=t,e[28]=b):b=e[28];let U;e[29]!==b||e[30]!==I||e[31]!==A?(U={mutationFn:I,onSuccess:A,onError:b},e[29]=b,e[30]=I,e[31]=A,e[32]=U):U=e[32];const Q=X(U);let O;e[33]!==i?(O=n=>i.call("ORGANIZATION_DOMAIN_VERIFY",{id:n}),e[33]=i,e[34]=O):O=e[34];let y;e[35]!==a||e[36]!==t?(y=n=>{a(),n.verified?N.success(t("settings.domainSettings.domainVerified")):N.error(t("settings.domainSettings.txtRecordNotFound"))},e[35]=a,e[36]=t,e[37]=y):y=e[37];let E;e[38]!==t?(E=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedVerify")),e[38]=t,e[39]=E):E=e[39];let Y;e[40]!==O||e[41]!==y||e[42]!==E?(Y={mutationFn:O,onSuccess:y,onError:E},e[40]=O,e[41]=y,e[42]=E,e[43]=Y):Y=e[43];const R=X(Y);let C;e[44]!==i?(C=n=>i.call("ORGANIZATION_DOMAIN_REMOVE",{id:n}),e[44]=i,e[45]=C):C=e[45];let P;e[46]!==a||e[47]!==t?(P=()=>{a(),N.success(t("settings.domainSettings.domainRemoved"))},e[46]=a,e[47]=t,e[48]=P):P=e[48];let _;e[49]!==t?(_=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedRemove")),e[49]=t,e[50]=_):_=e[50];let $;e[51]!==C||e[52]!==P||e[53]!==_?($={mutationFn:C,onSuccess:P,onError:_},e[51]=C,e[52]=P,e[53]=_,e[54]=$):$=e[54];const T=X($);if(M)return null;let L;e[55]!==h?.domains?(L=h?.domains??[],e[55]=h?.domains,e[56]=L):L=e[56];const ee=L;let V;e[57]!==t?(V=t("settings.domainSettings.emailDomains"),e[57]=t,e[58]=V):V=e[58];let F;e[59]!==t?(F=t("settings.domainSettings.emailDomainsDescription"),e[59]=t,e[60]=F):F=e[60];let k;if(e[61]!==ee||e[62]!==T||e[63]!==t||e[64]!==Q||e[65]!==R){let n;e[67]!==T||e[68]!==t||e[69]!==Q||e[70]!==R?(n=l=>{const D=l.verificationStatus==="verified";return s.jsx(fe,{title:s.jsxs("span",{className:"flex items-center gap-2",children:[l.domain,D?s.jsx(ne,{variant:"secondary",children:t("settings.domainSettings.verified")}):s.jsx(ne,{variant:"outline",children:t("settings.domainSettings.pending")})]}),description:D?Me(l.joinMode,l.domain,t):t("settings.domainSettings.addDnsRecordInstruction"),action:s.jsxs("div",{className:"flex items-center gap-2",children:[D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:t("settings.domainSettings.joinMode")}),s.jsxs(pe,{value:l.joinMode,onValueChange:le=>Q.mutate({id:l.id,joinMode:le}),children:[s.jsx(he,{className:"w-44",size:"sm",children:s.jsx(Ne,{})}),s.jsxs(ve,{children:[s.jsx(se,{value:"off",children:t("settings.domainSettings.joinModeOff")}),s.jsx(se,{value:"auto",children:t("settings.domainSettings.joinModeAuto")}),s.jsx(se,{value:"request",children:t("settings.domainSettings.joinModeRequest")})]})]})]}),!D&&s.jsx(te,{size:"sm",variant:"outline",onClick:()=>R.mutate(l.id),disabled:R.isPending,children:t("settings.domainSettings.verify")}),s.jsx(te,{size:"sm",variant:"ghost",onClick:()=>T.mutate(l.id),disabled:T.isPending,children:t("settings.domainSettings.remove")})]}),children:!D&&l.recordName&&l.recordValue&&s.jsx(Ie,{recordName:l.recordName,recordValue:l.recordValue})},l.id)},e[67]=T,e[68]=t,e[69]=Q,e[70]=R,e[71]=n):n=e[71],k=ee.map(n),e[61]=ee,e[62]=T,e[63]=t,e[64]=Q,e[65]=R,e[66]=k}else k=e[66];let J;e[72]===Symbol.for("react.memo_cache_sentinel")?(J=n=>v(n.target.value),e[72]=J):J=e[72];let q;e[73]!==t?(q=t("settings.domainSettings.domainPlaceholder"),e[73]=t,e[74]=q):q=e[74];let z;e[75]!==r||e[76]!==q?(z=s.jsx(je,{value:r,onChange:J,placeholder:q,className:"max-w-xs"}),e[75]=r,e[76]=q,e[77]=z):z=e[77];let w;e[78]!==d||e[79]!==r?(w=()=>d.mutate(r.trim()),e[78]=d,e[79]=r,e[80]=w):w=e[80];let G;e[81]!==d.isPending||e[82]!==r?(G=!r.trim()||d.isPending,e[81]=d.isPending,e[82]=r,e[83]=G):G=e[83];let Z;e[84]!==d.isPending||e[85]!==t?(Z=d.isPending?t("settings.domainSettings.adding"):t("settings.domainSettings.addDomain"),e[84]=d.isPending,e[85]=t,e[86]=Z):Z=e[86];let B;e[87]!==w||e[88]!==G||e[89]!==Z?(B=s.jsx(te,{size:"sm",onClick:w,disabled:G,children:Z}),e[87]=w,e[88]=G,e[89]=Z,e[90]=B):B=e[90];let H;e[91]!==z||e[92]!==B?(H=s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[z,B]}),e[91]=z,e[92]=B,e[93]=H):H=e[93];let K;e[94]!==k||e[95]!==H?(K=s.jsxs(xe,{children:[k,H]}),e[94]=k,e[95]=H,e[96]=K):K=e[96];let W;return e[97]!==V||e[98]!==F||e[99]!==K?(W=s.jsx(Se,{title:V,description:F,children:K}),e[97]=V,e[98]=F,e[99]=K,e[100]=W):W=e[100],W}function Ie(e){const t=oe.c(34),{recordName:o,recordValue:p}=e,i=ae();let r;t[0]!==i?(r=I=>{navigator.clipboard?.writeText(I),N.success(i("settings.domainSettings.copied"))},t[0]=i,t[1]=r):r=t[1];const v=r;let c;t[2]!==i?(c=i("settings.domainSettings.dnsInstructions"),t[2]=i,t[3]=c):c=t[3];let m;t[4]!==c?(m=s.jsx("p",{className:"text-muted-foreground",children:c}),t[4]=c,t[5]=m):m=t[5];let x;t[6]!==v||t[7]!==o?(x=()=>v(o),t[6]=v,t[7]=o,t[8]=x):x=t[8];let h;t[9]!==i?(h=i("settings.domainSettings.txt"),t[9]=i,t[10]=h):h=t[10];let M;t[11]!==h?(M=s.jsxs("span",{className:"text-muted-foreground",children:[h," "]}),t[11]=h,t[12]=M):M=t[12];let S;t[13]!==o||t[14]!==x||t[15]!==M?(S=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:x,children:[M,o]}),t[13]=o,t[14]=x,t[15]=M,t[16]=S):S=t[16];let a;t[17]!==v||t[18]!==p?(a=()=>v(p),t[17]=v,t[18]=p,t[19]=a):a=t[19];let g;t[20]!==i?(g=i("settings.domainSettings.value"),t[20]=i,t[21]=g):g=t[21];let u;t[22]!==g?(u=s.jsxs("span",{className:"text-muted-foreground",children:[g," "]}),t[22]=g,t[23]=u):u=t[23];let f;t[24]!==p||t[25]!==u||t[26]!==a?(f=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:a,children:[u,p]}),t[24]=p,t[25]=u,t[26]=a,t[27]=f):f=t[27];let j;t[28]!==f||t[29]!==S?(j=s.jsxs("div",{className:"grid gap-1",children:[S,f]}),t[28]=f,t[29]=S,t[30]=j):j=t[30];let d;return t[31]!==j||t[32]!==m?(d=s.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[m,j]}),t[31]=j,t[32]=m,t[33]=d):d=t[33],d}export{Re as D};