decocms 3.89.3 → 3.90.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/client/assets/{AlertCircle-NC3dB7os.js → AlertCircle-BFW82Glo.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-D9dn8W9B.js → ArrowUpRight-B8NHPBEV.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-4xU28_ze.js → CheckCircle-DNGMJpxK.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-4vfFBrpS.js → ChevronDown-CIJ7-0w6.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-CCAFk4Lh.js → ChevronLeft-DwrsIjn7.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BSaK-g_n.js → ChevronRight-CFrkN22M.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CIoJSXpm.js → ChevronUp-5yVty_-J.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-DXhOiROl.js → DotsVertical-B_6X1vi7.js} +1 -1
  9. package/dist/client/assets/{Eye-BcF7vo02.js → Eye-CVnhloDi.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CyP0eiMt.js → FilterLines-aCF-EO8Z.js} +1 -1
  11. package/dist/client/assets/{Globe01-cpwm3ZU4.js → Globe01-CThKgW6h.js} +1 -1
  12. package/dist/client/assets/{Globe04-DdU789Mf.js → Globe04-BM8I7PlJ.js} +1 -1
  13. package/dist/client/assets/{HardDrive-8lyy5Dp-.js → HardDrive-CnFxYfXA.js} +1 -1
  14. package/dist/client/assets/{Key01-C3jXuyTV.js → Key01-NlklfK2W.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BA3GeXV2.js → LayoutLeft-DeMAAMUQ.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-Dc9R-z7y.js → LinkExternal01-BQAshidh.js} +1 -1
  17. package/dist/client/assets/{Monitor01-4eRzNp1q.js → Monitor01-Dvufl23t.js} +1 -1
  18. package/dist/client/assets/{Palette-DziwArEq.js → Palette-BpmN1_H8.js} +1 -1
  19. package/dist/client/assets/{Play-BTFQj3qh.js → Play-BLi-TNw8.js} +1 -1
  20. package/dist/client/assets/{Plus-pFzKRSyH.js → Plus-DiPCnPyI.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BiaNZC1b.js → SearchMd-CKZEESAy.js} +1 -1
  22. package/dist/client/assets/{Settings02-Bvzlcm1U.js → Settings02-xJ3tiWNi.js} +1 -1
  23. package/dist/client/assets/{Shield01-CtXmxEJK.js → Shield01-CJTqMoEC.js} +1 -1
  24. package/dist/client/assets/{Star01-B2kdQndt.js → Star01-BO7uFQpG.js} +1 -1
  25. package/dist/client/assets/{Stars01-C_5LYi93.js → Stars01-BXxzvxO4.js} +1 -1
  26. package/dist/client/assets/{Stars02-i3gYlhXk.js → Stars02-CjJwnXFf.js} +1 -1
  27. package/dist/client/assets/{Sun-CoqE3qoL.js → Sun-O-ShYNtI.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-CPEaTyhx.js → SwitchHorizontal01-Bw76z7hc.js} +1 -1
  29. package/dist/client/assets/{Tool01-BmUpgiVH.js → Tool01-D2a8I_Gf.js} +1 -1
  30. package/dist/client/assets/{Trash01-B2-9vQgJ.js → Trash01-DmRbdJUk.js} +1 -1
  31. package/dist/client/assets/{Upload01-FAxCvObz.js → Upload01-Ccj_plFg.js} +1 -1
  32. package/dist/client/assets/{User01-C1HCSK6y.js → User01-BzP8oKZ3.js} +1 -1
  33. package/dist/client/assets/{Users01-D0cghbTw.js → Users01-CdAaoMtW.js} +1 -1
  34. package/dist/client/assets/{Users03-vYWz866I.js → Users03-fR0V8I72.js} +1 -1
  35. package/dist/client/assets/{X-DVenJxl2.js → X-BAIghubv.js} +1 -1
  36. package/dist/client/assets/{XCircle-DkV5O0gt.js → XCircle-CdCz4npr.js} +1 -1
  37. package/dist/client/assets/{XClose-1aztqZN5.js → XClose-vwNqWD2m.js} +1 -1
  38. package/dist/client/assets/{Zap-CxBpS0TW.js → Zap-BJK90vlv.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-BupPfcYG.js → ZapSquare-DuHMAFt7.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DXDDUqzg.js → ZoomOut-Bpyue_Zw.js} +1 -1
  41. package/dist/client/assets/{access-gate-DJ3w7Rqa.js → access-gate-DcWgdeR9.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-B_FGzKHG.js → add-section-modal-DT5a2xfl.js} +1 -1
  43. package/dist/client/assets/{agent-icon-B9Rg96af.js → agent-icon-Dh6cDydc.js} +1 -1
  44. package/dist/client/assets/{agents-list-BpBQ33-8.js → agents-list-DTju_D-G.js} +1 -1
  45. package/dist/client/assets/ai-providers-lyzQuhAE.js +1 -0
  46. package/dist/client/assets/{alert-DBActzOw.js → alert-BPkaPX8i.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-TZS2F66y.js → alert-dialog-szhg9nbv.js} +3 -3
  48. package/dist/client/assets/app-editor-C-GJQzq3.js +1 -0
  49. package/dist/client/assets/{auth-catchall-jfA3V8jK.js → auth-catchall-C5WYUBq2.js} +1 -1
  50. package/dist/client/assets/{auth-entry-CzM_DcXD.js → auth-entry-v4IJxk9p.js} +1 -1
  51. package/dist/client/assets/{auth-split-layout-D8jZEv56.js → auth-split-layout-D6VmaiAh.js} +1 -1
  52. package/dist/client/assets/{auth-B2SyT5jq.js → auth-ylAHlhew.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-ugENWEdg.js → authenticate-and-persist-oauth-v9BhfxwO.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-RaQMgsZa.js → automation-list-row-BDQR6lip.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DEnZLNcv.js → automation-runs-CE9uyAtN.js} +1 -1
  56. package/dist/client/assets/automations-YJ5Px3_a.js +1 -0
  57. package/dist/client/assets/{avatar-Cz89OzST.js → avatar-C54BAvwV.js} +1 -1
  58. package/dist/client/assets/{badge-DemqTgjN.js → badge-WRzJoL2O.js} +1 -1
  59. package/dist/client/assets/{block-document-DnpmRre2.js → block-document-DUdX-3AH.js} +1 -1
  60. package/dist/client/assets/{brand-context-44FYoRF-.js → brand-context-BZ1-31a8.js} +1 -1
  61. package/dist/client/assets/buckets-DsHDoGzh.js +1 -0
  62. package/dist/client/assets/{capability-load-error-CD0k_ZBV.js → capability-load-error-BhBYuN70.js} +1 -1
  63. package/dist/client/assets/{card-DWocPikY.js → card-CZbszR9z.js} +1 -1
  64. package/dist/client/assets/category-editor-BSjmmy8p.js +1 -0
  65. package/dist/client/assets/{chat-context-bLbsqSUE.js → chat-context-2a9Unx31.js} +5 -5
  66. package/dist/client/assets/{checkbox-DmyBqpG7.js → checkbox-BbXVn_YC.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-g1RYvQjB.js → cli-auth-success-UyrL3uNf.js} +1 -1
  68. package/dist/client/assets/collection-detail-BEFyIol2.js +1 -0
  69. package/dist/client/assets/{collection-display-button-CmYy5ol1.js → collection-display-button-CZL1yZYo.js} +1 -1
  70. package/dist/client/assets/{collection-search-JyQFyghK.js → collection-search-DBIvyJJc.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-LMEfLwWZ.js → collection-tabs-C7lBi7ts.js} +1 -1
  72. package/dist/client/assets/command-yaXImYX7.js +1 -0
  73. package/dist/client/assets/commerce-onboarding-DrBs9RF7.js +1 -0
  74. package/dist/client/assets/{connect-desktop-dialog-dXosml16.js → connect-desktop-dialog-8X7uGHQP.js} +1 -1
  75. package/dist/client/assets/{connection-card-DoMs787B.js → connection-card-B9W_RY27.js} +1 -1
  76. package/dist/client/assets/connection-detail-q-5qcjda.js +1 -0
  77. package/dist/client/assets/{connection-form-helpers-Dm__G9wh.js → connection-form-helpers-BzU7xnbX.js} +1 -1
  78. package/dist/client/assets/connections-DZXZfK8S.js +1 -0
  79. package/dist/client/assets/{context-menu-B93bMgay.js → context-menu-C5FEV_by.js} +1 -1
  80. package/dist/client/assets/{decopilot-4k7KQSVX.js → decopilot-BJ5FU5R8.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-BEKDdVOU.js → decopilot-sse-pool-CjP6zAlU.js} +1 -1
  82. package/dist/client/assets/{dialog-BbHIKIUS.js → dialog-lbyUpqPt.js} +1 -1
  83. package/dist/client/assets/{domain-settings-PpBMgUMH.js → domain-settings-Bxo_fvwt.js} +1 -1
  84. package/dist/client/assets/{drawer-kr03m1vm.js → drawer-BZYAwdgw.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-vGHmo9fD.js → dropdown-menu-DF3B7I1K.js} +1 -1
  86. package/dist/client/assets/{empty-state-B4c8fq4i.js → empty-state-BAyVSC9K.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-D9jcQvie.js → extract-connection-data-C4TpBkxN.js} +1 -1
  88. package/dist/client/assets/file-explorer-BQgJH40A.js +2 -0
  89. package/dist/client/assets/{file-type-icon-DO4mmgEl.js → file-type-icon-D7nzXwZZ.js} +1 -1
  90. package/dist/client/assets/{files-DSkQRfS7.js → files-mQKfk-tg.js} +1 -1
  91. package/dist/client/assets/{form-BtzyQGYU.js → form-BGbfy77_.js} +1 -1
  92. package/dist/client/assets/general-3ck_txNd.js +1 -0
  93. package/dist/client/assets/{github-repo-picker-BR4lmXmU.js → github-repo-picker-Dt_KVpAO.js} +1 -1
  94. package/dist/client/assets/{hooks-DlrZPw8A.js → hooks-BdAROdrZ.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-DCkFh2H5.js → import-from-deco-dialog-l8ENbsJP.js} +1 -1
  96. package/dist/client/assets/{index-DeXSnTz7.js → index-BKAnigFO.js} +2 -2
  97. package/dist/client/assets/{index-B37Lpv5S.js → index-BUS-a-tW.js} +4 -4
  98. package/dist/client/assets/index-C0eVGhHT.js +1 -0
  99. package/dist/client/assets/{index-yU2r0Gdy.js → index-C6PDcnUv.js} +10 -10
  100. package/dist/client/assets/index-CInyex9M.js +1 -0
  101. package/dist/client/assets/{index-JuJHr8Il.js → index-Cj5OqjXz.js} +1 -1
  102. package/dist/client/assets/{index-BqVMogvA.js → index-CqqoV_UO.js} +1 -1
  103. package/dist/client/assets/index-CuICTOkh.js +26 -0
  104. package/dist/client/assets/index-D0fvhtT3.js +1 -0
  105. package/dist/client/assets/{index-BbMa6I-9.js → index-DOaXG0Oi.js} +2 -2
  106. package/dist/client/assets/{index-CAIYCRJp.js → index-Dg5jx7eC.js} +1 -1
  107. package/dist/client/assets/{index-DasNl4Yd.js → index-DlWRWOod.js} +1 -1
  108. package/dist/client/assets/{index-BHKcN4cC.js → index-n4Vo7V4h.js} +1 -1
  109. package/dist/client/assets/{index-redirect-c7PIBlRk.js → index-redirect-ChD654T3.js} +1 -1
  110. package/dist/client/assets/{index-ZjRHn464.js → index-waTLikGH.js} +1 -1
  111. package/dist/client/assets/{input-D3OR9wlV.js → input-D8TXMXM-.js} +1 -1
  112. package/dist/client/assets/{integration-icon-DtONHt_d.js → integration-icon-D2yZ6MPG.js} +1 -1
  113. package/dist/client/assets/{label-C3oLcOn0.js → label-CFlYbKnz.js} +1 -1
  114. package/dist/client/assets/{login-DjI0bYya.js → login-CnaQyAhS.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-B7tRsqo-.js → mcp-oauth-oXYSrL8I.js} +1 -1
  116. package/dist/client/assets/{members-DIxpLBtJ.js → members-BQ3iSjR0.js} +2 -2
  117. package/dist/client/assets/{monaco-editor-CI1Pa0QN.js → monaco-editor-D82OjyDd.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-BcIi6QZu.js → monitoring-stats-row-BuPr-4zl.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-Dgp5DdjP.js → oauth-callback-DtstK2kL.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-DPhQ8sI3.js → oauth-callback-ai-provider-BgnPPSol.js} +1 -1
  121. package/dist/client/assets/{onboarding-DtsS5lUr.js → onboarding-CJH0Leuw.js} +1 -1
  122. package/dist/client/assets/{org-install-7RmPSbO9.js → org-install-D67sKYgq.js} +1 -1
  123. package/dist/client/assets/{org-layout--gQCQGBA.js → org-layout-BLUbiGyn.js} +1 -1
  124. package/dist/client/assets/{organization-choice-A8WzCg8t.js → organization-choice-CHjmYj3j.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-rxuP--YT.js → page-seo-form-C4I7m4Df.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-YKiIzrJb.js +1 -0
  127. package/dist/client/assets/{popover-voqJlCLR.js → popover-D2Q2Eswn.js} +1 -1
  128. package/dist/client/assets/post-editor-Bv1F9MYX.js +1 -0
  129. package/dist/client/assets/{preview-dialog-DC1NsLKi.js → preview-dialog-Bc2VzAN-.js} +1 -1
  130. package/dist/client/assets/{primitives-DLRj8yUL.js → primitives-DHTHNxUS.js} +1 -1
  131. package/dist/client/assets/profile-B6N3yux5.js +1 -0
  132. package/dist/client/assets/project-app-view-BELIYBcW.js +1 -0
  133. package/dist/client/assets/record-editor-DaT6c7WV.js +1 -0
  134. package/dist/client/assets/registry-DCDFj_rf.js +2 -0
  135. package/dist/client/assets/{registry-layout-Bsm16ESy.js → registry-layout-Cy_01Sh1.js} +2 -2
  136. package/dist/client/assets/{require-capability-WHfqcRqc.js → require-capability-ClWn_lpQ.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-CcH9lzeU.js → required-auth-layout-wwcnSe6F.js} +1 -1
  138. package/dist/client/assets/{reset-password-o6QeBSLY.js → reset-password-DaGLhf4o.js} +1 -1
  139. package/dist/client/assets/{roles-D_-_h1c8.js → roles-CaiOtbXD.js} +1 -1
  140. package/dist/client/assets/{save-status-D4ISIXoj.js → save-status-CTER4gWs.js} +1 -1
  141. package/dist/client/assets/{scroll-area-CLfWXW0D.js → scroll-area-CryCPcTg.js} +1 -1
  142. package/dist/client/assets/{search-input-DPBtlWUD.js → search-input-CeZYeezj.js} +1 -1
  143. package/dist/client/assets/secrets-BrjgXM97.js +1 -0
  144. package/dist/client/assets/{sections-editor-DdPJUwmv.js → sections-editor-F-BnnENl.js} +2 -2
  145. package/dist/client/assets/select-BumbnE5Z.js +1 -0
  146. package/dist/client/assets/{select-model-DdKq7y8l.js → select-model-CTcIByf-.js} +1 -1
  147. package/dist/client/assets/seo-editor-ClI_EAvi.js +1 -0
  148. package/dist/client/assets/{settings-layout-Bf0CD3Ha.js → settings-layout-DXkAusB2.js} +1 -1
  149. package/dist/client/assets/{settings-section-BOPxWg6D.js → settings-section-C5bkQp2g.js} +1 -1
  150. package/dist/client/assets/{sheet-BCI6wljB.js → sheet-BbFKIkah.js} +1 -1
  151. package/dist/client/assets/{shell-controls-CUcC0uoE.js → shell-controls-DGWPxiPv.js} +1 -1
  152. package/dist/client/assets/{shell-layout-BpdvdxRY.js → shell-layout-C9OrPrc4.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-CrU5yzKP.js → shell-route-loading-DaawUhrG.js} +1 -1
  154. package/dist/client/assets/{sidebar-DLjbCYfe.js → sidebar-DaurSYcm.js} +1 -1
  155. package/dist/client/assets/{skeleton-vuq3rnUi.js → skeleton-C0NWZPiq.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-aG8KzwUt.js → sortable.esm-BqlsxZdn.js} +1 -1
  157. package/dist/client/assets/sso-9s_kUvCN.js +1 -0
  158. package/dist/client/assets/{store-ChzWT5-N.js → store-Ba8mcjDx.js} +1 -1
  159. package/dist/client/assets/store-registry-DEktUT3r.js +2 -0
  160. package/dist/client/assets/{studio-tools-QGvUs6qu.js → studio-tools-BO3QwsEE.js} +1 -1
  161. package/dist/client/assets/{switch-BwnzJhUB.js → switch-B87bQp16.js} +1 -1
  162. package/dist/client/assets/{table-DyiI6lY1.js → table-N4-giWdo.js} +1 -1
  163. package/dist/client/assets/{tabs-2cKRgONn.js → tabs-CRPtX_rJ.js} +1 -1
  164. package/dist/client/assets/{task-status-1cY6Pf8x.js → task-status-2UEXnm8o.js} +1 -1
  165. package/dist/client/assets/{textarea-DqRxFP0T.js → textarea-Du6Le5sO.js} +1 -1
  166. package/dist/client/assets/{toggle-group-CvE2Rn7y.js → toggle-group-CBnuvlgo.js} +1 -1
  167. package/dist/client/assets/{toolbar-Dsvneu3f.js → toolbar-DdFuWthq.js} +1 -1
  168. package/dist/client/assets/{tooltip-Bjh8CXdQ.js → tooltip-xmkm89yV.js} +1 -1
  169. package/dist/client/assets/{types-CXT3eJPp.js → types-D8C9oPp4.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-Cm6bJu4O.js → use-ai-providers-9J9bNHdx.js} +1 -1
  171. package/dist/client/assets/{use-automations-hkjYbjXY.js → use-automations-D_7wf0xL.js} +1 -1
  172. package/dist/client/assets/{use-capability-qIjsd8HD.js → use-capability-DNSU4SSH.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-Doyl2hlk.js → use-clock-tick-6wGCr9QA.js} +1 -1
  174. package/dist/client/assets/{use-collections-OMXnywUO.js → use-collections-FvPggnCf.js} +1 -1
  175. package/dist/client/assets/use-connection-C3KlVqRc.js +1 -0
  176. package/dist/client/assets/{use-copy-CjrJL2o4.js → use-copy-DvqrWhoO.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BbhHiNda.js → use-create-virtual-mcp-CTi94rag.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BStxRiyA.js → use-debounced-autosave-BtHhY3kf.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-CcoavCzH.js → use-delete-connection-Ba_GRKCM.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-DwaAJaA6.js → use-file-configs-Pe4NRgWE.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-BLyYnILN.js → use-infinite-scroll-DL5hyVmQ.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-DzaX5jxt.js → use-join-requests-D_Gq_19N.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-CX47WlCL.js → use-mcp-client-CLcTwBS1.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-CbrvbR3P.js → use-mcp-prompts-DC-bHnlV.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-C37oT0bu.js → use-mcp-tools-DHra8uvX.js} +1 -1
  186. package/dist/client/assets/{use-members-CtUanB1S.js → use-members-DARPXJlK.js} +1 -1
  187. package/dist/client/assets/{use-mobile-BsQGJSz8.js → use-mobile-DFs3QJqY.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-C_B7rQZ3.js → use-navigate-to-agent-rF0GaXHe.js} +1 -1
  189. package/dist/client/assets/use-org-auth-client-C7qnan75.js +1 -0
  190. package/dist/client/assets/{use-org-sso-DKfKkOYy.js → use-org-sso-Bo9vUunv.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-LSjQh-hO.js → use-organization-roles-De8oePVP.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-Cw-0oyZX.js → use-organization-settings-57SGXats.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-sALt7ACC.js → use-registry-connections-Ii3j5xH_.js} +1 -1
  194. package/dist/client/assets/{use-secrets-DyPgSICV.js → use-secrets-C4ru1qie.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-YKEkF-4T.js → use-status-sounds-BP_ijgUo.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-BMTZD0uv.js → use-view-mode-Bl_CH29I.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-ByWPjIzd.js → use-virtual-mcp-DgKfTExI.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-uhUmaTO5.js +1 -0
  199. package/dist/client/assets/{useQueries-Do45fFi7.js → useQueries-CgTem5R4.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-DjACAiSm.js +1 -0
  201. package/dist/client/assets/variant-calendar-CyMRGA_z.js +1 -0
  202. package/dist/client/assets/{view-mode-toggle-yOXFqeV7.js → view-mode-toggle-DNw1iw_b.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +429 -429
  205. package/package.json +4 -5
  206. package/dist/client/assets/Form-DLIz5vwr.js +0 -26
  207. package/dist/client/assets/ai-providers-Cr1HJb4g.js +0 -1
  208. package/dist/client/assets/app-editor-Cu5Jn0bp.js +0 -1
  209. package/dist/client/assets/automations-LxVvDRSf.js +0 -1
  210. package/dist/client/assets/buckets-pliF9NOx.js +0 -1
  211. package/dist/client/assets/category-editor-BElGS0p5.js +0 -1
  212. package/dist/client/assets/collection-detail-BfoXrAWD.js +0 -1
  213. package/dist/client/assets/command-6Xv18lx6.js +0 -1
  214. package/dist/client/assets/commerce-onboarding-COle5u-q.js +0 -1
  215. package/dist/client/assets/connection-detail-Cy4adAl6.js +0 -1
  216. package/dist/client/assets/connections-x7QDuFJK.js +0 -1
  217. package/dist/client/assets/file-explorer-BujxJOsE.js +0 -2
  218. package/dist/client/assets/general-BjDrCY53.js +0 -1
  219. package/dist/client/assets/index-B7G40tVP.js +0 -1
  220. package/dist/client/assets/index-BdQq_4o_.js +0 -1
  221. package/dist/client/assets/index-CxLZ7FWT.js +0 -1
  222. package/dist/client/assets/index-DGekSTiC.js +0 -1
  223. package/dist/client/assets/index-hl6kLhIe.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-vEubWUB4.js +0 -1
  225. package/dist/client/assets/post-editor-CukRi04m.js +0 -1
  226. package/dist/client/assets/profile-Cuy0XRiQ.js +0 -1
  227. package/dist/client/assets/project-app-view-DCl-CWYr.js +0 -1
  228. package/dist/client/assets/record-editor-DOI2gIfd.js +0 -1
  229. package/dist/client/assets/registry-EBdkezYg.js +0 -2
  230. package/dist/client/assets/secrets-cvbnrgVx.js +0 -1
  231. package/dist/client/assets/select-Dm5gSFeK.js +0 -1
  232. package/dist/client/assets/seo-editor-D12GD7FT.js +0 -1
  233. package/dist/client/assets/sso-V1O3oG0I.js +0 -1
  234. package/dist/client/assets/store-registry-DwmY0RAT.js +0 -2
  235. package/dist/client/assets/tools-list-Dk1OdhLO.js +0 -1
  236. package/dist/client/assets/use-connection-CQmB3ngS.js +0 -1
  237. package/dist/client/assets/use-org-auth-client-BWt-3T2p.js +0 -1
  238. package/dist/client/assets/useInfiniteQuery-V0rLmF2w.js +0 -1
  239. package/dist/client/assets/useSuspenseInfiniteQuery-Zpghw-jA.js +0 -1
  240. package/dist/client/assets/variant-calendar-bDr2uwc7.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-BUS-a-tW.js";import{E as Ee}from"./empty-state-BAyVSC9K.js";import{u as et,a as Ae}from"./use-collections-FvPggnCf.js";import{u as ce}from"./use-mcp-client-CLcTwBS1.js";import{F as ne,a as tt,b as de,d as me}from"./form-BGbfy77_.js";import{I as ue}from"./input-D8TXMXM-.js";import{T as re}from"./textarea-Du6Le5sO.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CuICTOkh.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-Dh6cDydc.js";import{g as ut,M as xt,a as Ne}from"./types-D8C9oPp4.js";import{A as pt,a as ft,b as ht}from"./alert-BPkaPX8i.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-BumbnE5Z.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-xmkm89yV.js";import{i as jt}from"./AlertCircle-BFW82Glo.js";import{s as bt}from"./Stars02-CjJwnXFf.js";import{a as Nt}from"./Eye-CVnhloDi.js";import{i as vt}from"./Play-BLi-TNw8.js";import{i as St}from"./ChevronRight-CFrkN22M.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-C0eVGhHT.js";import{a as Oe,u as Re}from"./use-connection-C3KlVqRc.js";import{a as It}from"./use-mcp-tools-DHra8uvX.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-D2yZ6MPG.js";import{f as Tt,h as Pt}from"./chat-context-2a9Unx31.js";import{b as kt}from"./shell-layout-C9OrPrc4.js";import{M as Et}from"./monaco-editor-D82OjyDd.js";import{n as At}from"./XCircle-CdCz4npr.js";import"./auth-ylAHlhew.js";import"./label-CFlYbKnz.js";import"./index-waTLikGH.js";import"./sidebar-DaurSYcm.js";import"./LayoutLeft-DeMAAMUQ.js";import"./use-mobile-DFs3QJqY.js";import"./sheet-BbFKIkah.js";import"./X-BAIghubv.js";import"./ZoomOut-Bpyue_Zw.js";import"./Key01-NlklfK2W.js";import"./extract-connection-data-C4TpBkxN.js";import"./use-registry-connections-Ii3j5xH_.js";import"./use-organization-settings-57SGXats.js";import"./studio-tools-BO3QwsEE.js";import"./Plus-DiPCnPyI.js";import"./index-Dg5jx7eC.js";import"./index-n4Vo7V4h.js";import"./popover-D2Q2Eswn.js";import"./use-virtual-mcp-DgKfTExI.js";import"./ChevronUp-5yVty_-J.js";import"./SearchMd-CKZEESAy.js";import"./Users03-fR0V8I72.js";import"./use-create-virtual-mcp-CTi94rag.js";import"./use-navigate-to-agent-rF0GaXHe.js";import"./Tool01-D2a8I_Gf.js";import"./SwitchHorizontal01-Bw76z7hc.js";import"./Settings02-xJ3tiWNi.js";import"./ArrowUpRight-B8NHPBEV.js";import"./ZapSquare-DuHMAFt7.js";import"./CheckCircle-DNGMJpxK.js";import"./ChevronDown-CIJ7-0w6.js";import"./ChevronLeft-DwrsIjn7.js";import"./DotsVertical-B_6X1vi7.js";import"./Globe01-CThKgW6h.js";import"./FilterLines-aCF-EO8Z.js";import"./Star01-BO7uFQpG.js";import"./Globe04-BM8I7PlJ.js";import"./HardDrive-CnFxYfXA.js";import"./LinkExternal01-BQAshidh.js";import"./Monitor01-Dvufl23t.js";import"./Sun-O-ShYNtI.js";import"./Palette-BpmN1_H8.js";import"./Shield01-CJTqMoEC.js";import"./Stars01-BXxzvxO4.js";import"./Trash01-DmRbdJUk.js";import"./Upload01-Ccj_plFg.js";import"./User01-BzP8oKZ3.js";import"./Users01-CdAaoMtW.js";import"./XClose-vwNqWD2m.js";import"./Zap-BJK90vlv.js";import"./mcp-oauth-oXYSrL8I.js";import"./badge-WRzJoL2O.js";import"./hooks-BdAROdrZ.js";import"./decopilot-sse-pool-CjP6zAlU.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-9J9bNHdx.js";import"./tab-id-BptcWVWa.js";import"./avatar-C54BAvwV.js";import"./dialog-lbyUpqPt.js";import"./required-auth-layout-wwcnSe6F.js";import"./use-org-sso-Bo9vUunv.js";import"./index-Cj5OqjXz.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-B37Lpv5S.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-vGHmo9fD.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-CPEaTyhx.js";import{i as S}from"./ChevronUp-CIoJSXpm.js";import{a as I,b as K,c as P,T as W}from"./tooltip-Bjh8CXdQ.js";import{V as q}from"./view-mode-toggle-yOXFqeV7.js";import{B as G}from"./badge-DemqTgjN.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-BUS-a-tW.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-DF3B7I1K.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-Bw76z7hc.js";import{i as S}from"./ChevronUp-5yVty_-J.js";import{a as I,b as K,c as P,T as W}from"./tooltip-xmkm89yV.js";import{V as q}from"./view-mode-toggle-DNw1iw_b.js";import{B as G}from"./badge-WRzJoL2O.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-B37Lpv5S.js";import{i as C}from"./SearchMd-BiaNZC1b.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-BUS-a-tW.js";import{i as C}from"./SearchMd-CKZEESAy.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-B37Lpv5S.js";import{B as g}from"./badge-DemqTgjN.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,l as u,j as m}from"./index-BUS-a-tW.js";import{B as g}from"./badge-WRzJoL2O.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -0,0 +1 @@
1
+ import{c as d,l as i,j as n}from"./index-BUS-a-tW.js";import{_ as m}from"./index-n4Vo7V4h.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-lbyUpqPt.js";import{i as y}from"./SearchMd-CKZEESAy.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
@@ -0,0 +1 @@
1
+ import{c as E,r as q,l as X,j as t,B as V,m as Xe,d as Le,K as H,o as Ae,s as me,n as De,p as Me,k as ue,i as Je,a as Fe,u as Ct,b as et,q as St,v as tt,Q as vt,E as Nt,w as Qe,L as _t}from"./index-BUS-a-tW.js";import{A as wt}from"./auth-entry-v4IJxk9p.js";import{A as Q}from"./auth-split-layout-D6VmaiAh.js";import{O as We}from"./organization-choice-CHjmYj3j.js";import{f as It}from"./tab-id-BptcWVWa.js";import{I as Ke}from"./input-D8TXMXM-.js";import{u as _e,W as nt,S as st,g as Tt,C as Et}from"./use-mcp-client-CLcTwBS1.js";import{i as it}from"./XCircle-CdCz4npr.js";import{I as kt}from"./integration-icon-D2yZ6MPG.js";import{D as qe,a as Ot,b as Rt,c as Ut,d as $t,e as Pt}from"./dialog-lbyUpqPt.js";import{T as zt,a as Lt,b as At}from"./tooltip-xmkm89yV.js";import{i as ot}from"./CheckCircle-DNGMJpxK.js";import{i as Dt}from"./ZoomOut-Bpyue_Zw.js";import{g as Mt,c as Ft,e as Kt}from"./extract-connection-data-C4TpBkxN.js";import{F as fe,a as Ve,b as pe,c as ge,d as he,e as xe}from"./form-BGbfy77_.js";import{i as qt}from"./ChevronUp-5yVty_-J.js";import{s as Vt,a as Bt}from"./Eye-CVnhloDi.js";import{i as Gt}from"./Settings02-xJ3tiWNi.js";import{S as rt,a as lt,b as at,c as ct,d as dt}from"./select-BumbnE5Z.js";import{u as Ht}from"./useQueries-CgTem5R4.js";import{a as Qt}from"./authenticate-and-persist-oauth-v9BhfxwO.js";import{i as ut}from"./ArrowUpRight-B8NHPBEV.js";import{s as mt}from"./User01-BzP8oKZ3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C54BAvwV.js";import"./auth-ylAHlhew.js";import"./agent-icon-Dh6cDydc.js";import"./AlertCircle-BFW82Glo.js";import"./Tool01-D2a8I_Gf.js";import"./SwitchHorizontal01-Bw76z7hc.js";import"./ZapSquare-DuHMAFt7.js";import"./Users03-fR0V8I72.js";import"./ChevronDown-CIJ7-0w6.js";import"./ChevronLeft-DwrsIjn7.js";import"./ChevronRight-CFrkN22M.js";import"./DotsVertical-B_6X1vi7.js";import"./Stars02-CjJwnXFf.js";import"./Globe01-CThKgW6h.js";import"./FilterLines-aCF-EO8Z.js";import"./Star01-BO7uFQpG.js";import"./Globe04-BM8I7PlJ.js";import"./HardDrive-CnFxYfXA.js";import"./Key01-NlklfK2W.js";import"./LayoutLeft-DeMAAMUQ.js";import"./LinkExternal01-BQAshidh.js";import"./Monitor01-Dvufl23t.js";import"./Sun-O-ShYNtI.js";import"./Palette-BpmN1_H8.js";import"./Play-BLi-TNw8.js";import"./Plus-DiPCnPyI.js";import"./SearchMd-CKZEESAy.js";import"./Shield01-CJTqMoEC.js";import"./Stars01-BXxzvxO4.js";import"./Trash01-DmRbdJUk.js";import"./Upload01-Ccj_plFg.js";import"./Users01-CdAaoMtW.js";import"./XClose-vwNqWD2m.js";import"./X-BAIghubv.js";import"./Zap-BJK90vlv.js";import"./label-CFlYbKnz.js";import"./mcp-oauth-oXYSrL8I.js";const Wt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Yt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Zt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,Xt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ue(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Wt.test(e),i=Yt.test(e),o=Zt.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=r.hostname.split(".");return a.length<2||a.some(l=>!l||!Xt.test(l))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function $e(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=a):a=e[0];const l=a;let d;e[1]!==o?(d=X("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:l,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=X("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function Jt(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&n.push({fieldKey:i,bindingType:a})}return n}function en(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function Z(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function tn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Pe(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Pe):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Pe(n)):!1}function nn(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function sn(s){return Pe(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function on(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=sn(n);return i?[{key:e,label:nn(e),value:i}]:[]}):[]}function rn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=a=>a.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function ln(s){return s.server?.icons?.[0]?.src??Mt(s.server?.repository)??null}function an(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function cn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,a=r?n.get(r):void 0,l=r&&a?r:null,d=l?s.connectionReadiness?.[l]!==!1:!1,f=!!l&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:an(c,i.bindingType),icon:ln(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:l||rn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:l,configurationState:a?.configuration_state??null})}return e}function dn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function un(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function Ye(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[a,l]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(K){console.error("Failed to copy text: ",K)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==a?(x=()=>{l(!a)},e[8]=a,e[9]=x):x=e[9];const g=x,j=a?"text":"password";let y;e[10]!==n?(y=X("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ke,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=a?"Hide password":"Show password";let b;e[19]!==a?(b=a?t.jsx(Gt,{size:16}):t.jsx(Vt,{size:16}),e[19]=a,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(qt,{size:16}):t.jsx(Bt,{size:16}),e[25]=d,e[26]=_):_=e[26];let k;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(k=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=k):k=e[31];let O;e[32]!==k||e[33]!==C?(O=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,k]}),e[32]=k,e[33]=C,e[34]=O):O=e[34];let T;return e[35]!==O||e[36]!==h?(T=t.jsxs("div",{className:"relative",children:[h,O]}),e[35]=O,e[36]=h,e[37]=T):T=e[37],T}function Be(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,a=Xe();let l;e[0]!==n||e[1]!==i?(l=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=l):l=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==a?(d=async()=>{await a.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=a,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==l||e[10]!==d||e[11]!==f?(p={mutationFn:l,onSuccess:d,onError:f},e[9]=l,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=Le(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const mn=Ae({accountName:me().min(1,"Account name is required"),appKey:me().optional(),appToken:me().optional()});function fn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=De(mn),e[0]=a):a=e[0];const l=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==l||e[2]!==d||e[3]!==f?(p={resolver:a,defaultValues:{accountName:l,appKey:d,appToken:f}},e[1]=l,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Me(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=Be(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Account Name"}),t.jsx(he,{children:t.jsx(Ke,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(xe,{})]})},e[27]=h,e[28]=_):_=e[28];let k;e[29]!==u.control||e[30]!==_?(k=t.jsx(fe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=k):k=e[31];let O;e[32]!==h?(O=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Key (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(xe,{})]})},e[32]=h,e[33]=O):O=e[33];let T;e[34]!==u.control||e[35]!==O?(T=t.jsx(fe,{control:u.control,name:"appKey",render:O}),e[34]=u.control,e[35]=O,e[36]=T):T=e[36];let K;e[37]!==h?(K=z=>{const{field:S}=z;return t.jsxs(pe,{children:[t.jsx(ge,{children:"App Token (optional)"}),t.jsx(he,{children:t.jsx(Ye,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(xe,{})]})},e[37]=h,e[38]=K):K=e[38];let U;e[39]!==u.control||e[40]!==K?(U=t.jsx(fe,{control:u.control,name:"appToken",render:K}),e[39]=u.control,e[40]=K,e[41]=U):U=e[41];let w;e[42]!==u||e[43]!==k||e[44]!==T||e[45]!==U?(w=t.jsxs(Ve,{...u,children:[k,T,U]}),e[42]=u,e[43]=k,e[44]=T,e[45]=U,e[46]=w):w=e[46];let $;e[47]!==m?($=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=$):$=e[48];let P;e[49]!==h||e[50]!==c?(P=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=P):P=e[51];const F=h?"Saving...":"Save";let D;e[52]!==h||e[53]!==F?(D=t.jsx(V,{type:"submit",disabled:h,children:F}),e[52]=h,e[53]=F,e[54]=D):D=e[54];let A;e[55]!==P||e[56]!==D?(A=t.jsxs(qe,{className:"pt-4",children:[P,D]}),e[55]=P,e[56]=D,e[57]=A):A=e[57];let R;return e[58]!==N||e[59]!==w||e[60]!==$||e[61]!==A?(R=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[w,$,A]}),e[58]=N,e[59]=w,e[60]=$,e[61]=A,e[62]=R):R=e[62],R}const pn=Ae({propertyId:me().min(1,"Property is required")});function gn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:a,onIsPendingChange:l}=s;let d;e[0]!==i||e[1]!==r.id?(d=H.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=Z(S);return un(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=ue(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=De(pn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Me(j);let h;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=Be(h);let v,N;e[16]!==b||e[17]!==l?(v=()=>{l?.(b)},N=[b,l],e[16]=b,e[17]=l,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const k=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let O;e[27]!==u.data?(O=u.data||[],e[27]=u.data,e[28]=O):O=e[28];const T=O;if(T.flatMap(yn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let U;e[30]!==b||e[31]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Google Analytics Property"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a property"})}),t.jsx(ct,{children:T.map(hn)})]})}),t.jsx(xe,{})]})},e[30]=b,e[31]=T,e[32]=U):U=e[32];let w;e[33]!==y.control||e[34]!==U?(w=t.jsx(fe,{control:y.control,name:"propertyId",render:U}),e[33]=y.control,e[34]=U,e[35]=w):w=e[35];let $;e[36]!==y||e[37]!==w?($=t.jsx(Ve,{...y,children:w}),e[36]=y,e[37]=w,e[38]=$):$=e[38];let P;e[39]!==C?(P=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=P):P=e[40];let F;e[41]!==b||e[42]!==a?(F=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:b,children:"Cancel"}),e[41]=b,e[42]=a,e[43]=F):F=e[43];const D=b?"Saving...":"Save";let A;e[44]!==b||e[45]!==D?(A=t.jsx(V,{type:"submit",disabled:b,children:D}),e[44]=b,e[45]=D,e[46]=A):A=e[46];let R;e[47]!==F||e[48]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[47]=F,e[48]=A,e[49]=R):R=e[49];let z;return e[50]!==k||e[51]!==$||e[52]!==P||e[53]!==R?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[$,P,R]}),e[50]=k,e[51]=$,e[52]=P,e[53]=R,e[54]=z):z=e[54],z}function hn(s){return t.jsx("div",{children:s.options.map(xn)},s.account)}function xn(s){return t.jsx(dt,{value:s.value,children:s.label},s.value)}function yn(s){return s.options}const jn=Ae({siteUrl:me().min(1,"Site is required")});function bn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:a,onDone:l,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=H.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return Z(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=ue(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=De(jn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Me(y);let m;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=Be(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let k;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],k=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=k}else k=e[22];const O=k;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let T,K;if(e[27]!==n.configurationState?.siteUrl||e[28]!==a||e[29]!==h||e[30]!==x.data){K=Symbol.for("react.early_return_sentinel");e:{if(T=x.data||[],T.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],K=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=dn(a,T);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=a,e[29]=h,e[30]=x.data,e[31]=T,e[32]=K}else T=e[31],K=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let U;e[34]!==C||e[35]!==T?(U=S=>{const{field:L}=S;return t.jsxs(pe,{children:[t.jsx(ge,{children:"Verified Site"}),t.jsx(he,{children:t.jsxs(rt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(lt,{children:t.jsx(at,{placeholder:"Select a site"})}),t.jsx(ct,{children:T.map(Cn)})]})}),t.jsx(xe,{})]})},e[34]=C,e[35]=T,e[36]=U):U=e[36];let w;e[37]!==h.control||e[38]!==U?(w=t.jsx(fe,{control:h.control,name:"siteUrl",render:U}),e[37]=h.control,e[38]=U,e[39]=w):w=e[39];let $;e[40]!==h||e[41]!==w?($=t.jsx(Ve,{...h,children:w}),e[40]=h,e[41]=w,e[42]=$):$=e[42];let P;e[43]!==v?(P=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=P):P=e[44];let F;e[45]!==C||e[46]!==l?(F=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:C,children:"Cancel"}),e[45]=C,e[46]=l,e[47]=F):F=e[47];const D=C?"Saving...":"Save";let A;e[48]!==C||e[49]!==D?(A=t.jsx(V,{type:"submit",disabled:C,children:D}),e[48]=C,e[49]=D,e[50]=A):A=e[50];let R;e[51]!==F||e[52]!==A?(R=t.jsxs(qe,{className:"pt-4",children:[F,A]}),e[51]=F,e[52]=A,e[53]=R):R=e[53];let z;return e[54]!==O||e[55]!==$||e[56]!==P||e[57]!==R?(z=t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[$,P,R]}),e[54]=O,e[55]=$,e[56]=P,e[57]=R,e[58]=z):z=e[58],z}function Cn(s){return t.jsx(dt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const Sn={vtex:fn,"google-analytics":gn,"google-search-console":bn};function vn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function ze(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ot,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function Nn(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:a,siteUrl:l}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=on(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx(kt,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ot,{size:16})," Connected"]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(Je,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(ze,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(ze,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(_n),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==a||e[37]!==l?(v=n.satisfied&&d&&t.jsx(Tn,{card:n,org:r,selfClient:a,connectionId:d,savedConfigEntries:p,contextSiteUrl:l}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=a,e[37]=l,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function _n(s){return t.jsx(ze,{children:s},s)}function wn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function In(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Tn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:a}=s;let l;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(l={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=l):l=e[3];const d=_e(l),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=Sn[n.bindingType];let j;e[4]!==u?(j=T=>{!T&&u||p(T)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(zt,{children:[t.jsx(Lt,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(Dt,{size:14})})}),t.jsx(At,{children:"Edit configuration"})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(En)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let k;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==a||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(k=g?t.jsx(Ot,{open:f,onOpenChange:y,children:t.jsxs(Rt,{className:"sm:max-w-lg",children:[t.jsxs(Ut,{children:[t.jsxs($t,{children:["Configure ",n.title]}),t.jsx(Pt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:a,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(In,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=a,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=k):k=e[32];let O;return e[33]!==k||e[34]!==_?(O=t.jsxs(t.Fragment,{children:[_,k]}),e[33]=k,e[34]=_,e[35]=O):O=e[35],O}function En(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:wn(s.key,s.value)})]},s.key)}const Ge={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function kn(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=_e(c);let a;e[4]!==o||e[5]!==i.id?(a=H.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=a):a=e[6];let l;e[7]!==r?(l=async()=>{const I=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(I)},e[7]=r,e[8]=l):l=e[8];let d;e[9]!==a||e[10]!==l?(d={queryKey:a,queryFn:l},e[9]=a,e[10]=l,e[11]=d):d=e[11];const f=ue(d),p=Jt(f.data?.stateSchema??{properties:{}}),u=p.map(An),x=p.map(Ln).filter(zn),g=p.filter(Pn).map($n),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=H.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const I=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return Z(I)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=ue(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=I=>C?.[I.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Un),_=ue({queryKey:H.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const I=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&I.push({field:["id"],operator:"in",value:N});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:I},limit:1e3}});return Z(B)}}),k=_.data?.items??[],O=new Set(N),T=k.filter(I=>O.has(I.id)),K=T.filter(Rn);let U;e[23]!==i.id||e[24]!==i.slug?(U=I=>({queryKey:H.commerceDiscoveryCompanionOAuthStatus(i.id,I.id),queryFn:async()=>{const B=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(I.id)}/oauth-token/status`,{credentials:"include"});return B.ok?{hasToken:(await B.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=U):U=e[25];const w=Ht({queries:K.map(U)});let $;e[26]!==w?($=(I,B)=>[I.id,w[B]?.data?.hasToken===!0],e[26]=w,e[27]=$):$=e[27];const P=new Map(K.map($)),F={};for(const I of T)F[I.id]=!I.oauth_config||!!I.connection_token||P.get(I.id)===!0;const D=ue({queryKey:H.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const I=en(x,g),B=await Ft(nt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...I?{where:I}:{},limit:1e3});return Z(B)}}),A={},R={};for(const I of D.data?.items??[])A[I.id]=I,I.server?.name&&(R[I.server.name]=I);const z=cn({requirements:p,itemsById:A,itemsByName:R,connections:k,connectionReadiness:F,configurationState:C,curated:Ge});let S;e[28]!==b||e[29]!==_||e[30]!==w||e[31]!==D||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||D.isPending||w.some(On)),e[28]=b,e[29]=_,e[30]=w,e[31]=D,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,ee=f.error??b.error??_.error??D.error??null;let Y;return e[35]!==z||e[36]!==ee||e[37]!==L?(Y={cards:z,isLoading:L,error:ee},e[35]=z,e[36]=ee,e[37]=L,e[38]=Y):Y=e[38],Y}function On(s){return s.isPending}function Rn(s){return s.oauth_config&&!s.connection_token}function Un(s){return typeof s=="string"&&s.length>0}function $n(s){return s.bindingType}function Pn(s){return!Ge[s.bindingType]}function zn(s){return!!s}function Ln(s){return Ge[s.bindingType]?.registryAppId}function An(s){return s.bindingType}function Dn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=Xe(),[c,r]=q.useState(null),[a,l]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return Z(x)};async function f(p){r(p.fieldKey),l(null);try{let u=p.candidateConnectionId;if(!u){const m=Kt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){l(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=Z(N).item.id}const x=u,g=await Qt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){l(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=Z(j).item?.configuration_state??null,h=tn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:H.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:H.commerceDiscoveryCompanionConnections(e.id)})}catch(u){l(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:a}}const Mn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Fn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Kn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(qn)}),s[0]=e):e=s[0],e}function qn(s){return t.jsx(vn,{},s)}function Vn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Fe.useSession(),r=c?.user?.id??"";let a;e[0]!==n.id||e[1]!==n.slug?(a={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=a):a=e[2];const l=_e(a);let d;e[3]!==i||e[4]!==n||e[5]!==l?(d={selfClient:l,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=l,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=kn(d);let x;e[7]!==i||e[8]!==n||e[9]!==l||e[10]!==r?(x={selfClient:l,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=l,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=Dn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Fn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==l||e[22]!==o?(b=t.jsxs("div",{className:Mn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Kn,{}):t.jsx($e,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(Nn,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:l,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=l,e[22]=o,e[23]=b):b=e[23],b}const He="https://decocms-tanstack.deco-cx.workers.dev/agendar",Bn="Rather have us walk you through it?",Gn="Book a 20-minute call and we'll run the diagnostic with you, live.";function ft({siteUrl:s,email:e}){const n=new URL(He);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Hn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?He:n,r=i===void 0?"lg":i;let a;e[0]!==o?(a=X("w-full",o),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ut,{size:16}),e[2]=l):l=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",l]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==a||e[7]!==d?(f=t.jsx(V,{asChild:!0,variant:"outline",size:r,className:a,children:d}),e[5]=r,e[6]=a,e[7]=d,e[8]=f):f=e[8],f}function Ze(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Qn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ze,{children:t.jsx(mt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(Ze,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function pt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Bn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Gn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Hn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Wn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?He:i;let c;e[0]!==n?(c=X("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(mt,{size:20})}),e[2]=r):r=e[2];let a,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=t.jsx(ut,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=a,e[4]=l):(a=e[3],l=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,a,l]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function gt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let a;e[3]!==i?(a=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=a):a=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,a,l]}),e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ht(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,a=i===void 0?14:i;let l;e[0]!==o?(l=X("inline-flex items-center gap-2",o),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==c?(d=X("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==a||e[5]!==d?(f=t.jsx(Je,{size:a,className:d}),e[4]=a,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=X("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==l||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:l,children:[f,u]}),e[12]=l,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const Yn={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function xt(s){return Yn[s]}function yt(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Q,{children:t.jsx(we,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function we(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=xt(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(ht,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function Zn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ht,{label:xt("button")}),s[0]=e):e=s[0],e}function xi(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Jn,{}),s[0]=e):e=s[0],e}const jt=q.createContext(null),bt=()=>q.useContext(jt);function Xn(s){if(!s)return null;const e=Ue(s);return e.ok?new URL(e.value).hostname:null}function Jn(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=Ct(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=Xn(o),s[1]=o,s[2]=c):c=s[2];const r=c;let a;s[3]!==i||s[4]!==o?(a=t.jsx(es,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=a):a=s[5];let l;return s[6]!==r||s[7]!==a?(l=t.jsx(jt.Provider,{value:r,children:a}),s[6]=r,s[7]=a,s[8]=l):l=s[8],l}function es(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Fe.useSession(),r=bt();if(c){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(yt,{variant:"route"}),e[0]=l):l=e[0],l}if(!o){const l=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(gt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Q,{children:t.jsx(wt,{callbackUrl:l,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let a;return e[5]!==n||e[6]!==i?(a=t.jsx(ts,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=a):a=e[7],a}function ts(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=et(),c=St(),[r,a]=q.useState(null),[l,d]=q.useState(null),f=c.data?.map(ss)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:ns,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=Le(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(yt,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(ve,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(Se,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(ve,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(Se,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(Se,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>a(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!l){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(is,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=l;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(Se,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(J,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{tt(),a({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(We,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(ve,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function ns(){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&&tt(),e}function ss(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function is(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(ve,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{variant:"workspace"}),e[4]=a):a=e[4];let l;return e[5]!==r?(l=t.jsx(Q,{children:t.jsx("div",{ref:r,children:a})}),e[5]=r,e[6]=l):l=e[6],l}function J(s){const e=E.c(8),{title:n,description:i}=s,o=bt();let c;e[0]!==o?(c=o?t.jsx(gt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==c||e[6]!==r?(a=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=a):a=e[7],a}function ve(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(J,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==o||e[4]!==c?(a=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=a):a=e[5];let l;return e[6]!==r||e[7]!==a?(l=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[r,a]})}),e[6]=r,e[7]=a,e[8]=l):l=e[8],l}function os(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Oe(s){const e=s;if(e.isError)throw new Error(os(e));return e.structuredContent??s}function Se(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Fe.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=ft({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const a=r;let l;e[3]!==a?(l=t.jsx(pt,{href:a}),e[3]=a,e[4]=l):l=e[4];const d=l;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(vt,{children:p=>{const{reset:u}=p;return t.jsx(Nt,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Q,{visual:d,children:t.jsx(rs,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Q,{visual:d,children:t.jsx(we,{variant:"connect"})}),children:t.jsx(ls,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function rs(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(J,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let a;e[2]!==i?(a=t.jsx(Ne,{message:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsxs("div",{className:"grid gap-10",children:[r,a,l]}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function ls(s){const e=E.c(100),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=et();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:st,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const a=_e(r),[l,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=nt.COMMERCE_DISCOVERY(n.id),y=Tt(n.id),h=H.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==a?(m=async()=>{const M=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Oe(M)},e[3]=j,e[4]=a,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Qe(b),v=H.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==a||e[10]!==y?(N=async()=>{const M=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Oe(M)},e[9]=a,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const k=Qe(_);let O;e[15]!==a?(O=async M=>{const W=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:M}});return Oe(W)},e[15]=a,e[16]=O):O=e[16];let T;e[17]!==C||e[18]!==k?(T=M=>{p(M),x(null),C.refetch(),k.refetch()},e[17]=C,e[18]=k,e[19]=T):T=e[19];let K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=M=>{x(M instanceof Error?M.message:"Commerce Discovery setup failed.")},e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==T?(U={mutationFn:O,retry:!1,onSuccess:T,onError:K},e[21]=O,e[22]=T,e[23]=U):U=e[23];const w=Le(U),$=!!C.data.item&&!!k.data.item,P=i??l;let F;e[24]!==P||e[25]!==o?(F=ft({siteUrl:P,email:o}),e[24]=P,e[25]=o,e[26]=F):F=e[26];const D=F;let A;e[27]!==D?(A=t.jsx(pt,{href:D}),e[27]=D,e[28]=A):A=e[28];const R=A;let z;e[29]!==w?(z=M=>{const W=Ue(M);if(!W.ok){x(W.error);return}x(null),w.mutate(W.value)},e[29]=w,e[30]=z):z=e[30];const S=z;let L;e[31]!==i||e[32]!==S||e[33]!==$?(L=M=>{!M||g.current||$||!i||(g.current=!0,S(i))},e[31]=i,e[32]=S,e[33]=$,e[34]=L):L=e[34];const ee=L;let Y;e[35]!==S||e[36]!==l?(Y=M=>{M.preventDefault(),S(l)},e[35]=S,e[36]=l,e[37]=Y):Y=e[37];const I=Y;let B;e[38]!==j||e[39]!==f?.reportApp||e[40]!==y?(B=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Et},e[38]=j,e[39]=f?.reportApp,e[40]=y,e[41]=B):B=e[41];const G=B;let ye;e[42]!==c||e[43]!==n.slug||e[44]!==G.connectionId||e[45]!==G.toolName||e[46]!==G.virtualMcpId?(ye=()=>{localStorage.setItem(_t.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:G.virtualMcpId,main:It(G.connectionId,G.toolName),chat:0}})},e[42]=c,e[43]=n.slug,e[44]=G.connectionId,e[45]=G.toolName,e[46]=G.virtualMcpId,e[47]=ye):ye=e[47];const Ie=ye;if($){let M;return e[48]!==D||e[49]!==R||e[50]!==P||e[51]!==Ie||e[52]!==n||e[53]!==G?(M=t.jsx(as,{org:n,reportApp:G,onOpenReport:Ie,meetingUrl:D,meetingVisual:R,siteUrl:P}),e[48]=D,e[49]=R,e[50]=P,e[51]=Ie,e[52]=n,e[53]=G,e[54]=M):M=e[54],M}if(i){let M;e[55]!==i?(M=Ue(i),e[55]=i,e[56]=M):M=e[56];const W=M;if(!W.ok){const ke=`Commerce setup will continue for ${n.name}.`;let le;e[57]!==ke?(le=t.jsx(J,{title:"Commerce diagnostics",description:ke}),e[57]=ke,e[58]=le):le=e[58];let ae;e[59]!==W.error?(ae=t.jsx(Ne,{message:W.error}),e[59]=W.error,e[60]=ae):ae=e[60];let ce;e[61]!==I||e[62]!==u||e[63]!==w.isPending||e[64]!==l?(ce=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[61]=I,e[62]=u,e[63]=w.isPending,e[64]=l,e[65]=ce):ce=e[65];let de;e[66]!==le||e[67]!==ae||e[68]!==ce?(de=t.jsxs("div",{className:"grid gap-10",children:[le,ae,ce]}),e[66]=le,e[67]=ae,e[68]=ce,e[69]=de):de=e[69];let Ce;return e[70]!==R||e[71]!==de?(Ce=t.jsx(Q,{visual:R,children:de}),e[70]=R,e[71]=de,e[72]=Ce):Ce=e[72],Ce}const Ee=`Commerce Discovery is being prepared for ${W.value}.`;let ie;e[73]!==Ee?(ie=t.jsx(J,{title:"Commerce diagnostics",description:Ee}),e[73]=Ee,e[74]=ie):ie=e[74];let oe;e[75]!==I||e[76]!==u||e[77]!==w||e[78]!==l?(oe=u?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{message:u}),t.jsx(Re,{siteUrl:l,error:null,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I})]}):t.jsx(we,{variant:"setup"}),e[75]=I,e[76]=u,e[77]=w,e[78]=l,e[79]=oe):oe=e[79];let re;e[80]!==ie||e[81]!==oe||e[82]!==ee?(re=t.jsxs("div",{ref:ee,className:"grid gap-10",children:[ie,oe]}),e[80]=ie,e[81]=oe,e[82]=ee,e[83]=re):re=e[83];let be;return e[84]!==R||e[85]!==re?(be=t.jsx(Q,{visual:R,children:re}),e[84]=R,e[85]=re,e[86]=be):be=e[86],be}const Te=`Commerce setup will continue for ${n.name}.`;let te;e[87]!==Te?(te=t.jsx(J,{title:"Commerce diagnostics",description:Te}),e[87]=Te,e[88]=te):te=e[88];let ne;e[89]!==I||e[90]!==u||e[91]!==w.isPending||e[92]!==l?(ne=t.jsx(Re,{siteUrl:l,error:u,isSubmitting:w.isPending,onSiteUrlChange:d,onSubmit:I}),e[89]=I,e[90]=u,e[91]=w.isPending,e[92]=l,e[93]=ne):ne=e[93];let se;e[94]!==te||e[95]!==ne?(se=t.jsxs("div",{className:"grid gap-10",children:[te,ne]}),e[94]=te,e[95]=ne,e[96]=se):se=e[96];let je;return e[97]!==R||e[98]!==se?(je=t.jsx(Q,{visual:R,children:se}),e[97]=R,e[98]=se,e[99]=je):je=e[99],je}function Re(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=a):a=e[0];let l;e[1]!==c?(l=y=>c(y.target.value),e[1]=c,e[2]=l):l=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==d?(f=t.jsx(Ke,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:l,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=l,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Ne,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[a,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(Zn,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(it,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(V,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function as(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(J,{}),e[0]=l):l=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==a?(d=t.jsx(Vn,{org:n,cdConnectionId:i.connectionId,siteUrl:a}),e[1]=n,e[2]=i.connectionId,e[3]=a,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Wn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(it,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(V,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[l,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Q,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Ne(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{xi as default};
@@ -1 +1 @@
1
- import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-B37Lpv5S.js";import{D as I,a as S,b as D,d as E,e as R}from"./dialog-BbHIKIUS.js";import{S as _}from"./chat-context-bLbsqSUE.js";import{i as $}from"./ChevronUp-CIoJSXpm.js";import{a as A}from"./Eye-BcF7vo02.js";import{u as B}from"./studio-tools-QGvUs6qu.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=N(),l=B();let o;i[0]!==e.id?(o=k.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",w=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return w.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(D,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:w.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(E,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(R,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
1
+ import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-BUS-a-tW.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-lbyUpqPt.js";import{S as _}from"./chat-context-2a9Unx31.js";import{i as $}from"./ChevronUp-5yVty_-J.js";import{a as A}from"./Eye-CVnhloDi.js";import{u as B}from"./studio-tools-BO3QwsEE.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,w as $,b0 as k,K as D,l as w,j as x}from"./index-B37Lpv5S.js";import{u as K}from"./use-registry-connections-sALt7ACC.js";import{b as Q}from"./use-organization-settings-Cw-0oyZX.js";import{S as E,e as F}from"./use-mcp-client-CX47WlCL.js";import{u as H}from"./useInfiniteQuery-V0rLmF2w.js";import{i as q,f as G}from"./extract-connection-data-D9jcQvie.js";import{C as U}from"./card-DWocPikY.js";import{I as V}from"./integration-icon-DtONHt_d.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:w("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C as $,b0 as k,K as D,l as E,j as x}from"./index-BUS-a-tW.js";import{u as K}from"./use-registry-connections-Ii3j5xH_.js";import{b as Q}from"./use-organization-settings-57SGXats.js";import{S as w,e as F}from"./use-mcp-client-CLcTwBS1.js";import{u as H}from"./useInfiniteQuery-uhUmaTO5.js";import{i as q,f as G}from"./extract-connection-data-C4TpBkxN.js";import{C as U}from"./card-CZbszR9z.js";import{I as V}from"./integration-icon-D2yZ6MPG.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
@@ -0,0 +1 @@
1
+ import{o as fe,aE as Ie,b6 as Ae,s as le,aC as De,c as P,j as t,i as ge,B as V,r as q,l as je,C as J,w as $e,K as ne,b as Y,aa as ce,x as Pe,b7 as Oe,E as ze,e as Me,b8 as Ee,m as Ve,p as Ue,n as Fe,t as G,b9 as Re}from"./index-BUS-a-tW.js";import{a as Le}from"./extract-connection-data-C4TpBkxN.js";import{E as ve}from"./empty-state-BAyVSC9K.js";import{E as Be,c as He,r as We,b as Xe,d as Ge}from"./connection-form-helpers-BzU7xnbX.js";import{c as qe,S as Ke,V as Qe}from"./index-CuICTOkh.js";import{u as be,T as Je}from"./index-C0eVGhHT.js";import{u as Ye}from"./use-members-DARPXJlK.js";import{A as Ze}from"./avatar-C54BAvwV.js";import{a as Ne,b as ye,u as et}from"./use-connection-C3KlVqRc.js";import{u as _e}from"./use-mcp-client-CLcTwBS1.js";import{a as tt}from"./use-mcp-tools-DHra8uvX.js";import{a as st}from"./use-mcp-prompts-DC-bHnlV.js";import{i as nt,a as ot}from"./mcp-oauth-oXYSrL8I.js";import{I as oe}from"./integration-icon-D2yZ6MPG.js";import{s as it}from"./Plus-DiPCnPyI.js";import{z as at,C as rt,ag as lt,a5 as ct}from"./agent-icon-Dh6cDydc.js";import{a as Ce,s as dt}from"./Settings02-xJ3tiWNi.js";import{s as ae}from"./Trash01-DmRbdJUk.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-BbFKIkah.js";import{F as L,b as B,c as H,d as E,e as W,f as ft,a as gt}from"./form-BGbfy77_.js";import{I as X}from"./input-D8TXMXM-.js";import{u as jt,D as vt}from"./use-delete-connection-Ba_GRKCM.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-BuPr-4zl.js";import{u as kt}from"./studio-tools-BO3QwsEE.js";import{u as Tt}from"./use-virtual-mcp-DgKfTExI.js";import{i as Se}from"./ChevronRight-CFrkN22M.js";import{a as we}from"./Users03-fR0V8I72.js";import{T as ee,a as It,b as te,c as At}from"./tabs-CRPtX_rJ.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-DuHMAFt7.js";import{c as $t}from"./Tool01-D2a8I_Gf.js";import{g as re,M as Pt}from"./types-D8C9oPp4.js";import{C as Ot}from"./collection-search-DBIvyJJc.js";import{C as zt}from"./card-CZbszR9z.js";import{B as Mt}from"./badge-WRzJoL2O.js";import{D as Et,a as Vt,b as Ut,c as de}from"./dropdown-menu-DF3B7I1K.js";import{S as me,a as ue,b as xe,c as pe,d as R}from"./select-BumbnE5Z.js";import{i as Ft}from"./CheckCircle-DNGMJpxK.js";import{t as Rt}from"./ChevronDown-CIJ7-0w6.js";import{n as Lt}from"./XCircle-CdCz4npr.js";import{s as se}from"./Star01-BO7uFQpG.js";import{s as Bt}from"./XClose-vwNqWD2m.js";import"./index-waTLikGH.js";import"./sidebar-DaurSYcm.js";import"./LayoutLeft-DeMAAMUQ.js";import"./use-mobile-DFs3QJqY.js";import"./tooltip-xmkm89yV.js";import"./ZoomOut-Bpyue_Zw.js";import"./Key01-NlklfK2W.js";import"./auth-ylAHlhew.js";import"./use-registry-connections-Ii3j5xH_.js";import"./use-organization-settings-57SGXats.js";import"./index-Dg5jx7eC.js";import"./index-n4Vo7V4h.js";import"./popover-D2Q2Eswn.js";import"./ChevronUp-5yVty_-J.js";import"./SearchMd-CKZEESAy.js";import"./use-create-virtual-mcp-CTi94rag.js";import"./use-navigate-to-agent-rF0GaXHe.js";import"./Eye-CVnhloDi.js";import"./use-org-auth-client-C7qnan75.js";import"./User01-BzP8oKZ3.js";import"./use-collections-FvPggnCf.js";import"./AlertCircle-BFW82Glo.js";import"./SwitchHorizontal01-Bw76z7hc.js";import"./ArrowUpRight-B8NHPBEV.js";import"./ChevronLeft-DwrsIjn7.js";import"./DotsVertical-B_6X1vi7.js";import"./Stars02-CjJwnXFf.js";import"./Globe01-CThKgW6h.js";import"./FilterLines-aCF-EO8Z.js";import"./Globe04-BM8I7PlJ.js";import"./HardDrive-CnFxYfXA.js";import"./LinkExternal01-BQAshidh.js";import"./Monitor01-Dvufl23t.js";import"./Sun-O-ShYNtI.js";import"./Palette-BpmN1_H8.js";import"./Play-BLi-TNw8.js";import"./Shield01-CJTqMoEC.js";import"./Stars01-BXxzvxO4.js";import"./Upload01-Ccj_plFg.js";import"./Users01-CdAaoMtW.js";import"./X-BAIghubv.js";import"./Zap-BJK90vlv.js";import"./label-CFlYbKnz.js";import"./alert-dialog-szhg9nbv.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{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 v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==a?(S=()=>a(n),e[24]=n,e[25]=a,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let h;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(h=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Gt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=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]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ce,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let f;e[8]!==x||e[9]!==d?(f=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=f):f=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Gt,{instance:N,onConfigure:a}),children:t.jsx(Xt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(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 Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],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:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.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:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.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 ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=q.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,f]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const S=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,placeholder:"Search apps...",onKeyDown:C}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),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:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>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:()=>b(m.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($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let h;e[29]!==C?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=h):h=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==h||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,h,w,O,M]})}),e[44]=k,e[45]=h,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(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(lt,{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 ds(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(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:Te(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 ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=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]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=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:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{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(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.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:()=>d.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:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",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 ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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"&&Re(s.connection_headers)){const a=s.connection_headers,r=We(a.envVars);if(ps(a)){const i=hs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=fs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}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 gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ge(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=f??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=qe(k,Wt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){G.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),G.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();G.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),G.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),G.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:f?.title??s.title}),t.jsx(ht,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...h,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(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.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(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),G.success(D==="active"?"Connection enabled":"Connection disabled")}catch{G.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);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:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Ss):(x?.tools??[]).map(Cs);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const C=k;let h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:C,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function ao(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{ao as default};
@@ -1 +1 @@
1
- import{z as R,aE as z,b6 as A,C as a,aC as S,aD as I,c as L,j as u,B as j}from"./index-B37Lpv5S.js";import{I as H}from"./input-D3OR9wlV.js";import{s as W}from"./Plus-pFzKRSyH.js";import{s as q}from"./Trash01-B2-9vQgJ.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:I(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:S(K).optional(),configuration_scopes:S(a()).nullable().optional(),configuration_state:z(a(),A()).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"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==N?(f=u.jsxs(j,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[T,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function C(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=C(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===C("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 J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=C(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>C(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{o as R,aE as A,b6 as I,s as a,aC as S,aD as z,c as L,j as u,B as j}from"./index-BUS-a-tW.js";import{I as H}from"./input-D8TXMXM-.js";import{s as W}from"./Plus-DiPCnPyI.js";import{s as q}from"./Trash01-DmRbdJUk.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:S(K).optional(),configuration_scopes:S(a()).nullable().optional(),configuration_state:A(a(),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"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const C=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==C?(f=u.jsxs(j,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[T,"Add Environment Variable"]}),e[26]=C,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("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 J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};