decocms 4.76.71 → 4.76.73
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-Cvu85Sr0.js → AlertCircle-BruzF2iv.js} +1 -1
- package/dist/client/assets/{AreaChart-BSihuL6I.js → AreaChart-BskXy4SQ.js} +1 -1
- package/dist/client/assets/{ArrowUp-fbYe80_F.js → ArrowUp-BGaUYqqU.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bl5xGmHO.js → ArrowUpRight-DSpTWVQc.js} +1 -1
- package/dist/client/assets/{Check-wimNrbhN.js → Check-B39admL5.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bl4aW-nn.js → CheckCircle-CoEkVilF.js} +1 -1
- package/dist/client/assets/{ChevronDown-C5CvsmcD.js → ChevronDown-sOSEiy0A.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bno5_0xg.js → ChevronRight-ctIWxLHP.js} +1 -1
- package/dist/client/assets/{ChevronUp-DrDSr-mi.js → ChevronUp-Lql1NvtB.js} +1 -1
- package/dist/client/assets/{Circle-g57xQlUQ.js → Circle-BYFM9066.js} +1 -1
- package/dist/client/assets/{Copy01-1_zUjHG9.js → Copy01-E4tNRR-Z.js} +1 -1
- package/dist/client/assets/{DotsVertical-SPVqsXfZ.js → DotsVertical-CpFpEjlh.js} +1 -1
- package/dist/client/assets/{Eye-BMAxGnGK.js → Eye-Ct8zbzXX.js} +1 -1
- package/dist/client/assets/{FilterLines-BnL8BlYf.js → FilterLines-xFs3ElyA.js} +1 -1
- package/dist/client/assets/{Flag01-BFVNOegT.js → Flag01-BdjQXdzI.js} +1 -1
- package/dist/client/assets/{Globe01-DJ_zs5G_.js → Globe01-DlmRiuvQ.js} +1 -1
- package/dist/client/assets/{Globe04-DkaJlCI4.js → Globe04-BuOYj4s3.js} +1 -1
- package/dist/client/assets/{HardDrive-yPFtg6_w.js → HardDrive-CwS1eRw9.js} +1 -1
- package/dist/client/assets/Image01-MTGhbLH3.js +1 -0
- package/dist/client/assets/{Key01-BdmJ-1sf.js → Key01-CDDG9ZrY.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DXtD65nH.js → LayoutLeft-DiwhJk8X.js} +1 -1
- package/dist/client/assets/{LinkExternal01-26v779uD.js → LinkExternal01-BTVlP1dv.js} +1 -1
- package/dist/client/assets/{List-Degct3aY.js → List-M0UjuOxn.js} +1 -1
- package/dist/client/assets/{Monitor01-B52VT9DG.js → Monitor01-DUsCnCA5.js} +1 -1
- package/dist/client/assets/{Package-CKW2xi_w.js → Package-Cc4YIffE.js} +1 -1
- package/dist/client/assets/{Palette-Bv_JYMYM.js → Palette-ZP9uMafU.js} +1 -1
- package/dist/client/assets/{Play-Dw4gmx5C.js → Play-Bnke5AjJ.js} +1 -1
- package/dist/client/assets/{Plus-CeRRdRrw.js → Plus-ThnzQs_H.js} +1 -1
- package/dist/client/assets/{SearchLg-EpoU8TwV.js → SearchLg-BRF52o3Y.js} +1 -1
- package/dist/client/assets/{SearchMd-DAd-Bkgu.js → SearchMd-B0RRZN_O.js} +1 -1
- package/dist/client/assets/{Settings02-BYgyRjAD.js → Settings02-10h76TH1.js} +1 -1
- package/dist/client/assets/{Shield01-CMDd26KY.js → Shield01-BajsDKVh.js} +1 -1
- package/dist/client/assets/{Star01-B4wdnyjY.js → Star01-Dl_LBuXW.js} +1 -1
- package/dist/client/assets/{Stars01-aA8DbwLH.js → Stars01-C3Bg4dd_.js} +1 -1
- package/dist/client/assets/{Stars02-CmYTwRcx.js → Stars02-lvNxzizN.js} +1 -1
- package/dist/client/assets/{Sun-MykPXdqN.js → Sun-Bf8X7MX0.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DJnrgsIK.js → SwitchHorizontal01-akGfxRdA.js} +1 -1
- package/dist/client/assets/Tool01-LhCh3bFV.js +1 -0
- package/dist/client/assets/{Tool02-Bt1NLhl1.js → Tool02-DZKFCBGu.js} +1 -1
- package/dist/client/assets/{Trash01-kZy-N3Xo.js → Trash01-CIPEsJnb.js} +1 -1
- package/dist/client/assets/{TrendUp01-CwpvhxrP.js → TrendUp01-BxgENeu4.js} +1 -1
- package/dist/client/assets/{Upload01-Bpbyu6sv.js → Upload01-oMXVRbE4.js} +1 -1
- package/dist/client/assets/{User01-DQn1mAZF.js → User01-Rht1Q5Yv.js} +1 -1
- package/dist/client/assets/{UserPlus01-DjC11OT1.js → UserPlus01-Bt4CqLte.js} +1 -1
- package/dist/client/assets/{Users01-CY0-Vc-O.js → Users01-D3nQH-pU.js} +1 -1
- package/dist/client/assets/{Users03-CLvfcW6v.js → Users03-DAIrOmRa.js} +1 -1
- package/dist/client/assets/{X-BZ_UKD_O.js → X-DVlYMws3.js} +1 -1
- package/dist/client/assets/{XCircle-BgTed_Co.js → XCircle-BNznCaWL.js} +1 -1
- package/dist/client/assets/{XClose-CcOoHUUk.js → XClose-BZeqA9Ww.js} +1 -1
- package/dist/client/assets/{Zap-D3VZuva8.js → Zap-Ms4YFpn7.js} +1 -1
- package/dist/client/assets/{ZapSquare-95HyzbKN.js → ZapSquare-CxddJtQi.js} +1 -1
- package/dist/client/assets/ZoomOut--W8MgdQO.js +1 -0
- package/dist/client/assets/{access-gate-DKOiEABa.js → access-gate-vVi3vJ12.js} +1 -1
- package/dist/client/assets/{add-section-modal-DS-jmwsV.js → add-section-modal-BVEBTabZ.js} +1 -1
- package/dist/client/assets/agent-icon-Blkthr26.js +1 -0
- package/dist/client/assets/agents-list-e8u0eWiY.js +1 -0
- package/dist/client/assets/ai-providers-B4DzfmA5.js +1 -0
- package/dist/client/assets/{alert-CpO8hjmN.js → alert-DCcGiWPs.js} +1 -1
- package/dist/client/assets/{alert-dialog-nxq3-B6t.js → alert-dialog-DRU6i9El.js} +1 -1
- package/dist/client/assets/app-editor-BCdwVRos.js +1 -0
- package/dist/client/assets/{auth-4uk65Jwa.js → auth-CCkcm_W5.js} +1 -1
- package/dist/client/assets/{auth-catchall-StGshhx2.js → auth-catchall-DY1MzxoU.js} +1 -1
- package/dist/client/assets/{auth-entry-BBVTjEcb.js → auth-entry-DKXF8sqr.js} +1 -1
- package/dist/client/assets/{auth-split-layout-5rHPK2FX.js → auth-split-layout-S1yObhJS.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DSvl_dtV.js → authenticate-and-persist-oauth-DeMFtp9E.js} +1 -1
- package/dist/client/assets/{automation-list-row-BbQKDFDI.js → automation-list-row-B5yCu82T.js} +1 -1
- package/dist/client/assets/{automation-runs-J5VVC0pP.js → automation-runs-CzbwAasU.js} +6 -6
- package/dist/client/assets/automations-o2IJL27P.js +1 -0
- package/dist/client/assets/{autosend-C3_RSy-l.js → autosend-B-yG8dZ_.js} +1 -1
- package/dist/client/assets/{avatar-DJ2MPOjW.js → avatar-CUSXc3DL.js} +1 -1
- package/dist/client/assets/{badge-tPEV-RxK.js → badge-BDPKfe1o.js} +1 -1
- package/dist/client/assets/{block-document-BGBDt9He.js → block-document-BsuXnWRh.js} +1 -1
- package/dist/client/assets/{brand-context-XU5oj6VV.js → brand-context-BXfH2r6C.js} +1 -1
- package/dist/client/assets/{buckets-BpEMloCg.js → buckets-V1uwFW0T.js} +1 -1
- package/dist/client/assets/bulk-category-panel-B7H_RXsV.js +1 -0
- package/dist/client/assets/{calendar-Csl0UCmv.js → calendar-DRmj2_7a.js} +1 -1
- package/dist/client/assets/{capability-load-error-BVM1o44K.js → capability-load-error-Dr90XN0k.js} +1 -1
- package/dist/client/assets/{card-BiR2GL-H.js → card-BhXues2U.js} +1 -1
- package/dist/client/assets/category-editor-D2Jh2ccx.js +1 -0
- package/dist/client/assets/{chat-context-CXmj1wzI.js → chat-context-DwpoTpCs.js} +1 -1
- package/dist/client/assets/{checkbox-BnAeGRmY.js → checkbox-YCXduo1r.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DpSY8KYL.js → cli-auth-success-00P4IPO6.js} +1 -1
- package/dist/client/assets/collection-detail-VnygK1zQ.js +1 -0
- package/dist/client/assets/{collection-display-button-ClhtIWW8.js → collection-display-button-Bz05-PLo.js} +1 -1
- package/dist/client/assets/{collection-search-CIVfwIbs.js → collection-search-BNQwJEsh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BLGcEcmX.js → collection-table-wrapper-D0_3fOek.js} +1 -1
- package/dist/client/assets/{collection-tabs-C-nwiHu-.js → collection-tabs-7hcH-EcY.js} +1 -1
- package/dist/client/assets/{command-CZ7egaGh.js → command-CP0dFnW4.js} +1 -1
- package/dist/client/assets/commerce-onboarding-CvDyxDtR.js +1 -0
- package/dist/client/assets/{companions-core-DVErIwai.js → companions-core-gVgC5gLl.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-B4yVc_7M.js → connect-desktop-dialog-DTNiYcmh.js} +1 -1
- package/dist/client/assets/{connection-card-DAmJM9w3.js → connection-card-BDm2Vxuw.js} +1 -1
- package/dist/client/assets/connection-detail-Bwgi-IR2.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CmZoSIwh.js → connection-form-helpers-Cx5FQf8f.js} +1 -1
- package/dist/client/assets/connections-CIUrHsbk.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-COulQsQu.js → decopilot-sse-pool-GJszCN4Q.js} +1 -1
- package/dist/client/assets/{dialog-gLpw4bfG.js → dialog-BwwNZnAc.js} +1 -1
- package/dist/client/assets/{domain-settings-BdAEu5gj.js → domain-settings-CK9YNiOo.js} +1 -1
- package/dist/client/assets/{drawer-ZJqvF-A5.js → drawer-BxmffSQp.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bbpx10wk.js → dropdown-menu-CtBX3hkW.js} +1 -1
- package/dist/client/assets/{empty-state-n5t0v7uI.js → empty-state-g8rQJwLx.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DQ2KFguj.js → extract-connection-data--BgpLR7j.js} +1 -1
- package/dist/client/assets/file-explorer-B0f2QBuh.js +2 -0
- package/dist/client/assets/{file-type-icon-BZvnDuN0.js → file-type-icon-bssT4364.js} +1 -1
- package/dist/client/assets/{files-Y9_h0NXa.js → files-AzAIkIpO.js} +1 -1
- package/dist/client/assets/{form-CEJ7NLQz.js → form-LRtEhza0.js} +1 -1
- package/dist/client/assets/{general-Dz0_FpL5.js → general-CJsys3bF.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BXgmr-ZU.js → github-repo-picker-Cet2BIU3.js} +1 -1
- package/dist/client/assets/{hooks-qsHMC7Ia.js → hooks-jRMX1tPE.js} +1 -1
- package/dist/client/assets/{index-B6gIYSAi.js → index-4aNFIt2P.js} +2 -2
- package/dist/client/assets/{index-DKZ2zjKb.js → index-CYmCSGd9.js} +1 -1
- package/dist/client/assets/{index-Dh4GqdsZ.js → index-C_ovNVSG.js} +1 -1
- package/dist/client/assets/index-Chyi6JKI.js +1 -0
- package/dist/client/assets/{index-BDELOfSs.js → index-CoLsoEv2.js} +16 -16
- package/dist/client/assets/{index-DejlCbgi.js → index-CuYW0lru.js} +1 -1
- package/dist/client/assets/{index-G899Mwwz.js → index-Czg4DChE.js} +1 -1
- package/dist/client/assets/index-DIhXATA_.js +173 -0
- package/dist/client/assets/{index-CczqpYmb.js → index-DnrwxVNx.js} +1 -1
- package/dist/client/assets/{index-kW87eoYl.js → index-FUeBfl3-.js} +3 -3
- package/dist/client/assets/{index-Bq8gS4_7.js → index-GdjtudVZ.js} +1 -1
- package/dist/client/assets/{index-LRYSqCUf.js → index-OZYjiADY.js} +1 -1
- package/dist/client/assets/{index-BGNS1OgZ.js → index-VfHbVSbi.js} +1 -1
- package/dist/client/assets/{index-DvtTPSSz.js → index-mYkDUksJ.js} +2 -2
- package/dist/client/assets/{index-redirect-QoYcGrYH.js → index-redirect-OuAmXGHj.js} +1 -1
- package/dist/client/assets/{input-BUVWi6ji.js → input-BNciDZ-m.js} +1 -1
- package/dist/client/assets/{integration-icon-RxSgmsqJ.js → integration-icon-DOJbY39B.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Cg5P2m_Y.js → invite-member-dialog-B084d8DU.js} +1 -1
- package/dist/client/assets/{label-DoX8QwZg.js → label-CAQUmjgF.js} +1 -1
- package/dist/client/assets/{layout-C46sf1QP.js → layout-D4WQxrU-.js} +1 -1
- package/dist/client/assets/{login-C5rPpeku.js → login-Bh3mO67k.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DayJEOBQ.js → mcp-oauth-Cbcz8u9b.js} +1 -1
- package/dist/client/assets/{members-BGQwgaxl.js → members-DctDjLbb.js} +1 -1
- package/dist/client/assets/{monaco-editor-BQzusA3f.js → monaco-editor-BkksA5a6.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-cCie6bHV.js → monitoring-stats-row-DLbBnTSL.js} +1 -1
- package/dist/client/assets/{multi-select-C7UKUlA7.js → multi-select-Rhfv-J3X.js} +1 -1
- package/dist/client/assets/{oauth-callback-BfQDJq5F.js → oauth-callback-BYakKLJp.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CCEPN7ut.js → oauth-callback-ai-provider-zjPBoC0T.js} +1 -1
- package/dist/client/assets/{onboarding-fd5CG08c.js → onboarding-BBkdv36T.js} +1 -1
- package/dist/client/assets/{org-install-Dl_4sb8U.js → org-install-D6TrHg8B.js} +1 -1
- package/dist/client/assets/{org-layout-Cn6g2hBG.js → org-layout-CtHQg4L1.js} +1 -1
- package/dist/client/assets/{organization-choice-D7thp0nF.js → organization-choice-DzyDzoXM.js} +1 -1
- package/dist/client/assets/{orgs-BWXnjR-G.js → orgs-DVB50bRo.js} +1 -1
- package/dist/client/assets/{page-seo-form-low418oG.js → page-seo-form-DfCox7SM.js} +1 -1
- package/dist/client/assets/page-seo-sheet-fzQmqAvt.js +1 -0
- package/dist/client/assets/{popover-1iWni6pj.js → popover-LtbmrOvT.js} +1 -1
- package/dist/client/assets/post-editor-D13T-rLR.js +1 -0
- package/dist/client/assets/{primitives-BV45qvF6.js → primitives-Dw1Ili_8.js} +1 -1
- package/dist/client/assets/{profile-C09oJ7nj.js → profile-C4YAPcRV.js} +1 -1
- package/dist/client/assets/project-app-view-DF_t4Ll1.js +1 -0
- package/dist/client/assets/record-editor-Dy3vDwHR.js +1 -0
- package/dist/client/assets/redirect-editor-B7oO-o55.js +1 -0
- package/dist/client/assets/registry-D693y_4v.js +2 -0
- package/dist/client/assets/{registry-layout-C4z50gL3.js → registry-layout-oMxr3SMs.js} +1 -1
- package/dist/client/assets/{reports-BHGC1TMn.js → reports-B2z2VxmB.js} +1 -1
- package/dist/client/assets/{require-capability-NMkQ7p2n.js → require-capability-D6LDcBsB.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BdTGAOVV.js → required-auth-layout-DXQiZuQo.js} +1 -1
- package/dist/client/assets/{reset-password-WfkYhHBu.js → reset-password-Dk7trBMv.js} +1 -1
- package/dist/client/assets/roles-BFz4XAgA.js +1 -0
- package/dist/client/assets/{search-input-DvuYITM0.js → search-input-Cb2dICCQ.js} +1 -1
- package/dist/client/assets/{secrets-C2UBhfFr.js → secrets-BVK6z_jx.js} +1 -1
- package/dist/client/assets/{sections-editor-Blzdp0oy.js → sections-editor-C3PAFhks.js} +2 -2
- package/dist/client/assets/{select-gkpsAlUm.js → select-h6iD6dPg.js} +1 -1
- package/dist/client/assets/{select-model-DE9e2e1e.js → select-model-CREUOZ29.js} +2 -2
- package/dist/client/assets/{self-tool-result-2G6-rtik.js → self-tool-result-CHXpzbky.js} +1 -1
- package/dist/client/assets/seo-editor-BhEvKyYt.js +1 -0
- package/dist/client/assets/{settings-layout-CwsTbQU0.js → settings-layout-CjMT8s_E.js} +1 -1
- package/dist/client/assets/{settings-section-BhliH2-8.js → settings-section-COU9ODVO.js} +1 -1
- package/dist/client/assets/{shell-controls-HysOBF2a.js → shell-controls-BC0zs4AV.js} +1 -1
- package/dist/client/assets/{shell-layout-F-ok_nx8.js → shell-layout-61057r5X.js} +1 -1
- package/dist/client/assets/{sidebar-DjP0hlIN.js → sidebar-BxF88HnL.js} +1 -1
- package/dist/client/assets/{skeleton-1fz4b835.js → skeleton-CpLAJuj1.js} +1 -1
- package/dist/client/assets/{sso-BA16hQgw.js → sso-BPuRwEKw.js} +1 -1
- package/dist/client/assets/store-registry-C6sCneNz.js +2 -0
- package/dist/client/assets/{store-DvmwXBiB.js → store-yo-HFKRU.js} +1 -1
- package/dist/client/assets/{studio-tools-hO5SJ9L1.js → studio-tools-9SvAU5Is.js} +1 -1
- package/dist/client/assets/{switch-BSb1YfEU.js → switch-D1gI_P-a.js} +1 -1
- package/dist/client/assets/{table-BO-Pqce3.js → table-C_rqsM95.js} +1 -1
- package/dist/client/assets/{tabs-BaUdekDU.js → tabs-NifTcWDa.js} +1 -1
- package/dist/client/assets/{textarea-CJ9nnedq.js → textarea-CNGAKeiL.js} +1 -1
- package/dist/client/assets/{toggle-group-BLEtqopd.js → toggle-group-BdAyJvtA.js} +1 -1
- package/dist/client/assets/{toolbar-mHxlKpgC.js → toolbar-DX36rQ9r.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-tX4cl55G.js → toolbar-icon-button-SwBha1Vd.js} +1 -1
- package/dist/client/assets/{tooltip-MpF93QwW.js → tooltip-D0_JD72b.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DOWHTDqA.js → use-ai-providers-9MDT4p7u.js} +1 -1
- package/dist/client/assets/{use-automations-D9Z5baDr.js → use-automations-CsRi3Z_j.js} +1 -1
- package/dist/client/assets/{use-autosave-DWH_u4bp.js → use-autosave-CAwYUqDx.js} +1 -1
- package/dist/client/assets/{use-capability-D9_H5dnX.js → use-capability-D1bAtSLF.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BL0-k7e9.js → use-clock-tick-DN2mcl2v.js} +1 -1
- package/dist/client/assets/{use-collections-BwkNh9s8.js → use-collections-BYgNxcGQ.js} +1 -1
- package/dist/client/assets/{use-connection-Dyi0y--H.js → use-connection-By5m-b5L.js} +1 -1
- package/dist/client/assets/{use-copy-DD-AY19W.js → use-copy-B_oJd3vm.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-NhUMTYbb.js → use-create-virtual-mcp-DrM85Hz7.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CWt391ns.js → use-debounced-autosave-Dnk4qlNK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Bb7tMvOa.js → use-debounced-value-BO_s9ycZ.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DRClHKlt.js → use-deco-credits-Bi6XTefP.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BXDhFIv7.js → use-decopilot-events-q_5BSKQo.js} +1 -1
- package/dist/client/assets/{use-delete-connection-6W9qWG0y.js → use-delete-connection-Bm_sCz8Z.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BYh8bdhB.js → use-deployment-admin-CjbioHkZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-DjyD5Omy.js → use-file-configs-Bll6WOFD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-AWTzpLPw.js → use-infinite-scroll-C0x8AKi9.js} +1 -1
- package/dist/client/assets/{use-join-requests-CGldJY9N.js → use-join-requests-BLsTn8B7.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CSloTF4V.js → use-mcp-auth-status-C2PNgxdD.js} +1 -1
- package/dist/client/assets/{use-mcp-client-t1Lq9dtN.js → use-mcp-client-uhBk68dW.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CCr3WLAZ.js → use-mcp-tools-BY8mBpuN.js} +1 -1
- package/dist/client/assets/{use-members-B0yMwrOg.js → use-members-BecITS0A.js} +1 -1
- package/dist/client/assets/{use-mobile-DKQP_Jss.js → use-mobile-DaA_aN8t.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cwegpci4.js → use-navigate-to-agent-CfntK8Bi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cj6dUtY9.js → use-org-auth-client-DTOjvCAF.js} +1 -1
- package/dist/client/assets/{use-org-sso-z04b3p1a.js → use-org-sso-Ck_byfbY.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CGng68qz.js → use-organization-roles-BPJ6IDp7.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bs5bz6s7.js → use-organization-settings-9n_iIErO.js} +1 -1
- package/dist/client/assets/{use-registry-connections-izs-KLy2.js → use-registry-connections-DB5XyBJp.js} +1 -1
- package/dist/client/assets/{use-secrets-BRyksvJu.js → use-secrets-DHximN5S.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CCDNWlCZ.js → use-status-sounds-P_jw-5Hu.js} +1 -1
- package/dist/client/assets/{use-view-mode-CUhUbUhu.js → use-view-mode-CXo4T0HC.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CFX-alhS.js → use-virtual-mcp-Cx3kfmKl.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BB5_ANL9.js +1 -0
- package/dist/client/assets/{useRouterState-seAdVQEm.js → useRouterState-BUuoW_5Y.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BslLX2Br.js +1 -0
- package/dist/client/assets/{users-DuOSsUUl.js → users-CBEiZbgw.js} +1 -1
- package/dist/client/assets/variant-calendar-CV4OibVl.js +1 -0
- package/dist/client/assets/{view-mode-toggle-xB0T4AsL.js → view-mode-toggle-CV44u6dj.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/Tool01-BcPlknT9.js +0 -1
- package/dist/client/assets/ZoomOut-Mbjnh50O.js +0 -1
- package/dist/client/assets/agent-icon-wm2eb0Nq.js +0 -1
- package/dist/client/assets/agents-list-Dz15AE-1.js +0 -1
- package/dist/client/assets/ai-providers-BKooAHnA.js +0 -1
- package/dist/client/assets/app-editor-Baj_Q_pt.js +0 -1
- package/dist/client/assets/automations-c5wcHSrJ.js +0 -1
- package/dist/client/assets/bulk-category-panel-kbn3uWhA.js +0 -1
- package/dist/client/assets/category-editor-CIv3YUMC.js +0 -1
- package/dist/client/assets/collection-detail-xpBis_7_.js +0 -1
- package/dist/client/assets/commerce-onboarding-BaXxbYVf.js +0 -1
- package/dist/client/assets/connection-detail-Dve5jUgE.js +0 -1
- package/dist/client/assets/connections-JiFN616P.js +0 -1
- package/dist/client/assets/file-explorer-DVcP3tZ1.js +0 -2
- package/dist/client/assets/index-BU2GOVdy.js +0 -1
- package/dist/client/assets/index-DyfzQj5m.js +0 -173
- package/dist/client/assets/page-seo-sheet-CSYYJs4Y.js +0 -1
- package/dist/client/assets/post-editor-mwSGk_ht.js +0 -1
- package/dist/client/assets/project-app-view-HOewAoV4.js +0 -1
- package/dist/client/assets/record-editor-CGSKkbo3.js +0 -1
- package/dist/client/assets/redirect-editor-C6ONqY6R.js +0 -1
- package/dist/client/assets/registry-XVj5joIQ.js +0 -2
- package/dist/client/assets/roles-BYjp-Ajk.js +0 -1
- package/dist/client/assets/seo-editor-Do4mbKfF.js +0 -1
- package/dist/client/assets/store-registry-DYJLdhuX.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C3eTHgjV.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BcApL0b0.js +0 -1
- package/dist/client/assets/variant-calendar-YBO9nK_z.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as V,c as se,j as t,B as K,i as ae,p as te,l as de,E as Ye,C as be,b as _e,u as Ze,a as Ne,z as et,G as tt,D as nt,M as st,J as ot,n as it,t as R,K as rt}from"./index-kW87eoYl.js";import{a as De,b as lt,g as ct,e as at}from"./extract-connection-data-DQ2KFguj.js";import{C as dt}from"./collection-display-button-ClhtIWW8.js";import{S as mt}from"./search-input-DvuYITM0.js";import{C as ut}from"./collection-tabs-C-nwiHu-.js";import{C as Ce,u as pt,a as ke,g as ht}from"./connection-card-DAmJM9w3.js";import{E as gt}from"./empty-state-n5t0v7uI.js";import{P as ue}from"./index-Dh4GqdsZ.js";import{u as xt,D as ft}from"./use-delete-connection-6W9qWG0y.js";import{u as ye}from"./use-capability-D9_H5dnX.js";import{u as jt}from"./use-infinite-scroll-AWTzpLPw.js";import{u as yt}from"./use-view-mode-CUhUbUhu.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-nxq3-B6t.js";import{n as ge}from"./Tool02-Bt1NLhl1.js";import{D as Fe,a as Me,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-gLpw4bfG.js";import{D as Ct,a as vt,c as St,b as bt,d as _t,e as Nt,f as Dt}from"./drawer-ZJqvF-A5.js";import{u as kt}from"./use-mobile-DKQP_Jss.js";import{F as J,b as Q,c as Y,d as Z,f as ee,a as ve}from"./form-CEJ7NLQz.js";import{I as ie}from"./input-BUVWi6ji.js";import{S as At,a as wt,b as Tt,c as It,d as ce}from"./select-gkpsAlUm.js";import{T as Pt}from"./textarea-CJ9nnedq.js";import{b as Ke,u as $t}from"./use-connection-Dyi0y--H.js";import{u as Ot}from"./use-virtual-mcp-CFX-alhS.js";import{u as Lt}from"./studio-tools-hO5SJ9L1.js";import{s as je}from"./Star01-B4wdnyjY.js";import{s as Ue}from"./Plus-CeRRdRrw.js";import{K as Ft,J as Mt,ak as zt,ah as Vt}from"./agent-icon-wm2eb0Nq.js";import{s as He}from"./XClose-CcOoHUUk.js";import{i as pe,a as Se,E as Et,c as Bt,p as Kt,b as Ut,d as Ht}from"./connection-form-helpers-CmZoSIwh.js";import{a as Rt}from"./authenticate-and-persist-oauth-DSvl_dtV.js";import{I as Wt}from"./integration-icon-RxSgmsqJ.js";import{C as Re}from"./checkbox-BnAeGRmY.js";import{d as re,a as We,D as Xe,c as qe}from"./dropdown-menu-Bbpx10wk.js";import{i as Ge}from"./DotsVertical-SPVqsXfZ.js";import{s as Je}from"./Eye-BMAxGnGK.js";import{s as Qe}from"./Trash01-kZy-N3Xo.js";import"./use-mcp-client-t1Lq9dtN.js";import"./constants-D_FQAPnt.js";import"./auth-4uk65Jwa.js";import"./ArrowUp-fbYe80_F.js";import"./Check-wimNrbhN.js";import"./SwitchHorizontal01-DJnrgsIK.js";import"./List-Degct3aY.js";import"./tooltip-MpF93QwW.js";import"./view-mode-toggle-xB0T4AsL.js";import"./badge-tPEV-RxK.js";import"./SearchMd-DAd-Bkgu.js";import"./use-registry-connections-izs-KLy2.js";import"./use-organization-settings-Bs5bz6s7.js";import"./useInfiniteQuery-C3eTHgjV.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-BiR2GL-H.js";import"./sidebar-DjP0hlIN.js";import"./LayoutLeft-DXtD65nH.js";import"./X-BZ_UKD_O.js";import"./label-DoX8QwZg.js";import"./ChevronDown-C5CvsmcD.js";import"./ChevronUp-DrDSr-mi.js";import"./use-collections-BwkNh9s8.js";import"./AlertCircle-Cvu85Sr0.js";import"./UserPlus01-DjC11OT1.js";import"./Tool01-BcPlknT9.js";import"./Settings02-BYgyRjAD.js";import"./XCircle-BgTed_Co.js";import"./ArrowUpRight-Bl5xGmHO.js";import"./TrendUp01-CwpvhxrP.js";import"./ZapSquare-95HyzbKN.js";import"./Users03-CLvfcW6v.js";import"./CheckCircle-Bl4aW-nn.js";import"./ChevronRight-Bno5_0xg.js";import"./Circle-g57xQlUQ.js";import"./Stars02-CmYTwRcx.js";import"./Copy01-1_zUjHG9.js";import"./ZoomOut-Mbjnh50O.js";import"./Globe01-DJ_zs5G_.js";import"./FilterLines-BnL8BlYf.js";import"./Flag01-BFVNOegT.js";import"./Globe04-DkaJlCI4.js";import"./HardDrive-yPFtg6_w.js";import"./Key01-BdmJ-1sf.js";import"./LinkExternal01-26v779uD.js";import"./Monitor01-B52VT9DG.js";import"./Sun-MykPXdqN.js";import"./Package-CKW2xi_w.js";import"./Palette-Bv_JYMYM.js";import"./Play-Dw4gmx5C.js";import"./SearchLg-EpoU8TwV.js";import"./Shield01-CMDd26KY.js";import"./Stars01-aA8DbwLH.js";import"./Upload01-Bpbyu6sv.js";import"./User01-DQn1mAZF.js";import"./Users01-CY0-Vc-O.js";import"./Zap-D3VZuva8.js";import"./mcp-oauth-DayJEOBQ.js";function Xt(h){const e=`deco-filters-${h}`,[n,d]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{d(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(h){const e=se.c(7),[n,d]=V.useState(h),[r,s]=V.useState(h?"desc":null);let i;e[0]!==r||e[1]!==n?(i=j=>{n!==j?(d(j),s("asc")):r==="asc"?s("desc"):r==="desc"&&(d(void 0),s(null))},e[0]=r,e[1]=n,e[2]=i):i=e[2];const m=i;let u;return e[3]!==m||e[4]!==r||e[5]!==n?(u={sortKey:n,sortDirection:r,handleSort:m},e[3]=m,e[4]=r,e[5]=n,e[6]=u):u=e[6],u}function Gt(h){const e=se.c(20),{namespace:n,resource:d,defaultSortKey:r,defaultViewMode:s}=h,i=r===void 0?"title":r,m=s===void 0?"table":s,[u,j]=V.useState(""),y=V.useDeferredValue(u),v=`${n}-${d}`,[N,l]=Xt(v),f=`mesh-${d}-filter-visible-${n}`;let c;e[0]!==f?(c=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=c):c=e[1];const[C,S]=V.useState(c);let b;e[2]!==f?(b=O=>{S(O),globalThis.localStorage?.setItem(f,String(O))},e[2]=f,e[3]=b):b=e[3];const T=b;let P;e[4]!==C||e[5]!==T?(P=()=>{T(!C)},e[4]=C,e[5]=T,e[6]=P):P=e[6];const o=P,[D,$]=yt(`mesh-${d}-${n}`,m),{sortKey:w,sortDirection:I,handleSort:L}=qt(i),M=w;let _;return e[7]!==C||e[8]!==N||e[9]!==L||e[10]!==u||e[11]!==y||e[12]!==T||e[13]!==l||e[14]!==$||e[15]!==I||e[16]!==M||e[17]!==o||e[18]!==D?(_={search:u,searchTerm:y,setSearch:j,filters:N,setFilters:l,filterBarVisible:C,setFilterBarVisible:T,toggleFilterBar:o,viewMode:D,setViewMode:$,sortKey:M,sortDirection:I,handleSort:L},e[7]=C,e[8]=N,e[9]=L,e[10]=u,e[11]=y,e[12]=T,e[13]=l,e[14]=$,e[15]=I,e[16]=M,e[17]=o,e[18]=D,e[19]=_):_=e[19],_}function Jt(h){const e=se.c(20),{open:n,onOpenChange:d,count:r,onConfirm:s}=h,i=r!==1?"s":"";let m;e[0]!==r||e[1]!==i?(m=t.jsxs(Ae,{children:["Delete ",r," connection",i,"?"]}),e[0]=r,e[1]=i,e[2]=m):m=e[2];const u=r!==1?"s":"";let j;e[3]!==u?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",u,". This action cannot be undone."]}),e[3]=u,e[4]=j):j=e[4];let y;e[5]!==m||e[6]!==j?(y=t.jsxs(Te,{children:[m,j]}),e[5]=m,e[6]=j,e[7]=y):y=e[7];let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ie,{children:"Cancel"}),e[8]=v):v=e[8];const N=r!==1?"s":"";let l;e[9]!==r||e[10]!==s||e[11]!==N?(l=t.jsxs(Pe,{children:[v,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",r," connection",N]})]}),e[9]=r,e[10]=s,e[11]=N,e[12]=l):l=e[12];let f;e[13]!==y||e[14]!==l?(f=t.jsxs(Oe,{children:[y,l]}),e[13]=y,e[14]=l,e[15]=f):f=e[15];let c;return e[16]!==d||e[17]!==n||e[18]!==f?(c=t.jsx(Le,{open:n,onOpenChange:d,children:f}),e[16]=d,e[17]=n,e[18]=f,e[19]=c):c=e[19],c}function Qt(h){return h._registryId?.includes("community-registry")===!0}function Yt(h){const e=se.c(58),{item:n,canManage:d,allConnections:r,connectedAppNames:s,connectingItemId:i,onNavigateConnected:m,onConnect:u}=h,[j,y]=V.useState(!1),[v,N]=V.useState(null);let l,f;e[0]!==s||e[1]!==n?(l=De(n)??"",f=s.has(l),e[0]=s,e[1]=n,e[2]=l,e[3]=f):(l=e[2],f=e[3]);const c=f,C=n._meta?.["mcp.mesh"],S=C?.friendlyName||C?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let T;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(T=n.server?.icons?.[0]?.src||lt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=T):T=e[6];const P=T;let o;if(e[7]!==r||e[8]!==l){let A;e[10]!==l?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=A):A=e[11],o=r.filter(A),e[7]=r,e[8]=l,e[9]=o}else o=e[9];const D=o;let $;e[12]!==n?($=Qt(n),e[12]=n,e[13]=$):$=e[13];const w=$;let I,L;e[14]!==D||e[15]!==d||e[16]!==w||e[17]!==c||e[18]!==n||e[19]!==u||e[20]!==m?(I=()=>{if(c){const A=D[0];A&&m(A);return}d&&L()},L=()=>{w?(N("connect"),y(!0)):u(n)},e[14]=D,e[15]=d,e[16]=w,e[17]=c,e[18]=n,e[19]=u,e[20]=m,e[21]=I,e[22]=L):(I=e[21],L=e[22]);let M;e[23]!==n||e[24]!==u||e[25]!==v?(M=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),v==="connect"&&u(n),N(null)},e[23]=n,e[24]=u,e[25]=v,e[26]=M):M=e[26];const _=M;let O;e[27]!==b||e[28]!==P||e[29]!==S?(O={title:S,description:b,icon:P},e[27]=b,e[28]=P,e[29]=S,e[30]=O):O=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(ge,{}),e[31]=q):q=e[31];let H;e[32]!==w||e[33]!==n._sourceIcon?(H=w&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=w,e[33]=n._sourceIcon,e[34]=H):H=e[34];let W;e[35]!==d||e[36]!==i||e[37]!==L||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):d&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),L()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=d,e[36]=i,e[37]=L,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let p;e[41]!==H||e[42]!==W?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[H,W]}),e[41]=H,e[42]=W,e[43]=p):p=e[43];let k;e[44]!==I||e[45]!==p||e[46]!==O?(k=t.jsx(Ce,{connection:O,fallbackIcon:q,onClick:I,headerActionsAlwaysVisible:!0,headerActions:p}),e[44]=I,e[45]=p,e[46]=O,e[47]=k):k=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Ie,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==_?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[U,t.jsx($e,{onClick:_,children:"Continue"})]})]}),e[50]=_,e[51]=E):E=e[51];let g;e[52]!==j||e[53]!==E?(g=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=g):g=e[54];let F;return e[55]!==k||e[56]!==g?(F=t.jsxs(t.Fragment,{children:[k,g]}),e[55]=k,e[56]=g,e[57]=F):F=e[57],F}function Zt(h){const e=se.c(51),{group:n,onOpen:d,selectionMode:r,selectedIds:s,onToggleSelect:i}=h;let m;if(e[0]!==n.connections||e[1]!==s){let _;e[3]!==s?(_=O=>s.has(O.id),e[3]=s,e[4]=_):_=e[4],m=n.connections.every(_),e[0]=n.connections,e[1]=s,e[2]=m}else m=e[2];const u=m;let j;if(e[5]!==n.connections||e[6]!==s){let _;e[8]!==s?(_=O=>s.has(O.id),e[8]=s,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j,v=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==v?(N={title:n.title,icon:n.icon,description:v},e[10]=n.icon,e[11]=n.title,e[12]=v,e[13]=N):N=e[13];let l;e[14]!==u||e[15]!==n.connections||e[16]!==d||e[17]!==i||e[18]!==s||e[19]!==r?(l=()=>r?(()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)})():d(),e[14]=u,e[15]=n.connections,e[16]=d,e[17]=i,e[18]=s,e[19]=r,e[20]=l):l=e[20];const f=r&&u&&"ring-2 ring-primary",c=r&&y&&!u&&"ring-1 ring-primary/50";let C;e[21]!==f||e[22]!==c?(C=de(f,c),e[21]=f,e[22]=c,e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ge,{}),e[24]=S):S=e[24];let b;e[25]!==u||e[26]!==n.connections||e[27]!==i||e[28]!==s||e[29]!==r||e[30]!==y?(b=r?t.jsx(Re,{checked:u?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const _ of n.connections)u?s.has(_.id)&&i(_.id):s.has(_.id)||i(_.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=u,e[26]=n.connections,e[27]=i,e[28]=s,e[29]=r,e[30]=y,e[31]=b):b=e[31];const T=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let P;e[32]!==T?(P=de("overflow-hidden transition-all duration-150 ease-out",T),e[32]=T,e[33]=P):P=e[33];let o;e[34]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Ge,{size:20})})}),e[34]=o):o=e[34];let D;e[35]!==d?(D=_=>{_.stopPropagation(),d()},e[35]=d,e[36]=D):D=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Je,{size:16}),e[37]=$):$=e[37];let w;e[38]!==D?(w=t.jsxs(Xe,{children:[o,t.jsx(qe,{align:"end",onClick:en,children:t.jsxs(re,{onClick:D,children:[$,"Open"]})})]}),e[38]=D,e[39]=w):w=e[39];let I;e[40]!==P||e[41]!==w?(I=t.jsx("div",{className:P,children:w}),e[40]=P,e[41]=w,e[42]=I):I=e[42];let L;e[43]!==b||e[44]!==I?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[b,I]}),e[43]=b,e[44]=I,e[45]=L):L=e[45];let M;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==C?(M=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:C,fallbackIcon:S,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=C,e[50]=M):M=e[50],M}function en(h){return h.stopPropagation()}function tn(h){return h.stopPropagation()}function nn(h){const e=se.c(34),{connection:n,isSelected:d,selectionMode:r,canManage:s,canManageAgents:i,onToggleSelect:m,onOpen:u,onToggleStatus:j,onDelete:y}=h;let v;e[0]!==d||e[1]!==m||e[2]!==r?(v=r?t.jsx(Re,{checked:d,onCheckedChange:m,onClick:rn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=d,e[1]=m,e[2]=r,e[3]=v):v=e[3];const N=r?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let l;e[4]!==N?(l=de("overflow-hidden transition-all duration-150 ease-out",N),e[4]=N,e[5]=l):l=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(We,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:on,children:t.jsx(Ge,{size:20})})}),e[6]=f):f=e[6];let c;e[7]!==u?(c=w=>{w.stopPropagation(),u()},e[7]=u,e[8]=c):c=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Je,{size:16}),e[9]=C):C=e[9];let S;e[10]!==c?(S=t.jsxs(re,{onClick:c,children:[C,"Open"]}),e[10]=c,e[11]=S):S=e[11];let b;e[12]!==s||e[13]!==i||e[14]!==m?(b=(s||i)&&t.jsxs(re,{onClick:w=>{w.stopPropagation(),m()},children:[t.jsx(zt,{size:16}),"Select"]}),e[12]=s,e[13]=i,e[14]=m,e[15]=b):b=e[15];let T;e[16]!==s||e[17]!==n||e[18]!==j?(T=s&&(n.status==="active"?t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("inactive")},children:[t.jsx(Ft,{size:16}),"Disable"]}):t.jsxs(re,{onClick:w=>{w.stopPropagation(),j("active")},children:[t.jsx(Mt,{size:16}),"Enable"]})),e[16]=s,e[17]=n,e[18]=j,e[19]=T):T=e[19];let P;e[20]!==s||e[21]!==y?(P=s&&t.jsxs(re,{variant:"destructive",onClick:w=>{w.stopPropagation(),y()},children:[t.jsx(Qe,{size:16}),"Delete"]}),e[20]=s,e[21]=y,e[22]=P):P=e[22];let o;e[23]!==P||e[24]!==S||e[25]!==b||e[26]!==T?(o=t.jsxs(Xe,{children:[f,t.jsxs(qe,{align:"end",onClick:sn,children:[S,b,T,P]})]}),e[23]=P,e[24]=S,e[25]=b,e[26]=T,e[27]=o):o=e[27];let D;e[28]!==o||e[29]!==l?(D=t.jsx("div",{className:l,children:o}),e[28]=o,e[29]=l,e[30]=D):D=e[30];let $;return e[31]!==v||e[32]!==D?($=t.jsxs("div",{className:"flex items-center gap-1",children:[v,D]}),e[31]=v,e[32]=D,e[33]=$):$=e[33],$}function sn(h){return h.stopPropagation()}function on(h){return h.stopPropagation()}function rn(h){return h.stopPropagation()}function ln(h){const e=se.c(23),{count:n,total:d,canManage:r,canManageAgents:s,onSelectAll:i,onDeselectAll:m,onDelete:u,onAddToAgent:j,onToggleStatus:y,onCancel:v}=h;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==m||e[4]!==i||e[5]!==d?(l=n<d?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",d,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:"Clear selection"}),e[2]=n,e[3]=m,e[4]=i,e[5]=d,e[6]=l):l=e[6];let f;e[7]!==s||e[8]!==j?(f=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ue,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=f):f=e[9];let c;e[10]!==r||e[11]!==u||e[12]!==y?(c=r&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=r,e[11]=u,e[12]=y,e[13]=c):c=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:13}),e[14]=C):C=e[14];let S;e[15]!==v?(S=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:C}),e[15]=v,e[16]=S):S=e[16];let b;return e[17]!==N||e[18]!==l||e[19]!==f||e[20]!==c||e[21]!==S?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,f,c,S]})}),e[17]=N,e[18]=l,e[19]=f,e[20]=c,e[21]=S,e[22]=b):b=e[22],b}function cn(h){const e=se.c(25),{open:n,onOpenChange:d,agents:r,onConfirm:s}=h,[i,m]=V.useState(null);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=u):u=e[0];let j;e[1]!==r||e[2]!==i?(j=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):r.map(b=>t.jsxs("button",{type:"button",onClick:()=>m(b.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Wt,{icon:b.icon,name:b.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=r,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let v;e[6]!==d?(v=t.jsx(K,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e[6]=d,e[7]=v):v=e[7];const N=!i;let l;e[8]!==s||e[9]!==d||e[10]!==i?(l=()=>{i&&(s(i),d(!1),m(null))},e[8]=s,e[9]=d,e[10]=i,e[11]=l):l=e[11];let f;e[12]!==N||e[13]!==l?(f=t.jsx(K,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=f):f=e[14];let c;e[15]!==v||e[16]!==f?(c=t.jsxs(Ve,{children:[v,f]}),e[15]=v,e[16]=f,e[17]=c):c=e[17];let C;e[18]!==y||e[19]!==c?(C=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[u,y,c]}),e[18]=y,e[19]=c,e[20]=C):C=e[20];let S;return e[21]!==d||e[22]!==n||e[23]!==C?(S=t.jsx(Be,{open:n,onOpenChange:d,children:C}),e[21]=d,e[22]=n,e[23]=C,e[24]=S):S=e[24],S}function an({listState:h,activeTab:e,typeFilter:n,statusFilter:d,registryFilter:r,enabledRegistries:s}){const{org:i}=be(),m=it(),u=_e(),{data:j}=Ne.useSession(),y=Ke(),v=$t(h),N=xt(),{granted:l}=ye("connections:manage"),{granted:f}=ye("agents:manage"),[c,C]=V.useState(new Set),S=c.size>0,[b,T]=V.useState(!1),[P,o]=V.useState(!1),[D,$]=V.useState(null),w=Ot(),I=v.filter(a=>!(n!=="ALL"&&a.connection_type!==n||d!=="ALL"&&a.status!==d)),L=ht(I),M=a=>{C(x=>{const B=new Set(x);return B.has(a)?B.delete(a):B.add(a),B})},_=()=>{C(new Set)},O=ke(s,h.searchTerm),q=O.items,H=jt(O.loadMore,O.hasMore,O.isLoadingMore),W=new Set(v.filter(a=>a.app_name).map(a=>a.app_name)),p=r==="ALL"||s.some(a=>a.id===r)?r:"ALL",k=h.search.length>0,z=e==="all"||k?q.filter(a=>{if(p!=="ALL"&&a._registryId!==p)return!1;if(k){const x=De(a);if(x&&W.has(x))return!1}return!0}):[],U=e==="connected"||k?L:[],E=async a=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,source:"connections_page"}),$(a.id);try{const x=at(a,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:ne}=await y.create.mutateAsync(x),le=await Rt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await m.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),F(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},g=Lt(),F=()=>{m.invalidateQueries({predicate:a=>{const x=a.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{T(!1);const a=[...c];te("connections_bulk_delete",{count:a.length});let x=0;for(const B of a)try{await g.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}F(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),_()},oe=async(a,x)=>{try{await y.update.mutateAsync({id:a,data:{status:x}}),F(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async a=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:a});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:a}}),B++}catch{}F(),R.success(`${a==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),_()},me=async a=>{const x=w.find(X=>X.id===a);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:a,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await g.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:a,data:{connections:[...x.connections,...G]}}),m.invalidateQueries({predicate:X=>{const ne=X.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),_()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...N}),t.jsx(Jt,{open:b,onOpenChange:T,count:c.size,onConfirm:A}),t.jsx(cn,{open:P,onOpenChange:o,agents:w,onConfirm:me}),O.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(k?z.length===0&&I.length===0:e==="all"?z.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:h.search?`No Connections match "${h.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(a=>{if(a.type==="group")return t.jsx(Zt,{group:a,onOpen:()=>{u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:a.key}})},selectionMode:S,selectedIds:c,onToggleSelect:M},a.key);const x=a.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(ge,{}),onClick:()=>S?M(x.id):u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),className:de(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(nn,{connection:x,isSelected:B,selectionMode:S,canManage:l,canManageAgents:f,onToggleSelect:()=>M(x.id),onOpen:()=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>N.requestDelete(x)})},x.id)}),z.map(a=>t.jsx(Yt,{item:a,canManage:l,allConnections:v,connectedAppNames:W,connectingItemId:D,onNavigateConnected:x=>u({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(x)}}),onConnect:E},`catalog-${a._registryId}:${a.id}`)),(e==="all"||k)&&s.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||k)&&O.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),S&&t.jsx(ln,{count:c.size,total:I.length,canManage:l,canManageAgents:f,onSelectAll:()=>{C(new Set(I.map(a=>a.id)))},onDeselectAll:()=>C(new Set),onDelete:()=>T(!0),onAddToAgent:()=>o(!0),onToggleStatus:xe,onCancel:_})]})}function dn(){const{org:h}=be(),e=_e(),n=Ze({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:r}=et(),s=kt(),{granted:i}=ye("connections:manage"),m=Gt({namespace:h.slug,resource:"connections"}),u=Ke(),[j,y]=tt(nt.connectionsTab(h.slug),p=>n.tab==="all"||n.tab==="connected"?n.tab:p??"all"),[v,N]=V.useState("ALL"),[l,f]=V.useState("ALL"),[c,C]=V.useState("ALL"),S=pt(),T=ke(S,m.searchTerm).items,P=m.search!==m.searchTerm,o=st({resolver:ot(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=o.watch("ui_type"),$=o.watch("connection_url"),w=o.watch("npx_package"),I=pe({uiType:D,connectionUrl:$??"",npxPackage:w??""})??Se({uiType:D,connectionUrl:$??"",registryItems:T}),L=i&&n.action==="create",M=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:h.slug},search:{action:"create"}})},_=()=>{e({to:"/$org/settings/connections",params:{org:h.slug},search:{}})},O=async p=>{let k,z=null,U=null,E=null;p.ui_type==="NPX"?(k="STDIO",z="",E=Ut(p.npx_package||"",p.env_vars||[])):p.ui_type==="STDIO"?(k="STDIO",z="",E=Ht(p.stdio_command||"",p.stdio_args||"",p.stdio_cwd,p.env_vars||[])):(k=p.ui_type,z=p.connection_url||"",U=p.connection_token||null);const g=ct("conn");te("connection_custom_created",{connection_type:k,ui_type:p.ui_type}),await u.create.mutateAsync({id:g,title:p.title,description:p.description||null,connection_type:k,connection_url:z,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:h.id,icon:p.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),_(),o.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:h.slug,appSlug:he({app_name:null,connection_url:z,title:p.title,id:g})}})},q=p=>{p||(L&&_(),o.reset())},H=p=>{const k=p.trim();if(!k)return;const z=!!o.formState.dirtyFields.title,U=!!o.formState.dirtyFields.description,E=!!o.formState.dirtyFields.env_vars,g=A=>{if(A&&(!z&&!o.getValues("title").trim()&&A.title&&o.setValue("title",A.title,{shouldDirty:!1}),!U&&!(o.getValues("description")??"").trim()&&A.description&&o.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=o.getValues("env_vars")??[],xe=new Set(oe.map(a=>a.key)),me=A.envVarKeys.filter(a=>!xe.has(a));me.length>0&&o.setValue("env_vars",[...oe,...me.map(a=>({key:a,value:""}))],{shouldDirty:!0})}},F=Kt(k);if(F&&r){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",F.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(pe({uiType:"NPX",npxPackage:F.packageName}));return}if(k.startsWith("http://")||k.startsWith("https://")){const A=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";o.setValue("ui_type",A,{shouldDirty:!0}),o.setValue("connection_url",k,{shouldDirty:!0}),g(pe({uiType:A,connectionUrl:k})??Se({uiType:A,connectionUrl:k,registryItems:T}));return}D==="NPX"&&g(pe({uiType:"NPX",npxPackage:k}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:M,children:[t.jsx(Ue,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const p="Create Connection",k="Create a custom connection in your organization. Fill in the details below.",z=o.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:o.control,name:"ui_type",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(At,{value:g.value,onValueChange:g.onChange,children:[t.jsx(Z,{children:t.jsx(wt,{children:t.jsx(Tt,{})})}),t.jsxs(It,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(J,{control:o.control,name:"npx_package",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("npx_package",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:o.control,name:"stdio_command",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...g,value:g.value??""})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"stdio_args",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"stdio_cwd",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...g,value:g.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(J,{control:o.control,name:"env_vars",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Et,{value:g.value??[],onChange:g.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:o.control,name:"connection_url",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...g,value:g.value??"",onPaste:F=>{const A=F.clipboardData.getData("text");A&&(F.preventDefault(),o.setValue("connection_url",A.trim(),{shouldDirty:!0}),H(A))},onBlur:F=>{H(F.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"connection_token",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:I?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:I?.token?.placeholder??"Bearer token or API key",...g,value:g.value??""})}),I?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[I.token.helperText,I.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(J,{control:o.control,name:"title",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...g})}),t.jsx(ee,{})]})}),t.jsx(J,{control:o.control,name:"description",render:({field:g})=>t.jsxs(Q,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Pt,{placeholder:"A brief description of this connection",rows:3,...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),E=L;return s?t.jsx(Ct,{open:E,onOpenChange:q,children:t.jsxs(vt,{className:"max-h-[90vh]",children:[t.jsx(St,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(bt,{children:p}),t.jsx(_t,{className:"mt-1",children:k})]}),t.jsx(Nt,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(He,{size:16})})})]})}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Dt,{children:t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:p}),t.jsx(ze,{children:k})]}),t.jsx(ve,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(O),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:m.search,onChange:m.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:p=>{p.key==="Escape"&&(m.setSearch(""),p.target.blur())}}),t.jsx(dt,{sortKey:m.sortKey,sortDirection:m.sortDirection,onSort:m.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:v,onChange:p=>N(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:p=>f(p||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...S.length>1?[{label:"Registry",value:c,onChange:p=>C(p||"ALL"),options:[{id:"ALL",label:"All registries"},...S.map(p=>({id:p.id,label:p.id.includes("community-registry")?"Community MCP Registry":p.title}))]}]:[]]})]}),W]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:p=>{const k=p;k!==j&&te("connections_page_tab_changed",{to_tab:k}),y(k)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:P?.5:1,transition:P?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:P?"none":"auto"},children:t.jsx(an,{listState:m,activeTab:j,typeFilter:v,statusFilter:l,registryFilter:c,enabledRegistries:S})})})]})})})]})})}function eo(){const h=se.c(1);let e;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(dn,{})})}),h[0]=e):e=h[0],e}export{eo as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Y,r as u,j as r,i as oe,B as xe,d$ as St,aO as Mt,aU as re,e0 as Dt,e1 as Rt,e2 as Pt,e3 as Et,bO as kt,e4 as Tt,e5 as Ue,aQ as Ot,e6 as At,e7 as Lt,e8 as Ft,e9 as It,ea as $t,eb as _t,ec as zt,ed as Gt,ee as Wt,l as ie,n as Kt,t as q,K as Fe}from"./index-kW87eoYl.js";import{F as Bt,l as Ut}from"./index-DKZ2zjKb.js";import{d as Vt,ay as qt,az as Qt,aA as de,aB as Ht,a0 as Ie}from"./agent-icon-wm2eb0Nq.js";import{a as Xt}from"./Tool01-BcPlknT9.js";import{s as Yt}from"./XClose-CcOoHUUk.js";import{A as Jt}from"./automation-runs-J5VVC0pP.js";import{b as $e,T as _e,a as ze}from"./tooltip-MpF93QwW.js";import{b as Zt}from"./chat-context-CXmj1wzI.js";import{u as en}from"./shell-layout-F-ok_nx8.js";import{s as ue,a as Ge,f as tn}from"./index-BDELOfSs.js";import{a as nn,h as rn,D as on,c as sn,d as an,e as ln}from"./dialog-gLpw4bfG.js";import{I as We}from"./input-BUVWi6ji.js";import{c as cn,d as dn,b as un,A as fn,g as mn,e as pn,a as xn,f as hn}from"./alert-dialog-nxq3-B6t.js";import{t as gn}from"./ChevronDown-C5CvsmcD.js";import{i as vn}from"./ChevronRight-Bno5_0xg.js";import{a as Cn}from"./ZoomOut-Mbjnh50O.js";import{v as yn,E as wn,w as Ke,x as Ce,y as bn,z as jn,A as Nn,C as H,D as fe,g as ye,G as we,I as Sn,J as Mn,K as be,M as me,N as je,O as Dn,P as Rn}from"./index-DyfzQj5m.js";import"./AlertCircle-Cvu85Sr0.js";import"./UserPlus01-DjC11OT1.js";import"./ArrowUp-fbYe80_F.js";import"./Settings02-BYgyRjAD.js";import"./Tool02-Bt1NLhl1.js";import"./XCircle-BgTed_Co.js";import"./ArrowUpRight-Bl5xGmHO.js";import"./TrendUp01-CwpvhxrP.js";import"./ZapSquare-95HyzbKN.js";import"./Users03-CLvfcW6v.js";import"./CheckCircle-Bl4aW-nn.js";import"./Check-wimNrbhN.js";import"./ChevronUp-DrDSr-mi.js";import"./Circle-g57xQlUQ.js";import"./Stars02-CmYTwRcx.js";import"./Copy01-1_zUjHG9.js";import"./DotsVertical-SPVqsXfZ.js";import"./Globe01-DJ_zs5G_.js";import"./Eye-BMAxGnGK.js";import"./FilterLines-BnL8BlYf.js";import"./Flag01-BFVNOegT.js";import"./Star01-B4wdnyjY.js";import"./Globe04-DkaJlCI4.js";import"./SwitchHorizontal01-DJnrgsIK.js";import"./HardDrive-yPFtg6_w.js";import"./Key01-BdmJ-1sf.js";import"./LayoutLeft-DXtD65nH.js";import"./LinkExternal01-26v779uD.js";import"./List-Degct3aY.js";import"./Monitor01-B52VT9DG.js";import"./Sun-MykPXdqN.js";import"./Package-CKW2xi_w.js";import"./Palette-Bv_JYMYM.js";import"./Play-Dw4gmx5C.js";import"./Plus-CeRRdRrw.js";import"./SearchLg-EpoU8TwV.js";import"./SearchMd-DAd-Bkgu.js";import"./Shield01-CMDd26KY.js";import"./Stars01-aA8DbwLH.js";import"./Trash01-kZy-N3Xo.js";import"./Upload01-Bpbyu6sv.js";import"./User01-DQn1mAZF.js";import"./Users01-CY0-Vc-O.js";import"./X-BZ_UKD_O.js";import"./Zap-D3VZuva8.js";import"./select-gkpsAlUm.js";import"./useInfiniteQuery-C3eTHgjV.js";import"./use-infinite-scroll-AWTzpLPw.js";import"./use-connection-Dyi0y--H.js";import"./use-collections-BwkNh9s8.js";import"./use-mcp-client-t1Lq9dtN.js";import"./constants-D_FQAPnt.js";import"./auth-4uk65Jwa.js";import"./use-virtual-mcp-CFX-alhS.js";import"./card-BiR2GL-H.js";import"./sidebar-DjP0hlIN.js";import"./use-mobile-DKQP_Jss.js";import"./table-BO-Pqce3.js";import"./empty-state-n5t0v7uI.js";import"./use-members-B0yMwrOg.js";import"./use-org-auth-client-Cj6dUtY9.js";import"./use-clock-tick-BL0-k7e9.js";import"./use-automations-D9Z5baDr.js";import"./studio-tools-hO5SJ9L1.js";import"./useSuspenseInfiniteQuery-BcApL0b0.js";import"./avatar-DJ2MPOjW.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DD-AY19W.js";import"./file-type-icon-BZvnDuN0.js";import"./tab-id-BijBBRwE.js";import"./hooks-qsHMC7Ia.js";import"./decopilot-sse-pool-COulQsQu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-BQzusA3f.js";import"./index-CczqpYmb.js";import"./integration-icon-RxSgmsqJ.js";import"./use-navigate-to-agent-Cwegpci4.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BSihuL6I.js";import"./form-CEJ7NLQz.js";import"./label-DoX8QwZg.js";import"./autosend-C3_RSy-l.js";import"./use-ai-providers-DOWHTDqA.js";import"./use-decopilot-events-BXDhFIv7.js";import"./use-organization-settings-Bs5bz6s7.js";import"./required-auth-layout-BdTGAOVV.js";import"./use-org-sso-z04b3p1a.js";import"./drawer-ZJqvF-A5.js";import"./collection-search-CIVfwIbs.js";import"./tabs-BaUdekDU.js";import"./toggle-group-BLEtqopd.js";import"./use-deco-credits-DRClHKlt.js";import"./extract-connection-data-DQ2KFguj.js";import"./connection-card-DAmJM9w3.js";import"./use-registry-connections-izs-KLy2.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CJ9nnedq.js";import"./connection-form-helpers-CmZoSIwh.js";import"./authenticate-and-persist-oauth-DSvl_dtV.js";import"./mcp-oauth-DayJEOBQ.js";import"./collection-tabs-C-nwiHu-.js";import"./badge-tPEV-RxK.js";import"./connect-desktop-dialog-B4yVc_7M.js";import"./select-model-DE9e2e1e.js";import"./checkbox-BnAeGRmY.js";import"./skeleton-1fz4b835.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BhliH2-8.js";import"./command-CZ7egaGh.js";import"./index-LRYSqCUf.js";import"./popover-1iWni6pj.js";import"./dropdown-menu-Bbpx10wk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CCDNWlCZ.js";import"./toolbar-mHxlKpgC.js";import"./use-mcp-tools-CCr3WLAZ.js";import"./use-capability-D9_H5dnX.js";import"./use-debounced-autosave-CWt391ns.js";import"./index-Dh4GqdsZ.js";import"./search-input-DvuYITM0.js";import"./use-mcp-auth-status-CSloTF4V.js";import"./switch-BSb1YfEU.js";import"./github-repo-picker-BXgmr-ZU.js";import"./use-debounced-value-Bb7tMvOa.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-BRyksvJu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DVErIwai.js";import"./index-DvtTPSSz.js";import"./get-initials-D-f_fDFw.js";import"./calendar-Csl0UCmv.js";import"./toolbar-icon-button-tX4cl55G.js";import"./use-file-configs-DjyD5Omy.js";import"./automation-list-row-BbQKDFDI.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(a){const e=Y.c(51),{open:i,mode:s,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=a,C=c===void 0?"":c,d=h===void 0?!1:h,[x,y]=u.useState(C),[D,k]=u.useState(i),g=Pn[s];i!==D&&(k(i),i&&y(C));let b;e[0]!==d||e[1]!==v?(b=B=>{!B&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async B=>{B.preventDefault();const Q=x.trim();!Q||d||await p(Q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(nn,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(rn,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(on,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(We,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=B=>y(B.target.value),e[17]=I):I=e[17];let $;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?($=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(We,{id:"file-explorer-name",value:x,onChange:I,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=$):$=e[21];let R;e[22]!==$||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,$]}),e[22]=$,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(xe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let W;e[36]!==z||e[37]!==N?(W=r.jsx(xe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=W):W=e[38];let S;e[39]!==_||e[40]!==W?(S=r.jsxs(sn,{children:[_,W]}),e[39]=_,e[40]=W,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(an,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let V;return e[47]!==U||e[48]!==i||e[49]!==E?(V=r.jsx(ln,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=V):V=e[50],V}function kn(a){const e=Y.c(31),{deleteTarget:i,deleteDirtyPaths:s,fsActionPending:c,onOpenChange:f,onConfirm:h}=a,p=i!==null,v=i?.kind==="directory"?"folder":"file";let C;e[0]!==v?(C=r.jsxs(cn,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=C):C=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const y=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==s.length?(D=s.length>0&&r.jsxs(r.Fragment,{children:[" ",s.length===1?"One open file has unsaved changes that will be lost.":`${s.length} open files have unsaved changes that will be lost.`]}),e[4]=s.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==y||e[8]!==D?(k=r.jsxs(dn,{children:["This will permanently delete"," ",x,y,D]}),e[6]=x,e[7]=y,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==C||e[11]!==k?(g=r.jsxs(un,{children:[C,k]}),e[10]=C,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(fn,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(mn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(pn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(xn,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(hn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var Ne="ContextMenu",[Tn]=Ot(Ne,[Ue]),K=Ue(),[On,Ve]=Tn(Ne),qe=a=>{const{__scopeContextMenu:e,children:i,onOpenChange:s,dir:c,modal:f=!0}=a,[h,p]=u.useState(!1),v=K(e),C=kt(s),d=u.useCallback(x=>{p(x),C(x)},[C]);return r.jsx(On,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Tt,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};qe.displayName=Ne;var Qe="ContextMenuTrigger",He=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,disabled:s=!1,...c}=a,f=Ve(Qe,i),h=K(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),C=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(C.current),[]),x=y=>{p.current={x:y.clientX,y:y.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{s&&d()},[s,d]),r.jsxs(r.Fragment,{children:[r.jsx(St,{...h,virtualRef:v}),r.jsx(Mt.span,{"data-state":f.open?"open":"closed","data-disabled":s?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:s?a.onContextMenu:re(a.onContextMenu,y=>{d(),x(y),y.preventDefault()}),onPointerDown:s?a.onPointerDown:re(a.onPointerDown,pe(y=>{d(),C.current=window.setTimeout(()=>x(y),700)})),onPointerMove:s?a.onPointerMove:re(a.onPointerMove,pe(d)),onPointerCancel:s?a.onPointerCancel:re(a.onPointerCancel,pe(d)),onPointerUp:s?a.onPointerUp:re(a.onPointerUp,pe(d))})]})});He.displayName=Qe;var An="ContextMenuPortal",Xe=a=>{const{__scopeContextMenu:e,...i}=a,s=K(e);return r.jsx(Pt,{...s,...i})};Xe.displayName=An;var Ye="ContextMenuContent",Je=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=Ve(Ye,i),f=K(i),h=u.useRef(!1);return r.jsx(Et,{...f,...s,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{a.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{a.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Je.displayName=Ye;var Ln="ContextMenuGroup",Fn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(At,{...c,...s,ref:e})});Fn.displayName=Ln;var In="ContextMenuLabel",$n=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Lt,{...c,...s,ref:e})});$n.displayName=In;var _n="ContextMenuItem",Ze=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Dt,{...c,...s,ref:e})});Ze.displayName=_n;var zn="ContextMenuCheckboxItem",Gn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Ft,{...c,...s,ref:e})});Gn.displayName=zn;var Wn="ContextMenuRadioGroup",Kn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(It,{...c,...s,ref:e})});Kn.displayName=Wn;var Bn="ContextMenuRadioItem",Un=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx($t,{...c,...s,ref:e})});Un.displayName=Bn;var Vn="ContextMenuItemIndicator",qn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(_t,{...c,...s,ref:e})});qn.displayName=Vn;var Qn="ContextMenuSeparator",et=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Rt,{...c,...s,ref:e})});et.displayName=Qn;var Hn="ContextMenuArrow",Xn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(zt,{...c,...s,ref:e})});Xn.displayName=Hn;var Yn="ContextMenuSubTrigger",Jn=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Gt,{...c,...s,ref:e})});Jn.displayName=Yn;var Zn="ContextMenuSubContent",er=u.forwardRef((a,e)=>{const{__scopeContextMenu:i,...s}=a,c=K(i);return r.jsx(Wt,{...c,...s,ref:e,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});er.displayName=Zn;function pe(a){return e=>e.pointerType!=="mouse"?a(e):void 0}var tr=qe,nr=He,rr=Xe,or=Je,ir=Ze,sr=et;function ar(a){const e=Y.c(4);let i;e[0]!==a?({...i}=a,e[0]=a,e[1]=i):i=e[1];let s;return e[2]!==i?(s=r.jsx(tr,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=s):s=e[3],s}function lr(a){const e=Y.c(4);let i;e[0]!==a?({...i}=a,e[0]=a,e[1]=i):i=e[1];let s;return e[2]!==i?(s=r.jsx(nr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=s):s=e[3],s}function cr(a){const e=Y.c(8);let i,s;e[0]!==a?({className:i,...s}=a,e[0]=a,e[1]=i,e[2]=s):(i=e[1],s=e[2]);let c;e[3]!==i?(c=ie("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==s||e[6]!==c?(f=r.jsx(rr,{children:r.jsx(or,{"data-slot":"context-menu-content",className:c,...s})}),e[5]=s,e[6]=c,e[7]=f):f=e[7],f}function ee(a){const e=Y.c(12);let i,s,c,f;e[0]!==a?({className:i,inset:s,variant:f,...c}=a,e[0]=a,e[1]=i,e[2]=s,e[3]=c,e[4]=f):(i=e[1],s=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let v;return e[7]!==s||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(ir,{"data-slot":"context-menu-item","data-inset":s,"data-variant":h,className:p,...c}),e[7]=s,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Be(a){const e=Y.c(8);let i,s;e[0]!==a?({className:i,...s}=a,e[0]=a,e[1]=i,e[2]=s):(i=e[1],s=e[2]);let c;e[3]!==i?(c=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==s||e[6]!==c?(f=r.jsx(sr,{"data-slot":"context-menu-separator",className:c,...s}),e[5]=s,e[6]=c,e[7]=f):f=e[7],f}const dr="#d9a441";function ur(a){const e=Y.c(45),{node:i,depth:s,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:C,onNewFile:d,onNewFolder:x,onCopyPath:y,onCopyRelativePath:D,onRename:k,onDelete:g}=a,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${s*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==C?(G=()=>{C(),v()},e[4]=v,e[5]=C,e[6]=G):G=e[6];let I;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?(I=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(gn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:dr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=I):I=e[12];let $;e[13]!==i.name?($=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=$):$=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==I||e[19]!==$?(R=r.jsx(lr,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[I,$]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=I,e[19]=$,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Be,{}),e[25]=z):z=e[25];let N;e[26]!==y?(N=r.jsx(ee,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=N):N=e[27];let W;e[28]!==D?(W=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=W):W=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Be,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let V;e[33]!==g?(V=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=V):V=e[34];let B;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==W||e[39]!==E||e[40]!==V?(B=r.jsxs(cr,{className:"w-52",children:[P,_,z,N,W,S,E,V]}),e[35]=P,e[36]=_,e[37]=N,e[38]=W,e[39]=E,e[40]=V,e[41]=B):B=e[41];let Q;return e[42]!==B||e[43]!==R?(Q=r.jsxs(ar,{children:[R,B]}),e[42]=B,e[43]=R,e[44]=Q):Q=e[44],Q}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function fr(a,e,i,s){return`/api/${a}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${s}`}const mr="#94a3b8";function pr(a){const e=a.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:de,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:de,color:"#d9a441"}:e.endsWith(".json")?{Icon:Ht,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:de,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:de,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Xt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:Ie,color:"#64748b"}:{Icon:Ie,color:mr}}function ls({orgSlug:a,virtualMcpId:e,branch:i,openPath:s}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,C]=u.useState(new Set),[d,x]=u.useState(null),[y,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),I=u.useRef(0),$=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),W=u.useRef(null),[S,E]=u.useState(null),{sendMessage:V}=Zt(),{openSidePanel:B}=en(),Q=Kt(),[F,X]=u.useState(null),[he,ge]=u.useState(null),[se,ae]=u.useState(!1);async function J(t,n){const o=await fetch(fr(a,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function le(){Q.invalidateQueries({queryKey:Ge(a,e,i)})}function Se(t,n){navigator.clipboard.writeText(n).then(()=>q.success(`${t} copied`),()=>q.error(`Failed to copy ${t.toLowerCase()}`))}function tt(t){const n=Dn(t);if(!n)return;const o=`${a}/${e}/${i}`;Q.setQueryData(Fe.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),Q.invalidateQueries({queryKey:Fe.liveMeta(a,e,i)})}function nt(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>fe(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)tt(o)}function rt(t){const n=fe(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Me(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function ot(t){const n=fe(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Me(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function it(t){if(!F)return;const n=me(F.parentDir,t);if(je(n,h,p))throw new Error(`"${t}" already exists`);await J("write",{path:H(n),content:""}),await te(),await le(),X(null),ve(n)}async function st(t){if(!F)return;const n=me(F.parentDir,t);if(je(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await J("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),C(l=>{const m=new Set(l);for(const M of Ce(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function at(t){if(!F)return;const n=F.node.path,o=be(n),l=me(o,t);if(l===n){X(null);return}if(je(l,h,p))throw new Error(`"${t}" already exists`);await J("rename",{from:H(n),to:H(l)}),Me(m=>m===n?l:m.startsWith(`${n}/`)?me(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function lt(t){ae(!0);try{await J("unlink",{path:H(t.path),recursive:t.kind==="directory"}),nt(t),ot(t.path),await te(),await le(),ge(null),q.success(`Deleted "${t.name}"`)}catch(n){q.error(n instanceof Error?n.message:"Delete failed")}finally{ae(!1)}}async function ct(t){const n=Mn(t);if(n){q.error(n);return}ae(!0);try{F?.mode==="new-file"?(await it(t),q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await st(t),q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await at(t),q.success(`Renamed to "${t}"`))}catch(o){q.error(o instanceof Error?o.message:"Operation failed")}finally{ae(!1)}}const De=u.useRef(!1);De.current||(De.current=!0,$.current=te());const[dt,ut]=u.useState(null);if(s&&s!==dt){ut(s);const t=s;queueMicrotask(()=>{yn(t)&&ve(t).catch(n=>{q.error(n instanceof Error?n.message:"Failed to open file")})})}async function Re(t){const n=await J("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Pe(t,n,o){if(o!==I.current)return!1;let l=!1;return f(m=>{const M=n?Rn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&q.warning("File list truncated — some files may be hidden"),l}async function ft(t){const n=P.current.get(t);if(n)return n;const o=I.current,l=(async()=>{const m=await Re({pattern:"**/*",path:H(t),limit:Ke}),M=Pe(m,!0,o);return!M&&o===I.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Ee(t){if(!we(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await ft(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function mt(t){const n=new Set(R.current);for(const o of Ce(t)){if(!we(o,n))continue;if(await Ee(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++I.current;P.current.clear(),O(!0),_(new Set),C(new Set),G(new Set);try{const n=await Re({pattern:"**/*",limit:Ke,maxDepth:wn});Pe(n,!1,t),w(!0)}catch{j&&q.error("Failed to refresh file tree")}finally{O(!1)}}async function ke(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await J("read",{path:H(t),full:!0}),l=Sn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function pt(t,n){try{await J("write",{path:H(t),content:n}),ue("file saved via sandbox /write",{path:t}),Q.invalidateQueries({queryKey:Ge(a,e,i)});try{const o=await tn(a,e,i);ue("git status after save",o)}catch(o){ue("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){ue("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function xt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),ke(t)}function ht(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function Te(t){C(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function gt(t){if(we(t,R.current))try{if(await Ee(t))return}catch(n){q.error(n instanceof Error?n.message:"Failed to load folder");return}Te(t)}async function vt(t,n){if(n){Te(t);return}await gt(t)}async function ve(t){await $.current,await mt(t);const n=Ce(t);C(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),xt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?be(y.path):d?be(d):"/"}function Oe(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const yt=bn(h,p),Ae=jn(yt,v),Le=b?Ae.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Ae,Z=d?z.get(d):null,wt=Z?.loaded&&Z.editorValue!==Z.savedContent,bt=he?rt(he.path):[],jt=(t,n)=>{W.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await pt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function Nt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=ye(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),B("chat"),V({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),E(null)}return T&&!j?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Vt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:b,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs($e,{children:[r.jsx(_e,{asChild:!0,children:r.jsx(xe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Oe("new-file"),children:r.jsx(qt,{size:14})})}),r.jsx(ze,{side:"bottom",children:"New file"})]}),r.jsxs($e,{children:[r.jsx(_e,{asChild:!0,children:r.jsx(xe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Oe("new-folder"),children:r.jsx(Qt,{size:14})})}),r.jsx(ze,{side:"bottom",children:"New folder"})]})]}),r.jsx(Jt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Le.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",m=v.has(n.path),M=y?.path===n.path,ne=Nn(n.path,n.kind),ce=l&&L.has(n.path);return r.jsx(ur,{node:n,depth:o,isExpanded:m,isSelected:M,isLoading:ce,fileVisual:pr(n.name),onSelect:()=>D(n),onOpen:()=>{l?vt(n.path,m):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:ne}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:ne}),onCopyPath:()=>Se("Path",fe(n.path)),onCopyRelativePath:()=>Se("Relative path",H(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:ne}),onDelete:()=>ge(n)},n.path)}),j&&Le.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:b?`No files match "${b}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=z.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,m=t.split("/").pop()??t;return r.jsxs("div",{className:ie("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:m}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:M=>{M.stopPropagation(),ht(t)},children:r.jsx(Yt,{size:12})})]},t)})}),S&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Nt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&E(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&Z?.loaded?r.jsx(Bt,{language:ye(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:d,onChange:t=>{const n=d;n&&N(o=>{const l=new Map(o),m=l.get(n);return m&&l.set(n,{...m,editorValue:t??""}),l})},onMount:jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!Z?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[wt?"Modified":"Saved"," ·"," ",ye(d)]})]})]}),r.jsx(En,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":H(F.parentDir):void 0,isPending:se,onSubmit:ct,onOpenChange:t=>{!t&&!se&&X(null)}}),r.jsx(kn,{deleteTarget:he,deleteDirtyPaths:bt,fsActionPending:se,onOpenChange:t=>{!t&&!se&&ge(null)},onConfirm:t=>{lt(t)}})]})}export{ls as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as I,b as ne,C as X,D as xs,j as s,B as je,r as M,F as ps,E as We,a as te,v as gs,K as Ct,d as Le,p as J,G as Ce,l as O,H as bs,I as js,J as vs,M as ys,P as Ss,q as _s,t as oe,s as Ns,i as wt,e as Ve,u as we,L as Cs,R as ws,U as ks,V as Is,W as As,m as zs,X as $s,O as Ts,Y as Os}from"./index-kW87eoYl.js";import{u as re,S as qe,a as Ke,b as ee,c as K,d as H,e as kt,f as Ms,g as It,h as Es,i as he,j as Ps,k as Ds,l as Fs}from"./sidebar-DjP0hlIN.js";import{u as Ye}from"./use-mobile-DKQP_Jss.js";import{C as Rs,p as Ee,s as Ls,b as Hs,S as Bs,d as Us,e as Gs,c as Ws,n as Vs}from"./self-tool-result-2G6-rtik.js";import{f as qs,a as At,e as zt,g as Ks,D as Ys,h as Xs,d as Qs}from"./dialog-gLpw4bfG.js";import{f as Js}from"./tab-id-BijBBRwE.js";import{u as $t}from"./use-mcp-client-t1Lq9dtN.js";import{C as Zs,W as Tt,g as en,S as Ot,a as _e,i as tn,b as sn}from"./constants-D_FQAPnt.js";import{i as Mt}from"./XCircle-BgTed_Co.js";import{S as se}from"./skeleton-1fz4b835.js";import{i as Et}from"./LayoutLeft-DXtD65nH.js";import{t as Xe}from"./ChevronDown-C5CvsmcD.js";import{T as le,a as ae,b as ce,c as Pt}from"./tooltip-MpF93QwW.js";import{u as Dt,a as Qe}from"./use-virtual-mcp-CFX-alhS.js";import{A as de,t as nn,a as on,i as rn,b as ln,c as ot,d as an,s as cn,e as dn}from"./agent-icon-wm2eb0Nq.js";import{P as fe,a as ke,b as Ie}from"./popover-1iWni6pj.js";import{i as Ft}from"./Check-wimNrbhN.js";import{s as xe}from"./Plus-CeRRdRrw.js";import{i as Rt}from"./SearchMd-DAd-Bkgu.js";import{s as mn}from"./XClose-CcOoHUUk.js";import{A as un,a as fn,b as hn,c as xn,d as pn,e as gn,f as bn}from"./alert-dialog-nxq3-B6t.js";import{F as jn,a as vn,b as yn,c as Sn,d as _n,e as Nn,f as Cn}from"./form-CEJ7NLQz.js";import{I as wn}from"./input-BUVWi6ji.js";import{S as kn,u as In,C as An}from"./chat-context-CXmj1wzI.js";import{T as me}from"./toolbar-icon-button-tX4cl55G.js";import{D as Lt,a as Ht,b as Bt}from"./drawer-ZJqvF-A5.js";import{G as zn,a as $n}from"./github-repo-picker-BXgmr-ZU.js";import{u as Ut,a as Je,b as Tn,T as On}from"./hooks-qsHMC7Ia.js";import{r as Mn,u as Ze,f as En}from"./shell-layout-F-ok_nx8.js";import{u as Pn,g as Dn,a as Fn,b as Rn,S as Gt}from"./use-navigate-to-agent-Cwegpci4.js";import{g as Ln,a as Wt,u as Hn,A as Bn,b as Un}from"./use-deco-credits-DRClHKlt.js";import{f as Gn}from"./reusable-new-chat-CouMjkYR.js";import{A as He}from"./avatar-DJ2MPOjW.js";import{a as Wn}from"./Copy01-1_zUjHG9.js";import{n as Vn,i as qn}from"./Globe01-DJ_zs5G_.js";import{i as Kn}from"./ZoomOut-Mbjnh50O.js";import{i as rt,a as Yn}from"./ZapSquare-95HyzbKN.js";import{i as Be}from"./Monitor01-B52VT9DG.js";import{n as Xn,a as Qn}from"./Sun-MykPXdqN.js";import{a as Ae}from"./Settings02-BYgyRjAD.js";import{i as Jn}from"./Shield01-CMDd26KY.js";import{a as Zn}from"./Users03-CLvfcW6v.js";import{u as ei}from"./use-deployment-admin-BYh8bdhB.js";import"./index-Bq8gS4_7.js";import{t as Vt}from"./UserPlus01-DjC11OT1.js";import{I as qt}from"./invite-member-dialog-Cg5P2m_Y.js";import{v as ti,C as lt}from"./connect-desktop-dialog-B4yVc_7M.js";import{u as ze}from"./use-organization-settings-Bs5bz6s7.js";import{i as si}from"./FilterLines-BnL8BlYf.js";import{T as ni,a as ii}from"./toggle-group-BLEtqopd.js";import{C as oi,a as ri,b as li,c as ai,d as ci}from"./command-CZ7egaGh.js";import{u as Kt}from"./studio-tools-hO5SJ9L1.js";import{i as Yt}from"./Zap-D3VZuva8.js";import{S as Xt,M as di}from"./shell-controls-HysOBF2a.js";import{n as mi}from"./Stars02-CmYTwRcx.js";import{g as ui,u as fi,S as hi}from"./use-clock-tick-BL0-k7e9.js";import{a as xi}from"./format-time-BnbuEtat.js";import{i as pi}from"./ChevronRight-Bno5_0xg.js";import{T as Q}from"./toolbar-mHxlKpgC.js";import"./X-BZ_UKD_O.js";import"./integration-icon-RxSgmsqJ.js";import"./Tool02-Bt1NLhl1.js";import"./CheckCircle-Bl4aW-nn.js";import"./companions-core-DVErIwai.js";import"./extract-connection-data-DQ2KFguj.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./Eye-BMAxGnGK.js";import"./use-debounced-value-Bb7tMvOa.js";import"./authenticate-and-persist-oauth-DSvl_dtV.js";import"./mcp-oauth-DayJEOBQ.js";import"./auth-4uk65Jwa.js";import"./ArrowUpRight-Bl5xGmHO.js";import"./use-collections-BwkNh9s8.js";import"./AlertCircle-Cvu85Sr0.js";import"./Tool01-BcPlknT9.js";import"./ArrowUp-fbYe80_F.js";import"./TrendUp01-CwpvhxrP.js";import"./ChevronUp-DrDSr-mi.js";import"./Circle-g57xQlUQ.js";import"./DotsVertical-SPVqsXfZ.js";import"./Flag01-BFVNOegT.js";import"./Star01-B4wdnyjY.js";import"./Globe04-DkaJlCI4.js";import"./SwitchHorizontal01-DJnrgsIK.js";import"./HardDrive-yPFtg6_w.js";import"./Key01-BdmJ-1sf.js";import"./LinkExternal01-26v779uD.js";import"./List-Degct3aY.js";import"./Package-CKW2xi_w.js";import"./Palette-Bv_JYMYM.js";import"./Play-Dw4gmx5C.js";import"./SearchLg-EpoU8TwV.js";import"./Stars01-aA8DbwLH.js";import"./Trash01-kZy-N3Xo.js";import"./Upload01-Bpbyu6sv.js";import"./User01-DQn1mAZF.js";import"./Users01-CY0-Vc-O.js";import"./label-DoX8QwZg.js";import"./autosend-C3_RSy-l.js";import"./use-ai-providers-DOWHTDqA.js";import"./use-decopilot-events-BXDhFIv7.js";import"./decopilot-sse-pool-COulQsQu.js";import"./backoff-CrEUbyZT.js";import"./collection-search-CIVfwIbs.js";import"./use-connection-Dyi0y--H.js";import"./use-mcp-tools-CCr3WLAZ.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-BdTGAOVV.js";import"./use-org-sso-z04b3p1a.js";import"./connection-card-DAmJM9w3.js";import"./use-registry-connections-izs-KLy2.js";import"./useInfiniteQuery-C3eTHgjV.js";import"./use-infinite-scroll-AWTzpLPw.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BiR2GL-H.js";import"./select-gkpsAlUm.js";import"./textarea-CJ9nnedq.js";import"./connection-form-helpers-CmZoSIwh.js";import"./collection-tabs-C-nwiHu-.js";import"./badge-tPEV-RxK.js";import"./useSuspenseInfiniteQuery-BcApL0b0.js";import"./use-org-auth-client-Cj6dUtY9.js";import"./use-organization-roles-CGng68qz.js";import"./index-LRYSqCUf.js";import"./differenceInSeconds-NQ4PDo0z.js";function gi(t){const e=I.c(15),{siteUrl:n}=t,o=ne(),{org:i}=X();let r;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(r=()=>{localStorage.setItem(xs.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:en(i.id),main:Js(Tt.COMMERCE_DISCOVERY(i.id),Zs),sidepanel:0}})},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=r):r=e[3];const l=r;let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qs,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(At,{className:"sr-only",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),e[5]=m):m=e[5];let c;e[6]!==l?(c=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar as integrações. Você pode continuar e abrir o relatório mesmo assim."}),s.jsxs(je,{type:"button",size:"xl",className:"w-full",onClick:l,children:["Continuar",s.jsx(Mt,{size:18})]})]}),e[6]=l,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rs,{}),e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==n?(u=s.jsx(M.Suspense,{fallback:d,children:s.jsx(yi,{siteUrlFromUrl:n,onComplete:l})}),e[9]=l,e[10]=n,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=s.jsx(zt,{open:!0,children:s.jsxs(Ks,{children:[a,s.jsxs(ps,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:vi,onPointerDownOutside:ji,onInteractOutside:bi,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,s.jsx(We,{fallback:c,children:u})]})]})}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function bi(t){return t.preventDefault()}function ji(t){return t.preventDefault()}function vi(t){return t.preventDefault()}function yi({siteUrlFromUrl:t,onComplete:e}){const{org:n}=X(),{data:o}=te.useSession(),i=Tt.COMMERCE_DISCOVERY(n.id),r=$t({connectionId:Ot,orgId:n.id,orgSlug:n.slug}),a=gs({queryKey:Ct.commerceDiscoveryConnection(n.id,i),queryFn:async()=>{const v=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return Ee(v)},retry:!1}).data.item,m=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||m,d=Ls(c),[u,f]=M.useState(!0),[h,x]=M.useState(null),g=Le({mutationFn:async v=>Ee(await r.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),p=Le({mutationFn:async v=>Ee(await r.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),b=Hs({siteUrl:c,email:o?.user?.email}),j=async()=>{x(null),J("commerce_onboarding_open_report_clicked",{domain:d??void 0,organization_id:n.id});const v=c?Vs(c):null;if(v?.ok)try{let y=await p.mutateAsync(v.value);if(y.triggered||(J("commerce_onboarding_run_reclaim",{domain:d??void 0,organization_id:n.id,reason:y.reason??"not_upgraded"}),await g.mutateAsync(v.value),y=await p.mutateAsync(v.value)),!y.triggered){J("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y.reason??"not_triggered"}),x("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(y){J("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y instanceof Error?y.message:String(y)}),x("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[d?s.jsx(Bs,{host:d}):null,s.jsx(Us,{org:n,cdConnectionId:i,siteUrl:c,onReadinessChange:f}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(Gs,{href:b,orgId:n.id,className:"lg:hidden"}),h?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:h}):null,s.jsxs(je,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{j()},disabled:p.isPending||!u,children:[p.isPending?"Abrindo relatório...":u?"Ver relatório completo":"Conecte uma ferramenta para continuar",!p.isPending&&u?s.jsx(Mt,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(Ws,{href:b,orgId:n.id})})]})}function Si(t){const e=I.c(5),{onPointerDown:n,onDoubleClick:o}=t,{state:i,isMobile:r}=re();if(r||i==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let m;return e[2]!==o||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=o,e[3]=n,e[4]=m):m=e[4],m}const et=240,_i=400,Ni="sidebar.width";function pe(t){return Math.max(et,Math.min(_i,t))}function Ci(){const t=I.c(11),[e,n]=Ce(Ni,wi),o=M.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,f=pe(e),h=o.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=pe(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=pe(f+(b.clientX-u));n(j);for(const v of x)v.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let l;t[3]!==n?(l=()=>{n(et)},t[3]=n,t[4]=l):l=t[4];const a=l;let m;t[5]!==e?(m=pe(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:o,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function wi(t){return typeof t=="number"?pe(t):et}function Qt(){return[]}function Jt(t){const e=I.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs(qe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Ke,{children:s.jsx(ee,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function Zt(t){const e=I.c(18),{item:n}=t,{isMobile:o,setOpenMobile:i}=re();let r;e[0]!==o||e[1]!==n||e[2]!==i?(r=()=>{J("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=r):r=e[3];const l=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=O(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(K,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(H,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function ki(t){const e=I.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(kt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Ai),e[2]=n.group.items,e[3]=r):r=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(l=s.jsx(Jt,{label:o,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==n.items?(o=n.items.map(Ii),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ke,{children:s.jsx(ee,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ii(t){return s.jsx(Zt,{item:t},t.key)}function Ai(t){return s.jsx(Zt,{item:t},t.key)}function zi(t){const e=I.c(17),{sections:n,footer:o,additionalContent:i,header:r,variant:l,contentClassName:a}=t,m=l===void 0?"sidebar":l;let c;e[0]!==r?(c=r&&s.jsx(Ms,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=O("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map($i),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==i?(f=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[6]=i,e[7]=f):f=e[7];let h;e[8]!==d||e[9]!==u||e[10]!==f?(h=s.jsxs(It,{className:d,children:[u,f]}),e[8]=d,e[9]=u,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==o||e[13]!==c||e[14]!==h||e[15]!==m?(x=s.jsxs(Es,{variant:m,children:[c,h,o]}),e[12]=o,e[13]=c,e[14]=h,e[15]=m,e[16]=x):x=e[16],x}function $i(t,e){return s.jsx(ki,{section:t},e)}function es(t){const e=I.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}es.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(se,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ts(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ti=bs({name:js().min(2,"Organization name is required")});function Oi(t){const e=I.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Ti),defaultValues:{name:""}},e[0]=i):i=e[0];const r=ys(i);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ei,onSuccess:Mi},e[1]=l):l=e[1];const a=Le(l),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(hn,{children:[s.jsx(xn,{children:"Create a new organization"}),s.jsx(pn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let _;e[6]!==a?(_=N=>a.mutateAsync(N),e[6]=a,e[7]=_):_=e[7],d=r.handleSubmit(_),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=_=>{const{field:N}=_;return s.jsxs(yn,{children:[s.jsx(Sn,{children:"Organization Name"}),s.jsx(_n,{children:s.jsx(wn,{...N,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(Nn,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ts(N.value)]})]}),s.jsx(Cn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(jn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==m?(h=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(un,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(kn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(je,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==g?(v=s.jsxs(gn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==d||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=d,e[31]=f,e[32]=h,e[33]=y):y=e[33];let S;e[34]!==r||e[35]!==y?(S=s.jsxs(fn,{children:[c,s.jsx(vn,{...r,children:y})]}),e[34]=r,e[35]=y,e[36]=S):S=e[36];let C;return e[37]!==o||e[38]!==n||e[39]!==S?(C=s.jsx(bn,{open:n,onOpenChange:o,children:S}),e[37]=o,e[38]=n,e[39]=S,e[40]=C):C=e[40],C}function Mi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ei(t){const e=ts(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await te.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function ss(){const t=M.useContext(Ss),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function Pi(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function $e(t){const e=I.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,r=i==="xs"?"size-5":"size-6",l=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=O(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:Pi(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:O("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function Di({invitation:t,onChanged:e}){const[n,o]=M.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{o(!0);try{const m=await te.organization.acceptInvitation({invitationId:t.id});if(m.error){oe.error(m.error.message),o(!1);return}}catch{oe.error("Failed to accept invitation"),o(!1);return}oe.success(`Joined ${i}`),Ns();let a;try{a=(await te.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},l=async()=>{o(!0);try{const a=await te.organization.rejectInvitation({invitationId:t.id});if(a.error){oe.error(a.error.message),o(!1);return}oe.success("Invitation declined"),o(!1),e()}catch{oe.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx($e,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(mn,{size:14})})]})]})}function Fi(t){const e=I.c(29),{orgParam:n,onSelectOrg:o,onCreateOrg:i}=t,{data:r}=_s(),{invitations:l,refetch:a}=ss();let m;e[0]!==n?(m=(k,$)=>k.slug===n?-1:$.slug===n?1:k.name.localeCompare($.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=M.useState(""),f=d.toLowerCase(),h=f?c.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Rt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>u(k.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=k=>k.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xe,{size:16}),e[9]=j):j=e[9];let v;e[10]!==i?(v=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==b||e[13]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,v]}),e[12]=b,e[13]=v,e[14]=y):y=e[14];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==l||e[16]!==d||e[17]!==a?(C=!d&&l.map(k=>s.jsx(Di,{invitation:k,onChanged:a},k.id)),e[15]=l,e[16]=d,e[17]=a,e[18]=C):C=e[18];const _=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let N;e[19]!==o||e[20]!==n?(N=k=>s.jsxs("button",{type:"button",onClick:()=>o(k.slug),className:O("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx($e,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(Ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[19]=o,e[20]=n,e[21]=N):N=e[21];const w=h.map(N);let A;e[22]!==C||e[23]!==_||e[24]!==w?(A=s.jsxs("div",{className:S,children:[C,_,w]}),e[22]=C,e[23]=_,e[24]=w,e[25]=A):A=e[25];let z;return e[26]!==A||e[27]!==y?(z=s.jsxs(s.Fragment,{children:[y,A]}),e[26]=A,e[27]=y,e[28]=z):z=e[28],z}function ns(t){const e=I.c(22),{trigger:n,orgParam:o,align:i,side:r}=t,l=i===void 0?"start":i,a=r===void 0?"bottom":r,m=ne(),[c,d]=M.useState(!1),[u,f]=M.useState(!1);let h;e[0]!==n?(h=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const x=String(c);let g;e[2]!==m?(g=C=>{d(!1),m({to:"/$org",params:{org:C}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),f(!0)},e[4]=p):p=e[4];let b;e[5]!==o||e[6]!==x||e[7]!==g?(b=s.jsx(Fi,{orgParam:o,onSelectOrg:g,onCreateOrg:p},x),e[5]=o,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==l||e[10]!==a||e[11]!==b?(j=s.jsx(ke,{side:a,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Li,onCloseAutoFocus:Ri,children:b}),e[9]=l,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==h||e[15]!==j?(v=s.jsxs(Ie,{open:c,onOpenChange:d,children:[h,j]}),e[13]=c,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Oi,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let S;return e[19]!==y||e[20]!==v?(S=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=S):S=e[21],S}function Ri(t){return t.preventDefault()}function Li(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Hi(t){const e=I.c(21),{value:n,onChange:o,placeholder:i,onKeyDown:r,className:l,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==l?(d=O("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=O("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Rt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==o?(x=j=>o(j.target.value),e[6]=o,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==f||e[15]!==h||e[16]!==g?(p=s.jsxs("label",{className:f,children:[h,g]}),e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const Bi="Select an existing agent";function Ui(t){const e=I.c(5),{children:n}=t;let o;e[0]!==n?(o=s.jsx(le,{asChild:!0,children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{side:"right",sideOffset:8,children:Bi}),e[2]=i):i=e[2];let r;return e[3]!==o?(r=s.jsxs(ce,{defaultOpen:!0,delayDuration:0,children:[o,i]}),e[3]=o,e[4]=r):r=e[4],r}function Gi(t){const e=ne(),{create:n}=Ut(),{locator:o}=X(),i=Ve({strict:!1}),r=we({strict:!1});return async l=>{const a=crypto.randomUUID(),m=l===r.virtualmcpid?Mn(t,o,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Pe(t){const e=I.c(20),{agent:n,selected:o,onClick:i}=t,r=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==r?(l=O("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(de,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==o?(u=o&&s.jsx(Ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==l||e[16]!==a||e[17]!==d||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:l,children:[a,d,u]}),e[14]=i,e[15]=l,e[16]=a,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function at(t){const e=I.c(5),{children:n,action:o}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==o||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,o]}),e[2]=o,e[3]=i,e[4]=r):r=e[4],r}function Wi(t){const e=I.c(27),{onClose:n,onSelectAgent:o,selectedAgentId:i,onImportFromGithub:r}=t,[l,a]=M.useState(""),m=Dt(),c=m??[],{org:d}=X(),{data:u}=te.useSession(),f=u?.user?.id??"anon",h=Dn(m),x=Fn(),g=Gi(d.slug),p=Ln(m),b=l.toLowerCase(),j=c.filter(Yi).filter(V=>!p.has(V.id)).filter(Ki).filter(V=>!l||V.title.toLowerCase().includes(b)),v=j.filter(qi),y=j.filter(Vi),S=_e(d.id),C=!l||S.title.toLowerCase().includes(b),_=!!(o&&C);let N;e[0]!==n||e[1]!==o?(N=()=>{o?.(null),n(),a("")},e[0]=n,e[1]=o,e[2]=N):N=e[2];const w=N,A=V=>{if(o){o(V.id),n(),a("");return}Rn({orgId:d.id,userId:f},V.id,h),x(),n(),a(""),g(V.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let k;e[3]!==l?(k=s.jsx(Hi,{value:l,onChange:a,placeholder:"Search agents..."}),e[3]=l,e[4]=k):k=e[4];const $="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",D=o&&C&&S&&s.jsx(Pe,{agent:S,selected:!i||i===S.id,onClick:w}),R=y.length>0&&s.jsx(at,{children:"Agents"}),B=y.map(V=>s.jsx(Pe,{agent:V,selected:o?i===V.id:void 0,onClick:()=>A(V)},V.id)),L=(v.length>0||!l)&&s.jsx(at,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx($n,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),P=v.map(V=>s.jsx(Pe,{agent:V,selected:o?i===V.id:void 0,onClick:()=>A(V)},V.id));let E;e[5]!==_||e[6]!==l||e[7]!==j.length?(E=j.length===0&&!_&&l&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=_,e[6]=l,e[7]=j.length,e[8]=E):E=e[8];let F;e[9]!==E||e[10]!==D||e[11]!==R||e[12]!==B||e[13]!==L||e[14]!==P?(F=s.jsxs("div",{className:$,children:[D,R,B,L,P,E]}),e[9]=E,e[10]=D,e[11]=R,e[12]=B,e[13]=L,e[14]=P,e[15]=F):F=e[15];let U;e[16]!==d.slug?(U={org:d.slug},e[16]=d.slug,e[17]=U):U=e[17];let G;e[18]!==n?(G=()=>n(),e[18]=n,e[19]=G):G=e[19];let W;e[20]!==U||e[21]!==G?(W=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Cs,{to:"/$org/settings/agents",params:U,onClick:G,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=U,e[21]=G,e[22]=W):W=e[22];let Y;return e[23]!==F||e[24]!==W||e[25]!==k?(Y=s.jsxs("div",{className:z,children:[k,F,W]}),e[23]=F,e[24]=W,e[25]=k,e[26]=Y):Y=e[26],Y}function Vi(t){return!Wt(t.metadata)}function qi(t){return Wt(t.metadata)}function Ki(t){return!sn(t.id)}function Yi(t){return!tn(t.id)}function Xi(t){const e=I.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:o,trigger:i,onSelectAgent:r,selectedAgentId:l,side:a,align:m}=n,c=o===void 0?!1:o,d=a===void 0?"right":a,u=m===void 0?"start":m,[f,h]=M.useState(!1),[x,g]=M.useState(!1),p=Ye(),{setOpenMobile:b}=re(),j=Pn(),v=j?"border border-border":void 0;let y;e[2]!==j?(y=R=>j?s.jsx(Ui,{children:R}):R,e[2]=j,e[3]=y):y=e[3];const S=y;let C;e[4]!==p||e[5]!==b?(C=()=>{h(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=C):C=e[6];const _=C;let N;e[7]!==_?(N=()=>{_(),g(!0)},e[7]=_,e[8]=N):N=e[8];const w=N;let A;e[9]!==_||e[10]!==w||e[11]!==r||e[12]!==f||e[13]!==l?(A=f&&s.jsx(M.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(se,{className:"h-4 w-24"})}),children:s.jsx(Wi,{onClose:_,onSelectAgent:r,selectedAgentId:l,onImportFromGithub:w})}),e[9]=_,e[10]=w,e[11]=r,e[12]=f,e[13]=l,e[14]=A):A=e[14];const z=A;let k;e[15]!==u||e[16]!==c||e[17]!==v||e[18]!==j||e[19]!==p||e[20]!==f||e[21]!==z||e[22]!==d||e[23]!==i||e[24]!==S?(k=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?S(s.jsx(me,{"aria-label":"Browse agents",className:O(v),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(xe,{className:"size-4"})})):s.jsx(H,{children:S(s.jsxs(K,{tooltip:j?void 0:"Browse agents",className:O(v),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(xe,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Lt,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Ht,{className:"max-h-[85dvh] p-0",children:[s.jsx(Bt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ie,{open:f,onOpenChange:R=>{R&&!f&&J("agent_browser_opened",{surface:"desktop_popover"}),h(R)},children:[i?s.jsx(fe,{asChild:!0,children:i}):c?S(s.jsx(fe,{asChild:!0,children:s.jsx(me,{"aria-label":"Browse agents",className:O(v),children:s.jsx(xe,{className:"size-4"})})})):s.jsx(H,{children:S(s.jsx(fe,{asChild:!0,children:s.jsxs(K,{tooltip:j?void 0:"Browse agents",className:O(v),children:[s.jsx(xe,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(ke,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=v,e[18]=j,e[19]=p,e[20]=f,e[21]=z,e[22]=d,e[23]=i,e[24]=S,e[25]=k):k=e[25];let $;e[26]!==x?($=s.jsx(zn,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=$):$=e[27];let D;return e[28]!==$||e[29]!==k?(D=s.jsxs(s.Fragment,{children:[k,$]}),e[28]=$,e[29]=k,e[30]=D):D=e[30],D}const Qi="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ji(t){const e=I.c(19),{agentId:n,fallback:o,onOpenHome:i,onPick:r}=t,l=Qe(n)??o??null,a=l?.title??"Super Agent",m=`Open ${a} home`,c=l?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(de,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:Qi,children:[f,h]}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(Xi,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function Ue(t){const e=I.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:o}=n,{org:i}=X(),{state:r,isMobile:l}=re(),a=ss().invitations.length>0,m=r==="collapsed"||l,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx($e,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:O("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=f):f=e[9];let h;e[10]!==i.name||e[11]!==o?(h=o&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=o,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Xe,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==h?(g=s.jsx(le,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[f,h,x]})}),e[14]=c,e[15]=f,e[16]=h,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx(ns,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(ae,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(ce,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function Te(t){const e=I.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:o}=n,{org:i}=X(),r=ne();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[2]=l):l=e[2];const a=Ve(l);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=we(m),{threads:d}=Je(),{data:u}=te.useSession(),{setTaskId:f,createNewTask:h}=Ze();let x;e[4]!==i.id?(x=_e(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==h||e[7]!==p||e[8]!==r||e[9]!==o||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==d?(j=N=>{if(!N||N===p){r({to:"/$org",params:{org:i.slug}}),o?.();return}const w=Gn(d,N,u?.user?.id);w?f(w.id,N):h(N),o?.()},e[6]=h,e[7]=p,e[8]=r,e[9]=o,e[10]=i.slug,e[11]=u?.user?.id,e[12]=f,e[13]=d,e[14]=j):j=e[14];const v=j;let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=y):y=e[15];const S=b===p?g:void 0;let C;e[16]!==b||e[17]!==v?(C=()=>v(b),e[16]=b,e[17]=v,e[18]=C):C=e[18];let _;return e[19]!==b||e[20]!==v||e[21]!==S||e[22]!==C?(_=s.jsx(M.Suspense,{fallback:y,children:s.jsx(Ji,{agentId:b,fallback:S,onOpenHome:C,onPick:v})}),e[19]=b,e[20]=v,e[21]=S,e[22]=C,e[23]=_):_=e[23],_}function ct(t){const e=I.c(18),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=O(i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n||e[3]!==o?(l=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==m?(c=s.jsxs(K,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(H,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function Zi(t){const e=I.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(kt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==n.group.items){let m;e[5]!==o?(m=c=>s.jsx(ct,{item:c,onClose:o},c.key),e[5]=o,e[6]=m):m=e[6],l=n.group.items.map(m),e[2]=o,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(Jt,{label:i,defaultExpanded:r,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let l;e[14]!==o?(l=a=>s.jsx(ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],i=n.items.map(l),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ke,{children:s.jsx(ee,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function eo(t){const e=I.c(24),{sections:n,onClose:o,footer:i,additionalContent:r}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ue,{}),e[0]=l):l=e[0];let a;e[1]!==o?(a=s.jsx(Te,{onNavigate:o}),e[1]=o,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Et,{size:16}),e[4]=c):c=e[4];let d;e[5]!==o?(d=s.jsx(me,{onClick:o,"aria-label":"Close sidebar",children:c}),e[5]=o,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[l,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;if(e[10]!==o||e[11]!==n){let p;e[13]!==o?(p=(b,j)=>s.jsx(Zi,{section:b,onClose:o},j),e[13]=o,e[14]=p):p=e[14],f=n.map(p),e[10]=o,e[11]=n,e[12]=f}else f=e[12];let h;e[15]!==r?(h=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs(It,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function ue(t){const e=I.c(26),{item:n,onClose:o}=t;let i;e[0]!==n.className?(i=O("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let h;e[4]!==n.label?(h=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=h):h=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==o||e[9]!==d||e[10]!==u||e[11]!==f||e[12]!==h?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:o,children:[f,h]}),e[6]=r,e[7]=n.href,e[8]=o,e[9]=d,e[10]=u,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}let l;e[14]!==n||e[15]!==o?(l=()=>{n.onClick?.(),o()},e[14]=n,e[15]=o,e[16]=l):l=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==l||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:l,className:r,children:[a,m]}),e[21]=r,e[22]=l,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function to(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:"Impersonating"}),t[0]=e):e=t[0],e}function dt(t){const e=I.c(30),{user:n,userImage:o,isImpersonating:i,isMobile:r}=t,l=r?"py-4 border-b border-border":"py-3 mx-1 mt-1";let a;e[0]!==l?(a=O("flex items-center gap-3 px-4",l),e[0]=l,e[1]=a):a=e[1];const m=n?.name??"U";let c;e[2]!==m||e[3]!==o?(c=s.jsx(He,{url:o,fallback:m,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=m,e[3]=o,e[4]=c):c=e[4];const d=n?.name??"User";let u;e[5]!==d?(u=s.jsx("p",{className:"text-sm font-medium truncate",children:d}),e[5]=d,e[6]=u):u=e[6];let f;e[7]!==i?(f=i&&s.jsx(to,{}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==u||e[10]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2",children:[u,f]}),e[9]=u,e[10]=f,e[11]=h):h=e[11];const x=n?.email;let g;e[12]!==x?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x}),e[12]=x,e[13]=g):g=e[13];let p;e[14]!==g||e[15]!==h?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,g]}),e[14]=g,e[15]=h,e[16]=p):p=e[16];let b;e[17]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(so)},e[17]=n,e[18]=b):b=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Wn,{size:14}),e[19]=j):j=e[19];let v;e[20]!==b?(v=s.jsx(le,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:j})}),e[20]=b,e[21]=v):v=e[21];let y;e[22]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[22]=y):y=e[22];let S;e[23]!==v?(S=s.jsx(Pt,{delayDuration:300,children:s.jsxs(ce,{children:[v,y]})}),e[23]=v,e[24]=S):S=e[24];let C;return e[25]!==p||e[26]!==S||e[27]!==a||e[28]!==c?(C=s.jsxs("div",{className:a,children:[c,p,S]}),e[25]=p,e[26]=S,e[27]=a,e[28]=c,e[29]=C):C=e[29],C}function so(){oe.success("User ID copied")}function mt(t){const e=I.c(32),{themeOptions:n,preferences:o,setPreferences:i,isMobile:r}=t,l=r?"size-8":"size-7",a=r?"px-3 py-3":"px-2 py-1.5";let m;e[0]!==a?(m=O("flex items-center justify-between border-t border-border/50",a),e[0]=a,e[1]=m):m=e[1];let c;if(e[2]!==l||e[3]!==o.theme||e[4]!==i||e[5]!==n){let y;e[7]!==l||e[8]!==o.theme||e[9]!==i?(y=S=>{const{value:C,icon:_,label:N}=S;return s.jsx("button",{type:"button","aria-label":N,onClick:()=>i(w=>({...w,theme:C})),className:O(l,"rounded-md flex items-center justify-center transition-colors",o.theme===C?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:_},C)},e[7]=l,e[8]=o.theme,e[9]=i,e[10]=y):y=e[10],c=n.map(y),e[2]=l,e[3]=o.theme,e[4]=i,e[5]=n,e[6]=c}else c=e[6];let d;e[11]!==c?(d=s.jsx("div",{className:"flex items-center gap-0.5",children:c}),e[11]=c,e[12]=d):d=e[12];const u=o.enableSounds?"Disable sounds":"Enable sounds";let f;e[13]!==i?(f=()=>i(no),e[13]=i,e[14]=f):f=e[14];const h=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let x;e[15]!==l||e[16]!==h?(x=O(l,"rounded-md flex items-center justify-center transition-colors",h),e[15]=l,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.enableSounds?(g=o.enableSounds?s.jsx(on,{size:14}):s.jsx(rn,{size:14}),e[18]=o.enableSounds,e[19]=g):g=e[19];let p;e[20]!==u||e[21]!==f||e[22]!==x||e[23]!==g?(p=s.jsx("button",{type:"button","aria-label":u,onClick:f,className:x,children:g}),e[20]=u,e[21]=f,e[22]=x,e[23]=g,e[24]=p):p=e[24];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.76.71"]}),e[25]=b):b=e[25];let j;e[26]!==p?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[26]=p,e[27]=j):j=e[27];let v;return e[28]!==j||e[29]!==m||e[30]!==d?(v=s.jsxs("div",{className:m,children:[d,j]}),e[28]=j,e[29]=m,e[30]=d,e[31]=v):v=e[31],v}function no(t){return{...t,enableSounds:!t.enableSounds}}function ut(t){const e=I.c(54),{user:n,userImage:o,menuItems:i,signOutItem:r,stopImpersonatingItem:l,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:f}=t;if(f){let y;e[0]!==a||e[1]!==n||e[2]!==o?(y=s.jsx(dt,{user:n,userImage:o,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=o,e[3]=y):y=e[3];let S;if(e[4]!==u||e[5]!==i){let z;e[7]!==u?(z=k=>s.jsx(ue,{item:k,onClose:u},k.key),e[7]=u,e[8]=z):z=e[8],S=i.map(z),e[4]=u,e[5]=i,e[6]=S}else S=e[6];let C;e[9]!==u||e[10]!==l?(C=l&&s.jsx(ue,{item:l,onClose:u}),e[9]=u,e[10]=l,e[11]=C):C=e[11];let _;e[12]!==u||e[13]!==r?(_=s.jsx(ue,{item:r,onClose:u}),e[12]=u,e[13]=r,e[14]=_):_=e[14];let N;e[15]!==S||e[16]!==C||e[17]!==_?(N=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[S,C,_]})}),e[15]=S,e[16]=C,e[17]=_,e[18]=N):N=e[18];let w;e[19]!==c||e[20]!==d||e[21]!==m?(w=s.jsx(mt,{themeOptions:m,preferences:c,setPreferences:d,isMobile:!0}),e[19]=c,e[20]=d,e[21]=m,e[22]=w):w=e[22];let A;return e[23]!==y||e[24]!==N||e[25]!==w?(A=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,N,w]}),e[23]=y,e[24]=N,e[25]=w,e[26]=A):A=e[26],A}let h;e[27]!==a||e[28]!==n||e[29]!==o?(h=s.jsx(dt,{user:n,userImage:o,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=o,e[30]=h):h=e[30];let x;if(e[31]!==u||e[32]!==i){let y;e[34]!==u?(y=S=>s.jsx(ue,{item:S,onClose:u},S.key),e[34]=u,e[35]=y):y=e[35],x=i.map(y),e[31]=u,e[32]=i,e[33]=x}else x=e[33];let g;e[36]!==u||e[37]!==l?(g=l&&s.jsx(ue,{item:l,onClose:u}),e[36]=u,e[37]=l,e[38]=g):g=e[38];let p;e[39]!==u||e[40]!==r?(p=s.jsx(ue,{item:r,onClose:u}),e[39]=u,e[40]=r,e[41]=p):p=e[41];let b;e[42]!==x||e[43]!==g||e[44]!==p?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[x,g,p]}),e[42]=x,e[43]=g,e[44]=p,e[45]=b):b=e[45];let j;e[46]!==c||e[47]!==d||e[48]!==m?(j=s.jsx(mt,{themeOptions:m,preferences:c,setPreferences:d,isMobile:!1}),e[46]=c,e[47]=d,e[48]=m,e[49]=j):j=e[49];let v;return e[50]!==h||e[51]!==b||e[52]!==j?(v=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[h,b,j]})}),e[50]=h,e[51]=b,e[52]=j,e[53]=v):v=e[53],v}function ge(){const t=I.c(43),{data:e}=te.useSession(),{org:n}=X(),o=ne();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const l=ws(i)?.params.org,[a,m]=ks(),c=Ye(),{isAdmin:d}=ei(),[u,f]=M.useState(!1),h=e?.user,x=h?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>f(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{size:16}),t[2]=j):j=t[2];let v;t[3]!==o||t[4]!==l?(v={key:"preferences",label:"Preferences",icon:j,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[3]=o,t[4]=l,t[5]=v):v=t[5];let y;t[6]!==n||t[7]!==o?(y=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Vn,{size:16}),onClick:()=>{o({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=o,t[8]=y):y=t[8];let S;t[9]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Kn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=S):S=t[9];let C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(Jn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=C):C=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Is,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={key:"community",label:"Community",icon:s.jsx(Zn,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=N):N=t[12];let w;t[13]===Symbol.for("react.memo_cache_sentinel")?(w={key:"homepage",label:"Homepage",icon:s.jsx(qn,{size:16}),href:"https://decocms.com",external:!0},t[13]=w):w=t[13];let A;t[14]!==d||t[15]!==o?(A=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx(nn,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[14]=d,t[15]=o,t[16]=A):A=t[16];let z;t[17]!==A||t[18]!==v||t[19]!==y?(z=[v,...y,S,C,_,N,w,...A],t[17]=A,t[18]=v,t[19]=y,t[20]=z):z=t[20];const k=z;let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($={key:"logout",label:"Sign out",icon:s.jsx(rt,{size:16}),onClick:ro},t[21]=$):$=t[21];const D=$;let R;t[22]!==g?(R=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(rt,{size:16}),onClick:oo,className:"text-warning"}:null,t[22]=g,t[23]=R):R=t[23];const B=R;let L;t[24]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(Xn,{size:14}),label:"Light theme"},t[24]=L):L=t[24];let P;t[25]===Symbol.for("react.memo_cache_sentinel")?(P={value:"dark",icon:s.jsx(Qn,{size:14}),label:"Dark theme"},t[25]=P):P=t[25];let E;t[26]===Symbol.for("react.memo_cache_sentinel")?(E=[L,P,{value:"system",icon:s.jsx(Be,{size:14}),label:"System theme"}],t[26]=E):E=t[26];const F=E;let U;t[27]!==g||t[28]!==c||t[29]!==k||t[30]!==a||t[31]!==m||t[32]!==B||t[33]!==h||t[34]!==x?(U={user:h,userImage:x,menuItems:k,signOutItem:D,stopImpersonatingItem:B,isImpersonating:g,themeOptions:F,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=k,t[30]=a,t[31]=m,t[32]=B,t[33]=h,t[34]=x,t[35]=U):U=t[35];const G=U;let W;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==G||t[40]!==h?.name||t[41]!==x?(W=s.jsx(s.Fragment,{children:c?s.jsxs(Lt,{open:u,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:O("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",g&&"border-2 border-dashed border-warning"),children:[s.jsx(He,{url:x,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Ht,{className:"h-[80dvh] p-0",children:[s.jsx(Bt,{className:"sr-only",children:"Account"}),s.jsx(ut,{...G})]})]}):s.jsxs(Ie,{open:u,onOpenChange:f,children:[s.jsx(fe,{asChild:!0,children:s.jsxs(K,{tooltip:h?.name??"Account",className:O("rounded-md",g&&"border-2 border-dashed border-warning"),children:[s.jsx(He,{url:x,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]})}),s.jsx(ke,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:io,children:s.jsx(ut,{...G})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=G,t[40]=h?.name,t[41]=x,t[42]=W):W=t[42],W}function io(t){return t.preventDefault()}async function oo(){const{error:t}=await te.admin.stopImpersonating();if(t){oe.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function ro(){J("signed_out",{source:"account_popover"}),As(),te.signOut()}function be(t){const e=I.c(43),{variant:n}=t===void 0?{}:t,o=n===void 0?"icon":n,i=In(),[r,l]=M.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const v=ti(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:v.length>0?`Available: ${v.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(o==="full"){let v,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=()=>l(!0),y=s.jsx(Be,{}),e[6]=v,e[7]=y):(v=e[6],y=e[7]);let S;e[8]!==a?(S=s.jsx("span",{children:a}),e[8]=a,e[9]=S):S=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let _;e[12]!==a||e[13]!==S||e[14]!==C?(_=s.jsx(le,{asChild:!0,children:s.jsxs(K,{tooltip:a,onClick:v,children:[y,S,C]})}),e[12]=a,e[13]=S,e[14]=C,e[15]=_):_=e[15];let N;e[16]!==c?(N=s.jsx(ae,{side:"right",children:c}),e[16]=c,e[17]=N):N=e[17];let w;e[18]!==_||e[19]!==N?(w=s.jsxs(ce,{children:[_,N]}),e[18]=_,e[19]=N,e[20]=w):w=e[20];let A;e[21]!==r?(A=s.jsx(lt,{open:r,onOpenChange:l}),e[21]=r,e[22]=A):A=e[22];let z;return e[23]!==A||e[24]!==w?(z=s.jsxs(s.Fragment,{children:[w,A]}),e[23]=A,e[24]=w,e[25]=z):z=e[25],z}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>l(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Be,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let x;e[30]!==u||e[31]!==h?(x=s.jsx(le,{asChild:!0,children:s.jsxs(me,{onClick:d,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(ae,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(ce,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(lt,{open:r,onOpenChange:l}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class lo extends M.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function ao(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function co(){const t=I.c(17),e=ne(),{org:n}=X(),{hasDecoKey:o,balanceDollars:i}=Hn();if(!o)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let l;t[2]!==i?(l=O(i!=null&&ao(i)),t[2]=i,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ln,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==l||t[14]!==a||t[15]!==d?(u=s.jsx(ee,{children:s.jsx(H,{children:s.jsxs(K,{tooltip:r,className:l,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=l,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function ft(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(lo,{children:s.jsx(M.Suspense,{fallback:null,children:s.jsx(co,{})})}),t[0]=e):e=t[0],e}function De(){const t=I.c(7),e=ne(),{org:n}=X();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ae,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let l;return t[5]!==o?(l=s.jsxs(K,{tooltip:"Settings",onClick:o,children:[i,r]}),t[5]=o,t[6]=l):l=t[6],l}function mo(){const t=I.c(6),e=ne(),{org:n}=X();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ae,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==o?(r=s.jsx("button",{type:"button","aria-label":"Settings",onClick:o,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:i}),t[4]=o,t[5]=r):r=t[5],r}function ht(){const t=I.c(4),[e,n]=M.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(H,{children:s.jsx(qt,{trigger:s.jsxs(K,{tooltip:"Invite members",children:[s.jsx(Vt,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ee,{className:"gap-0.5",children:[o,s.jsx(H,{children:s.jsxs(K,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Yn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(Bn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function xt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ee,{className:"gap-0.5",children:s.jsx(H,{children:s.jsx(qt,{trigger:s.jsxs(K,{tooltip:"Invite members",children:[s.jsx(Vt,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function uo(){const t=I.c(17),{state:e}=re(),n=e==="collapsed";if(ze()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(xt,{}),t[0]=f):f=t[0];let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(H,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(be,{})})}),t[1]=h):h=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(H,{children:s.jsx(De,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(he,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(ee,{children:[h,x,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(H,{children:s.jsx(be,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(he,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(ee,{className:"gap-0.5",children:[d,s.jsx(H,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ge,{})}),s.jsx(mo,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ht,{}),d=s.jsx(ft,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(H,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(be,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(H,{children:s.jsx(De,{})}),t[10]=f):f=t[10];let h;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(he,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(ee,{children:[u,f,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[11]=h):h=t[11],h}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{}),r=s.jsx(ft,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let l;t[14]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(H,{children:s.jsx(be,{variant:"full"})}),t[14]=l):l=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(H,{children:s.jsx(De,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(he,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ee,{className:"gap-0.5",children:[l,a,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[16]=m):m=t[16],m}function fo(){const t=I.c(8),e=ne(),{org:n}=X(),{setOpenMobile:o}=re();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ee,{children:s.jsx(H,{children:s.jsx(ge,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==o?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[1]=e,t[2]=n.slug,t[3]=o,t[4]=r):r=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ae,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==r?(a=s.jsx(he,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(me,{"aria-label":"Settings",onClick:r,children:l})]})}),t[6]=r,t[7]=a):a=t[7],a}function pt(t){const e=I.c(15),{className:n,wrapperClassName:o,children:i}=t,[r,l]=M.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&l(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==o?(u=O("relative",o),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let x;e[7]!==h?(x=O("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==g?(p=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=p):p=e[14],p}function ho(t){const e=I.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,r=o===void 0?"sm":o;let l;e[0]!==r||e[1]!==n?(l=n?s.jsx(xo,{virtualMcpId:n,size:r}):s.jsx(de,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Yt,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function xo(t){const e=I.c(6),{virtualMcpId:n,size:o}=t,i=Qe(n);if(!i){let a;return e[0]!==o?(a=s.jsx(de,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const r=i.icon??null;let l;return e[2]!==i.title||e[3]!==o||e[4]!==r?(l=s.jsx(de,{icon:r,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function gt(t){const e=I.c(36),{open:n,onOpenChange:o}=t,[i,r]=M.useState(""),{org:l}=X(),{setTaskId:a}=Ze(),m=Kt();let c,d,u;e[0]!==l.id||e[1]!==i?(u=i.trim(),d=zs,c=Ct.globalSearch(l.id,u),e[0]=l.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==m||e[6]!==u?(h=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==h?(x={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==o?(v=$=>{$||r(""),o($)},e[14]=o,e[15]=v):v=e[15];const y=v;let S;e[16]!==y||e[17]!==a?(S=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=S):S=e[18];const C=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Ys,{className:"sr-only",children:[s.jsx(At,{children:"Search"}),s.jsx(Xs,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let N;e[20]!==i?(N=s.jsx(li,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=N):N=e[21];let w;e[22]!==C||e[23]!==p||e[24]!==j||e[25]!==u?(w=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(oi,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(ri,{value:`thread:${$.id}:${$.title}`,onSelect:()=>C($),className:"gap-2.5",children:[s.jsx(ho,{virtualMcpId:$.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:$.title||"Untitled chat"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=j,e[25]=u,e[26]=w):w=e[26];let A;e[27]!==w?(A=s.jsx(ai,{children:w}),e[27]=w,e[28]=A):A=e[28];let z;e[29]!==N||e[30]!==A?(z=s.jsxs(Qs,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(ci,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[N,A]})]}),e[29]=N,e[30]=A,e[31]=z):z=e[31];let k;return e[32]!==y||e[33]!==n||e[34]!==z?(k=s.jsx(zt,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=k):k=e[35],k}function po(t){return t==="ephemeral"||t.startsWith("thread:")}function is(t){const e=I.c(40),{task:n,isActive:o,onClick:i,onArchive:r,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=ui(n.status),u=d.icon,f=n.metadata?.kind==="tool_call_run",h=Qe(f?void 0:n.virtual_mcp_id);let x;e[0]!==h?(x=Un(h),e[0]=h,e[1]=x):x=e[1];const g=x;fi(6e4);const p=l||!!n.trigger_id,b=n.id,j="button",v=0;let y;e[2]!==i?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),i())},e[2]=i,e[3]=y):y=e[3];const S=c?"-ml-4 pl-6":"pl-[7px]",C=o?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==S||e[5]!==C?(_=O("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=S,e[5]=C,e[6]=_):_=e[6];let N;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(N=a&&!f&&s.jsx(de,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=N):N=e[11];let w;e[12]!==p?(w=p&&s.jsx(Yt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=w):w=e[13];const A=n.title||"Untitled task";let z;e[14]!==A?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:A}),e[14]=A,e[15]=z):z=e[15];let k;e[16]!==w||e[17]!==z?(k=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,z]}),e[16]=w,e[17]=z,e[18]=k):k=e[18];let $;e[19]!==g||e[20]!==o||e[21]!==n.branch||e[22]!==n.updated_at?($=n.updated_at&&s.jsxs("div",{className:O("flex items-center gap-1 text-[11px] min-w-0",o?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!po(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:xi(new Date(n.updated_at))})]}),e[19]=g,e[20]=o,e[21]=n.branch,e[22]=n.updated_at,e[23]=$):$=e[23];let D;e[24]!==k||e[25]!==$?(D=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,$]}),e[24]=k,e[25]=$,e[26]=D):D=e[26];const R="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",B=!m&&s.jsx("span",{className:O("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:O(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let L;e[27]!==r?(L=r&&s.jsxs(ce,{children:[s.jsx(le,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:F=>{F.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx($s,{size:14})})}),s.jsx(ae,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=L):L=e[28];let P;e[29]!==B||e[30]!==L?(P=s.jsxs("div",{className:R,children:[B,L]}),e[29]=B,e[30]=L,e[31]=P):P=e[31];let E;return e[32]!==i||e[33]!==D||e[34]!==P||e[35]!==y||e[36]!==_||e[37]!==N||e[38]!==n.id?(E=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:v,onClick:i,onKeyDown:y,className:_,children:[N,D,P]}),e[32]=i,e[33]=D,e[34]=P,e[35]=y,e[36]=_,e[37]=N,e[38]=n.id,e[39]=E):E=e[39],E}const bt=["requires_action","in_progress","failed","expired","completed"];function go(t){const e=new Map(bt.map(n=>[n,[]]));for(const n of t){const o=n.status??"completed";(e.get(o)??e.get("completed")).push(n)}return bt.map(n=>({status:n,threads:e.get(n)}))}const bo="sidebar.group.expanded.";function jo(t,e){const n=I.c(3),[o,i]=Ce(`${bo}${t}`,e);let r;return n[0]!==o||n[1]!==i?(r=[o,i],n[0]=o,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=I.c(12),{onClick:n,isFetching:o,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==r?(l=O("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=l):l=e[1];let a;e[2]!==o?(a=o&&s.jsx(wt,{size:14,className:"animate-spin"}),e[2]=o,e[3]=a):a=e[3];const m=o?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:o,className:l,children:[a,c]}),e[6]=o,e[7]=n,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function vo(t,e,n,o){return[t,e,n,o.type,o.member,o.currentUserId??""].join("|")}function yo(t){return t.member==="mine"&&!t.currentUserId}const rs=4;let Se=0;const Ge=[];function So(){for(;Se<rs&&Ge.length>0;){const t=Ge.shift();t&&t()}}function ls(t){return new Promise((e,n)=>{const o=()=>{Se++,t().then(e,n).finally(()=>{Se--,So()})};Se<rs?o():Ge.push(o)})}const Oe=10;function jt(t,e,n,o,i){const r={hidden:!1};o.member==="mine"&&o.currentUserId&&(r.created_by=o.currentUserId),o.type==="automation"&&(r.has_trigger=!0),o.type==="manual"&&(r.has_trigger=!1);const l={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function _o(t,e,n,o){let i=0;for(const r of t)as(r,e,n,o)&&i++;return i}function Fe(t,e,n,o){return _o(t,e,n,o)}function No(t,e){return!!(t>=Oe||t===0&&e)}function vt(t,e){return t<e}function Co(t,e){return e===!1?!1:e===!0?!0:t}function as(t,e,n,o){return!(t.hidden||(t.status??"completed")!==n||o.member==="mine"&&o.currentUserId&&t.created_by!==o.currentUserId||o.type==="automation"&&!t.trigger_id||o.type==="manual"&&t.trigger_id)}const Ne=new Map,ye=new Map;function wo(t,e){return e?t>=Oe?!0:null:!1}function yt(t){return Ne.get(t)}function ko(t,e){Ne.set(t,e)}function Io(t,e,n){const o=Ne.get(t);if(o!==void 0){n(o);return}let i=ye.get(t);i||(i=ls(e).then(r=>(Ne.set(t,r),ye.delete(t),r)).catch(()=>(ye.delete(t),Promise.reject(new Error("group probe failed")))),ye.set(t,i)),i.then(n,()=>n(!1))}function St(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Oe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ao(t,e,n,o,i){let r=0;for(const l of t)e.has(l.id)||as(l,n,o,i)&&r++;return r}function zo(t,e,n,o){const i=I.c(8),{org:r}=X(),l=vo(r.id,t,e,n);let a;i[0]!==n?(a=yo(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=M.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const u=Tn(),{threads:f,hasMore:h}=Je(),x=Fe(f,t,e,n),g=No(x,h),p=wo(x,h),b=Kt();if(c.identity===l&&c.serverHasMore===null){const _=p??yt(l);_!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!m&&c.identity===l&&c.serverHasMore===null&&p===null&&yt(l)===void 0&&c.probeSubscribedIdentity!==l&&(d(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),Io(l,async()=>{const _=jt(t,e,0,n,1),N=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:w}=St(N),A=Fe(u.threads.get(),t,e,n);return w===void 0?!1:vt(A,w)},_=>{d(N=>N.identity!==l?N:{...N,isProbing:!1,serverHasMore:_})}));const v=async function(){if(c.isFetching||c.isProbing||m)return;const N=l;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=Fe(f,t,e,n),A=jt(t,e,w,n,Oe),z=await ls(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:k,hasMore:$,totalCount:D}=St(z),R=new Set(f.map($o)),B=Ao(k,R,t,e,n),L=w;u.mergeThreads(k),d(P=>{if(P.identity!==N)return P;let E;return D!==void 0?E=vt(L+B,D):E=k.length===0||B===0?!1:$,ko(N,E),{...P,isFetching:!1,serverHasMore:E}})}catch(w){const A=w,z=A instanceof Error?A.message:String(A);oe.error(`Could not load more tasks: ${z}`),d(k=>k.identity===N?{...k,isFetching:!1}:k)}},y=c.isFetching||c.isProbing,S=!m&&!y&&Co(g,c.serverHasMore);let C;return i[2]!==y||i[3]!==v||i[4]!==S||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:S,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},i[2]=y,i[3]=v,i[4]=S,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function $o(t){return t.id}function To(t){const e=I.c(20),{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:f,serverHasMore:h}=zo("status",n,m),[x,g]=M.useState(!1);!x&&o.length===0&&h===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==l||e[4]!==r||e[5]!==o){let v;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==l||e[11]!==r?(v=y=>s.jsx(is,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:a&&y.created_by===m.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=a,e[9]=m,e[10]=l,e[11]=r,e[12]=v):v=e[12],p=o.map(v),e[0]=i,e[1]=a,e[2]=m,e[3]=l,e[4]=r,e[5]=o,e[6]=p}else p=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function Oo(t){const e=I.c(36),{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m}=t,c=hi[n],d=c.icon,[u,f]=jo(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const x=h;let g;e[3]!==x?(g=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=p):p=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Xe,{size:14}):s.jsx(pi,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c.label?(v=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=v):v=e[14];let y;e[15]!==o.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:o.length})}),e[15]=o.length,e[16]=y):y=e[16];let S;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==v||e[22]!==y?(S=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,v,y]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=v,e[22]=y,e[23]=S):S=e[23];let C;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==l||e[29]!==r||e[30]!==n||e[31]!==o?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(To,{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=l,e[29]=r,e[30]=n,e[31]=o,e[32]=C):C=e[32];let _;return e[33]!==S||e[34]!==C?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[S,C]}),e[33]=S,e[34]=C,e[35]=_):_=e[35],_}function _t(t){const e=I.c(38),{threads:n,groupBy:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(mi,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||m;if(o==="status"){let p;if(e[3]!==i||e[4]!==f||e[5]!==a||e[6]!==l||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==f||e[12]!==a||e[13]!==l||e[14]!==r?(j=v=>s.jsx(Oo,{status:v.status,threads:v.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:f,filters:a},v.status),e[10]=i,e[11]=f,e[12]=a,e[13]=l,e[14]=r,e[15]=j):j=e[15],p=go(n).map(j),e[3]=i,e[4]=f,e[5]=a,e[6]=l,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let h;if(e[18]!==i||e[19]!==f||e[20]!==a||e[21]!==l||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==f||e[27]!==a||e[28]!==l||e[29]!==r?(p=b=>s.jsx(is,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:f&&b.created_by===a.currentUserId?()=>l(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=f,e[27]=a,e[28]=l,e[29]=r,e[30]=p):p=e[30],h=n.map(p),e[18]=i,e[19]=f,e[20]=a,e[21]=l,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(os,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==h||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[h,x]}),e[35]=h,e[36]=x,e[37]=g):g=e[37],g}function Mo(t,e,n){if(!n)return;const o=t.findIndex(i=>i.id===e);if(o!==-1){for(let i=o+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=o-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Nt(t){const e=I.c(17),{label:n,onClick:o,active:i,children:r}=t,[l,a]=M.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=O("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=h):h=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==o||e[9]!==h?(x=s.jsx(le,{asChild:!0,children:s.jsx(me,{"aria-label":n,onClick:o,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=o,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(ae,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==l||e[14]!==x||e[15]!==g?(p=s.jsxs(ce,{open:l,children:[x,g]}),e[13]=l,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function Re(t){const e=I.c(13),{label:n,value:o,onChange:i,options:r}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(Eo),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==o?(c=s.jsx(ii,{type:"single",size:"sm",value:o,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=o,e[9]=c):c=e[9];let d;return e[10]!==l||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,c]}),e[10]=l,e[11]=c,e[12]=d):d=e[12],d}function Eo(t){return s.jsxs(ni,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function cs({onNavigate:t}={}){const{data:e}=te.useSession(),n=e?.user?.id,{org:o}=X(),i=$t({connectionId:Ot,orgId:o.id,orgSlug:o.slug}),r=_e(o.id).id,l=Dt(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=Je(),u=a.filter(T=>!T.hidden),{hide:f,setScope:h}=Ut(),x=ne(),{setTaskId:g,createNewTask:p}=Ze(),b=Ve({strict:!1}),j=we({strict:!1}),v=b.taskId??null,y=j.virtualmcpid??a.find(T=>T.id===v)?.virtual_mcp_id??null,S=()=>{t?.()},C=[...u].sort((T,q)=>(q.updated_at??"").localeCompare(T.updated_at??"")),[_,N]=M.useState("all"),[w,A]=M.useState("flat"),[z,k]=Ce("sidebar-threads-scope-all",!1),[$,D]=M.useState(!1),[R,B]=M.useState(!1),L={type:_,member:"mine",currentUserId:n??null},P={};z||(P.created_by="me"),h(P);const E=T=>n?T.filter(q=>q.created_by===n):[],F=T=>_==="automation"?T.filter(q=>!!q.trigger_id):_==="manual"?T.filter(q=>!q.trigger_id):T,U=E(C),G=F(U),W=F(C),Y=z?W:G,V=T=>{if(n&&T.created_by&&T.created_by!==n)return;const q=T.id===v;if(f(T.id),En(T.id),!q)return;const ie=Mo(Y,T.id,n);S(),ie?g(ie.id,ie.virtual_mcp_id):x({to:"/$org",params:{org:o.slug}})},Me=T=>{S(),g(T.id,T.virtual_mcp_id)},ms=async T=>{try{const q=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((q.structuredContent??q).items?.length??0)===0}catch{return!1}},tt=async()=>{const T=y??r;J("sidebar_new_thread_clicked",{virtual_mcp_id:T});const q=U.find(ie=>ie.virtual_mcp_id===T&&ie.title==="New chat");if(q&&await ms(q.id)){S(),g(q.id,T);return}S(),p(T)},{state:us,isMobile:st,toggleSidebar:fs}=re();if(us==="collapsed"&&!st){const T=_e(o.id),q=new Map((l??[]).map(Z=>[Z.id,Z])),ie=Z=>(Z?q.get(Z):void 0)??(Z===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(ns,{orgParam:o.slug,side:"right",align:"start",trigger:s.jsx(K,{tooltip:o.name,children:s.jsx($e,{org:o,size:"sm"})})})}),s.jsxs(ee,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(H,{children:s.jsx(K,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fs,children:s.jsx(Et,{size:16})})}),s.jsx(H,{children:s.jsx(K,{tooltip:"New chat",onClick:()=>{tt()},children:s.jsx(ot,{size:16})})}),Y.map(Z=>{const it=ie(Z.virtual_mcp_id);return s.jsx(H,{children:s.jsx(K,{tooltip:Z.title||"New chat",isActive:Z.id===v,onClick:()=>Me(Z),children:s.jsx(de,{icon:it?.icon??null,name:it?.title??"Agent",size:"xs"})})},Z.id)})]})]})}const ve=w!=="flat"||_!=="all"||z===!0,hs=s.jsxs(Ie,{children:[s.jsxs(ce,{children:[s.jsx(le,{asChild:!0,children:s.jsx(fe,{asChild:!0,children:s.jsxs(me,{"aria-label":"Filter chats",active:ve,className:"md:size-[34px] rounded-lg",children:[s.jsx(si,{size:16}),ve&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ae,{side:"bottom",children:"Filter chats"})]}),s.jsxs(ke,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Re,{label:"View",value:w,onChange:T=>{J("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(cn,{size:13})},{value:"status",label:"Status",icon:s.jsx(dn,{size:13})}]}),s.jsx(Re,{label:"Type",value:_,onChange:T=>{J("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Re,{label:"Scope",value:z?"team":"mine",onChange:T=>k(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),nt=T=>s.jsx(Pt,{delayDuration:300,children:s.jsxs("div",{className:O("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Xt,{className:"md:size-[34px] rounded-lg"}),hs]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Nt,{label:"Search chats",onClick:()=>{J("tasks_panel_search_opened"),B(!0),D(!0)},children:s.jsx(an,{size:16})}),s.jsx(Nt,{label:"New chat",onClick:()=>{tt()},children:s.jsx(ot,{size:16})})]})]})});return st?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[nt(!0),s.jsx(pt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(_t,{threads:Y,groupBy:w,activeTaskId:v,onSelectTask:Me,onArchiveTask:V,filters:L,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ve})}),R&&s.jsx(gt,{open:$,onOpenChange:D})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[nt(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(pt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(_t,{threads:Y,groupBy:w,activeTaskId:v,onSelectTask:Me,onArchiveTask:V,filters:L,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ve})})}),R&&s.jsx(gt,{open:$,onOpenChange:D})]})}const Po=5,Do=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function ds(){const t=I.c(3),{state:e}=re();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Po}).map(Lo)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"})]}),s.jsx(se,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Do.map(Fo)})]}),t[2]=o):o=t[2],o}function Fo(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(se,{className:"size-5 rounded-full shrink-0"}),s.jsx(se,{className:O("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Ro)})]},e)}function Ro(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(se,{className:"h-3 flex-1 rounded-sm"})},e)}function Lo(t,e){return s.jsx(se,{className:"size-10 rounded-lg mx-auto"},e)}function Ho(){const t=I.c(2);if(ze()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ue,{showName:!0}),t[0]=o):o=t[0],o}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(Ue,{}),s.jsx(Te,{})]}),t[1]=n):n=t[1],n}function Bo(){const t=I.c(5),e=Qt();let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(uo,{}),o=s.jsx(Ho,{}),t[0]=n,t[1]=o):(n=t[0],o=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(We,{children:s.jsx(M.Suspense,{fallback:s.jsx(ds,{}),children:s.jsx(cs,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(Gt,{children:s.jsx(es,{sections:e,footer:n,header:o,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function Uo(t){const e=I.c(8),{onClose:n}=t,o=Qt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fo,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ds,{}),e[1]=r):r=e[1];let l;e[2]!==n?(l=s.jsx(We,{children:s.jsx(M.Suspense,{fallback:r,children:s.jsx(cs,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==o||e[6]!==l?(a=s.jsx(Gt,{children:s.jsx(eo,{sections:o,onClose:n,footer:i,additionalContent:l})}),e[4]=n,e[5]=o,e[6]=l,e[7]=a):a=e[7],a}const Go="sidebar.open";function Wo(){const t=I.c(1),{state:e}=re(),n=ze();if(e!=="collapsed"||n)return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Te,{}),t[0]=o):o=t[0],o}function Vo(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Os,{}),t[0]=e):e=t[0],e}function fa(){const t=I.c(43),e=Ye(),n=ze();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{connect:i,siteUrl:r}=we(o),l=i==="1",[a,m]=Ce(Go,!1),{width:c,wrapperRef:d,onStartResize:u,resetWidth:f}=Ci(),h=!e;let x,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(Q.LeftColumn,{children:[s.jsx(Wo,{}),s.jsx(Q.TogglesSlot,{})]}),g=s.jsx(Q.CenterSlot,{}),t[1]=x,t[2]=g):(x=t[1],g=t[2]);let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(Q.Header,{children:[x,g,s.jsxs(Q.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})]}),t[3]=p):p=t[3];const b=p;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Xt,{}),t[4]=j):j=t[4];let v;t[5]!==n?(v=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(Te,{})}),t[5]=n,t[6]=v):v=t[6];let y,S,C,_,N;t[7]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(be,{}),C=s.jsx(Q.TogglesSlot,{}),_=s.jsx(Q.TabsSlot,{className:"shrink-0"}),N=s.jsx(Q.CenterSlot,{}),y=s.jsx(Q.RightSlot,{}),t[7]=y,t[8]=S,t[9]=C,t[10]=_,t[11]=N):(y=t[7],S=t[8],C=t[9],_=t[10],N=t[11]);let w;t[12]!==v?(w=s.jsx(Q.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,v,S,C,_,N,y]})}),t[12]=v,t[13]=w):w=t[13];const A=w;let z;t[14]===Symbol.for("react.memo_cache_sentinel")?(z={background:"transparent",containerType:"inline-size"},t[14]=z):z=t[14];let k;t[15]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ps,{className:"flex flex-col min-h-0",style:z,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(M.Suspense,{fallback:s.jsx(Vo,{}),children:s.jsx(Ts,{})})})})}),t[15]=k):k=t[15];const $=k,D=!h&&(e?A:b),R=`${c}px`;let B;t[16]!==R?(B={"--sidebar-width":R,"--sidebar-width-icon":"3.125rem"},t[16]=R,t[17]=B):B=t[17];const L=B;let P;t[18]!==e||t[19]!==u||t[20]!==f?(P=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Bo,{}),s.jsx(Si,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=P):P=t[21];let E;t[22]!==h?(E=h?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,$]}):$,t[22]=h,t[23]=E):E=t[23];let F;t[24]!==L||t[25]!==P||t[26]!==E||t[27]!==d?(F=s.jsxs(Ds,{ref:d,className:"flex-1 bg-sidebar relative min-h-0",style:L,children:[P,E]}),t[24]=L,t[25]=P,t[26]=E,t[27]=d,t[28]=F):F=t[28];let U;t[29]!==e?(U=e&&s.jsx(di,{renderSidebar:qo}),t[29]=e,t[30]=U):U=t[30];let G;t[31]!==r||t[32]!==l?(G=l&&s.jsx(gi,{siteUrl:r}),t[31]=r,t[32]=l,t[33]=G):G=t[33];let W;t[34]!==D||t[35]!==F||t[36]!==U||t[37]!==G?(W=s.jsx(An,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[D,F,U,G]})}),t[34]=D,t[35]=F,t[36]=U,t[37]=G,t[38]=W):W=t[38];let Y;return t[39]!==m||t[40]!==a||t[41]!==W?(Y=s.jsx(On,{children:s.jsx(Q.Provider,{children:s.jsx(Fs,{open:a,onOpenChange:m,children:W})})}),t[39]=m,t[40]=a,t[41]=W,t[42]=Y):Y=t[42],Y}function qo(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Uo,{onClose:e})})})}export{fa as default};
|