decocms 3.26.2 → 3.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-9EFUZenf.js → AlertCircle-DTxB9pUH.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-97355q5v.js → ArrowUpRight-zXKZw2Xb.js} +1 -1
- package/dist/client/assets/{Check-D-9dblUn.js → Check-CTLrORIv.js} +1 -1
- package/dist/client/assets/{CheckCircle-C2ualSpf.js → CheckCircle-BUQijftD.js} +1 -1
- package/dist/client/assets/{ChevronDown-Cf2Q-GlB.js → ChevronDown-CE2QQfze.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BaV4nFMQ.js → ChevronLeft-Cu7s4gqK.js} +1 -1
- package/dist/client/assets/{ChevronRight-CrZy8tHx.js → ChevronRight-VGojeAFz.js} +1 -1
- package/dist/client/assets/{ChevronUp-BAxoXhnT.js → ChevronUp-4IXM99ti.js} +1 -1
- package/dist/client/assets/{Container-CYcITvPW.js → Container-BoFlhIZL.js} +1 -1
- package/dist/client/assets/{DotsVertical-SvwN4CeV.js → DotsVertical--R-pmXe3.js} +1 -1
- package/dist/client/assets/{Eye-ByuwKsdh.js → Eye-pMhw6sUG.js} +1 -1
- package/dist/client/assets/{FilterLines-BJZdiggU.js → FilterLines-Bz8yyibx.js} +1 -1
- package/dist/client/assets/{Globe01-DfGFlik1.js → Globe01-Cp3X_WfB.js} +1 -1
- package/dist/client/assets/{HardDrive-DNFvbooP.js → HardDrive-BH54c3De.js} +1 -1
- package/dist/client/assets/{Key01-CzmPnHuw.js → Key01-CfBifHqv.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CQ8Vq9nI.js → LayoutLeft-DhbihSgJ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CgI1VTqi.js → LinkExternal01-BGLjTHSM.js} +1 -1
- package/dist/client/assets/{Monitor01-Cw6kmClm.js → Monitor01-Djh_XBKr.js} +1 -1
- package/dist/client/assets/{Palette-Druykvzw.js → Palette-PH8MXuP9.js} +1 -1
- package/dist/client/assets/{Play-CMJ2IWYR.js → Play-C4oLlMWL.js} +1 -1
- package/dist/client/assets/{Plus-CjrtKB-Y.js → Plus-BX4ueqQS.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-3BsQQkRx.js → RefreshCcw01-Duj7NlwB.js} +1 -1
- package/dist/client/assets/{SearchMd-BL2y99rx.js → SearchMd-CL91MHi_.js} +1 -1
- package/dist/client/assets/{Settings02-Cd4DIqaJ.js → Settings02-DWXKmfg4.js} +1 -1
- package/dist/client/assets/{Shield01-zIbMct6w.js → Shield01-5PYVS020.js} +1 -1
- package/dist/client/assets/{Star01-eRdSY4QW.js → Star01-E49TkgRa.js} +1 -1
- package/dist/client/assets/{Stars01-v0yz6PCZ.js → Stars01-NNVgYP83.js} +1 -1
- package/dist/client/assets/{Stars02-EuAFDZ5E.js → Stars02-BVMEIcco.js} +1 -1
- package/dist/client/assets/{Sun-CH2HWLCn.js → Sun-CC_Mb8Zc.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BMnNI1Fi.js → SwitchHorizontal01-Fq29tGDx.js} +1 -1
- package/dist/client/assets/{Tool01-Dcq7KP8Y.js → Tool01-B2YQjPAa.js} +1 -1
- package/dist/client/assets/{Trash01-Cup7-ZTT.js → Trash01-XqCtMZQT.js} +1 -1
- package/dist/client/assets/{Upload01-C9yi1Bdg.js → Upload01-CTIKtpO3.js} +1 -1
- package/dist/client/assets/{User01-thAIxsAs.js → User01-Cz-IdAgQ.js} +1 -1
- package/dist/client/assets/{Users01-DPJm6-u-.js → Users01-D7P0o8Z_.js} +1 -1
- package/dist/client/assets/{Users03-BlNe2PnN.js → Users03-DUZwXij4.js} +1 -1
- package/dist/client/assets/{X-1KR4wibP.js → X-8xcHoVBj.js} +1 -1
- package/dist/client/assets/{XCircle-UPVnJx4i.js → XCircle-CGgdji5f.js} +1 -1
- package/dist/client/assets/{XClose-pR-QU0OQ.js → XClose-CxCjUb2p.js} +1 -1
- package/dist/client/assets/{Zap-Cl-JM7N9.js → Zap-DLFeSSQ0.js} +1 -1
- package/dist/client/assets/{ZapSquare-B1o2Q9OR.js → ZapSquare-C2mTTgos.js} +1 -1
- package/dist/client/assets/{ZoomOut-D8vQ49we.js → ZoomOut-CR6ja8eb.js} +1 -1
- package/dist/client/assets/{access-gate-CWPebMdP.js → access-gate-3WvSXWjg.js} +1 -1
- package/dist/client/assets/{accordion-aX0NKKKh.js → accordion-DBEoJ6NR.js} +1 -1
- package/dist/client/assets/add-section-modal-B-90MHzy.js +1 -0
- package/dist/client/assets/agent-capabilities-CeRZY0ao.js +3 -0
- package/dist/client/assets/{agent-icon-DT8dQ9tq.js → agent-icon-DyzI2_Id.js} +1 -1
- package/dist/client/assets/agent-icons-CkjHTgLo.js +4 -0
- package/dist/client/assets/{agents-list-DDhPNISh.js → agents-list-DNeWvyP9.js} +1 -1
- package/dist/client/assets/ai-providers-DAK2efaH.js +1 -0
- package/dist/client/assets/{alert-DyB_hFGI.js → alert-BHgS7nAN.js} +1 -1
- package/dist/client/assets/{alert-dialog-CSkQIwm8.js → alert-dialog-tg3D4mnu.js} +1 -1
- package/dist/client/assets/app-editor-WcogQO88.js +1 -0
- package/dist/client/assets/{auth-catchall-BUwhIhze.js → auth-catchall-BOC0nYtA.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CY4CpKKX.js → auth-split-layout-VA3PSXMI.js} +1 -1
- package/dist/client/assets/{automation-list-row-5M4PNEWw.js → automation-list-row-SEcTO2sW.js} +1 -1
- package/dist/client/assets/automation-runs-S95csAA4.js +1 -0
- package/dist/client/assets/{automations-Cy981ltn.js → automations-Ce44y56V.js} +1 -1
- package/dist/client/assets/{avatar-BHEXMwdE.js → avatar-DK3a4hPp.js} +1 -1
- package/dist/client/assets/{badge-Da0IsrqH.js → badge-SRsZ13Ha.js} +1 -1
- package/dist/client/assets/brand-context-CHR40nnF.js +1 -0
- package/dist/client/assets/buckets-7WU_Biyf.js +1 -0
- package/dist/client/assets/{calendar-BbhbS2FE.js → calendar-CC1tf37S.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dfw4xb8a.js → capability-load-error-C5tUHDdB.js} +1 -1
- package/dist/client/assets/{card-BUTabNLA.js → card-BU_YNBo4.js} +1 -1
- package/dist/client/assets/chat-context-Moe82J6D.js +20 -0
- package/dist/client/assets/{checkbox--nDaSUZE.js → checkbox-CGo4P_LC.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CUSnxWUp.js → cli-auth-success-D15RP8BC.js} +1 -1
- package/dist/client/assets/collection-detail-CiMl4FG7.js +1 -0
- package/dist/client/assets/{collection-display-button-BfQyXSIv.js → collection-display-button-M_1xgyCf.js} +1 -1
- package/dist/client/assets/{collection-search-LsgoMrVO.js → collection-search-CfzW8Ljz.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D3ciIIEv.js → collection-table-wrapper-B4EgEmky.js} +1 -1
- package/dist/client/assets/{collection-tabs-CQJiHDMR.js → collection-tabs-BxpcEAFc.js} +1 -1
- package/dist/client/assets/{collections-C_j8CeI8.js → collections-BthqN0MR.js} +1 -1
- package/dist/client/assets/{command-BehF6pb8.js → command-D_uV9Uyw.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-BSZmVMpV.js +1 -0
- package/dist/client/assets/{connection-card-EXvV7rxl.js → connection-card-CMo6aDgc.js} +1 -1
- package/dist/client/assets/connection-detail-Mimew6o2.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DoJomSCQ.js → connection-form-helpers-D7eAIFli.js} +1 -1
- package/dist/client/assets/connections-C3EDxDCA.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-BUhEcft-.js → decopilot-sse-pool-8oQl4q0c.js} +1 -1
- package/dist/client/assets/{dialog-Bm1pP7Vu.js → dialog-DSHkVmzb.js} +1 -1
- package/dist/client/assets/domain-settings-BOHvvqIE.js +1 -0
- package/dist/client/assets/{drawer-B51jkLaX.js → drawer-BCmqLnLy.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CIu58K9q.js → dropdown-menu-DFCaJxA8.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-D3tgFtHQ.js +1 -0
- package/dist/client/assets/{empty-state-1AbmTLd7.js → empty-state-CVOhfUW7.js} +1 -1
- package/dist/client/assets/{empty-state-BfmCVPeb.js → empty-state-DqgO6Psg.js} +1 -1
- package/dist/client/assets/{extract-connection-data-LoMqboL3.js → extract-connection-data-B52LuKdR.js} +1 -1
- package/dist/client/assets/{features-DWJ09Fdz.js → features-Dsrgvggp.js} +1 -1
- package/dist/client/assets/file-explorer-CAiKkVp8.js +2 -0
- package/dist/client/assets/{file-type-icon-CX5JEvCQ.js → file-type-icon-ThJaLePn.js} +1 -1
- package/dist/client/assets/{files-QExlaPCQ.js → files-BwgPol6-.js} +1 -1
- package/dist/client/assets/{form-BcPtow5O.js → form-DngzP8fb.js} +1 -1
- package/dist/client/assets/general-D61AQybp.js +1 -0
- package/dist/client/assets/{generate-id-CadHbHqX.js → generate-id-CDzcbt9l.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B24_pGAu.js → github-repo-picker-Dy1vUJSU.js} +1 -1
- package/dist/client/assets/{header-tab-button-DSX6YPkf.js → header-tab-button-YP4v_sFN.js} +1 -1
- package/dist/client/assets/{hover-card-DE2_8MLP.js → hover-card-CK_HvQcf.js} +1 -1
- package/dist/client/assets/image-field-pfu57PP0.js +1 -0
- package/dist/client/assets/{index-CHdFXpqc.js → index-2EH0OR7k.js} +1 -1
- package/dist/client/assets/{index-B1bHiM-j.js → index-5lPKE0PI.js} +1 -1
- package/dist/client/assets/{index-CR_LeyNj.js → index-BepaMXhR.js} +1 -1
- package/dist/client/assets/index-CIBQMZc3.js +310 -0
- package/dist/client/assets/index-D7h1Qkk4.js +1 -0
- package/dist/client/assets/{index-biiHZ5l9.js → index-DLy_MgNO.js} +3 -3
- package/dist/client/assets/{index-Bo5bzoUm.js → index-DdnG6T0z.js} +1 -1
- package/dist/client/assets/{index-Dr4Isy1j.js → index-Df6ljz6n.js} +1 -1
- package/dist/client/assets/{index-D6ELOmUq.js → index-Dj1voR4t.js} +1 -1
- package/dist/client/assets/{index-50-dmJFK.js → index-DqC0vS4o.js} +1 -1
- package/dist/client/assets/index-Dy_atLRy.js +1 -0
- package/dist/client/assets/{index-YdX5UjUB.js → index-G1Ev5Inf.js} +1 -1
- package/dist/client/assets/{index-J2NhKqyZ.js → index-LDNFPs7X.js} +5 -5
- package/dist/client/assets/{index-r7-3fAFf.js → index-hMTvGWUn.js} +1 -1
- package/dist/client/assets/{index-BflNEs6l.js → index-hwXZ3lhJ.js} +1 -1
- package/dist/client/assets/{index-redirect-pPYMz5D6.js → index-redirect-BkbiWtap.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B0VBGXv5.js → infiniteQueryObserver-CJIUgHAf.js} +1 -1
- package/dist/client/assets/{input-5PMMNPU9.js → input-CTpSARTD.js} +1 -1
- package/dist/client/assets/{integration-icon-Dy-a3x5R.js → integration-icon-BpF3qWll.js} +1 -1
- package/dist/client/assets/{label-CcC4_aKf.js → label-Dh8yif55.js} +1 -1
- package/dist/client/assets/{layout-CbTbCjmA.js → layout-D7xM_FMD.js} +1 -1
- package/dist/client/assets/{login-Dn4EF5EK.js → login-BsYL8EoQ.js} +1 -1
- package/dist/client/assets/members-D3KerYs6.js +3 -0
- package/dist/client/assets/{monaco-editor-CJVi8Ty8.js → monaco-editor-47G-YgBx.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BAplEVfE.js → monitoring-stats-row-DLPVsavd.js} +1 -1
- package/dist/client/assets/{oauth-callback-D5XAAL8p.js → oauth-callback-DPmGsVIH.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-tGQCB63I.js → oauth-callback-ai-provider-B2SdgtVf.js} +1 -1
- package/dist/client/assets/{onboarding-CgvYwT2C.js → onboarding-CUnTn08b.js} +1 -1
- package/dist/client/assets/{org-install-CV5qvXsE.js → org-install-D55Hf-Ci.js} +1 -1
- package/dist/client/assets/{org-layout-BFil8fwL.js → org-layout-D1CUrdu0.js} +1 -1
- package/dist/client/assets/org-plugin-layout-C_lutJvY.js +1 -0
- package/dist/client/assets/{page-seo-form-Bbna5w2y.js → page-seo-form-CDMGSBfI.js} +1 -1
- package/dist/client/assets/page-seo-sheet-D9mMBTfk.js +1 -0
- package/dist/client/assets/pair-C8e4qd_P.js +39 -0
- package/dist/client/assets/{plugin-empty-state-DM8dR2Wk.js → plugin-empty-state-DOz60yXL.js} +1 -1
- package/dist/client/assets/{plugin-header-CaWKfaZE.js → plugin-header-dSexLn5d.js} +1 -1
- package/dist/client/assets/plugin-layout-DeJC8Je1.js +1 -0
- package/dist/client/assets/{popover-Cvcd3A1d.js → popover-BTf4Nz5d.js} +1 -1
- package/dist/client/assets/{post-editor-CM-ESdP7.js → post-editor-DqMVZSkF.js} +1 -1
- package/dist/client/assets/{primitives-DWXKnou4.js → primitives-C5R0vRG0.js} +1 -1
- package/dist/client/assets/{profile-DmCC3zYK.js → profile-D24Mm1Bo.js} +1 -1
- package/dist/client/assets/project-app-view-Bww_ZnyA.js +1 -0
- package/dist/client/assets/record-editor-dyb9Ijad.js +1 -0
- package/dist/client/assets/registry-BnciKKiV.js +2 -0
- package/dist/client/assets/registry-layout-BTGZh3rH.js +27 -0
- package/dist/client/assets/{require-capability-DVI2cKO3.js → require-capability-VkdqqQVh.js} +1 -1
- package/dist/client/assets/{required-auth-layout-zYH6NIDF.js → required-auth-layout-B_Qr5rQD.js} +1 -1
- package/dist/client/assets/{reset-password-DXXx8e6Q.js → reset-password-EasI5IT7.js} +1 -1
- package/dist/client/assets/{resizable-BbbLszRZ.js → resizable-psD7TWaW.js} +1 -1
- package/dist/client/assets/{roles-vHYrQg5g.js → roles-DcdBU5wW.js} +1 -1
- package/dist/client/assets/save-referenced-block-H29Sz2fU.js +1 -0
- package/dist/client/assets/{save-status-pJVz5vCQ.js → save-status-BBtiR3n4.js} +1 -1
- package/dist/client/assets/{schema-form-nZH-67HX.js → schema-form-CQrr8C2Q.js} +1 -1
- package/dist/client/assets/{scroll-area-BqOijBAI.js → scroll-area-EinmnR6o.js} +1 -1
- package/dist/client/assets/{search-input-BgGthWir.js → search-input-IQT_u5qN.js} +1 -1
- package/dist/client/assets/secrets-CvkPaEJL.js +1 -0
- package/dist/client/assets/{sections-editor-CSz4pxMw.js → sections-editor-4lprX9C-.js} +1 -1
- package/dist/client/assets/{select-CNSUv3cw.js → select-Dz1PdScB.js} +1 -1
- package/dist/client/assets/{select-model-0CGh6cKF.js → select-model-azh5-bst.js} +1 -1
- package/dist/client/assets/seo-editor-Bhb2HHgZ.js +1 -0
- package/dist/client/assets/{settings-layout-DRYgevr6.js → settings-layout-DXfn8mRu.js} +1 -1
- package/dist/client/assets/{settings-section-V9kb8x32.js → settings-section-DqhmLe6Q.js} +1 -1
- package/dist/client/assets/{sheet-D99KevZC.js → sheet-CtgWE_6O.js} +1 -1
- package/dist/client/assets/{shell-controls-DSSWZ7Ia.js → shell-controls-D5kseyts.js} +1 -1
- package/dist/client/assets/{shell-layout-4LsIVsl3.js → shell-layout-CWL5imKS.js} +1 -1
- package/dist/client/assets/shell-route-loading-Co6LGu_q.js +1 -0
- package/dist/client/assets/{sidebar-CPZXU-2w.js → sidebar-DRcLUASh.js} +1 -1
- package/dist/client/assets/{skeleton--DN75sg7.js → skeleton-BH3hvPuC.js} +1 -1
- package/dist/client/assets/{sortable.esm-g7bq1nDZ.js → sortable.esm-Bv55LbH0.js} +1 -1
- package/dist/client/assets/{spinner-DJD6-9r-.js → spinner-B_3Siejz.js} +1 -1
- package/dist/client/assets/sso-0oMpJ4kh.js +1 -0
- package/dist/client/assets/{store-DTK5DubB.js → store-BVB26WGO.js} +1 -1
- package/dist/client/assets/store-registry-CO_g7WZl.js +2 -0
- package/dist/client/assets/studio-tools-BxKekKsO.js +1 -0
- package/dist/client/assets/{switch-D6SWnoi2.js → switch-DH2AgpKj.js} +1 -1
- package/dist/client/assets/{tab-id-D4SJwEQy.js → tab-id-xylxHxk-.js} +2 -2
- package/dist/client/assets/{table-Cx3PhNth.js → table-BF0TGzWk.js} +1 -1
- package/dist/client/assets/{tabs-DCDCb9Pz.js → tabs-zn3_c2X4.js} +1 -1
- package/dist/client/assets/{task-status-P3BULAyA.js → task-status-CcBiqoc9.js} +1 -1
- package/dist/client/assets/{textarea-QEULyLXh.js → textarea--0YfTbVD.js} +1 -1
- package/dist/client/assets/{toggle-group-DhVqXGfs.js → toggle-group-CzCtoT44.js} +1 -1
- package/dist/client/assets/{toolbar-BsB4Mvyv.js → toolbar-GqBUNMmA.js} +1 -1
- package/dist/client/assets/{tools-list-Ch5RlbiL.js → tools-list-6mOdBofe.js} +1 -1
- package/dist/client/assets/{tooltip-bsrBmmjV.js → tooltip-DUvSyhJC.js} +1 -1
- package/dist/client/assets/{types-jBdXInU0.js → types-DA4RGvyb.js} +1 -1
- package/dist/client/assets/use-ai-providers-D2lIJSNP.js +1 -0
- package/dist/client/assets/{use-automations-Db8x6SNU.js → use-automations-DBfmwk1I.js} +1 -1
- package/dist/client/assets/{use-capability-BPM45mbW.js → use-capability-B4Fg7dX0.js} +1 -1
- package/dist/client/assets/{use-collections-B5Jh_wGd.js → use-collections-CmHxKkjG.js} +1 -1
- package/dist/client/assets/{use-connection-DyJtuHQI.js → use-connection-DBknh1_S.js} +1 -1
- package/dist/client/assets/{use-copy-P6tx-uOp.js → use-copy-Cwl7g8AE.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CWYOy45e.js → use-create-virtual-mcp-C1TsXsHi.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-ClLbciGl.js → use-debounced-autosave-Bxr0aFzV.js} +1 -1
- package/dist/client/assets/use-delete-connection-R6nqWnGZ.js +1 -0
- package/dist/client/assets/use-file-configs-DWXPP8uC.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-xQQ6lYk4.js → use-infinite-scroll-SoMG-nf0.js} +1 -1
- package/dist/client/assets/{use-list-state-BZmeG7gi.js → use-list-state-RN4viRCb.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CWFUu1lY.js → use-mcp-client-FbAC4-Un.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-B5RhBVzg.js → use-mcp-prompts-yCzBJuZf.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DePRGZE5.js → use-mcp-tools-CxFt6L0J.js} +1 -1
- package/dist/client/assets/{use-members-Cw70r_Wh.js → use-members-B2ko1Eht.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CdsMYUzL.js → use-navigate-to-agent-Bg4INoCb.js} +1 -1
- package/dist/client/assets/{use-org-auth-client--i_Sx92M.js → use-org-auth-client-D0Et-q9V.js} +1 -1
- package/dist/client/assets/{use-org-sso-C1cJTBIx.js → use-org-sso-Ba3MjbPK.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ATKYiNpl.js → use-organization-roles-jFwocdK5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Izqk1Gkk.js → use-organization-settings-Bdk0M31t.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C-WVKjSU.js → use-registry-connections-DkTd3pip.js} +1 -1
- package/dist/client/assets/use-secrets-B3XtAhqh.js +1 -0
- package/dist/client/assets/{use-status-sounds-BJ_LqdGJ.js → use-status-sounds-Bi-eGoxq.js} +1 -1
- package/dist/client/assets/{use-view-mode-CbT8E3wV.js → use-view-mode-CVu0jG_s.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-0jbEmvOc.js → use-virtual-mcp-CL360k9_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-68Zg22Ld.js +1 -0
- package/dist/client/assets/{useRouterState-Dm0UHjU4.js → useRouterState-CBsQY2cY.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C32oPBV5.js +1 -0
- package/dist/client/assets/user-ce-n8AzQ.js +1 -0
- package/dist/client/assets/{view-mode-toggle-G0qNMbJ1.js → view-mode-toggle-DPvhvCSl.js} +1 -1
- package/dist/client/assets/workflow-DEw4Tgx1.js +1 -0
- package/dist/client/assets/workflow-detail-DPYK3MGg.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-DbuGc2qc.js +0 -1
- package/dist/client/assets/agent-capabilities-BJLQSkAN.js +0 -3
- package/dist/client/assets/agent-icons-DRrDyR7j.js +0 -4
- package/dist/client/assets/ai-providers-GxPLAPId.js +0 -1
- package/dist/client/assets/app-editor-BsxVHV86.js +0 -1
- package/dist/client/assets/automation-runs-BJTRztep.js +0 -1
- package/dist/client/assets/brand-context-DTmvDRqf.js +0 -1
- package/dist/client/assets/buckets-Cv3AB_TT.js +0 -1
- package/dist/client/assets/chat-context-Bu6qpu9K.js +0 -20
- package/dist/client/assets/collection-detail-DHxXW6T4.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-DPqrgnkS.js +0 -1
- package/dist/client/assets/connection-detail-58UbdFd3.js +0 -1
- package/dist/client/assets/connections-BMZIGugH.js +0 -1
- package/dist/client/assets/domain-settings-DHsRsnmX.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-DWE13BKk.js +0 -1
- package/dist/client/assets/file-explorer-Dmpsw-4-.js +0 -2
- package/dist/client/assets/general-CLesrOe8.js +0 -1
- package/dist/client/assets/image-field-D00iYa4G.js +0 -1
- package/dist/client/assets/index-BZvxagUr.js +0 -310
- package/dist/client/assets/index-CCs3Chg3.js +0 -1
- package/dist/client/assets/index-Db3P8pHg.js +0 -1
- package/dist/client/assets/members-BwcNzXwU.js +0 -3
- package/dist/client/assets/org-plugin-layout-DyCflrr1.js +0 -1
- package/dist/client/assets/page-seo-sheet-D9M3CoUb.js +0 -1
- package/dist/client/assets/pair-Ba1UoSSJ.js +0 -39
- package/dist/client/assets/plugin-layout-DrVKV-lp.js +0 -1
- package/dist/client/assets/project-app-view-C9azYjZP.js +0 -1
- package/dist/client/assets/record-editor-DJucp492.js +0 -1
- package/dist/client/assets/registry-hKns5OCc.js +0 -2
- package/dist/client/assets/registry-layout-DPaKDLDg.js +0 -27
- package/dist/client/assets/save-referenced-block-q2CPWVkl.js +0 -1
- package/dist/client/assets/secrets-YkTDT7yT.js +0 -1
- package/dist/client/assets/seo-editor-CspZxazh.js +0 -1
- package/dist/client/assets/shell-route-loading-5KSwc3hj.js +0 -1
- package/dist/client/assets/sso-D04DjSnZ.js +0 -1
- package/dist/client/assets/store-registry-nABlp_7k.js +0 -2
- package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +0 -1
- package/dist/client/assets/use-ai-providers-v0sCRzMO.js +0 -1
- package/dist/client/assets/use-delete-connection-C60uGs0b.js +0 -1
- package/dist/client/assets/use-file-configs-CC8ghNUa.js +0 -1
- package/dist/client/assets/use-secrets-BpdIBEe6.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BGg7INCQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B4dQiTEq.js +0 -1
- package/dist/client/assets/user-DRDdFgUw.js +0 -1
- package/dist/client/assets/workflow-D1PUPL3K.js +0 -1
- package/dist/client/assets/workflow-detail-CRUxUbKb.js +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{e as Y,q as ie,n as Ie,G as ke,a as je,o as V,r as M,j as t,B as G,l as ze,c as Z,M as Fs,J as Bs,bl as Qs,bm as Vs}from"./index-biiHZ5l9.js";import{c as Jt,b as Gs,d as ds,a as Ks,i as Ys,t as Hs,f as Ws,e as Js}from"./XCircle-UPVnJx4i.js";import{i as Le}from"./CheckCircle-C2ualSpf.js";import{n as Zs}from"./Container-CYcITvPW.js";import{a as Xs}from"./Settings02-Cd4DIqaJ.js";import{S as ce,u as oe,W as er}from"./use-mcp-client-CWFUu1lY.js";import{u as us}from"./useInfiniteQuery-BGg7INCQ.js";import{B as F}from"./badge-Da0IsrqH.js";import{I as ae}from"./input-5PMMNPU9.js";import{a as dt,c as Ce,D as ut,b as mt,j as Zt,k as Xt,d as tr}from"./dropdown-menu-CIu58K9q.js";import{c as Mt,d as Et,a as Fe,e as ue,b as Dt,T as me}from"./table-Cx3PhNth.js";import{T as sr,a as es}from"./toggle-group-DhVqXGfs.js";import{u as rr}from"./use-view-mode-CbT8E3wV.js";import{i as At}from"./DotsVertical-SvwN4CeV.js";import{i as nr}from"./FilterLines-BJZdiggU.js";import{n as ir,i as ms}from"./Globe01-DfGFlik1.js";import{i as lr}from"./SearchMd-BL2y99rx.js";import{b as xt,c as ht,e as pt,d as ft,a as gt,D as jt}from"./dialog-Bm1pP7Vu.js";import{i as Ke}from"./AlertCircle-9EFUZenf.js";import{i as ts}from"./Upload01-C9yi1Bdg.js";import{c as Ye,b as He,d as We,f as Je,g as Ze,e as Xe,a as et,A as tt}from"./alert-dialog-CSkQIwm8.js";import{C as ne}from"./card-BUTabNLA.js";import{s as st}from"./Trash01-Cup7-ZTT.js";import{L as X}from"./label-CcC4_aKf.js";import{d as ar,S as or,a as cr,b as dr,c as St}from"./select-CNSUv3cw.js";import{S as Oe}from"./switch-D6SWnoi2.js";import{T as vt}from"./textarea-QEULyLXh.js";import{s as $t,b as ur,i as mr,a as xr}from"./RefreshCcw01-3BsQQkRx.js";import{i as hr}from"./X-1KR4wibP.js";import{t as pr}from"./ChevronDown-Cf2Q-GlB.js";import{n as fr}from"./ChevronUp-BAxoXhnT.js";import{C as ss}from"./checkbox--nDaSUZE.js";import{s as xs,a as Rt}from"./Eye-ByuwKsdh.js";import{n as gr}from"./LinkExternal01-CgI1VTqi.js";import{u as Tt}from"./use-copy-P6tx-uOp.js";import{i as It}from"./Check-D-9dblUn.js";import{i as jr}from"./Key01-CzmPnHuw.js";import{s as vr}from"./Plus-CjrtKB-Y.js";import{T as br,a as yr,b as Nr}from"./tooltip-bsrBmmjV.js";import{i as wr}from"./Play-CMJ2IWYR.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./ChevronRight-CrZy8tHx.js";const $e="private-registry",_r=`
|
|
2
|
-
You are an MCP tool tester running automated integration checks.
|
|
3
|
-
|
|
4
|
-
Goal:
|
|
5
|
-
- Validate that this MCP and its tools work end-to-end.
|
|
6
|
-
- Prefer realistic sequences where one tool output feeds the next tool input.
|
|
7
|
-
- Example chain: list -> pick id -> get/update/delete.
|
|
8
|
-
|
|
9
|
-
Rules:
|
|
10
|
-
- Try to execute as many tools as possible.
|
|
11
|
-
- If a tool requires context, first call discovery/list tools to obtain valid IDs.
|
|
12
|
-
- If you create test data, clean it up when possible.
|
|
13
|
-
- If one tool fails, continue testing the remaining tools.
|
|
14
|
-
- If a tool returns input validation errors, fix the arguments and retry that tool.
|
|
15
|
-
- For tools that require identifiers (fileId, folderId, etc), always get IDs from previous list/get calls.
|
|
16
|
-
- Keep calls focused and safe.
|
|
17
|
-
|
|
18
|
-
At the end, provide a concise summary of:
|
|
19
|
-
- What passed
|
|
20
|
-
- What failed
|
|
21
|
-
- What could not be tested and why
|
|
22
|
-
- If some tool needs user-specific context (email/account/tenant), explicitly output a "CONTEXT_REQUIRED" note with what is needed.
|
|
23
|
-
`.trim(),Q={all:["private-registry"],items:()=>[...Q.all,"items"],itemsList:(s,e,r,n)=>[...Q.items(),"list",{search:s,tags:e,categories:r,limit:n}],item:s=>[...Q.items(),"item",s],filters:()=>[...Q.all,"filters"],registryConfig:()=>[...Q.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...Q.registryConfig(),s,e],publishRequests:()=>[...Q.all,"publish-requests"],publishRequestsByOrg:s=>[...Q.publishRequests(),"org",s],publishRequestsList:(s,e,r)=>[...Q.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:r??"desc"}],publishRequestsListByOrg:(s,e,r,n)=>[...Q.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:r??"created_at",sortDirection:n??"desc"}],publishRequestsCount:()=>[...Q.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...Q.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...Q.all,"publish-api-keys"],monitor:()=>[...Q.all,"monitor"],monitorRuns:()=>[...Q.monitor(),"runs"],monitorRunsList:s=>[...Q.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...Q.monitorRuns(),"run",s??"none"],monitorResults:()=>[...Q.monitor(),"results"],monitorResultsList:(s,e)=>[...Q.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...Q.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...Q.monitorConnections(),"auth-probe",s]};async function _e(s,e,r){const n=await s.callTool({name:e,arguments:r});if(!n||typeof n!="object")throw new Error(`Invalid tool response for ${e}`);if(n.isError){const o=n.content?.find(i=>i.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return n.structuredContent??n}function Cr(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async d=>_e(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.monitorRuns()}),e.invalidateQueries({queryKey:Q.monitorResults()})])},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}function kr(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async d=>_e(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async(d,u)=>{await Promise.all([e.invalidateQueries({queryKey:Q.monitorRuns()}),e.invalidateQueries({queryKey:Q.monitorRun(u)})])},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}function yt(s){const e=Y.c(11),{org:r}=ie();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=oe(n);let i;e[3]!==s?(i=Q.monitorRunsList(s),e[3]=s,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==s?(a=async()=>_e(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[5]=o,e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l={queryKey:i,queryFn:a,staleTime:5e3},e[8]=i,e[9]=a,e[10]=l):l=e[10],Ie(l)}function Ot(s){const e=Y.c(12),{org:r}=ie();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=oe(n);let i;e[3]!==s?(i=Q.monitorRun(s),e[3]=s,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==s?(a=async()=>_e(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[5]=o,e[6]=s,e[7]=a):a=e[7];const l=!!s;let d;return e[8]!==i||e[9]!==a||e[10]!==l?(d={queryKey:i,queryFn:a,enabled:l,refetchInterval:Sr},e[8]=i,e[9]=a,e[10]=l,e[11]=d):d=e[11],Ie(d)}function Sr(s){return s.state.data?.run?.status==="running"?5e3:!1}function rt(s,e,r){const n=Y.c(15),{org:o}=ie();let i;n[0]!==o.id||n[1]!==o.slug?(i={connectionId:ce,orgId:o.id,orgSlug:o.slug},n[0]=o.id,n[1]=o.slug,n[2]=i):i=n[2];const a=oe(i);let l;n[3]!==s||n[4]!==e?(l=Q.monitorResultsList(s,e),n[3]=s,n[4]=e,n[5]=l):l=n[5];let d;n[6]!==a||n[7]!==s||n[8]!==e?(d=async()=>_e(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),n[6]=a,n[7]=s,n[8]=e,n[9]=d):d=n[9];const u=!!s,m=r==="running"?2500:!1;let h;return n[10]!==l||n[11]!==d||n[12]!==u||n[13]!==m?(h={queryKey:l,queryFn:d,enabled:u,staleTime:5e3,refetchInterval:m},n[10]=l,n[11]=d,n[12]=u,n[13]=m,n[14]=h):h=n[14],Ie(h)}function hs(){const s=Y.c(6),{org:e}=ie();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ce,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const n=oe(r);let o;s[3]===Symbol.for("react.memo_cache_sentinel")?(o=Q.monitorConnections(),s[3]=o):o=s[3];let i;return s[4]!==n?(i={queryKey:o,queryFn:async()=>_e(n,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[4]=n,s[5]=i):i=s[5],Ie(i)}function Rr(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async()=>_e(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.monitorConnections()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}function Tr(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async d=>{const{connectionId:u,authStatus:m}=d;return _e(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:u,authStatus:m})},s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.monitorConnections()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}const rs={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:""};function ps(){const s=Y.c(34),{org:e,project:r}=ie();let n;s[0]!==e.id||s[1]!==e.slug?(n={connectionId:ce,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=n):n=s[2];const o=oe(n),i=ke();let a;s[3]!==r.id?(a=Q.registryConfigByPlugin(r.id??"",$e),s[3]=r.id,s[4]=a):a=s[4];let l;s[5]!==o||s[6]!==r.id?(l=async()=>_e(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:$e}),s[5]=o,s[6]=r.id,s[7]=l):l=s[7];const d=!!r.id;let u;s[8]!==a||s[9]!==l||s[10]!==d?(u={queryKey:a,queryFn:l,enabled:d},s[8]=a,s[9]=l,s[10]=d,s[11]=u):u=s[11];const m=Ie(u),h=m.data?.config?.settings,x=h&&typeof h=="object"?h.testConfig:void 0,c=typeof(h?h.monitorMode??h.testMode:void 0)=="string";let f;s[12]!==x?(f=x??{},s[12]=x,s[13]=f):f=s[13];let g;s[14]!==c||s[15]!==h||s[16]!==x?(g=c&&!x?h:{},s[14]=c,s[15]=h,s[16]=x,s[17]=g):g=s[17];let _;s[18]!==f||s[19]!==g?(_={...rs,...f,...g},s[18]=f,s[19]=g,s[20]=_):_=s[20];const w=_;let y;s[21]!==o||s[22]!==r.id?(y=async C=>{const R=(await _e(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:$e}))?.config?.settings??{};return _e(o,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:r.id,pluginId:$e,settings:{...R,testConfig:{...rs,...R.testConfig??{},...C}}})},s[21]=o,s[22]=r.id,s[23]=y):y=s[23];let j;s[24]!==r.id||s[25]!==i?(j=async()=>{await i.invalidateQueries({queryKey:Q.registryConfigByPlugin(r.id??"",$e)})},s[24]=r.id,s[25]=i,s[26]=j):j=s[26];let I;s[27]!==y||s[28]!==j?(I={mutationFn:y,onSuccess:j},s[27]=y,s[28]=j,s[29]=I):I=s[29];const S=je(I);let N;return s[30]!==m.isLoading||s[31]!==S||s[32]!==w?(N={settings:w,isLoading:m.isLoading,saveMutation:S},s[30]=m.isLoading,s[31]=S,s[32]=w,s[33]=N):N=s[33],N}function Ir(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async d=>_e(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.registryConfig()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}function Pr(){const s=Y.c(10),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async d=>_e(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.registryConfig()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],je(l)}function Mr(){const s=Y.c(3),e=yt("completed"),r=e.data?.items?.[0]?.id,n=e.data?.items?.[0]?.status,o=rt(r,"failed",n),i=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let l;return s[0]!==i||s[1]!==a?(l={brokenCount:i,isLoading:a},s[0]=i,s[1]=a,s[2]=l):l=s[2],l}const fs=24;function Er(s){return s.trim()}async function ve(s,e,r){const n=await s.callTool({name:e,arguments:r});if(!n||typeof n!="object")throw new Error(`Invalid tool response for ${e}`);if(n.isError){const o=n.content?.find(i=>i.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return n.structuredContent??n}function gs(s){const e=Y.c(20),{org:r}=ie();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=oe(n);let i,a,l,d;e[3]!==s.categories||e[4]!==s.limit||e[5]!==s.search||e[6]!==s.tags?(a=Er(s.search),i=s.limit??fs,d=us,l=Q.itemsList(a,s.tags,s.categories,i),e[3]=s.categories,e[4]=s.limit,e[5]=s.search,e[6]=s.tags,e[7]=i,e[8]=a,e[9]=l,e[10]=d):(i=e[7],a=e[8],l=e[9],d=e[10]);let u;e[11]!==o||e[12]!==i||e[13]!==s.categories||e[14]!==s.tags||e[15]!==a?(u=async h=>{const{pageParam:x}=h,p=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return ve(o,"REGISTRY_ITEM_LIST",{cursor:x,limit:i,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:p})},e[11]=o,e[12]=i,e[13]=s.categories,e[14]=s.tags,e[15]=a,e[16]=u):u=e[16];let m;return e[17]!==l||e[18]!==u?(m={queryKey:l,queryFn:u,initialPageParam:void 0,getNextPageParam:Dr,staleTime:3e4},e[17]=l,e[18]=u,e[19]=m):m=e[19],d(m)}function Dr(s){return s.nextCursor}function Ar(){const s=Y.c(9),{org:e}=ie();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ce,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const n=oe(r);let o;s[3]===Symbol.for("react.memo_cache_sentinel")?(o=Q.filters(),s[3]=o):o=s[3];let i;s[4]!==n?(i=async()=>ve(n,"REGISTRY_ITEM_FILTERS",{}),s[4]=n,s[5]=i):i=s[5];let a;s[6]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},s[6]=a):a=s[6];let l;return s[7]!==i?(l={queryKey:o,queryFn:i,placeholderData:a,staleTime:6e4},s[7]=i,s[8]=l):l=s[8],Ie(l)}function Ut(){const s=Y.c(30),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.items()}),e.invalidateQueries({queryKey:Q.filters()})])},s[3]=e,s[4]=i):i=s[4];const a=i;let l;s[5]!==o?(l=async j=>(await ve(o,"REGISTRY_ITEM_CREATE",{data:j})).item,s[5]=o,s[6]=l):l=s[6];let d;s[7]!==a||s[8]!==l?(d={mutationFn:l,onSuccess:a},s[7]=a,s[8]=l,s[9]=d):d=s[9];const u=je(d);let m;s[10]!==o?(m=async j=>{const{id:I,data:S}=j;return(await ve(o,"REGISTRY_ITEM_UPDATE",{id:I,data:S})).item},s[10]=o,s[11]=m):m=s[11];let h;s[12]!==a||s[13]!==m?(h={mutationFn:m,onSuccess:a},s[12]=a,s[13]=m,s[14]=h):h=s[14];const x=je(h);let p;s[15]!==o?(p=async j=>(await ve(o,"REGISTRY_ITEM_DELETE",{id:j})).item,s[15]=o,s[16]=p):p=s[16];let c;s[17]!==a||s[18]!==p?(c={mutationFn:p,onSuccess:a},s[17]=a,s[18]=p,s[19]=c):c=s[19];const f=je(c);let g;s[20]!==o?(g=async j=>ve(o,"REGISTRY_ITEM_BULK_CREATE",{items:j}),s[20]=o,s[21]=g):g=s[21];let _;s[22]!==a||s[23]!==g?(_={mutationFn:g,onSuccess:a},s[22]=a,s[23]=g,s[24]=_):_=s[24];const w=je(_);let y;return s[25]!==w||s[26]!==u||s[27]!==f||s[28]!==x?(y={createMutation:u,updateMutation:x,deleteMutation:f,bulkCreateMutation:w},s[25]=w,s[26]=u,s[27]=f,s[28]=x,s[29]=y):y=s[29],y}function js(s){const e=Y.c(27),{org:r}=ie();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=oe(n),i=ke(),a=er.SELF(r.id),l=Ie({queryKey:Q.registryConfigByPlugin(a,s),queryFn:async()=>ve(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:a,pluginId:s}),staleTime:6e4}),d=Q.registryConfigByPlugin(a,s);let u;e[3]!==o||e[4]!==s||e[5]!==a?(u=async R=>{const v=(await ve(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:a,pluginId:s}))?.config?.settings??{};return ve(o,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:a,pluginId:s,settings:{...v,...R}})},e[3]=o,e[4]=s,e[5]=a,e[6]=u):u=e[6];let m;e[7]!==i||e[8]!==d?(m=async()=>{await i.invalidateQueries({queryKey:d})},e[7]=i,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==u||e[11]!==m?(h={mutationFn:u,onSuccess:m,onError:$r},e[10]=u,e[11]=m,e[12]=h):h=e[12];const x=je(h);let p;e[13]!==x?(p=R=>{x.mutate(R)},e[13]=x,e[14]=p):p=e[14];const c=p,f=l.data?.config?.settings?.registryName??"Private Registry",g=l.data?.config?.settings?.registryIcon??"",_=l.data?.config?.settings?.acceptPublishRequests??!1,w=l.data?.config?.settings?.requireApiToken??!1,y=l.data?.config?.settings?.storePrivateOnly??!1,j=l.data?.config?.settings?.rateLimitEnabled??!0,S=l.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",N=l.data?.config?.settings?.rateLimitMax,C=typeof N=="number"&&N>=1?Math.floor(N):100;let T;return e[15]!==_||e[16]!==x.isPending||e[17]!==l.isLoading||e[18]!==j||e[19]!==C||e[20]!==S||e[21]!==g||e[22]!==f||e[23]!==w||e[24]!==y||e[25]!==c?(T={registryName:f,registryIcon:g,acceptPublishRequests:_,requireApiToken:w,storePrivateOnly:y,rateLimitEnabled:j,rateLimitWindow:S,rateLimitMax:C,isLoadingConfig:l.isLoading,isSaving:x.isPending,updateConfig:c},e[15]=_,e[16]=x.isPending,e[17]=l.isLoading,e[18]=j,e[19]=C,e[20]=S,e[21]=g,e[22]=f,e[23]=w,e[24]=y,e[25]=c,e[26]=T):T=e[26],T}function $r(s){V.error(s instanceof Error?s.message:"Failed to save registry settings")}function Or(s){const e=Y.c(16),{org:r}=ie();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=oe(n);let i;e[3]!==r.id||e[4]!==s.sortBy||e[5]!==s.sortDirection||e[6]!==s.status?(i=Q.publishRequestsListByOrg(r.id,s.status,s.sortBy,s.sortDirection),e[3]=r.id,e[4]=s.sortBy,e[5]=s.sortDirection,e[6]=s.status,e[7]=i):i=e[7];let a;e[8]!==o||e[9]!==s.sortBy||e[10]!==s.sortDirection||e[11]!==s.status?(a=async d=>{const{pageParam:u}=d;return ve(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:fs,offset:u})},e[8]=o,e[9]=s.sortBy,e[10]=s.sortDirection,e[11]=s.status,e[12]=a):a=e[12];let l;return e[13]!==i||e[14]!==a?(l={queryKey:i,queryFn:a,initialPageParam:0,getNextPageParam:Ur,staleTime:3e4,refetchOnMount:!0},e[13]=i,e[14]=a,e[15]=l):l=e[15],us(l)}function Ur(s,e){const r=e.reduce(qr,0);return r<s.totalCount?r:void 0}function qr(s,e){return s+e.items.length}function zr(){const s=Y.c(10),{org:e}=ie();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ce,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const n=oe(r);let o;s[3]!==e.id?(o=Q.publishRequestsCountByOrg(e.id),s[3]=e.id,s[4]=o):o=s[4];let i;s[5]!==n?(i=async()=>ve(n,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[5]=n,s[6]=i):i=s[6];let a;return s[7]!==o||s[8]!==i?(a={queryKey:o,queryFn:i,staleTime:3e4},s[7]=o,s[8]=i,s[9]=a):a=s[9],Ie(a)}function Lr(){const s=Y.c(18),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.publishRequests()})])},s[3]=e,s[4]=i):i=s[4];const a=i;let l;s[5]!==o?(l=async c=>ve(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",c),s[5]=o,s[6]=l):l=s[6];let d;s[7]!==a||s[8]!==l?(d={mutationFn:l,onSuccess:a},s[7]=a,s[8]=l,s[9]=d):d=s[9];const u=je(d);let m;s[10]!==o?(m=async c=>ve(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:c}),s[10]=o,s[11]=m):m=s[11];let h;s[12]!==a||s[13]!==m?(h={mutationFn:m,onSuccess:a},s[12]=a,s[13]=m,s[14]=h):h=s[14];const x=je(h);let p;return s[15]!==x||s[16]!==u?(p={reviewMutation:u,deleteMutation:x},s[15]=x,s[16]=u,s[17]=p):p=s[17],p}function Fr(){const s=Y.c(6),{org:e}=ie();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ce,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const n=oe(r);let o;s[3]===Symbol.for("react.memo_cache_sentinel")?(o=Q.publishApiKeys(),s[3]=o):o=s[3];let i;return s[4]!==n?(i={queryKey:o,queryFn:async()=>ve(n,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[4]=n,s[5]=i):i=s[5],Ie(i)}function Br(){const s=Y.c(20),e=ke(),{org:r}=ie();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ce,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=oe(n);let i;s[3]!==o?(i=async c=>ve(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:c}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.publishApiKeys()})},s[5]=e,s[6]=a):a=s[6];let l;s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9];const d=je(l);let u;s[10]!==o?(u=async c=>ve(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:c}),s[10]=o,s[11]=u):u=s[11];let m;s[12]!==e?(m=async()=>{await e.invalidateQueries({queryKey:Q.publishApiKeys()})},s[12]=e,s[13]=m):m=s[13];let h;s[14]!==u||s[15]!==m?(h={mutationFn:u,onSuccess:m},s[14]=u,s[15]=m,s[16]=h):h=s[16];const x=je(h);let p;return s[17]!==d||s[18]!==x?(p={generateMutation:d,revokeMutation:x},s[17]=d,s[18]=x,s[19]=p):p=s[19],p}function ns(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function is(s){const e=[];let r="",n=!1;for(let o=0;o<s.length;o+=1){const i=s[o],a=s[o+1];if(i==='"'){n&&a==='"'?(r+='"',o+=1):n=!n;continue}if(i===","&&!n){e.push(r.trim()),r="";continue}r+=i}return e.push(r.trim()),e}const Qr=["id","title"],Vr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function Gr(s){const e=s.split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const r=is(e[0]??""),n=new Map,o=[];r.forEach((u,m)=>{const h=u.toLowerCase().trim();h&&n.set(h,m)});for(const u of Qr)n.has(u)||o.push({line:1,message:`Missing required column: "${u}"`});for(const u of r){const m=u.toLowerCase().trim();m&&!Vr.includes(m)&&o.push({line:1,message:`Unknown column "${u}" will be ignored`})}if(!n.has("id")||!n.has("title"))return{items:[],warnings:o,skipped:0};const i=(u,m)=>{const h=n.get(m);return typeof h=="number"?u[h]??"":""},a=[],l=new Set;let d=0;for(let u=1;u<e.length;u+=1){const m=is(e[u]??""),h=i(m,"id").trim(),x=i(m,"title").trim();if(!h){o.push({line:u+1,message:"Missing id — row skipped"}),d+=1;continue}if(!x){o.push({line:u+1,message:`Missing title for id="${h}" — row skipped`}),d+=1;continue}if(l.has(h)){o.push({line:u+1,message:`Duplicate id="${h}" — row skipped`}),d+=1;continue}l.add(h);const p=i(m,"description").trim(),c=i(m,"remote_url").trim(),g=i(m,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",_=ns(i(m,"tags")),w=ns(i(m,"categories")),y=i(m,"is_public").trim().toLowerCase(),j=y==="true"||y==="1"||y==="yes";a.push({id:h,title:x,description:p||null,is_public:j,_meta:{"mcp.mesh":{..._.length>0?{tags:_}:{},...w.length>0?{categories:w}:{}}},server:{name:h,title:x,description:p||void 0,remotes:c?[{type:g,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const Kr=`id,title,description,remote_url,remote_type,tags,categories,is_public
|
|
24
|
-
my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
|
|
25
|
-
another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function Yr(){const s=new Blob([Kr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(s),r=document.createElement("a");r.href=e,r.download="registry-import-template.csv",r.click(),URL.revokeObjectURL(e)}function Hr(s){const e=Y.c(63),{open:r,onOpenChange:n,isImporting:o,onImport:i}=s,a=o===void 0?!1:o,[l,d]=M.useState(null),[u,m]=M.useState(null),[h,x]=M.useState(null),p=M.useRef(null);let c;e[0]!==n?(c=H=>{n(H),H||(d(null),m(null),x(null),p.current&&(p.current.value=""))},e[0]=n,e[1]=c):c=e[1];const f=c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=async H=>{if(!H)return;x(H.name),m(null);const xe=await H.text();d(Gr(xe))},e[2]=g):g=e[2];const _=g;let w;e[3]!==i||e[4]!==l?(w=async()=>{if(!l?.items.length)return;const H=await i(l.items);m(H)},e[3]=i,e[4]=l,e[5]=w):w=e[5];const y=w;let j;e[6]!==l?.items?(j=l?.items??[],e[6]=l?.items,e[7]=j):j=e[7];const I=j;let S;e[8]!==l?.warnings?(S=l?.warnings??[],e[8]=l?.warnings,e[9]=S):S=e[9];const N=S;let C;e[10]!==N?(C=N.some(Xr),e[10]=N,e[11]=C):C=e[11];const T=C,R=u!==null;let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs(xt,{children:[t.jsx(ht,{children:"Import MCP Servers from CSV"}),t.jsx(pt,{children:"Upload a CSV file to bulk-import MCP servers into the registry."})]}),e[12]=E):E=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=()=>p.current?.click(),e[13]=v):v=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ts,{size:14}),e[14]=D):D=e[14];const O=h?"Change file":"Choose CSV file";let P;e[15]!==a||e[16]!==O?(P=t.jsxs(G,{variant:"outline",size:"sm",className:"gap-1.5",onClick:v,disabled:a,children:[D,O]}),e[15]=a,e[16]=O,e[17]=P):P=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("input",{ref:p,type:"file",accept:".csv,text/csv",className:"hidden",onChange:H=>_(H.target.files?.[0]??null)}),e[18]=A):A=e[18];let z;e[19]!==h?(z=h&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),e[19]=h,e[20]=z):z=e[20];let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("div",{className:"flex-1"}),e[21]=U):U=e[21];let q;e[22]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Yr,children:[t.jsx(ir,{size:14}),"Download template"]}),e[22]=q):q=e[22];let b;e[23]!==P||e[24]!==z?(b=t.jsxs("div",{className:"flex items-center gap-3",children:[P,A,z,U,q]}),e[23]=P,e[24]=z,e[25]=b):b=e[25];let $;e[26]!==N?($=N.length>0&&t.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/30 p-3 grid gap-1",children:N.map(Zr)}),e[26]=N,e[27]=$):$=e[27];let K;e[28]!==I||e[29]!==l?(K=I.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:"Preview"}),t.jsxs(F,{variant:"secondary",children:[I.length," items"]}),l?.skipped?t.jsxs(F,{variant:"outline",className:"text-yellow-600",children:[l.skipped," skipped"]}):null]}),t.jsx("div",{className:"border rounded-lg overflow-hidden",children:t.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:t.jsxs(Mt,{children:[t.jsx(Et,{children:t.jsxs(Fe,{children:[t.jsx(ue,{className:"w-[140px]",children:"ID"}),t.jsx(ue,{children:"Title"}),t.jsx(ue,{children:"Remote URL"}),t.jsx(ue,{className:"w-[80px] text-center",children:"Public"}),t.jsx(ue,{children:"Tags"})]})}),t.jsx(Dt,{children:I.map(Jr)})]})})})]}),e[28]=I,e[29]=l,e[30]=K):K=e[30];let te;e[31]!==u?(te=u&&t.jsxs("div",{className:"rounded-lg border p-3 grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[t.jsx(Le,{size:16,className:"text-emerald-600"}),"Imported ",u.created," item(s) successfully"]}),u.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:u.errors.map(Wr)})]}),e[31]=u,e[32]=te):te=e[32];let ee;e[33]!==R||e[34]!==l?(ee=!l&&!R&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(ts,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a CSV file or download the template to get started."}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Required columns: ",t.jsx("code",{children:"id"}),", ",t.jsx("code",{children:"title"}),". Optional:"," ",t.jsx("code",{children:"description"}),", ",t.jsx("code",{children:"remote_url"}),","," ",t.jsx("code",{children:"remote_type"}),", ",t.jsx("code",{children:"tags"}),","," ",t.jsx("code",{children:"categories"}),", ",t.jsx("code",{children:"is_public"}),"."]}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Use ",t.jsx("code",{children:"|"})," or ",t.jsx("code",{children:";"})," to separate multiple tags/categories within a cell."]})]}),e[33]=R,e[34]=l,e[35]=ee):ee=e[35];let se;e[36]!==b||e[37]!==$||e[38]!==K||e[39]!==te||e[40]!==ee?(se=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[b,$,K,te,ee]}),e[36]=b,e[37]=$,e[38]=K,e[39]=te,e[40]=ee,e[41]=se):se=e[41];let re;e[42]!==f?(re=()=>f(!1),e[42]=f,e[43]=re):re=e[43];const pe=R?"Done":"Cancel";let fe;e[44]!==re||e[45]!==pe?(fe=t.jsx(G,{variant:"outline",onClick:re,children:pe}),e[44]=re,e[45]=pe,e[46]=fe):fe=e[46];let ge;e[47]!==y||e[48]!==T||e[49]!==R||e[50]!==a||e[51]!==I.length?(ge=!R&&t.jsx(G,{onClick:y,disabled:a||I.length===0||T,children:a?"Importing...":`Import ${I.length} item(s)`}),e[47]=y,e[48]=T,e[49]=R,e[50]=a,e[51]=I.length,e[52]=ge):ge=e[52];let be;e[53]!==fe||e[54]!==ge?(be=t.jsxs(ft,{className:"gap-2 sm:gap-0",children:[fe,ge]}),e[53]=fe,e[54]=ge,e[55]=be):be=e[55];let k;e[56]!==se||e[57]!==be?(k=t.jsxs(gt,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col",children:[E,se,be]}),e[56]=se,e[57]=be,e[58]=k):k=e[58];let W;return e[59]!==f||e[60]!==r||e[61]!==k?(W=t.jsx(jt,{open:r,onOpenChange:f,children:k}),e[59]=f,e[60]=r,e[61]=k,e[62]=W):W=e[62],W}function Wr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(Ke,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[t.jsx("span",{className:"font-mono",children:s.id}),": ",s.error]})]},s.id)}function Jr(s){return t.jsxs(Fe,{children:[t.jsx(me,{className:"font-mono text-xs",children:s.id}),t.jsx(me,{className:"text-sm",children:s.title}),t.jsx(me,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:s.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:"none"})}),t.jsx(me,{className:"text-center",children:s.is_public?t.jsx(F,{variant:"secondary",className:"text-[10px] bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400",children:"Yes"}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),t.jsx(me,{className:"text-xs text-muted-foreground",children:(s._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},s.id)}function Zr(s,e){return t.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-400 flex items-start gap-1.5",children:[t.jsx(Ke,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[s.line>0&&t.jsxs("span",{className:"font-mono text-[10px] mr-1",children:["Line ",s.line,":"]}),s.message]})]},`${s.line}-${e}`)}function Xr(s){return s.message.startsWith("Missing required column:")}function en(s){const e=Y.c(19),{open:r,onOpenChange:n,title:o,isDeleting:i,onConfirm:a}=s,l=i===void 0?!1:i;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ye,{children:"Delete registry item?"}),e[0]=d):d=e[0];let u;e[1]!==o?(u=t.jsxs(He,{children:[d,t.jsxs(We,{children:["This action cannot be undone. Item ",t.jsx("strong",{children:o})," will be permanently removed from this private registry."]})]}),e[1]=o,e[2]=u):u=e[2];let m;e[3]!==l?(m=t.jsx(Je,{disabled:l,children:"Cancel"}),e[3]=l,e[4]=m):m=e[4];const h=l?"Deleting...":"Delete";let x;e[5]!==l||e[6]!==a||e[7]!==h?(x=t.jsx(Ze,{disabled:l,onClick:a,children:h}),e[5]=l,e[6]=a,e[7]=h,e[8]=x):x=e[8];let p;e[9]!==m||e[10]!==x?(p=t.jsxs(Xe,{children:[m,x]}),e[9]=m,e[10]=x,e[11]=p):p=e[11];let c;e[12]!==u||e[13]!==p?(c=t.jsxs(et,{children:[u,p]}),e[12]=u,e[13]=p,e[14]=c):c=e[14];let f;return e[15]!==n||e[16]!==r||e[17]!==c?(f=t.jsx(tt,{open:r,onOpenChange:n,children:c}),e[15]=n,e[16]=r,e[17]=c,e[18]=f):f=e[18],f}function tn(s){const[e]=s.id.split("/");return e??"provider"}function sn(s){return s._meta?.["mcp.mesh"]?.tags??[]}function rn(s){return s._meta?.["mcp.mesh"]?.categories??[]}function nn(s){return s.server?.icons?.[0]?.src??null}function ln(s){const e=Y.c(77),{item:r,onEdit:n,onDelete:o,onToggleVerified:i,onToggleOfficial:a}=s;let l;e[0]!==r?(l=nn(r),e[0]=r,e[1]=l):l=e[1];const d=l,u=r._meta?.["mcp.mesh"]?.verified===!0,m=r._meta?.["mcp.mesh"]?.official===!0;let h;e[2]!==r?(h=[...sn(r),...rn(r)],e[2]=r,e[3]=h):h=e[3];const x=h;let p;e[4]!==x?(p=x.slice(0,3),e[4]=x,e[5]=p):p=e[5];const c=p,f=Math.max(0,x.length-c.length);let g;e[6]!==d||e[7]!==r.title?(g=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:d?t.jsx("img",{src:d,alt:r.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:r.title.charAt(0).toUpperCase()})}),e[6]=d,e[7]=r.title,e[8]=g):g=e[8];let _;e[9]!==r.title?(_=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[9]=r.title,e[10]=_):_=e[10];let w;e[11]!==r?(w=tn(r),e[11]=r,e[12]=w):w=e[12];let y;e[13]!==w?(y=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w}),e[13]=w,e[14]=y):y=e[14];let j;e[15]!==r.is_public?(j=r.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(ms,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"}),e[15]=r.is_public,e[16]=j):j=e[16];let I;e[17]!==m?(I=m&&t.jsxs(F,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(Jt,{size:10}),"Official"]}),e[17]=m,e[18]=I):I=e[18];let S;e[19]!==m||e[20]!==u?(S=!m&&u&&t.jsxs(F,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(Jt,{size:10}),"Verified"]}),e[19]=m,e[20]=u,e[21]=S):S=e[21];let N;e[22]!==S||e[23]!==y||e[24]!==j||e[25]!==I?(N=t.jsxs("div",{className:"flex items-center gap-2",children:[y,j,I,S]}),e[22]=S,e[23]=y,e[24]=j,e[25]=I,e[26]=N):N=e[26];let C;e[27]!==N||e[28]!==_?(C=t.jsxs("div",{className:"min-w-0 flex-1",children:[_,N]}),e[27]=N,e[28]=_,e[29]=C):C=e[29];let T;e[30]!==C||e[31]!==g?(T=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[g,C]}),e[30]=C,e[31]=g,e[32]=T):T=e[32];let R;e[33]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(dt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx(At,{size:18})})}),e[33]=R):R=e[33];let E;e[34]!==r||e[35]!==n?(E=t.jsx(Ce,{onClick:()=>n(r),children:"Edit"}),e[34]=r,e[35]=n,e[36]=E):E=e[36];let v;e[37]!==r||e[38]!==i?(v=()=>i(r),e[37]=r,e[38]=i,e[39]=v):v=e[39];const D=u?"Unmark as Verified":"Mark as Verified";let O;e[40]!==v||e[41]!==D?(O=t.jsx(Ce,{onClick:v,children:D}),e[40]=v,e[41]=D,e[42]=O):O=e[42];let P;e[43]!==r||e[44]!==a?(P=()=>a(r),e[43]=r,e[44]=a,e[45]=P):P=e[45];const A=m?"Unmark as Official":"Mark as Official";let z;e[46]!==P||e[47]!==A?(z=t.jsx(Ce,{onClick:P,children:A}),e[46]=P,e[47]=A,e[48]=z):z=e[48];let U;e[49]!==r||e[50]!==o?(U=()=>o(r),e[49]=r,e[50]=o,e[51]=U):U=e[51];let q;e[52]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(st,{size:14}),e[52]=q):q=e[52];let b;e[53]!==U?(b=t.jsxs(Ce,{variant:"destructive",onClick:U,children:[q,"Delete"]}),e[53]=U,e[54]=b):b=e[54];let $;e[55]!==E||e[56]!==O||e[57]!==z||e[58]!==b?($=t.jsxs(ut,{children:[R,t.jsxs(mt,{align:"end",children:[E,O,z,b]})]}),e[55]=E,e[56]=O,e[57]=z,e[58]=b,e[59]=$):$=e[59];let K;e[60]!==T||e[61]!==$?(K=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[T,$]}),e[60]=T,e[61]=$,e[62]=K):K=e[62];const te=r._meta?.["mcp.mesh"]?.short_description||r.description||r.server.description||"No description provided.";let ee;e[63]!==te?(ee=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:te}),e[63]=te,e[64]=ee):ee=e[64];let se;e[65]!==r.id||e[66]!==c?(se=c.map(ge=>t.jsx(F,{variant:"secondary",children:ge},`${r.id}-badge-${ge}`)),e[65]=r.id,e[66]=c,e[67]=se):se=e[67];let re;e[68]!==f?(re=f>0&&t.jsxs(F,{variant:"outline",children:["+",f]}),e[68]=f,e[69]=re):re=e[69];let pe;e[70]!==se||e[71]!==re?(pe=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[se,re]}),e[70]=se,e[71]=re,e[72]=pe):pe=e[72];let fe;return e[73]!==K||e[74]!==ee||e[75]!==pe?(fe=t.jsxs(ne,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[K,ee,pe]}),e[73]=K,e[74]=ee,e[75]=pe,e[76]=fe):fe=e[76],fe}function vs(s){const e=Y.c(28),{value:r,onChange:n,onBlur:o,onFileUpload:i,error:a,isUploading:l}=s,d=l===void 0?!1:l,[u,m]=M.useState(!1),[h,x]=M.useState(!1),p=M.useRef(null);let c;e[0]!==d?(c=v=>{v.preventDefault(),d||m(!0)},e[0]=d,e[1]=c):c=e[1];const f=c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{v.preventDefault(),m(!1)},e[2]=g):g=e[2];const _=g;let w;e[3]!==d||e[4]!==i?(w=async v=>{if(v.preventDefault(),m(!1),d)return;const D=v.dataTransfer.files[0];D&&await i(D)},e[3]=d,e[4]=i,e[5]=w):w=e[5];const y=w;let j;e[6]!==d||e[7]!==i?(j=async v=>{const D=v.target.files?.[0];D&&!d&&await i(D),v.target.value=""},e[6]=d,e[7]=i,e[8]=j):j=e[8];const I=j,S=r.length>0;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(X,{children:"Image"}),e[9]=N):N=e[9];let C;e[10]!==f||e[11]!==y||e[12]!==S||e[13]!==u||e[14]!==d||e[15]!==o||e[16]!==n||e[17]!==h||e[18]!==r?(C=S?t.jsx("div",{className:"relative group min-h-[180px] rounded-xl border border-border overflow-hidden bg-muted/10",children:t.jsxs("div",{className:"flex items-center gap-3 p-3 h-full",children:[t.jsx("div",{className:"size-20 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:t.jsx("img",{src:r,alt:"Preview",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r}),t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>p.current?.click(),disabled:d,children:[t.jsx($t,{className:"size-3"}),"Change"]}),t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{n(""),x(!1)},disabled:d,children:[t.jsx(st,{className:"size-3"}),"Remove"]})]})]})]})}):d?t.jsxs("div",{className:"relative min-h-[180px] rounded-xl border border-border bg-muted/10 flex flex-col items-center justify-center gap-3",children:[t.jsx(ze,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):t.jsxs("div",{className:Z("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",u?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:f,onDragLeave:_,onDrop:y,onClick:()=>p.current?.click(),children:[t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6 px-4 flex-1",children:[t.jsx("div",{className:Z("size-10 rounded-lg flex items-center justify-center transition-colors",u?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:t.jsx(ur,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:u?"Drop image here":"Click or drag to upload"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"PNG, JPG, SVG up to 2MB"})]})]}),h?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:an,children:t.jsx(ae,{placeholder:"https://example.com/logo.png",value:r,className:"text-xs h-8",onChange:v=>n(v.target.value),onBlur:o})}):t.jsx("div",{className:"border-t border-border px-4 py-2",children:t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-full justify-center",onClick:v=>{v.stopPropagation(),x(!0)},children:[t.jsx(Gs,{className:"size-3"}),"Or paste an image URL"]})})]}),e[10]=f,e[11]=y,e[12]=S,e[13]=u,e[14]=d,e[15]=o,e[16]=n,e[17]=h,e[18]=r,e[19]=C):C=e[19];let T;e[20]!==I?(T=t.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:I}),e[20]=I,e[21]=T):T=e[21];let R;e[22]!==a?(R=a&&t.jsx("p",{className:"text-xs text-destructive",children:a}),e[22]=a,e[23]=R):R=e[23];let E;return e[24]!==C||e[25]!==T||e[26]!==R?(E=t.jsxs("div",{className:"grid gap-1.5",children:[N,C,T,R]}),e[24]=C,e[25]=T,e[26]=R,e[27]=E):E=e[27],E}function an(s){return s.stopPropagation()}function bs(){const[s,e]=M.useState("idle"),[r,n]=M.useState(null),{org:o}=ie(),i=oe({connectionId:ce,orgId:o.id,orgSlug:o.slug});return{discover:async(d,u)=>{if(!d)return null;e("loading"),n(null);try{const m=await i.callTool({name:"REGISTRY_DISCOVER_TOOLS",arguments:{url:d,type:u==="sse"?"sse":"http"}}),h=m.structuredContent??m;if(m.isError){const x=m.content?.find(p=>p.type==="text")?.text??"Tool returned an error";return n(x),e("error"),null}return h.error?on(h.error)?(n(h.error),e("auth_required"),null):(n(h.error),e("error"),null):!h.tools||h.tools.length===0?(n("No tools found on this MCP server."),e("error"),null):(e("success"),h.tools)}catch(m){const h=m instanceof Error?m.message:String(m);return n(h||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:r,resetDiscover:()=>{e("idle"),n(null)}}}function on(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function cn(s){const e=Y.c(54),{tools:r,onChange:n,remoteUrl:o,remoteType:i,externalDiscoverStatus:a,externalDiscoverError:l}=s,[d,u]=M.useState(r.length>0),{discover:m,discoverStatus:h,discoverError:x,resetDiscover:p}=bs(),c=a??h,f=l??x;let g;e[0]!==m||e[1]!==n||e[2]!==i||e[3]!==o?(g=async()=>{if(!o)return;const q=await m(o,i??"http");q&&(n(q),u(!0))},e[0]=m,e[1]=n,e[2]=i,e[3]=o,e[4]=g):g=e[4];const _=g;let w;e[5]!==n||e[6]!==p?(w=()=>{n([]),p()},e[5]=n,e[6]=p,e[7]=w):w=e[7];const y=w;let j;e[8]!==d?(j=()=>u(!d),e[8]=d,e[9]=j):j=e[9];let I,S;e[10]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ds,{size:14,className:"text-muted-foreground"}),S=t.jsx("span",{children:"Tools"}),e[10]=I,e[11]=S):(I=e[10],S=e[11]);let N;e[12]!==r.length?(N=r.length>0&&t.jsx(F,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[12]=r.length,e[13]=N):N=e[13];let C;e[14]!==d?(C=d?t.jsx(fr,{size:14,className:"text-muted-foreground"}):t.jsx(pr,{size:14,className:"text-muted-foreground"}),e[14]=d,e[15]=C):C=e[15];let T;e[16]!==j||e[17]!==N||e[18]!==C?(T=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:j,children:[I,S,N,C]}),e[16]=j,e[17]=N,e[18]=C,e[19]=T):T=e[19];let R;e[20]!==y||e[21]!==r.length?(R=r.length>0&&t.jsxs(G,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:y,children:[t.jsx(st,{size:12}),"Clear"]}),e[20]=y,e[21]=r.length,e[22]=R):R=e[22];let E;e[23]!==c||e[24]!==_||e[25]!==o||e[26]!==r.length?(E=o&&t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all",onClick:_,disabled:c==="loading",children:[c==="loading"?t.jsx(ze,{size:12,className:"animate-spin"}):t.jsx($t,{size:12}),c==="loading"?"Discovering...":r.length>0?"Refresh":"Auto-discover"]}),e[23]=c,e[24]=_,e[25]=o,e[26]=r.length,e[27]=E):E=e[27];let v;e[28]!==E||e[29]!==R?(v=t.jsxs("div",{className:"flex items-center gap-2",children:[R,E]}),e[28]=E,e[29]=R,e[30]=v):v=e[30];let D;e[31]!==v||e[32]!==T?(D=t.jsxs("div",{className:"flex items-center justify-between",children:[T,v]}),e[31]=v,e[32]=T,e[33]=D):D=e[33];let O;e[34]!==c||e[35]!==r.length?(O=c==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-950/30 rounded-lg px-3 py-2",children:[t.jsx(Le,{size:14,className:"shrink-0"}),t.jsxs("span",{children:["Discovered ",r.length," tool",r.length!==1?"s":""," ","successfully."]})]}),e[34]=c,e[35]=r.length,e[36]=O):O=e[36];let P;e[37]!==f||e[38]!==c?(P=c==="error"&&f&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(Ke,{size:14,className:"shrink-0"}),t.jsx("span",{children:f})]}),e[37]=f,e[38]=c,e[39]=P):P=e[39];let A;e[40]!==d||e[41]!==r?(A=d&&r.length>0&&t.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:r.map(dn)}),e[40]=d,e[41]=r,e[42]=A):A=e[42];let z;e[43]!==c||e[44]!==d||e[45]!==o||e[46]!==r.length?(z=d&&r.length===0&&c==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o?'Click "Auto-discover" to load tools from the MCP server.':"Add a Remote URL first, then tools can be auto-discovered."}),e[43]=c,e[44]=d,e[45]=o,e[46]=r.length,e[47]=z):z=e[47];let U;return e[48]!==D||e[49]!==O||e[50]!==P||e[51]!==A||e[52]!==z?(U=t.jsxs("div",{className:"space-y-3",children:[D,O,P,A,z]}),e[48]=D,e[49]=O,e[50]=P,e[51]=A,e[52]=z,e[53]=U):U=e[53],U}function dn(s){return t.jsx("div",{className:"flex items-center gap-3 px-3 py-2",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-mono truncate",children:s.name}),s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})},s.name)}function ys(s){const{org:e}=ie(),[r,n]=M.useState(!1),i=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,a=oe({connectionId:i??"noop",orgId:e.id,orgSlug:e.slug});return{uploadImage:async(d,u)=>{if(!i)return V.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!d.type.startsWith("image/"))return V.error("Only image files are supported"),null;if(d.size>5*1024*1024)return V.error("Image size must be less than 5MB"),null;n(!0);try{const m=await a.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:u,contentType:d.type}}),h=m.structuredContent?.url||m.url;if(!h)throw new Error("Failed to get presigned URL");const x=await fetch(h,{method:"PUT",body:d,headers:{"Content-Type":d.type}});if(!x.ok)throw new Error(`Upload failed: ${x.statusText}`);const p=await a.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),c=p.structuredContent?.url||p.url;if(!c)throw new Error("Failed to get public URL");return c}catch(m){return console.error("Image upload failed:",m),V.error(m instanceof Error?m.message:"Failed to upload image. Please try again."),null}finally{n(!1)}},isUploading:r}}const un=new Set(["http","sse","stdio"]),mn=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,xn=["internal","automation","support","sales","ops","ai"],hn=["productivity","communication","customer-support","development","data","operations"],pn=["Essentials","Details","Advanced"],fn="h-7 text-xs border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all";function ls(s){return s.replace(/^https?:\/\//i,"").trim()}function Ge(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Ue(s){return s.trim().toLowerCase()}function bt(s){return Array.from(new Set(s.map(Ue).filter(e=>e.length>0)))}function Ae(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function gn(s){const e=Y.c(4),{current:r}=s;let n;e[0]!==r?(n=pn.map((i,a)=>{const l=a+1,d=l===r,u=l<r;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&t.jsx("div",{className:Z("w-4 h-px",u?"bg-primary":"bg-border")}),t.jsxs("div",{className:Z("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",d?"bg-primary/10 text-primary font-medium":u?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:Z("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",d?"bg-primary text-primary-foreground":u?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:l}),t.jsx("span",{className:"hidden sm:inline",children:i})]})]},i)}),e[0]=r,e[1]=n):n=e[1];let o;return e[2]!==n?(o=t.jsx("div",{className:"flex items-center gap-1.5",children:n}),e[2]=n,e[3]=o):o=e[3],o}function jn(s){const e=Y.c(28),{id:r,label:n,values:o,availableOptions:i,placeholder:a,onChange:l}=s,[d,u]=M.useState(""),[m,h]=M.useState(!1);let x,p,c,f,g;if(e[0]!==i||e[1]!==r||e[2]!==d||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==o){const y=bt(i),j=bt(o),I=new Set(j),S=Ue(d),N=y.filter(P=>!I.has(P)).filter(P=>S?P.includes(S):!0).slice(0,8),C=P=>{const A=Ue(P);!A||I.has(A)||l([...j,A])},T=P=>{l(j.filter(A=>A!==P))},R=()=>{const P=d.split(/[,\n;]/).map(Ue).filter(Boolean);if(P.length===0)return;const A=[...j];for(const z of P)A.includes(z)||A.push(z);l(A),u("")},E=S;f="grid gap-2",e[13]!==r||e[14]!==n?(g=t.jsx(X,{htmlFor:r,children:n}),e[13]=r,e[14]=n,e[15]=g):g=e[15],x="relative";let v;e[16]!==r?(v=()=>{const P=document.getElementById(r);P instanceof HTMLInputElement&&P.focus()},e[16]=r,e[17]=v):v=e[17];let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=()=>h(!0),e[18]=D):D=e[18];let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=P=>u(P.target.value),e[19]=O):O=e[19],p=t.jsx("div",{className:"min-h-9 w-full rounded-xl border border-input bg-background px-2.5 py-1.5 text-sm focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",onClick:v,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[j.map(P=>t.jsxs(F,{variant:"secondary",className:"gap-1",children:[P,t.jsx("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),T(P)},children:t.jsx(hr,{size:12})})]},`${r}-${P}`)),t.jsx("input",{id:r,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:j.length?"":a,value:d,onFocus:D,onBlur:()=>{h(!1),R()},onChange:O,onKeyDown:P=>{if(P.key==="Enter"||P.key===","){P.preventDefault(),R();return}P.key==="Backspace"&&!d&&j.length&&T(j[j.length-1]??"")}})]})}),c=m&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:N.length>0?N.map(P=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:bn,onClick:()=>{C(P),u("")},children:P},`${r}-suggestion-${P}`)):E?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:vn,onClick:()=>{C(E),u("")},children:['Create "',E,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})}),e[0]=i,e[1]=r,e[2]=d,e[3]=m,e[4]=n,e[5]=l,e[6]=a,e[7]=o,e[8]=x,e[9]=p,e[10]=c,e[11]=f,e[12]=g}else x=e[8],p=e[9],c=e[10],f=e[11],g=e[12];let _;e[20]!==x||e[21]!==p||e[22]!==c?(_=t.jsxs("div",{className:x,children:[p,c]}),e[20]=x,e[21]=p,e[22]=c,e[23]=_):_=e[23];let w;return e[24]!==f||e[25]!==g||e[26]!==_?(w=t.jsxs("div",{className:f,children:[g,_]}),e[24]=f,e[25]=g,e[26]=_,e[27]=w):w=e[27],w}function vn(s){return s.preventDefault()}function bn(s){return s.preventDefault()}function yn({id:s,value:e,availableOptions:r,onChange:n}){const[o,i]=M.useState(e),[a,l]=M.useState(!1),d=M.useRef(e);d.current!==e&&(d.current=e,i(e));const u=bt([...hn,...r,e]).filter(Boolean),m=Ue(o),h=u.filter(p=>m?p.includes(m):!0).slice(0,8),x=p=>{const c=Ue(p);n(c),i(c),l(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(X,{htmlFor:s,children:"Category"}),t.jsxs("div",{className:"relative",children:[t.jsx(ae,{id:s,className:"h-9 text-sm",placeholder:"Select or create category",value:o,onFocus:()=>{i(e),l(!0)},onBlur:()=>{x(o)},onChange:p=>i(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),x(o))}}),e&&t.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground hover:text-foreground",onMouseDown:p=>p.preventDefault(),onClick:()=>{n(""),i("")},children:"clear"}),a&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:h.length>0?h.map(p=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:c=>c.preventDefault(),onClick:()=>x(p),children:p},`${s}-${p}`)):m?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:p=>p.preventDefault(),onClick:()=>x(m),children:['Create "',m,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})})]})]})}function Nn({open:s,onOpenChange:e,item:r,draft:n,availableTags:o=[],availableCategories:i=[],isSubmitting:a=!1,onSubmit:l}){const{org:d}=ie(),{uploadImage:u,isUploading:m}=ys(),{discover:h,discoverStatus:x,discoverError:p,resetDiscover:c}=bs(),f=!!r,g=n?._meta?.["mcp.mesh"],_=r?.title??n?.title??"",w=r?.id?.split("/")[0]??n?.id?.split("/")[0]??"",y=r?.description??n?.description??"",j=r?._meta?.["mcp.mesh"]?.short_description??g?.short_description??"",I=r?._meta?.["mcp.mesh"]?.owner??g?.owner??"",S=r?.server?.repository?.url??n?.server?.repository?.url??"",N=r?._meta?.["mcp.mesh"]?.readme??g?.readme??"",C=r?._meta?.["mcp.mesh"]?.readme_url??g?.readme_url??"",T=ls(r?.server?.remotes?.[0]?.url??n?.server?.remotes?.[0]?.url??""),R=r?.server?.remotes?.[0]?.type??n?.server?.remotes?.[0]?.type??"http",E=r?._meta?.["mcp.mesh"]?.tags??g?.tags??[],v=r?._meta?.["mcp.mesh"]?.categories?.[0]??g?.categories?.[0]??"",D=r?.server?.icons?.[0]?.src??n?.server?.icons?.[0]?.src??"",O=r?._meta?.["mcp.mesh"]?.tools??g?.tools??[],P=r?.is_public??n?.is_public??!1,A=r?._meta?.["mcp.mesh"]?.verified??g?.verified??!1,z=r?._meta?.["mcp.mesh"]?.official??g?.official??!1,[U,q]=M.useState(1),[b,$]=M.useState(_),[K,te]=M.useState(w),[ee,se]=M.useState(y),[re,pe]=M.useState(j),[fe,ge]=M.useState(I),[be,k]=M.useState(S),[W,H]=M.useState(N),[xe,ye]=M.useState(C),[de,nt]=M.useState(N?"content":"link"),[Me,L]=M.useState(T),[le,it]=M.useState(R),[qe,qt]=M.useState(E),[Nt,zt]=M.useState(v),[Be,wt]=M.useState(D),[we,lt]=M.useState(O),[Lt,Ft]=M.useState(P),[Bt,Qt]=M.useState(A),[Vt,Gt]=M.useState(z),[he,Qe]=M.useState({}),Kt=()=>{q(1),$(_),te(w),se(y),pe(j),ge(I),k(S),H(N),ye(C),nt(N?"content":"link"),L(T),it(R),qt(E),zt(v),wt(D),lt(O),Ft(P),Qt(A),Gt(z),Qe({}),c(),at.current="",Pe.current&&(clearTimeout(Pe.current),Pe.current=null)},ks=async B=>{if(!B)return;const J=f?r?.id:`${K}/${b}`.toLowerCase(),Ne=Ae(J||"temp"),Se=B.name.split(".").pop()||"png",Re=`registry/${d.id}/${Ne}/icon.${Se}`,De=await u(B,Re);De?(wt(De),Qe(Te=>({...Te,imageUrl:void 0}))):Qe(Te=>({...Te,imageUrl:"Failed to upload image. Please try again."}))},Pe=M.useRef(null),at=M.useRef(""),_t=M.useRef(le);_t.current=le;const Yt=B=>{!B&&Pe.current&&(clearTimeout(Pe.current),Pe.current=null),e(B),B||Kt()},Ss=async()=>{const B=Ge(Me);if(!B)return;at.current=B;const J=await h(B,_t.current);J&<(J)},Rs=B=>{Pe.current&&clearTimeout(Pe.current);const J=Ge(B);!J||J===at.current||B.includes(".")&&(Pe.current=setTimeout(async()=>{at.current=J;const Ne=await h(J,_t.current);Ne&<(Ne)},800))},Ht=B=>{const J={};if(B===1){const Ne=Ae(K),Se=Ae(b),Re=`${Ne}/${Se}`;b.trim()||(J.title="Name is required."),f||(Ne?Se?mn.test(Re)||(J.provider="Use lowercase letters/numbers and separators '/' or '-'."):J.title="Name must contain valid characters.":J.provider="Provider is required.");const De=Ge(Me),Te=le.trim().toLowerCase();if(Te!=="stdio"&&De)try{const Ve=new URL(De);["http:","https:"].includes(Ve.protocol)||(J.remoteUrl="Remote URL must be http(s).")}catch{J.remoteUrl="Remote URL is invalid."}if(Te&&!un.has(Te)&&(J.remoteType="Remote type must be: http, sse or stdio."),Be.trim()&&!Be.trim().startsWith("data:image/"))try{const Ct=new URL(Be.trim());["http:","https:"].includes(Ct.protocol)||(J.imageUrl="Image URL must be http(s).")}catch{J.imageUrl="Image URL is invalid."}}if(B===2&&(ee.length>1500&&(J.description="Description must be 1500 characters or less."),re.trim().length>160&&(J.shortDescription="Short description must be 160 characters or less.")),B===3){const Ne=xe.trim();if(Ne)try{const Re=new URL(Ne);["http:","https:"].includes(Re.protocol)||(J.readmeUrl="README URL must be http(s).")}catch{J.readmeUrl="README URL is invalid."}W.trim().length>5e4&&(J.readme="README must be 50 000 characters or less.");const Se=be.trim();if(Se)try{const Re=new URL(Se);["http:","https:"].includes(Re.protocol)||(J.repositoryUrl="Repository URL must be http(s).")}catch{J.repositoryUrl="Repository URL is invalid."}}return Qe(J),Object.values(J).every(Ne=>Ne===void 0)},Ts=()=>{Ht(U)&&U<3&&q(U+1)},Is=()=>{U>1&&q(U-1)},Ps=async()=>{if(!Ht(3))return;const B=b.trim(),J=Ae(K),Ne=Ae(B),Se=`${J}/${Ne}`,Re=Ge(Me),De=le.trim().toLowerCase(),Te=Be.trim(),Ve=be.trim(),Ct=re.trim(),As=W.trim(),$s=xe.trim(),Os=bt(qe),Us=Nt?[Ue(Nt)]:[],qs=r?r.server?.name??r.id:"",zs=(f?qs:Se).trim(),kt=ee.trim(),Ls=fe.trim(),Wt={title:B,description:kt.length>0?kt:null,is_public:Lt,_meta:{"mcp.mesh":{verified:Bt,official:Vt,tags:Os,categories:Us,short_description:Ct||null,owner:Ls||null,readme:As||null,readme_url:$s||null,...we.length>0?{tools:we}:{}}},server:{name:zs,title:B,description:kt||void 0,icons:Te?[{src:Te}]:[],repository:Ve?{url:Ve}:void 0,remotes:Re?[{type:De||"http",url:Re}]:[]}};if(f&&r){await l({id:r.id,data:Wt}),e(!1);return}await l({id:Se,...Wt}),e(!1),Kt()},Ms=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"row-span-2 grid gap-3 content-start",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-provider",children:"Provider"}),t.jsx(ae,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:K,onChange:B=>te(B.target.value),disabled:f}),!f&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Item ID:"," ",t.jsx("span",{className:"font-mono",children:`${Ae(K)||"provider"}/${Ae(b)||"name"}`})]}),he.provider&&t.jsx("p",{className:"text-xs text-destructive",children:he.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-title",children:"Name"}),t.jsx(ae,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:b,onChange:B=>$(B.target.value)}),he.title&&t.jsx("p",{className:"text-xs text-destructive",children:he.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(vs,{value:Be,onChange:B=>{wt(B),Qe(J=>({...J,imageUrl:void 0}))},onFileUpload:ks,error:he.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-remote-url",children:"Remote URL"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex-1 flex items-center rounded-xl border border-input px-3",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground mr-1",children:"https://"}),t.jsx("input",{id:"registry-remote-url",className:"flex-1 h-9 bg-transparent outline-none text-sm",placeholder:"example.com/mcp",value:Me,onChange:B=>{const J=ls(B.target.value);L(J),Rs(J)}})]}),t.jsxs(ar,{value:le,onValueChange:it,children:[t.jsx(or,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(cr,{placeholder:"Type"})}),t.jsxs(dr,{children:[t.jsx(St,{value:"http",children:"http"}),t.jsx(St,{value:"sse",children:"sse"}),t.jsx(St,{value:"stdio",children:"stdio"})]})]})]}),he.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:he.remoteUrl}),he.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:he.remoteType})]}),Me.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:Z(fn,"gap-1.5"),onClick:Ss,disabled:x==="loading",children:[x==="loading"?t.jsx(ze,{size:12,className:"animate-spin"}):t.jsx($t,{size:12}),x==="loading"?"Discovering tools...":we.length>0?"Re-discover tools":"Discover tools from URL"]}),we.length>0&&x!=="loading"&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[we.length," tool",we.length!==1?"s":""," loaded"]})]}),x==="success"&&we.length>0&&t.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-50 dark:bg-green-950/20 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400",children:[t.jsx(Le,{size:14,className:"shrink-0"}),t.jsxs("span",{className:"font-medium",children:[we.length," tool",we.length!==1?"s":""," discovered"]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[we.slice(0,8).map(B=>t.jsx(F,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:B.name},B.name)),we.length>8&&t.jsxs("span",{className:"text-[10px] text-muted-foreground self-center",children:["+",we.length-8," more"]})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These tools will enrich AI-generated descriptions, tags and categories in the next step."})]}),x==="auth_required"&&p&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 rounded-lg px-3 py-2",children:[t.jsx(Ke,{size:14,className:"shrink-0"}),t.jsx("span",{children:"This server requires authentication. The connection is valid but tools cannot be listed without credentials."})]}),x==="error"&&p&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(Ke,{size:14,className:"shrink-0"}),t.jsx("span",{children:p})]})]})]}),Es=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{htmlFor:"registry-item-short-description",children:"Short Description"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[re.length,"/160"]})]}),t.jsx(ae,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:"Short summary for the store card",value:re,maxLength:160,onChange:B=>pe(B.target.value)}),he.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:he.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{htmlFor:"registry-item-description",children:"Description"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ee.length,"/1500"]})]}),t.jsx(vt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:"Brief description of this MCP server",rows:2,value:ee,onChange:B=>se(B.target.value)}),he.description&&t.jsx("p",{className:"text-xs text-destructive",children:he.description})]}),t.jsx("div",{className:"border-t border-border"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(yn,{id:"registry-category",value:Nt,availableOptions:i,onChange:zt})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(jn,{id:"registry-tags",label:"Tags",values:qe,availableOptions:[...xn,...o],placeholder:"Type and press Enter or comma",onChange:qt})})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-public",className:"text-sm",children:"Public"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this MCP visible in the public store URL."})]}),t.jsx(Oe,{id:"registry-is-public",checked:Lt,onCheckedChange:Ft})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-verified",className:"text-sm",children:"Verified"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Curated and approved by deco."})]}),t.jsx(Oe,{id:"registry-is-verified",checked:Bt,onCheckedChange:Qt})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-official",className:"text-sm",children:"Official"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Made and hosted by the service provider."})]}),t.jsx(Oe,{id:"registry-is-official",checked:Vt,onCheckedChange:Gt})]})]}),Ds=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-owner",children:"Owner (optional)"}),t.jsx(ae,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:"Team, company, or responsible person",value:fe,onChange:B=>ge(B.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-repository-url",children:"Repository URL (optional)"}),t.jsx(ae,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:be,onChange:B=>k(B.target.value)}),he.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:he.repositoryUrl})]})]}),t.jsxs("div",{className:"rounded-xl border border-border p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{children:"README"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[W.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(B=>t.jsx("button",{type:"button",className:Z("px-2.5 py-1 text-xs rounded-md",de===B?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>nt(B),children:B==="link"?"Link":"Content"},B))}),de==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:xe,onChange:B=>ye(B.target.value)}),he.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:he.readmeUrl})]}),de==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(vt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
|
|
26
|
-
|
|
27
|
-
Describe your MCP here...`,rows:6,value:W,onChange:B=>H(B.target.value)}),he.readme&&t.jsx("p",{className:"text-xs text-destructive",children:he.readme})]})]}),t.jsx(cn,{tools:we,onChange:lt,remoteUrl:Ge(Me)||void 0,remoteType:le,externalDiscoverStatus:x,externalDiscoverError:p})]});return t.jsx(jt,{open:s,onOpenChange:Yt,children:t.jsxs(gt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(xt,{className:"space-y-3",children:[t.jsx(ht,{children:f?"Edit MCP Server":"Add MCP Server"}),t.jsx(gn,{current:U}),t.jsxs(pt,{children:[U===1&&"Set up the identity, connection and discover available tools.",U===2&&"Add descriptions, categories and tags to help discovery.",U===3&&"Configure optional metadata, README and tools."]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[U===1&&Ms,U===2&&Es,U===3&&Ds]}),t.jsxs(ft,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:U>1&&t.jsxs(G,{variant:"ghost",size:"sm",onClick:Is,children:[t.jsx(mr,{size:14}),"Back"]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(G,{variant:"outline",size:"sm",onClick:()=>Yt(!1),disabled:a,children:"Cancel"}),U<3?t.jsxs(G,{size:"sm",onClick:Ts,children:["Next",t.jsx(Ks,{size:14})]}):t.jsx(G,{size:"sm",onClick:Ps,disabled:a,children:a?"Saving...":f?"Save changes":"Create"})]})]})]})})}function as(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function wn(s){return s._meta?.["mcp.mesh"]?.tags??[]}function _n(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Cn(s){return s.server?.remotes?.[0]?.url??"-"}function kn(){const[e,r]=M.useState(""),n=M.useDeferredValue(e),[o,i]=M.useState([]),[a,l]=M.useState([]),[d,u]=M.useState(!1),[m,h]=M.useState(!1),[x,p]=M.useState(null),[c,f]=M.useState(null),[g,_]=rr("private-registry-list","cards"),w=M.useRef(null),y=gs({search:n,tags:o,categories:a}),j=Ar(),{createMutation:I,updateMutation:S,deleteMutation:N,bulkCreateMutation:C}=Ut(),T=y.data?.pages.flatMap(b=>b.items??[]).filter(Boolean)??[],R=y.data?.pages[0]?.totalCount??T.length,E=o.length>0||a.length>0||n.length>0,v=j.data,D=Array.isArray(v?.tags)?v.tags:[],O=Array.isArray(v?.categories)?v.categories:[],P=b=>{w.current&&(w.current.disconnect(),w.current=null),!(!b||!y.hasNextPage||y.isFetchingNextPage)&&(w.current=new IntersectionObserver($=>{$[0]?.isIntersecting&&y.hasNextPage&&!y.isFetchingNextPage&&y.fetchNextPage()},{rootMargin:"240px 0px"}),w.current.observe(b))},A=async b=>{try{"data"in b?(await S.mutateAsync(b),V.success("Registry item updated")):(await I.mutateAsync(b),V.success("Registry item created"))}catch($){throw V.error($ instanceof Error?$.message:"Failed to save item"),$}},z=async b=>{const $=b._meta?.["mcp.mesh"]?.verified===!0;try{await S.mutateAsync({id:b.id,data:{_meta:{...b._meta,"mcp.mesh":{...b._meta?.["mcp.mesh"],verified:!$}}}}),V.success($?"Removed verified status":"Marked as verified")}catch(K){V.error(K instanceof Error?K.message:"Failed to update item")}},U=async b=>{const $=b._meta?.["mcp.mesh"]?.official===!0;try{await S.mutateAsync({id:b.id,data:{_meta:{...b._meta,"mcp.mesh":{...b._meta?.["mcp.mesh"],official:!$}}}}),V.success($?"Removed official status":"Marked as official")}catch(K){V.error(K instanceof Error?K.message:"Failed to update item")}},q=async()=>{if(c)try{await N.mutateAsync(c.id),V.success("Registry item deleted"),f(null)}catch(b){V.error(b instanceof Error?b.message:"Failed to delete item")}};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:"Items"}),t.jsx(F,{variant:"secondary",className:"text-xs",children:R})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(ut,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(G,{variant:"outline",size:"sm",className:Z("h-8","gap-1.5"),children:[t.jsx(nr,{size:14}),"Filters"]})}),t.jsxs(mt,{align:"end",className:"w-[260px]",children:[t.jsx(Zt,{children:"Tags"}),D.length>0?D.map(b=>t.jsxs(Xt,{checked:o.includes(b.value),onCheckedChange:()=>i($=>as($,b.value)),children:[b.value," (",b.count,")"]},b.value)):t.jsx(Ce,{disabled:!0,children:"No tags available"}),t.jsx(tr,{}),t.jsx(Zt,{children:"Categories"}),O.length>0?O.map(b=>t.jsxs(Xt,{checked:a.includes(b.value),onCheckedChange:()=>l($=>as($,b.value)),children:[b.value," (",b.count,")"]},b.value)):t.jsx(Ce,{disabled:!0,children:"No categories available"})]})]}),t.jsxs(sr,{type:"single",value:g,onValueChange:b=>{(b==="cards"||b==="table")&&_(b)},variant:"outline",className:"h-8",children:[t.jsx(es,{value:"cards","aria-label":"Cards view",className:"h-8",children:"Cards"}),t.jsx(es,{value:"table","aria-label":"Table view",className:"h-8",children:"Table"})]}),t.jsx(G,{variant:"outline",size:"sm",className:"h-8",onClick:()=>h(!0),children:"Import CSV"}),t.jsx(G,{size:"sm",className:"h-8",onClick:()=>u(!0),children:"Add MCP Servers"})]})]}),t.jsx("div",{className:"border-t border-border h-12 px-4 md:px-6 flex items-center",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-12 w-full cursor-text",children:[t.jsx(lr,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(ae,{value:e,onChange:b=>r(b.target.value),placeholder:"Search by id, title, description, or server name",className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),E&&t.jsxs("div",{className:"border-t border-border px-4 md:px-6 py-2 flex flex-wrap items-center gap-2",children:[o.map(b=>t.jsxs(F,{variant:"default",children:["#",b]},`selected-tag-${b}`)),a.map(b=>t.jsx(F,{variant:"outline",children:b},`selected-category-${b}`)),e.trim()&&t.jsxs(F,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",e]}),t.jsx(G,{size:"sm",variant:"ghost",className:"h-7 ml-auto",onClick:()=>{r(""),i([]),l([])},children:"Clear filters"})]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[T.length===0?t.jsx("div",{className:"min-h-[320px] rounded-xl border border-dashed border-border flex flex-col items-center justify-center gap-3 p-6 text-center",children:y.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(ze,{className:"size-5 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-base font-medium",children:E?"No items found":"No MCPs in your registry"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:E?"Try removing filters or changing your search to find matching MCPs.":"Add your first MCP item to start building your private registry catalog."}),!E&&t.jsx(G,{size:"lg",onClick:()=>u(!0),children:"Add MCP Servers"})]})}):g==="cards"?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:T.map(b=>t.jsx(ln,{item:b,onEdit:p,onDelete:f,onToggleVerified:z,onToggleOfficial:U},b.id))}),y.hasNextPage&&t.jsx("div",{ref:P,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs(Mt,{children:[t.jsx(Et,{children:t.jsxs(Fe,{children:[t.jsx(ue,{className:"w-[56px]",children:"Icon"}),t.jsx(ue,{children:"Title"}),t.jsx(ue,{children:"ID"}),t.jsx(ue,{children:"Tags"}),t.jsx(ue,{children:"Categories"}),t.jsx(ue,{children:"Remote URL"}),t.jsx(ue,{children:"Visibility"}),t.jsx(ue,{className:"text-right w-[68px]",children:"Actions"})]})}),t.jsx(Dt,{children:T.map(b=>t.jsxs(Fe,{children:[t.jsx(me,{children:t.jsx("div",{className:"size-8 rounded-md border border-border bg-muted/20 overflow-hidden flex items-center justify-center",children:b.server?.icons?.[0]?.src?t.jsx("img",{src:b.server.icons[0].src,alt:b.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:b.title.charAt(0).toUpperCase()})})}),t.jsx(me,{children:b.title}),t.jsx(me,{className:"font-mono",children:b.id}),t.jsx(me,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:wn(b).slice(0,3).map($=>t.jsx(F,{variant:"outline",children:$},`${b.id}-tag-${$}`))})}),t.jsx(me,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:_n(b).slice(0,3).map($=>t.jsx(F,{variant:"outline",children:$},`${b.id}-category-${$}`))})}),t.jsx(me,{children:Cn(b)}),t.jsx(me,{children:b.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(ms,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"})}),t.jsx(me,{className:"text-right",children:t.jsxs(ut,{children:[t.jsx(dt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx(At,{size:18})})}),t.jsxs(mt,{align:"end",children:[t.jsx(Ce,{onClick:()=>p(b),children:"Edit"}),t.jsx(Ce,{variant:"destructive",onClick:()=>f(b),children:"Delete"})]})]})})]},b.id))})]})}),y.hasNextPage&&t.jsx("div",{ref:P,className:"h-2"})]}),y.isFetchingNextPage&&t.jsxs("div",{className:"py-4 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ze,{className:"size-4 animate-spin"}),"Loading more items..."]})]}),t.jsx(Nn,{open:d||!!x,onOpenChange:b=>{b||(u(!1),p(null))},item:x,availableTags:D.map(b=>b.value),availableCategories:O.map(b=>b.value),isSubmitting:I.isPending||S.isPending,onSubmit:A},x?.id??"create"),t.jsx(Hr,{open:m,onOpenChange:h,isImporting:C.isPending,onImport:async b=>{try{const $=await C.mutateAsync(b);return V.success(`Imported ${$.created} item(s)`),$}catch($){throw V.error($ instanceof Error?$.message:"Failed to import CSV"),$}}}),t.jsx(en,{open:!!c,onOpenChange:b=>{b||f(null)},title:c?.title??c?.id??"",isDeleting:N.isPending,onConfirm:q})]})}function Sn(s,e,r=!1){const n=M.useRef(null),o=M.useRef(s),i=M.useRef(e),a=M.useRef(r);return o.current=s,i.current=e,a.current=r,d=>{n.current&&n.current.disconnect(),n.current=new IntersectionObserver(u=>{u[0]?.isIntersecting&&i.current&&!a.current&&o.current()}),d&&n.current.observe(d)}}const Rn=[{value:"pending",label:"Pending"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"}];function os(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function cs(s){return{id:s.requested_id??s.server?.name,title:s.title,description:s.description??"",_meta:s._meta,server:s.server,is_public:!1}}function Pt(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function ot(s){const e=s._meta?.["mcp.mesh"];return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function Tn(){const[s,e]=M.useState("pending"),[r,n]=M.useState("created_at"),[o,i]=M.useState("asc"),[a,l]=M.useState(new Set),[d,u]=M.useState(!1),[m,h]=M.useState("private"),[x,p]=M.useState(!1),[c,f]=M.useState(null),[g,_]=M.useState(null),[w,y]=M.useState(null),[j,I]=M.useState(null),[S,N]=M.useState(""),C=Or({status:s,sortBy:r,sortDirection:o}),{reviewMutation:T,deleteMutation:R}=Lr(),{createMutation:E}=Ut(),v=C.data?.pages.flatMap(k=>k.items)??[],D=C.data?.pages[0]?.totalCount??0,O=C.isFetchingNextPage,P=!!C.hasNextPage,A=Sn(()=>{C.isFetchingNextPage||C.fetchNextPage()},P,O),z=new Set(v.filter(k=>k.status==="pending").map(k=>k.id)),U=v.filter(k=>z.has(k.id)),q=a.size,b=U.filter(k=>a.has(k.id)),$=v.filter(k=>a.has(k.id)).length,K=U.length>0&&U.every(k=>a.has(k.id)),te=()=>l(new Set),ee=(k,W)=>{l(H=>{const xe=new Set(H);return W?xe.add(k):xe.delete(k),xe})},se=k=>{l(W=>{const H=new Set(W);return H.has(k)?H.delete(k):H.add(k),H})},re=()=>{l(k=>{const W=new Set(k);for(const H of U)W.add(H.id);return W})},pe=async()=>{const k=g;if(k){_(null),f(k.id);try{await T.mutateAsync({id:k.id,status:"approved",reviewerNotes:void 0});const W=cs(k);await E.mutateAsync({id:W.id,title:W.title,description:W.description,_meta:W._meta,server:W.server,is_public:W.is_public}),V.success("Request approved and added to registry")}catch(W){const H=W instanceof Error?W.message:"Failed to approve request";H.includes("UNIQUE constraint")||H.includes("already exists")?V.error("An item with this ID already exists in the registry. Delete or rename it first."):V.error(H)}finally{f(null)}}},fe=async()=>{if(w)try{await T.mutateAsync({id:w.id,status:"rejected",reviewerNotes:S.trim()||void 0}),V.success("Request rejected"),y(null),N("")}catch(k){V.error(k instanceof Error?k.message:"Failed to reject request")}},ge=async k=>{try{await R.mutateAsync(k.id),V.success("Request deleted")}catch(W){V.error(W instanceof Error?W.message:"Failed to delete request")}},be=async()=>{if(b.length===0||x)return;p(!0),u(!1);let k=0;const W=new Set;for(const xe of b)try{await T.mutateAsync({id:xe.id,status:"approved",reviewerNotes:void 0});const ye=cs(xe);await E.mutateAsync({id:ye.id,title:ye.title,description:ye.description,_meta:ye._meta,server:ye.server,is_public:m==="public"}),k++}catch{W.add(xe.id)}const H=W.size;k>0&&H===0?V.success(`${k} request${k>1?"s":""} approved as ${m}.`):k>0&&H>0?V.warning(`Approved ${k}. Failed ${H}. Failed items remain selected for retry.`):V.error("Bulk approve failed. Selected items were kept for retry."),l(W),p(!1)};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"shrink-0 border-b border-border",children:t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:"Requests to Publish"}),t.jsx(F,{variant:"secondary",className:"text-xs",children:D})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:Rn.map(k=>t.jsx("button",{type:"button",className:Z("px-2.5 py-1 text-xs rounded-md transition-colors",s===k.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>e(k.value),onClickCapture:()=>te(),children:k.label},k.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${r}:${o}`,onChange:k=>{const[W,H]=k.target.value.split(":");n(W),i(H)},children:[t.jsx("option",{value:"created_at:asc",children:"Created at (oldest first)"}),t.jsx("option",{value:"created_at:desc",children:"Created at (newest first)"}),t.jsx("option",{value:"title:asc",children:"Alphabetical (A-Z)"}),t.jsx("option",{value:"title:desc",children:"Alphabetical (Z-A)"})]})]})]})}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[C.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading requests..."}):C.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load publish requests."}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:C.error instanceof Error?C.error.message:"Unknown error"})]}):v.length===0?t.jsx("div",{className:"p-8 text-center rounded-lg border border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:s==="pending"?"No pending publish requests.":s==="approved"?"No approved publish requests.":"No rejected publish requests."})}):t.jsxs(Mt,{children:[t.jsx(Et,{children:t.jsxs(Fe,{children:[s==="pending"&&t.jsx(ue,{className:"w-10",children:t.jsx(ss,{checked:K&&U.length>0,onCheckedChange:k=>{k?re():te()}})}),t.jsx(ue,{children:"Name"}),t.jsx(ue,{children:"Requester"}),t.jsx(ue,{children:"Tags"}),t.jsx(ue,{children:"Status"}),t.jsx(ue,{children:"Date"}),t.jsx(ue,{className:"text-right",children:"Actions"})]})}),t.jsx(Dt,{children:v.map(k=>{const W=Pt(k),H=k._meta?.["mcp.mesh"]?.tags??[],xe=z.has(k.id),ye=a.has(k.id);return t.jsxs(Fe,{className:Z(xe&&"cursor-pointer",ye&&"bg-accent/20"),onClick:()=>{xe&&se(k.id)},children:[s==="pending"&&t.jsx(me,{children:t.jsx(ss,{checked:ye,onCheckedChange:de=>ee(k.id,de===!0),onClick:de=>de.stopPropagation()})}),t.jsx(me,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-7 rounded-md border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:W?t.jsx("img",{src:W,alt:k.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:k.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:k.description})]})]})}),t.jsx(me,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:k.requester_name||k.requester_email||"-"})}),t.jsx(me,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:H.slice(0,3).map(de=>t.jsx(F,{variant:"secondary",className:"text-[10px]",children:de},`${k.id}-tag-${de}`))})}),t.jsx(me,{children:t.jsx(F,{variant:"secondary",className:"capitalize text-[11px]",children:k.status})}),t.jsx(me,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:os(k.created_at)})}),t.jsx(me,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(G,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:de=>{de.stopPropagation(),I(k)},children:[t.jsx(xs,{size:13}),"View"]}),xe?t.jsxs(t.Fragment,{children:[t.jsxs(G,{size:"sm",className:"h-7 text-xs px-2",onClick:de=>{de.stopPropagation(),_(k)},disabled:c!==null||x||ye,children:[t.jsx(Le,{size:13}),c===k.id?"Approving...":ye?"Selected":"Approve"]}),t.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:de=>{de.stopPropagation(),y(k),N("")},disabled:T.isPending,children:[t.jsx(Ys,{size:13}),"Reject"]})]}):t.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:de=>{de.stopPropagation(),ge(k)},disabled:R.isPending,children:[t.jsx(st,{size:13}),"Delete"]})]})})]},k.id)})})]}),v.length>0&&P?t.jsx("div",{ref:A,className:"h-1 w-full"}):null,O&&v.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:"Loading more requests..."}):null]}),q>0?t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[t.jsxs("div",{className:"text-xs text-muted-foreground pr-1",children:[q," selected"]}),t.jsx(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:re,disabled:K,children:"Select all"}),t.jsx(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:te,children:"Clear selection"}),t.jsxs(G,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>u(!0),disabled:x,children:[t.jsx(Le,{size:13}),"Approve selected"]})]})}):null,t.jsx(jt,{open:!!j,onOpenChange:k=>{k||I(null)},children:t.jsxs(gt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(xt,{children:[t.jsx(ht,{children:j?.title??"Request details"}),t.jsx(pt,{children:"Review all metadata sent by the requester before approving."})]}),j&&t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 space-y-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3 flex items-center gap-3",children:[t.jsx("div",{className:"size-16 rounded-lg border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:Pt(j)?t.jsx("img",{src:Pt(j)||"",alt:j.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-lg font-semibold text-muted-foreground",children:j.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:j.title}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j.server?.name||j.id})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"}),t.jsx("span",{className:"capitalize",children:j.status})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Submitted"}),t.jsx("span",{children:os(j.created_at)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Requester"}),t.jsx("span",{children:j.requester_name||"-"})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Email"}),t.jsx("span",{children:j.requester_email||"-"})]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Remote URL"}),t.jsx("code",{className:"text-xs rounded-md border border-border bg-muted/30 px-2.5 py-2 break-all",children:j.server?.remotes?.[0]?.url??"-"})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Description"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:j.description||"No description provided."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(j._meta?.["mcp.mesh"]?.tags??[]).length?(j._meta?.["mcp.mesh"]?.tags??[]).map(k=>t.jsx(F,{variant:"secondary",children:k},`${j.id}-detail-tag-${k}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(j._meta?.["mcp.mesh"]?.categories??[]).length?(j._meta?.["mcp.mesh"]?.categories??[]).map(k=>t.jsx(F,{variant:"secondary",children:k},`${j.id}-detail-category-${k}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"README"}),ot(j).hasReadmeContent?t.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap max-h-40 overflow-y-auto rounded-md border border-border bg-muted/20 px-2.5 py-2",children:ot(j).readmeContent}):ot(j).hasReadmeLink?t.jsxs("a",{href:ot(j).readmeUrl,target:"_blank",rel:"noreferrer",className:"text-sm inline-flex items-center gap-1.5 text-primary hover:underline",children:["Open README link",t.jsx(gr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:"No README provided."})]})]}),t.jsx(ft,{children:t.jsx(G,{variant:"outline",onClick:()=>I(null),children:"Close"})})]})}),t.jsx(tt,{open:!!g,onOpenChange:k=>{k||_(null)},children:t.jsxs(et,{children:[t.jsxs(He,{children:[t.jsx(Ye,{children:"Approve publish request?"}),t.jsxs(We,{children:["This will add"," ",t.jsx("span",{className:"font-medium text-foreground",children:g?.title})," ","to your private registry. The requester will be notified of the approval."]})]}),t.jsxs(Xe,{children:[t.jsx(Je,{children:"Cancel"}),t.jsx(Ze,{onClick:pe,children:"Approve"})]})]})}),t.jsx(tt,{open:d,onOpenChange:u,children:t.jsxs(et,{children:[t.jsxs(He,{children:[t.jsx(Ye,{children:"Approve selected requests?"}),t.jsxs(We,{children:["This will approve ",b.length," request",b.length>1?"s":""," and create all resulting apps with the same visibility setting."]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"bulk-visibility",children:"Visibility for all selected"}),t.jsxs("select",{id:"bulk-visibility",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:m,onChange:k=>h(k.target.value),children:[t.jsx("option",{value:"private",children:"Private"}),t.jsx("option",{value:"public",children:"Public"})]})]}),t.jsxs(Xe,{children:[t.jsx(Je,{disabled:x,children:"Cancel"}),t.jsx(Ze,{onClick:be,disabled:x||$===0,children:x?"Approving...":"Approve selected"})]})]})}),t.jsx(jt,{open:!!w,onOpenChange:k=>{k||(y(null),N(""))},children:t.jsxs(gt,{children:[t.jsxs(xt,{children:[t.jsx(ht,{children:"Reject publish request?"}),t.jsx(pt,{children:"This request will move to rejected status. You can leave optional notes for context."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"reject-notes",children:"Reviewer notes (optional)"}),t.jsx(vt,{id:"reject-notes",rows:4,value:S,onChange:k=>N(k.target.value),placeholder:"Reason for rejection..."})]}),t.jsxs(ft,{children:[t.jsx(G,{variant:"outline",onClick:()=>{y(null),N("")},children:"Cancel"}),t.jsx(G,{onClick:fe,disabled:T.isPending,children:T.isPending?"Rejecting...":"Reject"})]})]})})]})}function In({revealedKey:s,onRevealedKeyChange:e}){const{org:r}=ie(),{uploadImage:n,isUploading:o}=ys(),{registryName:i,registryIcon:a,acceptPublishRequests:l,requireApiToken:d,storePrivateOnly:u,rateLimitEnabled:m,rateLimitWindow:h,rateLimitMax:x,isSaving:p,updateConfig:c}=js($e),[f,g]=M.useState(i),[_,w]=M.useState(i);i!==_&&(w(i),g(i));const[y,j]=M.useState(a),[I,S]=M.useState(a);a!==I&&(S(a),j(a));const[N,C]=M.useState(String(x)),[T,R]=M.useState(x);x!==T&&(R(x),C(String(x)));const E=Fr(),{generateMutation:v,revokeMutation:D}=Br(),[O,P]=M.useState(""),[A,z]=M.useState(!1),[U,q]=M.useState(null),{handleCopy:b,copied:$}=Tt(),{handleCopy:K,copied:te}=Tt(),{handleCopy:ee,copied:se}=Tt(),re=gs({search:"",tags:[],categories:[],limit:50}),pe=`${window.location.origin}/org/${r.slug}/registry/mcp`,ge=(re.data?.pages.flatMap(L=>L.items??[])??[]).filter(L=>L.is_public).length,be=`${window.location.origin}/org/${r.slug}/registry/publish-request`,k=s?.slice(0,12)??null,W=!!(k&&(E.data?.items??[]).some(L=>L.prefix===k)),H=p||o,xe=()=>{const L=f.trim();!L||L===i||c({registryName:L})},ye=()=>{const L=Number.parseInt(N,10),le=Number.isFinite(L)&&L>=1?L:100;C(String(le)),le!==x&&c({rateLimitMax:le})},de=async L=>{if(!L)return;const le=L.name.split(".").pop()||"png",it=`registry/${r.id}/identity/icon.${le}`,qe=await n(L,it);qe?(j(qe),c({registryIcon:qe})):V.error("Failed to upload icon. Please try again.")},nt=async()=>{const L=O.trim();if(L)try{const le=await v.mutateAsync(L);le?.key&&(e(le.key),z(!1),P(""),V.success("API key generated. Copy it now — it won't be shown again!"))}catch(le){V.error(le instanceof Error?le.message:"Failed to generate API key")}},Me=async L=>{try{await D.mutateAsync(L),e(null),q(null),V.success("API key revoked")}catch(le){V.error(le instanceof Error?le.message:"Failed to revoke API key")}};return t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 items-start xl:grid-cols-2",children:[t.jsx("div",{className:"grid gap-4 min-w-0 content-start",children:t.jsxs(ne,{className:"min-w-0 p-4 grid gap-4 content-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Registry Identity"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure the name and icon shown in the store selector."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"identity-name",children:"Name"}),t.jsx(ae,{id:"identity-name",value:f,onChange:L=>g(L.target.value),onBlur:xe,disabled:H,placeholder:"Private Registry"})]}),t.jsx(vs,{value:y,onChange:j,onBlur:()=>{const L=y.trim();L!==a&&c({registryIcon:L})},onFileUpload:de,isUploading:o})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Public Registry"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Public URL to consume this registry as an MCP."})]}),t.jsxs(F,{variant:"secondary",children:[ge," ",ge===1?"public item":"public items"]})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:pe}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>b(pe),children:$?t.jsx(It,{size:14}):t.jsx(Rt,{size:14})})]})]}),t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Store Visibility"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose what appears when users browse this registry in Store."})]}),t.jsx(Oe,{id:"store-private-only",checked:u,onCheckedChange:L=>c({storePrivateOnly:L}),disabled:H})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Enabled: show only private apps. Disabled: show public and private apps together."})]}),t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Publish Requests"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Allow external users to submit MCP servers for review."})]}),t.jsx(Oe,{id:"accept-publish-requests",checked:l,onCheckedChange:L=>c({acceptPublishRequests:L}),disabled:H})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:be}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>K(be),children:te?t.jsx(It,{size:14}):t.jsx(Rt,{size:14})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(X,{className:"text-sm font-medium",children:"Require API Token"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Requests without a valid token will be rejected."})]}),t.jsx(Oe,{id:"require-api-token",checked:d,onCheckedChange:L=>c({requireApiToken:L}),disabled:H})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(X,{className:"text-sm font-medium",children:"Rate Limit"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Limit publish requests per organization by time window."})]}),t.jsx(Oe,{id:"publish-rate-limit",checked:m,onCheckedChange:L=>c({rateLimitEnabled:L}),disabled:H})]}),m&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:"Max requests"}),t.jsx(ae,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:N,onChange:L=>C(L.target.value),onBlur:ye,disabled:H,placeholder:"100"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{htmlFor:"rate-limit-window",className:"text-sm font-medium",children:"Window"}),t.jsxs("select",{id:"rate-limit-window",className:"h-9 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",value:h,onChange:L=>c({rateLimitWindow:L.target.value}),disabled:H,children:[t.jsx("option",{value:"minute",children:"Per minute"}),t.jsx("option",{value:"hour",children:"Per hour"})]})]})]}),l&&d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[t.jsx(jr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"API Keys"})]}),s&&!W&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"New key (refreshing list...)"}),t.jsx(ae,{readOnly:!0,value:s,className:"h-8 text-xs font-mono bg-background"})]}),t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsxs("div",{className:"grid gap-1.5 flex-1",children:[t.jsx(X,{htmlFor:"api-key-name",className:"text-xs",children:"Key name"}),t.jsx(ae,{id:"api-key-name",value:O,onChange:L=>P(L.target.value),placeholder:"e.g. CI/CD Pipeline",className:"h-8 text-sm"})]}),t.jsxs(G,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!O.trim()||v.isPending,onClick:nt,children:[v.isPending?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(vr,{size:14}),"Generate"]})]}),(E.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:E.data?.items?.map(L=>t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2",children:[t.jsxs("div",{className:"grid gap-1 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate leading-none",children:L.name}),k===L.prefix?t.jsx(ae,{readOnly:!0,value:A?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(ae,{readOnly:!0,value:`${L.prefix}••••••••`,className:"h-8 text-xs font-mono bg-muted/20 text-muted-foreground"})]}),t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[k===L.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>z(le=>!le),children:A?t.jsx(xr,{size:14}):t.jsx(xs,{size:14})}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&ee(s),children:se?t.jsx(It,{size:14}):t.jsx(Rt,{size:14})})]}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:D.isPending,onClick:()=>q({id:L.id,name:L.name}),children:t.jsx(st,{size:14})})]})]},L.id))})]})]})]})]}),t.jsx(tt,{open:!!U,onOpenChange:L=>{!L&&!D.isPending&&q(null)},children:t.jsxs(et,{children:[t.jsxs(He,{children:[t.jsx(Ye,{children:"Revoke API key?"}),t.jsxs(We,{children:["This action cannot be undone. The key",U?` "${U.name}"`:""," will stop working immediately."]})]}),t.jsxs(Xe,{children:[t.jsx(Je,{disabled:D.isPending,children:"Cancel"}),t.jsx(Ze,{disabled:!U||D.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>U&&Me(U.id),children:D.isPending?"Revoking...":"Revoke key"})]})]})})]})}function Pn(s){const e=Y.c(5),{results:r}=s;if(r.length===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ne,{className:"p-4 text-sm text-muted-foreground text-center",children:"No broken MCPs in this run. All healthy! ✓"}),e[0]=i):i=e[0],i}let n;e[1]!==r?(n=r.map(Mn),e[1]=r,e[2]=n):n=e[2];let o;return e[3]!==n?(o=t.jsx("div",{className:"space-y-2",children:n}),e[3]=n,e[4]=o):o=e[4],o}function Mn(s){return t.jsx(En,{result:s},s.id)}function En(s){const e=Y.c(49),{result:r}=s,[n,o]=M.useState(!1);let i;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.connection_ok||e[3]!==r.duration_ms||e[4]!==r.error_message||e[5]!==r.id||e[6]!==r.item_title||e[7]!==r.status||e[8]!==r.tool_results||e[9]!==r.tools_listed){const a=r.tool_results.filter($n);let l;e[11]!==n?(l=()=>o(!n),e[11]=n,e[12]=l):l=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-red-500 text-sm mt-0.5",children:"✗"}),e[13]=d):d=e[13];let u;e[14]!==r.item_title?(u=t.jsx("h4",{className:"text-sm font-medium truncate",children:r.item_title}),e[14]=r.item_title,e[15]=u):u=e[15];let m;e[16]!==r.status?(m=r.status.replace("_"," "),e[16]=r.status,e[17]=m):m=e[17];let h;e[18]!==m?(h=t.jsx(F,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[18]=m,e[19]=h):h=e[19];let x;e[20]!==u||e[21]!==h?(x=t.jsxs("div",{className:"flex items-center gap-2",children:[u,h]}),e[20]=u,e[21]=h,e[22]=x):x=e[22];const p=r.connection_ok?"✓":"✗";let c;e[23]!==p?(c=t.jsxs("span",{children:["conn: ",p]}),e[23]=p,e[24]=c):c=e[24];const f=r.tools_listed?"✓":"✗";let g;e[25]!==f?(g=t.jsxs("span",{children:["tools listed: ",f]}),e[25]=f,e[26]=g):g=e[26];let _;e[27]!==r.duration_ms?(_=t.jsxs("span",{children:[r.duration_ms,"ms"]}),e[27]=r.duration_ms,e[28]=_):_=e[28];const w=a.length>0&&t.jsxs("span",{className:"text-red-600",children:[a.length," tool",a.length>1?"s":""," ","failed"]});let y;e[29]!==r.action_taken?(y=r.action_taken!=="none"&&t.jsx(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:r.action_taken.replace(/_/g," ")}),e[29]=r.action_taken,e[30]=y):y=e[30];let j;e[31]!==g||e[32]!==_||e[33]!==w||e[34]!==y||e[35]!==c?(j=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[c,g,_,w,y]}),e[31]=g,e[32]=_,e[33]=w,e[34]=y,e[35]=c,e[36]=j):j=e[36];let I;e[37]!==r.error_message?(I=r.error_message&&t.jsx("p",{className:"text-xs text-red-600 line-clamp-2",children:r.error_message}),e[37]=r.error_message,e[38]=I):I=e[38];let S;e[39]!==j||e[40]!==I||e[41]!==x?(S=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[x,j,I]}),e[39]=j,e[40]=I,e[41]=x,e[42]=S):S=e[42];const N=n?"▲":"▼";let C;e[43]!==N?(C=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:N}),e[43]=N,e[44]=C):C=e[44];let T;e[45]!==S||e[46]!==C||e[47]!==l?(T=t.jsxs("button",{type:"button",className:"w-full text-left p-3 flex items-start gap-3 hover:bg-muted/30 transition-colors",onClick:l,children:[d,S,C]}),e[45]=S,e[46]=C,e[47]=l,e[48]=T):T=e[48],i=t.jsxs(ne,{className:"overflow-hidden",children:[T,n&&t.jsxs("div",{className:"border-t border-border p-3 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Full Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2.5 py-1.5 whitespace-pre-wrap break-all text-red-700",children:r.error_message})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Connection"}),t.jsx("p",{className:Z("text-xs font-medium",r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"OK":"Failed"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tools Listed"}),t.jsx("p",{className:Z("text-xs font-medium",r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?"Yes":"No"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Duration"}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]})]}),a.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-red-600",children:["Failed Tools (",a.length,")"]}),a.map(R=>t.jsxs("div",{className:"rounded border border-red-500/10 bg-red-500/5 px-2.5 py-1.5 space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs font-mono font-medium text-red-700",children:R.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-red-600",children:R.error})]},`${r.id}-${R.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(An)&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Passing Tools"}),t.jsx("div",{className:"flex flex-wrap gap-1",children:r.tool_results.filter(Dn).map(R=>t.jsxs(F,{variant:"secondary",className:"text-[10px]",children:["✓ ",R.toolName]},`${r.id}-${R.toolName}-pass`))})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.connection_ok,e[3]=r.duration_ms,e[4]=r.error_message,e[5]=r.id,e[6]=r.item_title,e[7]=r.status,e[8]=r.tool_results,e[9]=r.tools_listed,e[10]=i}else i=e[10];return i}function Dn(s){return s.success}function An(s){return s.success}function $n(s){return!s.success}const On=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];function Un(s){const r=s.trim().split(/\s+/);if(r.length!==5)return{frequency:"custom",minute:0,hour:9,weekDay:1,dayOfMonth:1};const[n,o,i,a,l]=r,d=Number(n),u=Number(o),m=Number(i),h=Number(l);return Number.isInteger(d)&&Number.isInteger(u)&&d>=0&&d<=59&&u>=0&&u<=23?i==="*"&&l==="*"?{frequency:"daily",minute:d,hour:u,weekDay:1,dayOfMonth:1}:i==="*/14"&&l==="*"?{frequency:"biweekly",minute:d,hour:u,weekDay:1,dayOfMonth:1}:i==="*"&&Number.isInteger(h)&&h>=0&&h<=6?{frequency:"weekly",minute:d,hour:u,weekDay:h,dayOfMonth:1}:l==="*"&&Number.isInteger(m)&&m>=1&&m<=31?{frequency:"monthly",minute:d,hour:u,weekDay:1,dayOfMonth:m}:{frequency:"custom",minute:d,hour:u,weekDay:1,dayOfMonth:1}:{frequency:"custom",minute:0,hour:9,weekDay:1,dayOfMonth:1}}function qn(s,e){return`${String(s).padStart(2,"0")}:${String(e).padStart(2,"0")}`}function ct(s){return s.frequency==="daily"?`${s.minute} ${s.hour} * * *`:s.frequency==="weekly"?`${s.minute} ${s.hour} * * ${s.weekDay}`:s.frequency==="biweekly"?`${s.minute} ${s.hour} */14 * *`:s.frequency==="monthly"?`${s.minute} ${s.hour} ${s.dayOfMonth} * *`:s.currentValue}function zn(s){const e=Y.c(60),{value:r,onChange:n,disabled:o}=s,i=o===void 0?!1:o;let a;e[0]!==r?(a=Un(r),e[0]=r,e[1]=a):a=e[1];const l=a,d=l.frequency==="custom";let u;e[2]!==n||e[3]!==l.dayOfMonth||e[4]!==l.hour||e[5]!==l.minute||e[6]!==l.weekDay||e[7]!==r?(u=A=>{if(A==="custom"){n(r);return}n(ct({frequency:A,hour:l.hour,minute:l.minute,weekDay:l.weekDay,dayOfMonth:l.dayOfMonth,currentValue:r}))},e[2]=n,e[3]=l.dayOfMonth,e[4]=l.hour,e[5]=l.minute,e[6]=l.weekDay,e[7]=r,e[8]=u):u=e[8];const m=u;let h;e[9]!==n||e[10]!==l.dayOfMonth||e[11]!==l.frequency||e[12]!==l.weekDay||e[13]!==r?(h=A=>{const[z,U]=A.split(":"),q=Number(z),b=Number(U);!Number.isInteger(q)||!Number.isInteger(b)||n(ct({frequency:l.frequency,hour:q,minute:b,weekDay:l.weekDay,dayOfMonth:l.dayOfMonth,currentValue:r}))},e[9]=n,e[10]=l.dayOfMonth,e[11]=l.frequency,e[12]=l.weekDay,e[13]=r,e[14]=h):h=e[14];const x=h;let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(X,{children:"Frequency"}),e[15]=p):p=e[15];let c;e[16]!==m?(c=A=>m(A.target.value),e[16]=m,e[17]=c):c=e[17];let f,g,_,w,y;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("option",{value:"daily",children:"Daily"}),w=t.jsx("option",{value:"weekly",children:"Weekly"}),y=t.jsx("option",{value:"biweekly",children:"Every 2 weeks"}),f=t.jsx("option",{value:"monthly",children:"Monthly"}),g=t.jsx("option",{value:"custom",children:"Custom (raw cron)"}),e[18]=f,e[19]=g,e[20]=_,e[21]=w,e[22]=y):(f=e[18],g=e[19],_=e[20],w=e[21],y=e[22]);let j;e[23]!==i||e[24]!==l.frequency||e[25]!==c?(j=t.jsxs("label",{className:"space-y-1",children:[p,t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:l.frequency,onChange:c,disabled:i,children:[_,w,y,f,g]})]}),e[23]=i,e[24]=l.frequency,e[25]=c,e[26]=j):j=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(X,{children:"Time"}),e[27]=I):I=e[27];let S;e[28]!==l.hour||e[29]!==l.minute?(S=qn(l.hour,l.minute),e[28]=l.hour,e[29]=l.minute,e[30]=S):S=e[30];let N;e[31]!==x?(N=A=>x(A.target.value),e[31]=x,e[32]=N):N=e[32];const C=i||d;let T;e[33]!==S||e[34]!==N||e[35]!==C?(T=t.jsxs("label",{className:"space-y-1",children:[I,t.jsx(ae,{type:"time",value:S,onChange:N,disabled:C})]}),e[33]=S,e[34]=N,e[35]=C,e[36]=T):T=e[36];let R;e[37]!==i||e[38]!==n||e[39]!==l.dayOfMonth||e[40]!==l.frequency||e[41]!==l.hour||e[42]!==l.minute||e[43]!==l.weekDay||e[44]!==r?(R=l.frequency==="weekly"?t.jsxs("label",{className:"space-y-1",children:[t.jsx(X,{children:"Day of week"}),t.jsx("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:l.weekDay,onChange:A=>n(ct({frequency:"weekly",hour:l.hour,minute:l.minute,weekDay:Number(A.target.value),dayOfMonth:l.dayOfMonth,currentValue:r})),disabled:i,children:On.map(Ln)})]}):l.frequency==="monthly"?t.jsxs("label",{className:"space-y-1",children:[t.jsx(X,{children:"Day of month"}),t.jsx(ae,{type:"number",min:1,max:31,value:l.dayOfMonth,onChange:A=>{const z=Number(A.target.value);!Number.isInteger(z)||z<1||z>31||n(ct({frequency:"monthly",hour:l.hour,minute:l.minute,weekDay:l.weekDay,dayOfMonth:z,currentValue:r}))},disabled:i})]}):t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{children:"Schedule notes"}),t.jsx("div",{className:"h-9 rounded-md border border-input bg-muted/20 px-3 text-xs text-muted-foreground flex items-center",children:l.frequency==="biweekly"?"Biweekly uses an every-14-days cron approximation.":l.frequency==="custom"?"Edit raw cron directly below.":"Runs in your server timezone."})]}),e[37]=i,e[38]=n,e[39]=l.dayOfMonth,e[40]=l.frequency,e[41]=l.hour,e[42]=l.minute,e[43]=l.weekDay,e[44]=r,e[45]=R):R=e[45];let E;e[46]!==j||e[47]!==T||e[48]!==R?(E=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[j,T,R]}),e[46]=j,e[47]=T,e[48]=R,e[49]=E):E=e[49];let v;e[50]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(X,{children:"Raw cron expression"}),e[50]=v):v=e[50];let D;e[51]!==n?(D=A=>n(A.target.value),e[51]=n,e[52]=D):D=e[52];let O;e[53]!==i||e[54]!==D||e[55]!==r?(O=t.jsxs("label",{className:"space-y-1 block",children:[v,t.jsx(ae,{value:r,onChange:D,disabled:i,placeholder:"*/15 * * * *"})]}),e[53]=i,e[54]=D,e[55]=r,e[56]=O):O=e[56];let P;return e[57]!==E||e[58]!==O?(P=t.jsxs("div",{className:"space-y-2",children:[E,O]}),e[57]=E,e[58]=O,e[59]=P):P=e[59],P}function Ln(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function Fn(s,e){return s.onFailure!==e.onFailure||s.perMcpTimeoutMs!==e.perMcpTimeoutMs||s.perToolTimeoutMs!==e.perToolTimeoutMs||s.maxAgentSteps!==e.maxAgentSteps||s.testPublicOnly!==e.testPublicOnly||s.testPrivateOnly!==e.testPrivateOnly||s.includePendingRequests!==e.includePendingRequests||(s.agentContext??"")!==(e.agentContext??"")||s.schedule!==e.schedule||s.cronExpression!==e.cronExpression}function Bn(){const{settings:s,saveMutation:e}=ps(),r=Ir(),n=Pr(),o=M.useRef(s),[i,a]=M.useState(s),[l,d]=M.useState(!1),[u,m]=M.useState(!1);o.current!==s&&(o.current=s,a(s));const h=Fn(i,s),x=c=>{d(!1),a(f=>({...f,...c}))},p=async()=>{const c=i.cronExpression?.trim()??"";let f=s.scheduleEventId??"";if(i.schedule==="cron"&&c.length>0){const _=c!==(s.cronExpression??"");_&&f&&await n.mutateAsync(f),(_||!f)&&(f=(await r.mutateAsync({cronExpression:c,config:i})).scheduleEventId)}else f&&(await n.mutateAsync(f),f="");const g={...i,cronExpression:c,scheduleEventId:f,agentContext:(i.agentContext??"").trim()};await e.mutateAsync(g),a(g),d(!0),setTimeout(()=>d(!1),3e3)};return t.jsxs(ne,{className:"p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA Configuration"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure how the MCP QA agent validates registry entries."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[h&&t.jsx(F,{className:"bg-amber-500/10 text-amber-600 border-amber-500/20 text-[10px]",children:"Unsaved changes"}),l&&t.jsx(F,{className:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20 text-[10px]",children:"✓ Saved"}),t.jsx(G,{size:"sm",onClick:p,disabled:e.isPending||r.isPending||n.isPending||!h,children:e.isPending||r.isPending||n.isPending?"Saving...":"Save settings"})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"On failure",hint:"Automatic action to apply when an MCP fails tests in a run."}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:i.onFailure,onChange:c=>x({onFailure:c.target.value}),children:[t.jsx("option",{value:"none",children:"Do nothing"}),t.jsx("option",{value:"unlisted",children:"Unlist from store (keep in registry)"}),t.jsx("option",{value:"remove_public",children:"Remove from public store"}),t.jsx("option",{value:"remove_private",children:"Remove from private registry"}),t.jsx("option",{value:"remove_all",children:"Remove from all (public + private)"})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Test scope",hint:"Choose whether tests should run for public items, private items, or both."}),t.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:[t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.testPublicOnly,onChange:c=>x({testPublicOnly:c.target.checked,testPrivateOnly:c.target.checked?!1:i.testPrivateOnly})}),"Public only"]}),t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.testPrivateOnly,onChange:c=>x({testPrivateOnly:c.target.checked,testPublicOnly:c.target.checked?!1:i.testPublicOnly})}),"Private only"]})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Publish requests",hint:"Include pending publish requests in QA runs to validate them before publishing to the store."}),t.jsx("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.includePendingRequests,onChange:c=>x({includePendingRequests:c.target.checked})}),"Include pending requests in tests"]})})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(Ee,{label:"Additional test context (prompt)",hint:"Extra runtime context passed to the agent, such as valid emails, tenant IDs, or known test entities."}),t.jsxs(G,{size:"sm",variant:"outline",className:"h-7",onClick:()=>m(c=>!c),children:[u?"Hide":"View"," default system prompt"]})]}),t.jsx(vt,{value:i.agentContext??"",onChange:c=>x({agentContext:c.target.value}),placeholder:'Example: Use "my-user@company.com" as a valid email for Google Drive share/create_permission tests.',rows:3}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use this field for real data required by some tools (valid email, fixed IDs, test environment details, etc)."}),u&&t.jsx("pre",{className:"text-[11px] bg-muted/50 border border-border rounded px-3 py-2 whitespace-pre-wrap max-h-64 overflow-auto",children:_r})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsx(Ee,{label:"Schedule",hint:"Set automatic test runs. Manual mode runs only when you click Start QA run."}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:i.schedule??"manual",onChange:c=>x({schedule:c.target.value}),children:[t.jsx("option",{value:"manual",children:"Manual only"}),t.jsx("option",{value:"cron",children:"Cron schedule"})]}),(i.schedule??"manual")==="cron"&&t.jsx(zn,{value:i.cronExpression??"",onChange:c=>x({cronExpression:c})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Per MCP timeout (ms)",hint:"Max total time allowed to validate one MCP."}),t.jsx(ae,{type:"number",value:i.perMcpTimeoutMs,onChange:c=>x({perMcpTimeoutMs:Number(c.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Per tool timeout (ms)",hint:"Max time allowed for each individual tool call."}),t.jsx(ae,{type:"number",value:i.perToolTimeoutMs,onChange:c=>x({perToolTimeoutMs:Number(c.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Max agent steps",hint:"Maximum number of reasoning/tool steps in Agentic mode."}),t.jsx(ae,{type:"number",value:i.maxAgentSteps,onChange:c=>x({maxAgentSteps:Number(c.target.value)}),min:1,max:30})]})]})]})}function Ee(s){const e=Y.c(13),{label:r,hint:n}=s;let o;e[0]!==r?(o=t.jsx(X,{children:r}),e[0]=r,e[1]=o):o=e[1];const i=`About ${r}`;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Hs,{size:14}),e[2]=a):a=e[2];let l;e[3]!==i?(l=t.jsx(br,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":i,children:a})}),e[3]=i,e[4]=l):l=e[4];let d;e[5]!==n?(d=t.jsx(yr,{side:"top",className:"max-w-72",children:n}),e[5]=n,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==d?(u=t.jsxs(Nr,{children:[l,d]}),e[7]=l,e[8]=d,e[9]=u):u=e[9];let m;return e[10]!==o||e[11]!==u?(m=t.jsxs("div",{className:"flex items-center gap-1.5",children:[o,u]}),e[10]=o,e[11]=u,e[12]=m):m=e[12],m}function Qn(s){switch(s){case"authenticated":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"needs_auth":return"bg-amber-500/10 text-amber-600 border-amber-500/20";default:return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20"}}function Vn(s){switch(s){case"authenticated":return"Authenticated";case"needs_auth":return"Needs Auth";default:return"Not checked"}}function Gn({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:n}){const[o,i]=M.useState(!1),[a,l]=M.useState(""),[d,u]=M.useState(!1),m=Tr(),{updateMutation:h}=Ut(),{org:x}=ie(),p=ke(),c=s.mapping.connection_id,f=s.mapping.auth_status,g=s.item?.title??s.mapping.item_id,_=s.item?.server?.icons?.[0]?.src??null,w=s.item?.is_public??!1,y=s.item?.is_unlisted??!1,j=s.source==="request",I=Ie({queryKey:Q.monitorConnectionAuthProbe(c),queryFn:async()=>Fs({url:`/api/${x.slug}/mcp/${c}`,token:null,orgId:x.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),S=I.data,N=I.isLoading,C=S?.supportsOAuth??!1,T=S?.hasOAuthToken??!1,R=S?.isServerError??!1,E=S?.isAuthenticated??!1,v=N?"checking":R?"server_error":C?E?T?"oauth_connected":"connected":"oauth_available":E?"connected":"token_required",D=()=>{m.mutate({connectionId:c,authStatus:"authenticated"},{onSuccess:()=>e()})},O=async()=>{i(!0);try{const b=(await I.refetch()).data;if(!b){V.error(`Could not reach "${g}". The remote MCP may be down.`);return}if(b.isAuthenticated){V.success(`"${g}" is reachable. You can re-authenticate if needed.`);return}if(b.isServerError){V.error(`Server error for "${g}". The remote MCP may be down.`);return}if(!b.supportsOAuth){V.warning(`"${g}" does not support OAuth. Use the Token field to paste an API key.`);return}V.info(`Opening authentication window for "${g}"...`);const $=await Bs({connectionId:c,orgSlug:x.slug,clientName:`MCP Test - ${g}`,timeout:18e4,scope:"offline_access"});if($.error){V.error(`OAuth failed for "${g}": ${$.error}`);return}$.tokenInfo?(await fetch(`/api/${x.slug}/connections/${c}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.tokenInfo.accessToken,refreshToken:$.tokenInfo.refreshToken,expiresIn:$.tokenInfo.expiresIn,scope:$.tokenInfo.scope,clientId:$.tokenInfo.clientId,clientSecret:$.tokenInfo.clientSecret,tokenEndpoint:$.tokenInfo.tokenEndpoint})})).ok||$.token&&await P($.token):$.token&&await P($.token),V.success(`"${g}" authenticated!`),D(),await I.refetch()}catch(q){console.error("[MonitorConnectionsPanel] Auth error:",q),V.error(`Error: ${q instanceof Error?q.message:String(q)}`)}finally{i(!1)}},P=async q=>{if(!(await fetch(`/api/${x.slug}/mcp/self`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:c,data:{connection_token:q}}}})})).ok)throw new Error("Failed to save token")},A=async()=>{if(!a.trim()){V.error("Token cannot be empty.");return}i(!0);try{await P(a),V.success(`Token saved for "${g}"!`),u(!1),l(""),D(),Qs(c),p.invalidateQueries({predicate:q=>q.queryKey[1]===Vs&&q.queryKey[3]===c}),await I.refetch()}catch(q){V.error(`Error saving token: ${q instanceof Error?q.message:String(q)}`)}finally{i(!1)}},z=f==="authenticated"&&!T&&!d&&a.length===0,U=async q=>{if(j){V.info("Visibility controls are available only for store items.");return}if(!s.item){V.error("Registry item not found for this connection.");return}try{await h.mutateAsync({id:s.item.id,data:q}),V.success("Visibility updated"),e()}catch(b){V.error(b instanceof Error?b.message:"Failed to update visibility")}};return t.jsxs(ne,{className:"p-3 space-y-3 h-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:_?t.jsx("img",{src:_,alt:g,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:g.charAt(0).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:g}),t.jsx("p",{className:"text-xs text-muted-foreground break-all",children:s.remoteUrl??"-"}),t.jsxs("div",{className:"mt-1 flex items-center gap-1.5 flex-wrap",children:[t.jsx(F,{variant:"outline",className:Z("text-[10px]",Qn(f)),children:Vn(f)}),t.jsx(F,{variant:w?"default":"secondary",className:"text-[10px]",children:w?"Public":"Not public"}),t.jsx(F,{variant:"outline",className:"text-[10px]",children:j?"Request":"Store"}),t.jsxs(F,{variant:"outline",className:Z("text-[10px]",v==="server_error"?"border-destructive/40 text-destructive":v==="oauth_connected"?"border-emerald-500/30 text-emerald-600":v==="oauth_available"?"border-sky-500/30 text-sky-600":v==="token_required"?"border-amber-500/30 text-amber-600":"text-muted-foreground"),children:[v==="checking"&&"Checking auth...",v==="server_error"&&"Server error",v==="oauth_connected"&&"OAuth connected",v==="oauth_available"&&"OAuth available",v==="token_required"&&"Token/manual auth",v==="connected"&&"Connected"]}),y&&t.jsx(F,{variant:"outline",className:"text-[10px]",children:"Hidden in private"}),(n>0||r>0)&&t.jsxs(F,{variant:"destructive",className:"text-[10px]",children:[n," failed MCP / ",r," failed tools"]})]})]})]}),t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:t.jsxs(ut,{children:[t.jsx(dt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx(At,{size:16})})}),t.jsx(mt,{align:"end",children:j?t.jsx(Ce,{disabled:!0,children:"Request item (no store visibility controls)"}):t.jsxs(t.Fragment,{children:[t.jsx(Ce,{onClick:()=>U({is_public:!1}),children:"Hide from public store"}),t.jsx(Ce,{onClick:()=>U({is_unlisted:!0}),children:"Hide from private store"}),t.jsx(Ce,{onClick:()=>U({is_public:!0,is_unlisted:!1}),children:"Show in both stores"})]})})]})})]}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 flex-wrap",children:[C&&t.jsx(G,{size:"sm",onClick:O,disabled:o,children:o?"...":T?"Re-auth OAuth":"OAuth"}),t.jsx(G,{size:"sm",variant:"outline",onClick:()=>I.refetch(),disabled:o||N,children:N?"Checking...":"Re-check"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Token/API key (for MCPs that require manual auth)"}),z?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/50 text-muted-foreground font-mono text-xs",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u(!0),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted",title:"Replace token",children:"Edit"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ae,{type:"password",placeholder:"Paste API token / key...",value:a,onChange:q=>l(q.target.value),className:"h-8 text-xs flex-1",onKeyDown:q=>{q.key==="Enter"&&A()}}),t.jsx(G,{size:"sm",className:"h-8 text-xs",onClick:A,disabled:o||!a.trim(),children:"Save"}),t.jsx(G,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),l("")},children:"✕"})]})]})]})}function Kn(){const s=Y.c(55),e=hs(),n=yt("completed").data?.items?.[0],o=rt(n?.id,void 0,n?.status),i=Rr(),[a,l]=M.useState("all");let d,u,m,h,x,p;if(s[0]!==e||s[1]!==o.data?.items||s[2]!==a||s[3]!==i){const g=e.data?.items??[];let _;s[10]!==o.data?.items?(_=(o.data?.items??[]).reduce(Wn,{}),s[10]=o.data?.items,s[11]=_):_=s[11];const w=_;let y;s[12]!==a?(y=se=>a==="all"?!0:se.source===a,s[12]=a,s[13]=y):y=s[13];const j=g.filter(y);d=ne,x="p-4 space-y-3";let I,S,N,C;s[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("h3",{className:"text-sm font-semibold",children:"QA Connections"}),N=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"We auto-detect auth type. Use OAuth when available, or always paste a Token/API key for manual auth MCPs."}),C=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Listing tools alone does not imply authenticated status."}),I=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Cards show MCP icon, auth status, and latest failed test counters."}),s[14]=I,s[15]=S,s[16]=N,s[17]=C):(I=s[14],S=s[15],N=s[16],C=s[17]);const T=a==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let R;s[18]!==T?(R=Z("px-2.5 py-1 text-xs rounded-md transition-colors",T),s[18]=T,s[19]=R):R=s[19];let E;s[20]===Symbol.for("react.memo_cache_sentinel")?(E=()=>l("all"),s[20]=E):E=s[20];let v;s[21]!==R?(v=t.jsx("button",{type:"button",className:R,onClick:E,children:"All"}),s[21]=R,s[22]=v):v=s[22];const D=a==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let O;s[23]!==D?(O=Z("px-2.5 py-1 text-xs rounded-md transition-colors",D),s[23]=D,s[24]=O):O=s[24];let P;s[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>l("store"),s[25]=P):P=s[25];let A;s[26]!==O?(A=t.jsx("button",{type:"button",className:O,onClick:P,children:"Store"}),s[26]=O,s[27]=A):A=s[27];const z=a==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let U;s[28]!==z?(U=Z("px-2.5 py-1 text-xs rounded-md transition-colors",z),s[28]=z,s[29]=U):U=s[29];let q;s[30]===Symbol.for("react.memo_cache_sentinel")?(q=()=>l("request"),s[30]=q):q=s[30];let b;s[31]!==U?(b=t.jsx("button",{type:"button",className:U,onClick:q,children:"Requests"}),s[31]=U,s[32]=b):b=s[32];let $;s[33]!==v||s[34]!==A||s[35]!==b?($=t.jsxs("div",{children:[S,N,C,I,t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[v,A,b]})]}),s[33]=v,s[34]=A,s[35]=b,s[36]=$):$=s[36];let K;s[37]!==i?(K=()=>{i.mutate(void 0,{onSuccess:Hn,onError:Yn})},s[37]=i,s[38]=K):K=s[38];const te=i.isPending?"Syncing...":"Sync";let ee;s[39]!==i.isPending||s[40]!==K||s[41]!==te?(ee=t.jsx(G,{size:"sm",variant:"outline",onClick:K,disabled:i.isPending,children:te}),s[39]=i.isPending,s[40]=K,s[41]=te,s[42]=ee):ee=s[42],s[43]!==$||s[44]!==ee?(p=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[$,ee]}),s[43]=$,s[44]=ee,s[45]=p):p=s[45],u="space-y-2",m=j.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:'No QA connections for this filter. Click "Sync" to create mappings from store items and pending requests.'}),h=j.length>0&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:j.map(se=>{const re=w[se.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Gn,{entry:se,onAuthChanged:()=>e.refetch(),failedToolsCount:re.failedTools,failedResultCount:re.failedResults},se.mapping.id)})}),s[0]=e,s[1]=o.data?.items,s[2]=a,s[3]=i,s[4]=d,s[5]=u,s[6]=m,s[7]=h,s[8]=x,s[9]=p}else d=s[4],u=s[5],m=s[6],h=s[7],x=s[8],p=s[9];let c;s[46]!==u||s[47]!==m||s[48]!==h?(c=t.jsxs("div",{className:u,children:[m,h]}),s[46]=u,s[47]=m,s[48]=h,s[49]=c):c=s[49];let f;return s[50]!==d||s[51]!==x||s[52]!==p||s[53]!==c?(f=t.jsxs(d,{className:x,children:[p,c]}),s[50]=d,s[51]=x,s[52]=p,s[53]=c,s[54]=f):f=s[54],f}function Yn(s){return V.error(`Sync failed: ${s.message}`)}function Hn(){return V.success("Connections synced (store + pending requests)")}function Wn(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},n=e.tool_results.filter(Jn).length;return r.failedTools=r.failedTools+n,(e.status==="failed"||e.status==="error")&&(r.failedResults=r.failedResults+1),s[e.item_id]=r,s}function Jn(s){return!s.success}function Ns(s){switch(s){case"running":return"bg-blue-500/10 text-blue-600 border-blue-500/20";case"completed":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"failed":return"bg-red-500/10 text-red-600 border-red-500/20";case"cancelled":return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20";case"pending":return"bg-amber-500/10 text-amber-600 border-amber-500/20";default:return""}}function ws(s,e){if(!s)return null;const r=e?new Date(e).getTime():Date.now(),n=new Date(s).getTime(),o=r-n;return o<1e3?`${o}ms`:o<6e4?`${(o/1e3).toFixed(1)}s`:`${Math.floor(o/6e4)}m ${Math.round(o%6e4/1e3)}s`}function _s(s){const e=new Map;for(const r of s)e.has(r.toolName)&&e.delete(r.toolName),e.set(r.toolName,r);return Array.from(e.values())}function Zn(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Xn(s){if(!s)return null;const e=s.match(/Not executed tools \((\d+)\/(\d+)\):/i);if(!e)return null;const r=Number(e[2]);return Number.isFinite(r)&&r>=0?r:null}function ei(s){const e=Y.c(57),{result:r,index:n,icon:o}=s,[i,a]=M.useState(!1);let l;if(e[0]!==i||e[1]!==o||e[2]!==n||e[3]!==r.action_taken||e[4]!==r.agent_summary||e[5]!==r.connection_ok||e[6]!==r.duration_ms||e[7]!==r.error_message||e[8]!==r.id||e[9]!==r.item_title||e[10]!==r.status||e[11]!==r.tool_results||e[12]!==r.tools_listed){const d=_s(r.tool_results),u=d.every(ni),m=d.filter(ri),h=m.filter(si).length,x=m.filter(ti).length,p=m.length>0,c=m.length;let f;e[14]!==r.agent_summary?(f=Xn(r.agent_summary),e[14]=r.agent_summary,e[15]=f):f=e[15];const g=f,_=Math.max(d.length,g??0),w=_>0?`${c}/${_} tools tested`:"0 tools";let y;e[16]!==i?(y=()=>a(!i),e[16]=i,e[17]=y):y=e[17];const j=n+1;let I;e[18]!==j?(I=t.jsx("span",{className:"text-muted-foreground w-5 text-right shrink-0",children:j}),e[18]=j,e[19]=I):I=e[19];let S;e[20]!==o||e[21]!==r.item_title?(S=t.jsx("div",{className:"size-5 rounded border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:o?t.jsx("img",{src:o,alt:r.item_title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[9px] font-semibold text-muted-foreground",children:r.item_title.charAt(0).toUpperCase()})}),e[20]=o,e[21]=r.item_title,e[22]=S):S=e[22];const N=r.status==="passed"?"text-emerald-600":r.status==="needs_auth"?"text-amber-600":"text-red-600";let C;e[23]!==N?(C=Z("shrink-0",N),e[23]=N,e[24]=C):C=e[24];const T=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let R;e[25]!==C||e[26]!==T?(R=t.jsx("span",{className:C,children:T}),e[25]=C,e[26]=T,e[27]=R):R=e[27];let E;e[28]!==r.item_title?(E=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[28]=r.item_title,e[29]=E):E=e[29];let v;e[30]!==r.duration_ms?(v=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[30]=r.duration_ms,e[31]=v):v=e[31];const D=r.status==="passed"?"text-emerald-600 border-emerald-500/20":r.status==="needs_auth"?"text-amber-600 border-amber-500/20":"text-red-600 border-red-500/20";let O;e[32]!==D?(O=Z("text-[9px] capitalize shrink-0",D),e[32]=D,e[33]=O):O=e[33];let P;e[34]!==r.status?(P=r.status.replace("_"," "),e[34]=r.status,e[35]=P):P=e[35];let A;e[36]!==O||e[37]!==P?(A=t.jsx(F,{variant:"outline",className:O,children:P}),e[36]=O,e[37]=P,e[38]=A):A=e[38];let z;e[39]!==r.connection_ok?(z=r.connection_ok?t.jsx("span",{className:"text-[10px] text-emerald-600 shrink-0",children:"conn✓"}):t.jsx("span",{className:"text-[10px] text-red-600 shrink-0",children:"conn✗"}),e[39]=r.connection_ok,e[40]=z):z=e[40];const U=r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:p?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-emerald-600",children:[h,"✓"]})," ",t.jsxs("span",{className:Z(x>0?"text-red-600":""),children:[x,"✗"]})]}):u&&d.length>0?t.jsxs("span",{children:[d.length," tools found"]}):"no tools"});let q;e[41]!==w?(q=t.jsx(F,{variant:"outline",className:"text-[9px] shrink-0",children:w}),e[41]=w,e[42]=q):q=e[42];const b=i?"▲":"▼";let $;e[43]!==b?($=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:b}),e[43]=b,e[44]=$):$=e[44];let K;e[45]!==R||e[46]!==E||e[47]!==v||e[48]!==A||e[49]!==z||e[50]!==U||e[51]!==q||e[52]!==$||e[53]!==y||e[54]!==I||e[55]!==S?(K=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors",onClick:y,children:[I,S,R,E,v,A,z,U,q,$]}),e[45]=R,e[46]=E,e[47]=v,e[48]=A,e[49]=z,e[50]=U,e[51]=q,e[52]=$,e[53]=y,e[54]=I,e[55]=S,e[56]=K):K=e[56],l=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[K,i&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-red-700 max-h-20 overflow-auto",children:r.error_message})]}),t.jsxs("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:[t.jsxs("span",{children:["Connection:"," ",t.jsx("span",{className:Z(r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"OK":"Failed"})]}),t.jsxs("span",{children:["Tools listed:"," ",t.jsx("span",{className:Z(r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?"Yes":"No"})]}),r.action_taken!=="none"&&t.jsxs(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),p?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools tested: ",h," passed, ",x," failed"]}),t.jsx("div",{className:"space-y-0.5",children:m.map((te,ee)=>t.jsx(ii,{tool:te},`${r.id}-${te.toolName}-${ee}`))})]}):u&&d.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools discovered (",d.length,") - not individually tested (health-check mode)"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:d.map((te,ee)=>t.jsx(F,{variant:"outline",className:"text-[10px] font-mono",children:te.toolName},`${r.id}-${te.toolName}-${ee}`))})]}):r.tools_listed?t.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"No tools found on this server."}):null,r.agent_summary&&t.jsx("p",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5",children:r.agent_summary})]})]}),e[0]=i,e[1]=o,e[2]=n,e[3]=r.action_taken,e[4]=r.agent_summary,e[5]=r.connection_ok,e[6]=r.duration_ms,e[7]=r.error_message,e[8]=r.id,e[9]=r.item_title,e[10]=r.status,e[11]=r.tool_results,e[12]=r.tools_listed,e[13]=l}else l=e[13];return l}function ti(s){return!s.success}function si(s){return s.success}function ri(s){return s.outputPreview!=="health_check: not called"}function ni(s){return s.outputPreview==="health_check: not called"}function ii(s){const e=Y.c(30),{tool:r}=s,[n,o]=M.useState(!1);let i;e[0]!==n?(i=()=>o(!n),e[0]=n,e[1]=i):i=e[1];const a=r.success?"text-emerald-600":"text-red-600";let l;e[2]!==a?(l=Z("font-bold",a),e[2]=a,e[3]=l):l=e[3];const d=r.success?"✓":"✗";let u;e[4]!==l||e[5]!==d?(u=t.jsx("span",{className:l,children:d}),e[4]=l,e[5]=d,e[6]=u):u=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];let x;e[11]!==r.error?(x=r.error&&t.jsx("span",{className:"text-red-500 truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=x):x=e[12];const p=n?"▲":"▼";let c;e[13]!==p?(c=t.jsx("span",{className:"text-muted-foreground",children:p}),e[13]=p,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==c||e[17]!==u||e[18]!==m||e[19]!==h||e[20]!==x?(f=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1 text-[11px] hover:bg-muted/30 transition-colors",onClick:i,children:[u,m,h,x,c]}),e[15]=i,e[16]=c,e[17]=u,e[18]=m,e[19]=h,e[20]=x,e[21]=f):f=e[21];let g;e[22]!==n||e[23]!==r.error||e[24]!==r.input||e[25]!==r.outputPreview?(g=n&&t.jsxs("div",{className:"border-t border-border px-2 py-1.5 space-y-1 bg-muted/10 text-[11px]",children:[r.error&&t.jsx("pre",{className:"bg-red-500/5 border border-red-500/10 rounded px-2 py-1 whitespace-pre-wrap break-all text-red-700 max-h-20 overflow-auto",children:r.error}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Input"}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Output"}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:r.outputPreview})]})]}),e[22]=n,e[23]=r.error,e[24]=r.input,e[25]=r.outputPreview,e[26]=g):g=e[26];let _;return e[27]!==f||e[28]!==g?(_=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[f,g]}),e[27]=f,e[28]=g,e[29]=_):_=e[29],_}function li({activeRunId:s,onRunChange:e}){const{settings:r}=ps(),[n,o]=M.useState(null),[i,a]=M.useState(!1),l=M.useRef(0),d=M.useRef(null),u=Cr(),m=kr(),h=Ot(s),x=yt(),p=hs(),c=h.data?.run??null,f=c?.status,g=c?.config_snapshot?.monitorMode??c?.config_snapshot?.testMode,_=rt(s,void 0,f),w=(x.data?.items??[]).find(v=>v.status==="running"),y=x.data?.items?.[0]?.id;!s&&y&&d.current!==y&&(d.current=y,queueMicrotask(()=>{e(y)}));const j=async()=>{const v=Date.now();if(v-l.current<1e3)return;l.current=v;const D=n??r.monitorMode,O=await u.mutateAsync({...r,monitorMode:D});e(O.run.id)},I=async()=>{if(w&&w.id!==s&&w.status==="running"){a(!0);return}await j()},S=async()=>{s&&await m.mutateAsync(s)},N=c?.status==="running",C=c?ws(c.started_at,c.finished_at):null,T=_.data?.items??[],R=(p.data?.items??[]).reduce((v,D)=>(v[D.mapping.item_id]=D.item?.server?.icons?.[0]?.src??null,v),{}),E=n??r.monitorMode;return t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs(ne,{className:"p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Current QA Run"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a full QA validation run and track results in real time."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[w&&w.id!==s&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["Run in progress: ",w.id.slice(0,8)]}),t.jsxs(G,{size:"sm",onClick:I,disabled:u.isPending||N,className:"gap-1.5",children:[t.jsx(wr,{size:14}),u.isPending?"Starting...":w&&w.id!==s?"Start another run":"Start QA run"]}),t.jsxs(G,{size:"sm",variant:"outline",onClick:S,disabled:!s||!N,className:"gap-1.5",children:[t.jsx(Ws,{size:14}),"Cancel"]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"QA mode"}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:E,onChange:v=>o(v.target.value),disabled:N,children:[t.jsx("option",{value:"health_check",children:"Health check"}),t.jsx("option",{value:"tool_call",children:"Tool call"}),t.jsx("option",{value:"full_agent",children:"Agentic (LLM model)"})]})]}),t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"QA run history (pick a previous run)"}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:s??"",onChange:v=>e(v.target.value||void 0),children:[t.jsx("option",{value:"",children:"Auto-select latest run"}),(x.data?.items??[]).map(v=>t.jsxs("option",{value:v.id,children:[new Date(v.created_at).toLocaleString()," -"," ",v.status]},v.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:E==="health_check"?"Checks connectivity and tool listing only — no tool calls are made.":E==="tool_call"?"Calls each tool with empty inputs to verify it responds without errors.":"Uses an LLM model to execute chained tool calls and validate outputs."}),c?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(F,{className:Z("capitalize",Ns(c.status),c.status==="running"?"animate-pulse":""),children:c.status}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.tested_items,"/",c.total_items," tested"]}),C&&t.jsx("span",{className:"text-xs text-muted-foreground",children:C}),N&&c.current_item_id&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-64",children:["QA on:"," ",t.jsx("span",{className:"font-mono",children:c.current_item_id})]})]}),t.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:t.jsx("div",{className:Z("h-full transition-all duration-500",c.failed_items>0?"bg-orange-500":"bg-emerald-500",N?"animate-pulse":""),style:{width:`${Zn(c)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-emerald-600",children:"Passed"}),t.jsx("p",{className:"text-lg font-bold text-emerald-600",children:c.passed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-red-600",children:"Failed"}),t.jsx("p",{className:"text-lg font-bold text-red-600",children:c.failed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Skipped"}),t.jsx("p",{className:"text-lg font-bold",children:c.skipped_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"}),t.jsx("p",{className:"text-lg font-bold",children:c.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:"No run selected yet. Start a new run to begin."})]}),t.jsxs(ne,{className:"p-4 space-y-2 min-h-[360px]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-semibold",children:["QA results log (",T.length,")"]}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Live per-MCP test output for the selected run."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[N&&t.jsx(F,{className:"bg-blue-500/10 text-blue-600 border-blue-500/20 animate-pulse",children:"run in progress"}),c&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["progress: ",c.tested_items," of ",c.total_items," MCPs"]}),g&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["mode: ",g.replace("_"," ")]})]})]}),T.length===0?t.jsx("div",{className:"h-[280px] rounded border border-dashed border-border flex items-center justify-center text-xs text-muted-foreground",children:"No results yet. Start a run to see live logs here."}):t.jsx("div",{ref:v=>{v&&N&&v.scrollHeight-v.scrollTop-v.clientHeight<120&&requestAnimationFrame(()=>{v.scrollTop=v.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:T.map((v,D)=>t.jsx(ei,{result:v,index:D,icon:R[v.item_id]},v.id))})]})]}),t.jsx(tt,{open:i,onOpenChange:a,children:t.jsxs(et,{children:[t.jsxs(He,{children:[t.jsx(Ye,{children:"Start another test run?"}),t.jsxs(We,{children:["There is already a run in progress",w?` (${w.id})`:"",". Starting another run may increase database load and slow down both executions."]})]}),t.jsxs(Xe,{children:[t.jsx(Je,{children:"Cancel"}),t.jsx(Ze,{onClick:()=>{a(!1),j()},children:"Start anyway"})]})]})})]})}function Cs(s){switch(s){case"passed":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"failed":return"bg-red-500/10 text-red-600 border-red-500/20";case"error":return"bg-orange-500/10 text-orange-600 border-orange-500/20";case"needs_auth":return"bg-amber-500/10 text-amber-600 border-amber-500/20";case"skipped":return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20";default:return""}}function ai(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function oi(s){const e=Y.c(27),{tool:r}=s,[n,o]=M.useState(!1);let i;e[0]!==n?(i=()=>o(!n),e[0]=n,e[1]=i):i=e[1];const a=r.success?"text-emerald-600":"text-red-600";let l;e[2]!==a?(l=Z("text-xs font-bold",a),e[2]=a,e[3]=l):l=e[3];const d=r.success?"✓":"✗";let u;e[4]!==l||e[5]!==d?(u=t.jsx("span",{className:l,children:d}),e[4]=l,e[5]=d,e[6]=u):u=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"text-xs font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];const x=n?"▲":"▼";let p;e[11]!==x?(p=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x}),e[11]=x,e[12]=p):p=e[12];let c;e[13]!==i||e[14]!==u||e[15]!==m||e[16]!==h||e[17]!==p?(c=t.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",onClick:i,children:[u,m,h,p]}),e[13]=i,e[14]=u,e[15]=m,e[16]=h,e[17]=p,e[18]=c):c=e[18];let f;e[19]!==n||e[20]!==r.error||e[21]!==r.input||e[22]!==r.outputPreview?(f=n&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-1.5 bg-muted/20",children:[r.error&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-red-700",children:r.error})]}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Input"}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Output preview"}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:r.outputPreview})]}),!r.error&&!r.outputPreview&&(!r.input||Object.keys(r.input).length===0)&&t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"No additional details."})]}),e[19]=n,e[20]=r.error,e[21]=r.input,e[22]=r.outputPreview,e[23]=f):f=e[23];let g;return e[24]!==c||e[25]!==f?(g=t.jsxs("div",{className:"rounded border border-border",children:[c,f]}),e[24]=c,e[25]=f,e[26]=g):g=e[26],g}function ci(s){const e=Y.c(52),{result:r}=s,[n,o]=M.useState(r.status!=="passed");let i;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.agent_summary||e[3]!==r.connection_ok||e[4]!==r.duration_ms||e[5]!==r.error_message||e[6]!==r.id||e[7]!==r.item_title||e[8]!==r.status||e[9]!==r.tool_results||e[10]!==r.tools_listed){const a=_s(r.tool_results),l=a.every(xi),d=a.filter(mi),u=d.filter(ui).length,m=d.filter(di).length,h=d.length>0;let x;e[12]!==n?(x=()=>o(!n),e[12]=n,e[13]=x):x=e[13];let p;e[14]!==r.status?(p=ai(r.status),e[14]=r.status,e[15]=p):p=e[15];let c;e[16]!==p?(c=t.jsx("span",{className:"text-base shrink-0",children:p}),e[16]=p,e[17]=c):c=e[17];let f;e[18]!==r.item_title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[18]=r.item_title,e[19]=f):f=e[19];let g;e[20]!==r.duration_ms?(g=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[r.duration_ms,"ms"]}),e[20]=r.duration_ms,e[21]=g):g=e[21];const _=r.connection_ok?"✓":"✗";let w;e[22]!==_?(w=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["conn: ",_]}),e[22]=_,e[23]=w):w=e[23];const y=r.tools_listed?"✓":"✗";let j;e[24]!==y?(j=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["tools listed: ",y]}),e[24]=y,e[25]=j):j=e[25];const I=a.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:h?t.jsxs(t.Fragment,{children:["tools: ",u,"✓ ",m,"✗"]}):t.jsxs(t.Fragment,{children:[a.length," tools found"]})});let S;e[26]!==r.action_taken?(S=r.action_taken!=="none"&&t.jsxs(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]}),e[26]=r.action_taken,e[27]=S):S=e[27];let N;e[28]!==j||e[29]!==I||e[30]!==S||e[31]!==g||e[32]!==w?(N=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[g,w,j,I,S]}),e[28]=j,e[29]=I,e[30]=S,e[31]=g,e[32]=w,e[33]=N):N=e[33];let C;e[34]!==N||e[35]!==f?(C=t.jsxs("div",{className:"min-w-0 flex-1",children:[f,N]}),e[34]=N,e[35]=f,e[36]=C):C=e[36];let T;e[37]!==r.status?(T=Z("capitalize shrink-0",Cs(r.status)),e[37]=r.status,e[38]=T):T=e[38];let R;e[39]!==r.status?(R=r.status.replace("_"," "),e[39]=r.status,e[40]=R):R=e[40];let E;e[41]!==T||e[42]!==R?(E=t.jsx(F,{className:T,children:R}),e[41]=T,e[42]=R,e[43]=E):E=e[43];const v=n?"▲":"▼";let D;e[44]!==v?(D=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:v}),e[44]=v,e[45]=D):D=e[45];let O;e[46]!==C||e[47]!==E||e[48]!==D||e[49]!==x||e[50]!==c?(O=t.jsxs("button",{type:"button",className:"w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-muted/30 transition-colors",onClick:x,children:[c,C,E,D]}),e[46]=C,e[47]=E,e[48]=D,e[49]=x,e[50]=c,e[51]=O):O=e[51],i=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[O,n&&t.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2 bg-muted/10",children:[t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Connection"}),t.jsx("p",{className:Z("text-xs font-medium",r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"Connected":"Failed"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tools Listed"}),t.jsx("p",{className:Z("text-xs font-medium",r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?`Yes (${a.length})`:"No"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Duration"}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Action Taken"}),t.jsx("p",{className:"text-xs font-medium capitalize",children:r.action_taken.replace(/_/g," ")})]})]}),r.error_message&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error Message"}),t.jsx("pre",{className:"text-xs bg-red-500/5 border border-red-500/10 rounded px-3 py-2 whitespace-pre-wrap break-all text-red-700",children:r.error_message})]}),h?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tool Results (",u," passed, ",m," failed)"]}),t.jsx("div",{className:"space-y-1",children:d.map((P,A)=>t.jsx(oi,{tool:P},`${r.id}-${P.toolName}-${A}`))})]}):l&&a.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools discovered (",a.length,") — not individually tested (health-check mode)"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:a.map((P,A)=>t.jsx(F,{variant:"outline",className:"text-[10px] font-mono",children:P.toolName},`${r.id}-${P.toolName}-${A}`))})]}):null,r.agent_summary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Agent Summary"}),t.jsx("p",{className:"text-xs bg-muted/50 rounded px-3 py-2",children:r.agent_summary})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.agent_summary,e[3]=r.connection_ok,e[4]=r.duration_ms,e[5]=r.error_message,e[6]=r.id,e[7]=r.item_title,e[8]=r.status,e[9]=r.tool_results,e[10]=r.tools_listed,e[11]=i}else i=e[11];return i}function di(s){return!s.success}function ui(s){return s.success}function mi(s){return s.outputPreview!=="health_check: not called"}function xi(s){return s.outputPreview==="health_check: not called"}function hi(s){const e=Y.c(4),{value:r,onChange:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[{value:"all",label:"All"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"},{value:"error",label:"Error"},{value:"needs_auth",label:"Needs Auth"},{value:"skipped",label:"Skipped"}],e[0]=o):o=e[0];const i=o;let a;return e[1]!==n||e[2]!==r?(a=t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:i.map(l=>t.jsx("button",{type:"button",className:Z("text-[11px] px-2 py-0.5 rounded-full border transition-colors",r===l.value?"bg-primary text-primary-foreground border-primary":"bg-muted/30 border-border hover:bg-muted/50"),onClick:()=>n(l.value),children:l.label},l.value))}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function pi(s){const e=Y.c(46),{runId:r}=s,[n,o]=M.useState("all"),i=Ot(r),a=i.data?.run,l=rt(r,void 0,a?.status);let d;e[0]!==l.data?.items?(d=l.data?.items??[],e[0]=l.data?.items,e[1]=d):d=e[1];const u=d;let m;e[2]!==u||e[3]!==n?(m=n==="all"?u:u.filter(v=>v.status===n),e[2]=u,e[3]=n,e[4]=m):m=e[4];const h=m;if(!r){let v;return e[5]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ne,{className:"p-6 text-center space-y-2",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a run to inspect details."})}),e[5]=v):v=e[5],v}let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h3",{className:"text-sm font-semibold",children:"Run Detail"}),e[6]=x):x=e[6];let p;e[7]!==r?(p=t.jsxs("div",{children:[x,t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r})]}),e[7]=r,e[8]=p):p=e[8];let c;e[9]!==a?(c=a&&t.jsx(F,{className:Z("capitalize",Cs(a.status)),children:a.status}),e[9]=a,e[10]=c):c=e[10];let f;e[11]!==l||e[12]!==i?(f=t.jsx(G,{size:"sm",variant:"outline",onClick:()=>{i.refetch(),l.refetch()},children:"Refresh"}),e[11]=l,e[12]=i,e[13]=f):f=e[13];let g;e[14]!==c||e[15]!==f?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[c,f]}),e[14]=c,e[15]=f,e[16]=g):g=e[16];let _;e[17]!==p||e[18]!==g?(_=t.jsx(ne,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,g]})}),e[17]=p,e[18]=g,e[19]=_):_=e[19];let w;e[20]!==a?(w=a&&t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"}),t.jsx("p",{className:"text-lg font-bold",children:a.total_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tested"}),t.jsx("p",{className:"text-lg font-bold",children:a.tested_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-emerald-600",children:"Passed"}),t.jsx("p",{className:"text-lg font-bold text-emerald-600",children:a.passed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-red-600",children:"Failed"}),t.jsx("p",{className:"text-lg font-bold text-red-600",children:a.failed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Skipped"}),t.jsx("p",{className:"text-lg font-bold",children:a.skipped_items})]})]}),e[20]=a,e[21]=w):w=e[21];let y;e[22]!==a?(y=a&&(a.started_at||a.finished_at)&&t.jsxs(ne,{className:"p-3 flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[a.started_at&&t.jsxs("span",{children:["Started: ",new Date(a.started_at).toLocaleString()]}),a.finished_at&&t.jsxs("span",{children:["Finished: ",new Date(a.finished_at).toLocaleString()]}),a.started_at&&a.finished_at&&t.jsxs("span",{className:"font-medium text-foreground",children:["Duration:"," ",((new Date(a.finished_at).getTime()-new Date(a.started_at).getTime())/1e3).toFixed(1),"s"]})]}),e[22]=a,e[23]=y):y=e[23];let j;e[24]!==n?(j=t.jsx(hi,{value:n,onChange:o}),e[24]=n,e[25]=j):j=e[25];const I=h.length!==1?"s":"";let S;e[26]!==h.length||e[27]!==I?(S=t.jsxs("span",{className:"text-xs text-muted-foreground",children:[h.length," result",I]}),e[26]=h.length,e[27]=I,e[28]=S):S=e[28];let N;e[29]!==j||e[30]!==S?(N=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[j,S]}),e[29]=j,e[30]=S,e[31]=N):N=e[31];let C;e[32]!==u||e[33]!==h.length?(C=h.length===0&&t.jsx(ne,{className:"p-4 text-sm text-muted-foreground text-center",children:u.length===0?"No test results yet.":"No results match the current filter."}),e[32]=u,e[33]=h.length,e[34]=C):C=e[34];let T;e[35]!==h?(T=h.map(fi),e[35]=h,e[36]=T):T=e[36];let R;e[37]!==C||e[38]!==T?(R=t.jsxs("div",{className:"space-y-2",children:[C,T]}),e[37]=C,e[38]=T,e[39]=R):R=e[39];let E;return e[40]!==y||e[41]!==N||e[42]!==R||e[43]!==_||e[44]!==w?(E=t.jsxs("div",{className:"space-y-3",children:[_,w,y,N,R]}),e[40]=y,e[41]=N,e[42]=R,e[43]=_,e[44]=w,e[45]=E):E=e[45],E}function fi(s){return t.jsx(ci,{result:s},s.id)}function gi(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function ji(s){const e=Y.c(20),{selectedRunId:r,onSelectRun:n}=s,o=yt();let i;e[0]!==o.data?.items?(i=o.data?.items??[],e[0]=o.data?.items,e[1]=i):i=e[1];const a=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA run history"}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Browse previous QA executions and reopen their logs."})]}),e[2]=l):l=e[2];let d;e[3]!==o?(d=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l,t.jsx(G,{size:"sm",variant:"outline",onClick:()=>o.refetch(),children:"Refresh"})]}),e[3]=o,e[4]=d):d=e[4];let u;e[5]!==a.length?(u=a.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No runs yet. Start QA from the Dashboard tab."}),e[5]=a.length,e[6]=u):u=e[6];let m;if(e[7]!==n||e[8]!==a||e[9]!==r){let p;e[11]!==n||e[12]!==r?(p=c=>{const f=ws(c.started_at,c.finished_at),g=gi(c),_=r===c.id;return t.jsxs("button",{type:"button",onClick:()=>n(c.id),className:Z("w-full text-left rounded-lg border p-3 transition-colors",_?"border-primary bg-primary/5":"border-border hover:bg-muted/30"),children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(c.created_at).toLocaleString()})}),t.jsx(F,{className:Z("capitalize",Ns(c.status)),children:c.status})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs flex-wrap",children:[t.jsxs("span",{className:"text-muted-foreground",children:[c.tested_items,"/",c.total_items," tested"]}),t.jsxs("span",{className:"text-emerald-600 font-medium",children:[c.passed_items," passed"]}),c.failed_items>0&&t.jsxs("span",{className:"text-red-600 font-medium",children:[c.failed_items," failed"]}),c.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[c.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",g]}),f&&t.jsx("span",{className:"text-muted-foreground",children:f})]}),c.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(F,{variant:"outline",className:"text-[9px]",children:(c.config_snapshot.monitorMode??c.config_snapshot.testMode??"health_check").replace("_"," ")}),c.config_snapshot.onFailure!=="none"&&t.jsxs(F,{variant:"outline",className:"text-[9px] text-red-600",children:["on fail:"," ",c.config_snapshot.onFailure.replace(/_/g," ")]})]})]},c.id)},e[11]=n,e[12]=r,e[13]=p):p=e[13],m=a.map(p),e[7]=n,e[8]=a,e[9]=r,e[10]=m}else m=e[10];let h;e[14]!==u||e[15]!==m?(h=t.jsxs("div",{className:"space-y-2 max-h-[520px] overflow-auto",children:[u,m]}),e[14]=u,e[15]=m,e[16]=h):h=e[16];let x;return e[17]!==d||e[18]!==h?(x=t.jsx(ne,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[d,h]})}),e[17]=d,e[18]=h,e[19]=x):x=e[19],x}function vi(){const s=Y.c(20),[e,r]=M.useState(void 0),[n,o]=M.useState("tests"),a=Ot(e).data?.run?.status,l=rt(e,void 0,a);let d;s[0]!==l.data?.items?(d=l.data?.items??[],s[0]=l.data?.items,s[1]=d):d=s[1];let u;s[2]!==d?(u=d.filter(bi),s[2]=d,s[3]=u):u=s[3];const m=u;let h;s[4]===Symbol.for("react.memo_cache_sentinel")?(h=[{id:"tests",label:"Tests"},{id:"configuration",label:"Configuration"},{id:"connections",label:"Connections"}],s[4]=h):h=s[4];let x;s[5]!==n?(x=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:h.map(_=>{const w=n===_.id;return t.jsx("button",{type:"button",className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",w?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>o(_.id),children:t.jsx("span",{children:_.label})},_.id)})}),s[5]=n,s[6]=x):x=s[6];let p;s[7]!==e||s[8]!==n||s[9]!==m?(p=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(li,{activeRunId:e,onRunChange:r}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-4 items-start",children:[t.jsxs("div",{className:"xl:col-span-8 space-y-6 min-w-0",children:[e&&t.jsx(pi,{runId:e}),t.jsx(ji,{selectedRunId:e,onSelectRun:r})]}),t.jsxs("div",{className:"xl:col-span-4 space-y-2 min-w-0",children:[t.jsxs("h3",{className:"text-sm font-semibold",children:["Broken MCPs"," ",m.length>0&&t.jsx(F,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Pn,{results:m})]})]})]}),s[7]=e,s[8]=n,s[9]=m,s[10]=p):p=s[10];let c;s[11]!==n?(c=n==="configuration"&&t.jsx(Bn,{}),s[11]=n,s[12]=c):c=s[12];let f;s[13]!==n?(f=n==="connections"&&t.jsx(Kn,{}),s[13]=n,s[14]=f):f=s[14];let g;return s[15]!==x||s[16]!==p||s[17]!==c||s[18]!==f?(g=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[x,p,c,f]}),s[15]=x,s[16]=p,s[17]=c,s[18]=f,s[19]=g):g=s[19],g}function bi(s){return s.status==="failed"||s.status==="error"}function yi(s){const e=Y.c(9),{activeTab:r,onChange:n,items:o}=s;let i;if(e[0]!==r||e[1]!==o||e[2]!==n){let l;e[4]!==r||e[5]!==n?(l=d=>{const u=r===d.tab,m=d.icon;return t.jsxs("button",{type:"button",className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",u?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>n(d.tab),children:[t.jsx(m,{size:14}),t.jsx("span",{children:d.label}),typeof d.count=="number"&&d.count>0&&t.jsx("span",{className:"min-w-4 h-4 px-1 inline-flex items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold",children:d.count})]},d.id)},e[4]=r,e[5]=n,e[6]=l):l=e[6],i=o.map(l),e[0]=r,e[1]=o,e[2]=n,e[3]=i}else i=e[3];let a;return e[7]!==i?(a=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:i}),e[7]=i,e[8]=a):a=e[8],a}function dl(s){const e=Y.c(47),{onBack:r}=s,[n,o]=M.useState("items"),[i,a]=M.useState(null),{registryName:l,registryIcon:d,acceptPublishRequests:u}=js($e),m=zr(),h=Mr();!u&&n==="requests"&&o("items");const x=m.data?.pending??0,p=h.brokenCount>0?h.brokenCount:void 0;let c;e[0]!==p?(c={id:"items",label:"Items",icon:Zs,tab:"items",count:p},e[0]=p,e[1]=c):c=e[1];let f;e[2]!==u||e[3]!==x?(f=u?[{id:"requests",label:"Requests",icon:Le,tab:"requests",count:x}]:[],e[2]=u,e[3]=x,e[4]=f):f=e[4];let g,_;e[5]===Symbol.for("react.memo_cache_sentinel")?(g={id:"qa",label:"QA",icon:ds,tab:"qa"},_={id:"settings",label:"Settings",icon:Xs,tab:"settings"},e[5]=g,e[6]=_):(g=e[5],_=e[6]);let w;e[7]!==c||e[8]!==f?(w=[c,...f,g,_],e[7]=c,e[8]=f,e[9]=w):w=e[9];const y=w;let j;e[10]!==r?(j=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Js,{size:16})}),e[10]=r,e[11]=j):j=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=()=>o("settings"),e[12]=I):I=e[12];let S;e[13]!==d||e[14]!==l?(S=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children:d?t.jsx("img",{src:d,alt:l,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:l.slice(0,1).toUpperCase()})}),e[13]=d,e[14]=l,e[15]=S):S=e[15];let N;e[16]!==l?(N=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:l}),e[16]=l,e[17]=N):N=e[17];let C;e[18]!==N||e[19]!==S?(C=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:I,children:[S,N]}),e[18]=N,e[19]=S,e[20]=C):C=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[21]=T):T=e[21];let R;e[22]!==n||e[23]!==y?(R=t.jsx(yi,{activeTab:n,onChange:o,items:y}),e[22]=n,e[23]=y,e[24]=R):R=e[24];let E;e[25]!==C||e[26]!==R||e[27]!==j?(E=t.jsx("header",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[j,C,T,R]})}),e[25]=C,e[26]=R,e[27]=j,e[28]=E):E=e[28];let v;e[29]!==n?(v=n==="items"&&t.jsx(kn,{}),e[29]=n,e[30]=v):v=e[30];let D;e[31]!==u||e[32]!==n?(D=n==="requests"&&u&&t.jsx(Tn,{}),e[31]=u,e[32]=n,e[33]=D):D=e[33];let O;e[34]!==n?(O=n==="qa"&&t.jsx(vi,{}),e[34]=n,e[35]=O):O=e[35];let P;e[36]!==n||e[37]!==i?(P=n==="settings"&&t.jsx(In,{revealedKey:i,onRevealedKeyChange:a}),e[36]=n,e[37]=i,e[38]=P):P=e[38];let A;e[39]!==v||e[40]!==D||e[41]!==O||e[42]!==P?(A=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[v,D,O,P]}),e[39]=v,e[40]=D,e[41]=O,e[42]=P,e[43]=A):A=e[43];let z;return e[44]!==E||e[45]!==A?(z=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[E,A]}),e[44]=E,e[45]=A,e[46]=z):z=e[46],z}export{dl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as a}from"./header-tab-button-DSX6YPkf.js";function t(r){return(e,o)=>{a(e),r(e,o)}}export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as f,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-biiHZ5l9.js";import{i as k}from"./AlertCircle-9EFUZenf.js";import{s as z}from"./Plus-CjrtKB-Y.js";import{s as F}from"./User01-thAIxsAs.js";import{t as E}from"./Users01-DPJm6-u-.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-Bm1pP7Vu.js";import{I as N}from"./input-5PMMNPU9.js";import{L as g}from"./label-CcC4_aKf.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-CNSUv3cw.js";import{S as H}from"./skeleton--DN75sg7.js";import{T as K}from"./textarea-QEULyLXh.js";import{P as b}from"./index-r7-3fAFf.js";import{c as W}from"./settings-section-V9kb8x32.js";import{u as Y,a as G}from"./use-secrets-BpdIBEe6.js";import{R as J}from"./require-capability-DVI2cKO3.js";import"./X-1KR4wibP.js";import"./tooltip-bsrBmmjV.js";import"./Check-D-9dblUn.js";import"./ChevronDown-Cf2Q-GlB.js";import"./ChevronUp-BAxoXhnT.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./sheet-D99KevZC.js";import"./card-BUTabNLA.js";import"./ArrowUpRight-97355q5v.js";import"./use-mcp-client-CWFUu1lY.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";function M(s){const e=f.c(3),{error:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(k,{size:16}),e[0]=a):a=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=f.c(5),{scope:r}=s,a=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==a?(i=t.jsx(a,{size:12}),e[0]=a,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o}function D(s){const e=f.c(20),{secret:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=a):a=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let o;e[5]!==n||e[6]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==o||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a,t.jsxs("div",{className:"min-w-0",children:[o,d]})]}),e[10]=o,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=f.c(5),{onCreate:r}=s;let a,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=a,e[1]=n):(a=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let o;return e[3]!==r?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[a,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=o):o=e[4],o}function _({open:s,onOpenChange:e}){const[r,a]=j.useState("organization"),[n,i]=j.useState(""),[o,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){a("organization"),i(""),d(""),l("")}function p(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!o))try{await c.mutateAsync({scope:r,name:n.trim(),value:o,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),p()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):p()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>a(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:o,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:p,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!o,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=f.c(21),e=Y(),[r,a]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>a(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:a})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,o;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let p;s[7]!==e.length||s[8]!==x?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=p):p=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==p?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[p,m]}),s[12]=p,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,o=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=o}else n=s[4],i=s[5],o=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:a}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==o||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,o,d]}),s[16]=n,s[17]=i,s[18]=o,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=f.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Oe(){const s=f.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as T,j as t,r as Q,B as je,l as Se}from"./index-biiHZ5l9.js";import{i as be}from"./ChevronRight-CrZy8tHx.js";import{E as fe}from"./agent-icon-DT8dQ9tq.js";import{S as ue}from"./scroll-area-BqOijBAI.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Ee,S as Re}from"./page-seo-form-Bbna5w2y.js";import{m as ze}from"./index-BZvxagUr.js";import{a as ge}from"./Tool01-Dcq7KP8Y.js";import{s as xe}from"./schema-form-nZH-67HX.js";import"./AlertCircle-9EFUZenf.js";import"./SwitchHorizontal01-BMnNI1Fi.js";import"./RefreshCcw01-3BsQQkRx.js";import"./XCircle-UPVnJx4i.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./Check-D-9dblUn.js";import"./ChevronDown-Cf2Q-GlB.js";import"./ChevronLeft-BaV4nFMQ.js";import"./ChevronUp-BAxoXhnT.js";import"./DotsVertical-SvwN4CeV.js";import"./Container-CYcITvPW.js";import"./Eye-ByuwKsdh.js";import"./ZoomOut-D8vQ49we.js";import"./Globe01-DfGFlik1.js";import"./FilterLines-BJZdiggU.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./Key01-CzmPnHuw.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Play-CMJ2IWYR.js";import"./Plus-CjrtKB-Y.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Trash01-Cup7-ZTT.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./X-1KR4wibP.js";import"./Zap-Cl-JM7N9.js";import"./select-CNSUv3cw.js";import"./tooltip-bsrBmmjV.js";import"./label-CcC4_aKf.js";import"./switch-D6SWnoi2.js";import"./agent-capabilities-BJLQSkAN.js";import"./chat-context-Bu6qpu9K.js";import"./tab-id-D4SJwEQy.js";import"./use-mcp-client-CWFUu1lY.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-0jbEmvOc.js";import"./use-collections-B5Jh_wGd.js";import"./use-ai-providers-v0sCRzMO.js";import"./use-organization-settings-Izqk1Gkk.js";import"./pair-Ba1UoSSJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./dialog-Bm1pP7Vu.js";import"./content-blocks-o63cs2vh.js";import"./types-jBdXInU0.js";import"./shell-layout-4LsIVsl3.js";import"./avatar-BHEXMwdE.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./integration-icon-Dy-a3x5R.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./use-connection-DyJtuHQI.js";import"./use-mcp-prompts-B5RhBVzg.js";import"./form-BcPtow5O.js";import"./input-5PMMNPU9.js";import"./spinner-DJD6-9r-.js";import"./drawer-B51jkLaX.js";import"./collection-search-LsgoMrVO.js";import"./tabs-DCDCb9Pz.js";import"./toggle-group-DhVqXGfs.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./agent-icons-DRrDyR7j.js";import"./checkbox--nDaSUZE.js";import"./skeleton--DN75sg7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-V9kb8x32.js";import"./card-BUTabNLA.js";import"./popover-Cvcd3A1d.js";import"./command-BehF6pb8.js";import"./index-CR_LeyNj.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./sortable.esm-g7bq1nDZ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-EXvV7rxl.js";import"./use-registry-connections-C-WVKjSU.js";import"./extract-connection-data-LoMqboL3.js";import"./generate-id-CadHbHqX.js";import"./collections-C_j8CeI8.js";import"./collection-tabs-CQJiHDMR.js";import"./badge-Da0IsrqH.js";import"./textarea-QEULyLXh.js";import"./connection-form-helpers-DoJomSCQ.js";import"./use-infinite-scroll-xQQ6lYk4.js";import"./useSuspenseInfiniteQuery-B4dQiTEq.js";import"./index-Bo5bzoUm.js";import"./dropdown-menu-CIu58K9q.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-5KSwc3hj.js";import"./sidebar-CPZXU-2w.js";import"./sheet-D99KevZC.js";import"./toolbar-BsB4Mvyv.js";import"./use-create-virtual-mcp-CWYOy45e.js";import"./github-repo-picker-B24_pGAu.js";import"./use-mcp-tools-DePRGZE5.js";import"./alert-dialog-CSkQIwm8.js";import"./index-B1bHiM-j.js";import"./use-org-auth-client--i_Sx92M.js";import"./hover-card-DE2_8MLP.js";import"./task-status-P3BULAyA.js";import"./use-status-sounds-BJ_LqdGJ.js";import"./empty-state-1AbmTLd7.js";import"./resizable-BbbLszRZ.js";import"./use-capability-BPM45mbW.js";import"./header-tab-button-DSX6YPkf.js";import"./index-BflNEs6l.js";import"./user-DRDdFgUw.js";import"./tools-list-Ch5RlbiL.js";import"./use-debounced-autosave-ClLbciGl.js";import"./index-r7-3fAFf.js";import"./search-input-BgGthWir.js";import"./use-secrets-BpdIBEe6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-aX0NKKKh.js";import"./view-mode-toggle-G0qNMbJ1.js";import"./select-model-0CGh6cKF.js";import"./use-automations-Db8x6SNU.js";import"./monaco-editor-CJVi8Ty8.js";import"./automation-runs-BJTRztep.js";import"./table-Cx3PhNth.js";import"./use-members-Cw70r_Wh.js";import"./automation-list-row-5M4PNEWw.js";import"./calendar-BbhbS2FE.js";import"./image-field-D00iYa4G.js";import"./use-file-configs-CC8ghNUa.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Di(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let E,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(E=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(E,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=E,e[7]=G):(E=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=R=>{if(!c)return;const de=R;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==E?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Ee,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:E,onPersistRaw:R=>{N(R),k(R)},onInnerChange:R=>{v(R),b(R)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Re,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=E,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Di as SeoEditor};
|