decocms 3.99.2 → 3.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D8nl7USt.js → AlertCircle-CB5KvLwP.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DgG9Xs3P.js → ArrowUpRight-CGiD8vy5.js} +1 -1
- package/dist/client/assets/{CheckCircle-yOjX9PZe.js → CheckCircle-BBV9CFFT.js} +1 -1
- package/dist/client/assets/{ChevronDown-DXzUoD2e.js → ChevronDown-BJhXIK-P.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DopUTXew.js → ChevronLeft-B1FMEVNc.js} +1 -1
- package/dist/client/assets/{ChevronRight-j760Iee-.js → ChevronRight-Cxkz20f7.js} +1 -1
- package/dist/client/assets/{ChevronUp-CADhYHt4.js → ChevronUp-CSnIUHk6.js} +1 -1
- package/dist/client/assets/{DotsVertical-AD-a2Knc.js → DotsVertical-D_Mc-7IQ.js} +1 -1
- package/dist/client/assets/{Eye-CQQama2s.js → Eye-v7KW9L98.js} +1 -1
- package/dist/client/assets/{FilterLines-CehUrsTR.js → FilterLines-BFU-HGPB.js} +1 -1
- package/dist/client/assets/{Globe01-CaIgPTxT.js → Globe01-J206FB3X.js} +1 -1
- package/dist/client/assets/{Globe04-CuT114AV.js → Globe04-BVemAfGE.js} +1 -1
- package/dist/client/assets/{HardDrive-lZvAMErY.js → HardDrive-CWgzi9wO.js} +1 -1
- package/dist/client/assets/{Key01-BAEB0MKB.js → Key01-BD-IJNJQ.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Fadct960.js → LayoutLeft-CB8DIaei.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dh2g8Xye.js → LinkExternal01-B2EDdnZx.js} +1 -1
- package/dist/client/assets/{Monitor01-_MTiHAuD.js → Monitor01-JBmV730I.js} +1 -1
- package/dist/client/assets/{Palette-hlsbFMfV.js → Palette-wlYD__vW.js} +1 -1
- package/dist/client/assets/{Play-CfbRRa8r.js → Play-DUpdkISP.js} +1 -1
- package/dist/client/assets/{Plus-CdiQoMoJ.js → Plus-CSb3V8S8.js} +1 -1
- package/dist/client/assets/SearchLg-B9kqdzVX.js +1 -0
- package/dist/client/assets/{SearchMd-D1HSgOeu.js → SearchMd-DhW8248m.js} +1 -1
- package/dist/client/assets/{Settings02-D-O2SNJf.js → Settings02-BsAGDeee.js} +1 -1
- package/dist/client/assets/{Shield01-DOrMIO9W.js → Shield01-DU8KFrFU.js} +1 -1
- package/dist/client/assets/{Star01-BNUohd1g.js → Star01-BG3nvXkE.js} +1 -1
- package/dist/client/assets/{Stars01-DMt3zew5.js → Stars01-BleMq6lh.js} +1 -1
- package/dist/client/assets/{Stars02-BUidkUMX.js → Stars02-D1hTo9kS.js} +1 -1
- package/dist/client/assets/{Sun-CrWUbEJD.js → Sun-BHlOvrTC.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CB8Z7BL9.js → SwitchHorizontal01-dtUU9yY1.js} +1 -1
- package/dist/client/assets/{Tool01-Dt-TbXDn.js → Tool01-BBDLAsiN.js} +1 -1
- package/dist/client/assets/{Trash01-BVvGX_KK.js → Trash01-DEQkTUig.js} +1 -1
- package/dist/client/assets/{Upload01-Prj9a2xY.js → Upload01-aTx0MT4i.js} +1 -1
- package/dist/client/assets/{User01-CaU7xtcd.js → User01-y8ntusMn.js} +1 -1
- package/dist/client/assets/{Users01-BRnzISUs.js → Users01-B-8sWltw.js} +1 -1
- package/dist/client/assets/{Users03-DwMxpPU3.js → Users03-Dlm3r0r-.js} +1 -1
- package/dist/client/assets/{X-C-TqNtc2.js → X-BXn2_vYM.js} +1 -1
- package/dist/client/assets/{XCircle-DAqTWvWp.js → XCircle-mXjRT0sF.js} +1 -1
- package/dist/client/assets/{XClose-DlK2hm1P.js → XClose-BDAWssyq.js} +1 -1
- package/dist/client/assets/{Zap-5n0DTezT.js → Zap-eZQ7TcmD.js} +1 -1
- package/dist/client/assets/{ZapSquare-DD_XuIyF.js → ZapSquare-DrbsMYOt.js} +1 -1
- package/dist/client/assets/{ZoomOut-VAm9p2Hl.js → ZoomOut-DwwAa3X7.js} +1 -1
- package/dist/client/assets/{access-gate-Bb0qjuIO.js → access-gate-BkQkZSw7.js} +1 -1
- package/dist/client/assets/{add-section-modal-ZfYc_Xn6.js → add-section-modal-BT0K2WGi.js} +1 -1
- package/dist/client/assets/agent-icon-DQ2UQuHh.js +1 -0
- package/dist/client/assets/agents-list-D4pW1eF3.js +1 -0
- package/dist/client/assets/{ai-providers-KlM-uWQ0.js → ai-providers-qdSfgAjS.js} +1 -1
- package/dist/client/assets/{alert-19iuIUZ1.js → alert-Bk7_b-_k.js} +1 -1
- package/dist/client/assets/{alert-dialog-DESqZhA2.js → alert-dialog-DqsunxqN.js} +1 -1
- package/dist/client/assets/app-editor-Bb387cQo.js +1 -0
- package/dist/client/assets/{auth-BR3aJLVt.js → auth-EMMal3Dz.js} +1 -1
- package/dist/client/assets/{auth-catchall-DV_XFERR.js → auth-catchall-B0IwkpQE.js} +1 -1
- package/dist/client/assets/{auth-entry-WLY89UlS.js → auth-entry-DUQxRcp9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D8MR1i_O.js → auth-split-layout-CozHTgSY.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DlE0FF2e.js → authenticate-and-persist-oauth-cWdyk-4l.js} +1 -1
- package/dist/client/assets/{automation-list-row-D2uPOFxN.js → automation-list-row-DcfWPhsa.js} +1 -1
- package/dist/client/assets/{automation-runs-irK0CDv6.js → automation-runs-GIeVqtWs.js} +1 -1
- package/dist/client/assets/automations-BuY0n0pu.js +1 -0
- package/dist/client/assets/{avatar-DKl_SvPY.js → avatar-CCs3cbGI.js} +1 -1
- package/dist/client/assets/{badge-CPOFnH5f.js → badge-B-Bz5at5.js} +1 -1
- package/dist/client/assets/{block-document-C_nFcvPT.js → block-document-BkT_K3Fj.js} +1 -1
- package/dist/client/assets/{brand-context-CmJN3ec7.js → brand-context-Budskn6L.js} +1 -1
- package/dist/client/assets/{buckets-BEbuFGaG.js → buckets-f0-ci-zH.js} +1 -1
- package/dist/client/assets/{capability-load-error-BULhLJ9o.js → capability-load-error-C31L1nr_.js} +1 -1
- package/dist/client/assets/{card-CCz6n2PT.js → card-KfNIoaPf.js} +1 -1
- package/dist/client/assets/category-editor-B9pyPRue.js +1 -0
- package/dist/client/assets/{chat-context-C-somJSY.js → chat-context-B-cXtnc6.js} +1 -1
- package/dist/client/assets/{checkbox-DXMAgfVg.js → checkbox-L9WnatCJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dv2HlRuI.js → cli-auth-success-D32UIzoT.js} +1 -1
- package/dist/client/assets/collection-detail-w19GYSpy.js +1 -0
- package/dist/client/assets/{collection-display-button-DsLpaXK_.js → collection-display-button-DNZy72Lj.js} +1 -1
- package/dist/client/assets/{collection-search-9Z9J-flr.js → collection-search-Bw8ErL9A.js} +1 -1
- package/dist/client/assets/{collection-tabs-BkVwtVd6.js → collection-tabs-CDQNfYku.js} +1 -1
- package/dist/client/assets/{command-CD_UfdIZ.js → command-DM9QRA4h.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BIIFNmxt.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-DhsRqyJo.js → connect-desktop-dialog-CG0vg5V1.js} +1 -1
- package/dist/client/assets/{connection-card-Cm-r3F3U.js → connection-card-CFNuDsq8.js} +1 -1
- package/dist/client/assets/connection-detail-BgYdE75o.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CzldBL3R.js → connection-form-helpers-DO3e40s1.js} +1 -1
- package/dist/client/assets/connections-6kxrxm_j.js +1 -0
- package/dist/client/assets/{context-menu-BMjlqCBa.js → context-menu-gXAbOm7T.js} +1 -1
- package/dist/client/assets/{decopilot-CzHxKRA2.js → decopilot-YCL8e-nf.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-9lyDYS1g.js → decopilot-sse-pool-DPxuN-3_.js} +1 -1
- package/dist/client/assets/{dialog-BYnY80tb.js → dialog-BxQnVy3N.js} +1 -1
- package/dist/client/assets/{domain-settings-Be5Onfyn.js → domain-settings-Dj2fR8fd.js} +1 -1
- package/dist/client/assets/{drawer-DSWLLvbj.js → drawer-Cnet3QMz.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B_-Um9OQ.js → dropdown-menu-C0QC0e-U.js} +1 -1
- package/dist/client/assets/{empty-state-Di1r-g_a.js → empty-state-B6QyYsPZ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-sR3PfR1q.js → extract-connection-data-Bosa8zHT.js} +1 -1
- package/dist/client/assets/file-explorer-Dy4dTATI.js +2 -0
- package/dist/client/assets/{file-type-icon-MmuXAAgi.js → file-type-icon-C5be6uul.js} +1 -1
- package/dist/client/assets/{files-D4PhY45Y.js → files-BFxWtXVO.js} +1 -1
- package/dist/client/assets/{form-DyV_U4Fx.js → form-CIlG55_C.js} +1 -1
- package/dist/client/assets/{general-CBtZaIU7.js → general-rOZ7zQE0.js} +1 -1
- package/dist/client/assets/github-repo-picker-ClZplb89.js +1 -0
- package/dist/client/assets/{hooks-B4h0KjiG.js → hooks-BW_au6w-.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DQBHcufQ.js → import-from-deco-dialog-BRqiGd04.js} +1 -1
- package/dist/client/assets/{index-Dsuwnck-.js → index-3RYygtpZ.js} +1 -1
- package/dist/client/assets/index-BUsNDaiq.js +1 -0
- package/dist/client/assets/index-Bl1rlkAc.js +503 -0
- package/dist/client/assets/{index-mv0f5ZIA.js → index-BsT-8SKh.js} +1 -1
- package/dist/client/assets/index-C6oPDe4K.js +1 -0
- package/dist/client/assets/index-CAwZtBUO.js +169 -0
- package/dist/client/assets/{index-9DIboil-.js → index-CI3DfI1l.js} +2 -2
- package/dist/client/assets/{index-T5P3sRB3.js → index-Cj1plGam.js} +1 -1
- package/dist/client/assets/{index-CfIbeCCb.js → index-DDDWgWz8.js} +1 -1
- package/dist/client/assets/{index-BSpZjkyI.js → index-DH054m17.js} +1 -1
- package/dist/client/assets/{index-C5w7M3ak.js → index-DJ-0yJzO.js} +4 -4
- package/dist/client/assets/{index--rRbpAQ9.js → index-DSFMxO70.js} +1 -1
- package/dist/client/assets/{index-Cx9raLNH.js → index-Dn5vAQDR.js} +1 -1
- package/dist/client/assets/index-h9qXUa58.css +1 -0
- package/dist/client/assets/{index-DJPcb21Y.js → index-hIyA29hR.js} +1 -1
- package/dist/client/assets/{index-redirect-D6vRUTKb.js → index-redirect-BdBm--uy.js} +1 -1
- package/dist/client/assets/{input-agFYfi3v.js → input-C2eR67CX.js} +1 -1
- package/dist/client/assets/{integration-icon-CE7Y49fT.js → integration-icon-CRPoStYp.js} +1 -1
- package/dist/client/assets/{label-A5aaknkU.js → label-dfUb2uoI.js} +1 -1
- package/dist/client/assets/{login-Ccc0MFum.js → login-BQhCM0sv.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BsM22i8Z.js → mcp-oauth-DHLZTN3O.js} +1 -1
- package/dist/client/assets/{members-Cxv-yFRF.js → members-CK_LQWOy.js} +1 -1
- package/dist/client/assets/{monaco-editor-CK4_aHmD.js → monaco-editor-C1v3GK4B.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C_tu4yGv.js → monitoring-stats-row-sU5G_aur.js} +1 -1
- package/dist/client/assets/{oauth-callback-BGRjz4pz.js → oauth-callback-BBcDGSVc.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D6VPZnFo.js → oauth-callback-ai-provider-CYOtZ7DJ.js} +1 -1
- package/dist/client/assets/{onboarding-DuFslM5N.js → onboarding-BZH5ergb.js} +1 -1
- package/dist/client/assets/{org-install-HxIFGE3M.js → org-install-BbRwzOKv.js} +1 -1
- package/dist/client/assets/{org-layout-Bz6JE5ap.js → org-layout-BCsbDhvJ.js} +1 -1
- package/dist/client/assets/{organization-choice-BtKnPkHP.js → organization-choice-DrYPCeGO.js} +1 -1
- package/dist/client/assets/{page-seo-form-DjBw0txl.js → page-seo-form-DpOET_p-.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DyoKBsS2.js +1 -0
- package/dist/client/assets/{popover-DXCLs7Mh.js → popover-NZJWCLt1.js} +1 -1
- package/dist/client/assets/post-editor-Bbt5yCh2.js +1 -0
- package/dist/client/assets/preview-dialog-C4yQrBab.js +5 -0
- package/dist/client/assets/{primitives-DHDblW6s.js → primitives-_v-rLEEl.js} +1 -1
- package/dist/client/assets/{profile-BHOgJciD.js → profile-_KXC62IE.js} +1 -1
- package/dist/client/assets/project-app-view-DXSz0pMJ.js +1 -0
- package/dist/client/assets/record-editor-VdfYg6pr.js +1 -0
- package/dist/client/assets/registry-iyhJaDcl.js +2 -0
- package/dist/client/assets/{registry-layout-DQnSen4T.js → registry-layout-ueKfEeIx.js} +1 -1
- package/dist/client/assets/{require-capability-DyXOtXgQ.js → require-capability-bIF6RhUp.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CluuNdrt.js → required-auth-layout-Dto8wlZl.js} +1 -1
- package/dist/client/assets/{reset-password-CfcV_Ol7.js → reset-password-BK5EbrE5.js} +1 -1
- package/dist/client/assets/roles-DK_1BIWv.js +1 -0
- package/dist/client/assets/{scroll-area-BFd5bzOG.js → scroll-area-C1pOloFJ.js} +1 -1
- package/dist/client/assets/{search-input-DBcneL-Z.js → search-input-Dv1TseVx.js} +1 -1
- package/dist/client/assets/{secrets-DKKr0DS-.js → secrets-BAuZTTwK.js} +1 -1
- package/dist/client/assets/{sections-editor-Da2BXnWh.js → sections-editor-0O2o_Y6K.js} +2 -2
- package/dist/client/assets/{select--NMtIJXa.js → select-P94u0CJo.js} +1 -1
- package/dist/client/assets/{select-model-B8wcKRbd.js → select-model-BUU-K3y0.js} +1 -1
- package/dist/client/assets/seo-editor-C4nbRhPN.js +1 -0
- package/dist/client/assets/settings-layout-BS6pavFk.js +1 -0
- package/dist/client/assets/{settings-section-Cv3fX46A.js → settings-section-BOi1IsyE.js} +1 -1
- package/dist/client/assets/{sheet-CG7AqhVD.js → sheet-DBbd3xZ9.js} +1 -1
- package/dist/client/assets/{shell-controls-BD9OqBnx.js → shell-controls-Cx99Qsog.js} +1 -1
- package/dist/client/assets/shell-layout-C7ri93NQ.js +1 -0
- package/dist/client/assets/{shell-route-loading-DX7cr59C.js → shell-route-loading-tzhgNES0.js} +1 -1
- package/dist/client/assets/{sidebar-C8Zfra_F.js → sidebar-V0fgYf5d.js} +1 -1
- package/dist/client/assets/{skeleton-sBC4lQNI.js → skeleton-Dkde-wB2.js} +1 -1
- package/dist/client/assets/{sortable.esm-YhwgmY_a.js → sortable.esm-CuMhTk6a.js} +1 -1
- package/dist/client/assets/{sso-CMBwbNfn.js → sso-D0Kl4hLV.js} +1 -1
- package/dist/client/assets/{store-Cl_1LRh_.js → store-Di_Xqz3q.js} +1 -1
- package/dist/client/assets/store-registry-bvwbkRZM.js +2 -0
- package/dist/client/assets/{studio-tools-BJLBgOee.js → studio-tools-Cdx_UHKK.js} +1 -1
- package/dist/client/assets/{switch-V6piMM6A.js → switch-COQDKJ_b.js} +1 -1
- package/dist/client/assets/{table-CO4yX7RA.js → table-BV4PwUfw.js} +1 -1
- package/dist/client/assets/{tabs-DGpCIiez.js → tabs-DDSzGN2J.js} +1 -1
- package/dist/client/assets/{task-status-CyBXqR4E.js → task-status-DRFd52Gi.js} +1 -1
- package/dist/client/assets/{textarea-Dgff3Gg2.js → textarea-3Q-WOeg_.js} +1 -1
- package/dist/client/assets/{toggle-group-DRhh44eR.js → toggle-group-BO6v5tfG.js} +1 -1
- package/dist/client/assets/{toolbar-QoRJzy-G.js → toolbar-CWj6rOG7.js} +1 -1
- package/dist/client/assets/{tooltip-CgNWIJOM.js → tooltip-4wDbnU57.js} +1 -1
- package/dist/client/assets/{types-CXz6VYrK.js → types-CYxZXBM0.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dw8zktiy.js → use-ai-providers-DRi0TGR5.js} +1 -1
- package/dist/client/assets/{use-automations-1dr86I_A.js → use-automations-BooH66Yd.js} +1 -1
- package/dist/client/assets/{use-capability-DVHDSFWa.js → use-capability-BsG-lChE.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CmvqvAhs.js → use-clock-tick-CasxGSyY.js} +1 -1
- package/dist/client/assets/{use-collections-BYKClwvP.js → use-collections-BpN1mXwR.js} +1 -1
- package/dist/client/assets/{use-connection-BnTFSsXk.js → use-connection-BqxUv0Rd.js} +1 -1
- package/dist/client/assets/{use-copy-Cz-l8dwG.js → use-copy-CwggxRep.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dc3lK-qn.js → use-create-virtual-mcp-CZRe26ST.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-mT469Qcu.js → use-debounced-autosave-CtylY127.js} +1 -1
- package/dist/client/assets/use-debounced-value-BRThlWXN.js +1 -0
- package/dist/client/assets/{use-delete-connection-Tmvu17mo.js → use-delete-connection-BHJOzx5H.js} +1 -1
- package/dist/client/assets/{use-file-configs-BY2cpVcw.js → use-file-configs-Dw3oHwr6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-10P3vgT3.js → use-infinite-scroll-PHACyDPD.js} +1 -1
- package/dist/client/assets/{use-join-requests-CrmgeiIm.js → use-join-requests-DzK_EBfe.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Ci_r6Z9X.js → use-mcp-client-fiFo9WZN.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Brfbccg_.js → use-mcp-prompts-Cc4XqYJp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C3Vng-X-.js → use-mcp-tools-DZ2dmLN4.js} +1 -1
- package/dist/client/assets/{use-members-B81Cwsvd.js → use-members-CaBsWevB.js} +1 -1
- package/dist/client/assets/{use-mobile-COxfHS-K.js → use-mobile-LV4GsbgX.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cp82Pt97.js → use-navigate-to-agent-BMSd7x3f.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C5HFWhiz.js → use-org-auth-client-VEUd0F6I.js} +1 -1
- package/dist/client/assets/{use-org-sso-BrX2nnoi.js → use-org-sso-axj6nKtT.js} +1 -1
- package/dist/client/assets/{use-organization-roles-kcsQY_C9.js → use-organization-roles-Dcl4Pns4.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D1CXb2Mk.js → use-organization-settings-BQsTdhD3.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DxwnrcKA.js → use-registry-connections-Do_Rvk9e.js} +1 -1
- package/dist/client/assets/{use-secrets-B-XWgN3K.js → use-secrets-BIiRA5fw.js} +1 -1
- package/dist/client/assets/{use-status-sounds-SD_W2P9L.js → use-status-sounds-D3_nXyIH.js} +1 -1
- package/dist/client/assets/{use-view-mode-C99Hv44a.js → use-view-mode-igg5URt-.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C76Ypnz5.js → use-virtual-mcp-sFB9DBP0.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DpyG04IT.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-C19LNIx7.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-CT-DHsCI.js → useSuspenseQueries-DB9vVKVd.js} +1 -1
- package/dist/client/assets/variant-calendar-DYjpscqX.js +1 -0
- package/dist/client/assets/{view-mode-toggle-XGoB5RsL.js → view-mode-toggle-CUNdRghN.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +426 -426
- package/dist/server/server.js +268 -268
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-Tlh3oNKM.js +0 -1
- package/dist/client/assets/agents-list-DG6ttARV.js +0 -1
- package/dist/client/assets/app-editor-C0ZGI6j9.js +0 -1
- package/dist/client/assets/automations-DLGkAvdI.js +0 -1
- package/dist/client/assets/category-editor-BEu80DLc.js +0 -1
- package/dist/client/assets/collection-detail-BunbCR6D.js +0 -1
- package/dist/client/assets/commerce-onboarding-BiVomJ-b.js +0 -1
- package/dist/client/assets/connection-detail-C_0Hpkc4.js +0 -1
- package/dist/client/assets/connections-Be1_sFRI.js +0 -1
- package/dist/client/assets/file-explorer-hz_GCFqU.js +0 -2
- package/dist/client/assets/github-repo-picker-B4YgsSnm.js +0 -1
- package/dist/client/assets/index-2MM6p12e.js +0 -1
- package/dist/client/assets/index-53LWl5CV.js +0 -503
- package/dist/client/assets/index-BG_EZ_gC.js +0 -169
- package/dist/client/assets/index-C94qgHMJ.js +0 -1
- package/dist/client/assets/index-NVhaWgyE.css +0 -1
- package/dist/client/assets/page-seo-sheet-Ddik0L9a.js +0 -1
- package/dist/client/assets/post-editor-aN1M0k3q.js +0 -1
- package/dist/client/assets/preview-dialog-DwVGd6qW.js +0 -5
- package/dist/client/assets/project-app-view-Dds52VxM.js +0 -1
- package/dist/client/assets/record-editor-DWU1kNnR.js +0 -1
- package/dist/client/assets/registry-BQ5Yq-6B.js +0 -2
- package/dist/client/assets/roles-BCXCHheI.js +0 -1
- package/dist/client/assets/save-status-Dg-HdKmb.js +0 -1
- package/dist/client/assets/seo-editor-CpXgkLht.js +0 -1
- package/dist/client/assets/settings-layout-kC9Zv916.js +0 -1
- package/dist/client/assets/shell-layout-Cz9jaH1b.js +0 -1
- package/dist/client/assets/store-registry-B8Uu7fXQ.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Dd70hn1g.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-8qs6htsj.js +0 -1
- package/dist/client/assets/variant-calendar-BHRaDzz9.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as se,j as s,B as Z,D as me,r as Y,w as v,t as de}from"./index-C5w7M3ak.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-B_-Um9OQ.js";import{s as pe}from"./Star01-BNUohd1g.js";import{a as fe}from"./Users03-DwMxpPU3.js";import{a as ge,G as ue}from"./github-repo-picker-B4YgsSnm.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-DQBHcufQ.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-C76Ypnz5.js";import{P as K}from"./index-DJPcb21Y.js";import{a as ye}from"./DotsVertical-AD-a2Knc.js";import{a as Ne}from"./Settings02-D-O2SNJf.js";import{s as Se}from"./Trash01-BVvGX_KK.js";import{A as De,at as ve}from"./agent-icon-Tlh3oNKM.js";import{m as Ae}from"./use-navigate-to-agent-Cp82Pt97.js";import{C as we}from"./card-CCz6n2PT.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-DVHDSFWa.js";import{E as Te}from"./empty-state-Di1r-g_a.js";import{u as ze}from"./use-create-virtual-mcp-Dc3lK-qn.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-DESqZhA2.js";import{S as $e}from"./search-input-DBcneL-Z.js";import{s as le}from"./Plus-CdiQoMoJ.js";import"./ChevronUp-CADhYHt4.js";import"./ChevronRight-j760Iee-.js";import"./dialog-BYnY80tb.js";import"./X-C-TqNtc2.js";import"./checkbox-DXMAgfVg.js";import"./collection-search-9Z9J-flr.js";import"./SearchMd-D1HSgOeu.js";import"./use-connection-BnTFSsXk.js";import"./use-collections-BYKClwvP.js";import"./use-mcp-client-Ci_r6Z9X.js";import"./auth-BR3aJLVt.js";import"./authenticate-and-persist-oauth-DlE0FF2e.js";import"./mcp-oauth-BsM22i8Z.js";import"./use-mcp-tools-C3Vng-X-.js";import"./extract-connection-data-sR3PfR1q.js";import"./sidebar-C8Zfra_F.js";import"./LayoutLeft-Fadct960.js";import"./use-mobile-COxfHS-K.js";import"./sheet-CG7AqhVD.js";import"./tooltip-CgNWIJOM.js";import"./AlertCircle-D8nl7USt.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./XCircle-DAqTWvWp.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronDown-DXzUoD2e.js";import"./ChevronLeft-DopUTXew.js";import"./Stars02-BUidkUMX.js";import"./Eye-CQQama2s.js";import"./ZoomOut-VAm9p2Hl.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./Zap-5n0DTezT.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function ls(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{ls as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-C5w7M3ak.js";import{i as je}from"./ChevronRight-j760Iee-.js";import{S as ke}from"./scroll-area-BFd5bzOG.js";import{A as _e}from"./add-section-modal-ZfYc_Xn6.js";import{ao as Be,ap as we,aq as Ae,j as Ne,k as Re,ar as Ce,U as Ee,ab as Ke}from"./index-53LWl5CV.js";import{S as Te}from"./save-status-Dg-HdKmb.js";import"./agent-icon-Tlh3oNKM.js";import"./AlertCircle-D8nl7USt.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./Settings02-D-O2SNJf.js";import"./XCircle-DAqTWvWp.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./Users03-DwMxpPU3.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronUp-CADhYHt4.js";import"./ChevronDown-DXzUoD2e.js";import"./ChevronLeft-DopUTXew.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Eye-CQQama2s.js";import"./ZoomOut-VAm9p2Hl.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LayoutLeft-Fadct960.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Plus-CdiQoMoJ.js";import"./SearchMd-D1HSgOeu.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Trash01-BVvGX_KK.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./X-C-TqNtc2.js";import"./Zap-5n0DTezT.js";import"./use-clock-tick-CmvqvAhs.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cz-l8dwG.js";import"./tooltip-CgNWIJOM.js";import"./file-type-icon-MmuXAAgi.js";import"./dialog-BYnY80tb.js";import"./use-mobile-COxfHS-K.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CXz6VYrK.js";import"./use-mcp-client-Ci_r6Z9X.js";import"./auth-BR3aJLVt.js";import"./chat-context-C-somJSY.js";import"./hooks-B4h0KjiG.js";import"./decopilot-sse-pool-9lyDYS1g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C76Ypnz5.js";import"./use-collections-BYKClwvP.js";import"./use-ai-providers-Dw8zktiy.js";import"./studio-tools-BJLBgOee.js";import"./use-organization-settings-D1CXb2Mk.js";import"./shell-layout-Cz9jaH1b.js";import"./avatar-DKl_SvPY.js";import"./required-auth-layout-CluuNdrt.js";import"./use-org-sso-BrX2nnoi.js";import"./sheet-CG7AqhVD.js";import"./integration-icon-CE7Y49fT.js";import"./use-navigate-to-agent-Cp82Pt97.js";import"./use-connection-BnTFSsXk.js";import"./use-mcp-prompts-Brfbccg_.js";import"./form-DyV_U4Fx.js";import"./label-A5aaknkU.js";import"./input-agFYfi3v.js";import"./select--NMtIJXa.js";import"./index-T5P3sRB3.js";import"./drawer-DSWLLvbj.js";import"./collection-search-9Z9J-flr.js";import"./tabs-DGpCIiez.js";import"./toggle-group-DRhh44eR.js";import"./sortable.esm-YhwgmY_a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cm-r3F3U.js";import"./use-registry-connections-DxwnrcKA.js";import"./useInfiniteQuery-Dd70hn1g.js";import"./use-infinite-scroll-10P3vgT3.js";import"./extract-connection-data-sR3PfR1q.js";import"./card-CCz6n2PT.js";import"./collection-tabs-BkVwtVd6.js";import"./badge-CPOFnH5f.js";import"./textarea-Dgff3Gg2.js";import"./connection-form-helpers-CzldBL3R.js";import"./authenticate-and-persist-oauth-DlE0FF2e.js";import"./mcp-oauth-BsM22i8Z.js";import"./useSuspenseInfiniteQuery-8qs6htsj.js";import"./connect-desktop-dialog-DhsRqyJo.js";import"./decopilot-CzHxKRA2.js";import"./checkbox-DXMAgfVg.js";import"./skeleton-sBC4lQNI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Cv3fX46A.js";import"./popover-DXCLs7Mh.js";import"./command-CD_UfdIZ.js";import"./index--rRbpAQ9.js";import"./dropdown-menu-B_-Um9OQ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-SD_W2P9L.js";import"./empty-state-Di1r-g_a.js";import"./toolbar-QoRJzy-G.js";import"./preview-dialog-DwVGd6qW.js";import"./index-BSpZjkyI.js";import"./use-mcp-tools-C3Vng-X-.js";import"./use-capability-DVHDSFWa.js";import"./shell-route-loading-DX7cr59C.js";import"./index-Dsuwnck-.js";import"./alert-dialog-DESqZhA2.js";import"./switch-V6piMM6A.js";import"./use-debounced-autosave-mT469Qcu.js";import"./index-DJPcb21Y.js";import"./sidebar-C8Zfra_F.js";import"./search-input-DBcneL-Z.js";import"./github-repo-picker-B4YgsSnm.js";import"./use-secrets-B-XWgN3K.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-XGoB5RsL.js";import"./automation-runs-irK0CDv6.js";import"./table-CO4yX7RA.js";import"./use-members-B81Cwsvd.js";import"./use-org-auth-client-C5HFWhiz.js";import"./task-status-CyBXqR4E.js";import"./use-automations-1dr86I_A.js";import"./use-file-configs-BY2cpVcw.js";import"./monaco-editor-CK4_aHmD.js";import"./select-model-B8wcKRbd.js";import"./automation-list-row-D2uPOFxN.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function vr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{vr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,D as L,b as T,r as $,B as M,w as N}from"./index-C5w7M3ak.js";import{s as D}from"./Plus-CdiQoMoJ.js";import{i as S}from"./Zap-5n0DTezT.js";import{S as q}from"./search-input-DBcneL-Z.js";import{P as l}from"./index-DJPcb21Y.js";import{E as b}from"./empty-state-Di1r-g_a.js";import{c as O}from"./use-automations-1dr86I_A.js";import{m as V}from"./use-navigate-to-agent-Cp82Pt97.js";import{A as F}from"./automation-list-row-D2uPOFxN.js";import{o as G}from"./use-mcp-client-Ci_r6Z9X.js";import{u as H}from"./use-virtual-mcp-C76Ypnz5.js";import{R as J}from"./require-capability-DyXOtXgQ.js";import"./SearchMd-D1HSgOeu.js";import"./sidebar-C8Zfra_F.js";import"./LayoutLeft-Fadct960.js";import"./use-mobile-COxfHS-K.js";import"./sheet-CG7AqhVD.js";import"./X-C-TqNtc2.js";import"./tooltip-CgNWIJOM.js";import"./studio-tools-BJLBgOee.js";import"./alert-dialog-DESqZhA2.js";import"./dropdown-menu-B_-Um9OQ.js";import"./ChevronUp-CADhYHt4.js";import"./ChevronRight-j760Iee-.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Trash01-BVvGX_KK.js";import"./agent-icon-Tlh3oNKM.js";import"./AlertCircle-D8nl7USt.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./Settings02-D-O2SNJf.js";import"./XCircle-DAqTWvWp.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./Users03-DwMxpPU3.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronDown-DXzUoD2e.js";import"./ChevronLeft-DopUTXew.js";import"./Eye-CQQama2s.js";import"./ZoomOut-VAm9p2Hl.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./auth-BR3aJLVt.js";import"./use-collections-BYKClwvP.js";import"./use-capability-DVHDSFWa.js";import"./access-gate-Bb0qjuIO.js";import"./capability-load-error-BULhLJ9o.js";function K(){const t=B.c(16),{org:i}=L(),{data:v}=O(void 0),u=v===void 0?[]:v,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(q,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const w=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(D,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==w?(s=o.jsxs(j.Body,{children:[r,w]}),t[6]=j.Body,t[7]=r,t[8]=w,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function io(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{io as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-C5w7M3ak.js";import{i as X}from"./XCircle-DAqTWvWp.js";import{ay as Y,U as T}from"./agent-icon-Tlh3oNKM.js";import{n as Z}from"./LinkExternal01-Dh2g8Xye.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as st,g as it}from"./alert-dialog-DESqZhA2.js";import{I as M}from"./input-agFYfi3v.js";import{L}from"./label-A5aaknkU.js";import{as as at,at as nt,aB as mt,au as R,aw as lt,aC as pt}from"./index-53LWl5CV.js";import{c as ct,B as dt,a as ut}from"./block-document-C_nFcvPT.js";import{u as gt,s as v,E as xt}from"./primitives-DHDblW6s.js";import{S as ht}from"./save-status-Dg-HdKmb.js";import{t as ft}from"./ChevronDown-DXzUoD2e.js";import{f as yt,h as jt,e as vt}from"./scroll-area-BFd5bzOG.js";import"./AlertCircle-D8nl7USt.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./Settings02-D-O2SNJf.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./Users03-DwMxpPU3.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronUp-CADhYHt4.js";import"./ChevronLeft-DopUTXew.js";import"./ChevronRight-j760Iee-.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Eye-CQQama2s.js";import"./ZoomOut-VAm9p2Hl.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LayoutLeft-Fadct960.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Plus-CdiQoMoJ.js";import"./SearchMd-D1HSgOeu.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Trash01-BVvGX_KK.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./X-C-TqNtc2.js";import"./Zap-5n0DTezT.js";import"./index-T5P3sRB3.js";import"./chat-context-C-somJSY.js";import"./hooks-B4h0KjiG.js";import"./use-mcp-client-Ci_r6Z9X.js";import"./auth-BR3aJLVt.js";import"./decopilot-sse-pool-9lyDYS1g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C76Ypnz5.js";import"./use-collections-BYKClwvP.js";import"./use-ai-providers-Dw8zktiy.js";import"./studio-tools-BJLBgOee.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-D1CXb2Mk.js";import"./tooltip-CgNWIJOM.js";import"./dialog-BYnY80tb.js";import"./drawer-DSWLLvbj.js";import"./collection-search-9Z9J-flr.js";import"./use-mobile-COxfHS-K.js";import"./use-mcp-prompts-Brfbccg_.js";import"./shell-layout-Cz9jaH1b.js";import"./avatar-DKl_SvPY.js";import"./required-auth-layout-CluuNdrt.js";import"./use-org-sso-BrX2nnoi.js";import"./form-DyV_U4Fx.js";import"./select--NMtIJXa.js";import"./tabs-DGpCIiez.js";import"./toggle-group-DRhh44eR.js";import"./sortable.esm-YhwgmY_a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cm-r3F3U.js";import"./use-registry-connections-DxwnrcKA.js";import"./use-connection-BnTFSsXk.js";import"./useInfiniteQuery-Dd70hn1g.js";import"./use-infinite-scroll-10P3vgT3.js";import"./extract-connection-data-sR3PfR1q.js";import"./card-CCz6n2PT.js";import"./integration-icon-CE7Y49fT.js";import"./collection-tabs-BkVwtVd6.js";import"./badge-CPOFnH5f.js";import"./textarea-Dgff3Gg2.js";import"./connection-form-helpers-CzldBL3R.js";import"./authenticate-and-persist-oauth-DlE0FF2e.js";import"./mcp-oauth-BsM22i8Z.js";import"./useSuspenseInfiniteQuery-8qs6htsj.js";import"./connect-desktop-dialog-DhsRqyJo.js";import"./decopilot-CzHxKRA2.js";import"./checkbox-DXMAgfVg.js";import"./skeleton-sBC4lQNI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Cv3fX46A.js";import"./popover-DXCLs7Mh.js";import"./command-CD_UfdIZ.js";import"./index--rRbpAQ9.js";import"./dropdown-menu-B_-Um9OQ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-SD_W2P9L.js";import"./empty-state-Di1r-g_a.js";import"./toolbar-QoRJzy-G.js";import"./preview-dialog-DwVGd6qW.js";import"./index-BSpZjkyI.js";import"./file-type-icon-MmuXAAgi.js";import"./use-mcp-tools-C3Vng-X-.js";import"./types-CXz6VYrK.js";import"./use-capability-DVHDSFWa.js";import"./shell-route-loading-DX7cr59C.js";import"./index-Dsuwnck-.js";import"./switch-V6piMM6A.js";import"./use-debounced-autosave-mT469Qcu.js";import"./index-DJPcb21Y.js";import"./sidebar-C8Zfra_F.js";import"./sheet-CG7AqhVD.js";import"./search-input-DBcneL-Z.js";import"./github-repo-picker-B4YgsSnm.js";import"./use-navigate-to-agent-Cp82Pt97.js";import"./use-secrets-B-XWgN3K.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-XGoB5RsL.js";import"./automation-runs-irK0CDv6.js";import"./table-CO4yX7RA.js";import"./use-members-B81Cwsvd.js";import"./use-org-auth-client-C5HFWhiz.js";import"./task-status-CyBXqR4E.js";import"./use-automations-1dr86I_A.js";import"./use-file-configs-BY2cpVcw.js";import"./monaco-editor-CK4_aHmD.js";import"./select-model-B8wcKRbd.js";import"./automation-list-row-D2uPOFxN.js";import"./use-clock-tick-CmvqvAhs.js";import"./use-copy-Cz-l8dwG.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=q.c(18),{icon:f,title:m,defaultOpen:b,children:u}=k,D=b===void 0?!1:b,[h,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let s;e[2]!==m?(s=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=s):s=e[3];const y=h&&"rotate-180";let r;e[4]!==y?(r=Q("transition-transform",y),e[4]=y,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ft,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==s||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,s,p]})}),e[8]=l,e[9]=s,e[10]=p,e[11]=c):c=e[11];let i;e[12]!==u?(i=t.jsx(jt,{className:"px-2 pt-4",children:u}),e[12]=u,e[13]=i):i=e[13];let g;return e[14]!==h||e[15]!==c||e[16]!==i?(g=t.jsxs(vt,{open:h,onOpenChange:A,className:"mt-4",children:[c,i]}),e[14]=h,e[15]=c,e[16]=i,e[17]=g):g=e[17],g}function rr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:u,meta:D,onManagePosts:h,onOpenPost:A,previewBaseUrl:l}){const s=at({orgSlug:k,virtualMcpId:e,branch:f}),y=nt(b,"categories"),[r,p,c]=gt(y,o=>{s.mutate({blockKey:m,data:R(m,"categories",o)})}),i=(o,w)=>p({...r,[o]:w}),g=ct({decofile:u,category:r,previewBaseUrl:l}),a=v(r.slug),[B,j]=S.useState(a),[n,C]=S.useState(null),[N,$]=S.useState(!1),z=a?mt(u).filter(o=>o.categorySlugs.includes(a)):[],d=z.length,G=o=>i("slug",o),H=async(o,w)=>{const W=v(r.name);$(!0);try{let x=0;for(const{key:O,payload:P}of lt(u,"posts")){const F=pt(P,o,{name:W,slug:w});F!==P&&(await s.mutateAsync({blockKey:O,data:R(O,"posts",F)}),x+=1)}const E={...r,slug:w};await s.mutateAsync({blockKey:m,data:R(m,"categories",E)}),c(E),I.success(x>0?`Renamed slug and updated ${x} ${x===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(x){j(o),C(null),I.error(x instanceof Error?x.message:"Rename failed")}finally{$(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&j(o);return}if(!o){j(a);return}if(d===0){G(o);return}C({oldSlug:a,newSlug:o,count:d})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(ht,{isPending:s.isPending,isError:s.isError}),g&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(g,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(xt,{value:v(r.name),onChange:o=>i("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>j(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>i("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(dt,{value:ut(r.sections),onChange:o=>i("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[d," ",d===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?d===0?"Go to the posts list to add posts to this category":"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts",onClick:()=>h(d===0?"":a),children:[d===0?"Add posts":"Manage posts",t.jsx(X,{size:14})]})]}),d>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(st,{disabled:N,children:"Cancel"}),t.jsx(it,{onClick:o=>{o.preventDefault(),n&&H(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{rr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as X,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as V,bg as Ye,u as Xe,G,t as Ze,e as ae,b2 as ke}from"./index-C5w7M3ak.js";import{E as Ee}from"./empty-state-Di1r-g_a.js";import{u as et,a as Ae}from"./use-collections-BYKClwvP.js";import{u as ce}from"./use-mcp-client-Ci_r6Z9X.js";import{F as ne,a as tt,b as de,d as me}from"./form-DyV_U4Fx.js";import{I as ue}from"./input-agFYfi3v.js";import{T as re}from"./textarea-Dgff3Gg2.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CfIbeCCb.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-Tlh3oNKM.js";import{g as ut,M as xt,a as Ne}from"./types-CXz6VYrK.js";import{A as pt,a as ft,b as ht}from"./alert-19iuIUZ1.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select--NMtIJXa.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-CgNWIJOM.js";import{i as jt}from"./AlertCircle-D8nl7USt.js";import{s as bt}from"./Stars02-BUidkUMX.js";import{a as Nt}from"./Eye-CQQama2s.js";import{i as vt}from"./Play-CfbRRa8r.js";import{i as St}from"./ChevronRight-j760Iee-.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-Dsuwnck-.js";import{a as Oe,u as Re}from"./use-connection-BnTFSsXk.js";import{a as It}from"./use-mcp-tools-C3Vng-X-.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-CE7Y49fT.js";import{f as Tt,h as Pt}from"./chat-context-C-somJSY.js";import{b as kt}from"./shell-layout-Cz9jaH1b.js";import{M as Et}from"./monaco-editor-CK4_aHmD.js";import{n as At}from"./XCircle-DAqTWvWp.js";import"./auth-BR3aJLVt.js";import"./label-A5aaknkU.js";import"./index-DJPcb21Y.js";import"./sidebar-C8Zfra_F.js";import"./LayoutLeft-Fadct960.js";import"./use-mobile-COxfHS-K.js";import"./sheet-CG7AqhVD.js";import"./X-C-TqNtc2.js";import"./ZoomOut-VAm9p2Hl.js";import"./Key01-BAEB0MKB.js";import"./extract-connection-data-sR3PfR1q.js";import"./use-registry-connections-DxwnrcKA.js";import"./use-organization-settings-D1CXb2Mk.js";import"./studio-tools-BJLBgOee.js";import"./Plus-CdiQoMoJ.js";import"./index-Cx9raLNH.js";import"./index--rRbpAQ9.js";import"./popover-DXCLs7Mh.js";import"./use-virtual-mcp-C76Ypnz5.js";import"./ChevronUp-CADhYHt4.js";import"./SearchMd-D1HSgOeu.js";import"./Users03-DwMxpPU3.js";import"./use-create-virtual-mcp-Dc3lK-qn.js";import"./use-navigate-to-agent-Cp82Pt97.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./Settings02-D-O2SNJf.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronDown-DXzUoD2e.js";import"./ChevronLeft-DopUTXew.js";import"./DotsVertical-AD-a2Knc.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Trash01-BVvGX_KK.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./Zap-5n0DTezT.js";import"./mcp-oauth-BsM22i8Z.js";import"./badge-CPOFnH5f.js";import"./hooks-B4h0KjiG.js";import"./decopilot-sse-pool-9lyDYS1g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Dw8zktiy.js";import"./tab-id-BptcWVWa.js";import"./avatar-DKl_SvPY.js";import"./dialog-BYnY80tb.js";import"./required-auth-layout-CluuNdrt.js";import"./use-org-sso-BrX2nnoi.js";import"./index-BSpZjkyI.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Mt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const je=Number(h[M]);Number.isNaN(je)||(h[M]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(Me,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(Me,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Dn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Dn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,r as D,l as Z,j as n,B as H,m as ut,d as ke,K as W,o as He,s as ue,n as Be,p as Ge,i as ft,k as pt,q as me,Q as gt,E as ht,a as Oe,u as xt,v as Ot,w as Ut,b as yt,x as At,y as vt,L as Rt}from"./index-C5w7M3ak.js";import{A as Pt}from"./auth-entry-WLY89UlS.js";import{A as $t}from"./auth-split-layout-D8MR1i_O.js";import{O as at}from"./organization-choice-BtKnPkHP.js";import{f as Lt}from"./tab-id-BptcWVWa.js";import{I as Ue}from"./input-agFYfi3v.js";import{u as Ae,W as bt,S as jt,g as zt,C as Dt}from"./use-mcp-client-Ci_r6Z9X.js";import{i as Ct}from"./XCircle-DAqTWvWp.js";import{I as St}from"./integration-icon-CE7Y49fT.js";import{D as Qe,a as Kt,b as Mt,c as Ft,d as qt,e as Vt}from"./dialog-BYnY80tb.js";import{T as Ht,a as Bt,b as Gt}from"./tooltip-CgNWIJOM.js";import{i as We}from"./CheckCircle-yOjX9PZe.js";import{i as Qt}from"./ZoomOut-VAm9p2Hl.js";import{g as Wt,c as Yt,e as Jt}from"./extract-connection-data-sR3PfR1q.js";import{F as fe,a as Ye,b as pe,c as Ke,d as ge,e as he}from"./form-DyV_U4Fx.js";import{i as Zt}from"./ChevronUp-CADhYHt4.js";import{s as Xt,a as en}from"./Eye-CQQama2s.js";import{i as tn}from"./Settings02-D-O2SNJf.js";import{i as nn}from"./agent-icon-Tlh3oNKM.js";import{u as sn}from"./useSuspenseQueries-CT-DHsCI.js";import{a as on}from"./authenticate-and-persist-oauth-DlE0FF2e.js";import{i as Nt}from"./ArrowUpRight-DgG9Xs3P.js";import{s as _t}from"./User01-CaU7xtcd.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DKl_SvPY.js";import"./auth-BR3aJLVt.js";import"./X-C-TqNtc2.js";import"./label-A5aaknkU.js";import"./AlertCircle-D8nl7USt.js";import"./Tool01-Dt-TbXDn.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./ZapSquare-DD_XuIyF.js";import"./Users03-DwMxpPU3.js";import"./ChevronDown-DXzUoD2e.js";import"./ChevronLeft-DopUTXew.js";import"./ChevronRight-j760Iee-.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LayoutLeft-Fadct960.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Plus-CdiQoMoJ.js";import"./SearchMd-D1HSgOeu.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Trash01-BVvGX_KK.js";import"./Upload01-Prj9a2xY.js";import"./Users01-BRnzISUs.js";import"./XClose-DlK2hm1P.js";import"./Zap-5n0DTezT.js";import"./mcp-oauth-BsM22i8Z.js";const rn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,an=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,ln=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,cn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=rn.test(e),s=an.test(e),o=ln.test(e);if(t&&!s&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=s?e:`https://${e}`;let r;try{r=new URL(l)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=r.hostname.split(".");return c.length<2||c.some(a=>!a||!cn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Fe(i){const e=k.c(14),{children:t,className:s,wrapperClassName:o}=i,[l,r]=D.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=j=>{if(!j)return;const x=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};x(),j.addEventListener("scroll",x,{passive:!0});const g=new ResizeObserver(x);g.observe(j);for(const m of Array.from(j.children))g.observe(m);return()=>{j.removeEventListener("scroll",x),g.disconnect()}},e[0]=c):c=e[0];const a=c;let u;e[1]!==o?(u=Z("relative",o),e[1]=o,e[2]=u):u=e[2];let f;e[3]!==t||e[4]!==s?(f=n.jsx("div",{ref:a,className:s,children:t}),e[3]=t,e[4]=s,e[5]=f):f=e[5];const p=l?"opacity-0":"opacity-100";let d;e[6]!==p?(d=Z("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=d):d=e[7];let h;e[8]!==d?(h=n.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let v;return e[10]!==u||e[11]!==f||e[12]!==h?(v=n.jsxs("div",{className:u,children:[f,h]}),e[10]=u,e[11]=f,e[12]=h,e[13]=v):v=e[13],v}function dn(i){const e=i.properties;if(!e)return[];const t=[];for(const[s,o]of Object.entries(e)){const c=o?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:s,bindingType:c})}return t}function mn(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function J(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function un(i,e,t,s){return{...i??{},[e]:{__type:t,value:s}}}function qe(i){return i==null?!1:typeof i=="string"?i.trim().length>0:typeof i=="number"||typeof i=="boolean"?!0:Array.isArray(i)?i.some(qe):typeof i=="object"?Object.entries(i).some(([e,t])=>!e.startsWith("__")&&qe(t)):!1}function fn(i){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[i]?e[i]:i.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function pn(i){return qe(i)?typeof i=="string"?i.trim():typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i):null}function gn(i){return i?Object.entries(i).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=pn(t);return s?[{key:e,label:fn(e),value:s}]:[]}):[]}function hn({autoOpenFieldKey:i,card:e}){return i===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function xn(i,e,t){const s=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return s.length===0?null:(s.sort((o,l)=>{const r=c=>c.status==="active"?0:1;return r(o)!==r(l)?r(o)-r(l):(l.updated_at??"").localeCompare(o.updated_at??"")}),s[0].id)}function yn(i){return i.server?.icons?.[0]?.src??Wt(i.server?.repository)??null}function vn(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function bn(i){const e=[],t=new Map(i.connections.map(s=>[s.id,s]));for(const s of i.requirements){const o=i.curated[s.bindingType],l=o?i.itemsById[o.registryAppId]:i.itemsByName[s.bindingType];if(!l)continue;const r=i.configurationState?.[s.fieldKey]?.value,c=r?t.get(r):void 0,a=r&&c?r:null,u=a?i.connectionReadiness?.[a]!==!1:!1,f=!!a&&u;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:l,title:vn(l,s.bindingType),icon:yn(l),headline:o?.headline??l._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||xn(i.connections,s.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:c?.configuration_state??null})}return e}function jn(i,e){if(!i)return null;const t=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},s=t(i);for(const o of e)if(t(o.siteUrl)===s)return o.siteUrl;return null}function Cn(i){return(i?.response?.accountSummaries??[]).map(s=>({account:s.account,options:(s.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${s.displayName})`}))}))}function lt(i){const e=k.c(38);let t,s,o,l,r;e[0]!==i?({value:r,onChange:s,placeholder:o,className:t,...l}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const[c,a]=D.useState(!1),[u,f]=D.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch($){console.error("Failed to copy text: ",$)}},e[6]=r,e[7]=p):p=e[7];const d=p;let h;e[8]!==c?(h=()=>{a(!c)},e[8]=c,e[9]=h):h=e[9];const v=h,j=c?"text":"password";let x;e[10]!==t?(x=Z("pr-20",t),e[10]=t,e[11]=x):x=e[11];let g;e[12]!==s||e[13]!==o||e[14]!==l||e[15]!==j||e[16]!==x||e[17]!==r?(g=n.jsx(Ue,{type:j,value:r,onChange:s,placeholder:o,className:x,...l}),e[12]=s,e[13]=o,e[14]=l,e[15]=j,e[16]=x,e[17]=r,e[18]=g):g=e[18];const m=c?"Hide password":"Show password";let b;e[19]!==c?(b=c?n.jsx(tn,{size:16}):n.jsx(Xt,{size:16}),e[19]=c,e[20]=b):b=e[20];let y;e[21]!==m||e[22]!==b||e[23]!==v?(y=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:v,title:m,children:b}),e[21]=m,e[22]=b,e[23]=v,e[24]=y):y=e[24];const S=!r,_=u?"Copied!":"Copy token";let N;e[25]!==u?(N=u?n.jsx(Zt,{size:16}):n.jsx(en,{size:16}),e[25]=u,e[26]=N):N=e[26];let w;e[27]!==d||e[28]!==_||e[29]!==N||e[30]!==S?(w=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:S,title:_,children:N}),e[27]=d,e[28]=_,e[29]=N,e[30]=S,e[31]=w):w=e[31];let E;e[32]!==w||e[33]!==y?(E=n.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[y,w]}),e[32]=w,e[33]=y,e[34]=E):E=e[34];let I;return e[35]!==E||e[36]!==g?(I=n.jsxs("div",{className:"relative",children:[g,E]}),e[35]=E,e[36]=g,e[37]=I):I=e[37],I}function Je(i){const e=k.c(19),{card:t,selfClient:s,org:o,onDone:l,onError:r}=i,c=ut();let a;e[0]!==t||e[1]!==s?(a=async x=>{const g={...t.configurationState??{},...x};await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:g}}})},e[0]=t,e[1]=s,e[2]=a):a=e[2];let u;e[3]!==l||e[4]!==o||e[5]!==c?(u=async()=>{await c.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),l()},e[3]=l,e[4]=o,e[5]=c,e[6]=u):u=e[6];let f;e[7]!==r?(f=x=>{r?.(x)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==u||e[11]!==f?(p={mutationFn:a,onSuccess:u,onError:f},e[9]=a,e[10]=u,e[11]=f,e[12]=p):p=e[12];const d=ke(p);let h;e[13]!==d?(h=x=>d.mutate(x),e[13]=d,e[14]=h):h=e[14];const v=h;let j;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==v?(j={save:v,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=v,e[18]=j):j=e[18],j}const Sn=He({accountName:ue().min(1,"Informe o nome da conta"),appKey:ue().optional(),appToken:ue().optional()});function Nn(i){const e=k.c(63),{card:t,selfClient:s,org:o,onDone:l,onIsPendingChange:r}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Be(Sn),e[0]=c):c=e[0];const a=t.configurationState?.accountName||"",u=t.configurationState?.appKey||"",f=t.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==u||e[3]!==f?(p={resolver:c,defaultValues:{accountName:a,appKey:u,appToken:f}},e[1]=a,e[2]=u,e[3]=f,e[4]=p):p=e[4];const d=Ge(p);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==d?(h=()=>{d.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=d,e[9]=h):h=e[9];let v;e[10]!==t.configurationState||e[11]!==d?(v=[t.configurationState,d],e[10]=t.configurationState,e[11]=d,e[12]=v):v=e[12],D.useEffect(h,v);let j;e[13]!==t||e[14]!==l||e[15]!==o||e[16]!==s?(j={card:t,selfClient:s,org:o,onDone:l},e[13]=t,e[14]=l,e[15]=o,e[16]=s,e[17]=j):j=e[17];const{save:x,isPending:g,error:m}=Je(j);let b,y;e[18]!==g||e[19]!==r?(y=()=>{r?.(g)},b=[g,r],e[18]=g,e[19]=r,e[20]=b,e[21]=y):(b=e[20],y=e[21]),D.useEffect(y,b);let S;if(e[22]!==d||e[23]!==x){let K;e[25]!==x?(K=async C=>{x(C)},e[25]=x,e[26]=K):K=e[26],S=d.handleSubmit(K),e[22]=d,e[23]=x,e[24]=S}else S=e[24];const _=S;let N;e[27]!==g?(N=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"Nome da conta"}),n.jsx(ge,{children:n.jsx(Ue,{placeholder:"Nome da sua conta VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[27]=g,e[28]=N):N=e[28];let w;e[29]!==d.control||e[30]!==N?(w=n.jsx(fe,{control:d.control,name:"accountName",render:N}),e[29]=d.control,e[30]=N,e[31]=w):w=e[31];let E;e[32]!==g?(E=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Key (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Key da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[32]=g,e[33]=E):E=e[33];let I;e[34]!==d.control||e[35]!==E?(I=n.jsx(fe,{control:d.control,name:"appKey",render:E}),e[34]=d.control,e[35]=E,e[36]=I):I=e[36];let $;e[37]!==g?($=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Token (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Token da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[37]=g,e[38]=$):$=e[38];let O;e[39]!==d.control||e[40]!==$?(O=n.jsx(fe,{control:d.control,name:"appToken",render:$}),e[39]=d.control,e[40]=$,e[41]=O):O=e[41];let T;e[42]!==d||e[43]!==w||e[44]!==I||e[45]!==O?(T=n.jsxs(Ye,{...d,children:[w,I,O]}),e[42]=d,e[43]=w,e[44]=I,e[45]=O,e[46]=T):T=e[46];let U;e[47]!==m?(U=m&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Não foi possível salvar a configuração"}),e[47]=m,e[48]=U):U=e[48];let P;e[49]!==g||e[50]!==l?(P=n.jsx(H,{type:"button",variant:"outline",onClick:l,disabled:g,children:"Cancelar"}),e[49]=g,e[50]=l,e[51]=P):P=e[51];const M=g?"Salvando...":"Salvar";let q;e[52]!==g||e[53]!==M?(q=n.jsx(H,{type:"submit",disabled:g,children:M}),e[52]=g,e[53]=M,e[54]=q):q=e[54];let z;e[55]!==P||e[56]!==q?(z=n.jsxs(Qe,{className:"pt-4",children:[P,q]}),e[55]=P,e[56]=q,e[57]=z):z=e[57];let F;return e[58]!==_||e[59]!==T||e[60]!==U||e[61]!==z?(F=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[T,U,z]}),e[58]=_,e[59]=T,e[60]=U,e[61]=z,e[62]=F):F=e[62],F}function Et(i){const e=k.c(30),{options:t,value:s,onChange:o,disabled:l,ariaLabel:r,searchPlaceholder:c}=i,a=c===void 0?"Buscar...":c,[u,f]=D.useState("");let p,d,h;if(e[0]!==t||e[1]!==u||e[2]!==s){const w=u.trim().toLowerCase();p=w?t.filter(E=>E.label.toLowerCase().includes(w)):t,d=p.map(_n),h=d.includes(s)?s:d[0]??"",e[0]=t,e[1]=u,e[2]=s,e[3]=p,e[4]=d,e[5]=h}else p=e[3],d=e[4],h=e[5];const v=h;let j;e[6]!==l||e[7]!==d||e[8]!==o?(j=function(E){if(l||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(E.key))return;E.preventDefault();const $=E.currentTarget.dataset.value,O=d.indexOf($),T=d.length;if(T===0)return;let U;E.key==="ArrowDown"||E.key==="ArrowRight"?U=(O+1)%T:E.key==="ArrowUp"||E.key==="ArrowLeft"?U=(O-1+T)%T:E.key==="Home"?U=0:U=T-1;const P=d[U];o(P),E.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(P)}"]`)?.focus()},e[6]=l,e[7]=d,e[8]=o,e[9]=j):j=e[9];const x=j;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(nn,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=g):g=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=w=>f(w.target.value),e[11]=m):m=e[11];const b=`Buscar ${r}`;let y;e[12]!==l||e[13]!==u||e[14]!==a||e[15]!==b?(y=n.jsxs("div",{className:"relative",children:[g,n.jsx(Ue,{type:"text",value:u,onChange:m,disabled:l,placeholder:a,"aria-label":b,className:"h-8 pl-8"})]}),e[12]=l,e[13]=u,e[14]=a,e[15]=b,e[16]=y):y=e[16];let S;e[17]!==l||e[18]!==p||e[19]!==x||e[20]!==o||e[21]!==v||e[22]!==s?(S=p.length===0?n.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):p.map(w=>{const E=w.value===s;return n.jsxs("button",{type:"button",role:"radio","aria-checked":E,disabled:l,"data-value":w.value,tabIndex:w.value===v?0:-1,onClick:()=>o(w.value),onKeyDown:x,className:Z("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",E?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[n.jsx("span",{className:"truncate",children:w.label}),E?n.jsx(We,{size:16,className:"shrink-0 text-primary"}):null]},w.value)}),e[17]=l,e[18]=p,e[19]=x,e[20]=o,e[21]=v,e[22]=s,e[23]=S):S=e[23];let _;e[24]!==r||e[25]!==S?(_=n.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:S}),e[24]=r,e[25]=S,e[26]=_):_=e[26];let N;return e[27]!==y||e[28]!==_?(N=n.jsxs("div",{className:"space-y-2",children:[y,_]}),e[27]=y,e[28]=_,e[29]=N):N=e[29],N}function _n(i){return i.value}function Ze(i){const e=k.c(16),{label:t,iconSize:s,className:o,iconClassName:l,labelClassName:r}=i,c=s===void 0?14:s;let a;e[0]!==o?(a=Z("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let u;e[2]!==l?(u=Z("shrink-0 animate-spin",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==c||e[5]!==u?(f=n.jsx(ft,{size:c,className:u}),e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==r?(p=Z("text-sm",r),e[7]=r,e[8]=p):p=e[8];let d;e[9]!==t||e[10]!==p?(d=n.jsx("span",{className:p,children:t}),e[9]=t,e[10]=p,e[11]=d):d=e[11];let h;return e[12]!==a||e[13]!==f||e[14]!==d?(h=n.jsxs("span",{className:a,children:[f,d]}),e[12]=a,e[13]=f,e[14]=d,e[15]=h):h=e[15],h}const En=He({propertyId:ue().min(1,"Selecione uma propriedade")});function wn(i){const e=k.c(55),{card:t,connectionId:s,companionClient:o,selfClient:l,org:r,onDone:c,onIsPendingChange:a}=i;let u;e[0]!==s||e[1]!==r.id?(u=W.commerceDiscoveryCompanionGaProperties(r.id,s),e[0]=s,e[1]=r.id,e[2]=u):u=e[2];let f;e[3]!==o?(f=async()=>{const C=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(C);return Cn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==u||e[6]!==f?(p={queryKey:u,queryFn:f},e[5]=u,e[6]=f,e[7]=p):p=e[7];const d=pt(p);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Be(En),e[8]=h):h=e[8];const v=t.configurationState?.propertyId||"";let j;e[9]!==v?(j={resolver:h,defaultValues:{propertyId:v}},e[9]=v,e[10]=j):j=e[10];const x=Ge(j);let g;e[11]!==t||e[12]!==c||e[13]!==r||e[14]!==l?(g={card:t,selfClient:l,org:r,onDone:c},e[11]=t,e[12]=c,e[13]=r,e[14]=l,e[15]=g):g=e[15];const{save:m,isPending:b,error:y}=Je(g);let S,_;e[16]!==b||e[17]!==a?(S=()=>{a?.(b)},_=[b,a],e[16]=b,e[17]=a,e[18]=S,e[19]=_):(S=e[18],_=e[19]),D.useEffect(S,_);let N;if(e[20]!==x||e[21]!==m){let C;e[23]!==m?(C=async L=>{m(L)},e[23]=m,e[24]=C):C=e[24],N=x.handleSubmit(C),e[20]=x,e[21]=m,e[22]=N}else N=e[22];const w=N;if(d.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando propriedades..."})}),e[25]=C):C=e[25],C}if(d.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=C):C=e[26],C}let E;e[27]!==d.data?(E=d.data||[],e[27]=d.data,e[28]=E):E=e[28];const I=E;if(I.flatMap(In).length===0){let C;return e[29]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."})}),e[29]=C):C=e[29],C}let O;e[30]!==b||e[31]!==I?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(Et,{options:I.flatMap(Tn),value:L.value,onChange:L.onChange,disabled:b,ariaLabel:"Propriedade do Google Analytics"})}),n.jsx(he,{})]})},e[30]=b,e[31]=I,e[32]=O):O=e[32];let T;e[33]!==x.control||e[34]!==O?(T=n.jsx(fe,{control:x.control,name:"propertyId",render:O}),e[33]=x.control,e[34]=O,e[35]=T):T=e[35];let U;e[36]!==x||e[37]!==T?(U=n.jsx(Ye,{...x,children:T}),e[36]=x,e[37]=T,e[38]=U):U=e[38];let P;e[39]!==y?(P=y&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[39]=y,e[40]=P):P=e[40];let M;e[41]!==b||e[42]!==c?(M=n.jsx(H,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancelar"}),e[41]=b,e[42]=c,e[43]=M):M=e[43];const q=b?"Salvando...":"Salvar";let z;e[44]!==b||e[45]!==q?(z=n.jsx(H,{type:"submit",disabled:b,children:q}),e[44]=b,e[45]=q,e[46]=z):z=e[46];let F;e[47]!==M||e[48]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[47]=M,e[48]=z,e[49]=F):F=e[49];let K;return e[50]!==w||e[51]!==U||e[52]!==P||e[53]!==F?(K=n.jsxs("form",{onSubmit:w,className:"space-y-4",children:[U,P,F]}),e[50]=w,e[51]=U,e[52]=P,e[53]=F,e[54]=K):K=e[54],K}function Tn(i){return i.options}function In(i){return i.options}const kn=He({siteUrl:ue().min(1,"Selecione um site")});function On(i){const e=k.c(59),{card:t,connectionId:s,companionClient:o,selfClient:l,org:r,contextSiteUrl:c,onDone:a,onIsPendingChange:u}=i;let f;e[0]!==s||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,s),e[0]=s,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const C=await o.callTool({name:"list_sites",arguments:{}});return J(C).sites||[]},e[3]=o,e[4]=p):p=e[4];let d;e[5]!==f||e[6]!==p?(d={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=d):d=e[7];const h=pt(d);let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=Be(kn),e[8]=v):v=e[8];const j=t.configurationState?.siteUrl||"";let x;e[9]!==j?(x={resolver:v,defaultValues:{siteUrl:j}},e[9]=j,e[10]=x):x=e[10];const g=Ge(x);let m;e[11]!==t||e[12]!==a||e[13]!==r||e[14]!==l?(m={card:t,selfClient:l,org:r,onDone:a},e[11]=t,e[12]=a,e[13]=r,e[14]=l,e[15]=m):m=e[15];const{save:b,isPending:y,error:S}=Je(m);let _,N;e[16]!==y||e[17]!==u?(_=()=>{u?.(y)},N=[y,u],e[16]=y,e[17]=u,e[18]=_,e[19]=N):(_=e[18],N=e[19]),D.useEffect(_,N);let w;if(e[20]!==g||e[21]!==b){let C;e[23]!==b?(C=async L=>{b(L)},e[23]=b,e[24]=C):C=e[24],w=g.handleSubmit(C),e[20]=g,e[21]=b,e[22]=w}else w=e[22];const E=w;if(h.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando sites..."})}),e[25]=C):C=e[25],C}if(h.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=C):C=e[26],C}let I,$;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==g||e[30]!==h.data){$=Symbol.for("react.early_return_sentinel");e:{if(I=h.data||[],I.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=L):L=e[33],$=L;break e}const C=t.configurationState?.siteUrl;if(C&&g.getValues("siteUrl")!==C)g.setValue("siteUrl",C);else if(!C&&!g.getValues("siteUrl")){const L=jn(c,I);L&&g.setValue("siteUrl",L)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=g,e[30]=h.data,e[31]=I,e[32]=$}else I=e[31],$=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let O;e[34]!==y||e[35]!==I?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(Et,{options:I.map(Un),value:L.value,onChange:L.onChange,disabled:y,ariaLabel:"Site verificado"})}),n.jsx(he,{})]})},e[34]=y,e[35]=I,e[36]=O):O=e[36];let T;e[37]!==g.control||e[38]!==O?(T=n.jsx(fe,{control:g.control,name:"siteUrl",render:O}),e[37]=g.control,e[38]=O,e[39]=T):T=e[39];let U;e[40]!==g||e[41]!==T?(U=n.jsx(Ye,{...g,children:T}),e[40]=g,e[41]=T,e[42]=U):U=e[42];let P;e[43]!==S?(P=S&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:"Não foi possível salvar a configuração"}),e[43]=S,e[44]=P):P=e[44];let M;e[45]!==y||e[46]!==a?(M=n.jsx(H,{type:"button",variant:"outline",onClick:a,disabled:y,children:"Cancelar"}),e[45]=y,e[46]=a,e[47]=M):M=e[47];const q=y?"Salvando...":"Salvar";let z;e[48]!==y||e[49]!==q?(z=n.jsx(H,{type:"submit",disabled:y,children:q}),e[48]=y,e[49]=q,e[50]=z):z=e[50];let F;e[51]!==M||e[52]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[51]=M,e[52]=z,e[53]=F):F=e[53];let K;return e[54]!==E||e[55]!==U||e[56]!==P||e[57]!==F?(K=n.jsxs("form",{onSubmit:E,className:"space-y-4",children:[U,P,F]}),e[54]=E,e[55]=U,e[56]=P,e[57]=F,e[58]=K):K=e[58],K}function Un(i){return{value:i.siteUrl,label:i.siteUrl}}const An={vtex:Nn,"google-analytics":wn,"google-search-console":On};function Rn(){const i=k.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let s;return i[2]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=s):s=i[2],s}function Ve(i){const e=k.c(3),{children:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{size:14,className:"shrink-0 text-blue-500"}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=n.jsxs("div",{className:"flex items-center gap-2 p-1",children:[s,n.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function Pn(i){const e=k.c(45),{card:t,connecting:s,disabled:o,onConnect:l,org:r,selfClient:c,siteUrl:a,autoOpenConfigFieldKey:u,onAutoOpenConfigHandled:f}=i,p=t.linkedConnectionId;let d;e[0]!==t.configurationState?(d=gn(t.configurationState),e[0]=t.configurationState,e[1]=d):d=e[1];const h=d;let v;e[2]!==t.icon||e[3]!==t.title?(v=n.jsx(St,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=t.icon,e[3]=t.title,e[4]=v):v=e[4];let j;e[5]!==t.title?(j=n.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[5]=t.title,e[6]=j):j=e[6];let x;e[7]!==t.satisfied||e[8]!==t.title||e[9]!==s||e[10]!==o||e[11]!==l?(x=t.satisfied?n.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[n.jsx(We,{size:16})," Conectado"]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",disabled:o||s,onClick:l,"aria-label":`Conectar ${t.title}`,children:s?n.jsx(ft,{size:16,className:"animate-spin"}):"Conectar"}),e[7]=t.satisfied,e[8]=t.title,e[9]=s,e[10]=o,e[11]=l,e[12]=x):x=e[12];let g;e[13]!==v||e[14]!==j||e[15]!==x?(g=n.jsxs("div",{className:"flex items-center gap-2",children:[v,j,x]}),e[13]=v,e[14]=j,e[15]=x,e[16]=g):g=e[16];let m;e[17]!==t.checks?(m=t.checks!==null&&n.jsxs(Ve,{children:["+ ",t.checks," verificações"]}),e[17]=t.checks,e[18]=m):m=e[18];let b;e[19]!==t.headline?(b=t.headline&&n.jsx(Ve,{children:t.headline}),e[19]=t.headline,e[20]=b):b=e[20];let y;e[21]!==t.bullets?(y=t.bullets.map($n),e[21]=t.bullets,e[22]=y):y=e[22];let S;e[23]!==t.candidateConnectionId||e[24]!==t.satisfied||e[25]!==t.title?(S=!t.satisfied&&t.candidateConnectionId&&n.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Usando sua conexão existente de ",t.title]}),e[23]=t.candidateConnectionId,e[24]=t.satisfied,e[25]=t.title,e[26]=S):S=e[26];let _;e[27]!==m||e[28]!==b||e[29]!==y||e[30]!==S?(_=n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[m,b,y,S]}),e[27]=m,e[28]=b,e[29]=y,e[30]=S,e[31]=_):_=e[31];let N;e[32]!==u||e[33]!==t||e[34]!==p||e[35]!==f||e[36]!==r||e[37]!==h||e[38]!==c||e[39]!==a?(N=t.satisfied&&p&&n.jsx(D.Suspense,{fallback:n.jsx(Dn,{}),children:n.jsx(Kn,{card:t,org:r,selfClient:c,connectionId:p,savedConfigEntries:h,contextSiteUrl:a,autoOpen:hn({autoOpenFieldKey:u,card:t}),onAutoOpenHandled:f})}),e[32]=u,e[33]=t,e[34]=p,e[35]=f,e[36]=r,e[37]=h,e[38]=c,e[39]=a,e[40]=N):N=e[40];let w;return e[41]!==_||e[42]!==N||e[43]!==g?(w=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[g,_,N]}),e[41]=_,e[42]=N,e[43]=g,e[44]=w):w=e[44],w}function $n(i){return n.jsx(Ve,{children:i},i)}function Ln(i,e){return/(token|secret|password|appKey|key)$/i.test(i)?"••••••••":e}function zn(i){const e=k.c(2),{title:t}=i;let s;return e[0]!==t?(s=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("p",{className:"text-xs text-muted-foreground",children:["A configuração ainda não está disponível aqui para ",t,"."]})}),e[0]=t,e[1]=s):s=e[1],s}function Dn(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"h-5 w-24 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]})}),i[0]=e):e=i[0],e}function Kn(i){const e=k.c(41),{card:t,org:s,selfClient:o,connectionId:l,savedConfigEntries:r,contextSiteUrl:c,autoOpen:a,onAutoOpenHandled:u}=i;let f;e[0]!==l||e[1]!==s.id||e[2]!==s.slug?(f={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=l,e[1]=s.id,e[2]=s.slug,e[3]=f):f=e[3];const p=Ae(f),[d,h]=D.useState(a),[v,j]=D.useState(!1),x=An[t.bindingType];let g;e[4]!==a||e[5]!==u?(g=()=>{h(!1),a&&u()},e[4]=a,e[5]=u,e[6]=g):g=e[6];const m=g;let b;e[7]!==m||e[8]!==v?(b=U=>{if(!(!U&&v)){if(!U){m();return}h(!0)}},e[7]=m,e[8]=v,e[9]=b):b=e[9];const y=b;let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuração"}),e[10]=S):S=e[10];let _;e[11]!==r.length?(_=r.length===0&&n.jsx("p",{className:"text-xs text-muted-foreground",children:"Nenhum valor de configuração foi salvo ainda."}),e[11]=r.length,e[12]=_):_=e[12];let N;e[13]!==_?(N=n.jsxs("div",{className:"grid gap-1",children:[S,_]}),e[13]=_,e[14]=N):N=e[14];let w;e[15]!==x||e[16]!==t.title||e[17]!==r.length?(w=r.length>0?n.jsxs(Ht,{children:[n.jsx(Bt,{asChild:!0,children:n.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(!0),"aria-label":`Editar configuração de ${t.title}`,disabled:!x,children:n.jsx(Qt,{size:14})})}),n.jsx(Gt,{children:"Editar configuração"})]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!0),disabled:!x,children:"Configurar"}),e[15]=x,e[16]=t.title,e[17]=r.length,e[18]=w):w=e[18];let E;e[19]!==N||e[20]!==w?(E=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N,w]}),e[19]=N,e[20]=w,e[21]=E):E=e[21];let I;e[22]!==r?(I=r.length>0&&n.jsx("dl",{className:"grid gap-2",children:r.map(Mn)}),e[22]=r,e[23]=I):I=e[23];let $;e[24]!==E||e[25]!==I?($=n.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[E,I]}),e[24]=E,e[25]=I,e[26]=$):$=e[26];let O;e[27]!==x||e[28]!==t||e[29]!==m||e[30]!==p||e[31]!==l||e[32]!==c||e[33]!==d||e[34]!==y||e[35]!==s||e[36]!==o?(O=x?n.jsx(Kt,{open:d,onOpenChange:y,children:n.jsxs(Mt,{className:"sm:max-w-lg",children:[n.jsxs(Ft,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[n.jsx(St,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx(qt,{children:t.title}),n.jsxs(Vt,{children:["Configure o ",t.title," para enriquecer os dados"]})]})]}),n.jsx(x,{card:t,connectionId:l,companionClient:p,selfClient:o,org:s,contextSiteUrl:c,onDone:m,onIsPendingChange:j})]})}):n.jsx(zn,{title:t.title}),e[27]=x,e[28]=t,e[29]=m,e[30]=p,e[31]=l,e[32]=c,e[33]=d,e[34]=y,e[35]=s,e[36]=o,e[37]=O):O=e[37];let T;return e[38]!==$||e[39]!==O?(T=n.jsxs(n.Fragment,{children:[$,O]}),e[38]=$,e[39]=O,e[40]=T):T=e[40],T}function Mn(i){return n.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[n.jsx("dt",{className:"text-muted-foreground",children:i.label}),n.jsx("dd",{className:"truncate text-foreground",children:Ln(i.key,i.value)})]},i.key)}const Xe={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Rupturas, PDPs incompletas e lacunas de atributos em todos os SKUs"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Onde a receita vaza entre a visualização do produto e o checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Lacunas de visibilidade na busca e indexação em todo o seu catálogo"}};function Fn(i){const e=k.c(30),{selfClient:t,org:s,cdConnectionId:o}=i;let l;e[0]!==o||e[1]!==s.id||e[2]!==s.slug?(l={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=o,e[1]=s.id,e[2]=s.slug,e[3]=l):l=e[3];const r=Ae(l);let c;e[4]!==o||e[5]!==s.id?(c=W.commerceDiscoveryCompanionSchema(s.id,o),e[4]=o,e[5]=s.id,e[6]=c):c=e[6];let a;e[7]!==r?(a=async()=>{const R=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(R)},e[7]=r,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u={queryKey:c,queryFn:a},e[9]=c,e[10]=a,e[11]=u):u=e[11];const f=me(u),p=dn(f.data?.stateSchema??{properties:{}}),d=p.map(Zn),h=p.map(Jn).filter(Yn),v=p.filter(Wn).map(Qn),j=[...h,...v].sort().join(",");let x;e[12]!==o||e[13]!==s.id?(x=W.commerceDiscoveryConnection(s.id,o),e[12]=o,e[13]=s.id,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==t?(g=async()=>{const R=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(R)},e[15]=o,e[16]=t,e[17]=g):g=e[17];let m;e[18]!==x||e[19]!==g?(m={queryKey:x,queryFn:g},e[18]=x,e[19]=g,e[20]=m):m=e[20];const y=me(m).data?.item?.configuration_state??null;let S;e[21]!==y?(S=R=>y?.[R.fieldKey]?.value,e[21]=y,e[22]=S):S=e[22];const _=p.map(S).filter(Gn),N=[...d.map(Bn),...h.map(Hn),..._.map(Vn)].sort().join(","),E=me({queryKey:W.commerceDiscoveryCompanionConnections(s.id,N),queryFn:async()=>{if(p.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:d},{field:["app_id"],operator:"in",value:h}];_.length>0&&R.push({field:["id"],operator:"in",value:_});const G=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return J(G)}}).data?.items??[],I=new Set(_),$=E.filter(R=>I.has(R.id)),O=$.filter(qn);let T;e[23]!==s.id||e[24]!==s.slug?(T=R=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(s.id,R.id),queryFn:async()=>{try{const G=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=T):T=e[25];const U=sn({queries:O.map(T)});let P;e[26]!==U?(P=(R,G)=>[R.id,U[G]?.data?.hasToken===!0],e[26]=U,e[27]=P):P=e[27];const M=new Map(O.map(P)),q={};for(const R of $)q[R.id]=!R.oauth_config||!!R.connection_token||M.get(R.id)===!0;const z=me({queryKey:W.commerceDiscoveryCompanionRegistry(s.id,j),queryFn:async()=>{if(p.length===0)return{items:[]};const R=mn(h,v),G=await Yt(bt.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return J(G)}}),F={},K={};for(const R of z.data?.items??[])F[R.id]=R,R.server?.name&&(K[R.server.name]=R);const C=bn({requirements:p,itemsById:F,itemsByName:K,connections:E,connectionReadiness:q,configurationState:y,curated:Xe});let L;return e[28]!==C?(L={cards:C},e[28]=C,e[29]=L):L=e[29],L}function qn(i){return i.oauth_config&&!i.connection_token}function Vn(i){return`linked:${i}`}function Hn(i){return`app:${i}`}function Bn(i){return`binding:${i}`}function Gn(i){return typeof i=="string"&&i.length>0}function Qn(i){return i.bindingType}function Wn(i){return!Xe[i.bindingType]}function Yn(i){return!!i}function Jn(i){return Xe[i.bindingType]?.registryAppId}function Zn(i){return i.bindingType}function Xn({selfClient:i,org:e,userId:t,cdConnectionId:s}){const o=ut(),[l,r]=D.useState(null),[c,a]=D.useState(null),u=async(p,d)=>{const h=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:d}});return J(h)};async function f(p){r(p.fieldKey),a(null);try{let d=p.candidateConnectionId;if(!d){const m=Jt(p.registryItem,e.id,t,{remoteIndex:0}),b=m.connection_type==="STDIO",y=!!m.connection_url,S=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!y&&!S)return a(`${p.title} cannot be connected: no connection method available`),!1;const _=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});d=J(_).item.id}const h=d,v=await on({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:m=>u(h,{connection_token:m}).then(()=>{})});if(!v.ok)return a(`Couldn't sign in to ${p.title}: ${v.error}`),!1;const j=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),x=J(j).item?.configuration_state??null,g=un(x,p.fieldKey,p.bindingType,h);return await u(s,{configuration_state:g}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,s)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),!0}catch(d){return a(d instanceof Error?d.message:String(d)),!1}finally{r(null)}}return{connect:f,connectingFieldKey:l,error:c}}const et="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function tt(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"grid gap-1.5",children:[n.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Desbloqueie seu diagnóstico completo"}),n.jsx("p",{className:"text-base text-muted-foreground",children:"Conecte suas ferramentas para liberar mais de 100 verificações no seu funil."})]}),i[0]=e):e=i[0],e}function es(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-4",children:[0,1,2].map(ts)}),i[0]=e):e=i[0],e}function ts(i){return n.jsx(Rn,{},i)}function nt(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:et,children:[n.jsx(tt,{}),n.jsx(es,{})]}),i[0]=e):e=i[0],e}function ns(i){const e=k.c(5),{onRetry:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(tt,{}),e[0]=s):s=e[0];let o,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),l=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=o,e[2]=l):(o=e[1],l=e[2]);let r;return e[3]!==t?(r=n.jsxs("div",{className:et,children:[s,n.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[o,l,n.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=r):r=e[4],r}function ss(i){const e=k.c(2);let t;return e[0]!==i?(t=n.jsx(gt,{children:s=>{const{reset:o}=s;return n.jsx(ht,{fallback:l=>{const{resetError:r}=l;return n.jsx(ns,{onRetry:()=>{o(),r()}})},children:n.jsx(D.Suspense,{fallback:n.jsx(nt,{}),children:n.jsx(is,{...i})})})}}),e[0]=i,e[1]=t):t=e[1],t}function is(i){const e=k.c(35),{org:t,cdConnectionId:s,siteUrl:o}=i,{data:l}=Oe.useSession(),r=l?.user?.id??"";let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:jt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const a=Ae(c);let u;e[3]!==s||e[4]!==t||e[5]!==a?(u={selfClient:a,org:t,cdConnectionId:s},e[3]=s,e[4]=t,e[5]=a,e[6]=u):u=e[6];const{cards:f}=Fn(u);let p;e[7]!==s||e[8]!==t||e[9]!==a||e[10]!==r?(p={selfClient:a,org:t,userId:r,cdConnectionId:s},e[7]=s,e[8]=t,e[9]=a,e[10]=r,e[11]=p):p=e[11];const{connect:d,connectingFieldKey:h,error:v}=Xn(p),[j,x]=D.useState(null);if(f.length===0)return null;const g=h!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(tt,{}),e[12]=m):m=e[12];let b;e[13]!==v?(b=v&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v}),e[13]=v,e[14]=b):b=e[14];let y;if(e[15]!==j||e[16]!==g||e[17]!==f||e[18]!==d||e[19]!==h||e[20]!==t||e[21]!==a||e[22]!==o){let _;e[24]!==j||e[25]!==g||e[26]!==d||e[27]!==h||e[28]!==t||e[29]!==a||e[30]!==o?(_=N=>{const w=async()=>{await d(N)&&x(N.fieldKey)};return n.jsx(Pn,{card:N,connecting:h===N.fieldKey,disabled:g&&h!==N.fieldKey,org:t,selfClient:a,siteUrl:o,autoOpenConfigFieldKey:j,onAutoOpenConfigHandled:()=>x(E=>E===N.fieldKey?null:E),onConnect:()=>{w()}},N.fieldKey)},e[24]=j,e[25]=g,e[26]=d,e[27]=h,e[28]=t,e[29]=a,e[30]=o,e[31]=_):_=e[31],y=f.map(_),e[15]=j,e[16]=g,e[17]=f,e[18]=d,e[19]=h,e[20]=t,e[21]=a,e[22]=o,e[23]=y}else y=e[23];let S;return e[32]!==b||e[33]!==y?(S=n.jsxs("div",{className:et,children:[m,n.jsx(Fe,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[60vh] md:flex-none",children:n.jsxs("div",{className:"grid gap-4",children:[b,y]})})]}),e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const st="https://decocms-tanstack.deco-cx.workers.dev/agendar",os="Prefere que a gente acompanhe você?",rs="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.";function it({siteUrl:i,email:e}){const t=new URL(st);return i&&t.searchParams.set("siteUrl",i),e&&t.searchParams.set("email",e),t.toString()}function as(i){const e=k.c(9),{href:t,size:s,className:o}=i,l=t===void 0?st:t,r=s===void 0?"lg":s;let c;e[0]!==o?(c=Z("w-full",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Nt,{size:16}),e[2]=a):a=e[2];let u;e[3]!==l?(u=n.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",children:["Agendar uma reunião",a]}),e[3]=l,e[4]=u):u=e[4];let f;return e[5]!==r||e[6]!==c||e[7]!==u?(f=n.jsx(H,{asChild:!0,variant:"outline",size:r,className:c,children:u}),e[5]=r,e[6]=c,e[7]=u,e[8]=f):f=e[8],f}function ct(i){const e=k.c(2),{children:t}=i;let s;return e[0]!==t?(s=n.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:t}),e[0]=t,e[1]=s):s=e[1],s}function ls(){const i=k.c(4);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ct,{children:n.jsx(_t,{size:20,className:"text-muted-foreground"})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:n.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),i[1]=t):t=i[1];let s;i[2]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),i[2]=s):s=i[2];let o;return i[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,n.jsxs("div",{className:"relative",children:[s,n.jsxs(ct,{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),i[3]=o):o=i[3],o}function ot(i){const e=k.c(4),{href:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ls,{}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"grid gap-2",children:[n.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:os}),n.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:rs})]}),e[1]=o):o=e[1];let l;return e[2]!==t?(l=n.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:n.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[s,o,n.jsx(as,{href:t,size:"xl"})]})}),e[2]=t,e[3]=l):l=e[3],l}function cs(i){const e=k.c(8),{className:t,href:s}=i,o=s===void 0?st:s;let l;e[0]!==t?(l=Z("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:n.jsx(_t,{size:20})}),e[2]=r):r=e[2];let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[n.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefere falar com uma pessoa?"}),n.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Agende uma chamada e rodamos o diagnóstico com você."})]}),a=n.jsx(Nt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=c,e[4]=a):(c=e[3],a=e[4]);let u;return e[5]!==o||e[6]!==l?(u=n.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:l,children:[r,c,a]}),e[5]=o,e[6]=l,e[7]=u):u=e[7],u}function wt(i){const e=k.c(10),{host:t}=i,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=n.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=r):(o=e[0],l=e[1],r=e[2]);let c;e[3]!==s?(c=n.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:n.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=c):c=e[4];let a;e[5]!==t?(a=n.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"flex items-center gap-3",children:[o,l,r,c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const ds={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ms(i){return ds[i]}function rt(i){const e=k.c(4),{variant:t}=i;let s;e[0]!==t?(s=ms(t),e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ze,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=o):o=e[3],o}function Oi(){const i=k.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ps,{}),i[0]=e):e=i[0],e}const Tt=D.createContext(null),It=()=>D.useContext(Tt);function Q(i){const e=k.c(13);let t,s;e[0]!==i?({visual:s,...t}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/commerce-onboarding"},e[3]=o):o=e[3];const l=xt(o),{data:r}=Oe.useSession(),c=r?.user?.email;let a;e[4]!==l.siteUrl||e[5]!==c?(a=it({siteUrl:l.siteUrl,email:c}),e[4]=l.siteUrl,e[5]=c,e[6]=a):a=e[6];const u=a;let f;e[7]!==u||e[8]!==s?(f=s??n.jsx(ot,{href:u}),e[7]=u,e[8]=s,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==f?(p=n.jsx($t,{...t,visual:f}),e[10]=t,e[11]=f,e[12]=p):p=e[12],p}const us={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:i=>`Código enviado para ${i}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:i=>`Continuar com ${i}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function fs(i){if(!i)return null;const e=Te(i);return e.ok?new URL(e.value).hostname:null}function dt(i){switch(i){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return i}}let mt=!1;function ps(){const i=xt({from:"/commerce-onboarding"}),{org:e,siteUrl:t}=i,s=fs(t);return!mt&&Ot()&&(mt=!0,Ut("commerce_onboarding_viewed",{site_url:t,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),n.jsx(Tt.Provider,{value:s,children:n.jsx(gs,{requestedOrgSlug:e,siteUrl:t})})}function gs(i){const e=k.c(8),{requestedOrgSlug:t,siteUrl:s}=i,{data:o,isPending:l}=Oe.useSession(),r=It();if(l){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Q,{children:n.jsx(rt,{variant:"generic"})}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r?n.jsx(wt,{host:r}):void 0,e[1]=r,e[2]=u):u=e[2];let f;return e[3]!==u?(f=n.jsx(Q,{children:n.jsx(Pt,{callbackUrl:a,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:u,copy:us})}),e[3]=u,e[4]=f):f=e[4],f}let c;return e[5]!==t||e[6]!==s?(c=n.jsx(hs,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=c):c=e[7],c}function hs(i){const e=k.c(40),{requestedOrgSlug:t,siteUrl:s}=i,o=yt(),l=At(),[r,c]=D.useState(null),[a,u]=D.useState(null),f=l.data?.map(ys)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:xs,retry:!1,onSuccess:m=>{u(m)}},e[0]=p):p=e[0];const d=ke(p);if(l.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Q,{children:n.jsx(rt,{variant:"workspace"})}),e[1]=m):m=e[1],m}if(l.error){let m;return e[2]!==l?(m=n.jsx(Ie,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[2]=l,e[3]=m):m=e[3],m}const h=t?f.find(m=>m.slug===t):null;if(h){let m;return e[4]!==h||e[5]!==s?(m=n.jsx(we,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=m):m=e[6],m}if(t){let m;return e[7]!==l?(m=n.jsx(Ie,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[7]=l,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==s?(m=n.jsx(we,{org:r,initialSiteUrl:s}),e[9]=r,e[10]=s,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==s?(m=n.jsx(we,{org:f[0],initialSiteUrl:s}),e[12]=f[0],e[13]=s,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=S=>c(S),e[16]=b):b=e[16];let y;return e[17]!==f?(y=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:f,selectLabel:"Continuar",onSelected:b})})]})}),e[17]=f,e[18]=y):y=e[18],y}if(!a){let m;e[19]!==d?(m=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=m):m=e[20];let b;return e[21]!==d||e[22]!==m?(b=n.jsx(vs,{mutation:d,onRetry:m}),e[21]=d,e[22]=m,e[23]=b):b=e[23],b}const v=a;if(v?.success&&(v.status==="created"||v.status==="joined"||v.status==="already_has_organization")&&v.organization){let m;return e[24]!==v.organization||e[25]!==s?(m=n.jsx(we,{org:v.organization,initialSiteUrl:s}),e[24]=v.organization,e[25]=s,e[26]=m):m=e[26],m}if(v?.status==="ambiguous"&&v.organizations&&v.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=m):m=e[27];const b=v.domain??void 0;let y;e[28]!==o||e[29]!==s?(y=(_,N)=>{vt(),c({..._,slug:N}),o({to:"/commerce-onboarding",search:{org:N,siteUrl:s}})},e[28]=o,e[29]=s,e[30]=y):y=e[30];let S;return e[31]!==v.organizations||e[32]!==b||e[33]!==y?(S=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:v.organizations,domain:b,onJoined:y})})]})}),e[31]=v.organizations,e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const j=v?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let x;e[35]!==d?(x=()=>{u(null),d.reset()},e[35]=d,e[36]=x):x=e[36];let g;return e[37]!==j||e[38]!==x?(g=n.jsx(Ie,{title:"O onboarding de commerce precisa de suporte",description:j,actionLabel:"Tentar novamente",onRetry:x}),e[37]=j,e[38]=x,e[39]=g):g=e[39],g}async function xs(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&vt(),e}function ys(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function vs(i){const e=k.c(7),{mutation:t,onRetry:s}=i,o=D.useRef(!1);let l;e[0]!==t?(l=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=l):l=e[1];const r=l;if(t.error){let u;return e[2]!==s?(u=n.jsx(Ie,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:s}),e[2]=s,e[3]=u):u=e[3],u}let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rt,{variant:"generic"}),e[4]=c):c=e[4];let a;return e[5]!==r?(a=n.jsx(Q,{children:n.jsx("div",{ref:r,children:c})}),e[5]=r,e[6]=a):a=e[6],a}function X(i){const e=k.c(8),{title:t,description:s}=i,o=It();let l;e[0]!==o?(l=o?n.jsx(wt,{host:o}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let r;e[2]!==s||e[3]!==t?(r=(t||s)&&n.jsxs("div",{className:"space-y-2",children:[t&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=r):r=e[4];let c;return e[5]!==l||e[6]!==r?(c=n.jsxs("div",{className:"grid gap-10",children:[l,r]}),e[5]=l,e[6]=r,e[7]=c):c=e[7],c}function Ie(i){const e=k.c(9),{title:t,description:s,actionLabel:o,onRetry:l}=i;let r;e[0]!==s||e[1]!==t?(r=n.jsx(X,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=r):r=e[2];let c;e[3]!==o||e[4]!==l?(c=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=c):c=e[5];let a;return e[6]!==r||e[7]!==c?(a=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[r,c]})}),e[6]=r,e[7]=c,e[8]=a):a=e[8],a}function bs(i){return i.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Ee(i){const e=i;if(e.isError)throw new Error(bs(e));return e.structuredContent??i}function we(i){const e=k.c(10),{org:t,initialSiteUrl:s}=i,{data:o}=Oe.useSession(),l=o?.user?.email;let r;e[0]!==s||e[1]!==l?(r=it({siteUrl:s,email:l}),e[0]=s,e[1]=l,e[2]=r):r=e[2];const c=r;let a;e[3]!==c?(a=n.jsx(ot,{href:c}),e[3]=c,e[4]=a):a=e[4];const u=a;let f;return e[5]!==s||e[6]!==u||e[7]!==t||e[8]!==o?.user?.email?(f=n.jsx(gt,{children:p=>{const{reset:d}=p;return n.jsx(ht,{fallback:h=>{const{error:v,resetError:j}=h;return n.jsx(Q,{visual:u,children:n.jsx(js,{orgName:t.name,message:v instanceof Error?v.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{d(),j()}})})},children:n.jsx(D.Suspense,{fallback:n.jsx(kt,{visual:u}),children:n.jsx(Cs,{org:t,initialSiteUrl:s,sessionEmail:o?.user?.email},`${t.id}:${s??""}`)})})}}),e[5]=s,e[6]=u,e[7]=t,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function kt(i){const e=k.c(3),{visual:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(X,{}),n.jsx(nt,{})]}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=n.jsx(Q,{align:"fill",visual:t,children:s}),e[1]=t,e[2]=o):o=e[2],o}function js(i){const e=k.c(10),{orgName:t,message:s,onRetry:o}=i,l=`A configuração de commerce continuará em ${t}.`;let r;e[0]!==l?(r=n.jsx(X,{title:"Diagnóstico de commerce",description:l}),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx(xe,{message:s}),e[2]=s,e[3]=c):c=e[3];let a;e[4]!==o?(a=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Tentar novamente"}),e[4]=o,e[5]=a):a=e[5];let u;return e[6]!==r||e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"grid gap-10",children:[r,c,a]}),e[6]=r,e[7]=c,e[8]=a,e[9]=u):u=e[9],u}function Cs(i){const e=k.c(111),{org:t,initialSiteUrl:s,sessionEmail:o}=i,l=yt();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:jt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const c=Ae(r),[a,u]=D.useState(s??""),[f,p]=D.useState(null),[d,h]=D.useState(null),v=D.useRef(!1),j=bt.COMMERCE_DISCOVERY(t.id),x=zt(t.id),g=W.commerceDiscoveryConnection(t.id,j);let m;e[3]!==j||e[4]!==c?(m=async()=>{const A=await c.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ee(A)},e[3]=j,e[4]=c,e[5]=m):m=e[5];let b;e[6]!==g||e[7]!==m?(b={queryKey:g,queryFn:m,retry:!1},e[6]=g,e[7]=m,e[8]=b):b=e[8];const y=me(b),S=W.commerceDiscoveryVirtualMcp(t.id,x);let _;e[9]!==c||e[10]!==x?(_=async()=>{const A=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return Ee(A)},e[9]=c,e[10]=x,e[11]=_):_=e[11];let N;e[12]!==S||e[13]!==_?(N={queryKey:S,queryFn:_,retry:!1},e[12]=S,e[13]=_,e[14]=N):N=e[14];const w=me(N);let E;e[15]!==c?(E=async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:A}});return Ee(B)},e[15]=c,e[16]=E):E=e[16];let I;e[17]!==y||e[18]!==w?(I=A=>{p(A),h(null),y.refetch(),w.refetch()},e[17]=y,e[18]=w,e[19]=I):I=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=A=>{h(A instanceof Error?A.message:"A configuração do Commerce Discovery falhou.")},e[20]=$):$=e[20];let O;e[21]!==E||e[22]!==I?(O={mutationFn:E,retry:!1,onSuccess:I,onError:$},e[21]=E,e[22]=I,e[23]=O):O=e[23];const T=ke(O);let U;e[24]!==c?(U={mutationFn:async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:A}});return Ee(B)},retry:!1},e[24]=c,e[25]=U):U=e[25];const P=ke(U),[M,q]=D.useState(null),z=!!y.data.item&&!!w.data.item,F=y.data.item,K=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,C=s||a||K||"";let L;e[26]!==C||e[27]!==o?(L=it({siteUrl:C,email:o}),e[26]=C,e[27]=o,e[28]=L):L=e[28];const R=L;let G;e[29]!==R?(G=n.jsx(ot,{href:R}),e[29]=R,e[30]=G):G=e[30];const V=G;let ye;e[31]!==T?(ye=A=>{const B=Te(A);if(!B.ok){h(dt(B.error));return}h(null),T.mutate(B.value)},e[31]=T,e[32]=ye):ye=e[32];const te=ye;let ve;e[33]!==s||e[34]!==te||e[35]!==z?(ve=A=>{!A||v.current||z||!s||(v.current=!0,te(s))},e[33]=s,e[34]=te,e[35]=z,e[36]=ve):ve=e[36];const Re=ve;let be;e[37]!==te||e[38]!==a?(be=A=>{A.preventDefault(),te(a)},e[37]=te,e[38]=a,e[39]=be):be=e[39];const Y=be;let je;e[40]!==j||e[41]!==f?.reportApp||e[42]!==x?(je=f?.reportApp??{connectionId:j,virtualMcpId:x,toolName:Dt},e[40]=j,e[41]=f?.reportApp,e[42]=x,e[43]=je):je=e[43];const ee=je;let Ce;e[44]!==C||e[45]!==l||e[46]!==t.slug||e[47]!==ee||e[48]!==P?(Ce=async()=>{q(null);const A=Te(C);if(A.ok)try{await P.mutateAsync(A.value)}catch{q("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Rt.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ee.virtualMcpId,main:Lt(ee.connectionId,ee.toolName),chat:0}})},e[44]=C,e[45]=l,e[46]=t.slug,e[47]=ee,e[48]=P,e[49]=Ce):Ce=e[49];const Pe=Ce;if(z){let A;return e[50]!==R||e[51]!==V||e[52]!==C||e[53]!==Pe||e[54]!==t||e[55]!==ee||e[56]!==M||e[57]!==P.isPending?(A=n.jsx(Ss,{org:t,reportApp:ee,onOpenReport:Pe,isSubmitting:P.isPending,error:M,meetingUrl:R,meetingVisual:V,siteUrl:C}),e[50]=R,e[51]=V,e[52]=C,e[53]=Pe,e[54]=t,e[55]=ee,e[56]=M,e[57]=P.isPending,e[58]=A):A=e[58],A}if(T.isPending){let A;return e[59]!==V?(A=n.jsx(kt,{visual:V}),e[59]=V,e[60]=A):A=e[60],A}if(s){let A,B;if(e[61]!==V||e[62]!==Y||e[63]!==s||e[64]!==d||e[65]!==t.name||e[66]!==T.isPending||e[67]!==a){B=Symbol.for("react.early_return_sentinel");e:if(A=Te(s),!A.ok){const ze=`A configuração de commerce continuará em ${t.name}.`;let le;e[70]!==ze?(le=n.jsx(X,{title:"Diagnóstico de commerce",description:ze}),e[70]=ze,e[71]=le):le=e[71];const De=n.jsx(xe,{message:dt(A.error)});let ce;e[72]!==Y||e[73]!==d||e[74]!==T.isPending||e[75]!==a?(ce=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[72]=Y,e[73]=d,e[74]=T.isPending,e[75]=a,e[76]=ce):ce=e[76];let de;e[77]!==le||e[78]!==De||e[79]!==ce?(de=n.jsxs("div",{className:"grid gap-10",children:[le,De,ce]}),e[77]=le,e[78]=De,e[79]=ce,e[80]=de):de=e[80];let _e;e[81]!==V||e[82]!==de?(_e=n.jsx(Q,{visual:V,children:de}),e[81]=V,e[82]=de,e[83]=_e):_e=e[83],B=_e;break e}e[61]=V,e[62]=Y,e[63]=s,e[64]=d,e[65]=t.name,e[66]=T.isPending,e[67]=a,e[68]=A,e[69]=B}else A=e[68],B=e[69];if(B!==Symbol.for("react.early_return_sentinel"))return B;const Le=`O Commerce Discovery está sendo preparado para ${A.value}.`;let oe;e[84]!==Le?(oe=n.jsx(X,{title:"Diagnóstico de commerce",description:Le}),e[84]=Le,e[85]=oe):oe=e[85];let re;e[86]!==Y||e[87]!==d||e[88]!==T.isPending||e[89]!==a?(re=d?n.jsxs(n.Fragment,{children:[n.jsx(xe,{message:d}),n.jsx(Me,{siteUrl:a,error:null,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y})]}):n.jsx(nt,{}),e[86]=Y,e[87]=d,e[88]=T.isPending,e[89]=a,e[90]=re):re=e[90];let ae;e[91]!==oe||e[92]!==re||e[93]!==Re?(ae=n.jsxs("div",{ref:Re,className:"grid gap-10",children:[oe,re]}),e[91]=oe,e[92]=re,e[93]=Re,e[94]=ae):ae=e[94];let Ne;return e[95]!==V||e[96]!==ae?(Ne=n.jsx(Q,{visual:V,children:ae}),e[95]=V,e[96]=ae,e[97]=Ne):Ne=e[97],Ne}const $e=`A configuração de commerce continuará em ${t.name}.`;let ne;e[98]!==$e?(ne=n.jsx(X,{title:"Diagnóstico de commerce",description:$e}),e[98]=$e,e[99]=ne):ne=e[99];let se;e[100]!==Y||e[101]!==d||e[102]!==T.isPending||e[103]!==a?(se=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[100]=Y,e[101]=d,e[102]=T.isPending,e[103]=a,e[104]=se):se=e[104];let ie;e[105]!==ne||e[106]!==se?(ie=n.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[105]=ne,e[106]=se,e[107]=ie):ie=e[107];let Se;return e[108]!==V||e[109]!==ie?(Se=n.jsx(Q,{visual:V,children:ie}),e[108]=V,e[109]=ie,e[110]=Se):Se=e[110],Se}function Me(i){const e=k.c(20),{siteUrl:t,error:s,isSubmitting:o,onSiteUrlChange:l,onSubmit:r}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=c):c=e[0];let a;e[1]!==l?(a=x=>l(x.target.value),e[1]=l,e[2]=a):a=e[2];const u=!!s;let f;e[3]!==o||e[4]!==t||e[5]!==a||e[6]!==u?(f=n.jsx(Ue,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:a,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=a,e[6]=u,e[7]=f):f=e[7];let p;e[8]!==s?(p=s?n.jsx(xe,{message:s}):null,e[8]=s,e[9]=p):p=e[9];let d;e[10]!==f||e[11]!==p?(d=n.jsxs("div",{className:"grid gap-2",children:[c,f,p]}),e[10]=f,e[11]=p,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Ct,{size:16}),e[13]=h):h=e[13];let v;e[14]!==o?(v=n.jsxs(H,{type:"submit",size:"xl",className:"w-full",disabled:o,children:["Continuar",h]}),e[14]=o,e[15]=v):v=e[15];let j;return e[16]!==r||e[17]!==d||e[18]!==v?(j=n.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,v]}),e[16]=r,e[17]=d,e[18]=v,e[19]=j):j=e[19],j}function Ss(i){const e=k.c(26),{org:t,reportApp:s,onOpenReport:o,isSubmitting:l,error:r,meetingUrl:c,meetingVisual:a,siteUrl:u}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(X,{}),e[0]=f):f=e[0];let p;e[1]!==t||e[2]!==s.connectionId||e[3]!==u?(p=n.jsx(ss,{org:t,cdConnectionId:s.connectionId,siteUrl:u}),e[1]=t,e[2]=s.connectionId,e[3]=u,e[4]=p):p=e[4];let d;e[5]!==c?(d=n.jsx(cs,{className:"md:hidden",href:c}),e[5]=c,e[6]=d):d=e[6];let h;e[7]!==r?(h=r?n.jsx(xe,{message:r}):null,e[7]=r,e[8]=h):h=e[8];const v=l||!s.virtualMcpId,j=l?"Abrindo relatório...":"Ver relatório completo";let x;e[9]!==l?(x=l?null:n.jsx(Ct,{size:18}),e[9]=l,e[10]=x):x=e[10];let g;e[11]!==o||e[12]!==v||e[13]!==j||e[14]!==x?(g=n.jsxs(H,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:v,children:[j,x]}),e[11]=o,e[12]=v,e[13]=j,e[14]=x,e[15]=g):g=e[15];let m;e[16]!==d||e[17]!==h||e[18]!==g?(m=n.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,g]}),e[16]=d,e[17]=h,e[18]=g,e[19]=m):m=e[19];let b;e[20]!==p||e[21]!==m?(b=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,p,m]}),e[20]=p,e[21]=m,e[22]=b):b=e[22];let y;return e[23]!==a||e[24]!==b?(y=n.jsx(Q,{align:"fill",visual:a,children:b}),e[23]=a,e[24]=b,e[25]=y):y=e[25],y}function xe(i){const e=k.c(2),{message:t}=i;let s;return e[0]!==t?(s=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Oi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as fe,aF as Ie,b7 as Ae,s as le,aD as De,c as P,j as t,i as ge,B as E,r as G,l as je,D as J,q as $e,K as ne,b as Y,ab as ce,z as Pe,b8 as Oe,E as ze,e as Me,b9 as Ve,m as Ee,p as Ue,n as Fe,t as q,ba as Re}from"./index-C5w7M3ak.js";import{a as Le}from"./extract-connection-data-sR3PfR1q.js";import{E as ve}from"./empty-state-Di1r-g_a.js";import{E as Be,c as He,r as We,b as Xe,d as qe}from"./connection-form-helpers-CzldBL3R.js";import{c as Ge,S as Ke,V as Qe}from"./index-CfIbeCCb.js";import{u as be,T as Je}from"./index-Dsuwnck-.js";import{u as Ye}from"./use-members-B81Cwsvd.js";import{A as Ze}from"./avatar-DKl_SvPY.js";import{a as Ne,b as ye,u as et}from"./use-connection-BnTFSsXk.js";import{u as _e}from"./use-mcp-client-Ci_r6Z9X.js";import{a as tt}from"./use-mcp-tools-C3Vng-X-.js";import{a as st}from"./use-mcp-prompts-Brfbccg_.js";import{i as nt,a as ot}from"./mcp-oauth-BsM22i8Z.js";import{I as oe}from"./integration-icon-CE7Y49fT.js";import{s as it}from"./Plus-CdiQoMoJ.js";import{z as at,C as rt,ag as lt,a5 as ct}from"./agent-icon-Tlh3oNKM.js";import{a as Ce,s as dt}from"./Settings02-D-O2SNJf.js";import{s as ae}from"./Trash01-BVvGX_KK.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-CG7AqhVD.js";import{F as L,b as B,c as H,d as V,e as W,f as ft,a as gt}from"./form-DyV_U4Fx.js";import{I as X}from"./input-agFYfi3v.js";import{u as jt,D as vt}from"./use-delete-connection-Tmvu17mo.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-C_tu4yGv.js";import{u as kt}from"./studio-tools-BJLBgOee.js";import{u as Tt}from"./use-virtual-mcp-C76Ypnz5.js";import{i as Se}from"./ChevronRight-j760Iee-.js";import{a as we}from"./Users03-DwMxpPU3.js";import{T as ee,a as It,b as te,c as At}from"./tabs-DGpCIiez.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-DD_XuIyF.js";import{c as $t}from"./Tool01-Dt-TbXDn.js";import{g as re,M as Pt}from"./types-CXz6VYrK.js";import{C as Ot}from"./collection-search-9Z9J-flr.js";import{C as zt}from"./card-CCz6n2PT.js";import{B as Mt}from"./badge-CPOFnH5f.js";import{D as Vt,a as Et,b as Ut,c as de}from"./dropdown-menu-B_-Um9OQ.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select--NMtIJXa.js";import{i as Ft}from"./CheckCircle-yOjX9PZe.js";import{t as Rt}from"./ChevronDown-DXzUoD2e.js";import{n as Lt}from"./XCircle-DAqTWvWp.js";import{s as se}from"./Star01-BNUohd1g.js";import{s as Bt}from"./XClose-DlK2hm1P.js";import"./index-DJPcb21Y.js";import"./sidebar-C8Zfra_F.js";import"./LayoutLeft-Fadct960.js";import"./use-mobile-COxfHS-K.js";import"./tooltip-CgNWIJOM.js";import"./ZoomOut-VAm9p2Hl.js";import"./Key01-BAEB0MKB.js";import"./auth-BR3aJLVt.js";import"./use-registry-connections-DxwnrcKA.js";import"./use-organization-settings-D1CXb2Mk.js";import"./index-Cx9raLNH.js";import"./index--rRbpAQ9.js";import"./popover-DXCLs7Mh.js";import"./ChevronUp-CADhYHt4.js";import"./SearchMd-D1HSgOeu.js";import"./use-create-virtual-mcp-Dc3lK-qn.js";import"./use-navigate-to-agent-Cp82Pt97.js";import"./Eye-CQQama2s.js";import"./use-org-auth-client-C5HFWhiz.js";import"./User01-CaU7xtcd.js";import"./use-collections-BYKClwvP.js";import"./AlertCircle-D8nl7USt.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ChevronLeft-DopUTXew.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Upload01-Prj9a2xY.js";import"./Users01-BRnzISUs.js";import"./X-C-TqNtc2.js";import"./Zap-5n0DTezT.js";import"./label-A5aaknkU.js";import"./alert-dialog-DESqZhA2.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==a?(S=()=>a(n),e[24]=n,e[25]=a,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let h;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(h=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ce,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(E,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let f;e[8]!==x||e[9]!==d?(f=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=f):f=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:a}),children:t.jsx(Xt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=G.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const S=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,placeholder:"Search apps...",onKeyDown:C}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let h;e[29]!==C?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=h):h=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==h||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,h,w,O,M]})}),e[44]=k,e[45]=h,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Vt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>d.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const a=s.connection_headers,r=We(a.envVars);if(ps(a)){const i=hs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=fs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ee(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=f??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){q.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:f?.title??s.title}),t.jsx(ht,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(E,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(E,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(E,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),q.success(D==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Ss):(x?.tools??[]).map(Cs);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ve(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const C=k;let h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(E,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:C,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function ao(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{ao as default};
|