decocms 3.99.3 → 3.100.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 (239) hide show
  1. package/dist/client/assets/{AlertCircle-Bgopcarv.js → AlertCircle-qsmFLzIS.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-7XR-z7Ge.js → ArrowUpRight-yJehGCq_.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DsdDhP4L.js → CheckCircle-B6MW1yw_.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CpzTl0cf.js → ChevronDown-C6GKFdlz.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BuOnLJw9.js → ChevronLeft-B_g3Odoj.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DqDeYsel.js → ChevronRight-_T91Ki1i.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cr2g1GDa.js → ChevronUp-C73sdCjg.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BGprjE03.js → DotsVertical-BOTJmIm_.js} +1 -1
  9. package/dist/client/assets/{Eye-B9uHZVsM.js → Eye-CmIsbgje.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DgCFEQWk.js → FilterLines-Br0k3Gt9.js} +1 -1
  11. package/dist/client/assets/{Globe01-H40eMg8D.js → Globe01-jb99gJfY.js} +1 -1
  12. package/dist/client/assets/{Globe04-BNaAcUBp.js → Globe04-BoJpZpky.js} +1 -1
  13. package/dist/client/assets/{HardDrive-l0WQMFU9.js → HardDrive-tK8cadSs.js} +1 -1
  14. package/dist/client/assets/{Key01-BDd1iQS4.js → Key01--rf2r0q7.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DQOl0C9j.js → LayoutLeft-Dpq1l3Cs.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BAME6PCB.js → LinkExternal01-DgKre-XN.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CaJkUXyc.js → Monitor01-DLOF_NPZ.js} +1 -1
  18. package/dist/client/assets/{Palette-C1u1Sxuh.js → Palette-B13aA9KG.js} +1 -1
  19. package/dist/client/assets/{Play-DSjj50Z1.js → Play-CAoWwsoA.js} +1 -1
  20. package/dist/client/assets/{Plus-rHk0VScG.js → Plus-DaRhyqSH.js} +1 -1
  21. package/dist/client/assets/SearchLg-C7PlcyS-.js +1 -0
  22. package/dist/client/assets/{SearchMd-Bc8RVvtx.js → SearchMd-TIrNRuOw.js} +1 -1
  23. package/dist/client/assets/{Settings02-bfgJ4jKJ.js → Settings02-B1ys_QsX.js} +1 -1
  24. package/dist/client/assets/{Shield01-C0erkp7L.js → Shield01-cnNeKMKA.js} +1 -1
  25. package/dist/client/assets/{Star01-DnRxcrb2.js → Star01-DPd1XEvi.js} +1 -1
  26. package/dist/client/assets/{Stars01-DN0i_OuW.js → Stars01-CFQgPhA5.js} +1 -1
  27. package/dist/client/assets/{Stars02-DXKYKZ_y.js → Stars02-BBfjmRkO.js} +1 -1
  28. package/dist/client/assets/{Sun-BvgQbAIe.js → Sun-D1BAkaT6.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-CTCDUfta.js → SwitchHorizontal01-BPwURr_K.js} +1 -1
  30. package/dist/client/assets/{Tool01-Dvmkyh1g.js → Tool01-UFRB7Gn8.js} +1 -1
  31. package/dist/client/assets/{Trash01-BrvLbqQk.js → Trash01-2mnBLeel.js} +1 -1
  32. package/dist/client/assets/{Upload01-Cghimx9V.js → Upload01-BxxwdIAZ.js} +1 -1
  33. package/dist/client/assets/{User01-BPjc8LiD.js → User01-D61Pj0Jp.js} +1 -1
  34. package/dist/client/assets/{Users01-DKr-dGyn.js → Users01-enhuFvLY.js} +1 -1
  35. package/dist/client/assets/{Users03-CBNK0aq-.js → Users03-CsRyhHB5.js} +1 -1
  36. package/dist/client/assets/{X-BZf8Ua-f.js → X-D_jt_5zi.js} +1 -1
  37. package/dist/client/assets/{XCircle-CxfDN97v.js → XCircle-Cr_Uaxeq.js} +1 -1
  38. package/dist/client/assets/{XClose-Ca4NBXw9.js → XClose-C6a8uvfS.js} +1 -1
  39. package/dist/client/assets/{Zap-D8ndRUQT.js → Zap-CkUSEY1J.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BY_c_0SN.js → ZapSquare-CwzduoBx.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-C9_8nvys.js → ZoomOut-N-7VqfhT.js} +1 -1
  42. package/dist/client/assets/{access-gate-CCm9ALRG.js → access-gate-CKBNVhhp.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-BsBYigCm.js → add-section-modal-DCuBNkTr.js} +1 -1
  44. package/dist/client/assets/agent-icon-CDWUrKO6.js +1 -0
  45. package/dist/client/assets/agents-list-ulDX0H44.js +1 -0
  46. package/dist/client/assets/{ai-providers-P6gTuznf.js → ai-providers-DEa83FLl.js} +1 -1
  47. package/dist/client/assets/{alert-DpnpKBfm.js → alert-DXQz40c2.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CWTgvZp_.js → alert-dialog-DwrOZyIa.js} +1 -1
  49. package/dist/client/assets/app-editor-tXdvtxk6.js +1 -0
  50. package/dist/client/assets/{auth-DtR4b91D.js → auth-DnFlop4R.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BfgSkxA3.js → auth-catchall-CLwyMXPx.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DiMotG9E.js → auth-entry-DxRJaJWz.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-Bithe63j.js → auth-split-layout-CrmHdTXS.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-BYDKbSTj.js → authenticate-and-persist-oauth-7MZHsMGS.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-DmMT-Lmk.js → automation-list-row-D88Ulzbg.js} +1 -1
  56. package/dist/client/assets/{automation-runs-CglgtIyd.js → automation-runs-BJ__6yJz.js} +1 -1
  57. package/dist/client/assets/automations-DrzVSDDD.js +1 -0
  58. package/dist/client/assets/{avatar-DosbYSVo.js → avatar-C765fdJ7.js} +1 -1
  59. package/dist/client/assets/{badge-7eW-Y90w.js → badge-CgUoAb0G.js} +1 -1
  60. package/dist/client/assets/{block-document-CU1UWO2l.js → block-document-DMH0RbkS.js} +1 -1
  61. package/dist/client/assets/{brand-context-Bc4eOtey.js → brand-context-CE1MWp0U.js} +1 -1
  62. package/dist/client/assets/{buckets-C0c0s9n9.js → buckets-DoNYdWNk.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-BQe9cGJ_.js → capability-load-error-Cr5M8jid.js} +1 -1
  64. package/dist/client/assets/{card-ChgC15JC.js → card-CYYTvdp-.js} +1 -1
  65. package/dist/client/assets/category-editor-Cz0M4CjQ.js +1 -0
  66. package/dist/client/assets/{chat-context-C7e3nmPB.js → chat-context-CcIPgTva.js} +1 -1
  67. package/dist/client/assets/{checkbox-D1J6-HGS.js → checkbox-D9k8y94F.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Biv357Zc.js → cli-auth-success-BEhGmeMb.js} +1 -1
  69. package/dist/client/assets/collection-detail-DwEhzsQm.js +1 -0
  70. package/dist/client/assets/{collection-display-button-zkui4HfF.js → collection-display-button-D-VHSw0A.js} +1 -1
  71. package/dist/client/assets/{collection-search-SCB2wfQm.js → collection-search-OPVOwF6w.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CasRXW3s.js → collection-tabs-CRf8Ijmq.js} +1 -1
  73. package/dist/client/assets/{command-BP2NK5GV.js → command-gl-L1UMo.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-D-kTt4mI.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-CUoIMZ9P.js → connect-desktop-dialog-C95eK0uT.js} +1 -1
  76. package/dist/client/assets/{connection-card-Cw-v3-1B.js → connection-card-DQuoMZlF.js} +1 -1
  77. package/dist/client/assets/connection-detail-BTmjhXSR.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BE_9JHz-.js → connection-form-helpers-Bjlqqa5J.js} +1 -1
  79. package/dist/client/assets/connections-kvdl_r4C.js +1 -0
  80. package/dist/client/assets/{context-menu-Cbyc6J5M.js → context-menu-DqNcAhnr.js} +1 -1
  81. package/dist/client/assets/{decopilot-D1XiRpB_.js → decopilot-CdQeVtVh.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DsG4E7i_.js → decopilot-sse-pool-BxlWS7lz.js} +1 -1
  83. package/dist/client/assets/{dialog-DKiQlf0Y.js → dialog-Hh5ovGLY.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DZg105GS.js → domain-settings-D0sFUhGm.js} +1 -1
  85. package/dist/client/assets/{drawer-UishvVn_.js → drawer-SgGGijSm.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-B_TYOovI.js → dropdown-menu-CVNL6sbF.js} +1 -1
  87. package/dist/client/assets/{empty-state-BVh7wBPS.js → empty-state-C5ufqcxL.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-C9MdxGy0.js → extract-connection-data-Dl7BC58q.js} +1 -1
  89. package/dist/client/assets/file-explorer-DBztAiIo.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DouhlgA1.js → file-type-icon-b6CTHv4I.js} +1 -1
  91. package/dist/client/assets/{files-pYWmrODj.js → files-vqgO8Hmh.js} +1 -1
  92. package/dist/client/assets/{form-B4g755Hl.js → form-vkZSNPAt.js} +1 -1
  93. package/dist/client/assets/{general-5Yc9vnsv.js → general-VCh3bTjA.js} +1 -1
  94. package/dist/client/assets/github-repo-picker-DjgoP8zv.js +1 -0
  95. package/dist/client/assets/{hooks-DWc2KmvK.js → hooks-Cm8G1vlN.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-Bih2Fm5A.js → import-from-deco-dialog-lvJBG1l4.js} +1 -1
  97. package/dist/client/assets/{index-BSPCA2yy.js → index-5EogW27n.js} +1 -1
  98. package/dist/client/assets/{index-BgnTiSnU.js → index-BA1nWkqk.js} +1 -1
  99. package/dist/client/assets/{index-tHbNbVHJ.js → index-BEjmlKPl.js} +4 -4
  100. package/dist/client/assets/index-BQrms0i2.js +1 -0
  101. package/dist/client/assets/index-BgeHuUkH.js +169 -0
  102. package/dist/client/assets/{index-GbBrtIUx.js → index-C5C-UKU4.js} +1 -1
  103. package/dist/client/assets/{index-Blw_ez7B.js → index-CYNIQ2LP.js} +1 -1
  104. package/dist/client/assets/{index-DJGRW9ro.js → index-DMwgNM3s.js} +1 -1
  105. package/dist/client/assets/{index-DZqx_Cnp.js → index-DVWXva_V.js} +1 -1
  106. package/dist/client/assets/index-DcwF1_eH.js +1 -0
  107. package/dist/client/assets/{index-V36Mlak_.js → index-Dg4__lD-.js} +2 -2
  108. package/dist/client/assets/{index-CQ5sDlCR.js → index-b3uLeNQ7.js} +1 -1
  109. package/dist/client/assets/index-h9qXUa58.css +1 -0
  110. package/dist/client/assets/{index-87hVDe9f.js → index-kmrmjjsI.js} +1 -1
  111. package/dist/client/assets/{index-redirect-DwYyA5dK.js → index-redirect-BgY_k9Gz.js} +1 -1
  112. package/dist/client/assets/index-xtrjWgZh.js +503 -0
  113. package/dist/client/assets/{input-C1uF2dQ1.js → input-Csk5e2yH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-DOeD9Yy1.js → integration-icon-BubYo_JB.js} +1 -1
  115. package/dist/client/assets/{label-Bg0TZhOq.js → label-P9D2uSqZ.js} +1 -1
  116. package/dist/client/assets/{login-C4tPjUdy.js → login-Cl-Vlxwz.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DxJiJ187.js → mcp-oauth-C9EbOVQM.js} +1 -1
  118. package/dist/client/assets/{members-DwE4NR-t.js → members-TxM32jPh.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-C6tm250p.js → monaco-editor-Bk0ouh6L.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-BF3MVgko.js → monitoring-stats-row-ytgPYn-j.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-DDvAz-C3.js → oauth-callback-D6v0ajK5.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-PWS5W0qh.js → oauth-callback-ai-provider-CDDtW8tk.js} +1 -1
  123. package/dist/client/assets/{onboarding-BfXFCDPk.js → onboarding-J4ivY9wp.js} +1 -1
  124. package/dist/client/assets/{org-install-CRksScXH.js → org-install-R5bN1TE2.js} +1 -1
  125. package/dist/client/assets/{org-layout-D3Fm0DP7.js → org-layout-PPkGFokn.js} +1 -1
  126. package/dist/client/assets/{organization-choice-D0-tUZZw.js → organization-choice-CD_4VGlb.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BvkRv9HV.js → page-seo-form-B2_5Qimo.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-DDlWrFZb.js +1 -0
  129. package/dist/client/assets/{popover-eHXpDYJ1.js → popover-CXYDmYeq.js} +1 -1
  130. package/dist/client/assets/post-editor-B1H7keyM.js +1 -0
  131. package/dist/client/assets/preview-dialog-DPmt4gXJ.js +5 -0
  132. package/dist/client/assets/{primitives-CkRAfBR-.js → primitives-FsBU_d9l.js} +1 -1
  133. package/dist/client/assets/{profile-CEx7RbYh.js → profile-Bb6W32P_.js} +1 -1
  134. package/dist/client/assets/project-app-view-9qSeXqiM.js +1 -0
  135. package/dist/client/assets/record-editor-CeITAW1G.js +1 -0
  136. package/dist/client/assets/registry-BjqN-pIh.js +2 -0
  137. package/dist/client/assets/{registry-layout-BlqjOMOH.js → registry-layout-CgN5p_12.js} +1 -1
  138. package/dist/client/assets/{require-capability-BOr4zKTd.js → require-capability-BaWVSsgq.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-DCkraGAX.js → required-auth-layout-BfuMObCG.js} +1 -1
  140. package/dist/client/assets/{reset-password-BJpJyj5W.js → reset-password-DGoLN-pp.js} +1 -1
  141. package/dist/client/assets/roles-BLgs8rry.js +1 -0
  142. package/dist/client/assets/{scroll-area-IfNZ394n.js → scroll-area-DCf9FU8S.js} +1 -1
  143. package/dist/client/assets/{search-input-DWWTgewM.js → search-input-Cec8OPCx.js} +1 -1
  144. package/dist/client/assets/{secrets-BKFEeATT.js → secrets-D78lmb-N.js} +1 -1
  145. package/dist/client/assets/{sections-editor-uQUAGEex.js → sections-editor-CVFa_v55.js} +2 -2
  146. package/dist/client/assets/{select-Ufh1328y.js → select-f-UK5_IH.js} +1 -1
  147. package/dist/client/assets/{select-model-CQ-f9ftL.js → select-model-DXfyq6oG.js} +1 -1
  148. package/dist/client/assets/seo-editor-8EgzsFKu.js +1 -0
  149. package/dist/client/assets/settings-layout-D8fkj6t7.js +1 -0
  150. package/dist/client/assets/{settings-section-B4a4SAqB.js → settings-section-LAhWYbh9.js} +1 -1
  151. package/dist/client/assets/{sheet-DW12PvFQ.js → sheet-Dz5C6OGo.js} +1 -1
  152. package/dist/client/assets/{shell-controls-xlIGzcZ3.js → shell-controls-CEhcbJHE.js} +1 -1
  153. package/dist/client/assets/shell-layout-R4zDjERM.js +1 -0
  154. package/dist/client/assets/{shell-route-loading-B_CHvxTG.js → shell-route-loading-DHNvhkbM.js} +1 -1
  155. package/dist/client/assets/{sidebar-Cy5GVw74.js → sidebar-CFbvOGM6.js} +1 -1
  156. package/dist/client/assets/{skeleton-CpSca80L.js → skeleton-DLjQYeS_.js} +1 -1
  157. package/dist/client/assets/{sortable.esm-CoB59DXJ.js → sortable.esm-DHABQEKH.js} +1 -1
  158. package/dist/client/assets/{sso-DMV0Y_YX.js → sso-lZztM25h.js} +1 -1
  159. package/dist/client/assets/{store-B6JtITOy.js → store-CY1YTiO_.js} +1 -1
  160. package/dist/client/assets/store-registry-Cq3I32Lc.js +2 -0
  161. package/dist/client/assets/{studio-tools-Dd7dXWQL.js → studio-tools-E6eV6Arx.js} +1 -1
  162. package/dist/client/assets/{switch-CuKs1fR0.js → switch-CIDHMPBy.js} +1 -1
  163. package/dist/client/assets/{table-BfyoFEgz.js → table-FWIaAi69.js} +1 -1
  164. package/dist/client/assets/{tabs-C3buIvx_.js → tabs-DCWgt9U2.js} +1 -1
  165. package/dist/client/assets/{task-status-DXhUoFwL.js → task-status-CBSgsj9C.js} +1 -1
  166. package/dist/client/assets/{textarea-BiYr__3G.js → textarea-cMx1Sjw5.js} +1 -1
  167. package/dist/client/assets/{toggle-group-DFSFo_vP.js → toggle-group-DqYtGmOf.js} +1 -1
  168. package/dist/client/assets/{toolbar-DMYgRw5l.js → toolbar-C5mHjU06.js} +1 -1
  169. package/dist/client/assets/{tooltip-DW1HpudV.js → tooltip-vrtDbf-F.js} +1 -1
  170. package/dist/client/assets/{types-BpY6lzqy.js → types-Cpxi5nja.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-DS_7m4pz.js → use-ai-providers-SEySB86N.js} +1 -1
  172. package/dist/client/assets/{use-automations-BOSdn9Us.js → use-automations-BWMuOB-g.js} +1 -1
  173. package/dist/client/assets/{use-capability-CeF0OpPy.js → use-capability-BF81OxAF.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-DLGdZmyk.js → use-clock-tick-v8inwCL3.js} +1 -1
  175. package/dist/client/assets/{use-collections-GNpTGYUv.js → use-collections-DkNJNG6n.js} +1 -1
  176. package/dist/client/assets/{use-connection-B65sInnd.js → use-connection-DUBWvt9B.js} +1 -1
  177. package/dist/client/assets/{use-copy-I4sZTiJp.js → use-copy-BGZ8Ttn0.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-mtRixRQv.js → use-create-virtual-mcp-hBSqW_CF.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-Hw4VW15I.js → use-debounced-autosave-BwLKL-15.js} +1 -1
  180. package/dist/client/assets/use-debounced-value-BMcX8uyD.js +1 -0
  181. package/dist/client/assets/{use-delete-connection-DV4DJUaY.js → use-delete-connection-oIOCPNow.js} +1 -1
  182. package/dist/client/assets/{use-file-configs-DObQhPxD.js → use-file-configs-BLZ83KSj.js} +1 -1
  183. package/dist/client/assets/{use-infinite-scroll-Bk__8TxT.js → use-infinite-scroll-DUbloeNA.js} +1 -1
  184. package/dist/client/assets/{use-join-requests-D-QyHVW_.js → use-join-requests-DABqJWZf.js} +1 -1
  185. package/dist/client/assets/{use-mcp-client-0BRd9S75.js → use-mcp-client-DdEyuuWo.js} +1 -1
  186. package/dist/client/assets/{use-mcp-prompts-D4ll_rda.js → use-mcp-prompts-DqUyy9S8.js} +1 -1
  187. package/dist/client/assets/{use-mcp-tools-UJVs9gTs.js → use-mcp-tools-CgsqmnJG.js} +1 -1
  188. package/dist/client/assets/{use-members-BAva2zEC.js → use-members-BhBptkRX.js} +1 -1
  189. package/dist/client/assets/{use-mobile-BD2-gXK-.js → use-mobile-C7loFyQ0.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-CFNRRTVg.js → use-navigate-to-agent-C3I5i4Gg.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-7sV0tnvK.js → use-org-auth-client-B9guhhqA.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-CWJ7VJxn.js → use-org-sso-SRgmMZqR.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-GhUkwr8O.js → use-organization-roles-Aw74Iw_d.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-CLeV359D.js → use-organization-settings-CyhRZcil.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections-D7ZBIfwl.js → use-registry-connections-JP-nn714.js} +1 -1
  196. package/dist/client/assets/{use-secrets-_avq30K6.js → use-secrets-f-qJA1xx.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-DAUtYLJA.js → use-status-sounds-D8xk5cTm.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-DROl2yq4.js → use-view-mode-CsrgTSxk.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-CI9qouIO.js → use-virtual-mcp-CytuWVRm.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-Cm9C_gzI.js +1 -0
  201. package/dist/client/assets/useSuspenseInfiniteQuery-Dl9xywRE.js +1 -0
  202. package/dist/client/assets/{useSuspenseQueries-DuDQjlvx.js → useSuspenseQueries-CGmxp5yX.js} +1 -1
  203. package/dist/client/assets/variant-calendar-cvUhqu-8.js +1 -0
  204. package/dist/client/assets/{view-mode-toggle-Del-VZlp.js → view-mode-toggle-B0C659uf.js} +1 -1
  205. package/dist/client/index.html +2 -2
  206. package/dist/server/cli.js +439 -429
  207. package/dist/server/server.js +268 -268
  208. package/package.json +1 -1
  209. package/dist/client/assets/agent-icon-BbjKuSxW.js +0 -1
  210. package/dist/client/assets/agents-list-g0HlqLD8.js +0 -1
  211. package/dist/client/assets/app-editor-CJVdYBr2.js +0 -1
  212. package/dist/client/assets/automations-DfhbzTi8.js +0 -1
  213. package/dist/client/assets/category-editor-BWGJADot.js +0 -1
  214. package/dist/client/assets/collection-detail-B-FYgzNz.js +0 -1
  215. package/dist/client/assets/commerce-onboarding-CCTWN0Dv.js +0 -1
  216. package/dist/client/assets/connection-detail-D66t6r8n.js +0 -1
  217. package/dist/client/assets/connections-B7dKDvRD.js +0 -1
  218. package/dist/client/assets/file-explorer-Dvmu_Dcb.js +0 -2
  219. package/dist/client/assets/github-repo-picker-DDcB4OPT.js +0 -1
  220. package/dist/client/assets/index-BQjoq239.js +0 -1
  221. package/dist/client/assets/index-C0RjSTYg.js +0 -169
  222. package/dist/client/assets/index-CkflryUu.js +0 -503
  223. package/dist/client/assets/index-Cl3nu1dQ.js +0 -1
  224. package/dist/client/assets/index-NVhaWgyE.css +0 -1
  225. package/dist/client/assets/page-seo-sheet-DTF7F_WK.js +0 -1
  226. package/dist/client/assets/post-editor-DOULNreh.js +0 -1
  227. package/dist/client/assets/preview-dialog-QbgIb_4T.js +0 -5
  228. package/dist/client/assets/project-app-view-DHWSkD1u.js +0 -1
  229. package/dist/client/assets/record-editor-Dq4SLOu9.js +0 -1
  230. package/dist/client/assets/registry-fpLTXF0f.js +0 -2
  231. package/dist/client/assets/roles-C6kCiv-A.js +0 -1
  232. package/dist/client/assets/save-status-DVA4IHRx.js +0 -1
  233. package/dist/client/assets/seo-editor-BuTMaAaQ.js +0 -1
  234. package/dist/client/assets/settings-layout-DZdRUGWz.js +0 -1
  235. package/dist/client/assets/shell-layout-C09jnc4C.js +0 -1
  236. package/dist/client/assets/store-registry-BoPJCgP8.js +0 -2
  237. package/dist/client/assets/useInfiniteQuery-jWCtindg.js +0 -1
  238. package/dist/client/assets/useSuspenseInfiniteQuery-CwejNwQJ.js +0 -1
  239. package/dist/client/assets/variant-calendar-2pJ_kR62.js +0 -1
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-tHbNbVHJ.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-B_TYOovI.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-CTCDUfta.js";import{i as S}from"./ChevronUp-Cr2g1GDa.js";import{a as I,b as K,c as P,T as W}from"./tooltip-DW1HpudV.js";import{V as q}from"./view-mode-toggle-Del-VZlp.js";import{B as G}from"./badge-7eW-Y90w.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-BEjmlKPl.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-CVNL6sbF.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-BPwURr_K.js";import{i as S}from"./ChevronUp-C73sdCjg.js";import{a as I,b as K,c as P,T as W}from"./tooltip-vrtDbf-F.js";import{V as q}from"./view-mode-toggle-B0C659uf.js";import{B as G}from"./badge-CgUoAb0G.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-tHbNbVHJ.js";import{i as C}from"./SearchMd-Bc8RVvtx.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-BEjmlKPl.js";import{i as C}from"./SearchMd-TIrNRuOw.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-tHbNbVHJ.js";import{B as g}from"./badge-7eW-Y90w.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-BEjmlKPl.js";import{B as g}from"./badge-CgUoAb0G.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 +1 @@
1
- import{c as d,l as i,j as n}from"./index-tHbNbVHJ.js";import{_ as m}from"./index-CQ5sDlCR.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-DKiQlf0Y.js";import{i as y}from"./SearchMd-Bc8RVvtx.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};
1
+ import{c as d,l as i,j as n}from"./index-BEjmlKPl.js";import{_ as m}from"./index-b3uLeNQ7.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-Hh5ovGLY.js";import{i as y}from"./SearchMd-TIrNRuOw.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 k,r as D,l as Z,j as n,B as H,m as ut,d as ke,K as W,o as He,s as ue,n as Be,p as Ge,i as ft,k as pt,q as me,Q as gt,E as ht,a as Oe,u as xt,v as Ot,w as Ut,b as yt,x as At,y as vt,L as Rt}from"./index-BEjmlKPl.js";import{A as Pt}from"./auth-entry-DxRJaJWz.js";import{A as $t}from"./auth-split-layout-CrmHdTXS.js";import{O as at}from"./organization-choice-CD_4VGlb.js";import{f as Lt}from"./tab-id-BptcWVWa.js";import{I as Ue}from"./input-Csk5e2yH.js";import{u as Ae,W as bt,S as jt,g as zt,C as Dt}from"./use-mcp-client-DdEyuuWo.js";import{i as Ct}from"./XCircle-Cr_Uaxeq.js";import{I as St}from"./integration-icon-BubYo_JB.js";import{D as Qe,a as Kt,b as Mt,c as Ft,d as qt,e as Vt}from"./dialog-Hh5ovGLY.js";import{T as Ht,a as Bt,b as Gt}from"./tooltip-vrtDbf-F.js";import{i as We}from"./CheckCircle-B6MW1yw_.js";import{i as Qt}from"./ZoomOut-N-7VqfhT.js";import{g as Wt,c as Yt,e as Jt}from"./extract-connection-data-Dl7BC58q.js";import{F as fe,a as Ye,b as pe,c as Ke,d as ge,e as he}from"./form-vkZSNPAt.js";import{i as Zt}from"./ChevronUp-C73sdCjg.js";import{s as Xt,a as en}from"./Eye-CmIsbgje.js";import{i as tn}from"./Settings02-B1ys_QsX.js";import{i as nn}from"./agent-icon-CDWUrKO6.js";import{u as sn}from"./useSuspenseQueries-CGmxp5yX.js";import{a as on}from"./authenticate-and-persist-oauth-7MZHsMGS.js";import{i as Nt}from"./ArrowUpRight-yJehGCq_.js";import{s as _t}from"./User01-D61Pj0Jp.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C765fdJ7.js";import"./auth-DnFlop4R.js";import"./X-D_jt_5zi.js";import"./label-P9D2uSqZ.js";import"./AlertCircle-qsmFLzIS.js";import"./Tool01-UFRB7Gn8.js";import"./SwitchHorizontal01-BPwURr_K.js";import"./ZapSquare-CwzduoBx.js";import"./Users03-CsRyhHB5.js";import"./ChevronDown-C6GKFdlz.js";import"./ChevronLeft-B_g3Odoj.js";import"./ChevronRight-_T91Ki1i.js";import"./DotsVertical-BOTJmIm_.js";import"./Stars02-BBfjmRkO.js";import"./Globe01-jb99gJfY.js";import"./FilterLines-Br0k3Gt9.js";import"./Star01-DPd1XEvi.js";import"./Globe04-BoJpZpky.js";import"./HardDrive-tK8cadSs.js";import"./Key01--rf2r0q7.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./LinkExternal01-DgKre-XN.js";import"./Monitor01-DLOF_NPZ.js";import"./Sun-D1BAkaT6.js";import"./Palette-B13aA9KG.js";import"./Play-CAoWwsoA.js";import"./Plus-DaRhyqSH.js";import"./SearchLg-C7PlcyS-.js";import"./SearchMd-TIrNRuOw.js";import"./Shield01-cnNeKMKA.js";import"./Stars01-CFQgPhA5.js";import"./Trash01-2mnBLeel.js";import"./Upload01-BxxwdIAZ.js";import"./Users01-enhuFvLY.js";import"./XClose-C6a8uvfS.js";import"./Zap-CkUSEY1J.js";import"./mcp-oauth-C9EbOVQM.js";const rn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,an=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,ln=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,cn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=rn.test(e),s=an.test(e),o=ln.test(e);if(t&&!s&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=s?e:`https://${e}`;let r;try{r=new URL(l)}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 c=r.hostname.split(".");return c.length<2||c.some(a=>!a||!cn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Fe(i){const e=k.c(14),{children:t,className:s,wrapperClassName:o}=i,[l,r]=D.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=j=>{if(!j)return;const x=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};x(),j.addEventListener("scroll",x,{passive:!0});const g=new ResizeObserver(x);g.observe(j);for(const m of Array.from(j.children))g.observe(m);return()=>{j.removeEventListener("scroll",x),g.disconnect()}},e[0]=c):c=e[0];const a=c;let u;e[1]!==o?(u=Z("relative",o),e[1]=o,e[2]=u):u=e[2];let f;e[3]!==t||e[4]!==s?(f=n.jsx("div",{ref:a,className:s,children:t}),e[3]=t,e[4]=s,e[5]=f):f=e[5];const p=l?"opacity-0":"opacity-100";let d;e[6]!==p?(d=Z("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]=d):d=e[7];let h;e[8]!==d?(h=n.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let v;return e[10]!==u||e[11]!==f||e[12]!==h?(v=n.jsxs("div",{className:u,children:[f,h]}),e[10]=u,e[11]=f,e[12]=h,e[13]=v):v=e[13],v}function dn(i){const e=i.properties;if(!e)return[];const t=[];for(const[s,o]of Object.entries(e)){const c=o?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:s,bindingType:c})}return t}function mn(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function J(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function un(i,e,t,s){return{...i??{},[e]:{__type:t,value:s}}}function qe(i){return i==null?!1:typeof i=="string"?i.trim().length>0:typeof i=="number"||typeof i=="boolean"?!0:Array.isArray(i)?i.some(qe):typeof i=="object"?Object.entries(i).some(([e,t])=>!e.startsWith("__")&&qe(t)):!1}function fn(i){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[i]?e[i]:i.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function pn(i){return qe(i)?typeof i=="string"?i.trim():typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i):null}function gn(i){return i?Object.entries(i).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=pn(t);return s?[{key:e,label:fn(e),value:s}]:[]}):[]}function hn({autoOpenFieldKey:i,card:e}){return i===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function xn(i,e,t){const s=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return s.length===0?null:(s.sort((o,l)=>{const r=c=>c.status==="active"?0:1;return r(o)!==r(l)?r(o)-r(l):(l.updated_at??"").localeCompare(o.updated_at??"")}),s[0].id)}function yn(i){return i.server?.icons?.[0]?.src??Wt(i.server?.repository)??null}function vn(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function bn(i){const e=[],t=new Map(i.connections.map(s=>[s.id,s]));for(const s of i.requirements){const o=i.curated[s.bindingType],l=o?i.itemsById[o.registryAppId]:i.itemsByName[s.bindingType];if(!l)continue;const r=i.configurationState?.[s.fieldKey]?.value,c=r?t.get(r):void 0,a=r&&c?r:null,u=a?i.connectionReadiness?.[a]!==!1:!1,f=!!a&&u;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:l,title:vn(l,s.bindingType),icon:yn(l),headline:o?.headline??l._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||xn(i.connections,s.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:c?.configuration_state??null})}return e}function jn(i,e){if(!i)return null;const t=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}},s=t(i);for(const o of e)if(t(o.siteUrl)===s)return o.siteUrl;return null}function Cn(i){return(i?.response?.accountSummaries??[]).map(s=>({account:s.account,options:(s.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${s.displayName})`}))}))}function lt(i){const e=k.c(38);let t,s,o,l,r;e[0]!==i?({value:r,onChange:s,placeholder:o,className:t,...l}=i,e[0]=i,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[c,a]=D.useState(!1),[u,f]=D.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch($){console.error("Failed to copy text: ",$)}},e[6]=r,e[7]=p):p=e[7];const d=p;let h;e[8]!==c?(h=()=>{a(!c)},e[8]=c,e[9]=h):h=e[9];const v=h,j=c?"text":"password";let x;e[10]!==t?(x=Z("pr-20",t),e[10]=t,e[11]=x):x=e[11];let g;e[12]!==s||e[13]!==o||e[14]!==l||e[15]!==j||e[16]!==x||e[17]!==r?(g=n.jsx(Ue,{type:j,value:r,onChange:s,placeholder:o,className:x,...l}),e[12]=s,e[13]=o,e[14]=l,e[15]=j,e[16]=x,e[17]=r,e[18]=g):g=e[18];const m=c?"Hide password":"Show password";let b;e[19]!==c?(b=c?n.jsx(tn,{size:16}):n.jsx(Xt,{size:16}),e[19]=c,e[20]=b):b=e[20];let y;e[21]!==m||e[22]!==b||e[23]!==v?(y=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:v,title:m,children:b}),e[21]=m,e[22]=b,e[23]=v,e[24]=y):y=e[24];const S=!r,_=u?"Copied!":"Copy token";let N;e[25]!==u?(N=u?n.jsx(Zt,{size:16}):n.jsx(en,{size:16}),e[25]=u,e[26]=N):N=e[26];let w;e[27]!==d||e[28]!==_||e[29]!==N||e[30]!==S?(w=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:S,title:_,children:N}),e[27]=d,e[28]=_,e[29]=N,e[30]=S,e[31]=w):w=e[31];let E;e[32]!==w||e[33]!==y?(E=n.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[y,w]}),e[32]=w,e[33]=y,e[34]=E):E=e[34];let I;return e[35]!==E||e[36]!==g?(I=n.jsxs("div",{className:"relative",children:[g,E]}),e[35]=E,e[36]=g,e[37]=I):I=e[37],I}function Je(i){const e=k.c(19),{card:t,selfClient:s,org:o,onDone:l,onError:r}=i,c=ut();let a;e[0]!==t||e[1]!==s?(a=async x=>{const g={...t.configurationState??{},...x};await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:g}}})},e[0]=t,e[1]=s,e[2]=a):a=e[2];let u;e[3]!==l||e[4]!==o||e[5]!==c?(u=async()=>{await c.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),l()},e[3]=l,e[4]=o,e[5]=c,e[6]=u):u=e[6];let f;e[7]!==r?(f=x=>{r?.(x)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==u||e[11]!==f?(p={mutationFn:a,onSuccess:u,onError:f},e[9]=a,e[10]=u,e[11]=f,e[12]=p):p=e[12];const d=ke(p);let h;e[13]!==d?(h=x=>d.mutate(x),e[13]=d,e[14]=h):h=e[14];const v=h;let j;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==v?(j={save:v,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=v,e[18]=j):j=e[18],j}const Sn=He({accountName:ue().min(1,"Informe o nome da conta"),appKey:ue().optional(),appToken:ue().optional()});function Nn(i){const e=k.c(63),{card:t,selfClient:s,org:o,onDone:l,onIsPendingChange:r}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Be(Sn),e[0]=c):c=e[0];const a=t.configurationState?.accountName||"",u=t.configurationState?.appKey||"",f=t.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==u||e[3]!==f?(p={resolver:c,defaultValues:{accountName:a,appKey:u,appToken:f}},e[1]=a,e[2]=u,e[3]=f,e[4]=p):p=e[4];const d=Ge(p);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==d?(h=()=>{d.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=d,e[9]=h):h=e[9];let v;e[10]!==t.configurationState||e[11]!==d?(v=[t.configurationState,d],e[10]=t.configurationState,e[11]=d,e[12]=v):v=e[12],D.useEffect(h,v);let j;e[13]!==t||e[14]!==l||e[15]!==o||e[16]!==s?(j={card:t,selfClient:s,org:o,onDone:l},e[13]=t,e[14]=l,e[15]=o,e[16]=s,e[17]=j):j=e[17];const{save:x,isPending:g,error:m}=Je(j);let b,y;e[18]!==g||e[19]!==r?(y=()=>{r?.(g)},b=[g,r],e[18]=g,e[19]=r,e[20]=b,e[21]=y):(b=e[20],y=e[21]),D.useEffect(y,b);let S;if(e[22]!==d||e[23]!==x){let K;e[25]!==x?(K=async C=>{x(C)},e[25]=x,e[26]=K):K=e[26],S=d.handleSubmit(K),e[22]=d,e[23]=x,e[24]=S}else S=e[24];const _=S;let N;e[27]!==g?(N=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"Nome da conta"}),n.jsx(ge,{children:n.jsx(Ue,{placeholder:"Nome da sua conta VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[27]=g,e[28]=N):N=e[28];let w;e[29]!==d.control||e[30]!==N?(w=n.jsx(fe,{control:d.control,name:"accountName",render:N}),e[29]=d.control,e[30]=N,e[31]=w):w=e[31];let E;e[32]!==g?(E=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Key (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Key da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[32]=g,e[33]=E):E=e[33];let I;e[34]!==d.control||e[35]!==E?(I=n.jsx(fe,{control:d.control,name:"appKey",render:E}),e[34]=d.control,e[35]=E,e[36]=I):I=e[36];let $;e[37]!==g?($=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Token (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Token da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[37]=g,e[38]=$):$=e[38];let O;e[39]!==d.control||e[40]!==$?(O=n.jsx(fe,{control:d.control,name:"appToken",render:$}),e[39]=d.control,e[40]=$,e[41]=O):O=e[41];let T;e[42]!==d||e[43]!==w||e[44]!==I||e[45]!==O?(T=n.jsxs(Ye,{...d,children:[w,I,O]}),e[42]=d,e[43]=w,e[44]=I,e[45]=O,e[46]=T):T=e[46];let U;e[47]!==m?(U=m&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Não foi possível salvar a configuração"}),e[47]=m,e[48]=U):U=e[48];let P;e[49]!==g||e[50]!==l?(P=n.jsx(H,{type:"button",variant:"outline",onClick:l,disabled:g,children:"Cancelar"}),e[49]=g,e[50]=l,e[51]=P):P=e[51];const M=g?"Salvando...":"Salvar";let q;e[52]!==g||e[53]!==M?(q=n.jsx(H,{type:"submit",disabled:g,children:M}),e[52]=g,e[53]=M,e[54]=q):q=e[54];let z;e[55]!==P||e[56]!==q?(z=n.jsxs(Qe,{className:"pt-4",children:[P,q]}),e[55]=P,e[56]=q,e[57]=z):z=e[57];let F;return e[58]!==_||e[59]!==T||e[60]!==U||e[61]!==z?(F=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[T,U,z]}),e[58]=_,e[59]=T,e[60]=U,e[61]=z,e[62]=F):F=e[62],F}function Et(i){const e=k.c(30),{options:t,value:s,onChange:o,disabled:l,ariaLabel:r,searchPlaceholder:c}=i,a=c===void 0?"Buscar...":c,[u,f]=D.useState("");let p,d,h;if(e[0]!==t||e[1]!==u||e[2]!==s){const w=u.trim().toLowerCase();p=w?t.filter(E=>E.label.toLowerCase().includes(w)):t,d=p.map(_n),h=d.includes(s)?s:d[0]??"",e[0]=t,e[1]=u,e[2]=s,e[3]=p,e[4]=d,e[5]=h}else p=e[3],d=e[4],h=e[5];const v=h;let j;e[6]!==l||e[7]!==d||e[8]!==o?(j=function(E){if(l||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(E.key))return;E.preventDefault();const $=E.currentTarget.dataset.value,O=d.indexOf($),T=d.length;if(T===0)return;let U;E.key==="ArrowDown"||E.key==="ArrowRight"?U=(O+1)%T:E.key==="ArrowUp"||E.key==="ArrowLeft"?U=(O-1+T)%T:E.key==="Home"?U=0:U=T-1;const P=d[U];o(P),E.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(P)}"]`)?.focus()},e[6]=l,e[7]=d,e[8]=o,e[9]=j):j=e[9];const x=j;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(nn,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=g):g=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=w=>f(w.target.value),e[11]=m):m=e[11];const b=`Buscar ${r}`;let y;e[12]!==l||e[13]!==u||e[14]!==a||e[15]!==b?(y=n.jsxs("div",{className:"relative",children:[g,n.jsx(Ue,{type:"text",value:u,onChange:m,disabled:l,placeholder:a,"aria-label":b,className:"h-8 pl-8"})]}),e[12]=l,e[13]=u,e[14]=a,e[15]=b,e[16]=y):y=e[16];let S;e[17]!==l||e[18]!==p||e[19]!==x||e[20]!==o||e[21]!==v||e[22]!==s?(S=p.length===0?n.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):p.map(w=>{const E=w.value===s;return n.jsxs("button",{type:"button",role:"radio","aria-checked":E,disabled:l,"data-value":w.value,tabIndex:w.value===v?0:-1,onClick:()=>o(w.value),onKeyDown:x,className:Z("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",E?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[n.jsx("span",{className:"truncate",children:w.label}),E?n.jsx(We,{size:16,className:"shrink-0 text-primary"}):null]},w.value)}),e[17]=l,e[18]=p,e[19]=x,e[20]=o,e[21]=v,e[22]=s,e[23]=S):S=e[23];let _;e[24]!==r||e[25]!==S?(_=n.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:S}),e[24]=r,e[25]=S,e[26]=_):_=e[26];let N;return e[27]!==y||e[28]!==_?(N=n.jsxs("div",{className:"space-y-2",children:[y,_]}),e[27]=y,e[28]=_,e[29]=N):N=e[29],N}function _n(i){return i.value}function Ze(i){const e=k.c(16),{label:t,iconSize:s,className:o,iconClassName:l,labelClassName:r}=i,c=s===void 0?14:s;let a;e[0]!==o?(a=Z("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let u;e[2]!==l?(u=Z("shrink-0 animate-spin",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==c||e[5]!==u?(f=n.jsx(ft,{size:c,className:u}),e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==r?(p=Z("text-sm",r),e[7]=r,e[8]=p):p=e[8];let d;e[9]!==t||e[10]!==p?(d=n.jsx("span",{className:p,children:t}),e[9]=t,e[10]=p,e[11]=d):d=e[11];let h;return e[12]!==a||e[13]!==f||e[14]!==d?(h=n.jsxs("span",{className:a,children:[f,d]}),e[12]=a,e[13]=f,e[14]=d,e[15]=h):h=e[15],h}const En=He({propertyId:ue().min(1,"Selecione uma propriedade")});function wn(i){const e=k.c(55),{card:t,connectionId:s,companionClient:o,selfClient:l,org:r,onDone:c,onIsPendingChange:a}=i;let u;e[0]!==s||e[1]!==r.id?(u=W.commerceDiscoveryCompanionGaProperties(r.id,s),e[0]=s,e[1]=r.id,e[2]=u):u=e[2];let f;e[3]!==o?(f=async()=>{const C=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(C);return Cn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==u||e[6]!==f?(p={queryKey:u,queryFn:f},e[5]=u,e[6]=f,e[7]=p):p=e[7];const d=pt(p);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Be(En),e[8]=h):h=e[8];const v=t.configurationState?.propertyId||"";let j;e[9]!==v?(j={resolver:h,defaultValues:{propertyId:v}},e[9]=v,e[10]=j):j=e[10];const x=Ge(j);let g;e[11]!==t||e[12]!==c||e[13]!==r||e[14]!==l?(g={card:t,selfClient:l,org:r,onDone:c},e[11]=t,e[12]=c,e[13]=r,e[14]=l,e[15]=g):g=e[15];const{save:m,isPending:b,error:y}=Je(g);let S,_;e[16]!==b||e[17]!==a?(S=()=>{a?.(b)},_=[b,a],e[16]=b,e[17]=a,e[18]=S,e[19]=_):(S=e[18],_=e[19]),D.useEffect(S,_);let N;if(e[20]!==x||e[21]!==m){let C;e[23]!==m?(C=async L=>{m(L)},e[23]=m,e[24]=C):C=e[24],N=x.handleSubmit(C),e[20]=x,e[21]=m,e[22]=N}else N=e[22];const w=N;if(d.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando propriedades..."})}),e[25]=C):C=e[25],C}if(d.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=C):C=e[26],C}let E;e[27]!==d.data?(E=d.data||[],e[27]=d.data,e[28]=E):E=e[28];const I=E;if(I.flatMap(In).length===0){let C;return e[29]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."})}),e[29]=C):C=e[29],C}let O;e[30]!==b||e[31]!==I?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(Et,{options:I.flatMap(Tn),value:L.value,onChange:L.onChange,disabled:b,ariaLabel:"Propriedade do Google Analytics"})}),n.jsx(he,{})]})},e[30]=b,e[31]=I,e[32]=O):O=e[32];let T;e[33]!==x.control||e[34]!==O?(T=n.jsx(fe,{control:x.control,name:"propertyId",render:O}),e[33]=x.control,e[34]=O,e[35]=T):T=e[35];let U;e[36]!==x||e[37]!==T?(U=n.jsx(Ye,{...x,children:T}),e[36]=x,e[37]=T,e[38]=U):U=e[38];let P;e[39]!==y?(P=y&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[39]=y,e[40]=P):P=e[40];let M;e[41]!==b||e[42]!==c?(M=n.jsx(H,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancelar"}),e[41]=b,e[42]=c,e[43]=M):M=e[43];const q=b?"Salvando...":"Salvar";let z;e[44]!==b||e[45]!==q?(z=n.jsx(H,{type:"submit",disabled:b,children:q}),e[44]=b,e[45]=q,e[46]=z):z=e[46];let F;e[47]!==M||e[48]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[47]=M,e[48]=z,e[49]=F):F=e[49];let K;return e[50]!==w||e[51]!==U||e[52]!==P||e[53]!==F?(K=n.jsxs("form",{onSubmit:w,className:"space-y-4",children:[U,P,F]}),e[50]=w,e[51]=U,e[52]=P,e[53]=F,e[54]=K):K=e[54],K}function Tn(i){return i.options}function In(i){return i.options}const kn=He({siteUrl:ue().min(1,"Selecione um site")});function On(i){const e=k.c(59),{card:t,connectionId:s,companionClient:o,selfClient:l,org:r,contextSiteUrl:c,onDone:a,onIsPendingChange:u}=i;let f;e[0]!==s||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,s),e[0]=s,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const C=await o.callTool({name:"list_sites",arguments:{}});return J(C).sites||[]},e[3]=o,e[4]=p):p=e[4];let d;e[5]!==f||e[6]!==p?(d={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=d):d=e[7];const h=pt(d);let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=Be(kn),e[8]=v):v=e[8];const j=t.configurationState?.siteUrl||"";let x;e[9]!==j?(x={resolver:v,defaultValues:{siteUrl:j}},e[9]=j,e[10]=x):x=e[10];const g=Ge(x);let m;e[11]!==t||e[12]!==a||e[13]!==r||e[14]!==l?(m={card:t,selfClient:l,org:r,onDone:a},e[11]=t,e[12]=a,e[13]=r,e[14]=l,e[15]=m):m=e[15];const{save:b,isPending:y,error:S}=Je(m);let _,N;e[16]!==y||e[17]!==u?(_=()=>{u?.(y)},N=[y,u],e[16]=y,e[17]=u,e[18]=_,e[19]=N):(_=e[18],N=e[19]),D.useEffect(_,N);let w;if(e[20]!==g||e[21]!==b){let C;e[23]!==b?(C=async L=>{b(L)},e[23]=b,e[24]=C):C=e[24],w=g.handleSubmit(C),e[20]=g,e[21]=b,e[22]=w}else w=e[22];const E=w;if(h.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando sites..."})}),e[25]=C):C=e[25],C}if(h.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=C):C=e[26],C}let I,$;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==g||e[30]!==h.data){$=Symbol.for("react.early_return_sentinel");e:{if(I=h.data||[],I.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=L):L=e[33],$=L;break e}const C=t.configurationState?.siteUrl;if(C&&g.getValues("siteUrl")!==C)g.setValue("siteUrl",C);else if(!C&&!g.getValues("siteUrl")){const L=jn(c,I);L&&g.setValue("siteUrl",L)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=g,e[30]=h.data,e[31]=I,e[32]=$}else I=e[31],$=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let O;e[34]!==y||e[35]!==I?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(Et,{options:I.map(Un),value:L.value,onChange:L.onChange,disabled:y,ariaLabel:"Site verificado"})}),n.jsx(he,{})]})},e[34]=y,e[35]=I,e[36]=O):O=e[36];let T;e[37]!==g.control||e[38]!==O?(T=n.jsx(fe,{control:g.control,name:"siteUrl",render:O}),e[37]=g.control,e[38]=O,e[39]=T):T=e[39];let U;e[40]!==g||e[41]!==T?(U=n.jsx(Ye,{...g,children:T}),e[40]=g,e[41]=T,e[42]=U):U=e[42];let P;e[43]!==S?(P=S&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:"Não foi possível salvar a configuração"}),e[43]=S,e[44]=P):P=e[44];let M;e[45]!==y||e[46]!==a?(M=n.jsx(H,{type:"button",variant:"outline",onClick:a,disabled:y,children:"Cancelar"}),e[45]=y,e[46]=a,e[47]=M):M=e[47];const q=y?"Salvando...":"Salvar";let z;e[48]!==y||e[49]!==q?(z=n.jsx(H,{type:"submit",disabled:y,children:q}),e[48]=y,e[49]=q,e[50]=z):z=e[50];let F;e[51]!==M||e[52]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[51]=M,e[52]=z,e[53]=F):F=e[53];let K;return e[54]!==E||e[55]!==U||e[56]!==P||e[57]!==F?(K=n.jsxs("form",{onSubmit:E,className:"space-y-4",children:[U,P,F]}),e[54]=E,e[55]=U,e[56]=P,e[57]=F,e[58]=K):K=e[58],K}function Un(i){return{value:i.siteUrl,label:i.siteUrl}}const An={vtex:Nn,"google-analytics":wn,"google-search-console":On};function Rn(){const i=k.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let s;return i[2]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=s):s=i[2],s}function Ve(i){const e=k.c(3),{children:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{size:14,className:"shrink-0 text-blue-500"}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=n.jsxs("div",{className:"flex items-center gap-2 p-1",children:[s,n.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function Pn(i){const e=k.c(45),{card:t,connecting:s,disabled:o,onConnect:l,org:r,selfClient:c,siteUrl:a,autoOpenConfigFieldKey:u,onAutoOpenConfigHandled:f}=i,p=t.linkedConnectionId;let d;e[0]!==t.configurationState?(d=gn(t.configurationState),e[0]=t.configurationState,e[1]=d):d=e[1];const h=d;let v;e[2]!==t.icon||e[3]!==t.title?(v=n.jsx(St,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=t.icon,e[3]=t.title,e[4]=v):v=e[4];let j;e[5]!==t.title?(j=n.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[5]=t.title,e[6]=j):j=e[6];let x;e[7]!==t.satisfied||e[8]!==t.title||e[9]!==s||e[10]!==o||e[11]!==l?(x=t.satisfied?n.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[n.jsx(We,{size:16})," Conectado"]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",disabled:o||s,onClick:l,"aria-label":`Conectar ${t.title}`,children:s?n.jsx(ft,{size:16,className:"animate-spin"}):"Conectar"}),e[7]=t.satisfied,e[8]=t.title,e[9]=s,e[10]=o,e[11]=l,e[12]=x):x=e[12];let g;e[13]!==v||e[14]!==j||e[15]!==x?(g=n.jsxs("div",{className:"flex items-center gap-2",children:[v,j,x]}),e[13]=v,e[14]=j,e[15]=x,e[16]=g):g=e[16];let m;e[17]!==t.checks?(m=t.checks!==null&&n.jsxs(Ve,{children:["+ ",t.checks," verificações"]}),e[17]=t.checks,e[18]=m):m=e[18];let b;e[19]!==t.headline?(b=t.headline&&n.jsx(Ve,{children:t.headline}),e[19]=t.headline,e[20]=b):b=e[20];let y;e[21]!==t.bullets?(y=t.bullets.map($n),e[21]=t.bullets,e[22]=y):y=e[22];let S;e[23]!==t.candidateConnectionId||e[24]!==t.satisfied||e[25]!==t.title?(S=!t.satisfied&&t.candidateConnectionId&&n.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Usando sua conexão existente de ",t.title]}),e[23]=t.candidateConnectionId,e[24]=t.satisfied,e[25]=t.title,e[26]=S):S=e[26];let _;e[27]!==m||e[28]!==b||e[29]!==y||e[30]!==S?(_=n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[m,b,y,S]}),e[27]=m,e[28]=b,e[29]=y,e[30]=S,e[31]=_):_=e[31];let N;e[32]!==u||e[33]!==t||e[34]!==p||e[35]!==f||e[36]!==r||e[37]!==h||e[38]!==c||e[39]!==a?(N=t.satisfied&&p&&n.jsx(D.Suspense,{fallback:n.jsx(Dn,{}),children:n.jsx(Kn,{card:t,org:r,selfClient:c,connectionId:p,savedConfigEntries:h,contextSiteUrl:a,autoOpen:hn({autoOpenFieldKey:u,card:t}),onAutoOpenHandled:f})}),e[32]=u,e[33]=t,e[34]=p,e[35]=f,e[36]=r,e[37]=h,e[38]=c,e[39]=a,e[40]=N):N=e[40];let w;return e[41]!==_||e[42]!==N||e[43]!==g?(w=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[g,_,N]}),e[41]=_,e[42]=N,e[43]=g,e[44]=w):w=e[44],w}function $n(i){return n.jsx(Ve,{children:i},i)}function Ln(i,e){return/(token|secret|password|appKey|key)$/i.test(i)?"••••••••":e}function zn(i){const e=k.c(2),{title:t}=i;let s;return e[0]!==t?(s=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("p",{className:"text-xs text-muted-foreground",children:["A configuração ainda não está disponível aqui para ",t,"."]})}),e[0]=t,e[1]=s):s=e[1],s}function Dn(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"h-5 w-24 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]})}),i[0]=e):e=i[0],e}function Kn(i){const e=k.c(41),{card:t,org:s,selfClient:o,connectionId:l,savedConfigEntries:r,contextSiteUrl:c,autoOpen:a,onAutoOpenHandled:u}=i;let f;e[0]!==l||e[1]!==s.id||e[2]!==s.slug?(f={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=l,e[1]=s.id,e[2]=s.slug,e[3]=f):f=e[3];const p=Ae(f),[d,h]=D.useState(a),[v,j]=D.useState(!1),x=An[t.bindingType];let g;e[4]!==a||e[5]!==u?(g=()=>{h(!1),a&&u()},e[4]=a,e[5]=u,e[6]=g):g=e[6];const m=g;let b;e[7]!==m||e[8]!==v?(b=U=>{if(!(!U&&v)){if(!U){m();return}h(!0)}},e[7]=m,e[8]=v,e[9]=b):b=e[9];const y=b;let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuração"}),e[10]=S):S=e[10];let _;e[11]!==r.length?(_=r.length===0&&n.jsx("p",{className:"text-xs text-muted-foreground",children:"Nenhum valor de configuração foi salvo ainda."}),e[11]=r.length,e[12]=_):_=e[12];let N;e[13]!==_?(N=n.jsxs("div",{className:"grid gap-1",children:[S,_]}),e[13]=_,e[14]=N):N=e[14];let w;e[15]!==x||e[16]!==t.title||e[17]!==r.length?(w=r.length>0?n.jsxs(Ht,{children:[n.jsx(Bt,{asChild:!0,children:n.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(!0),"aria-label":`Editar configuração de ${t.title}`,disabled:!x,children:n.jsx(Qt,{size:14})})}),n.jsx(Gt,{children:"Editar configuração"})]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!0),disabled:!x,children:"Configurar"}),e[15]=x,e[16]=t.title,e[17]=r.length,e[18]=w):w=e[18];let E;e[19]!==N||e[20]!==w?(E=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N,w]}),e[19]=N,e[20]=w,e[21]=E):E=e[21];let I;e[22]!==r?(I=r.length>0&&n.jsx("dl",{className:"grid gap-2",children:r.map(Mn)}),e[22]=r,e[23]=I):I=e[23];let $;e[24]!==E||e[25]!==I?($=n.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[E,I]}),e[24]=E,e[25]=I,e[26]=$):$=e[26];let O;e[27]!==x||e[28]!==t||e[29]!==m||e[30]!==p||e[31]!==l||e[32]!==c||e[33]!==d||e[34]!==y||e[35]!==s||e[36]!==o?(O=x?n.jsx(Kt,{open:d,onOpenChange:y,children:n.jsxs(Mt,{className:"sm:max-w-lg",children:[n.jsxs(Ft,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[n.jsx(St,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx(qt,{children:t.title}),n.jsxs(Vt,{children:["Configure o ",t.title," para enriquecer os dados"]})]})]}),n.jsx(x,{card:t,connectionId:l,companionClient:p,selfClient:o,org:s,contextSiteUrl:c,onDone:m,onIsPendingChange:j})]})}):n.jsx(zn,{title:t.title}),e[27]=x,e[28]=t,e[29]=m,e[30]=p,e[31]=l,e[32]=c,e[33]=d,e[34]=y,e[35]=s,e[36]=o,e[37]=O):O=e[37];let T;return e[38]!==$||e[39]!==O?(T=n.jsxs(n.Fragment,{children:[$,O]}),e[38]=$,e[39]=O,e[40]=T):T=e[40],T}function Mn(i){return n.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[n.jsx("dt",{className:"text-muted-foreground",children:i.label}),n.jsx("dd",{className:"truncate text-foreground",children:Ln(i.key,i.value)})]},i.key)}const Xe={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Rupturas, PDPs incompletas e lacunas de atributos em todos os SKUs"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Onde a receita vaza entre a visualização do produto e o checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Lacunas de visibilidade na busca e indexação em todo o seu catálogo"}};function Fn(i){const e=k.c(30),{selfClient:t,org:s,cdConnectionId:o}=i;let l;e[0]!==o||e[1]!==s.id||e[2]!==s.slug?(l={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=o,e[1]=s.id,e[2]=s.slug,e[3]=l):l=e[3];const r=Ae(l);let c;e[4]!==o||e[5]!==s.id?(c=W.commerceDiscoveryCompanionSchema(s.id,o),e[4]=o,e[5]=s.id,e[6]=c):c=e[6];let a;e[7]!==r?(a=async()=>{const R=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(R)},e[7]=r,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u={queryKey:c,queryFn:a},e[9]=c,e[10]=a,e[11]=u):u=e[11];const f=me(u),p=dn(f.data?.stateSchema??{properties:{}}),d=p.map(Zn),h=p.map(Jn).filter(Yn),v=p.filter(Wn).map(Qn),j=[...h,...v].sort().join(",");let x;e[12]!==o||e[13]!==s.id?(x=W.commerceDiscoveryConnection(s.id,o),e[12]=o,e[13]=s.id,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==t?(g=async()=>{const R=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(R)},e[15]=o,e[16]=t,e[17]=g):g=e[17];let m;e[18]!==x||e[19]!==g?(m={queryKey:x,queryFn:g},e[18]=x,e[19]=g,e[20]=m):m=e[20];const y=me(m).data?.item?.configuration_state??null;let S;e[21]!==y?(S=R=>y?.[R.fieldKey]?.value,e[21]=y,e[22]=S):S=e[22];const _=p.map(S).filter(Gn),N=[...d.map(Bn),...h.map(Hn),..._.map(Vn)].sort().join(","),E=me({queryKey:W.commerceDiscoveryCompanionConnections(s.id,N),queryFn:async()=>{if(p.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:d},{field:["app_id"],operator:"in",value:h}];_.length>0&&R.push({field:["id"],operator:"in",value:_});const G=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return J(G)}}).data?.items??[],I=new Set(_),$=E.filter(R=>I.has(R.id)),O=$.filter(qn);let T;e[23]!==s.id||e[24]!==s.slug?(T=R=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(s.id,R.id),queryFn:async()=>{try{const G=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=T):T=e[25];const U=sn({queries:O.map(T)});let P;e[26]!==U?(P=(R,G)=>[R.id,U[G]?.data?.hasToken===!0],e[26]=U,e[27]=P):P=e[27];const M=new Map(O.map(P)),q={};for(const R of $)q[R.id]=!R.oauth_config||!!R.connection_token||M.get(R.id)===!0;const z=me({queryKey:W.commerceDiscoveryCompanionRegistry(s.id,j),queryFn:async()=>{if(p.length===0)return{items:[]};const R=mn(h,v),G=await Yt(bt.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return J(G)}}),F={},K={};for(const R of z.data?.items??[])F[R.id]=R,R.server?.name&&(K[R.server.name]=R);const C=bn({requirements:p,itemsById:F,itemsByName:K,connections:E,connectionReadiness:q,configurationState:y,curated:Xe});let L;return e[28]!==C?(L={cards:C},e[28]=C,e[29]=L):L=e[29],L}function qn(i){return i.oauth_config&&!i.connection_token}function Vn(i){return`linked:${i}`}function Hn(i){return`app:${i}`}function Bn(i){return`binding:${i}`}function Gn(i){return typeof i=="string"&&i.length>0}function Qn(i){return i.bindingType}function Wn(i){return!Xe[i.bindingType]}function Yn(i){return!!i}function Jn(i){return Xe[i.bindingType]?.registryAppId}function Zn(i){return i.bindingType}function Xn({selfClient:i,org:e,userId:t,cdConnectionId:s}){const o=ut(),[l,r]=D.useState(null),[c,a]=D.useState(null),u=async(p,d)=>{const h=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:d}});return J(h)};async function f(p){r(p.fieldKey),a(null);try{let d=p.candidateConnectionId;if(!d){const m=Jt(p.registryItem,e.id,t,{remoteIndex:0}),b=m.connection_type==="STDIO",y=!!m.connection_url,S=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!y&&!S)return a(`${p.title} cannot be connected: no connection method available`),!1;const _=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});d=J(_).item.id}const h=d,v=await on({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:m=>u(h,{connection_token:m}).then(()=>{})});if(!v.ok)return a(`Couldn't sign in to ${p.title}: ${v.error}`),!1;const j=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),x=J(j).item?.configuration_state??null,g=un(x,p.fieldKey,p.bindingType,h);return await u(s,{configuration_state:g}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,s)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),!0}catch(d){return a(d instanceof Error?d.message:String(d)),!1}finally{r(null)}}return{connect:f,connectingFieldKey:l,error:c}}const et="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function tt(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"grid gap-1.5",children:[n.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Desbloqueie seu diagnóstico completo"}),n.jsx("p",{className:"text-base text-muted-foreground",children:"Conecte suas ferramentas para liberar mais de 100 verificações no seu funil."})]}),i[0]=e):e=i[0],e}function es(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-4",children:[0,1,2].map(ts)}),i[0]=e):e=i[0],e}function ts(i){return n.jsx(Rn,{},i)}function nt(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:et,children:[n.jsx(tt,{}),n.jsx(es,{})]}),i[0]=e):e=i[0],e}function ns(i){const e=k.c(5),{onRetry:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(tt,{}),e[0]=s):s=e[0];let o,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),l=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=o,e[2]=l):(o=e[1],l=e[2]);let r;return e[3]!==t?(r=n.jsxs("div",{className:et,children:[s,n.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[o,l,n.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=r):r=e[4],r}function ss(i){const e=k.c(2);let t;return e[0]!==i?(t=n.jsx(gt,{children:s=>{const{reset:o}=s;return n.jsx(ht,{fallback:l=>{const{resetError:r}=l;return n.jsx(ns,{onRetry:()=>{o(),r()}})},children:n.jsx(D.Suspense,{fallback:n.jsx(nt,{}),children:n.jsx(is,{...i})})})}}),e[0]=i,e[1]=t):t=e[1],t}function is(i){const e=k.c(35),{org:t,cdConnectionId:s,siteUrl:o}=i,{data:l}=Oe.useSession(),r=l?.user?.id??"";let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:jt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const a=Ae(c);let u;e[3]!==s||e[4]!==t||e[5]!==a?(u={selfClient:a,org:t,cdConnectionId:s},e[3]=s,e[4]=t,e[5]=a,e[6]=u):u=e[6];const{cards:f}=Fn(u);let p;e[7]!==s||e[8]!==t||e[9]!==a||e[10]!==r?(p={selfClient:a,org:t,userId:r,cdConnectionId:s},e[7]=s,e[8]=t,e[9]=a,e[10]=r,e[11]=p):p=e[11];const{connect:d,connectingFieldKey:h,error:v}=Xn(p),[j,x]=D.useState(null);if(f.length===0)return null;const g=h!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(tt,{}),e[12]=m):m=e[12];let b;e[13]!==v?(b=v&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v}),e[13]=v,e[14]=b):b=e[14];let y;if(e[15]!==j||e[16]!==g||e[17]!==f||e[18]!==d||e[19]!==h||e[20]!==t||e[21]!==a||e[22]!==o){let _;e[24]!==j||e[25]!==g||e[26]!==d||e[27]!==h||e[28]!==t||e[29]!==a||e[30]!==o?(_=N=>{const w=async()=>{await d(N)&&x(N.fieldKey)};return n.jsx(Pn,{card:N,connecting:h===N.fieldKey,disabled:g&&h!==N.fieldKey,org:t,selfClient:a,siteUrl:o,autoOpenConfigFieldKey:j,onAutoOpenConfigHandled:()=>x(E=>E===N.fieldKey?null:E),onConnect:()=>{w()}},N.fieldKey)},e[24]=j,e[25]=g,e[26]=d,e[27]=h,e[28]=t,e[29]=a,e[30]=o,e[31]=_):_=e[31],y=f.map(_),e[15]=j,e[16]=g,e[17]=f,e[18]=d,e[19]=h,e[20]=t,e[21]=a,e[22]=o,e[23]=y}else y=e[23];let S;return e[32]!==b||e[33]!==y?(S=n.jsxs("div",{className:et,children:[m,n.jsx(Fe,{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-[60vh] md:flex-none",children:n.jsxs("div",{className:"grid gap-4",children:[b,y]})})]}),e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const st="https://decocms-tanstack.deco-cx.workers.dev/agendar",os="Prefere que a gente acompanhe você?",rs="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.";function it({siteUrl:i,email:e}){const t=new URL(st);return i&&t.searchParams.set("siteUrl",i),e&&t.searchParams.set("email",e),t.toString()}function as(i){const e=k.c(9),{href:t,size:s,className:o}=i,l=t===void 0?st:t,r=s===void 0?"lg":s;let c;e[0]!==o?(c=Z("w-full",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Nt,{size:16}),e[2]=a):a=e[2];let u;e[3]!==l?(u=n.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",children:["Agendar uma reunião",a]}),e[3]=l,e[4]=u):u=e[4];let f;return e[5]!==r||e[6]!==c||e[7]!==u?(f=n.jsx(H,{asChild:!0,variant:"outline",size:r,className:c,children:u}),e[5]=r,e[6]=c,e[7]=u,e[8]=f):f=e[8],f}function ct(i){const e=k.c(2),{children:t}=i;let s;return e[0]!==t?(s=n.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:t}),e[0]=t,e[1]=s):s=e[1],s}function ls(){const i=k.c(4);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ct,{children:n.jsx(_t,{size:20,className:"text-muted-foreground"})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:n.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})}),i[1]=t):t=i[1];let s;i[2]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),i[2]=s):s=i[2];let o;return i[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,n.jsxs("div",{className:"relative",children:[s,n.jsxs(ct,{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),i[3]=o):o=i[3],o}function ot(i){const e=k.c(4),{href:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ls,{}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"grid gap-2",children:[n.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:os}),n.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:rs})]}),e[1]=o):o=e[1];let l;return e[2]!==t?(l=n.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:n.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:[s,o,n.jsx(as,{href:t,size:"xl"})]})}),e[2]=t,e[3]=l):l=e[3],l}function cs(i){const e=k.c(8),{className:t,href:s}=i,o=s===void 0?st:s;let l;e[0]!==t?(l=Z("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:n.jsx(_t,{size:20})}),e[2]=r):r=e[2];let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[n.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefere falar com uma pessoa?"}),n.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Agende uma chamada e rodamos o diagnóstico com você."})]}),a=n.jsx(Nt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=c,e[4]=a):(c=e[3],a=e[4]);let u;return e[5]!==o||e[6]!==l?(u=n.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:l,children:[r,c,a]}),e[5]=o,e[6]=l,e[7]=u):u=e[7],u}function wt(i){const e=k.c(10),{host:t}=i,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=n.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=r):(o=e[0],l=e[1],r=e[2]);let c;e[3]!==s?(c=n.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:n.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=c):c=e[4];let a;e[5]!==t?(a=n.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"flex items-center gap-3",children:[o,l,r,c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const ds={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ms(i){return ds[i]}function rt(i){const e=k.c(4),{variant:t}=i;let s;e[0]!==t?(s=ms(t),e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ze,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=o):o=e[3],o}function Ui(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ps,{}),i[0]=e):e=i[0],e}const Tt=D.createContext(null),It=()=>D.useContext(Tt);function Q(i){const e=k.c(13);let t,s;e[0]!==i?({visual:s,...t}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/commerce-onboarding"},e[3]=o):o=e[3];const l=xt(o),{data:r}=Oe.useSession(),c=r?.user?.email;let a;e[4]!==l.siteUrl||e[5]!==c?(a=it({siteUrl:l.siteUrl,email:c}),e[4]=l.siteUrl,e[5]=c,e[6]=a):a=e[6];const u=a;let f;e[7]!==u||e[8]!==s?(f=s??n.jsx(ot,{href:u}),e[7]=u,e[8]=s,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==f?(p=n.jsx($t,{...t,visual:f}),e[10]=t,e[11]=f,e[12]=p):p=e[12],p}const us={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:i=>`Código enviado para ${i}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:i=>`Continuar com ${i}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function fs(i){if(!i)return null;const e=Te(i);return e.ok?new URL(e.value).hostname:null}function dt(i){switch(i){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return i}}let mt=!1;function ps(){const i=xt({from:"/commerce-onboarding"}),{org:e,siteUrl:t}=i,s=fs(t);return!mt&&Ot()&&(mt=!0,Ut("commerce_onboarding_viewed",{site_url:t,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),n.jsx(Tt.Provider,{value:s,children:n.jsx(gs,{requestedOrgSlug:e,siteUrl:t})})}function gs(i){const e=k.c(8),{requestedOrgSlug:t,siteUrl:s}=i,{data:o,isPending:l}=Oe.useSession(),r=It();if(l){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Q,{children:n.jsx(rt,{variant:"generic"})}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r?n.jsx(wt,{host:r}):void 0,e[1]=r,e[2]=u):u=e[2];let f;return e[3]!==u?(f=n.jsx(Q,{children:n.jsx(Pt,{callbackUrl:a,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:u,copy:us})}),e[3]=u,e[4]=f):f=e[4],f}let c;return e[5]!==t||e[6]!==s?(c=n.jsx(hs,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=c):c=e[7],c}function hs(i){const e=k.c(40),{requestedOrgSlug:t,siteUrl:s}=i,o=yt(),l=At(),[r,c]=D.useState(null),[a,u]=D.useState(null),f=l.data?.map(ys)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:xs,retry:!1,onSuccess:m=>{u(m)}},e[0]=p):p=e[0];const d=ke(p);if(l.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Q,{children:n.jsx(rt,{variant:"workspace"})}),e[1]=m):m=e[1],m}if(l.error){let m;return e[2]!==l?(m=n.jsx(Ie,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[2]=l,e[3]=m):m=e[3],m}const h=t?f.find(m=>m.slug===t):null;if(h){let m;return e[4]!==h||e[5]!==s?(m=n.jsx(we,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=m):m=e[6],m}if(t){let m;return e[7]!==l?(m=n.jsx(Ie,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[7]=l,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==s?(m=n.jsx(we,{org:r,initialSiteUrl:s}),e[9]=r,e[10]=s,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==s?(m=n.jsx(we,{org:f[0],initialSiteUrl:s}),e[12]=f[0],e[13]=s,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=S=>c(S),e[16]=b):b=e[16];let y;return e[17]!==f?(y=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:f,selectLabel:"Continuar",onSelected:b})})]})}),e[17]=f,e[18]=y):y=e[18],y}if(!a){let m;e[19]!==d?(m=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=m):m=e[20];let b;return e[21]!==d||e[22]!==m?(b=n.jsx(vs,{mutation:d,onRetry:m}),e[21]=d,e[22]=m,e[23]=b):b=e[23],b}const v=a;if(v?.success&&(v.status==="created"||v.status==="joined"||v.status==="already_has_organization")&&v.organization){let m;return e[24]!==v.organization||e[25]!==s?(m=n.jsx(we,{org:v.organization,initialSiteUrl:s}),e[24]=v.organization,e[25]=s,e[26]=m):m=e[26],m}if(v?.status==="ambiguous"&&v.organizations&&v.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=m):m=e[27];const b=v.domain??void 0;let y;e[28]!==o||e[29]!==s?(y=(_,N)=>{vt(),c({..._,slug:N}),o({to:"/commerce-onboarding",search:{org:N,siteUrl:s}})},e[28]=o,e[29]=s,e[30]=y):y=e[30];let S;return e[31]!==v.organizations||e[32]!==b||e[33]!==y?(S=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:v.organizations,domain:b,onJoined:y})})]})}),e[31]=v.organizations,e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const j=v?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let x;e[35]!==d?(x=()=>{u(null),d.reset()},e[35]=d,e[36]=x):x=e[36];let g;return e[37]!==j||e[38]!==x?(g=n.jsx(Ie,{title:"O onboarding de commerce precisa de suporte",description:j,actionLabel:"Tentar novamente",onRetry:x}),e[37]=j,e[38]=x,e[39]=g):g=e[39],g}async function xs(){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&&vt(),e}function ys(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function vs(i){const e=k.c(7),{mutation:t,onRetry:s}=i,o=D.useRef(!1);let l;e[0]!==t?(l=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=l):l=e[1];const r=l;if(t.error){let u;return e[2]!==s?(u=n.jsx(Ie,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:s}),e[2]=s,e[3]=u):u=e[3],u}let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rt,{variant:"generic"}),e[4]=c):c=e[4];let a;return e[5]!==r?(a=n.jsx(Q,{children:n.jsx("div",{ref:r,children:c})}),e[5]=r,e[6]=a):a=e[6],a}function X(i){const e=k.c(8),{title:t,description:s}=i,o=It();let l;e[0]!==o?(l=o?n.jsx(wt,{host:o}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let r;e[2]!==s||e[3]!==t?(r=(t||s)&&n.jsxs("div",{className:"space-y-2",children:[t&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=r):r=e[4];let c;return e[5]!==l||e[6]!==r?(c=n.jsxs("div",{className:"grid gap-10",children:[l,r]}),e[5]=l,e[6]=r,e[7]=c):c=e[7],c}function Ie(i){const e=k.c(9),{title:t,description:s,actionLabel:o,onRetry:l}=i;let r;e[0]!==s||e[1]!==t?(r=n.jsx(X,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=r):r=e[2];let c;e[3]!==o||e[4]!==l?(c=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=c):c=e[5];let a;return e[6]!==r||e[7]!==c?(a=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[r,c]})}),e[6]=r,e[7]=c,e[8]=a):a=e[8],a}function bs(i){return i.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Ee(i){const e=i;if(e.isError)throw new Error(bs(e));return e.structuredContent??i}function we(i){const e=k.c(10),{org:t,initialSiteUrl:s}=i,{data:o}=Oe.useSession(),l=o?.user?.email;let r;e[0]!==s||e[1]!==l?(r=it({siteUrl:s,email:l}),e[0]=s,e[1]=l,e[2]=r):r=e[2];const c=r;let a;e[3]!==c?(a=n.jsx(ot,{href:c}),e[3]=c,e[4]=a):a=e[4];const u=a;let f;return e[5]!==s||e[6]!==u||e[7]!==t||e[8]!==o?.user?.email?(f=n.jsx(gt,{children:p=>{const{reset:d}=p;return n.jsx(ht,{fallback:h=>{const{error:v,resetError:j}=h;return n.jsx(Q,{visual:u,children:n.jsx(js,{orgName:t.name,message:v instanceof Error?v.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{d(),j()}})})},children:n.jsx(D.Suspense,{fallback:n.jsx(kt,{visual:u}),children:n.jsx(Cs,{org:t,initialSiteUrl:s,sessionEmail:o?.user?.email},`${t.id}:${s??""}`)})})}}),e[5]=s,e[6]=u,e[7]=t,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function kt(i){const e=k.c(3),{visual:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(X,{}),n.jsx(nt,{})]}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=n.jsx(Q,{align:"fill",visual:t,children:s}),e[1]=t,e[2]=o):o=e[2],o}function js(i){const e=k.c(10),{orgName:t,message:s,onRetry:o}=i,l=`A configuração de commerce continuará em ${t}.`;let r;e[0]!==l?(r=n.jsx(X,{title:"Diagnóstico de commerce",description:l}),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx(xe,{message:s}),e[2]=s,e[3]=c):c=e[3];let a;e[4]!==o?(a=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Tentar novamente"}),e[4]=o,e[5]=a):a=e[5];let u;return e[6]!==r||e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"grid gap-10",children:[r,c,a]}),e[6]=r,e[7]=c,e[8]=a,e[9]=u):u=e[9],u}function Cs(i){const e=k.c(111),{org:t,initialSiteUrl:s,sessionEmail:o}=i,l=yt();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:jt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const c=Ae(r),[a,u]=D.useState(s??""),[f,p]=D.useState(null),[d,h]=D.useState(null),v=D.useRef(!1),j=bt.COMMERCE_DISCOVERY(t.id),x=zt(t.id),g=W.commerceDiscoveryConnection(t.id,j);let m;e[3]!==j||e[4]!==c?(m=async()=>{const A=await c.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ee(A)},e[3]=j,e[4]=c,e[5]=m):m=e[5];let b;e[6]!==g||e[7]!==m?(b={queryKey:g,queryFn:m,retry:!1},e[6]=g,e[7]=m,e[8]=b):b=e[8];const y=me(b),S=W.commerceDiscoveryVirtualMcp(t.id,x);let _;e[9]!==c||e[10]!==x?(_=async()=>{const A=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return Ee(A)},e[9]=c,e[10]=x,e[11]=_):_=e[11];let N;e[12]!==S||e[13]!==_?(N={queryKey:S,queryFn:_,retry:!1},e[12]=S,e[13]=_,e[14]=N):N=e[14];const w=me(N);let E;e[15]!==c?(E=async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:A}});return Ee(B)},e[15]=c,e[16]=E):E=e[16];let I;e[17]!==y||e[18]!==w?(I=A=>{p(A),h(null),y.refetch(),w.refetch()},e[17]=y,e[18]=w,e[19]=I):I=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=A=>{h(A instanceof Error?A.message:"A configuração do Commerce Discovery falhou.")},e[20]=$):$=e[20];let O;e[21]!==E||e[22]!==I?(O={mutationFn:E,retry:!1,onSuccess:I,onError:$},e[21]=E,e[22]=I,e[23]=O):O=e[23];const T=ke(O);let U;e[24]!==c?(U={mutationFn:async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:A}});return Ee(B)},retry:!1},e[24]=c,e[25]=U):U=e[25];const P=ke(U),[M,q]=D.useState(null),z=!!y.data.item&&!!w.data.item,F=y.data.item,K=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,C=s||a||K||"";let L;e[26]!==C||e[27]!==o?(L=it({siteUrl:C,email:o}),e[26]=C,e[27]=o,e[28]=L):L=e[28];const R=L;let G;e[29]!==R?(G=n.jsx(ot,{href:R}),e[29]=R,e[30]=G):G=e[30];const V=G;let ye;e[31]!==T?(ye=A=>{const B=Te(A);if(!B.ok){h(dt(B.error));return}h(null),T.mutate(B.value)},e[31]=T,e[32]=ye):ye=e[32];const te=ye;let ve;e[33]!==s||e[34]!==te||e[35]!==z?(ve=A=>{!A||v.current||z||!s||(v.current=!0,te(s))},e[33]=s,e[34]=te,e[35]=z,e[36]=ve):ve=e[36];const Re=ve;let be;e[37]!==te||e[38]!==a?(be=A=>{A.preventDefault(),te(a)},e[37]=te,e[38]=a,e[39]=be):be=e[39];const Y=be;let je;e[40]!==j||e[41]!==f?.reportApp||e[42]!==x?(je=f?.reportApp??{connectionId:j,virtualMcpId:x,toolName:Dt},e[40]=j,e[41]=f?.reportApp,e[42]=x,e[43]=je):je=e[43];const ee=je;let Ce;e[44]!==C||e[45]!==l||e[46]!==t.slug||e[47]!==ee||e[48]!==P?(Ce=async()=>{q(null);const A=Te(C);if(A.ok)try{await P.mutateAsync(A.value)}catch{q("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Rt.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ee.virtualMcpId,main:Lt(ee.connectionId,ee.toolName),chat:0}})},e[44]=C,e[45]=l,e[46]=t.slug,e[47]=ee,e[48]=P,e[49]=Ce):Ce=e[49];const Pe=Ce;if(z){let A;return e[50]!==R||e[51]!==V||e[52]!==C||e[53]!==Pe||e[54]!==t||e[55]!==ee||e[56]!==M||e[57]!==P.isPending?(A=n.jsx(Ss,{org:t,reportApp:ee,onOpenReport:Pe,isSubmitting:P.isPending,error:M,meetingUrl:R,meetingVisual:V,siteUrl:C}),e[50]=R,e[51]=V,e[52]=C,e[53]=Pe,e[54]=t,e[55]=ee,e[56]=M,e[57]=P.isPending,e[58]=A):A=e[58],A}if(T.isPending){let A;return e[59]!==V?(A=n.jsx(kt,{visual:V}),e[59]=V,e[60]=A):A=e[60],A}if(s){let A,B;if(e[61]!==V||e[62]!==Y||e[63]!==s||e[64]!==d||e[65]!==t.name||e[66]!==T.isPending||e[67]!==a){B=Symbol.for("react.early_return_sentinel");e:if(A=Te(s),!A.ok){const ze=`A configuração de commerce continuará em ${t.name}.`;let le;e[70]!==ze?(le=n.jsx(X,{title:"Diagnóstico de commerce",description:ze}),e[70]=ze,e[71]=le):le=e[71];const De=n.jsx(xe,{message:dt(A.error)});let ce;e[72]!==Y||e[73]!==d||e[74]!==T.isPending||e[75]!==a?(ce=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[72]=Y,e[73]=d,e[74]=T.isPending,e[75]=a,e[76]=ce):ce=e[76];let de;e[77]!==le||e[78]!==De||e[79]!==ce?(de=n.jsxs("div",{className:"grid gap-10",children:[le,De,ce]}),e[77]=le,e[78]=De,e[79]=ce,e[80]=de):de=e[80];let _e;e[81]!==V||e[82]!==de?(_e=n.jsx(Q,{visual:V,children:de}),e[81]=V,e[82]=de,e[83]=_e):_e=e[83],B=_e;break e}e[61]=V,e[62]=Y,e[63]=s,e[64]=d,e[65]=t.name,e[66]=T.isPending,e[67]=a,e[68]=A,e[69]=B}else A=e[68],B=e[69];if(B!==Symbol.for("react.early_return_sentinel"))return B;const Le=`O Commerce Discovery está sendo preparado para ${A.value}.`;let oe;e[84]!==Le?(oe=n.jsx(X,{title:"Diagnóstico de commerce",description:Le}),e[84]=Le,e[85]=oe):oe=e[85];let re;e[86]!==Y||e[87]!==d||e[88]!==T.isPending||e[89]!==a?(re=d?n.jsxs(n.Fragment,{children:[n.jsx(xe,{message:d}),n.jsx(Me,{siteUrl:a,error:null,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y})]}):n.jsx(nt,{}),e[86]=Y,e[87]=d,e[88]=T.isPending,e[89]=a,e[90]=re):re=e[90];let ae;e[91]!==oe||e[92]!==re||e[93]!==Re?(ae=n.jsxs("div",{ref:Re,className:"grid gap-10",children:[oe,re]}),e[91]=oe,e[92]=re,e[93]=Re,e[94]=ae):ae=e[94];let Ne;return e[95]!==V||e[96]!==ae?(Ne=n.jsx(Q,{visual:V,children:ae}),e[95]=V,e[96]=ae,e[97]=Ne):Ne=e[97],Ne}const $e=`A configuração de commerce continuará em ${t.name}.`;let ne;e[98]!==$e?(ne=n.jsx(X,{title:"Diagnóstico de commerce",description:$e}),e[98]=$e,e[99]=ne):ne=e[99];let se;e[100]!==Y||e[101]!==d||e[102]!==T.isPending||e[103]!==a?(se=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[100]=Y,e[101]=d,e[102]=T.isPending,e[103]=a,e[104]=se):se=e[104];let ie;e[105]!==ne||e[106]!==se?(ie=n.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[105]=ne,e[106]=se,e[107]=ie):ie=e[107];let Se;return e[108]!==V||e[109]!==ie?(Se=n.jsx(Q,{visual:V,children:ie}),e[108]=V,e[109]=ie,e[110]=Se):Se=e[110],Se}function Me(i){const e=k.c(20),{siteUrl:t,error:s,isSubmitting:o,onSiteUrlChange:l,onSubmit:r}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=c):c=e[0];let a;e[1]!==l?(a=x=>l(x.target.value),e[1]=l,e[2]=a):a=e[2];const u=!!s;let f;e[3]!==o||e[4]!==t||e[5]!==a||e[6]!==u?(f=n.jsx(Ue,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:a,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=a,e[6]=u,e[7]=f):f=e[7];let p;e[8]!==s?(p=s?n.jsx(xe,{message:s}):null,e[8]=s,e[9]=p):p=e[9];let d;e[10]!==f||e[11]!==p?(d=n.jsxs("div",{className:"grid gap-2",children:[c,f,p]}),e[10]=f,e[11]=p,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ct,{size:16}),e[13]=h):h=e[13];let v;e[14]!==o?(v=n.jsxs(H,{type:"submit",size:"xl",className:"w-full",disabled:o,children:["Continuar",h]}),e[14]=o,e[15]=v):v=e[15];let j;return e[16]!==r||e[17]!==d||e[18]!==v?(j=n.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,v]}),e[16]=r,e[17]=d,e[18]=v,e[19]=j):j=e[19],j}function Ss(i){const e=k.c(26),{org:t,reportApp:s,onOpenReport:o,isSubmitting:l,error:r,meetingUrl:c,meetingVisual:a,siteUrl:u}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(X,{}),e[0]=f):f=e[0];let p;e[1]!==t||e[2]!==s.connectionId||e[3]!==u?(p=n.jsx(ss,{org:t,cdConnectionId:s.connectionId,siteUrl:u}),e[1]=t,e[2]=s.connectionId,e[3]=u,e[4]=p):p=e[4];let d;e[5]!==c?(d=n.jsx(cs,{className:"md:hidden",href:c}),e[5]=c,e[6]=d):d=e[6];let h;e[7]!==r?(h=r?n.jsx(xe,{message:r}):null,e[7]=r,e[8]=h):h=e[8];const v=l||!s.virtualMcpId,j=l?"Abrindo relatório...":"Ver relatório completo";let x;e[9]!==l?(x=l?null:n.jsx(Ct,{size:18}),e[9]=l,e[10]=x):x=e[10];let g;e[11]!==o||e[12]!==v||e[13]!==j||e[14]!==x?(g=n.jsxs(H,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:v,children:[j,x]}),e[11]=o,e[12]=v,e[13]=j,e[14]=x,e[15]=g):g=e[15];let m;e[16]!==d||e[17]!==h||e[18]!==g?(m=n.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,g]}),e[16]=d,e[17]=h,e[18]=g,e[19]=m):m=e[19];let b;e[20]!==p||e[21]!==m?(b=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,p,m]}),e[20]=p,e[21]=m,e[22]=b):b=e[22];let y;return e[23]!==a||e[24]!==b?(y=n.jsx(Q,{align:"fill",visual:a,children:b}),e[23]=a,e[24]=b,e[25]=y):y=e[25],y}function xe(i){const e=k.c(2),{message:t}=i;let s;return e[0]!==t?(s=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Ui as default};
@@ -1 +1 @@
1
- import{c as b,D as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-tHbNbVHJ.js";import{d as I,e as S,c as D,b as E,a as R}from"./dialog-DKiQlf0Y.js";import{S as _}from"./chat-context-C7e3nmPB.js";import{i as $}from"./ChevronUp-Cr2g1GDa.js";import{a as A}from"./Eye-B9uHZVsM.js";import{u as B}from"./studio-tools-Dd7dXWQL.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(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: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(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,D as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-BEjmlKPl.js";import{d as I,e as S,c as D,b as E,a as R}from"./dialog-Hh5ovGLY.js";import{S as _}from"./chat-context-CcIPgTva.js";import{i as $}from"./ChevronUp-C73sdCjg.js";import{a as A}from"./Eye-CmIsbgje.js";import{u as B}from"./studio-tools-E6eV6Arx.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(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: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(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 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,b1 as k,K as D,l as E,j as x}from"./index-tHbNbVHJ.js";import{u as K}from"./use-registry-connections-D7ZBIfwl.js";import{b as Q}from"./use-organization-settings-CLeV359D.js";import{S as w,e as F}from"./use-mcp-client-0BRd9S75.js";import{u as H}from"./useInfiniteQuery-jWCtindg.js";import{i as q,f as G}from"./extract-connection-data-C9MdxGy0.js";import{C as U}from"./card-ChgC15JC.js";import{I as V}from"./integration-icon-DOeD9Yy1.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 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=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 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,D as $,b1 as k,K as D,l as E,j as x}from"./index-BEjmlKPl.js";import{u as K}from"./use-registry-connections-JP-nn714.js";import{b as Q}from"./use-organization-settings-CyhRZcil.js";import{S as w,e as F}from"./use-mcp-client-DdEyuuWo.js";import{u as H}from"./useInfiniteQuery-Cm9C_gzI.js";import{i as q,f as G}from"./extract-connection-data-Dl7BC58q.js";import{C as U}from"./card-CYYTvdp-.js";import{I as V}from"./integration-icon-BubYo_JB.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 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=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 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};
@@ -0,0 +1 @@
1
+ import{o as fe,aF as Ie,b7 as Ae,s as le,aD as De,c as P,j as t,i as ge,B as E,r as G,l as je,D as J,q as $e,K as ne,b as Y,ab as ce,z as Pe,b8 as Oe,E as ze,e as Me,b9 as Ve,m as Ee,p as Ue,n as Fe,t as q,ba as Re}from"./index-BEjmlKPl.js";import{a as Le}from"./extract-connection-data-Dl7BC58q.js";import{E as ve}from"./empty-state-C5ufqcxL.js";import{E as Be,c as He,r as We,b as Xe,d as qe}from"./connection-form-helpers-Bjlqqa5J.js";import{c as Ge,S as Ke,V as Qe}from"./index-C5C-UKU4.js";import{u as be,T as Je}from"./index-BA1nWkqk.js";import{u as Ye}from"./use-members-BhBptkRX.js";import{A as Ze}from"./avatar-C765fdJ7.js";import{a as Ne,b as ye,u as et}from"./use-connection-DUBWvt9B.js";import{u as _e}from"./use-mcp-client-DdEyuuWo.js";import{a as tt}from"./use-mcp-tools-CgsqmnJG.js";import{a as st}from"./use-mcp-prompts-DqUyy9S8.js";import{i as nt,a as ot}from"./mcp-oauth-C9EbOVQM.js";import{I as oe}from"./integration-icon-BubYo_JB.js";import{s as it}from"./Plus-DaRhyqSH.js";import{z as at,C as rt,aj as lt,a8 as ct}from"./agent-icon-CDWUrKO6.js";import{a as Ce,s as dt}from"./Settings02-B1ys_QsX.js";import{s as ae}from"./Trash01-2mnBLeel.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-Dz5C6OGo.js";import{F as L,b as B,c as H,d as V,e as W,f as ft,a as gt}from"./form-vkZSNPAt.js";import{I as X}from"./input-Csk5e2yH.js";import{u as jt,D as vt}from"./use-delete-connection-oIOCPNow.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-ytgPYn-j.js";import{u as kt}from"./studio-tools-E6eV6Arx.js";import{u as Tt}from"./use-virtual-mcp-CytuWVRm.js";import{i as Se}from"./ChevronRight-_T91Ki1i.js";import{a as we}from"./Users03-CsRyhHB5.js";import{T as ee,a as It,b as te,c as At}from"./tabs-DCWgt9U2.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-CwzduoBx.js";import{c as $t}from"./Tool01-UFRB7Gn8.js";import{g as re,M as Pt}from"./types-Cpxi5nja.js";import{C as Ot}from"./collection-search-OPVOwF6w.js";import{C as zt}from"./card-CYYTvdp-.js";import{B as Mt}from"./badge-CgUoAb0G.js";import{D as Vt,a as Et,b as Ut,c as de}from"./dropdown-menu-CVNL6sbF.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select-f-UK5_IH.js";import{i as Ft}from"./CheckCircle-B6MW1yw_.js";import{t as Rt}from"./ChevronDown-C6GKFdlz.js";import{n as Lt}from"./XCircle-Cr_Uaxeq.js";import{s as se}from"./Star01-DPd1XEvi.js";import{s as Bt}from"./XClose-C6a8uvfS.js";import"./index-kmrmjjsI.js";import"./sidebar-CFbvOGM6.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./use-mobile-C7loFyQ0.js";import"./tooltip-vrtDbf-F.js";import"./ZoomOut-N-7VqfhT.js";import"./Key01--rf2r0q7.js";import"./auth-DnFlop4R.js";import"./use-registry-connections-JP-nn714.js";import"./use-organization-settings-CyhRZcil.js";import"./index-CYNIQ2LP.js";import"./index-b3uLeNQ7.js";import"./popover-CXYDmYeq.js";import"./ChevronUp-C73sdCjg.js";import"./SearchMd-TIrNRuOw.js";import"./use-create-virtual-mcp-hBSqW_CF.js";import"./use-navigate-to-agent-C3I5i4Gg.js";import"./Eye-CmIsbgje.js";import"./use-org-auth-client-B9guhhqA.js";import"./User01-D61Pj0Jp.js";import"./use-collections-DkNJNG6n.js";import"./AlertCircle-qsmFLzIS.js";import"./SwitchHorizontal01-BPwURr_K.js";import"./ArrowUpRight-yJehGCq_.js";import"./ChevronLeft-B_g3Odoj.js";import"./DotsVertical-BOTJmIm_.js";import"./Stars02-BBfjmRkO.js";import"./Globe01-jb99gJfY.js";import"./FilterLines-Br0k3Gt9.js";import"./Globe04-BoJpZpky.js";import"./HardDrive-tK8cadSs.js";import"./LinkExternal01-DgKre-XN.js";import"./Monitor01-DLOF_NPZ.js";import"./Sun-D1BAkaT6.js";import"./Palette-B13aA9KG.js";import"./Play-CAoWwsoA.js";import"./SearchLg-C7PlcyS-.js";import"./Shield01-cnNeKMKA.js";import"./Stars01-CFQgPhA5.js";import"./Upload01-BxxwdIAZ.js";import"./Users01-enhuFvLY.js";import"./X-D_jt_5zi.js";import"./Zap-CkUSEY1J.js";import"./label-P9D2uSqZ.js";import"./alert-dialog-DwrOZyIa.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(E,{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(E,{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(E,{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(E,{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(E,{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 qt(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(E,{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 Gt(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(E,{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(G.Suspense,{fallback:t.jsx(qt,{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]=G.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(G.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]=G.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(V,{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(V,{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(V,{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(V,{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(V,{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(V,{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(V,{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(V,{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(Vt,{children:[t.jsx(Et,{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(V,{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=qe(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=Ee(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.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=Ge(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){q.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()}),q.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();q.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)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.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(V,{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(V,{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(E,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(E,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(E,{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(Gt,{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}}),q.success(D==="active"?"Connection enabled":"Connection disabled")}catch{q.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}=Ve(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(E,{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(G.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 ro(){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{ro as default};
@@ -1 +1 @@
1
- import{o as R,aF as A,b7 as I,s as a,aD as j,aE as z,c as L,j as u,B as C}from"./index-tHbNbVHJ.js";import{I as H}from"./input-C1uF2dQ1.js";import{s as W}from"./Plus-rHk0VScG.js";import{s as q}from"./Trash01-BrvLbqQk.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:j(K).optional(),configuration_scopes:j(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 S=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(C,{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]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,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};
1
+ import{o as R,aF as A,b7 as I,s as a,aD as j,aE as z,c as L,j as u,B as C}from"./index-BEjmlKPl.js";import{I as H}from"./input-Csk5e2yH.js";import{s as W}from"./Plus-DaRhyqSH.js";import{s as q}from"./Trash01-2mnBLeel.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:j(K).optional(),configuration_scopes:j(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 S=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(C,{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]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,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};
@@ -0,0 +1 @@
1
+ import{r as E,c as oe,j as t,E as Ye,i as ce,D as be,b as _e,u as Ze,a as Ne,z as et,C as tt,L as nt,p as st,n as ot,B as U,w as te,m as it,l as de,t as W,K as rt}from"./index-BEjmlKPl.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-Dl7BC58q.js";import{C as dt}from"./collection-display-button-D-VHSw0A.js";import{S as mt}from"./search-input-Cec8OPCx.js";import{C as ut}from"./collection-tabs-CRf8Ijmq.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-DQuoMZlF.js";import{E as gt}from"./empty-state-C5ufqcxL.js";import{I as xt}from"./integration-icon-BubYo_JB.js";import{P as ue}from"./index-kmrmjjsI.js";import{u as ft,D as jt}from"./use-delete-connection-oIOCPNow.js";import{u as ye}from"./use-capability-BF81OxAF.js";import{u as yt}from"./use-infinite-scroll-DUbloeNA.js";import{u as Ct}from"./use-view-mode-CsrgTSxk.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-DwrOZyIa.js";import{C as Fe}from"./checkbox-D9k8y94F.js";import{a as ze,b as Me,c as Ve,d as Ee,e as Be,D as Ke}from"./dialog-Hh5ovGLY.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-SgGGijSm.js";import{u as At}from"./use-mobile-C7loFyQ0.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-CVNL6sbF.js";import{F as Q,b as J,c as Y,d as Z,e as ee,a as ve}from"./form-vkZSNPAt.js";import{I as ie}from"./input-Csk5e2yH.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-f-UK5_IH.js";import{T as $t}from"./textarea-cMx1Sjw5.js";import{b as We,u as Lt}from"./use-connection-DUBWvt9B.js";import{u as Ot}from"./use-virtual-mcp-CytuWVRm.js";import{u as Ft}from"./studio-tools-E6eV6Arx.js";import{a8 as zt,ai as Mt,C as Vt,z as Et}from"./agent-icon-CDWUrKO6.js";import{n as ge}from"./XCircle-Cr_Uaxeq.js";import{a as Xe}from"./DotsVertical-BOTJmIm_.js";import{s as qe}from"./Eye-CmIsbgje.js";import{s as je}from"./Star01-DPd1XEvi.js";import{s as Ge}from"./Plus-DaRhyqSH.js";import{s as Qe}from"./Trash01-2mnBLeel.js";import{s as Je}from"./XClose-C6a8uvfS.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-Bjlqqa5J.js";import{a as Wt}from"./authenticate-and-persist-oauth-7MZHsMGS.js";import"./use-mcp-client-DdEyuuWo.js";import"./auth-DnFlop4R.js";import"./SwitchHorizontal01-BPwURr_K.js";import"./ChevronUp-C73sdCjg.js";import"./tooltip-vrtDbf-F.js";import"./view-mode-toggle-B0C659uf.js";import"./badge-CgUoAb0G.js";import"./SearchMd-TIrNRuOw.js";import"./use-registry-connections-JP-nn714.js";import"./use-organization-settings-CyhRZcil.js";import"./useInfiniteQuery-Cm9C_gzI.js";import"./card-CYYTvdp-.js";import"./sidebar-CFbvOGM6.js";import"./LayoutLeft-Dpq1l3Cs.js";import"./sheet-Dz5C6OGo.js";import"./X-D_jt_5zi.js";import"./ChevronRight-_T91Ki1i.js";import"./label-P9D2uSqZ.js";import"./ChevronDown-C6GKFdlz.js";import"./use-collections-DkNJNG6n.js";import"./AlertCircle-qsmFLzIS.js";import"./Tool01-UFRB7Gn8.js";import"./Settings02-B1ys_QsX.js";import"./ArrowUpRight-yJehGCq_.js";import"./ZapSquare-CwzduoBx.js";import"./Users03-CsRyhHB5.js";import"./CheckCircle-B6MW1yw_.js";import"./ChevronLeft-B_g3Odoj.js";import"./Stars02-BBfjmRkO.js";import"./ZoomOut-N-7VqfhT.js";import"./Globe01-jb99gJfY.js";import"./FilterLines-Br0k3Gt9.js";import"./Globe04-BoJpZpky.js";import"./HardDrive-tK8cadSs.js";import"./Key01--rf2r0q7.js";import"./LinkExternal01-DgKre-XN.js";import"./Monitor01-DLOF_NPZ.js";import"./Sun-D1BAkaT6.js";import"./Palette-B13aA9KG.js";import"./Play-CAoWwsoA.js";import"./SearchLg-C7PlcyS-.js";import"./Shield01-cnNeKMKA.js";import"./Stars01-CFQgPhA5.js";import"./Upload01-BxxwdIAZ.js";import"./User01-D61Pj0Jp.js";import"./Users01-enhuFvLY.js";import"./Zap-CkUSEY1J.js";import"./mcp-oauth-C9EbOVQM.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:z,sortDirection:w,handleSort:P}=qt(i),M=z;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==M||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:M,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=M,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let z;e[38]!==A?(z=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=z):z=e[39];let w;e[40]!==O||e[41]!==z?(w=t.jsx("div",{className:O,children:z}),e[40]=O,e[41]=z,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let M;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(M=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=M):M=e[50],M}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(ze,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const z=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==z||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{z?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=z,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let M;e[23]!==n||e[24]!==h||e[25]!==N?(M=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=M):M=e[26];const C=M;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==z||e[33]!==n._sourceIcon?(H=z&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=z,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),z=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),M=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=z.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:z,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:M},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?M(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>M(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),M(d.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),F=s.watch("connection_url"),z=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:z??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",M=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:M,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(ze,{open:B,onOpenChange:G,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:c=>b(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Ms(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Ms as default};