decocms 4.29.0 → 4.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/client/assets/{AlertCircle-CccbK4hX.js → AlertCircle-Npyn4_wF.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BgdgTW8q.js → ArrowUpRight-zXVQKR-G.js} +1 -1
  3. package/dist/client/assets/{Check-WJIsHzDQ.js → Check-BxViL4rK.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CM68yWPW.js → CheckCircle-Cz4tJUop.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CAuaRLDM.js → ChevronDown-UniVHOcZ.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-B7czck1y.js → ChevronRight-K3Ms28jw.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-D-qnR_uM.js → ChevronUp-C_JF1YJx.js} +1 -1
  8. package/dist/client/assets/{Circle-KYXNByEA.js → Circle-iQbOlvwS.js} +1 -1
  9. package/dist/client/assets/{Copy01-gjq995Op.js → Copy01-Ctt9FUbb.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BVo4MRpu.js → DotsVertical-Cnet9a8h.js} +1 -1
  11. package/dist/client/assets/{Eye-Bn25ApPz.js → Eye-Bf8ySHj2.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DaZCku74.js → FilterLines-DRa15Wby.js} +1 -1
  13. package/dist/client/assets/{Globe01-BwRmuR_8.js → Globe01-BCgVxayg.js} +1 -1
  14. package/dist/client/assets/{Globe04-9qIG4QhN.js → Globe04-BRhMXMEJ.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BJOyfL1s.js → HardDrive-BaaJKDpq.js} +1 -1
  16. package/dist/client/assets/{Key01-CDa-PA-y.js → Key01-BvoJKmt1.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DNsGMIFw.js → LayoutLeft-Bsqu0rxT.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-B-q2TCWq.js → LinkExternal01-bFRmolQv.js} +1 -1
  19. package/dist/client/assets/{List-CDS_Rmur.js → List-FyDw_upy.js} +1 -1
  20. package/dist/client/assets/{Loading02-Cv_WFApk.js → Loading02-wU_DDeXK.js} +1 -1
  21. package/dist/client/assets/{Monitor01-ChrDLGXa.js → Monitor01-rM21B5VM.js} +1 -1
  22. package/dist/client/assets/{Palette-CqqDm4G9.js → Palette-Bq3VPed6.js} +1 -1
  23. package/dist/client/assets/{Play-BLXO22JW.js → Play-Dqv3vBUr.js} +1 -1
  24. package/dist/client/assets/{Plus-CoqGiEoW.js → Plus-CIMT0C1M.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BJoMxiDy.js → SearchLg-BqF-kB3a.js} +1 -1
  26. package/dist/client/assets/{SearchMd-YxzpYnNt.js → SearchMd-OCIrtgl8.js} +1 -1
  27. package/dist/client/assets/{Settings02-Dy5hRJWC.js → Settings02-CTtq6YOs.js} +1 -1
  28. package/dist/client/assets/{Shield01-Dg-emZom.js → Shield01-CCAMun7k.js} +1 -1
  29. package/dist/client/assets/{Star01-Bbn22eVo.js → Star01-Cw7wbAha.js} +1 -1
  30. package/dist/client/assets/{Stars01-0N0PIoFw.js → Stars01-CXkCYhyc.js} +1 -1
  31. package/dist/client/assets/{Stars02-XLaFEqA9.js → Stars02-C6DKWb0j.js} +1 -1
  32. package/dist/client/assets/{Sun-Cf2_RQhM.js → Sun-Cfq43Fjh.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-8YfzWW4j.js → SwitchHorizontal01-BSEQu0PJ.js} +1 -1
  34. package/dist/client/assets/{Tool01-CExdAfac.js → Tool01-woqhmM89.js} +1 -1
  35. package/dist/client/assets/{Trash01-2bgd5rb5.js → Trash01-DSTcxy5m.js} +1 -1
  36. package/dist/client/assets/{Upload01-Da0GcY9n.js → Upload01-DI1Xs1Z6.js} +1 -1
  37. package/dist/client/assets/{User01-DWmqguL8.js → User01-D-uDYDK0.js} +1 -1
  38. package/dist/client/assets/{Users01-qo0Pfdbq.js → Users01-DVmsZOTe.js} +1 -1
  39. package/dist/client/assets/{Users03-m0mGCSLF.js → Users03-DGDUIZF4.js} +1 -1
  40. package/dist/client/assets/{X-dW9CI9iO.js → X-DWrz2LqH.js} +1 -1
  41. package/dist/client/assets/{XCircle-BLHWvvQb.js → XCircle-JQbz9WmR.js} +1 -1
  42. package/dist/client/assets/{XClose-BsCsQOzu.js → XClose-CBrgKiaB.js} +1 -1
  43. package/dist/client/assets/{Zap-NxwXfCyT.js → Zap-NoORqLvM.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-BllWW0jW.js → ZapSquare-RhqrJVTN.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-6KFj5qIF.js → ZoomOut-nih9dlzQ.js} +1 -1
  46. package/dist/client/assets/{access-gate-uhjaq2Ab.js → access-gate-DW0Ym0X9.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-WZYG5Z6d.js → add-section-modal-DgeyNgVY.js} +1 -1
  48. package/dist/client/assets/agent-capabilities-0FR5de0y.js +1 -0
  49. package/dist/client/assets/agent-icon-32aZu8f8.js +1 -0
  50. package/dist/client/assets/agents-list-C1UtH2E7.js +1 -0
  51. package/dist/client/assets/ai-providers-CNHaz-V2.js +1 -0
  52. package/dist/client/assets/{alert-ovMRS5yx.js → alert-D0cE0bpw.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DT6CiV3D.js → alert-dialog-DBrNjdaV.js} +3 -3
  54. package/dist/client/assets/app-editor-DVKTcnpY.js +1 -0
  55. package/dist/client/assets/{auth-D-3BenR-.js → auth-C9k5QFmE.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-1c9sE0Q2.js → auth-catchall-EFYsuYup.js} +1 -1
  57. package/dist/client/assets/{auth-entry-CiJUVGSj.js → auth-entry-B7dEi3i4.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-RqSEL3ko.js → auth-split-layout-DAa980Aa.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-cOkcseWI.js → authenticate-and-persist-oauth-Dji-Zkvk.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-DNZxP8s9.js → automation-list-row-DjnykZrH.js} +1 -1
  61. package/dist/client/assets/automation-runs-CyeVpPEA.js +188 -0
  62. package/dist/client/assets/automations-BRVTy0px.js +1 -0
  63. package/dist/client/assets/autosend-Lnw286aO.js +1 -0
  64. package/dist/client/assets/{avatar-D9dkHpvf.js → avatar-CVASN_n8.js} +1 -1
  65. package/dist/client/assets/{badge-C9YrQiOl.js → badge-DN1YW5R1.js} +1 -1
  66. package/dist/client/assets/{block-document-B3VgVdww.js → block-document-BMOnFuNo.js} +3 -3
  67. package/dist/client/assets/brand-context-BYp2uUo_.js +1 -0
  68. package/dist/client/assets/{breadcrumb-Bt63ruK5.js → breadcrumb-BylJDyxL.js} +1 -1
  69. package/dist/client/assets/buckets-ztIgzEwa.js +1 -0
  70. package/dist/client/assets/bulk-category-panel-D7ZYmK1J.js +1 -0
  71. package/dist/client/assets/{calendar-CVkRKG_3.js → calendar-ChXBpAOM.js} +1 -1
  72. package/dist/client/assets/capability-load-error-O4BtnIVr.js +1 -0
  73. package/dist/client/assets/{card-WdSE0wjZ.js → card-BYZEQBt8.js} +1 -1
  74. package/dist/client/assets/category-editor-C-eV-FDB.js +1 -0
  75. package/dist/client/assets/{chat-context-p7bQrjVO.js → chat-context-CCC-Byca.js} +5 -5
  76. package/dist/client/assets/{checkbox-Cf98ydrt.js → checkbox-C2WVbLnG.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-CDfqoEnc.js → cli-auth-success-D7EMTP4Y.js} +1 -1
  78. package/dist/client/assets/collection-detail-CKc7ZkK-.js +1 -0
  79. package/dist/client/assets/{collection-display-button-DhAisvln.js → collection-display-button-oZx_AhoK.js} +1 -1
  80. package/dist/client/assets/{collection-search-CwfTIp5v.js → collection-search-i90jdNni.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-1Z0s75jM.js → collection-table-wrapper-BkqcRITg.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-byFj2Ujd.js → collection-tabs-Bg1zR32u.js} +1 -1
  83. package/dist/client/assets/{command-Be3tajRL.js → command-D8e2ttGg.js} +1 -1
  84. package/dist/client/assets/commerce-onboarding-CUg63DGD.js +1 -0
  85. package/dist/client/assets/{connect-desktop-dialog-Af91UVe4.js → connect-desktop-dialog-CdtfQBg4.js} +1 -1
  86. package/dist/client/assets/{connection-card-CrmcBQ7w.js → connection-card-DGWh0T1M.js} +1 -1
  87. package/dist/client/assets/connection-detail-DG_Kwvgf.js +1 -0
  88. package/dist/client/assets/{connection-form-helpers-BEquM1Ke.js → connection-form-helpers-CvE1GCwU.js} +1 -1
  89. package/dist/client/assets/connections-CSSk2Lo7.js +1 -0
  90. package/dist/client/assets/constants-B72Xmt_K.js +1 -0
  91. package/dist/client/assets/{decopilot-sse-pool-wsz4kVX9.js → decopilot-sse-pool-CYJNLSex.js} +1 -1
  92. package/dist/client/assets/{dialog-DTR6Ld8R.js → dialog-wZUkxFBf.js} +1 -1
  93. package/dist/client/assets/{domain-settings-VmE96-t6.js → domain-settings-C-ClIsNf.js} +1 -1
  94. package/dist/client/assets/{drawer-tKmBK0sh.js → drawer-N4BBUwV9.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-D5GBwmj-.js → dropdown-menu-COQWVmxy.js} +1 -1
  96. package/dist/client/assets/{empty-state-Drp2V-gT.js → empty-state-BdREyKTx.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-hbWCHJzS.js → extract-connection-data-CguvuV8x.js} +1 -1
  98. package/dist/client/assets/file-explorer-DLrJ1FmW.js +2 -0
  99. package/dist/client/assets/{file-type-icon-ByfDUgJ1.js → file-type-icon-BEeYBjMh.js} +1 -1
  100. package/dist/client/assets/{files-CTG0VhhM.js → files-OSCRmAjy.js} +1 -1
  101. package/dist/client/assets/{form-Bdg2md6z.js → form-D4Sjj2S5.js} +1 -1
  102. package/dist/client/assets/general-EnRn7dAf.js +1 -0
  103. package/dist/client/assets/get-initials-D-f_fDFw.js +1 -0
  104. package/dist/client/assets/github-repo-picker-pjUsTLC6.js +1 -0
  105. package/dist/client/assets/{hooks-355Y2AQ-.js → hooks-RNhoO-Id.js} +6 -6
  106. package/dist/client/assets/{index-Fc19vagy.js → index-4ttWqKAk.js} +1 -1
  107. package/dist/client/assets/{index-Cg7efYOu.js → index-BGWTtZfz.js} +3 -3
  108. package/dist/client/assets/index-BYSbf1og.css +1 -0
  109. package/dist/client/assets/{index-D_fQ3aMM.js → index-BjUL_v0d.js} +1 -1
  110. package/dist/client/assets/index-C3s6kNZf.js +1 -0
  111. package/dist/client/assets/{index-C4qtLNrN.js → index-D6_eTKF9.js} +1 -1
  112. package/dist/client/assets/index-D8BXYXaV.js +1 -0
  113. package/dist/client/assets/index-DJ-AVzEz.js +519 -0
  114. package/dist/client/assets/{index-thaZU0eY.js → index-DcsErluY.js} +4 -4
  115. package/dist/client/assets/{index-ceQxuMuP.js → index-E0XzXtgq.js} +1 -1
  116. package/dist/client/assets/index-HmjC0l60.js +1 -0
  117. package/dist/client/assets/{index-Kblv4kfs.js → index-NrynAfgx.js} +3 -3
  118. package/dist/client/assets/{index-CbcN0I3P.js → index-Q0mE9w5a.js} +3 -3
  119. package/dist/client/assets/{index-BlDaAy7Z.js → index-etRGW8hR.js} +1 -1
  120. package/dist/client/assets/{index-redirect-BkSJGF9m.js → index-redirect-CtWijNin.js} +1 -1
  121. package/dist/client/assets/{index-Ci3919Ge.js → index-tYXe55yO.js} +1 -1
  122. package/dist/client/assets/{input-DEr8h15j.js → input-BLUXQaUJ.js} +1 -1
  123. package/dist/client/assets/{integration-icon-zZ56Ie6s.js → integration-icon-BJkk8MWl.js} +1 -1
  124. package/dist/client/assets/{invite-member-dialog-QdQZxiP_.js → invite-member-dialog-CzBp_hgb.js} +2 -2
  125. package/dist/client/assets/{label-D9vlZKHj.js → label-CW0QYigh.js} +1 -1
  126. package/dist/client/assets/{login-QcZ5VwBL.js → login-BzT7SutG.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-HycnBVan.js → mcp-oauth-DkjiGs3f.js} +1 -1
  128. package/dist/client/assets/members-B-nTZKqd.js +1 -0
  129. package/dist/client/assets/monaco-editor-CxptfxHs.js +9 -0
  130. package/dist/client/assets/{monitoring-stats-row-CLjCs61g.js → monitoring-stats-row-BCom1l-r.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-DmZkA-1Y.js → oauth-callback-BrnloLXP.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-qrMHndxu.js → oauth-callback-ai-provider-Gf3ErLGK.js} +1 -1
  133. package/dist/client/assets/{onboarding-D8Oj280h.js → onboarding-Bijoo7hh.js} +1 -1
  134. package/dist/client/assets/org-install-0y09LTw4.js +1 -0
  135. package/dist/client/assets/{org-layout-BdivmG72.js → org-layout-BnSZ4nrA.js} +1 -1
  136. package/dist/client/assets/{organization-choice-CNTMS9Qo.js → organization-choice-B0E5mbjx.js} +1 -1
  137. package/dist/client/assets/page-seo-form-Bgz7kJhB.js +1 -0
  138. package/dist/client/assets/page-seo-sheet-Ct29Vhus.js +1 -0
  139. package/dist/client/assets/{popover-BH74zFmN.js → popover-jVjMjIDj.js} +1 -1
  140. package/dist/client/assets/post-editor-BfRHhvGn.js +1 -0
  141. package/dist/client/assets/primitives-DaPu5vgv.js +1 -0
  142. package/dist/client/assets/profile-DclYxTny.js +1 -0
  143. package/dist/client/assets/project-app-view-BQBZobZ4.js +1 -0
  144. package/dist/client/assets/record-editor-BX1EoYMz.js +1 -0
  145. package/dist/client/assets/registry-BdbdSSDR.js +2 -0
  146. package/dist/client/assets/{registry-layout-BdxpZi19.js → registry-layout-BUFv94Wc.js} +1 -1
  147. package/dist/client/assets/{require-capability-bBFf7mtX.js → require-capability-gZyrOy_G.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DiYJUK17.js → required-auth-layout-CCig7BsQ.js} +1 -1
  149. package/dist/client/assets/{reset-password-Ws1sdfXL.js → reset-password-A6TbChyi.js} +1 -1
  150. package/dist/client/assets/reusable-new-chat-qqWu133U.js +1 -0
  151. package/dist/client/assets/roles-BW9vWvMW.js +1 -0
  152. package/dist/client/assets/{search-input-DLqCE5vh.js → search-input-5RFJsKB6.js} +1 -1
  153. package/dist/client/assets/secrets-T5w0qVnI.js +1 -0
  154. package/dist/client/assets/sections-editor-1RxueHws.js +2 -0
  155. package/dist/client/assets/{select-fd5CQiLd.js → select-GP-G7CYY.js} +1 -1
  156. package/dist/client/assets/select-model-Hh0vuEIf.js +4 -0
  157. package/dist/client/assets/seo-editor-BOaZSdYe.js +1 -0
  158. package/dist/client/assets/settings-layout-CQB5hLJw.js +1 -0
  159. package/dist/client/assets/{settings-section-C4B_agjR.js → settings-section-BN93dKeu.js} +1 -1
  160. package/dist/client/assets/shell-controls-Tu95tJS5.js +1 -0
  161. package/dist/client/assets/shell-layout-BktipYXq.js +1 -0
  162. package/dist/client/assets/sidebar-BjPm3XPY.js +1 -0
  163. package/dist/client/assets/{skeleton-Cz4bac5f.js → skeleton-CXWh_vT2.js} +1 -1
  164. package/dist/client/assets/sso-B36X_9Kv.js +1 -0
  165. package/dist/client/assets/store-Lh1RLabm.js +1 -0
  166. package/dist/client/assets/store-registry-CZQ9oZKe.js +2 -0
  167. package/dist/client/assets/{studio-tools-C88q8wAb.js → studio-tools-ajGrecV2.js} +1 -1
  168. package/dist/client/assets/{switch-Dg1aulpi.js → switch-C6ORwIf0.js} +1 -1
  169. package/dist/client/assets/tab-id-yjGvxWDL.js +1 -0
  170. package/dist/client/assets/{table-Z9PtYtMe.js → table-DyVNd3lx.js} +1 -1
  171. package/dist/client/assets/{tabs-BJWmaLw8.js → tabs-BbeJw3E0.js} +1 -1
  172. package/dist/client/assets/{textarea-DEWiELfd.js → textarea-CjjAiaC_.js} +1 -1
  173. package/dist/client/assets/{toggle-group-CvC6sjCU.js → toggle-group-CBKef6if.js} +1 -1
  174. package/dist/client/assets/toolbar-BS4jP5VP.js +1 -0
  175. package/dist/client/assets/{toolbar-icon-button-b0ekhhMY.js → toolbar-icon-button-aR9nKvjU.js} +1 -1
  176. package/dist/client/assets/tools-list-yY8qipR7.js +1 -0
  177. package/dist/client/assets/tooltip-CX8JDN5z.js +1 -0
  178. package/dist/client/assets/{types-BL5SG5y5.js → types-B4pxnIIx.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-C9ok3iTv.js → use-ai-providers-BFYpQ3Dm.js} +1 -1
  180. package/dist/client/assets/{use-automations-BGAQUfh0.js → use-automations-D2Y3aBGO.js} +1 -1
  181. package/dist/client/assets/{use-capability-DUO16Em8.js → use-capability-rVzvcxKr.js} +1 -1
  182. package/dist/client/assets/use-clock-tick-BZ0iPGQL.js +1 -0
  183. package/dist/client/assets/use-collections-Dkob9Q0i.js +1 -0
  184. package/dist/client/assets/{use-connection-DV6jfeKV.js → use-connection-BHlBIpYJ.js} +1 -1
  185. package/dist/client/assets/{use-copy--Yb2hvIV.js → use-copy-CQkPNAJi.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-BRs1YEXm.js → use-create-virtual-mcp-Cpq2-1Qg.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-B2imKI8J.js → use-debounced-autosave-C0n83t9Y.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-Dk3ZHqhr.js → use-debounced-value-HI4UvLEV.js} +1 -1
  189. package/dist/client/assets/{use-decopilot-events-CdGe1kZY.js → use-decopilot-events-qPFbeAuK.js} +1 -1
  190. package/dist/client/assets/{use-delete-connection-YECi64fi.js → use-delete-connection-Pr4HXWhs.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-D99FvcSf.js → use-file-configs-Bwgj83CL.js} +1 -1
  192. package/dist/client/assets/use-infinite-scroll-gRuFiDfW.js +1 -0
  193. package/dist/client/assets/{use-join-requests-KOCEnQ4v.js → use-join-requests-qOUGOtoj.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-B7zSFiOA.js → use-mcp-client-x-H3hM3X.js} +2 -2
  195. package/dist/client/assets/{use-mcp-prompts-BMNQ61Xi.js → use-mcp-prompts-CB2--qfn.js} +1 -1
  196. package/dist/client/assets/use-mcp-tools-BAOkrTmg.js +1 -0
  197. package/dist/client/assets/{use-members-ItYzCRBH.js → use-members-BAUKU0t0.js} +1 -1
  198. package/dist/client/assets/{use-mobile-B23FisN_.js → use-mobile-BNK4ZQXQ.js} +1 -1
  199. package/dist/client/assets/use-navigate-to-agent-B2zjxakj.js +1 -0
  200. package/dist/client/assets/{use-org-auth-client-CW518BNQ.js → use-org-auth-client-CT6ie6N1.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-BCol3dQF.js → use-org-sso-DIb9lRy0.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-DCgs3HLS.js → use-organization-roles-bMxDWnEc.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-CtWuj0-0.js → use-organization-settings-QG8fys4M.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-BfySsVRx.js → use-registry-connections-BvC5yqnv.js} +1 -1
  205. package/dist/client/assets/{use-secrets-KLMNhfAU.js → use-secrets-BUi_Va3F.js} +1 -1
  206. package/dist/client/assets/use-status-sounds-DV61EqQ3.js +1 -0
  207. package/dist/client/assets/{use-view-mode-DMcqNC4z.js → use-view-mode-BaQ_SNlr.js} +1 -1
  208. package/dist/client/assets/use-virtual-mcp-zN_q3qUT.js +1 -0
  209. package/dist/client/assets/useInfiniteQuery-W1abYeKO.js +1 -0
  210. package/dist/client/assets/useSuspenseInfiniteQuery-DTvKBZgn.js +1 -0
  211. package/dist/client/assets/variant-calendar-N7_o0k3x.js +1 -0
  212. package/dist/client/assets/{view-mode-toggle-oOb_3dux.js → view-mode-toggle-RdEYDkk_.js} +1 -1
  213. package/dist/client/index.html +2 -2
  214. package/dist/server/cli.js +313 -299
  215. package/dist/server/server.js +3 -3
  216. package/package.json +1 -1
  217. package/dist/client/assets/agent-capabilities-CUZgw2cK.js +0 -1
  218. package/dist/client/assets/agent-icon-8-zG6zq2.js +0 -1
  219. package/dist/client/assets/agents-list-NUEvPqtn.js +0 -1
  220. package/dist/client/assets/ai-providers-BdzkA6Ng.js +0 -1
  221. package/dist/client/assets/app-editor-DejM0aC5.js +0 -1
  222. package/dist/client/assets/automation-runs-DHORxp2E.js +0 -1
  223. package/dist/client/assets/automations-iHJIY2kp.js +0 -1
  224. package/dist/client/assets/brand-context-IlEjmRnX.js +0 -1
  225. package/dist/client/assets/buckets-DMOBdFu1.js +0 -1
  226. package/dist/client/assets/bulk-category-panel-BZWcVa6f.js +0 -1
  227. package/dist/client/assets/capability-load-error-mGRKLuE9.js +0 -1
  228. package/dist/client/assets/category-editor-B3O-6esM.js +0 -1
  229. package/dist/client/assets/collection-detail-Bb_s_e4f.js +0 -1
  230. package/dist/client/assets/commerce-onboarding-CeoQUmzc.js +0 -1
  231. package/dist/client/assets/connection-detail-ox7hONrA.js +0 -1
  232. package/dist/client/assets/connections-51GGeElE.js +0 -1
  233. package/dist/client/assets/constants-nH3qQ_1f.js +0 -1
  234. package/dist/client/assets/content-blocks-o63cs2vh.js +0 -1
  235. package/dist/client/assets/decopilot-Dj817txh.js +0 -4
  236. package/dist/client/assets/file-explorer-C432wWS3.js +0 -2
  237. package/dist/client/assets/general-DivwX3J2.js +0 -1
  238. package/dist/client/assets/github-repo-picker-BxPl8GNJ.js +0 -1
  239. package/dist/client/assets/index-5uzKO7q6.css +0 -1
  240. package/dist/client/assets/index-CwBtGV9W.js +0 -1
  241. package/dist/client/assets/index-DEtQBmLd.js +0 -1
  242. package/dist/client/assets/index-J9x3nT2B.js +0 -1
  243. package/dist/client/assets/index-OMZJdpqB.js +0 -513
  244. package/dist/client/assets/library-tab-dvlvVDBE.js +0 -7
  245. package/dist/client/assets/members-CKTHo3ec.js +0 -1
  246. package/dist/client/assets/monaco-editor-BfF7h5UL.js +0 -9
  247. package/dist/client/assets/org-install-LOUQXIPf.js +0 -1
  248. package/dist/client/assets/page-seo-form-W66oNzJN.js +0 -1
  249. package/dist/client/assets/page-seo-sheet-DQCQahYb.js +0 -1
  250. package/dist/client/assets/post-editor-BBupRkar.js +0 -1
  251. package/dist/client/assets/primitives-DCgBLYjb.js +0 -1
  252. package/dist/client/assets/profile-BCEngRby.js +0 -1
  253. package/dist/client/assets/project-app-view-BcPFuDsb.js +0 -1
  254. package/dist/client/assets/record-editor-IbXR53df.js +0 -1
  255. package/dist/client/assets/registry-C4jGqOi2.js +0 -2
  256. package/dist/client/assets/roles-B2mvqEQY.js +0 -1
  257. package/dist/client/assets/scroll-area-urNhBz-2.js +0 -188
  258. package/dist/client/assets/secrets-CxNuqWmn.js +0 -1
  259. package/dist/client/assets/sections-editor-D1IVqSOH.js +0 -2
  260. package/dist/client/assets/select-model-lznBUFcI.js +0 -1
  261. package/dist/client/assets/seo-editor-CU14ORD4.js +0 -1
  262. package/dist/client/assets/settings-layout-CX96yOJ5.js +0 -1
  263. package/dist/client/assets/sheet-C-KllyIc.js +0 -1
  264. package/dist/client/assets/shell-controls-BQwbtCrf.js +0 -1
  265. package/dist/client/assets/shell-layout-BnoAEqpd.js +0 -1
  266. package/dist/client/assets/sidebar-DSPYyChk.js +0 -1
  267. package/dist/client/assets/sso-DPkIABsj.js +0 -1
  268. package/dist/client/assets/store-C2QekUWt.js +0 -1
  269. package/dist/client/assets/store-registry-Da4NJevx.js +0 -2
  270. package/dist/client/assets/tab-id-Bgchl1bv.js +0 -1
  271. package/dist/client/assets/task-row-BPMcTFbK.js +0 -1
  272. package/dist/client/assets/task-status-pzbr--Ml.js +0 -1
  273. package/dist/client/assets/toolbar-Cs8I9yhI.js +0 -1
  274. package/dist/client/assets/tools-list-D8G7Mcid.js +0 -1
  275. package/dist/client/assets/tooltip-D9_AyRKs.js +0 -1
  276. package/dist/client/assets/use-clock-tick-Cr8Z09wV.js +0 -1
  277. package/dist/client/assets/use-collections-BLTNEY6D.js +0 -1
  278. package/dist/client/assets/use-infinite-scroll-CCgHyhHc.js +0 -1
  279. package/dist/client/assets/use-mcp-tools-CXGlYiLZ.js +0 -1
  280. package/dist/client/assets/use-navigate-to-agent-ChQTAqDN.js +0 -1
  281. package/dist/client/assets/use-status-sounds-QZH24TPY.js +0 -1
  282. package/dist/client/assets/use-virtual-mcp-BplbsFwA.js +0 -1
  283. package/dist/client/assets/useInfiniteQuery-Deh6Q8fX.js +0 -1
  284. package/dist/client/assets/useSuspenseInfiniteQuery-Cx1a_TEJ.js +0 -1
  285. package/dist/client/assets/useSuspenseQueries-B5d682yj.js +0 -1
  286. package/dist/client/assets/variant-calendar-CqjIGqTb.js +0 -1
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-thaZU0eY.js";import{c as z,b as _,D as $,a as E}from"./dropdown-menu-D5GBwmj-.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-8YfzWW4j.js";import{i as S}from"./Check-WJIsHzDQ.js";import{i as F}from"./List-CDS_Rmur.js";import{a as I,b as K,c as P,T as W}from"./tooltip-D9_AyRKs.js";import{V as q}from"./view-mode-toggle-oOb_3dux.js";import{B as G}from"./badge-C9YrQiOl.js";function re(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(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),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{re as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-DcsErluY.js";import{c as z,b as _,D as $,a as E}from"./dropdown-menu-COQWVmxy.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-BSEQu0PJ.js";import{i as S}from"./Check-BxViL4rK.js";import{i as F}from"./List-FyDw_upy.js";import{a as I,b as K,c as P,T as W}from"./tooltip-CX8JDN5z.js";import{V as q}from"./view-mode-toggle-RdEYDkk_.js";import{B as G}from"./badge-DN1YW5R1.js";function re(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(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),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{re as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-thaZU0eY.js";import{i as C}from"./SearchMd-YxzpYnNt.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-DcsErluY.js";import{i as C}from"./SearchMd-OCIrtgl8.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 k,j as s,l as C}from"./index-thaZU0eY.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-Z9PtYtMe.js";import{i as D,n as E}from"./SwitchHorizontal01-8YfzWW4j.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
1
+ import{c as k,j as s,l as C}from"./index-DcsErluY.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-DyVNd3lx.js";import{i as D,n as E}from"./SwitchHorizontal01-BSEQu0PJ.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-thaZU0eY.js";import{B as g}from"./badge-C9YrQiOl.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-DcsErluY.js";import{B as g}from"./badge-DN1YW5R1.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-thaZU0eY.js";import{_ as m}from"./index-Ci3919Ge.js";import{e as k,a as N,b as j,c as b,d as w}from"./dialog-DTR6Ld8R.js";import{i as y}from"./SearchMd-YxzpYnNt.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-DcsErluY.js";import{_ as m}from"./index-tYXe55yO.js";import{e as k,a as N,b as j,c as b,d as w}from"./dialog-wZUkxFBf.js";import{i as y}from"./SearchMd-OCIrtgl8.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,B as f,S as g};
@@ -0,0 +1 @@
1
+ import{m as At,n as Ue,s as Lt,o as Pt,Q as rt,p as ye,q as Ut,v as zt,r as K,w as $t,x as Dt,y as Mt,z as qt,C as Xe,D as Ft,E as Kt,F as Vt,c as F,l as oe,j as s,B as Q,d as fe,K as Y,G as Se,H as le,I as _e,J as Ne,i as De,k as ve,t as Re,L as he,M as ee,O as at,P as lt,a as ke,u as ct,R as Ht,b as dt,T as Qt,U as ut,V as Gt}from"./index-DcsErluY.js";import{A as Bt}from"./auth-entry-B7dEi3i4.js";import{A as Wt}from"./auth-split-layout-DAa980Aa.js";import{O as et}from"./organization-choice-B0E5mbjx.js";import{f as Yt}from"./tab-id-yjGvxWDL.js";import{I as be}from"./input-BLUXQaUJ.js";import{u as Ae}from"./use-mcp-client-x-H3hM3X.js";import{W as Me,S as mt,g as Jt,C as Zt}from"./constants-B72Xmt_K.js";import{i as ft}from"./XCircle-JQbz9WmR.js";import{I as qe}from"./integration-icon-BJkk8MWl.js";import{D as ge,a as pt,b as ht,c as gt,d as xt,e as yt}from"./dialog-wZUkxFBf.js";import{T as bt,a as vt,b as Ct}from"./tooltip-CX8JDN5z.js";import{i as Fe}from"./CheckCircle-Cz4tJUop.js";import{i as jt,t as St}from"./agent-icon-32aZu8f8.js";import{g as Xt,c as es,e as ts}from"./extract-connection-data-CguvuV8x.js";import{F as ce,a as Ee,b as de,c as Oe,d as ue,e as me,f as ss}from"./form-D4Sjj2S5.js";import{i as ns}from"./Check-BxViL4rK.js";import{a as _t}from"./Copy01-Ctt9FUbb.js";import{i as os}from"./Settings02-CTtq6YOs.js";import{s as is}from"./Eye-Bf8ySHj2.js";import{u as rs}from"./use-debounced-value-HI4UvLEV.js";import{f as as}from"./github-installations-DzN1UQ4x.js";import{a as ls}from"./authenticate-and-persist-oauth-Dji-Zkvk.js";import{i as Nt}from"./ArrowUpRight-zXVQKR-G.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-CVASN_n8.js";import"./User01-D-uDYDK0.js";import"./auth-C9k5QFmE.js";import"./X-DWrz2LqH.js";import"./AlertCircle-Npyn4_wF.js";import"./Tool01-woqhmM89.js";import"./SwitchHorizontal01-BSEQu0PJ.js";import"./ZapSquare-RhqrJVTN.js";import"./Users03-DGDUIZF4.js";import"./Loading02-wU_DDeXK.js";import"./ChevronDown-UniVHOcZ.js";import"./ChevronRight-K3Ms28jw.js";import"./ChevronUp-C_JF1YJx.js";import"./Circle-iQbOlvwS.js";import"./Stars02-C6DKWb0j.js";import"./ZoomOut-nih9dlzQ.js";import"./DotsVertical-Cnet9a8h.js";import"./Globe01-BCgVxayg.js";import"./FilterLines-DRa15Wby.js";import"./Star01-Cw7wbAha.js";import"./Globe04-BRhMXMEJ.js";import"./HardDrive-BaaJKDpq.js";import"./Key01-BvoJKmt1.js";import"./LayoutLeft-Bsqu0rxT.js";import"./LinkExternal01-bFRmolQv.js";import"./List-FyDw_upy.js";import"./Monitor01-rM21B5VM.js";import"./Sun-Cfq43Fjh.js";import"./Palette-Bq3VPed6.js";import"./Play-Dqv3vBUr.js";import"./Plus-CIMT0C1M.js";import"./SearchLg-BqF-kB3a.js";import"./SearchMd-OCIrtgl8.js";import"./Shield01-CCAMun7k.js";import"./Stars01-CXkCYhyc.js";import"./Trash01-DSTcxy5m.js";import"./Upload01-DI1Xs1Z6.js";import"./Users01-DVmsZOTe.js";import"./XClose-CBrgKiaB.js";import"./Zap-NoORqLvM.js";import"./label-CW0QYigh.js";import"./mcp-oauth-DkjiGs3f.js";function tt(n,e){const t=new Set(e);return n.filter(o=>!t.has(o))}function cs(n,e,t){const o=n.slice(0);return o[e]=t,o}var ds=class extends At{#o;#e;#i;#n;#t;#s;#r;#a;#l;#c=[];constructor(n,e,t){super(),this.#o=n,this.#n=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(n=>{n.subscribe(e=>{this.#f(n,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(n=>{n.destroy()})}setQueries(n,e){this.#i=n,this.#n=e,Ue.batch(()=>{const t=this.#t,o=this.#m(this.#i);o.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const i=o.map(l=>l.observer),r=i.map(l=>l.getCurrentResult()),a=t.length!==i.length,c=i.some((l,f)=>l!==t[f]),d=a||c,u=d?!0:r.some((l,f)=>{const m=this.#e[f];return!m||!Lt(l,m)});!d&&!u||(d&&(this.#c=o,this.#t=i),this.#e=r,this.hasListeners()&&(d&&(tt(t,i).forEach(l=>{l.destroy()}),tt(i,t).forEach(l=>{l.subscribe(f=>{this.#f(l,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(n=>n.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(n,e){const t=this.#m(n),o=t.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),i=t.map(r=>r.defaultedQueryOptions.queryHash);return[o,r=>this.#u(r??o,e,i),()=>this.#d(o,t)]}#d(n,e){return e.map((t,o)=>{const i=n[o];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,r=>{e.forEach(a=>{a.observer.trackProp(r)})})})}#u(n,e,t){if(e){const o=this.#l,i=t!==void 0&&o!==void 0&&(o.length!==t.length||t.some((r,a)=>r!==o[a]));return(!this.#s||this.#e!==this.#a||i||e!==this.#r)&&(this.#r=e,this.#a=this.#e,t!==void 0&&(this.#l=t),this.#s=Pt(this.#s,e(n))),this.#s}return n}#h(){return this.#n?.combine!==void 0&&this.#t.some((n,e)=>n.options.suspense&&this.#e[e]?.data===void 0)}#m(n){const e=new Map;this.#t.forEach(o=>{const i=o.options.queryHash;if(!i)return;const r=e.get(i);r?r.push(o):e.set(i,[o])});const t=[];return n.forEach(o=>{const i=this.#o.defaultQueryOptions(o),a=e.get(i.queryHash)?.shift()??new rt(this.#o,i);t.push({defaultedQueryOptions:i,observer:a})}),t}#f(n,e){const t=this.#t.indexOf(n);t!==-1&&(this.#e=cs(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const n=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,o=e?t:this.#u(n,this.#n?.combine);(e||t!==o)&&Ue.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function us({queries:n,...e},t){const o=ye(t),i=Ut(),r=zt(),a=K.useMemo(()=>n.map(y=>{const C=o.defaultQueryOptions(y);return C._optimisticResults=i?"isRestoring":"optimistic",C}),[n,o,i]);a.forEach(y=>{$t(y);const C=o.getQueryCache().get(y.queryHash);Dt(y,r,C)}),Mt(r);const[c]=K.useState(()=>new ds(o,a,e)),[d,u,l]=c.getOptimisticResult(a,e.combine),f=!i&&e.subscribed!==!1;K.useSyncExternalStore(K.useCallback(y=>f?c.subscribe(Ue.batchCalls(y)):qt,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),K.useEffect(()=>{c.setQueries(a,e)},[a,e,c]);const x=d.some((y,C)=>Xe(a[C],y))?d.flatMap((y,C)=>{const h=a[C];if(h&&Xe(h,y)){const p=new rt(o,h);return Ft(h,p,r)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=d.find((y,C)=>{const h=a[C];return h&&Kt({result:y,errorResetBoundary:r,throwOnError:h.throwOnError,query:o.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(g?.error)throw g.error;return u(l())}function ms(n,e){return us({...n,queries:n.queries.map(t=>({...t,suspense:!0,throwOnError:Vt,enabled:!0,placeholderData:void 0}))},e)}const fs=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ps=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,hs=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gs=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function ae(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=fs.test(e),o=ps.test(e),i=hs.test(e);if(t&&!o&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=o?e:`https://${e}`;let a;try{a=new URL(r)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(a.protocol!=="http:"&&a.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=a.hostname.split(".");return c.length<2||c.some(d=>!d||!gs.test(d))?{ok:!1,error:"Enter a valid website URL."}:(a.protocol="https:",{ok:!0,value:a.origin})}function xs(n,e){if(!n.trim())return!0;const t=ae(n);if(!t.ok||!e)return!1;const o=ae(e);return o.ok&&o.value===t.value}function ze(n){const e=F.c(14),{children:t,className:o,wrapperClassName:i}=n,[r,a]=K.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=y=>{if(!y)return;const C=()=>{const p=y.scrollHeight-y.scrollTop-y.clientHeight<8;a(p)};C(),y.addEventListener("scroll",C,{passive:!0});const h=new ResizeObserver(C);h.observe(y);for(const p of Array.from(y.children))h.observe(p);return()=>{y.removeEventListener("scroll",C),h.disconnect()}},e[0]=c):c=e[0];const d=c;let u;e[1]!==i?(u=oe("relative",i),e[1]=i,e[2]=u):u=e[2];let l;e[3]!==t||e[4]!==o?(l=s.jsx("div",{ref:d,className:o,children:t}),e[3]=t,e[4]=o,e[5]=l):l=e[5];const f=r?"opacity-0":"opacity-100";let m;e[6]!==f?(m=oe("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",f),e[6]=f,e[7]=m):m=e[7];let x;e[8]!==m?(x=s.jsx("div",{"aria-hidden":!0,className:m}),e[8]=m,e[9]=x):x=e[9];let g;return e[10]!==u||e[11]!==l||e[12]!==x?(g=s.jsxs("div",{className:u,children:[l,x]}),e[10]=u,e[11]=l,e[12]=x,e[13]=g):g=e[13],g}function ys(n){const e=n.properties;if(!e)return[];const t=[];for(const[o,i]of Object.entries(e)){const c=i?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:o,bindingType:c})}return t}function bs(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function se(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function vs(n,e,t,o){return{...n??{},[e]:{__type:t,value:o}}}function $e(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some($e):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&$e(t)):!1}function Cs(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function js(n){return $e(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function Ss(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const o=js(t);return o?[{key:e,label:Cs(e),value:o}]:[]}):[]}function _s({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Ns(n,e,t){const o=n.filter(i=>i.app_name===e||!!t&&i.app_id===t);return o.length===0?null:(o.sort((i,r)=>{const a=c=>c.status==="active"?0:1;return a(i)!==a(r)?a(i)-a(r):(r.updated_at??"").localeCompare(i.updated_at??"")}),o[0].id)}function Es(n){return n.server?.icons?.[0]?.src??Xt(n.server?.repository)??null}function ws(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function Is(n){const e=[],t=new Map(n.connections.map(o=>[o.id,o]));for(const o of n.requirements){const i=n.curated[o.bindingType],r=i?n.itemsById[i.registryAppId]:n.itemsByName[o.bindingType];if(!r)continue;const a=n.configurationState?.[o.fieldKey]?.value,c=a?t.get(a):void 0,d=a&&c?a:null,u=d?n.connectionReadiness?.[d]!==!1:!1,l=!!d&&u,f=l?void 0:n.saBindings?.[o.bindingType],m=l||!!f,x=l?"oauth":f?"sa":null;e.push({fieldKey:o.fieldKey,bindingType:o.bindingType,registryItem:r,title:ws(r,o.bindingType),icon:Es(r),headline:i?.headline??r._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:m,candidateConnectionId:m?null:d||Ns(n.connections,o.bindingType,i?.registryAppId),linkedConnectionId:d,configurationState:c?.configuration_state??null,boundVia:x,boundResource:f?.resource??null})}return e}function Os(n,e){if(!n)return null;const t=i=>{if(i.startsWith("sc-domain:"))return i.substring(10);try{let a=new URL(i.startsWith("http")?i:`https://${i}`).hostname||"";return a.startsWith("www.")&&(a=a.substring(4)),a}catch{return i}},o=t(n);for(const i of e)if(t(i.siteUrl)===o)return i.siteUrl;return null}function Ts(n){return(n?.response?.accountSummaries??[]).map(o=>({account:o.account,options:(o.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${o.displayName})`}))}))}function st(n){const e=F.c(38);let t,o,i,r,a;e[0]!==n?({value:a,onChange:o,placeholder:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=i,e[4]=r,e[5]=a):(t=e[1],o=e[2],i=e[3],r=e[4],a=e[5]);const[c,d]=K.useState(!1),[u,l]=K.useState(!1);let f;e[6]!==a?(f=async()=>{if(a)try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}catch(R){console.error("Failed to copy text: ",R)}},e[6]=a,e[7]=f):f=e[7];const m=f;let x;e[8]!==c?(x=()=>{d(!c)},e[8]=c,e[9]=x):x=e[9];const g=x,y=c?"text":"password";let C;e[10]!==t?(C=oe("pr-20",t),e[10]=t,e[11]=C):C=e[11];let h;e[12]!==o||e[13]!==i||e[14]!==r||e[15]!==y||e[16]!==C||e[17]!==a?(h=s.jsx(be,{type:y,value:a,onChange:o,placeholder:i,className:C,...r}),e[12]=o,e[13]=i,e[14]=r,e[15]=y,e[16]=C,e[17]=a,e[18]=h):h=e[18];const p=c?"Hide password":"Show password";let v;e[19]!==c?(v=c?s.jsx(os,{size:16}):s.jsx(is,{size:16}),e[19]=c,e[20]=v):v=e[20];let b;e[21]!==p||e[22]!==v||e[23]!==g?(b=s.jsx(Q,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:p,children:v}),e[21]=p,e[22]=v,e[23]=g,e[24]=b):b=e[24];const j=!a,N=u?"Copied!":"Copy token";let S;e[25]!==u?(S=u?s.jsx(ns,{size:16}):s.jsx(_t,{size:16}),e[25]=u,e[26]=S):S=e[26];let _;e[27]!==m||e[28]!==N||e[29]!==S||e[30]!==j?(_=s.jsx(Q,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,disabled:j,title:N,children:S}),e[27]=m,e[28]=N,e[29]=S,e[30]=j,e[31]=_):_=e[31];let I;e[32]!==_||e[33]!==b?(I=s.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[b,_]}),e[32]=_,e[33]=b,e[34]=I):I=e[34];let O;return e[35]!==I||e[36]!==h?(O=s.jsxs("div",{className:"relative",children:[h,I]}),e[35]=I,e[36]=h,e[37]=O):O=e[37],O}function Ke(n){const e=F.c(19),{card:t,selfClient:o,org:i,onDone:r,onError:a}=n,c=ye();let d;e[0]!==t||e[1]!==o?(d=async C=>{const h={...t.configurationState??{},...C};await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:h}}})},e[0]=t,e[1]=o,e[2]=d):d=e[2];let u;e[3]!==r||e[4]!==i||e[5]!==c?(u=async()=>{await c.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),r()},e[3]=r,e[4]=i,e[5]=c,e[6]=u):u=e[6];let l;e[7]!==a?(l=C=>{a?.(C)},e[7]=a,e[8]=l):l=e[8];let f;e[9]!==d||e[10]!==u||e[11]!==l?(f={mutationFn:d,onSuccess:u,onError:l},e[9]=d,e[10]=u,e[11]=l,e[12]=f):f=e[12];const m=fe(f);let x;e[13]!==m?(x=C=>m.mutate(C),e[13]=m,e[14]=x):x=e[14];const g=x;let y;return e[15]!==m.error||e[16]!==m.isPending||e[17]!==g?(y={save:g,isPending:m.isPending,error:m.error},e[15]=m.error,e[16]=m.isPending,e[17]=g,e[18]=y):y=e[18],y}const Rs=Se({accountName:le().min(1,"Informe o nome da conta"),appKey:le().optional(),appToken:le().optional()});function ks(n){const e=F.c(63),{card:t,selfClient:o,org:i,onDone:r,onIsPendingChange:a}=n;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=_e(Rs),e[0]=c):c=e[0];const d=t.configurationState?.accountName||"",u=t.configurationState?.appKey||"",l=t.configurationState?.appToken||"";let f;e[1]!==d||e[2]!==u||e[3]!==l?(f={resolver:c,defaultValues:{accountName:d,appKey:u,appToken:l}},e[1]=d,e[2]=u,e[3]=l,e[4]=f):f=e[4];const m=Ne(f);let x;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(x=()=>{m.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]=m,e[9]=x):x=e[9];let g;e[10]!==t.configurationState||e[11]!==m?(g=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=g):g=e[12],K.useEffect(x,g);let y;e[13]!==t||e[14]!==r||e[15]!==i||e[16]!==o?(y={card:t,selfClient:o,org:i,onDone:r},e[13]=t,e[14]=r,e[15]=i,e[16]=o,e[17]=y):y=e[17];const{save:C,isPending:h,error:p}=Ke(y);let v,b;e[18]!==h||e[19]!==a?(b=()=>{a?.(h)},v=[h,a],e[18]=h,e[19]=a,e[20]=v,e[21]=b):(v=e[20],b=e[21]),K.useEffect(b,v);let j;if(e[22]!==m||e[23]!==C){let D;e[25]!==C?(D=async k=>{C(k)},e[25]=C,e[26]=D):D=e[26],j=m.handleSubmit(D),e[22]=m,e[23]=C,e[24]=j}else j=e[24];const N=j;let S;e[27]!==h?(S=D=>{const{field:k}=D;return s.jsxs(de,{children:[s.jsx(Oe,{children:"Nome da conta"}),s.jsx(ue,{children:s.jsx(be,{placeholder:"Nome da sua conta VTEX",...k,disabled:h})}),s.jsx(me,{})]})},e[27]=h,e[28]=S):S=e[28];let _;e[29]!==m.control||e[30]!==S?(_=s.jsx(ce,{control:m.control,name:"accountName",render:S}),e[29]=m.control,e[30]=S,e[31]=_):_=e[31];let I;e[32]!==h?(I=D=>{const{field:k}=D;return s.jsxs(de,{children:[s.jsx(Oe,{children:"App Key (opcional)"}),s.jsx(ue,{children:s.jsx(st,{placeholder:"App Key da VTEX",...k,disabled:h})}),s.jsx(me,{})]})},e[32]=h,e[33]=I):I=e[33];let O;e[34]!==m.control||e[35]!==I?(O=s.jsx(ce,{control:m.control,name:"appKey",render:I}),e[34]=m.control,e[35]=I,e[36]=O):O=e[36];let R;e[37]!==h?(R=D=>{const{field:k}=D;return s.jsxs(de,{children:[s.jsx(Oe,{children:"App Token (opcional)"}),s.jsx(ue,{children:s.jsx(st,{placeholder:"App Token da VTEX",...k,disabled:h})}),s.jsx(me,{})]})},e[37]=h,e[38]=R):R=e[38];let E;e[39]!==m.control||e[40]!==R?(E=s.jsx(ce,{control:m.control,name:"appToken",render:R}),e[39]=m.control,e[40]=R,e[41]=E):E=e[41];let L;e[42]!==m||e[43]!==_||e[44]!==O||e[45]!==E?(L=s.jsxs(Ee,{...m,children:[_,O,E]}),e[42]=m,e[43]=_,e[44]=O,e[45]=E,e[46]=L):L=e[46];let $;e[47]!==p?($=p&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:p instanceof Error?p.message:"Não foi possível salvar a configuração"}),e[47]=p,e[48]=$):$=e[48];let P;e[49]!==h||e[50]!==r?(P=s.jsx(Q,{type:"button",variant:"outline",onClick:r,disabled:h,children:"Cancelar"}),e[49]=h,e[50]=r,e[51]=P):P=e[51];const M=h?"Salvando...":"Salvar";let q;e[52]!==h||e[53]!==M?(q=s.jsx(Q,{type:"submit",disabled:h,children:M}),e[52]=h,e[53]=M,e[54]=q):q=e[54];let w;e[55]!==P||e[56]!==q?(w=s.jsxs(ge,{className:"pt-4",children:[P,q]}),e[55]=P,e[56]=q,e[57]=w):w=e[57];let T;return e[58]!==N||e[59]!==L||e[60]!==$||e[61]!==w?(T=s.jsxs("form",{onSubmit:N,className:"space-y-4",children:[L,$,w]}),e[58]=N,e[59]=L,e[60]=$,e[61]=w,e[62]=T):T=e[62],T}function Ve(n){const e=F.c(29),{options:t,value:o,onChange:i,disabled:r,ariaLabel:a,searchPlaceholder:c,hideSearch:d}=n,u=c===void 0?"Buscar...":c,l=d===void 0?!1:d,[f,m]=K.useState("");let x,g,y;if(e[0]!==t||e[1]!==f||e[2]!==o){const S=f.trim().toLowerCase();x=S?t.filter(_=>_.label.toLowerCase().includes(S)):t,g=x.map(As),y=g.includes(o)?o:g[0]??"",e[0]=t,e[1]=f,e[2]=o,e[3]=x,e[4]=g,e[5]=y}else x=e[3],g=e[4],y=e[5];const C=y;let h;e[6]!==r||e[7]!==g||e[8]!==i?(h=function(_){if(r||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(_.key))return;_.preventDefault();const O=_.currentTarget.dataset.value,R=g.indexOf(O),E=g.length;if(E===0)return;let L;_.key==="ArrowDown"||_.key==="ArrowRight"?L=(R+1)%E:_.key==="ArrowUp"||_.key==="ArrowLeft"?L=(R-1+E)%E:_.key==="Home"?L=0:L=E-1;const $=g[L];i($),_.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape($)}"]`)?.focus()},e[6]=r,e[7]=g,e[8]=i,e[9]=h):h=e[9];const p=h;let v;e[10]!==a||e[11]!==r||e[12]!==l||e[13]!==f||e[14]!==u?(v=l?null:s.jsxs("div",{className:"relative",children:[s.jsx(jt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(be,{type:"text",value:f,onChange:S=>m(S.target.value),disabled:r,placeholder:u,"aria-label":`Buscar ${a}`,className:"h-8 pl-8"})]}),e[10]=a,e[11]=r,e[12]=l,e[13]=f,e[14]=u,e[15]=v):v=e[15];let b;e[16]!==r||e[17]!==x||e[18]!==p||e[19]!==i||e[20]!==C||e[21]!==o?(b=x.length===0?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):x.map(S=>{const _=S.value===o;return s.jsxs("button",{type:"button",role:"radio","aria-checked":_,disabled:r,"data-value":S.value,tabIndex:S.value===C?0:-1,onClick:()=>i(S.value),onKeyDown:p,className:oe("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",_?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[s.jsx("span",{className:"truncate",children:S.label}),_?s.jsx(Fe,{size:16,className:"shrink-0 text-primary"}):null]},S.value)}),e[16]=r,e[17]=x,e[18]=p,e[19]=i,e[20]=C,e[21]=o,e[22]=b):b=e[22];let j;e[23]!==a||e[24]!==b?(j=s.jsx("div",{role:"radiogroup","aria-label":a,className:"max-h-[280px] overflow-y-auto",children:b}),e[23]=a,e[24]=b,e[25]=j):j=e[25];let N;return e[26]!==v||e[27]!==j?(N=s.jsxs("div",{className:"space-y-2",children:[v,j]}),e[26]=v,e[27]=j,e[28]=N):N=e[28],N}function As(n){return n.value}function Le(n){const e=F.c(16),{label:t,iconSize:o,className:i,iconClassName:r,labelClassName:a}=n,c=o===void 0?14:o;let d;e[0]!==i?(d=oe("inline-flex items-center gap-2",i),e[0]=i,e[1]=d):d=e[1];let u;e[2]!==r?(u=oe("shrink-0 animate-spin",r),e[2]=r,e[3]=u):u=e[3];let l;e[4]!==c||e[5]!==u?(l=s.jsx(De,{size:c,className:u}),e[4]=c,e[5]=u,e[6]=l):l=e[6];let f;e[7]!==a?(f=oe("text-sm",a),e[7]=a,e[8]=f):f=e[8];let m;e[9]!==t||e[10]!==f?(m=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=m):m=e[11];let x;return e[12]!==d||e[13]!==l||e[14]!==m?(x=s.jsxs("span",{className:d,children:[l,m]}),e[12]=d,e[13]=l,e[14]=m,e[15]=x):x=e[15],x}const Ls=Se({propertyId:le().min(1,"Selecione uma propriedade")});function Ps(n){const e=F.c(68),{card:t,connectionId:o,companionClient:i,selfClient:r,org:a,onDone:c,onDisconnect:d,onIsPendingChange:u}=n;let l;e[0]!==o||e[1]!==a.id?(l=Y.commerceDiscoveryCompanionGaProperties(a.id,o),e[0]=o,e[1]=a.id,e[2]=l):l=e[2];let f;e[3]!==i?(f=async()=>{const z=await i.callTool({name:"get-account-summaries",arguments:{}}),V=se(z);return Ts(V)},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==l||e[6]!==f?(m={queryKey:l,queryFn:f},e[5]=l,e[6]=f,e[7]=m):m=e[7];const x=ve(m);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=_e(Ls),e[8]=g):g=e[8];const y=t.configurationState?.propertyId||"";let C;e[9]!==y?(C={resolver:g,defaultValues:{propertyId:y}},e[9]=y,e[10]=C):C=e[10];const h=Ne(C);let p;e[11]!==t||e[12]!==c||e[13]!==a||e[14]!==r?(p={card:t,selfClient:r,org:a,onDone:c},e[11]=t,e[12]=c,e[13]=a,e[14]=r,e[15]=p):p=e[15];const{save:v,isPending:b,error:j}=Ke(p);let N,S;e[16]!==b||e[17]!==u?(N=()=>{u?.(b)},S=[b,u],e[16]=b,e[17]=u,e[18]=N,e[19]=S):(N=e[18],S=e[19]),K.useEffect(N,S);let _;if(e[20]!==h||e[21]!==v){let z;e[23]!==v?(z=async V=>{v(V)},e[23]=v,e[24]=z):z=e[24],_=h.handleSubmit(z),e[20]=h,e[21]=v,e[22]=_}else _=e[22];const I=_;if(x.isLoading){let z;return e[25]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando propriedades..."})}),e[25]=z):z=e[25],z}if(x.isError){let z;return e[26]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=z):z=e[26],z}let O;e[27]!==x.data?(O=x.data||[],e[27]=x.data,e[28]=O):O=e[28];const R=O;if(R.flatMap(zs).length===0){let z;e[29]===Symbol.for("react.memo_cache_sentinel")?(z=s.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]=z):z=e[29];let V;e[30]!==d?(V=d?s.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=d,e[31]=V):V=e[31];let B;e[32]!==c?(B=s.jsx(Q,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=B):B=e[33];let W;return e[34]!==V||e[35]!==B?(W=s.jsxs("div",{className:"space-y-4",children:[z,s.jsxs(ge,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[V,B]})]}),e[34]=V,e[35]=B,e[36]=W):W=e[36],W}let L;e[37]!==b||e[38]!==R?(L=z=>{const{field:V}=z;return s.jsxs(de,{children:[s.jsx(ue,{children:s.jsx(Ve,{options:R.flatMap(Us),value:V.value,onChange:V.onChange,disabled:b,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(me,{})]})},e[37]=b,e[38]=R,e[39]=L):L=e[39];let $;e[40]!==h.control||e[41]!==L?($=s.jsx(ce,{control:h.control,name:"propertyId",render:L}),e[40]=h.control,e[41]=L,e[42]=$):$=e[42];let P;e[43]!==h||e[44]!==$?(P=s.jsx(Ee,{...h,children:$}),e[43]=h,e[44]=$,e[45]=P):P=e[45];let M;e[46]!==j?(M=j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j instanceof Error?j.message:"Não foi possível salvar a configuração"}),e[46]=j,e[47]=M):M=e[47];let q;e[48]!==b||e[49]!==d?(q=d?s.jsx("button",{type:"button",onClick:d,disabled:b,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):s.jsx("span",{}),e[48]=b,e[49]=d,e[50]=q):q=e[50];let w;e[51]!==b||e[52]!==c?(w=s.jsx(Q,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancelar"}),e[51]=b,e[52]=c,e[53]=w):w=e[53];const T=b?"Salvando...":"Salvar";let D;e[54]!==b||e[55]!==T?(D=s.jsx(Q,{type:"submit",disabled:b,children:T}),e[54]=b,e[55]=T,e[56]=D):D=e[56];let k;e[57]!==w||e[58]!==D?(k=s.jsxs("div",{className:"flex gap-2",children:[w,D]}),e[57]=w,e[58]=D,e[59]=k):k=e[59];let U;e[60]!==q||e[61]!==k?(U=s.jsxs(ge,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[q,k]}),e[60]=q,e[61]=k,e[62]=U):U=e[62];let H;return e[63]!==I||e[64]!==P||e[65]!==M||e[66]!==U?(H=s.jsxs("form",{onSubmit:I,className:"space-y-4",children:[P,M,U]}),e[63]=I,e[64]=P,e[65]=M,e[66]=U,e[67]=H):H=e[67],H}function Us(n){return n.options}function zs(n){return n.options}const $s=Se({siteUrl:le().min(1,"Selecione um site")});function Ds(n){const e=F.c(59),{card:t,connectionId:o,companionClient:i,selfClient:r,org:a,contextSiteUrl:c,onDone:d,onIsPendingChange:u}=n;let l;e[0]!==o||e[1]!==a.id?(l=Y.commerceDiscoveryCompanionGscSites(a.id,o),e[0]=o,e[1]=a.id,e[2]=l):l=e[2];let f;e[3]!==i?(f=async()=>{const k=await i.callTool({name:"list_sites",arguments:{}});return se(k).sites||[]},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==l||e[6]!==f?(m={queryKey:l,queryFn:f},e[5]=l,e[6]=f,e[7]=m):m=e[7];const x=ve(m);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=_e($s),e[8]=g):g=e[8];const y=t.configurationState?.siteUrl||"";let C;e[9]!==y?(C={resolver:g,defaultValues:{siteUrl:y}},e[9]=y,e[10]=C):C=e[10];const h=Ne(C);let p;e[11]!==t||e[12]!==d||e[13]!==a||e[14]!==r?(p={card:t,selfClient:r,org:a,onDone:d},e[11]=t,e[12]=d,e[13]=a,e[14]=r,e[15]=p):p=e[15];const{save:v,isPending:b,error:j}=Ke(p);let N,S;e[16]!==b||e[17]!==u?(N=()=>{u?.(b)},S=[b,u],e[16]=b,e[17]=u,e[18]=N,e[19]=S):(N=e[18],S=e[19]),K.useEffect(N,S);let _;if(e[20]!==h||e[21]!==v){let k;e[23]!==v?(k=async U=>{v(U)},e[23]=v,e[24]=k):k=e[24],_=h.handleSubmit(k),e[20]=h,e[21]=v,e[22]=_}else _=e[22];const I=_;if(x.isLoading){let k;return e[25]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(Le,{label:"Carregando sites..."})}),e[25]=k):k=e[25],k}if(x.isError){let k;return e[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=k):k=e[26],k}let O,R;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==h||e[30]!==x.data){R=Symbol.for("react.early_return_sentinel");e:{if(O=x.data||[],O.length===0){let U;e[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=U):U=e[33],R=U;break e}const k=t.configurationState?.siteUrl;if(k&&h.getValues("siteUrl")!==k)h.setValue("siteUrl",k);else if(!k&&!h.getValues("siteUrl")){const U=Os(c,O);U&&h.setValue("siteUrl",U)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=h,e[30]=x.data,e[31]=O,e[32]=R}else O=e[31],R=e[32];if(R!==Symbol.for("react.early_return_sentinel"))return R;let E;e[34]!==b||e[35]!==O?(E=k=>{const{field:U}=k;return s.jsxs(de,{children:[s.jsx(ue,{children:s.jsx(Ve,{options:O.map(Ms),value:U.value,onChange:U.onChange,disabled:b,ariaLabel:"Site verificado"})}),s.jsx(me,{})]})},e[34]=b,e[35]=O,e[36]=E):E=e[36];let L;e[37]!==h.control||e[38]!==E?(L=s.jsx(ce,{control:h.control,name:"siteUrl",render:E}),e[37]=h.control,e[38]=E,e[39]=L):L=e[39];let $;e[40]!==h||e[41]!==L?($=s.jsx(Ee,{...h,children:L}),e[40]=h,e[41]=L,e[42]=$):$=e[42];let P;e[43]!==j?(P=j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j instanceof Error?j.message:"Não foi possível salvar a configuração"}),e[43]=j,e[44]=P):P=e[44];let M;e[45]!==b||e[46]!==d?(M=s.jsx(Q,{type:"button",variant:"outline",onClick:d,disabled:b,children:"Cancelar"}),e[45]=b,e[46]=d,e[47]=M):M=e[47];const q=b?"Salvando...":"Salvar";let w;e[48]!==b||e[49]!==q?(w=s.jsx(Q,{type:"submit",disabled:b,children:q}),e[48]=b,e[49]=q,e[50]=w):w=e[50];let T;e[51]!==M||e[52]!==w?(T=s.jsxs(ge,{className:"pt-4",children:[M,w]}),e[51]=M,e[52]=w,e[53]=T):T=e[53];let D;return e[54]!==I||e[55]!==$||e[56]!==P||e[57]!==T?(D=s.jsxs("form",{onSubmit:I,className:"space-y-4",children:[$,P,T]}),e[54]=I,e[55]=$,e[56]=P,e[57]=T,e[58]=D):D=e[58],D}function Ms(n){return{value:n.siteUrl,label:n.siteUrl}}const qs=Se({githubRepo:le().min(1,"Selecione um repositório")}),Fs=15e3,Ks=/^[\w.-]+\/[\w.-]+$/;async function Vs(n,e,t,o){const{installations:i}=await as(n,t),r=o.trim(),a=await Promise.allSettled(i.map(async l=>{const f=l.type==="User"?"user":"org",m=r?`${f}:${l.login} ${r} in:name`:`${f}:${l.login}`,g=await e.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(Fs)}),y=g.content?.[0]?.text;if(g.isError)throw new Error(y??"search_repositories failed");if(!y)throw new Error("empty search_repositories response");return JSON.parse(y).items??[]})),c=new Map;let d=0;for(const l of a){if(l.status==="rejected"){d+=1;continue}for(const f of l.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((l,f)=>(f.updated_at??"").localeCompare(l.updated_at??"")).map(l=>l.full_name),failed:d,total:i.length}}function Hs(n){const e=F.c(80),{connectionId:t,companionClient:o,selfClient:i,org:r,onDone:a,onIsPendingChange:c}=n,d=ye();let u;e[0]!==r.id?(u=Me.COMMERCE_DISCOVERY(r.id),e[0]=r.id,e[1]=u):u=e[1];const l=u,[f,m]=K.useState(""),x=rs(f,300);let g;e[2]!==t||e[3]!==r.id?(g=Y.commerceDiscoveryCompanionGithubSelected(r.id,t),e[2]=t,e[3]=r.id,e[4]=g):g=e[4];let y;e[5]!==l||e[6]!==i?(y=async()=>{const Z=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}}),X=se(Z).item?.configuration_state??null;return typeof X?.github_repo=="string"?X.github_repo:""},e[5]=l,e[6]=i,e[7]=y):y=e[7];let C;e[8]!==g||e[9]!==y?(C={queryKey:g,queryFn:y},e[8]=g,e[9]=y,e[10]=C):C=e[10];const h=ve(C);let p;e[11]!==t||e[12]!==x||e[13]!==r.id?(p=Y.commerceDiscoveryCompanionGithubRepos(r.id,t,x.trim()),e[11]=t,e[12]=x,e[13]=r.id,e[14]=p):p=e[14];let v;e[15]!==o||e[16]!==t||e[17]!==x||e[18]!==i?(v=()=>Vs(Z=>i.callTool(Z),o,t,x),e[15]=o,e[16]=t,e[17]=x,e[18]=i,e[19]=v):v=e[19];let b;e[20]!==p||e[21]!==v?(b={queryKey:p,queryFn:v},e[20]=p,e[21]=v,e[22]=b):b=e[22];const j=ve(b);let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N={resolver:_e(qs),defaultValues:{githubRepo:""}},e[23]=N):N=e[23];const S=Ne(N);let _;e[24]!==l||e[25]!==i?(_=async Z=>{const X=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}}),kt={...se(X).item?.configuration_state??null??{},github_repo:Z};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:l,data:{configuration_state:kt}}})},e[24]=l,e[25]=i,e[26]=_):_=e[26];let I;e[27]!==l||e[28]!==a||e[29]!==r.id||e[30]!==d?(I=async()=>{await d.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(r.id,l)}),await d.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(r.id)}),a()},e[27]=l,e[28]=a,e[29]=r.id,e[30]=d,e[31]=I):I=e[31];let O;e[32]!==I||e[33]!==_?(O={mutationFn:_,onSuccess:I},e[32]=I,e[33]=_,e[34]=O):O=e[34];const R=fe(O),E=R.isPending;let L,$;e[35]!==E||e[36]!==c?(L=()=>{c?.(E)},$=[E,c],e[35]=E,e[36]=c,e[37]=L,e[38]=$):(L=e[37],$=e[38]),K.useEffect(L,$);let P;if(e[39]!==S||e[40]!==R){let Z;e[42]!==R?(Z=async X=>{R.mutate(X.githubRepo)},e[42]=R,e[43]=Z):Z=e[43],P=S.handleSubmit(Z),e[39]=S,e[40]=R,e[41]=P}else P=e[41];const M=P,q=h.data??"";q&&S.getValues("githubRepo")!==q&&S.setValue("githubRepo",q);let w,T,D;if(e[44]!==x||e[45]!==j.data?.failed||e[46]!==j.data?.repos||e[47]!==j.data?.total||e[48]!==q){const Z=j.data?.repos??[];w=j.data?.failed??0,D=j.data?.total??0;const X=x.trim();T=[...Z],X&&Ks.test(X)&&!T.includes(X)&&T.unshift(X),q&&!T.includes(q)&&T.push(q),e[44]=x,e[45]=j.data?.failed,e[46]=j.data?.repos,e[47]=j.data?.total,e[48]=q,e[49]=w,e[50]=T,e[51]=D}else w=e[49],T=e[50],D=e[51];const k=D>0&&w===D,U=j.isError||k?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":w>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let H;e[52]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(jt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[52]=H):H=e[52];let z;e[53]===Symbol.for("react.memo_cache_sentinel")?(z=Z=>m(Z.target.value),e[53]=z):z=e[53];let V;e[54]!==E||e[55]!==f?(V=s.jsxs("div",{className:"relative",children:[H,s.jsx(be,{type:"text",value:f,onChange:z,disabled:E,placeholder:"Buscar repositório (ex: deco-sites/fila-store)","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[54]=E,e[55]=f,e[56]=V):V=e[56];let B;e[57]!==S||e[58]!==E||e[59]!==T||e[60]!==j.isLoading||e[61]!==U?(B=j.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(Le,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[U&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:U}),T.length===0?!U&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(Ee,{...S,children:s.jsx(ce,{control:S.control,name:"githubRepo",render:Z=>{const{field:X}=Z;return s.jsxs(de,{children:[s.jsx(ue,{children:s.jsx(Ve,{options:T.map(Qs),value:X.value,onChange:X.onChange,disabled:E,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(me,{})]})}})})]}),e[57]=S,e[58]=E,e[59]=T,e[60]=j.isLoading,e[61]=U,e[62]=B):B=e[62];let W;e[63]!==R.error?(W=R.error&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:R.error instanceof Error?R.error.message:"Não foi possível salvar a configuração"}),e[63]=R.error,e[64]=W):W=e[64];let J;e[65]!==E||e[66]!==a?(J=s.jsx(Q,{type:"button",variant:"outline",onClick:a,disabled:E,children:"Cancelar"}),e[65]=E,e[66]=a,e[67]=J):J=e[67];const te=E?"Salvando...":"Salvar";let A;e[68]!==E||e[69]!==te?(A=s.jsx(Q,{type:"submit",disabled:E,children:te}),e[68]=E,e[69]=te,e[70]=A):A=e[70];let G;e[71]!==J||e[72]!==A?(G=s.jsxs(ge,{className:"pt-4",children:[J,A]}),e[71]=J,e[72]=A,e[73]=G):G=e[73];let ie;return e[74]!==M||e[75]!==V||e[76]!==B||e[77]!==W||e[78]!==G?(ie=s.jsxs("form",{onSubmit:M,className:"space-y-4",children:[V,B,W,G]}),e[74]=M,e[75]=V,e[76]=B,e[77]=W,e[78]=G,e[79]=ie):ie=e[79],ie}function Qs(n){return{value:n,label:n}}const Gs={vtex:ks,"google-analytics":Ps,"google-search-console":Ds,github:Hs},xe="deco-reader@decocms.iam.gserviceaccount.com",Et={"google-analytics":"ga4","google-search-console":"gsc"},wt={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${xe} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${xe} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function Bs(n,e){const t=wt[n].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:n==="ga4"?[`Confirme que ${xe} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${xe} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:n==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function Ws(n){const e=F.c(76),{provider:t,siteUrl:o,selfClient:i,org:r,initialResourceId:a,onDone:c,onIsPendingChange:d,onOAuthInstead:u}=n,l=wt[t],f=ye(),[m,x]=K.useState(null);let g,y;if(e[0]!==l.resourceLabel){const A=Se({resourceId:le().trim().min(1,`Informe o ${l.resourceLabel.toLowerCase()}`)});y=Ne,g=_e(A),e[0]=l.resourceLabel,e[1]=g,e[2]=y}else g=e[1],y=e[2];const C=a??"";let h;e[3]!==C?(h={resourceId:C},e[3]=C,e[4]=h):h=e[4];let p;e[5]!==g||e[6]!==h?(p={resolver:g,defaultValues:h},e[5]=g,e[6]=h,e[7]=p):p=e[7];const v=y(p);let b;e[8]!==t||e[9]!==i||e[10]!==o?(b=async A=>{if(!o)throw new Error("URL da loja indisponível — recarregue a página.");const G=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:o,provider:t,resourceId:A.resourceId}});return se(G)},e[8]=t,e[9]=i,e[10]=o,e[11]=b):b=e[11];let j,N;e[12]!==d?(j=()=>d?.(!0),N=()=>d?.(!1),e[12]=d,e[13]=j,e[14]=N):(j=e[13],N=e[14]);let S;e[15]!==l.label||e[16]!==c||e[17]!==r||e[18]!==t||e[19]!==f||e[20]!==o?(S=async A=>{if(A.ok){x(null),Re.success(`${l.label} conectado`),o&&await f.invalidateQueries({queryKey:Y.commerceDiscoveryConnectionStatus(r.id,o)}),c();return}x({...Bs(t,A.reason??"unknown"),detail:A.detail})},e[15]=l.label,e[16]=c,e[17]=r,e[18]=t,e[19]=f,e[20]=o,e[21]=S):S=e[21];let _;e[22]!==b||e[23]!==j||e[24]!==N||e[25]!==S?(_={mutationFn:b,onMutate:j,onSettled:N,onSuccess:S},e[22]=b,e[23]=j,e[24]=N,e[25]=S,e[26]=_):_=e[26];const I=fe(_);let O;if(e[27]!==v||e[28]!==I){let A;e[30]!==I?(A=G=>I.mutate(G),e[30]=I,e[31]=A):A=e[31],O=v.handleSubmit(A),e[27]=v,e[28]=I,e[29]=O}else O=e[29];const R=O,E=I.isPending,L=Zs;let $;e[32]!==l.connectSteps?($=l.connectSteps.map(Js),e[32]=l.connectSteps,e[33]=$):$=e[33];let P;e[34]!==$?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:$}),e[34]=$,e[35]=P):P=e[35];let M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:xe}),e[36]=M):M=e[36];let q;e[37]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[M,s.jsx(Q,{type:"button",variant:"ghost",size:"icon-sm",onClick:L,"aria-label":"Copiar e-mail do service account",children:s.jsx(_t,{size:16})})]}),e[37]=q):q=e[37];let w;e[38]!==l.resourceHint||e[39]!==l.resourceLabel||e[40]!==l.resourcePlaceholder||e[41]!==E?(w=A=>{const{field:G}=A;return s.jsxs(de,{children:[s.jsx(Oe,{children:l.resourceLabel}),s.jsx(ue,{children:s.jsx(be,{...G,placeholder:l.resourcePlaceholder,disabled:E,autoComplete:"off"})}),s.jsx(ss,{children:l.resourceHint}),s.jsx(me,{})]})},e[38]=l.resourceHint,e[39]=l.resourceLabel,e[40]=l.resourcePlaceholder,e[41]=E,e[42]=w):w=e[42];let T;e[43]!==v.control||e[44]!==w?(T=s.jsx(ce,{control:v.control,name:"resourceId",render:w}),e[43]=v.control,e[44]=w,e[45]=T):T=e[45];let D;e[46]!==v||e[47]!==T?(D=s.jsx(Ee,{...v,children:T}),e[46]=v,e[47]=T,e[48]=D):D=e[48];let k;e[49]!==m?(k=m&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:m.steps.map(Ys)})]}),e[49]=m,e[50]=k):k=e[50];let U;e[51]!==I.error||e[52]!==I.isError?(U=I.isError&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I.error instanceof Error?I.error.message:"Não foi possível vincular."}),e[51]=I.error,e[52]=I.isError,e[53]=U):U=e[53];let H;e[54]!==E||e[55]!==u?(H=u?s.jsx("button",{type:"button",onClick:u,disabled:E,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):s.jsx("span",{}),e[54]=E,e[55]=u,e[56]=H):H=e[56];let z;e[57]!==E||e[58]!==c?(z=s.jsx(Q,{type:"button",variant:"outline",onClick:c,disabled:E,children:"Cancelar"}),e[57]=E,e[58]=c,e[59]=z):z=e[59];const V=E?"Verificando...":"Vincular";let B;e[60]!==E||e[61]!==V?(B=s.jsx(Q,{type:"submit",disabled:E,children:V}),e[60]=E,e[61]=V,e[62]=B):B=e[62];let W;e[63]!==z||e[64]!==B?(W=s.jsxs("div",{className:"flex gap-2",children:[z,B]}),e[63]=z,e[64]=B,e[65]=W):W=e[65];let J;e[66]!==H||e[67]!==W?(J=s.jsxs(ge,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[H,W]}),e[66]=H,e[67]=W,e[68]=J):J=e[68];let te;return e[69]!==R||e[70]!==P||e[71]!==D||e[72]!==k||e[73]!==U||e[74]!==J?(te=s.jsxs("form",{onSubmit:R,className:"space-y-4",children:[P,q,D,k,U,J]}),e[69]=R,e[70]=P,e[71]=D,e[72]=k,e[73]=U,e[74]=J,e[75]=te):te=e[75],te}function Ys(n){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:n})]},n)}function Js(n,e){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),s.jsx("span",{children:n})]},n)}function Zs(){navigator.clipboard?.writeText(xe),Re.success("E-mail copiado")}function Xs(){const n=F.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[e,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"h-3 w-full animate-pulse rounded bg-muted/60"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),n[1]=t):t=n[1],t}const nt="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function en(n){const e=F.c(37),{card:t,connecting:o,disabled:i,onConnect:r,org:a,selfClient:c,siteUrl:d,autoOpenConfigFieldKey:u,onAutoOpenConfigHandled:l}=n,f=t.linkedConnectionId,m=Et[t.bindingType],x=!!m&&t.boundVia!=="oauth";let g;e[0]!==u||e[1]!==t||e[2]!==o||e[3]!==i||e[4]!==f||e[5]!==l||e[6]!==r||e[7]!==a||e[8]!==m||e[9]!==c||e[10]!==d||e[11]!==x?(g=x&&m?s.jsx(tn,{card:t,provider:m,org:a,selfClient:c,siteUrl:d,onOAuthInstead:r,disabled:i,connecting:o}):t.satisfied&&f?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Fe,{size:16,className:"text-success"})," Conectado"]}),s.jsx(K.Suspense,{fallback:s.jsx(sn,{}),children:s.jsx(nn,{card:t,org:a,selfClient:c,connectionId:f,contextSiteUrl:d,autoOpen:_s({autoOpenFieldKey:u,card:t}),onAutoOpenHandled:l})})]}):s.jsx(Q,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:i||o,onClick:r,"aria-label":`Conectar ${t.title}`,children:o?s.jsx(De,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=u,e[1]=t,e[2]=o,e[3]=i,e[4]=f,e[5]=l,e[6]=r,e[7]=a,e[8]=m,e[9]=c,e[10]=d,e[11]=x,e[12]=g):g=e[12];const y=g;let C;e[13]!==t.icon||e[14]!==t.title?(C=s.jsx(qe,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[13]=t.icon,e[14]=t.title,e[15]=C):C=e[15];let h;e[16]!==t.area?(h=t.area&&s.jsx("span",{className:oe("hidden sm:inline-block",nt),children:t.area}),e[16]=t.area,e[17]=h):h=e[17];let p;e[18]!==C||e[19]!==h?(p=s.jsxs("div",{className:"shrink-0 self-start sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[C,h]}),e[18]=C,e[19]=h,e[20]=p):p=e[20];let v;e[21]!==t.area?(v=t.area&&s.jsx("span",{className:oe("mb-1 inline-block sm:hidden",nt),children:t.area}),e[21]=t.area,e[22]=v):v=e[22];let b;e[23]!==t.title?(b=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=b):b=e[24];let j;e[25]!==t.headline?(j=t.headline&&s.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm leading-5 text-muted-foreground",children:t.headline}),e[25]=t.headline,e[26]=j):j=e[26];let N;e[27]!==v||e[28]!==b||e[29]!==j?(N=s.jsxs("div",{className:"min-w-0 flex-1",children:[v,b,j]}),e[27]=v,e[28]=b,e[29]=j,e[30]=N):N=e[30];let S;e[31]!==y?(S=s.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:y}),e[31]=y,e[32]=S):S=e[32];let _;return e[33]!==p||e[34]!==N||e[35]!==S?(_=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[p,N,S]}),e[33]=p,e[34]=N,e[35]=S,e[36]=_):_=e[36],_}function tn(n){const e=F.c(39),{card:t,provider:o,org:i,selfClient:r,siteUrl:a,onOAuthInstead:c,disabled:d,connecting:u}=n,[l,f]=K.useState(!1),[m,x]=K.useState(!1);let g;e[0]!==m?(g=L=>{!L&&m||f(L)},e[0]=m,e[1]=g):g=e[1];const y=g;let C;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==u||e[5]!==d?(C=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Fe,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(bt,{children:[s.jsx(vt,{asChild:!0,children:s.jsx(Q,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(St,{size:16})})}),s.jsx(Ct,{children:"Editar configuração"})]})]}):s.jsx(Q,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:d||u,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:u?s.jsx(De,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=u,e[5]=d,e[6]=C):C=e[6];let h;e[7]!==t.icon||e[8]!==t.title?(h=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=h):h=e[9];let p;e[10]!==t.title?(p=s.jsx(pt,{children:t.title}),e[10]=t.title,e[11]=p):p=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ht,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=v):v=e[12];let b;e[13]!==p?(b=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[p,v]}),e[13]=p,e[14]=b):b=e[14];let j;e[15]!==h||e[16]!==b?(j=s.jsxs(gt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[h,b]}),e[15]=h,e[16]=b,e[17]=j):j=e[17];const N=t.boundResource??void 0;let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=()=>f(!1),e[18]=S):S=e[18];let _;e[19]!==t.satisfied||e[20]!==c?(_=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.satisfied,e[20]=c,e[21]=_):_=e[21];let I;e[22]!==i||e[23]!==o||e[24]!==r||e[25]!==a||e[26]!==_||e[27]!==N?(I=s.jsx(Ws,{provider:o,siteUrl:a,selfClient:r,org:i,initialResourceId:N,onDone:S,onIsPendingChange:x,onOAuthInstead:_}),e[22]=i,e[23]=o,e[24]=r,e[25]=a,e[26]=_,e[27]=N,e[28]=I):I=e[28];let O;e[29]!==I||e[30]!==j?(O=s.jsxs(xt,{className:"sm:max-w-lg",children:[j,I]}),e[29]=I,e[30]=j,e[31]=O):O=e[31];let R;e[32]!==y||e[33]!==l||e[34]!==O?(R=s.jsx(yt,{open:l,onOpenChange:y,children:O}),e[32]=y,e[33]=l,e[34]=O,e[35]=R):R=e[35];let E;return e[36]!==R||e[37]!==C?(E=s.jsxs(s.Fragment,{children:[C,R]}),e[36]=R,e[37]=C,e[38]=E):E=e[38],E}function sn(){const n=F.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0],e}function nn(n){const e=F.c(60),{card:t,org:o,selfClient:i,connectionId:r,contextSiteUrl:a,autoOpen:c,onAutoOpenHandled:d}=n;let u;e[0]!==r||e[1]!==o.id||e[2]!==o.slug?(u={connectionId:r,orgId:o.id,orgSlug:o.slug},e[0]=r,e[1]=o.id,e[2]=o.slug,e[3]=u):u=e[3];const l=Ae(u),[f,m]=K.useState(c),[x,g]=K.useState(!1),y=ye(),C=Gs[t.bindingType],h=Ss(t.configurationState);let p;e[4]!==c||e[5]!==d?(p=()=>{m(!1),c&&d()},e[4]=c,e[5]=d,e[6]=p):p=e[6];const v=p;let b;e[7]!==v||e[8]!==x?(b=V=>{if(!(!V&&x)){if(!V){v();return}m(!0)}},e[7]=v,e[8]=x,e[9]=b):b=e[9];const j=b;let N;e[10]!==r||e[11]!==i?(N=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:r,force:!0}})},e[10]=r,e[11]=i,e[12]=N):N=e[12];let S;e[13]!==t.title||e[14]!==v||e[15]!==o.id||e[16]!==y?(S=async()=>{await y.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),Re.success(`${t.title} desconectado`),v()},e[13]=t.title,e[14]=v,e[15]=o.id,e[16]=y,e[17]=S):S=e[17];let _;e[18]!==N||e[19]!==S?(_={mutationFn:N,onSuccess:S,onError:on},e[18]=N,e[19]=S,e[20]=_):_=e[20];const I=fe(_);if(!C)return null;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=()=>m(!0),e[21]=O):O=e[21];const R=`Configurar ${t.title}`;let E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(St,{size:16}),e[22]=E):E=e[22];let L;e[23]!==R?(L=s.jsx(vt,{asChild:!0,children:s.jsx(Q,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:O,"aria-label":R,children:E})}),e[23]=R,e[24]=L):L=e[24];const $=h.length>0?"Editar configuração":"Configurar";let P;e[25]!==$?(P=s.jsx(Ct,{children:$}),e[25]=$,e[26]=P):P=e[26];let M;e[27]!==L||e[28]!==P?(M=s.jsxs(bt,{children:[L,P]}),e[27]=L,e[28]=P,e[29]=M):M=e[29];let q;e[30]!==t.icon||e[31]!==t.title?(q=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=q):q=e[32];let w;e[33]!==t.title?(w=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(pt,{children:t.title}),s.jsxs(ht,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=w):w=e[34];let T;e[35]!==q||e[36]!==w?(T=s.jsxs(gt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[q,w]}),e[35]=q,e[36]=w,e[37]=T):T=e[37];let D;e[38]!==I?(D=()=>I.mutate(),e[38]=I,e[39]=D):D=e[39];let k;e[40]!==C||e[41]!==t||e[42]!==v||e[43]!==l||e[44]!==r||e[45]!==a||e[46]!==o||e[47]!==i||e[48]!==D?(k=s.jsx(C,{card:t,connectionId:r,companionClient:l,selfClient:i,org:o,contextSiteUrl:a,onDone:v,onDisconnect:D,onIsPendingChange:g}),e[40]=C,e[41]=t,e[42]=v,e[43]=l,e[44]=r,e[45]=a,e[46]=o,e[47]=i,e[48]=D,e[49]=k):k=e[49];let U;e[50]!==T||e[51]!==k?(U=s.jsxs(xt,{className:"sm:max-w-lg",children:[T,k]}),e[50]=T,e[51]=k,e[52]=U):U=e[52];let H;e[53]!==f||e[54]!==j||e[55]!==U?(H=s.jsx(yt,{open:f,onOpenChange:j,children:U}),e[53]=f,e[54]=j,e[55]=U,e[56]=H):H=e[56];let z;return e[57]!==M||e[58]!==H?(z=s.jsxs(s.Fragment,{children:[M,H]}),e[57]=M,e[58]=H,e[59]=z):z=e[59],z}function on(){Re.error("Não foi possível desconectar. Tente novamente.")}const He={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function rn(n){const e=F.c(40),{selfClient:t,org:o,cdConnectionId:i,siteUrl:r}=n;let a;e[0]!==i||e[1]!==o.id||e[2]!==o.slug?(a={connectionId:i,orgId:o.id,orgSlug:o.slug},e[0]=i,e[1]=o.id,e[2]=o.slug,e[3]=a):a=e[3];const c=Ae(a);let d;e[4]!==i||e[5]!==o.id?(d=Y.commerceDiscoveryCompanionSchema(o.id,i),e[4]=i,e[5]=o.id,e[6]=d):d=e[6];let u;e[7]!==c?(u=async()=>{const A=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return se(A)},e[7]=c,e[8]=u):u=e[8];let l;e[9]!==d||e[10]!==u?(l={queryKey:d,queryFn:u},e[9]=d,e[10]=u,e[11]=l):l=e[11];const f=he(l),m=ys(f.data?.stateSchema??{properties:{}}),x=m.map(gn),g=m.map(hn).filter(pn),y=m.filter(fn).map(mn),C=[...g,...y].sort().join(",");let h;e[12]!==i||e[13]!==o.id?(h=Y.commerceDiscoveryConnection(o.id,i),e[12]=i,e[13]=o.id,e[14]=h):h=e[14];let p;e[15]!==i||e[16]!==t?(p=async()=>{const A=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return se(A)},e[15]=i,e[16]=t,e[17]=p):p=e[17];let v;e[18]!==h||e[19]!==p?(v={queryKey:h,queryFn:p},e[18]=h,e[19]=p,e[20]=v):v=e[20];const j=he(v).data?.item?.configuration_state??null;let N;e[21]!==j?(N=A=>j?.[A.fieldKey]?.value,e[21]=j,e[22]=N):N=e[22];const S=m.map(N).filter(un),_=[...x.map(dn),...g.map(cn),...S.map(ln)].sort().join(","),O=he({queryKey:Y.commerceDiscoveryCompanionConnections(o.id,_),queryFn:async()=>{if(m.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:x},{field:["app_id"],operator:"in",value:g}];S.length>0&&A.push({field:["id"],operator:"in",value:S});const G=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return se(G)}}).data?.items??[],R=new Set(S),E=O.filter(A=>R.has(A.id)),L=E.filter(an);let $;e[23]!==o.id||e[24]!==o.slug?($=A=>({queryKey:Y.commerceDiscoveryCompanionOAuthStatus(o.id,A.id),queryFn:async()=>{try{const G=await fetch(`/api/${encodeURIComponent(o.slug)}/connections/${encodeURIComponent(A.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]=o.id,e[24]=o.slug,e[25]=$):$=e[25];const P=ms({queries:L.map($)});let M;e[26]!==P?(M=(A,G)=>[A.id,P[G]?.data?.hasToken===!0],e[26]=P,e[27]=M):M=e[27];const q=new Map(L.map(M)),w={};for(const A of E)w[A.id]=!A.oauth_config||!!A.connection_token||q.get(A.id)===!0;const T=he({queryKey:Y.commerceDiscoveryCompanionRegistry(o.id,C),queryFn:async()=>{if(m.length===0)return{items:[]};const A=bs(g,y),G=await es(Me.REGISTRY(o.id),o.id,o.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return se(G)}}),D={},k={};for(const A of T.data?.items??[])D[A.id]=A,A.server?.name&&(k[A.server.name]=A);let U;e[28]!==o.id||e[29]!==r?(U=Y.commerceDiscoveryConnectionStatus(o.id,r??""),e[28]=o.id,e[29]=r,e[30]=U):U=e[30];const H=!!r;let z;e[31]!==t||e[32]!==r?(z=async()=>{const A=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:r}});return se(A)},e[31]=t,e[32]=r,e[33]=z):z=e[33];let V;e[34]!==U||e[35]!==H||e[36]!==z?(V={queryKey:U,enabled:H,queryFn:z},e[34]=U,e[35]=H,e[36]=z,e[37]=V):V=e[37];const B=ve(V),W={};for(const[A,G]of Object.entries(Et)){const ie=B.data?.providers?.[G];ie?.connected&&ie.via==="sa"&&(W[A]={resource:ie.resource??null})}const J=Is({requirements:m,itemsById:D,itemsByName:k,connections:O,connectionReadiness:w,configurationState:j,curated:He,saBindings:W});let te;return e[38]!==J?(te={cards:J},e[38]=J,e[39]=te):te=e[39],te}function an(n){return n.oauth_config&&!n.connection_token}function ln(n){return`linked:${n}`}function cn(n){return`app:${n}`}function dn(n){return`binding:${n}`}function un(n){return typeof n=="string"&&n.length>0}function mn(n){return n.bindingType}function fn(n){return!He[n.bindingType]}function pn(n){return!!n}function hn(n){return He[n.bindingType]?.registryAppId}function gn(n){return n.bindingType}function xn({selfClient:n,org:e,userId:t,cdConnectionId:o,domain:i,siteUrl:r}){const a=ye(),[c,d]=K.useState(null),[u,l]=K.useState(null),f=async(x,g)=>{const y=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:x,data:g}});return se(y)};async function m(x){d(x.fieldKey),l(null);const g={app_name:x.title,field_key:x.fieldKey,organization_id:e.id,domain:i,site_url:r};ee("commerce_onboarding_companion_connect_clicked",g);try{let y=x.candidateConnectionId;if(!y){const j=ts(x.registryItem,e.id,t,{remoteIndex:0}),N=j.connection_type==="STDIO",S=!!j.connection_url,_=N&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!S&&!_)return ee("commerce_onboarding_companion_connect_failed",{...g,error:"no_connection_method"}),l(`${x.title} cannot be connected: no connection method available`),!1;const I=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:j}});y=se(I).item.id}const C=y,h=await ls({connectionId:C,orgId:e.id,orgSlug:e.slug,persistFallback:j=>f(C,{connection_token:j}).then(()=>{})});if(!h.ok)return ee("commerce_onboarding_companion_connect_failed",{...g,error:h.error}),l(`Couldn't sign in to ${x.title}: ${h.error}`),!1;const p=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),v=se(p).item?.configuration_state??null,b=vs(v,x.fieldKey,x.bindingType,C);return await f(o,{configuration_state:b}),await a.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,o)}),await a.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ee("commerce_onboarding_companion_connected",g),!0}catch(y){return ee("commerce_onboarding_companion_connect_failed",{...g,error:y instanceof Error?y.message:String(y)}),l(y instanceof Error?y.message:String(y)),!1}finally{d(null)}}return{connect:m,connectingFieldKey:c,error:u}}const Qe="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Ge(){const n=F.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h1",{className:"text-2xl font-medium leading-8 text-foreground",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),n[0]=e):e=n[0],e}function yn(){const n=F.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(bn)}),n[0]=e):e=n[0],e}function bn(n){return s.jsx(Xs,{},n)}function Be(){const n=F.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Qe,children:[s.jsx(Ge,{}),s.jsx(yn,{})]}),n[0]=e):e=n[0],e}function vn(n){const e=F.c(5),{onRetry:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ge,{}),e[0]=o):o=e[0];let i,r;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),r=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=r):(i=e[1],r=e[2]);let a;return e[3]!==t?(a=s.jsxs("div",{className:Qe,children:[o,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,r,s.jsx(Q,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=a):a=e[4],a}function Cn(n){const e=F.c(2);let t;return e[0]!==n?(t=s.jsx(at,{children:o=>{const{reset:i}=o;return s.jsx(lt,{fallback:r=>{const{resetError:a}=r;return s.jsx(vn,{onRetry:()=>{i(),a()}})},children:s.jsx(K.Suspense,{fallback:s.jsx(Be,{}),children:s.jsx(jn,{...n})})})}}),e[0]=n,e[1]=t):t=e[1],t}function jn(n){const e=F.c(42),{org:t,cdConnectionId:o,siteUrl:i,onReadinessChange:r}=n,{data:a}=ke.useSession(),c=a?.user?.id??"";let d;if(e[0]!==i){const I=i?ae(i):null;if(I?.ok)try{d=new URL(I.value).hostname}catch{d=void 0}e[0]=i,e[1]=d}else d=e[1];let u;e[2]!==t.id||e[3]!==t.slug?(u={connectionId:mt,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=u):u=e[4];const l=Ae(u);let f;e[5]!==o||e[6]!==t||e[7]!==l||e[8]!==i?(f={selfClient:l,org:t,cdConnectionId:o,siteUrl:i},e[5]=o,e[6]=t,e[7]=l,e[8]=i,e[9]=f):f=e[9];const{cards:m}=rn(f);let x;e[10]!==o||e[11]!==t||e[12]!==l||e[13]!==d||e[14]!==i||e[15]!==c?(x={selfClient:l,org:t,userId:c,cdConnectionId:o,domain:d,siteUrl:i},e[10]=o,e[11]=t,e[12]=l,e[13]=d,e[14]=i,e[15]=c,e[16]=x):x=e[16];const{connect:g,connectingFieldKey:y,error:C}=xn(x),[h,p]=K.useState(null);if(r?.(m.length===0||m.some(Sn)),m.length===0)return null;const v=y!==null;let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ge,{}),e[17]=b):b=e[17];let j;e[18]!==C?(j=C&&s.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:C}),e[18]=C,e[19]=j):j=e[19];let N;if(e[20]!==h||e[21]!==v||e[22]!==m||e[23]!==g||e[24]!==y||e[25]!==t||e[26]!==l||e[27]!==i){let I;e[29]!==h||e[30]!==v||e[31]!==g||e[32]!==y||e[33]!==t||e[34]!==l||e[35]!==i?(I=O=>{const R=async()=>{await g(O)&&p(O.fieldKey)};return s.jsx(en,{card:O,connecting:y===O.fieldKey,disabled:v&&y!==O.fieldKey,org:t,selfClient:l,siteUrl:i,autoOpenConfigFieldKey:h,onAutoOpenConfigHandled:()=>p(E=>E===O.fieldKey?null:E),onConnect:()=>{R()}},O.fieldKey)},e[29]=h,e[30]=v,e[31]=g,e[32]=y,e[33]=t,e[34]=l,e[35]=i,e[36]=I):I=e[36],N=m.map(I),e[20]=h,e[21]=v,e[22]=m,e[23]=g,e[24]=y,e[25]=t,e[26]=l,e[27]=i,e[28]=N}else N=e[28];let S;e[37]!==N?(S=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:N}),e[37]=N,e[38]=S):S=e[38];let _;return e[39]!==j||e[40]!==S?(_=s.jsxs("div",{className:Qe,children:[b,s.jsxs(ze,{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-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,S]})]}),e[39]=j,e[40]=S,e[41]=_):_=e[41],_}function Sn(n){return n.satisfied}const We="https://decocms.com/agendar",_n="Precisa de ajuda? Fale conosco",Nn="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.",Ce=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],En="var(--brand-green-dark)";function Ye({siteUrl:n,email:e}){const t=new URL(We);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function wn(n){const e=F.c(12),{href:t,size:o,className:i,orgId:r}=n,a=t===void 0?We:t,c=o===void 0?"lg":o;let d;e[0]!==i?(d=oe("w-full",i),e[0]=i,e[1]=d):d=e[1];let u;e[2]!==r?(u=()=>ee("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:r}),e[2]=r,e[3]=u):u=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Nt,{size:16}),e[4]=l):l=e[4];let f;e[5]!==a||e[6]!==u?(f=s.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",onClick:u,children:["Agendar uma reunião",l]}),e[5]=a,e[6]=u,e[7]=f):f=e[7];let m;return e[8]!==c||e[9]!==d||e[10]!==f?(m=s.jsx(Q,{asChild:!0,variant:"outline",size:c,className:d,children:f}),e[8]=c,e[9]=d,e[10]=f,e[11]=m):m=e[11],m}function In(n){const e=F.c(10),{size:t}=n,o=t===void 0?72:t;let i;e[0]!==o?(i=Math.round(o*.3),e[0]=o,e[1]=i):i=e[1];const r=i;let a;e[2]!==o?(a={height:o},e[2]=o,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==o?(c=Ce.map((u,l)=>s.jsxs("div",{className:"relative shrink-0",style:{width:o,height:o,marginLeft:l===0?0:-r,zIndex:Ce.length-l},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:u.photo,alt:u.alt,className:"h-full w-full object-cover",loading:"lazy"})}),l===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},u.photo)),e[4]=r,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=s.jsx("div",{className:"flex items-end",style:a,children:c}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function Je(n){const e=F.c(6),{href:t,orgId:o}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:En}}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(In,{})}),e[1]=r):r=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:_n}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:Nn})]}),e[2]=a):a=e[2];let c;return e[3]!==t||e[4]!==o?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[r,a,s.jsx(wn,{href:t,size:"lg",className:"mt-6",orgId:o})]})]})}),e[3]=t,e[4]=o,e[5]=c):c=e[5],c}function On(n){const e=F.c(13),{className:t,href:o,orgId:i}=n,r=o===void 0?We:o;let a;e[0]!==i?(a=()=>ee("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==t?(c=oe("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=c):c=e[3];let d,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={height:44,width:44+2*Math.round(30.799999999999997)},u=Ce.map(Tn),e[4]=d,e[5]=u):(d=e[4],u=e[5]);let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:d,children:[u,s.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-3 w-3 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:Ce.length+1}})]}),e[6]=l):l=e[6];let f,m;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs("span",{className:"flex-1 text-base font-medium leading-5 text-foreground",children:["Precisa de ajuda?",s.jsx("br",{}),"Fale conosco"]}),m=s.jsx(Nt,{size:18,className:"shrink-0 text-muted-foreground"}),e[7]=f,e[8]=m):(f=e[7],m=e[8]);let x;return e[9]!==r||e[10]!==a||e[11]!==c?(x=s.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",onClick:a,className:c,children:[l,f,m]}),e[9]=r,e[10]=a,e[11]=c,e[12]=x):x=e[12],x}function Tn(n,e){return s.jsx("span",{className:"absolute block h-11 w-11 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(30.799999999999997),zIndex:Ce.length-e},children:s.jsx("img",{src:n.photo,alt:n.alt,className:"h-full w-full object-cover",loading:"lazy"})},n.photo)}function It(n){const e=F.c(10),{host:t}=n,o=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),r=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),a=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=r,e[2]=a):(i=e[0],r=e[1],a=e[2]);let c;e[3]!==o?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:o,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==d?(u=s.jsxs("div",{className:"flex items-center gap-3",children:[i,r,a,c,d]}),e[7]=c,e[8]=d,e[9]=u):u=e[9],u}const Rn={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function kn(n){return Rn[n]}function Ze(n){const e=F.c(4),{variant:t}=n;let o;e[0]!==t?(o=kn(t),e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=s.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:s.jsx(Le,{label:o,className:"text-muted-foreground"})}),e[2]=o,e[3]=i):i=e[3],i}function ri(){const n=F.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ln,{}),n[0]=e):e=n[0],e}const Ot=K.createContext(null),Tt=()=>K.useContext(Ot);function ne(n){const e=F.c(13);let t,o;e[0]!==n?({visual:o,...t}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/commerce-onboarding"},e[3]=i):i=e[3];const r=ct(i),{data:a}=ke.useSession(),c=a?.user?.email;let d;e[4]!==r.siteUrl||e[5]!==c?(d=Ye({siteUrl:r.siteUrl,email:c}),e[4]=r.siteUrl,e[5]=c,e[6]=d):d=e[6];const u=d;let l;e[7]!==u||e[8]!==o?(l=o??s.jsx(Je,{href:u}),e[7]=u,e[8]=o,e[9]=l):l=e[9];let f;return e[10]!==t||e[11]!==l?(f=s.jsx(Wt,{...t,visual:l}),e[10]=t,e[11]=l,e[12]=f):f=e[12],f}const An={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:n=>`Código enviado para ${n}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:n=>`Continuar com ${n}`,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 pe(n){if(!n)return null;const e=ae(n);return e.ok?new URL(e.value).hostname:null}function ot(n){switch(n){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 n}}let it=!1;function Ln(){const n=ct({from:"/commerce-onboarding"}),{org:e,siteUrl:t}=n,o=pe(t);return!it&&Ht()&&(it=!0,ee("commerce_onboarding_viewed",{site_url:t,domain:o??void 0,...o?{$set:{last_scanned_domain:o}}:{}})),s.jsx(Ot.Provider,{value:o,children:s.jsx(Pn,{requestedOrgSlug:e,siteUrl:t})})}function Pn(n){const e=F.c(8),{requestedOrgSlug:t,siteUrl:o}=n,{data:i,isPending:r}=ke.useSession(),a=Tt();if(r){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ne,{children:s.jsx(Ze,{variant:"generic"})}),e[0]=d):d=e[0],d}if(!i){const d=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==a?(u=a?s.jsx(It,{host:a}):void 0,e[1]=a,e[2]=u):u=e[2];let l;return e[3]!==u?(l=s.jsx(ne,{children:s.jsx(Bt,{callbackUrl:d,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:u,copy:An})}),e[3]=u,e[4]=l):l=e[4],l}let c;return e[5]!==t||e[6]!==o?(c=s.jsx(Un,{requestedOrgSlug:t,siteUrl:o}),e[5]=t,e[6]=o,e[7]=c):c=e[7],c}function Un(n){const e=F.c(43),{requestedOrgSlug:t,siteUrl:o}=n,i=dt(),r=Qt(),[a,c]=K.useState(null),[d,u]=K.useState(null),l=r.data?.map($n)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:zn,retry:!1,onSuccess:p=>{u(p)}},e[0]=f):f=e[0];const m=fe(f);if(r.isPending){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ne,{children:s.jsx(Ze,{variant:"workspace"})}),e[1]=p):p=e[1],p}if(r.error){let p;return e[2]!==r?(p=s.jsx(Te,{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:()=>r.refetch()}),e[2]=r,e[3]=p):p=e[3],p}const x=t?l.find(p=>p.slug===t):null;if(x){let p;return e[4]!==x||e[5]!==o?(p=s.jsx(Ie,{org:x,initialSiteUrl:o}),e[4]=x,e[5]=o,e[6]=p):p=e[6],p}if(t){let p;return e[7]!==r?(p=s.jsx(Te,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>r.refetch()}),e[7]=r,e[8]=p):p=e[8],p}if(a){let p;return e[9]!==a||e[10]!==o?(p=s.jsx(Ie,{org:a,initialSiteUrl:o}),e[9]=a,e[10]=o,e[11]=p):p=e[11],p}if(l.length===1&&l[0]){let p;return e[12]!==l[0]||e[13]!==o?(p=s.jsx(Ie,{org:l[0],initialSiteUrl:o}),e[12]=l[0],e[13]=o,e[14]=p):p=e[14],p}if(l.length>1){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(re,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=p):p=e[15];let v;e[16]!==i||e[17]!==o?(v=j=>i({to:"/commerce-onboarding",search:{org:j.slug,siteUrl:o}}),e[16]=i,e[17]=o,e[18]=v):v=e[18];let b;return e[19]!==l||e[20]!==v?(b=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[p,s.jsx(ze,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(et,{organizations:l,selectLabel:"Continuar",onSelected:v})})]})}),e[19]=l,e[20]=v,e[21]=b):b=e[21],b}if(!d){let p;e[22]!==m?(p=()=>{m.reset(),m.mutate()},e[22]=m,e[23]=p):p=e[23];let v;return e[24]!==m||e[25]!==p?(v=s.jsx(Dn,{mutation:m,onRetry:p}),e[24]=m,e[25]=p,e[26]=v):v=e[26],v}const g=d;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let p;return e[27]!==g.organization||e[28]!==o?(p=s.jsx(Ie,{org:g.organization,initialSiteUrl:o}),e[27]=g.organization,e[28]=o,e[29]=p):p=e[29],p}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let p;e[30]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(re,{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[30]=p):p=e[30];const v=g.domain??void 0;let b;e[31]!==i||e[32]!==o?(b=(N,S)=>{ut(),c({...N,slug:S}),i({to:"/commerce-onboarding",search:{org:S,siteUrl:o}})},e[31]=i,e[32]=o,e[33]=b):b=e[33];let j;return e[34]!==g.organizations||e[35]!==v||e[36]!==b?(j=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[p,s.jsx(ze,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(et,{organizations:g.organizations,domain:v,onJoined:b})})]})}),e[34]=g.organizations,e[35]=v,e[36]=b,e[37]=j):j=e[37],j}const y=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let C;e[38]!==m?(C=()=>{u(null),m.reset()},e[38]=m,e[39]=C):C=e[39];let h;return e[40]!==y||e[41]!==C?(h=s.jsx(Te,{title:"O onboarding de commerce precisa de suporte",description:y,actionLabel:"Tentar novamente",onRetry:C}),e[40]=y,e[41]=C,e[42]=h):h=e[42],h}async function zn(){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&&ut(),e}function $n(n){return{id:n.id,name:n.name,slug:n.slug,logo:n.logo??null}}function Dn(n){const e=F.c(7),{mutation:t,onRetry:o}=n,i=K.useRef(!1);let r;e[0]!==t?(r=u=>{!u||i.current||(i.current=!0,t.mutate())},e[0]=t,e[1]=r):r=e[1];const a=r;if(t.error){let u;return e[2]!==o?(u=s.jsx(Te,{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:o}),e[2]=o,e[3]=u):u=e[3],u}let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ze,{variant:"generic"}),e[4]=c):c=e[4];let d;return e[5]!==a?(d=s.jsx(ne,{children:s.jsx("div",{ref:a,children:c})}),e[5]=a,e[6]=d):d=e[6],d}function re(n){const e=F.c(8),{title:t,description:o}=n,i=Tt();let r;e[0]!==i?(r=i?s.jsx(It,{host:i}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==o||e[3]!==t?(a=(t||o)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),o&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:o})]}),e[2]=o,e[3]=t,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==a?(c=s.jsxs("div",{className:"grid gap-10",children:[r,a]}),e[5]=r,e[6]=a,e[7]=c):c=e[7],c}function Te(n){const e=F.c(9),{title:t,description:o,actionLabel:i,onRetry:r}=n;let a;e[0]!==o||e[1]!==t?(a=s.jsx(re,{title:t,description:o}),e[0]=o,e[1]=t,e[2]=a):a=e[2];let c;e[3]!==i||e[4]!==r?(c=s.jsx(Q,{type:"button",size:"xl",className:"w-full",onClick:r,children:i}),e[3]=i,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==a||e[7]!==c?(d=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[a,c]})}),e[6]=a,e[7]=c,e[8]=d):d=e[8],d}function Mn(n){return n.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function we(n){const e=n;if(e.isError)throw new Error(Mn(e));return e.structuredContent??n}function Ie(n){const e=F.c(11),{org:t,initialSiteUrl:o}=n,{data:i}=ke.useSession(),r=i?.user?.email;let a;e[0]!==o||e[1]!==r?(a=Ye({siteUrl:o,email:r}),e[0]=o,e[1]=r,e[2]=a):a=e[2];const c=a;let d;e[3]!==c||e[4]!==t.id?(d=s.jsx(Je,{href:c,orgId:t.id}),e[3]=c,e[4]=t.id,e[5]=d):d=e[5];const u=d;let l;return e[6]!==o||e[7]!==u||e[8]!==t||e[9]!==i?.user?.email?(l=s.jsx(at,{children:f=>{const{reset:m}=f;return s.jsx(lt,{fallback:x=>{const{error:g,resetError:y}=x;return s.jsx(ne,{visual:u,children:s.jsx(qn,{orgName:t.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{m(),y()}})})},children:s.jsx(K.Suspense,{fallback:s.jsx(Rt,{visual:u}),children:s.jsx(Fn,{org:t,initialSiteUrl:o,sessionEmail:i?.user?.email},`${t.id}:${o??""}`)})})}}),e[6]=o,e[7]=u,e[8]=t,e[9]=i?.user?.email,e[10]=l):l=e[10],l}function Rt(n){const e=F.c(3),{visual:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[s.jsx(re,{}),s.jsx(Be,{})]}),e[0]=o):o=e[0];let i;return e[1]!==t?(i=s.jsx(ne,{align:"fill",visual:t,children:o}),e[1]=t,e[2]=i):i=e[2],i}function qn(n){const e=F.c(10),{orgName:t,message:o,onRetry:i}=n,r=`A configuração de commerce continuará em ${t}.`;let a;e[0]!==r?(a=s.jsx(re,{title:"Diagnóstico de commerce",description:r}),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==o?(c=s.jsx(je,{message:o}),e[2]=o,e[3]=c):c=e[3];let d;e[4]!==i?(d=s.jsx(Q,{type:"button",size:"xl",className:"w-full",onClick:i,children:"Tentar novamente"}),e[4]=i,e[5]=d):d=e[5];let u;return e[6]!==a||e[7]!==c||e[8]!==d?(u=s.jsxs("div",{className:"grid gap-10",children:[a,c,d]}),e[6]=a,e[7]=c,e[8]=d,e[9]=u):u=e[9],u}function Fn({org:n,initialSiteUrl:e,sessionEmail:t}){const o=dt(),i=Ae({connectionId:mt,orgId:n.id,orgSlug:n.slug}),[r,a]=K.useState(e??""),[c,d]=K.useState(null),[u,l]=K.useState(null),f=K.useRef(!1),m=Me.COMMERCE_DISCOVERY(n.id),x=Jt(n.id),g=he({queryKey:Y.commerceDiscoveryConnection(n.id,m),queryFn:async()=>{const w=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:m}});return we(w)},retry:!1}),y=he({queryKey:Y.commerceDiscoveryVirtualMcp(n.id,x),queryFn:async()=>{const w=await i.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return we(w)},retry:!1}),C=fe({mutationFn:async w=>{const T=await i.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:w}});return we(T)},retry:!1,onSuccess:(w,T)=>{ee("commerce_onboarding_setup_succeeded",{domain:pe(T)??void 0,organization_id:n.id}),d(w),l(null),g.refetch(),y.refetch()},onError:(w,T)=>{ee("commerce_onboarding_setup_failed",{domain:pe(T)??void 0,organization_id:n.id,error:w instanceof Error?w.message:String(w)}),l(w instanceof Error?w.message:"A configuração do Commerce Discovery falhou.")}}),h=fe({mutationFn:async w=>{const T=await i.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:w}});return we(T)},retry:!1}),[p,v]=K.useState(null),b=!!g.data.item&&!!y.data.item,j=g.data.item,N=typeof j?.metadata?.siteUrl=="string"?j.metadata.siteUrl:void 0,_=xs(e||r||"",N),I=b&&_,O=e||r||N||"",R=Ye({siteUrl:O,email:t}),E=s.jsx(Je,{href:R,orgId:n.id}),L=w=>{const T=ae(w);if(!T.ok){l(ot(T.error));return}l(null),C.mutate(T.value)},$=w=>{!w||f.current||I||!e||(f.current=!0,L(e))},P=w=>{w.preventDefault();const T=ae(r);T.ok&&ee("commerce_onboarding_site_url_submitted",{domain:new URL(T.value).hostname,organization_id:n.id}),L(r)},M=c?.reportApp??{connectionId:m,virtualMcpId:x,toolName:Zt},q=async()=>{v(null),ee("commerce_onboarding_open_report_clicked",{domain:pe(O)??void 0,organization_id:n.id});const w=ae(O);if(w.ok)try{const T=await h.mutateAsync(w.value);if(!T.triggered){ee("commerce_onboarding_run_failed",{domain:pe(O)??void 0,organization_id:n.id,error:T.reason??"not_triggered"}),v("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(T){ee("commerce_onboarding_run_failed",{domain:pe(O)??void 0,organization_id:n.id,error:T instanceof Error?T.message:String(T)}),v("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Gt.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:M.virtualMcpId,main:Yt(M.connectionId,M.toolName),chat:0}})};if(I)return s.jsx(Kn,{org:n,reportApp:M,onOpenReport:q,isSubmitting:h.isPending,error:p,meetingUrl:R,meetingVisual:E,siteUrl:O});if(C.isPending)return s.jsx(Rt,{visual:E});if(e){const w=ae(e);return w.ok?s.jsx(ne,{visual:E,children:s.jsxs("div",{ref:$,className:"grid gap-10",children:[s.jsx(re,{title:"Diagnóstico de commerce",description:`O Commerce Discovery está sendo preparado para ${w.value}.`}),u?s.jsxs(s.Fragment,{children:[s.jsx(je,{message:u}),s.jsx(Pe,{siteUrl:r,error:null,isSubmitting:C.isPending,onSiteUrlChange:a,onSubmit:P})]}):s.jsx(Be,{})]})}):s.jsx(ne,{visual:E,children:s.jsxs("div",{className:"grid gap-10",children:[s.jsx(re,{title:"Diagnóstico de commerce",description:`A configuração de commerce continuará em ${n.name}.`}),s.jsx(je,{message:ot(w.error)}),s.jsx(Pe,{siteUrl:r,error:u,isSubmitting:C.isPending,onSiteUrlChange:a,onSubmit:P})]})})}return s.jsx(ne,{visual:E,children:s.jsxs("div",{className:"grid gap-10",children:[s.jsx(re,{title:"Diagnóstico de commerce",description:`A configuração de commerce continuará em ${n.name}.`}),s.jsx(Pe,{siteUrl:r,error:u,isSubmitting:C.isPending,onSiteUrlChange:a,onSubmit:P})]})})}function Pe(n){const e=F.c(20),{siteUrl:t,error:o,isSubmitting:i,onSiteUrlChange:r,onSubmit:a}=n;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=c):c=e[0];let d;e[1]!==r?(d=C=>r(C.target.value),e[1]=r,e[2]=d):d=e[2];const u=!!o;let l;e[3]!==i||e[4]!==t||e[5]!==d||e[6]!==u?(l=s.jsx(be,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:d,placeholder:"https://example.com","aria-invalid":u,disabled:i}),e[3]=i,e[4]=t,e[5]=d,e[6]=u,e[7]=l):l=e[7];let f;e[8]!==o?(f=o?s.jsx(je,{message:o}):null,e[8]=o,e[9]=f):f=e[9];let m;e[10]!==l||e[11]!==f?(m=s.jsxs("div",{className:"grid gap-2",children:[c,l,f]}),e[10]=l,e[11]=f,e[12]=m):m=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ft,{size:16}),e[13]=x):x=e[13];let g;e[14]!==i?(g=s.jsxs(Q,{type:"submit",size:"xl",className:"w-full",disabled:i,children:["Continuar",x]}),e[14]=i,e[15]=g):g=e[15];let y;return e[16]!==a||e[17]!==m||e[18]!==g?(y=s.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[m,g]}),e[16]=a,e[17]=m,e[18]=g,e[19]=y):y=e[19],y}function Kn(n){const e=F.c(27),{org:t,reportApp:o,onOpenReport:i,isSubmitting:r,error:a,meetingUrl:c,meetingVisual:d,siteUrl:u}=n,[l,f]=K.useState(!0);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(re,{}),e[0]=m):m=e[0];let x;e[1]!==t||e[2]!==o.connectionId||e[3]!==u?(x=s.jsx(Cn,{org:t,cdConnectionId:o.connectionId,siteUrl:u,onReadinessChange:f}),e[1]=t,e[2]=o.connectionId,e[3]=u,e[4]=x):x=e[4];let g;e[5]!==c||e[6]!==t.id?(g=s.jsx(On,{className:"md:hidden",href:c,orgId:t.id}),e[5]=c,e[6]=t.id,e[7]=g):g=e[7];let y;e[8]!==a?(y=a?s.jsx(je,{message:a}):null,e[8]=a,e[9]=y):y=e[9];const C=r||!o.virtualMcpId||!l,h=r?"Abrindo relatório...":"Ver relatório completo";let p;e[10]!==r?(p=r?null:s.jsx(ft,{size:18}),e[10]=r,e[11]=p):p=e[11];let v;e[12]!==i||e[13]!==C||e[14]!==h||e[15]!==p?(v=s.jsxs(Q,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:i,disabled:C,children:[h,p]}),e[12]=i,e[13]=C,e[14]=h,e[15]=p,e[16]=v):v=e[16];let b;e[17]!==g||e[18]!==y||e[19]!==v?(b=s.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[g,y,v]}),e[17]=g,e[18]=y,e[19]=v,e[20]=b):b=e[20];let j;e[21]!==x||e[22]!==b?(j=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[m,x,b]}),e[21]=x,e[22]=b,e[23]=j):j=e[23];let N;return e[24]!==d||e[25]!==j?(N=s.jsx(ne,{align:"fill",visual:d,children:j}),e[24]=d,e[25]=j,e[26]=N):N=e[26],N}function je(n){const e=F.c(2),{message:t}=n;let o;return e[0]!==t?(o=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=o):o=e[1],o}export{ri as default};
@@ -1 +1 @@
1
- import{c as v,D as w,K as z,k as M,j as s,r as T,B as I,l as L}from"./index-thaZU0eY.js";import{a as S,b as D,c as E,d as R,e as _}from"./dialog-DTR6Ld8R.js";import{S as $}from"./chat-context-p7bQrjVO.js";import{i as A}from"./Check-WJIsHzDQ.js";import{a as B}from"./Copy01-gjq995Op.js";import{u as F}from"./studio-tools-C88q8wAb.js";const y={online:!1,capabilities:[],ready:!1};function K(a){const e=v.c(9),{org:n}=w(),i=F(),o=a?.fast??!1;let t;e[0]!==n.id?(t=z.currentLink(n.id),e[0]=n.id,e[1]=t):t=e[1];let l;e[2]!==i?(l=async()=>{const u=await i.call("LINK_CURRENT_GET",{});return u?{...u,ready:!0}:{...y,ready:!0}},e[2]=i,e[3]=l):l=e[3];const d=o?1e3:1e4,g=o?2e3:15e3;let r;e[4]!==t||e[5]!==l||e[6]!==d||e[7]!==g?(r={queryKey:t,queryFn:l,staleTime:d,refetchInterval:g,refetchOnWindowFocus:!0},e[4]=t,e[5]=l,e[6]=d,e[7]=g,e[8]=r):r=e[8];const{data:c}=M(r);return c??y}function O(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}function P(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}const N="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(O,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(P,{size:18})}];function U(a){return k.filter(e=>a.includes(e.capability)).map(e=>e.label)}function J(a){const e=v.c(23),{open:n,onOpenChange:i}=a;let o;e[0]!==n?(o={fast:n},e[0]=n,e[1]=o):o=e[1];const t=K(o),[l,d]=T.useState(!1),g=t.hostname??t.machineId??"Your desktop",r=t.online?`Connected to ${g}`:"Connect your desktop";let c;e[2]!==r?(c=s.jsx(S,{children:r}),e[2]=r,e[3]=c):c=e[3];const u=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 m;e[4]!==u?(m=s.jsx(D,{children:u}),e[4]=u,e[5]=m):m=e[5];let x;e[6]!==c||e[7]!==m?(x=s.jsxs(E,{children:[c,m]}),e[6]=c,e[7]=m,e[8]=x):x=e[8];let f;e[9]!==l||e[10]!==t.online?(f=!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:N}),s.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(N),d(!0),setTimeout(()=>d(!1),1500)},children:l?s.jsx(A,{size:14}):s.jsx(B,{size:14})})]}),e[9]=l,e[10]=t.online,e[11]=f):f=e[11];let p;e[12]!==t.capabilities||e[13]!==t.online?(p=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:k.map(b=>{const C=t.capabilities.includes(b.capability);return s.jsxs("div",{className:L("flex items-center gap-3 rounded-md border px-3 py-2",C?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:L("flex size-6 items-center justify-center",C?"text-foreground":"text-muted-foreground"),children:b.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:b.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:C?b.description:"Not detected"})]}),s.jsx("span",{className:L("size-2 rounded-full",C?"bg-success":"bg-muted-foreground/30")})]},b.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx($,{size:"sm"}),"Waiting for desktop…"]}),e[12]=t.capabilities,e[13]=t.online,e[14]=p):p=e[14];let h;e[15]!==x||e[16]!==f||e[17]!==p?(h=s.jsxs(R,{className:"sm:max-w-md",children:[x,f,p]}),e[15]=x,e[16]=f,e[17]=p,e[18]=h):h=e[18];let j;return e[19]!==i||e[20]!==n||e[21]!==h?(j=s.jsx(_,{open:n,onOpenChange:i,children:h}),e[19]=i,e[20]=n,e[21]=h,e[22]=j):j=e[22],j}export{J as C,O as a,P as b,K as u,U as v};
1
+ import{c as v,Z as w,K as z,k as M,j as s,r as T,B as I,l as L}from"./index-DcsErluY.js";import{a as S,b as E,c as R,d as D,e as _}from"./dialog-wZUkxFBf.js";import{S as $}from"./chat-context-CCC-Byca.js";import{i as A}from"./Check-BxViL4rK.js";import{a as B}from"./Copy01-Ctt9FUbb.js";import{u as F}from"./studio-tools-ajGrecV2.js";const y={online:!1,capabilities:[],ready:!1};function K(a){const e=v.c(9),{org:n}=w(),i=F(),o=a?.fast??!1;let t;e[0]!==n.id?(t=z.currentLink(n.id),e[0]=n.id,e[1]=t):t=e[1];let l;e[2]!==i?(l=async()=>{const u=await i.call("LINK_CURRENT_GET",{});return u?{...u,ready:!0}:{...y,ready:!0}},e[2]=i,e[3]=l):l=e[3];const d=o?1e3:1e4,g=o?2e3:15e3;let r;e[4]!==t||e[5]!==l||e[6]!==d||e[7]!==g?(r={queryKey:t,queryFn:l,staleTime:d,refetchInterval:g,refetchOnWindowFocus:!0},e[4]=t,e[5]=l,e[6]=d,e[7]=g,e[8]=r):r=e[8];const{data:c}=M(r);return c??y}function O(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}function P(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}const N="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(O,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(P,{size:18})}];function U(a){return k.filter(e=>a.includes(e.capability)).map(e=>e.label)}function Z(a){const e=v.c(23),{open:n,onOpenChange:i}=a;let o;e[0]!==n?(o={fast:n},e[0]=n,e[1]=o):o=e[1];const t=K(o),[l,d]=T.useState(!1),g=t.hostname??t.machineId??"Your desktop",r=t.online?`Connected to ${g}`:"Connect your desktop";let c;e[2]!==r?(c=s.jsx(S,{children:r}),e[2]=r,e[3]=c):c=e[3];const u=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 m;e[4]!==u?(m=s.jsx(E,{children:u}),e[4]=u,e[5]=m):m=e[5];let x;e[6]!==c||e[7]!==m?(x=s.jsxs(R,{children:[c,m]}),e[6]=c,e[7]=m,e[8]=x):x=e[8];let f;e[9]!==l||e[10]!==t.online?(f=!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:N}),s.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(N),d(!0),setTimeout(()=>d(!1),1500)},children:l?s.jsx(A,{size:14}):s.jsx(B,{size:14})})]}),e[9]=l,e[10]=t.online,e[11]=f):f=e[11];let p;e[12]!==t.capabilities||e[13]!==t.online?(p=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:k.map(b=>{const C=t.capabilities.includes(b.capability);return s.jsxs("div",{className:L("flex items-center gap-3 rounded-md border px-3 py-2",C?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:L("flex size-6 items-center justify-center",C?"text-foreground":"text-muted-foreground"),children:b.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:b.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:C?b.description:"Not detected"})]}),s.jsx("span",{className:L("size-2 rounded-full",C?"bg-success":"bg-muted-foreground/30")})]},b.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx($,{size:"sm"}),"Waiting for desktop…"]}),e[12]=t.capabilities,e[13]=t.online,e[14]=p):p=e[14];let h;e[15]!==x||e[16]!==f||e[17]!==p?(h=s.jsxs(D,{className:"sm:max-w-md",children:[x,f,p]}),e[15]=x,e[16]=f,e[17]=p,e[18]=h):h=e[18];let j;return e[19]!==i||e[20]!==n||e[21]!==h?(j=s.jsx(_,{open:n,onOpenChange:i,children:h}),e[19]=i,e[20]=n,e[21]=h,e[22]=j):j=e[22],j}export{Z as C,P as a,O as b,K as u,U as v};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,aV as k,K as D,l as E,j as x}from"./index-thaZU0eY.js";import{u as K}from"./use-registry-connections-BfySsVRx.js";import{c as Q}from"./use-organization-settings-CtWuj0-0.js";import{S as w}from"./constants-nH3qQ_1f.js";import{u as F}from"./useInfiniteQuery-Deh6Q8fX.js";import{c as H}from"./use-mcp-client-B7zSFiOA.js";import{i as V,f as q}from"./extract-connection-data-hbWCHJzS.js";import{C as G}from"./card-WdSE0wjZ.js";import{I as U}from"./integration-icon-zZ56Ie6s.js";function ce(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 ue(){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:P}=F({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=V(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await H({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const b=await C.callTool({name:j,arguments:I}),N=b.structuredContent??b,M=N.nextCursor||N.cursor||void 0,L=q(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:P,fetchNextPage:()=>{f&&!p&&d()}}}function fe(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 P=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]!==P||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:P,loadMore:a},t[10]=c,t[11]=P,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 de(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,P=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==P?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",P,d),e[0]=d,e[1]=P,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(U,{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 b;e[28]!==m?(b=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]=b):b=e[29];let N;e[30]!==I||e[31]!==b?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,b]}),e[30]=I,e[31]=b,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(G,{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{de as C,fe as a,ce as g,ue as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,Z as $,aV as k,K as D,l as E,j as x}from"./index-DcsErluY.js";import{u as K}from"./use-registry-connections-BvC5yqnv.js";import{c as Q}from"./use-organization-settings-QG8fys4M.js";import{S as w}from"./constants-B72Xmt_K.js";import{u as F}from"./useInfiniteQuery-W1abYeKO.js";import{c as H}from"./use-mcp-client-x-H3hM3X.js";import{i as V,f as q}from"./extract-connection-data-CguvuV8x.js";import{C as G}from"./card-BYZEQBt8.js";import{I as U}from"./integration-icon-BJkk8MWl.js";function ce(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 ue(){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:P}=F({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=V(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await H({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const b=await C.callTool({name:j,arguments:I}),N=b.structuredContent??b,M=N.nextCursor||N.cursor||void 0,L=q(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:P,fetchNextPage:()=>{f&&!p&&d()}}}function fe(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(z),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 P=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]!==P||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:P,loadMore:a},t[10]=c,t[11]=P,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function z(s){return A(s)}function W(s){return!A(s)}function de(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,P=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==P?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",P,d),e[0]=d,e[1]=P,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(U,{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 b;e[28]!==m?(b=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]=b):b=e[29];let N;e[30]!==I||e[31]!==b?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,b]}),e[30]=I,e[31]=b,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(G,{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{de as C,fe as a,ce as g,ue as u};
@@ -0,0 +1 @@
1
+ import{G as he,ab as Ie,a$ as Ae,H as le,a9 as $e,c as P,j as t,i as ge,B as V,r as q,l as je,Z as J,L as De,K as ne,b as Y,aF as ce,W as Pe,b0 as Oe,P as Me,e as ze,b1 as Ee,p as Ve,J as Ue,I as Fe,t as X,b2 as Re}from"./index-DcsErluY.js";import{a as Le}from"./extract-connection-data-CguvuV8x.js";import{E as ve}from"./empty-state-BdREyKTx.js";import{E as He,c as Be,r as We,b as Ge,d as Xe}from"./connection-form-helpers-CvE1GCwU.js";import{c as qe,S as Ke,V as Qe}from"./index-etRGW8hR.js";import{u as be,T as Je}from"./tools-list-yY8qipR7.js";import{u as Ye}from"./use-members-BAUKU0t0.js";import{A as Ze}from"./avatar-CVASN_n8.js";import{a as Ne,b as ye,u as et}from"./use-connection-BHlBIpYJ.js";import{u as _e}from"./use-mcp-client-x-H3hM3X.js";import{a as tt}from"./use-mcp-tools-BAOkrTmg.js";import{a as st}from"./use-mcp-prompts-CB2--qfn.js";import{i as nt,a as ot}from"./mcp-oauth-DkjiGs3f.js";import{I as oe}from"./integration-icon-BJkk8MWl.js";import{s as it}from"./Plus-CIMT0C1M.js";import{N as rt,O as at,ap as lt,al as ct}from"./agent-icon-32aZu8f8.js";import{a as Ce,s as dt}from"./Settings02-CTtq6YOs.js";import{s as re}from"./Trash01-DSTcxy5m.js";import{q as mt,p as ut,o as xt,m as pt,n as ft}from"./sidebar-BjPm3XPY.js";import{F as L,b as H,c as B,d as E,e as W,f as ht,a as gt}from"./form-D4Sjj2S5.js";import{I as G}from"./input-BLUXQaUJ.js";import{u as jt,D as vt}from"./use-delete-connection-Pr4HXWhs.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-BCom1l-r.js";import{u as kt}from"./studio-tools-ajGrecV2.js";import{u as Tt}from"./use-virtual-mcp-zN_q3qUT.js";import{i as Se}from"./ChevronRight-K3Ms28jw.js";import{a as we}from"./Users03-DGDUIZF4.js";import{b as ee,c as It,T as te,a as At}from"./tabs-BbeJw3E0.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-RhqrJVTN.js";import{d as Dt}from"./Tool01-woqhmM89.js";import{g as ae,M as Pt}from"./types-B4pxnIIx.js";import{C as Ot}from"./collection-search-i90jdNni.js";import{C as Mt}from"./card-BYZEQBt8.js";import{B as zt}from"./badge-DN1YW5R1.js";import{a as Et,b as Vt,D as Ut,c as de}from"./dropdown-menu-COQWVmxy.js";import{a as me,c as ue,d as xe,S as pe,b as R}from"./select-GP-G7CYY.js";import{i as Ft}from"./CheckCircle-Cz4tJUop.js";import{t as Rt}from"./ChevronDown-UniVHOcZ.js";import{n as Lt}from"./XCircle-JQbz9WmR.js";import{s as se}from"./Star01-Cw7wbAha.js";import{s as Ht}from"./XClose-CBrgKiaB.js";import"./constants-B72Xmt_K.js";import"./index-4ttWqKAk.js";import"./ZoomOut-nih9dlzQ.js";import"./Key01-BvoJKmt1.js";import"./auth-C9k5QFmE.js";import"./use-registry-connections-BvC5yqnv.js";import"./use-organization-settings-QG8fys4M.js";import"./index-E0XzXtgq.js";import"./index-D6_eTKF9.js";import"./index-tYXe55yO.js";import"./popover-jVjMjIDj.js";import"./tooltip-CX8JDN5z.js";import"./Check-BxViL4rK.js";import"./SearchMd-OCIrtgl8.js";import"./use-mobile-BNK4ZQXQ.js";import"./use-create-virtual-mcp-Cpq2-1Qg.js";import"./use-navigate-to-agent-B2zjxakj.js";import"./hooks-RNhoO-Id.js";import"./decopilot-sse-pool-CYJNLSex.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Eye-Bf8ySHj2.js";import"./use-org-auth-client-CT6ie6N1.js";import"./User01-D-uDYDK0.js";import"./use-collections-Dkob9Q0i.js";import"./AlertCircle-Npyn4_wF.js";import"./SwitchHorizontal01-BSEQu0PJ.js";import"./ArrowUpRight-zXVQKR-G.js";import"./Loading02-wU_DDeXK.js";import"./ChevronUp-C_JF1YJx.js";import"./Circle-iQbOlvwS.js";import"./Stars02-C6DKWb0j.js";import"./Copy01-Ctt9FUbb.js";import"./DotsVertical-Cnet9a8h.js";import"./Globe01-BCgVxayg.js";import"./FilterLines-DRa15Wby.js";import"./Globe04-BRhMXMEJ.js";import"./HardDrive-BaaJKDpq.js";import"./LayoutLeft-Bsqu0rxT.js";import"./LinkExternal01-bFRmolQv.js";import"./List-FyDw_upy.js";import"./Monitor01-rM21B5VM.js";import"./Sun-Cfq43Fjh.js";import"./Palette-Bq3VPed6.js";import"./Play-Dqv3vBUr.js";import"./SearchLg-BqF-kB3a.js";import"./Shield01-CCAMun7k.js";import"./Stars01-CXkCYhyc.js";import"./Upload01-DI1Xs1Z6.js";import"./Users01-DVmsZOTe.js";import"./X-DWrz2LqH.js";import"./Zap-NoORqLvM.js";import"./label-CW0QYigh.js";import"./alert-dialog-DBrNjdaV.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Gt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(rt,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(at,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=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]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:i}=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 a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,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 c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:i}),children:t.jsx(Gt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,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]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(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 Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=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()}),h]}),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:Yt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),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"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(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 ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){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 os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=q.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,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 is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=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]!==d||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:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,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 as(s){const e=P.c(7),{connection:n}=s,{org:i}=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 d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.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=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"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(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},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:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,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 cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=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&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=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]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,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(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(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 f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(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 us(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($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(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 xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??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 a;e[3]!==r?(a=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]=a):a=e[4];let d;e[5]!==n.description?(d=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]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,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 fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||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:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{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:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.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:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(G,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...c,value:c.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:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{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:i,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.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:()=>c.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(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(G,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ht,{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 hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(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 i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);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 vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=jt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=qe(k,Wt),f=Ue({resolver:Fe(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),F=h?.id??e;await x.update.mutateAsync({id:F,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!$){X.error(`Authentication failed: ${F}`);return}if(D)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:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});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:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});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()}),X.success("Authentication successful")},z=()=>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 D=await m.text();X.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...c}),t.jsx(mt,{open:h!==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:h?.title??s.title}),t.jsx(ft,{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,{...f,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:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(G,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(G,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[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(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),X.success($==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.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(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){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 i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=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??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);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(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const F of D)z.has(F.name)||(z.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function bo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{bo as default};
@@ -1 +1 @@
1
- import{o as R,ay as A,a$ as I,s as a,aw as j,ax as z,c as L,j as u,B as C}from"./index-thaZU0eY.js";import{I as H}from"./input-DEr8h15j.js";import{s as W}from"./Plus-CoqGiEoW.js";import{s as $}from"./Trash01-2bgd5rb5.js";const q=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(q).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 K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function 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:K(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($,{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{G as R,ab as A,a$ as I,H as a,a9 as j,aa as z,c as L,j as u,B as C}from"./index-DcsErluY.js";import{I as H}from"./input-BLUXQaUJ.js";import{s as W}from"./Plus-CIMT0C1M.js";import{s as $}from"./Trash01-DSTcxy5m.js";const q=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(q).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 K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function 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:K(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($,{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};