decocms 4.331.0 → 4.331.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CeJGX1aj.js → AlertCircle-CTUkQXgs.js} +1 -1
- package/dist/client/assets/{AreaChart-BImYnimz.js → AreaChart-C7DTOZ-b.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CzjscPeK.js → ArrowLeft-DEDPbgLG.js} +1 -1
- package/dist/client/assets/{ArrowUp-CbXZzgIn.js → ArrowUp-BC1eUTqQ.js} +1 -1
- package/dist/client/assets/{Check-DwC3z1rx.js → Check-DhyLPiiJ.js} +1 -1
- package/dist/client/assets/{CheckCircle-DDxCuD7T.js → CheckCircle-CtgjJb3s.js} +1 -1
- package/dist/client/assets/{ChevronRight-BYetryHl.js → ChevronRight-erhjObhH.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BnCU9Xw2.js → ChevronSelectorVertical-L5QYEswb.js} +1 -1
- package/dist/client/assets/{ChevronUp-DjeW3rf8.js → ChevronUp-B7eB07ok.js} +1 -1
- package/dist/client/assets/{Copy01-DQMea6lD.js → Copy01-xF3K8KuJ.js} +1 -1
- package/dist/client/assets/{CreditCard01-CuAgtIoq.js → CreditCard01-DasQHOnb.js} +1 -1
- package/dist/client/assets/{DotsVertical-DHzsSfS0.js → DotsVertical-alsvv1gj.js} +1 -1
- package/dist/client/assets/{Download01-CCUcARk8.js → Download01-Carxvlo9.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-iSj6O4tu.js → ErrorBarContext-D1fW4DqU.js} +1 -1
- package/dist/client/assets/{Eye-DCY4B_Aq.js → Eye-T_5uiyBH.js} +1 -1
- package/dist/client/assets/{GitBranch01-DavFtT7J.js → GitBranch01-F7oOBAG6.js} +1 -1
- package/dist/client/assets/{Globe01-CWxN73Or.js → Globe01-Cip-2Ps4.js} +1 -1
- package/dist/client/assets/{HardDrive-C1RU_F8K.js → HardDrive-5keoMCkV.js} +1 -1
- package/dist/client/assets/{Image01-CZUSsIWJ.js → Image01-B2vrhds6.js} +1 -1
- package/dist/client/assets/{Key01-UmvGAYHQ.js → Key01-BDWlMcfg.js} +1 -1
- package/dist/client/assets/{Link01-Nzb5ZvLF.js → Link01-C08e0rPS.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dsnt5EOL.js → LinkExternal01-DVFUVB9h.js} +1 -1
- package/dist/client/assets/{Monitor01-pKli1vHT.js → Monitor01-BIBipmDF.js} +1 -1
- package/dist/client/assets/{Package-BP_9s2JL.js → Package-ZNK4UmQ4.js} +1 -1
- package/dist/client/assets/{Palette-BPE_MOvx.js → Palette-BZNwl0Y4.js} +1 -1
- package/dist/client/assets/{Play-DhGSA0iw.js → Play-Bdez5_h5.js} +1 -1
- package/dist/client/assets/{Plus-BANbQu0C.js → Plus-DpDZOmhb.js} +1 -1
- package/dist/client/assets/{SearchMd-b1VauOXm.js → SearchMd-TZRK7Jjy.js} +1 -1
- package/dist/client/assets/{Sector-DDM-UAiA.js → Sector-fCAN3APE.js} +1 -1
- package/dist/client/assets/{Settings02-DL4qHKPe.js → Settings02-BvEJJ01O.js} +1 -1
- package/dist/client/assets/{Share07-Cgan-Cfi.js → Share07-BbKQaSoa.js} +1 -1
- package/dist/client/assets/{Shield01-Bbt414S-.js → Shield01-C7gp23VU.js} +1 -1
- package/dist/client/assets/{Stars01-D8jFx6hR.js → Stars01-DzR1pkba.js} +1 -1
- package/dist/client/assets/{Sun-4ohzmuR2.js → Sun-CRSDN_xr.js} +1 -1
- package/dist/client/assets/{Tool01-C18ZpNfv.js → Tool01-BI2Udquq.js} +1 -1
- package/dist/client/assets/{Tool02-DrjGknwf.js → Tool02-D8KfndCv.js} +1 -1
- package/dist/client/assets/{Trash01-qI-MNO3W.js → Trash01-DMTMR2Ld.js} +1 -1
- package/dist/client/assets/{TrendUp01-D8_aoFuw.js → TrendUp01-DBzB_6-8.js} +1 -1
- package/dist/client/assets/{Upload01-h9msh4RF.js → Upload01-BaU8BJAh.js} +1 -1
- package/dist/client/assets/{User01-W-TGtA_0.js → User01-EYes367B.js} +1 -1
- package/dist/client/assets/{UserSquare-Crs1iNVm.js → UserSquare-B0qUe-aI.js} +1 -1
- package/dist/client/assets/{Users01-CJas_o50.js → Users01-DKepKoSC.js} +1 -1
- package/dist/client/assets/{Users03-iZkxvRLt.js → Users03-Dwp9VmWX.js} +1 -1
- package/dist/client/assets/{XCircle-B12Azu0Q.js → XCircle-BsDfD2mO.js} +1 -1
- package/dist/client/assets/{XClose-U5JL72PX.js → XClose-B53vZH_B.js} +1 -1
- package/dist/client/assets/{Zap-D7GDOY-h.js → Zap-DoRxOrrO.js} +1 -1
- package/dist/client/assets/{ZoomOut-CjRBAjBN.js → ZoomOut-DwUiWK8W.js} +1 -1
- package/dist/client/assets/{access-gate-Dw4vqU6J.js → access-gate-Bg5o0dFT.js} +1 -1
- package/dist/client/assets/{agent-icon-B48zizgx.js → agent-icon-Dp7ilfSA.js} +1 -1
- package/dist/client/assets/{agents-list-B92n23Ou.js → agents-list-FPxN9IOf.js} +1 -1
- package/dist/client/assets/{ai-providers-CrL7749i.js → ai-providers-D7PLItv9.js} +1 -1
- package/dist/client/assets/{alert-uSRYjM9c.js → alert-CnJoV69d.js} +1 -1
- package/dist/client/assets/{alert-dialog-C9B_UVL_.js → alert-dialog-CFvtxInl.js} +1 -1
- package/dist/client/assets/{analytics-tab-D2rbH2QN.js → analytics-tab-CMEI20XU.js} +1 -1
- package/dist/client/assets/{api-keys-sNY1Rre8.js → api-keys-C9nPFDfD.js} +1 -1
- package/dist/client/assets/api-keys-D2YehNxd.js +1 -0
- package/dist/client/assets/{app-editor-DW3zJhgQ.js → app-editor-CWnLKzg3.js} +1 -1
- package/dist/client/assets/{auth-BRsOzYq2.js → auth-CPKG1PMF.js} +1 -1
- package/dist/client/assets/{auth-catchall-B5pNriiM.js → auth-catchall-CakNmAFy.js} +1 -1
- package/dist/client/assets/{auth-entry-5XM8llWP.js → auth-entry-RnBUxeeA.js} +1 -1
- package/dist/client/assets/{auth-split-layout-0T7TkoQQ.js → auth-split-layout-kNG-EnWA.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DmW5k2KW.js → authenticate-and-persist-oauth-DHpekAO-.js} +1 -1
- package/dist/client/assets/{automation-list-row-DbQbxIBH.js → automation-list-row-C09iz2n2.js} +1 -1
- package/dist/client/assets/{automation-runs-BTUw3uBv.js → automation-runs-CAkFynJ2.js} +1 -1
- package/dist/client/assets/{automations-su9ERGi_.js → automations-BqJaQO-O.js} +1 -1
- package/dist/client/assets/{avatar-CNX9dPWO.js → avatar-CYvGTxVT.js} +1 -1
- package/dist/client/assets/{badge-DFCpQXcf.js → badge-jE0YdZz3.js} +1 -1
- package/dist/client/assets/{block-document-CY7wphTC.js → block-document-B9qbgFtn.js} +1 -1
- package/dist/client/assets/{breadcrumb-BLaxQkWE.js → breadcrumb-DKP8gBQX.js} +1 -1
- package/dist/client/assets/{buckets-aXIjaMHW.js → buckets-D5dyQWsL.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Bsi16ls-.js → bulk-category-panel-B87XiH9C.js} +1 -1
- package/dist/client/assets/{capability-load-error-DNDy9nsX.js → capability-load-error-CAVNGlum.js} +1 -1
- package/dist/client/assets/{cards--0c2HVU8.js → cards-BqL2dW3x.js} +1 -1
- package/dist/client/assets/{category-editor-BZCHHQVe.js → category-editor-YbrcictE.js} +1 -1
- package/dist/client/assets/{cdn-tab-C2KgOzv3.js → cdn-tab-BCSDeMOv.js} +1 -1
- package/dist/client/assets/{chart-C4lX7RVi.js → chart-CZch6DZp.js} +1 -1
- package/dist/client/assets/{chat-context-C97ngXtn.js → chat-context-BEHg6aEi.js} +1 -1
- package/dist/client/assets/{checkbox-C2aLrWKH.js → checkbox-DMdSKryI.js} +1 -1
- package/dist/client/assets/{choose-editor-CIm9FomR.js → choose-editor-B4jBLX09.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DsYRoAC-.js → cli-auth-success-CAD1lTgl.js} +1 -1
- package/dist/client/assets/{client-icons-DcgI21MG.js → client-icons-jyguvoVn.js} +1 -1
- package/dist/client/assets/{collection-detail-C7Lua4LN.js → collection-detail-1jWQu8QJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-DLNI5DR9.js → collection-display-button-DI-nsDCn.js} +1 -1
- package/dist/client/assets/{collection-search-B0Ems0e3.js → collection-search-CoaljN3t.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-yKl-NYAt.js → collection-table-wrapper-Cjvx4Wv2.js} +1 -1
- package/dist/client/assets/{collection-tabs-DWuBMe93.js → collection-tabs-DV5Bk6yE.js} +1 -1
- package/dist/client/assets/{command-44bpz2f7.js → command-DHa5RJaq.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-9urcWgyE.js → commerce-onboarding-B0oP2xjO.js} +1 -1
- package/dist/client/assets/{connect-BZ6z9xkv.js → connect-CHfvFOxu.js} +1 -1
- package/dist/client/assets/{connect-layout-D1-Yv6Nt.js → connect-layout-MA2Awb7r.js} +1 -1
- package/dist/client/assets/{connection-aFTZVtta.js → connection-BBdo3uke.js} +1 -1
- package/dist/client/assets/{connection-card-BLXD5mcy.js → connection-card-B3IJPiNj.js} +1 -1
- package/dist/client/assets/{connection-detail-CZq3EAy_.js → connection-detail-Lxtie76t.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C0_ULCSn.js → connection-form-helpers-Do9xG8iy.js} +1 -1
- package/dist/client/assets/{connections-CakdZreO.js → connections-Cme4XVUa.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-B-H-rzfh.js → create-organization-dialog-CDLw0Z3U.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BUcLYmbe.js → decopilot-sse-pool-DuxzrK6E.js} +1 -1
- package/dist/client/assets/{dialog-RbA7IheM.js → dialog--s8x0s1I.js} +1 -1
- package/dist/client/assets/{domain-settings-Bwlm7ElE.js → domain-settings-D_b5aj2K.js} +1 -1
- package/dist/client/assets/{drawer-BrDS1G0V.js → drawer-BhTJZiCl.js} +1 -1
- package/dist/client/assets/{dropdown-menu-o3ET1Hdn.js → dropdown-menu-B1CAYfZn.js} +1 -1
- package/dist/client/assets/{e2e-tab-D9MBFymX.js → e2e-tab-BfF-aLBq.js} +1 -1
- package/dist/client/assets/{editor-DRD3n37q.js → editor-C2YJx_fu.js} +1 -1
- package/dist/client/assets/{empty-state-C8riWqwz.js → empty-state-BeZZ6aWm.js} +1 -1
- package/dist/client/assets/{empty-state-CF09AK7Y.js → empty-state-co5TrSoZ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BwNCLN99.js → extract-connection-data-ovzHbL2Q.js} +1 -1
- package/dist/client/assets/{file-explorer-DUZbQ7ED.js → file-explorer-BMq9QxXt.js} +1 -1
- package/dist/client/assets/{file-type-icon-BjTldwkh.js → file-type-icon-CCcQ6AAf.js} +1 -1
- package/dist/client/assets/{folder-icon-CYpCXucT.js → folder-icon-B0WjuCw8.js} +1 -1
- package/dist/client/assets/{form-7-guzABw.js → form-Bz464I8y.js} +1 -1
- package/dist/client/assets/{general-BrSVrq_U.js → general-CTShTVqj.js} +1 -1
- package/dist/client/assets/{github-repo-picker-vPoyODrr.js → github-repo-picker-CardHb2H.js} +1 -1
- package/dist/client/assets/{hooks-D74-rHgb.js → hooks-BVfnO0Aw.js} +1 -1
- package/dist/client/assets/{hosting-tab-BEUO6vdv.js → hosting-tab-eRzJDwNq.js} +1 -1
- package/dist/client/assets/{index-DWKe_Q7c.js → index-BbswpEHj.js} +1 -1
- package/dist/client/assets/{index-LU2AC7M4.js → index-Bddb2TOb.js} +1 -1
- package/dist/client/assets/{index-Dok2Onq9.js → index-CMU-J5F2.js} +1 -1
- package/dist/client/assets/{index-DtObLnN2.js → index-CNdagDd8.js} +1 -1
- package/dist/client/assets/{index-dcLtXjb9.js → index-CXAF3w4w.js} +1 -1
- package/dist/client/assets/{index-B0xJaq-R.js → index-CX_Uh4IL.js} +1 -1
- package/dist/client/assets/{index-Cy-Ifi83.js → index-DDup5Pv4.js} +6 -6
- package/dist/client/assets/{index-BwV1-h20.js → index-DEh6Md0L.js} +1 -1
- package/dist/client/assets/{index-1nlVNgxn.js → index-Db96eOyL.js} +2 -2
- package/dist/client/assets/{index-wcC_uVXg.js → index-q60P7Zs8.js} +1 -1
- package/dist/client/assets/{index-redirect-DI_a-Brr.js → index-redirect-KOgwebWE.js} +1 -1
- package/dist/client/assets/{infra-billing-Bl6JKrbN.js → infra-billing-BVgEtduf.js} +1 -1
- package/dist/client/assets/{input-Bh_UVYjo.js → input-Cwwyr7Rh.js} +1 -1
- package/dist/client/assets/{integration-icon-C9yUDokb.js → integration-icon-B5SelfUS.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DjQvCxT2.js → invite-member-dialog-C1bUVNWi.js} +1 -1
- package/dist/client/assets/{label-CPshF2pU.js → label-D_vdFESC.js} +1 -1
- package/dist/client/assets/{layout-IKXh8SmL.js → layout-CgD5MMGX.js} +1 -1
- package/dist/client/assets/{login-Dhs_LgNz.js → login-BKtn9Zk-.js} +1 -1
- package/dist/client/assets/{markdown-BUVdPg3H.js → markdown-BTQo5HHG.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DBHQjyoD.js → mcp-oauth-BPMpNuFO.js} +1 -1
- package/dist/client/assets/{members-CDrg_x6h.js → members-CJF6NKF4.js} +1 -1
- package/dist/client/assets/{monaco-editor-B8Fm73Ld.js → monaco-editor-CqhlT806.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DANohFMf.js → monitoring-stats-row-CZhvYRwq.js} +1 -1
- package/dist/client/assets/{multi-select-Dz5hSv6H.js → multi-select-CjXByEMA.js} +1 -1
- package/dist/client/assets/{oauth-callback-XpDejOwo.js → oauth-callback-DlWi0e5v.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ED4SOqW-.js → oauth-callback-ai-provider-CeDxg54Z.js} +1 -1
- package/dist/client/assets/{onboarding-BwlKj9DR.js → onboarding-CppmVf6x.js} +1 -1
- package/dist/client/assets/{org-layout-CtfHpZVe.js → org-layout-39ZF5JVf.js} +1 -1
- package/dist/client/assets/{organization-choice-D2BDC1IL.js → organization-choice-D3M0mKax.js} +1 -1
- package/dist/client/assets/{orgs-BjftqeVg.js → orgs-CGyMtTjb.js} +1 -1
- package/dist/client/assets/{page-seo-form-kX4FCj4v.js → page-seo-form-CvkcVW5N.js} +1 -1
- package/dist/client/assets/{popover-CHu9OoAU.js → popover-BJRufN5E.js} +1 -1
- package/dist/client/assets/{post-calendar-CZvePpWi.js → post-calendar-DECkti-b.js} +1 -1
- package/dist/client/assets/{post-editor-B9--qYPG.js → post-editor-CUpCPNXF.js} +1 -1
- package/dist/client/assets/{primitives-AiNdPl89.js → primitives-tNTHzhGL.js} +1 -1
- package/dist/client/assets/{profile-XOvnwp8G.js → profile-CD4pVSnx.js} +1 -1
- package/dist/client/assets/{project-app-view-Cwd_PO9C.js → project-app-view-mek55VZ7.js} +1 -1
- package/dist/client/assets/{project-icon-B09v6EvP.js → project-icon-DW2b1tpw.js} +1 -1
- package/dist/client/assets/{prompts-BlywLHYY.js → prompts-ylc2vOB7.js} +1 -1
- package/dist/client/assets/record-editor-C_Y7e52y.js +1 -0
- package/dist/client/assets/redirect-editor-COuJvUl5.js +1 -0
- package/dist/client/assets/registry-Up5B6LrP.js +2 -0
- package/dist/client/assets/{registry-layout-DhGQCgPe.js → registry-layout-DDAVBECZ.js} +1 -1
- package/dist/client/assets/{reports-AZqE3FZg.js → reports-Ce4vS7W7.js} +1 -1
- package/dist/client/assets/{require-capability-sqTle2Fa.js → require-capability-sWsoOFc2.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BPvtlMuF.js → required-auth-layout-CokOUEgr.js} +1 -1
- package/dist/client/assets/{reset-password-CSV5VUVH.js → reset-password-ZJVFaRMm.js} +1 -1
- package/dist/client/assets/{review-settings-DqhU3Tk0.js → review-settings-BVtqlS7Y.js} +1 -1
- package/dist/client/assets/roles-DDTREEXS.js +1 -0
- package/dist/client/assets/{schema-DYE3f2lq.js → schema-D3Zdtr4A.js} +1 -1
- package/dist/client/assets/{scroll-area-DOQU287w.js → scroll-area-CeOD07Hw.js} +1 -1
- package/dist/client/assets/{search-input-CvsG48c7.js → search-input-D5IwxOW_.js} +1 -1
- package/dist/client/assets/{secrets-B4Yh-DKc.js → secrets-DQbg3yxG.js} +1 -1
- package/dist/client/assets/{sections-editor-BnQciha7.js → sections-editor-BG-tuDpJ.js} +1 -1
- package/dist/client/assets/{select-HaMFNCEI.js → select-CaIqJLnH.js} +1 -1
- package/dist/client/assets/{select-model-DWMhwNPs.js → select-model-BaaM-99e.js} +1 -1
- package/dist/client/assets/{self-tool-result-ClyhUtjJ.js → self-tool-result-EE9JsxOL.js} +1 -1
- package/dist/client/assets/{seo-editor-DXov33O1.js → seo-editor-BUI6GRns.js} +1 -1
- package/dist/client/assets/settings-layout-gBQs_ZGW.js +1 -0
- package/dist/client/assets/{settings-sidebar-Bja2pzq0.js → settings-sidebar-DGHR5cgg.js} +1 -1
- package/dist/client/assets/{shell-controls-DQbjapvr.js → shell-controls-1hzI1GBL.js} +1 -1
- package/dist/client/assets/{shell-layout-pJ3SWts0.js → shell-layout--n0X6oT8.js} +1 -1
- package/dist/client/assets/{skill-preview-Bkt9-1nT.js → skill-preview-C5-e77Iq.js} +1 -1
- package/dist/client/assets/{skills-BJoFOee1.js → skills-DnPgPbsQ.js} +1 -1
- package/dist/client/assets/{sso-v1ShUMRn.js → sso-2iOnxIqW.js} +1 -1
- package/dist/client/assets/{store-8kZqr41n.js → store-4cjHStMO.js} +1 -1
- package/dist/client/assets/store-registry-CiA81JKH.js +2 -0
- package/dist/client/assets/{switch-BtR8WZ52.js → switch-H6mW7TWR.js} +1 -1
- package/dist/client/assets/{synced-repos-BLS9thb0.js → synced-repos-Bg__UD_R.js} +1 -1
- package/dist/client/assets/{table-3iU2ypXW.js → table-D4EsPh8H.js} +1 -1
- package/dist/client/assets/{tabs-BLXnhEIS.js → tabs-DI7MVoHq.js} +1 -1
- package/dist/client/assets/{task-board-DD60a6Wz.js → task-board-CPnu2vHn.js} +1 -1
- package/dist/client/assets/{task-route-CIm49PI2.js → task-route-BTZYbUm0.js} +1 -1
- package/dist/client/assets/{tasks-D8auuWY1.js → tasks-DNY41pOF.js} +1 -1
- package/dist/client/assets/{textarea-Bgm417OP.js → textarea-fFyq39OK.js} +1 -1
- package/dist/client/assets/{thread-intent-5WHIjvYR.js → thread-intent-BpQob6u5.js} +1 -1
- package/dist/client/assets/{thread-route-DjJKU-k5.js → thread-route-DnMeCT5b.js} +1 -1
- package/dist/client/assets/{toggle-group-Cljr_L-y.js → toggle-group-5X5OVxvO.js} +1 -1
- package/dist/client/assets/{toolbar-ZyieXU9W.js → toolbar-CygYAeNY.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B1L3M1az.js → toolbar-icon-button-BjsE6ye3.js} +1 -1
- package/dist/client/assets/{track-BcGj_lMs.js → track-YMOI2TKV.js} +1 -1
- package/dist/client/assets/{types-CKOZt2hR.js → types-D618nSWF.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DmrtFZ3b.js → use-ai-providers-9OMyWZ-c.js} +1 -1
- package/dist/client/assets/{use-automations-DYhybc22.js → use-automations-B7rq5y89.js} +1 -1
- package/dist/client/assets/{use-autosave-DSVdvb0E.js → use-autosave-B1LwduED.js} +1 -1
- package/dist/client/assets/{use-connection-BFZIwSmK.js → use-connection-Dy0Z_WuU.js} +1 -1
- package/dist/client/assets/{use-copy-BM2RAZ1Q.js → use-copy-BtAcYms1.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C-Ogs2Q-.js → use-create-virtual-mcp-wM5JPyhO.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-60cBP7wJ.js → use-debounced-autosave-C9ED2M-K.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Dr0xObbz.js → use-debounced-value-CNLUOYR4.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DaVkBR_8.js → use-decopilot-events-CXqAHm8B.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BsLduKUe.js → use-delete-connection-Cd3jvMUJ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BsLn-GEH.js → use-deployment-admin-DlTRBf6Y.js} +1 -1
- package/dist/client/assets/{use-destination-route-iMqy_40D.js → use-destination-route-BlaUDv1t.js} +1 -1
- package/dist/client/assets/{use-file-configs-BLRF4b-d.js → use-file-configs-DDYv5LKG.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BaRAvP_7.js → use-infinite-scroll-DO_cvi6-.js} +1 -1
- package/dist/client/assets/{use-join-requests-DzICLdFR.js → use-join-requests-CcTLOzEb.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CzPd86bJ.js → use-mcp-auth-status-Dj8UnSed.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DkhuXiKH.js → use-mcp-client-CrXQAzxs.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CsXBZ61_.js → use-mcp-prompts-DVBCzZJ3.js} +1 -1
- package/dist/client/assets/{use-members-CAFVp1hA.js → use-members-C8Hqv8-u.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CEI8-w2f.js → use-navigate-to-agent-VH5AAfU9.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DBxDKgZ2.js → use-org-auth-client-FRXGLizb.js} +1 -1
- package/dist/client/assets/{use-org-sso-YF1jLuNo.js → use-org-sso-DqIp7ddK.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CkDRzg03.js → use-organization-roles-DL-rDg8L.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BiuiGhzw.js → use-organization-settings-CEqsZkOR.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DnWk3vmb.js → use-panel-navigate-Bh-F8soa.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CuQgnoP3.js → use-registry-connections-B4qaPIZH.js} +1 -1
- package/dist/client/assets/{use-secrets-BTvuuF7f.js → use-secrets-BJkbp2he.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-udD-RNT7.js → use-section-preview-base-BTYgiL8q.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B7IK59pi.js → use-status-sounds-Buxe5MUi.js} +1 -1
- package/dist/client/assets/{use-tags-BsQ8VONn.js → use-tags-DrEQnufT.js} +1 -1
- package/dist/client/assets/{use-view-mode-BthYYl5V.js → use-view-mode-gLSPt8Er.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CikmlP55.js → use-virtual-mcp-TDdC23NB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-qy981KB_.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BeaYkvve.js +1 -0
- package/dist/client/assets/{users-tF-soVEt.js → users-CzhwlFsm.js} +1 -1
- package/dist/client/assets/{variant-calendar-CUzI_Hea.js → variant-calendar-DGlZ6rr7.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BTgIouk8.js → view-mode-toggle-BSAUX2AE.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +583 -581
- package/dist/server/server.js +370 -368
- package/package.json +1 -1
- package/dist/client/assets/api-keys-C7lkp7R_.js +0 -1
- package/dist/client/assets/record-editor-D_Qh2jY6.js +0 -1
- package/dist/client/assets/redirect-editor-ZQwzY_s2.js +0 -1
- package/dist/client/assets/registry-Bjy1jnUl.js +0 -2
- package/dist/client/assets/roles-5ocMzQSi.js +0 -1
- package/dist/client/assets/settings-layout-BEQC50_J.js +0 -1
- package/dist/client/assets/store-registry-BApi5Y5i.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DOlgdhKt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DLZjjZgA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bV as Us,c as O,l as J,j as n,h as Qe,r as G,J as ss,H as Gs,o as oe,b as Q,b4 as Hs,G as le,d as ns,a6 as os,_ as is,L as Qs,a1 as Me,a2 as Le,a4 as Re,a as Dt,F as qs,aq as Ws,ar as Ys,B as ye,t as de,I as Xs,M as Js,K as fe,n as at,a7 as At,m as lt,bu as Zs,e as Oe,bk as en,ap as tn}from"./index-1nlVNgxn.js";import{c as rs,u as sn,d as as}from"./thread-route-DjJKU-k5.js";import{t as Ge}from"./ChevronUp-DjeW3rf8.js";import{A as ls,N as nn,s as jt,aI as on,aJ as rn,aK as Kt,aL as an,t as ln,aM as cn,a6 as dn,aN as un,p as fn,aO as mn,a4 as bt,a3 as pn,aa as gn}from"./agent-icon-B48zizgx.js";import{a as cs,i as hn,e as xn,S as jn,f as bn}from"./constants-DNuUCxmW.js";import{a as Tt,u as yn}from"./use-virtual-mcp-CikmlP55.js";import{g as vn,p as Cn,r as kn}from"./github-repo-COLY3wWI.js";import{l as Nn,j as Sn,q as wn}from"./use-navigate-to-agent-CEI8-w2f.js";import{T as ds}from"./toolbar-icon-button-B1L3M1az.js";import{P as ct,a as Ue,b as dt}from"./popover-CHu9OoAU.js";import{D as It,a as Bt,b as Ft,c as _n,e as Dn,f as us,g as fs,d as An}from"./drawer-BrDS1G0V.js";import{i as Tn}from"./SearchMd-b1VauOXm.js";import{i as qe}from"./Check-DwC3z1rx.js";import{s as Ye}from"./Plus-BANbQu0C.js";import{G as ms,a as In}from"./github-repo-picker-vPoyODrr.js";import{g as Bn,u as Fn,b as ps}from"./hooks-D74-rHgb.js";import{g as Pn,b as gs,P as En}from"./project-icon-B09v6EvP.js";import{b as hs}from"./shell-layout-pJ3SWts0.js";import{d as Vn}from"./thread-intent-5WHIjvYR.js";import{C as $n}from"./collection-search-B0Ems0e3.js";import{g as On,b as Mn,a as Ln,e as Rn}from"./extract-connection-data-BwNCLN99.js";import{u as xs,a as js,g as Kn,C as yt}from"./connection-card-BLXD5mcy.js";import{D as bs,b as ys,c as vs,d as Cs,h as zn,e as Un}from"./dialog-RbA7IheM.js";import{d as pe,a as ge,e as he,b as xe,c as je,F as zt}from"./form-7-guzABw.js";import{I as Se}from"./input-Bh_UVYjo.js";import{S as Gn,b as Hn,a as Qn,d as qn,c as He}from"./select-HaMFNCEI.js";import{T as Wn}from"./textarea-Bgm417OP.js";import{b as ks}from"./use-connection-BFZIwSmK.js";import{n as ot,a as vt,i as Ns}from"./Tool02-DrjGknwf.js";import{b as Yn,d as Xn}from"./UserSquare-Crs1iNVm.js";import{s as Jn}from"./XClose-U5JL72PX.js";import{c as Zn,i as et,a as Ut,E as eo,p as to,b as so,d as no}from"./connection-form-helpers-C0_ULCSn.js";import{a as Ct}from"./authenticate-and-persist-oauth-DmW5k2KW.js";import{g as oo}from"./connection-slug-CITJ0kGN.js";import{C as io}from"./collection-tabs-DWuBMe93.js";import{u as Gt}from"./use-infinite-scroll-BaRAvP_7.js";import{B as tt}from"./badge-DFCpQXcf.js";import{u as ro}from"./useSuspenseInfiniteQuery-DLZjjZgA.js";import{u as ao}from"./use-mcp-client-DkhuXiKH.js";import{g as it}from"./metadata-dUsYcpuu.js";import{u as lo}from"./use-ai-providers-DmrtFZ3b.js";import{a as co}from"./use-file-configs-BLRF4b-d.js";import{d as uo}from"./use-organization-settings-BiuiGhzw.js";import{r as fo}from"./site-slug-uya6Wp4-.js";import{T as mo,C as Pt,c as po,d as go,S as Nt}from"./task-board-DD60a6Wz.js";import{t as ho}from"./decopilot-sse-pool-BUcLYmbe.js";import{u as xo}from"./use-decopilot-events-DaVkBR_8.js";import{A as Ht}from"./avatar-CNX9dPWO.js";import{h as rt,D as Ss,b as ws,g as _s,c as Ds}from"./dropdown-menu-o3ET1Hdn.js";import{e as Ke,a as Et,c as Vt,d as Ce,b as $t,C as Ot}from"./command-44bpz2f7.js";import{s as jo}from"./TrendUp01-D8_aoFuw.js";import{a as bo}from"./Settings02-DL4qHKPe.js";import{s as Qt}from"./User01-W-TGtA_0.js";import{g as qt}from"./get-initials-D-f_fDFw.js";import{i as yo}from"./AlertCircle-CeJGX1aj.js";import{i as vo}from"./CheckCircle-DDxCuD7T.js";import{a as As}from"./DotsVertical-DHzsSfS0.js";import{s as Co}from"./Eye-DCY4B_Aq.js";import{i as ko}from"./Shield01-Bbt414S-.js";const No=Us("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function So(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function wo(t){return t?.name||t?.email?.split("@")[0]||void 0}function _o(t){const e=So(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function Do(t){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:r,className:i,isSearching:c,disabled:l}=t,f=a===void 0?"Search...":a;let u;e[0]!==i?(u=J("shrink-0 w-full border-b border-border h-12",i),e[0]=i,e[1]=u):u=e[1];const m=l?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==m?(d=J("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=d):d=e[3];let p;e[4]!==c?(p=c?n.jsx(Qe,{className:"size-4 text-muted-foreground shrink-0"}):n.jsx(Tn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let h;e[6]!==o?(h=N=>o(N.target.value),e[6]=o,e[7]=h):h=e[7];let g;e[8]!==l||e[9]!==r||e[10]!==f||e[11]!==h||e[12]!==s?(g=n.jsx("input",{type:"text",value:s,onChange:h,onKeyDown:r,placeholder:f,disabled:l,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=l,e[9]=r,e[10]=f,e[11]=h,e[12]=s,e[13]=g):g=e[13];let x;e[14]!==d||e[15]!==p||e[16]!==g?(x=n.jsxs("label",{className:d,children:[p,g]}),e[14]=d,e[15]=p,e[16]=g,e[17]=x):x=e[17];let j;return e[18]!==u||e[19]!==x?(j=n.jsx("div",{className:u,children:x}),e[18]=u,e[19]=x,e[20]=j):j=e[20],j}function Ao(t,e,s){if(!s)return null;const o=Bn(t,e);return o?o.threads.get().find(r=>r.id===s)?.branch??null:null}const Ts=G.createContext(null);function ma(t){const e=O.c(5),{children:s}=t,[o,a]=G.useState(!1);let r;e[0]!==o?(r={empty:o,setEmpty:a},e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx(Ts.Provider,{value:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function To(){return G.useContext(Ts)?.empty??!1}function Io(t){const e=O.c(6),{value:s,onChange:o}=t,a=Q();let r;e[0]!==a?(r=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==o||e[3]!==r||e[4]!==s?(i=n.jsx(Do,{value:s,onChange:o,placeholder:r}),e[2]=o,e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function Bo(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),t[2]=s,t[3]=o):o=t[3],o}function Fo(t){const e=O.c(10),{org:s,onClose:o}=t,a=Q();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let i;e[2]!==o?(i=()=>o(),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let l;return e[6]!==r||e[7]!==i||e[8]!==c?(l=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Qs,{to:"/$org/settings/agents",params:r,onClick:i,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=i,e[8]=c,e[9]=l):l=e[9],l}function Po(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx(Is,{children:s}),t[2]=s,t[3]=o):o=t[3],o}function Eo(t){const e=O.c(11),{onImportFromGithub:s}=t,o=Q();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ms,{className:"size-3.5"}),e[0]=a):a=e[0];let r;e[1]!==o?(r=o("sidebar.agentsSection.import"),e[1]=o,e[2]=r):r=e[2];let i;e[3]!==s||e[4]!==r?(i=n.jsxs("button",{type:"button",onClick:s,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:[a,r]}),e[3]=s,e[4]=r,e[5]=i):i=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsx(Is,{action:i,children:c}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function Vo(t){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=t,a=Q();let r;e[0]!==a?(r=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=r):r=e[1];let i;e[2]!==o?(i=J(o),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==s?(c=()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ye,{className:"size-4"}),e[6]=l):l=e[6];let f;return e[7]!==r||e[8]!==i||e[9]!==c?(f=n.jsx(ds,{"aria-label":r,className:i,onClick:c,children:l}),e[7]=r,e[8]=i,e[9]=c,e[10]=f):f=e[10],f}function $o(t){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=t,r=Q();let i;e[0]!==o||e[1]!==r?(i=o?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==a?(c=J(a),e[3]=a,e[4]=c):c=e[4];let l;e[5]!==s?(l=()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=l):l=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ye,{}),e[7]=f):f=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let m;e[10]!==u?(m=n.jsx("span",{children:u}),e[10]=u,e[11]=m):m=e[11];let d;return e[12]!==i||e[13]!==c||e[14]!==l||e[15]!==m?(d=n.jsx(os,{children:n.jsxs(is,{tooltip:i,className:c,onClick:l,children:[f,m]})}),e[12]=i,e[13]=c,e[14]=l,e[15]=m,e[16]=d):d=e[16],d}function Oo(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx(Ft,{className:"sr-only",children:s}),t[2]=s,t[3]=o):o=t[3],o}function Mo(t){const e=O.c(8),{emptyCtaClass:s}=t,o=Q();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let r;e[2]!==s?(r=J(s),e[2]=s,e[3]=r):r=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{className:"size-4"}),e[4]=i):i=e[4];let c;return e[5]!==a||e[6]!==r?(c=n.jsx(ds,{"aria-label":a,className:r,children:i}),e[5]=a,e[6]=r,e[7]=c):c=e[7],c}function Lo(t){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=t,r=Q();let i;e[0]!==o||e[1]!==r?(i=o?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==a?(c=J(a),e[3]=a,e[4]=c):c=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ye,{}),e[5]=l):l=e[5];let f;e[6]!==r?(f=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=f):f=e[7];let u;e[8]!==f?(u=n.jsx("span",{children:f}),e[8]=f,e[9]=u):u=e[9];let m;e[10]!==i||e[11]!==c||e[12]!==u?(m=n.jsx(Ue,{asChild:!0,children:n.jsxs(is,{tooltip:i,className:c,children:[l,u]})}),e[10]=i,e[11]=c,e[12]=u,e[13]=m):m=e[13];let d;e[14]!==m||e[15]!==s?(d=s(m),e[14]=m,e[15]=s,e[16]=d):d=e[16];let p;return e[17]!==d?(p=n.jsx(os,{children:d}),e[17]=d,e[18]=p):p=e[18],p}function Ro(t){const e=O.c(9),{children:s}=t,o=Q();let a;e[0]!==s?(a=n.jsx(Me,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let r;e[2]!==o?(r=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=r):r=e[3];let i;e[4]!==r?(i=n.jsx(Le,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=i):i=e[5];let c;return e[6]!==a||e[7]!==i?(c=n.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[a,i]}),e[6]=a,e[7]=i,e[8]=c):c=e[8],c}function Ko(t){const e=ns(),{create:s}=Fn(),{locator:o}=le(),a=rs(),r=sn();return async i=>{const c=crypto.randomUUID(),l=i===r?Ao(t,o,a??""):null;try{await s({id:c,virtual_mcp_id:i,...l?{branch:l}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:i}})}}function kt(t){const e=O.c(20),{agent:s,selected:o,onClick:a}=t,r=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let i;e[0]!==r?(i=J("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]=i):i=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=n.jsx(ls,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let l;e[5]!==s.title?(l=n.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=l):l=e[6];let f;e[7]!==s.description?(f=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=f):f=e[8];let u;e[9]!==l||e[10]!==f?(u=n.jsxs("div",{className:"flex-1 min-w-0",children:[l,f]}),e[9]=l,e[10]=f,e[11]=u):u=e[11];let m;e[12]!==o?(m=o&&n.jsx(qe,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=m):m=e[13];let d;return e[14]!==a||e[15]!==i||e[16]!==c||e[17]!==u||e[18]!==m?(d=n.jsxs("button",{type:"button",onClick:a,className:i,children:[c,u,m]}),e[14]=a,e[15]=i,e[16]=c,e[17]=u,e[18]=m,e[19]=d):d=e[19],d}function Is(t){const e=O.c(5),{children:s,action:o}=t;let a;e[0]!==s?(a=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let r;return e[2]!==o||e[3]!==a?(r=n.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=r):r=e[4],r}function zo(t){const e=O.c(43),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:r}=t,[i,c]=G.useState(""),l=G.useDeferredValue(i),f=l||void 0;let u;e[0]!==f?(u={searchTerm:f},e[0]=f,e[1]=u):u=e[1];const m=Tt(u),d=m??[],{org:p}=le(),h=Ko(p.slug),g=Pn(m),x=l.toLowerCase(),j=d.filter(Qo).filter(z=>!g.has(z.id)).filter(Ho),N=j.filter(Go),y=j.filter(Uo),v=cs(p.id),C=!l||v.title.toLowerCase().includes(x),k=!!(o&&C);let D;e[2]!==s||e[3]!==o?(D=()=>{o?.(null),s(),c("")},e[2]=s,e[3]=o,e[4]=D):D=e[4];const b=D;let w;e[5]!==h||e[6]!==s||e[7]!==o?(w=z=>{if(o){o(z.id),s(),c("");return}s(),c(""),h(z.id)},e[5]=h,e[6]=s,e[7]=o,e[8]=w):w=e[8];const _=w,I="flex flex-col max-h-[min(640px,80dvh)]";let P;e[9]!==i?(P=n.jsx(Io,{value:i,onChange:c}),e[9]=i,e[10]=P):P=e[10];const S="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==o||e[13]!==b||e[14]!==a||e[15]!==C?(A=o&&C&&v&&n.jsx(kt,{agent:v,selected:!a||a===v.id,onClick:b}),e[11]=v,e[12]=o,e[13]=b,e[14]=a,e[15]=C,e[16]=A):A=e[16];const T=(N.length>0||!l)&&n.jsx(Eo,{onImportFromGithub:r});let R;e[17]!==_||e[18]!==o||e[19]!==a?(R=z=>n.jsx(kt,{agent:z,selected:o?a===z.id:void 0,onClick:()=>_(z)},z.id),e[17]=_,e[18]=o,e[19]=a,e[20]=R):R=e[20];const E=N.map(R),B=y.length>0&&n.jsx(Po,{});let M;e[21]!==_||e[22]!==o||e[23]!==a?(M=z=>n.jsx(kt,{agent:z,selected:o?a===z.id:void 0,onClick:()=>_(z)},z.id),e[21]=_,e[22]=o,e[23]=a,e[24]=M):M=e[24];const q=y.map(M);let F;e[25]!==k||e[26]!==l||e[27]!==j.length?(F=j.length===0&&!k&&l&&n.jsx(Bo,{}),e[25]=k,e[26]=l,e[27]=j.length,e[28]=F):F=e[28];let U;e[29]!==E||e[30]!==B||e[31]!==q||e[32]!==F||e[33]!==A||e[34]!==T?(U=n.jsxs("div",{className:S,children:[A,T,E,B,q,F]}),e[29]=E,e[30]=B,e[31]=q,e[32]=F,e[33]=A,e[34]=T,e[35]=U):U=e[35];let $;e[36]!==s||e[37]!==p?($=n.jsx(Fo,{org:p,onClose:s}),e[36]=s,e[37]=p,e[38]=$):$=e[38];let H;return e[39]!==U||e[40]!==$||e[41]!==P?(H=n.jsxs("div",{className:I,children:[P,U,$]}),e[39]=U,e[40]=$,e[41]=P,e[42]=H):H=e[42],H}function Uo(t){return!gs(t.metadata)}function Go(t){return gs(t.metadata)}function Ho(t){return!xn(t.id)}function Qo(t){return!hn(t.id)}function qo(t){const e=O.c(14),{compact:s,trigger:o,onSelectAgent:a,selectedAgentId:r,side:i,align:c}=t===void 0?{}:t,l=s===void 0?!1:s,f=i===void 0?"right":i,u=c===void 0?"start":c,[m,d]=G.useState(!1),[p,h]=G.useState(!1),g=ss(),{setOpenMobile:x}=Gs(),j=To(),N=j?"border border-border":void 0;let y;e[0]!==j?(y=S=>j?n.jsx(Ro,{children:S}):S,e[0]=j,e[1]=y):y=e[1];const v=y;let C;e[2]!==g||e[3]!==x?(C=()=>{d(!1),g&&x(!1)},e[2]=g,e[3]=x,e[4]=C):C=e[4];const k=C;let D;e[5]!==k||e[6]!==h?(D=()=>{k(),h(!0)},e[5]=k,e[6]=h,e[7]=D):D=e[7];const b=D,w=m&&n.jsx(G.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Hs,{className:"h-4 w-24"})}),children:n.jsx(zo,{onClose:k,onSelectAgent:a,selectedAgentId:r,onImportFromGithub:b})}),_=g?n.jsxs(n.Fragment,{children:[o?G.cloneElement(o,{onClick:S=>{o.props.onClick?.(S),d(!0)}}):l?v(n.jsx(Vo,{setOpen:d,emptyCtaClass:N})):n.jsx($o,{setOpen:d,highlightEmpty:j,emptyCtaClass:N}),n.jsx(It,{open:m,onOpenChange:d,direction:"bottom",children:n.jsxs(Bt,{className:"max-h-[85dvh] p-0",children:[n.jsx(Oo,{}),w]})})]}):n.jsxs(ct,{open:m,onOpenChange:S=>{S&&!m&&oe("agent_browser_opened",{surface:"desktop_popover"}),d(S)},children:[o?n.jsx(Ue,{asChild:!0,children:o}):l?v(n.jsx(Ue,{asChild:!0,children:n.jsx(Mo,{emptyCtaClass:N})})):n.jsx(Lo,{wrapEmptyHint:v,highlightEmpty:j,emptyCtaClass:N}),n.jsx(dt,{className:"w-[380px] p-0 overflow-hidden",side:f,align:u,children:w})]});let I;e[8]!==p||e[9]!==h?(I=n.jsx(In,{open:p,onOpenChange:h,mode:"agent"}),e[8]=p,e[9]=h,e[10]=I):I=e[10];let P;return e[11]!==_||e[12]!==I?(P=n.jsxs(n.Fragment,{children:[_,I]}),e[11]=_,e[12]=I,e[13]=P):P=e[13],P}function Wo(){const t=O.c(2),e=Tt()??[];let s;return t[0]!==e?(s=o=>{if(!o)return;const a=e.find(r=>r.id===o);return a?Vn(a.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}const Yo="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 Xo(t){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:r}=t,i=Q(),c=yn(s)??o??null;let l,f,u,m,d;e[0]!==c?.title||e[1]!==a||e[2]!==i?(d=c?.title??i("header.shellBreadcrumb.superAgentDefaultName"),m="flex min-w-0 items-center gap-0",l="button",f=a,u=i("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=a,e[2]=i,e[3]=l,e[4]=f,e[5]=u,e[6]=m,e[7]=d):(l=e[3],f=e[4],u=e[5],m=e[6],d=e[7]);const p=c?.icon??null;let h;e[8]!==p||e[9]!==d?(h=n.jsx(ls,{icon:p,name:d,size:"xs"}),e[8]=p,e[9]=d,e[10]=h):h=e[10];let g;e[11]!==l||e[12]!==f||e[13]!==u||e[14]!==h?(g=n.jsx("button",{type:l,onClick:f,"aria-label":u,className:"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:h}),e[11]=l,e[12]=f,e[13]=u,e[14]=h,e[15]=g):g=e[15];let x;e[16]!==d?(x=n.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ge,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let N;e[19]!==x?(N=n.jsxs("button",{type:"button",className:Yo,children:[x,j]}),e[19]=x,e[20]=N):N=e[20];let y;e[21]!==s||e[22]!==r||e[23]!==N?(y=n.jsx(qo,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:N}),e[21]=s,e[22]=r,e[23]=N,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==m||e[27]!==g?(v=n.jsxs("div",{className:m,children:[g,y]}),e[25]=y,e[26]=m,e[27]=g,e[28]=v):v=e[28],v}function pa(t){const e=O.c(23);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=le(),{threads:r}=ps(),i=Tt(),{data:c}=Dt.useSession(),{setTaskId:l,createNewTask:f}=hs(),u=Wo(),m=Nn(void 0,null);let d;e[2]!==a.id?(d=cs(a.id),e[2]=a.id,e[3]=d):d=e[3];const p=d,h=p.id,g=as();let x;e[4]!==i||e[5]!==m||e[6]!==f||e[7]!==h||e[8]!==o||e[9]!==u||e[10]!==c?.user||e[11]!==l||e[12]!==r?(x=k=>{const D=k??h,b=(i??[]).find(I=>I.id===D),w=Sn(b),_=wn(r,D,c?.user?.id,u(D),!!(b&&vn(b)),{knownBranches:new Set([m,...(b?.metadata?.releases??[]).map(Jo)]),draftsMode:w,baseBranch:m});_?l(_.id,D):f(D,w?_o(wo(c?.user)):void 0),o?.()},e[4]=i,e[5]=m,e[6]=f,e[7]=h,e[8]=o,e[9]=u,e[10]=c?.user,e[11]=l,e[12]=r,e[13]=x):x=e[13];const j=x;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[14]=N):N=e[14];const y=g===h?p:void 0;let v;e[15]!==g||e[16]!==j?(v=()=>j(g),e[15]=g,e[16]=j,e[17]=v):v=e[17];let C;return e[18]!==g||e[19]!==j||e[20]!==y||e[21]!==v?(C=n.jsx(G.Suspense,{fallback:N,children:n.jsx(Xo,{agentId:g,fallback:y,onOpenHome:v,onPick:j})}),e[18]=g,e[19]=j,e[20]=y,e[21]=v,e[22]=C):C=e[22],C}function Jo(t){return t.branch}function ga(){const t=O.c(20),e=Q(),{threads:s}=ps(),{createNewTask:o}=hs(),a=as(),r=rs();let i;t[0]!==r||t[1]!==s?(i=s.find(x=>x.id===r)?.branch??null,t[0]=r,t[1]=s,t[2]=i):i=t[2];const c=i;let l;t[3]!==a||t[4]!==o||t[5]!==c?(l=()=>{o(a,c)},t[3]=a,t[4]=o,t[5]=c,t[6]=l):l=t[6];const f=l;let u;t[7]!==e?(u=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=u):u=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(nn,{size:16}),t[9]=m):m=t[9];let d;t[10]!==f||t[11]!==u?(d=n.jsx(Me,{asChild:!0,children:n.jsx("button",{type:"button",onClick:f,"aria-label":u,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m})}),t[10]=f,t[11]=u,t[12]=d):d=t[12];let p;t[13]!==e?(p=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=p):p=t[14];let h;t[15]!==p?(h=n.jsx(Le,{side:"bottom",children:p}),t[15]=p,t[16]=h):h=t[16];let g;return t[17]!==d||t[18]!==h?(g=n.jsxs(Re,{children:[d,h]}),t[17]=d,t[18]=h,t[19]=g):g=t[19],g}function Zo({open:t,onOpenChange:e,onCreated:s}){const o=Q(),{org:a}=le(),{data:r}=Dt.useSession(),{stdioEnabled:i}=qs(),c=ss(),l=ks(),f=xs(),m=js(f,"").items,d=Ws({resolver:Ys(Zn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=d.watch("ui_type"),h=d.watch("connection_url"),g=d.watch("npx_package"),x=et({uiType:p,connectionUrl:h??"",npxPackage:g??""})??Ut({uiType:p,connectionUrl:h??"",registryItems:m}),j=b=>{const w=b.trim();if(!w)return;const _=!!d.formState.dirtyFields.title,I=!!d.formState.dirtyFields.description,P=!!d.formState.dirtyFields.env_vars,S=T=>{if(T&&(!_&&!d.getValues("title").trim()&&T.title&&d.setValue("title",T.title,{shouldDirty:!1}),!I&&!(d.getValues("description")??"").trim()&&T.description&&d.setValue("description",T.description,{shouldDirty:!1}),!P&&T.envVarKeys?.length)){const R=d.getValues("env_vars")??[],E=new Set(R.map(M=>M.key)),B=T.envVarKeys.filter(M=>!E.has(M));B.length>0&&d.setValue("env_vars",[...R,...B.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},A=to(w);if(A&&i){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",A.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),S(et({uiType:"NPX",npxPackage:A.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const T=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";d.setValue("ui_type",T,{shouldDirty:!0}),d.setValue("connection_url",w,{shouldDirty:!0}),S(et({uiType:T,connectionUrl:w})??Ut({uiType:T,connectionUrl:w,registryItems:m}));return}p==="NPX"&&S(et({uiType:"NPX",npxPackage:w}))},N=b=>{b||d.reset(),e(b)},y=async b=>{let w,_=null,I=null,P=null;b.ui_type==="NPX"?(w="STDIO",_="",P=so(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(w="STDIO",_="",P=no(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(w=b.ui_type,_=b.connection_url||"",I=b.connection_token||null);const S=On("conn");try{await l.create.mutateAsync({id:S,title:b.title,description:b.description||null,connection_type:w,connection_url:_,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:a.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(S)}catch{de.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},v=o("connections.createConnectionDialog.title"),C=o("connections.createConnectionDialog.description"),k=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=n.jsxs("div",{className:"grid gap-4",children:[n.jsx(pe,{control:d.control,name:"ui_type",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.typeLabel")}),n.jsxs(Gn,{value:b.value,onValueChange:b.onChange,children:[n.jsx(xe,{children:n.jsx(Hn,{children:n.jsx(Qn,{})})}),n.jsxs(qn,{children:[n.jsx(He,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),n.jsx(He,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),n.jsx(He,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&n.jsxs(n.Fragment,{children:[n.jsx(He,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(ot,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),n.jsx(He,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Yn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),n.jsx(je,{})]})}),p==="NPX"&&n.jsx(pe,{control:d.control,name:"npx_package",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.npmPackageLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...b,value:b.value??"",onPaste:w=>{const _=w.clipboardData.getData("text");_&&(w.preventDefault(),d.setValue("npx_package",_.trim(),{shouldDirty:!0}),j(_))},onBlur:w=>{j(w.target.value),b.onBlur()}})}),n.jsx(je,{})]})}),p==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[n.jsx(pe,{control:d.control,name:"stdio_command",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.commandLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...b,value:b.value??""})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"stdio_args",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.argumentsLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...b,value:b.value??""})}),n.jsx(je,{})]})})]}),n.jsx(pe,{control:d.control,name:"stdio_cwd",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...b,value:b.value??""})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),n.jsx(je,{})]})})]}),(p==="NPX"||p==="STDIO")&&n.jsx(pe,{control:d.control,name:"env_vars",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),n.jsx(xe,{children:n.jsx(eo,{value:b.value??[],onChange:b.onChange})}),n.jsx(je,{})]})}),p!=="NPX"&&p!=="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsx(pe,{control:d.control,name:"connection_url",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.urlLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...b,value:b.value??"",onPaste:w=>{const _=w.clipboardData.getData("text");_&&(w.preventDefault(),d.setValue("connection_url",_.trim(),{shouldDirty:!0}),j(_))},onBlur:w=>{j(w.target.value),b.onBlur()}})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"connection_token",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),n.jsx(xe,{children:n.jsx(Se,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...b,value:b.value??""})}),x?.token?.helperText&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&n.jsxs(n.Fragment,{children:[" ","·"," ",n.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),n.jsx(je,{})]})})]}),n.jsx(pe,{control:d.control,name:"title",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.nameLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...b})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"description",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.descriptionLabel")}),n.jsx(xe,{children:n.jsx(Wn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...b,value:b.value??""})}),n.jsx(je,{})]})})]});return c?n.jsx(It,{open:t,onOpenChange:N,children:n.jsxs(Bt,{className:"max-h-[90vh]",children:[n.jsx(_n,{className:"pb-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex-1 text-left",children:[n.jsx(Ft,{children:v}),n.jsx(Dn,{className:"mt-1",children:C})]}),n.jsx(us,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:n.jsx(Jn,{size:16})})})]})}),n.jsx(zt,{...d,children:n.jsxs("form",{onSubmit:d.handleSubmit(y),children:[n.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),n.jsx(fs,{children:n.jsx(ye,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):n.jsx(bs,{open:t,onOpenChange:N,children:n.jsxs(ys,{className:"sm:max-w-[525px]",children:[n.jsxs(vs,{children:[n.jsx(Cs,{children:v}),n.jsx(zn,{children:C})]}),n.jsx(zt,{...d,children:n.jsxs("form",{onSubmit:d.handleSubmit(y),children:[n.jsx("div",{className:"py-4",children:D}),n.jsxs(Un,{children:[n.jsx(ye,{type:"button",variant:"outline",onClick:()=>N(!1),children:o("connections.createConnectionDialog.cancelButton")}),n.jsx(ye,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function ei(t){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:r,onCloneAndAdd:i,onConnectAndAdd:c,connectingItemId:l,search:f,onCreateConnection:u,onBrowseNavigate:m,defaultTab:d}=t,p=s===void 0?"add":s,h=d===void 0?"connected":d,g=Q(),{org:x}=le(),j=G.useDeferredValue(f),N=f!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const v=y;let C;e[2]!==h?(C=V=>V??h,e[2]=h,e[3]=C):C=e[3];const[k,D]=Xs(Js.connectionsTab(x.slug)+(h==="all"?":home-modal":":agent-modal"),C);let b;e[4]!==k||e[5]!==D?(b=V=>{V!==k&&oe("connections_dialog_tab_changed",{to_tab:V}),D(V)},e[4]=k,e[5]=D,e[6]=b):b=e[6];const w=b;let _;e[7]!==x.id||e[8]!==x.slug?(_={connectionId:jn,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=_):_=e[9];const I=ao(_),P=j?.trim().split(/\s+/).filter(Boolean)??[],S=P.length>0?{operator:"or",conditions:P.flatMap(li)}:void 0,A={...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:R,fetchNextPage:E,hasNextPage:B,isFetchingNextPage:M}=ro({queryKey:fe.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async V=>{const{pageParam:X}=V,be=X===void 0?0:X;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:be}})).structuredContent},initialPageParam:0,getNextPageParam:ri,staleTime:3e4}),q=R?.pages.flatMap(ii)??[],F=Kn(q),U=new Set(q.filter(oi).map(ni)),$=xs(),H=js($,j),z=Gt(H.loadMore,H.hasMore,H.isLoadingMore),se=Gt(E,B??!1,M),W=k==="all"||!!v,ie=W?H.items.filter(V=>{const X=Mn(V);if(X&&U.has(X))return!1;if(!v)return!0;const be=it(V._meta),ke=[V.title,V.description,V.name,V.server?.title,V.server?.description,V.server?.name,be?.friendly_name,be?.friendlyName].filter(Boolean).join(" ").toLowerCase();return P.some(me=>ke.includes(me.toLowerCase()))}):[],Z=ie.filter(si),ee=ie.filter(ti);let te;e[10]!==a?(te=V=>V.some(X=>a.has(X.id)),e[10]=a,e[11]=te):te=e[11];const ne=te;let re;e[12]!==a||e[13]!==o||e[14]!==l||e[15]!==ne||e[16]!==p||e[17]!==r||e[18]!==m||e[19]!==i||e[20]!==g?(re=(V,X,be,ke,me)=>{const Ze=ne(me),$e=me.find(Ne=>!a.has(Ne.id)),ce=me[0];if(p==="browse"){const Ne=oo(ce);return n.jsx(yt,{connection:{title:X,icon:be,description:me.length>1?`${me.length} instances`:ke??void 0},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs(tt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(qe,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{oe("connection_browse_clicked",{app_name:ce.app_name??null,connection_id:ce.id,instances_count:me.length}),m?.(Ne)}},V)}return n.jsx(yt,{connection:{title:X,icon:be,description:ke},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[Ze&&n.jsxs(tt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(qe,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),n.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Ne=>{Ne.stopPropagation(),$e?(oe("connection_add_clicked",{action:"use_existing",app_name:ce.app_name??null,connection_id:$e.id}),o&&oe("agent_connection_attached",{agent_id:o,connection_id:$e.id,app_name:ce.app_name??null,mode:"existing"}),r($e.id)):(oe("connection_add_clicked",{action:"clone",app_name:ce.app_name??null,base_connection_id:ce.id}),i(ce))},children:g("virtualMcp.connectionDialogContent.add")})]})},V)},e[12]=a,e[13]=o,e[14]=l,e[15]=ne,e[16]=p,e[17]=r,e[18]=m,e[19]=i,e[20]=g,e[21]=re):re=e[21];const L=re;let K;e[22]!==l||e[23]!==p||e[24]!==c||e[25]!==g?(K=V=>{const X=it(V._meta),be=X?.friendlyName||X?.friendly_name||V.server?.title||V.title||V.server?.name||V.name||V.id||"",ke=V.server?.description||V.description||null,me=V.server?.icons?.[0]?.src||Ln(V.server?.repository)||null,Ze=X?.official===!0,$e=X?.verified===!0,ce=X?.owner==="deco";return n.jsx(yt,{connection:{title:be,description:ke,icon:me},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[ce&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:n.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ce&&Ze&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx(tt,{variant:"outline",size:"icon",children:n.jsx(vt,{})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ce&&!Ze&&$e&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx(tt,{variant:"outline",size:"icon",children:n.jsx(vt,{})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),n.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Ne=>{Ne.stopPropagation(),oe("connection_add_clicked",{action:"connect_new",registry_item_id:V.id,app_name:X?.friendlyName||V.server?.name||V.name||null}),c(V)},children:l===V.id?n.jsx(Qe,{className:"size-3.5"}):g(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${V.id}`)},e[22]=l,e[23]=p,e[24]=c,e[25]=g,e[26]=K):K=e[26];const ae=K;let Y;e[27]!==k||e[28]!==w||e[29]!==u||e[30]!==v||e[31]!==g?(Y=!v&&n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[n.jsx(io,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:V=>w(V)}),n.jsxs(ye,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{oe("connections_dialog_custom_clicked"),u()},children:[n.jsx(Ye,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=w,e[29]=u,e[30]=v,e[31]=g,e[32]=Y):Y=e[32];const ve=N&&"opacity-50 pointer-events-none";let ue;e[33]!==ve?(ue=J("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=ue):ue=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Ae;e[35]!==L?(Ae=V=>{if(V.type==="group")return L(V.key,V.title,V.icon,null,V.connections);const X=V.connection;return L(X.id,X.title,X.icon,X.description??null,[X])},e[35]=L,e[36]=Ae):Ae=e[36];const mt=F.map(Ae);let Te;e[37]!==se?(Te=n.jsx("div",{ref:se,className:"col-span-full h-1"}),e[37]=se,e[38]=Te):Te=e[38];let Ie;e[39]!==M?(Ie=M&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),e[39]=M,e[40]=Ie):Ie=e[40];const pt=W&&Z.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx(vt,{size:13,className:"text-muted-foreground shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),gt=W&&Z.map(ae),ht=W&&ee.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),xt=W&&ee.map(ae);let Be;e[41]!==z||e[42]!==$||e[43]!==W?(Be=W&&$.length>0&&n.jsx("div",{ref:z,className:"col-span-full h-1"}),e[41]=z,e[42]=$,e[43]=W,e[44]=Be):Be=e[44];let Fe;e[45]!==H.isLoadingMore||e[46]!==W?(Fe=W&&H.isLoadingMore&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),e[45]=H.isLoadingMore,e[46]=W,e[47]=Fe):Fe=e[47];let Pe;e[48]!==mt||e[49]!==Te||e[50]!==Ie||e[51]!==pt||e[52]!==gt||e[53]!==ht||e[54]!==xt||e[55]!==Be||e[56]!==Fe?(Pe=n.jsxs("div",{className:De,children:[mt,Te,Ie,pt,gt,ht,xt,Be,Fe]}),e[48]=mt,e[49]=Te,e[50]=Ie,e[51]=pt,e[52]=gt,e[53]=ht,e[54]=xt,e[55]=Be,e[56]=Fe,e[57]=Pe):Pe=e[57];let Ee;e[58]!==k||e[59]!==F.length||e[60]!==ee||e[61]!==f||e[62]!==g||e[63]!==Z?(Ee=F.length===0&&Z.length===0&&ee.length===0&&n.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:f?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:f}):g(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=F.length,e[60]=ee,e[61]=f,e[62]=g,e[63]=Z,e[64]=Ee):Ee=e[64];let Ve;e[65]!==ue||e[66]!==Pe||e[67]!==Ee?(Ve=n.jsxs("div",{className:ue,children:[Pe,Ee]}),e[65]=ue,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Je;return e[69]!==Y||e[70]!==Ve?(Je=n.jsxs(n.Fragment,{children:[Y,Ve]}),e[69]=Y,e[70]=Ve,e[71]=Je):Je=e[71],Je}function ti(t){return!t.verified&&!it(t._meta)?.verified&&!t.meta?.verified}function si(t){return t.verified||it(t._meta)?.verified||t.meta?.verified}function ni(t){return t.app_name}function oi(t){return t.app_name}function ii(t){return t?.items??[]}function ri(t,e){if(t?.hasMore)return e.reduce(ai,0)}function ai(t,e){return t+(e?.items?.length??0)}function li(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function ha({open:t,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const r=Q(),i=a.mode??"add",c="agentId"in a?a.agentId:void 0,l="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,f="onAdd"in a&&a.onAdd?a.onAdd:S=>{},u=(S,A,T)=>{c&&oe("agent_connection_attached",{agent_id:c,connection_id:S,app_name:A,mode:T})},[m,d]=G.useState(null),[p,h]=G.useState(o),[g,x]=G.useState(!1),[j,N]=G.useState(t);t!==j&&(N(t),t&&h(o));const{org:y}=le(),{data:v}=Dt.useSession(),C=ks(),k=at(),D=ns(),b=S=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:S}})},w=()=>{k.invalidateQueries({predicate:S=>{const A=S.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},_=async(S,A)=>{oe("connection_oauth_succeeded",{connection_id:S,flow:A});const T=new URL(`/api/${y.slug}/mcp/${S}`,window.location.origin);await k.invalidateQueries({queryKey:fe.isMCPAuthenticated(T.href,null)}),w()},I=async S=>{d(S.app_name??S.id);try{const T=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,E=(await C.create.mutateAsync({title:T,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,B=await Ct({connectionId:E,orgId:y.id,orgSlug:y.slug,persistFallback:M=>C.update.mutateAsync({id:E,data:{connection_token:M}}).then(()=>{})});if(B.ran&&!B.ok){oe("connection_oauth_failed",{connection_id:E,flow:"clone",error:B.error??"no_token"}),de.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await C.delete.mutateAsync(E);return}B.ran&&await _(E,"clone"),u(E,S.app_name??null,"clone"),f(E)}catch(A){console.error("Failed to add connection:",A),de.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},P=async S=>{if(!(!y||!v?.user?.id)){d(S.id);try{const A=Rn(S,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",R=!!A.connection_url,E=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!R&&!E){de.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:B}=await C.create.mutateAsync(A),M=await Ct({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:q=>C.update.mutateAsync({id:B,data:{connection_token:q}}).then(()=>{})});if(M.ran&&!M.ok){oe("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:M.error??"no_token"}),de.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:M.error??"no token received"})}),u(B,A.app_name??null,"new"),f(B);return}M.ran?(await _(B,"connect_new"),de.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):de.success(r("virtualMcp.addConnectionDialog.connected")),u(B,A.app_name??null,"new"),f(B)}catch(A){console.error("Failed to connect:",A),de.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return n.jsxs(bs,{open:t,onOpenChange:e,children:[n.jsxs(ys,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[n.jsx(vs,{className:"px-6 pt-5 pb-0 shrink-0",children:n.jsx(Cs,{className:"text-base font-semibold",children:r(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),n.jsx("div",{className:"pt-3 shrink-0",children:n.jsx($n,{value:p,onChange:h,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),n.jsx(G.Suspense,{fallback:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),children:n.jsx(ei,{mode:i,agentId:c,addedConnectionIds:l,onAdd:f,onCloneAndAdd:I,onConnectAndAdd:P,connectingItemId:m,search:p,onCreateConnection:()=>x(!0),onBrowseNavigate:b,defaultTab:s})})]}),n.jsx(Zo,{open:g,onOpenChange:x,onCreated:async S=>{x(!1);const A=await Ct({connectionId:S,orgId:y.id,orgSlug:y.slug,persistFallback:T=>C.update.mutateAsync({id:S,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){oe("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:A.error??"no_token"}),de.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),u(S,null,"custom"),f(S),e(!1);return}A.ran&&await _(S,"custom_create"),u(S,null,"custom"),f(S),e(!1)}})]})}const Wt=new Map;function xa(){const{org:t}=le(),e=At(),s=lo(),o=s.find(x=>x.providerId==="deco"),{data:a,isLoading:r,refetch:i,isFetching:c}=lt({queryKey:fe.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=a?.balanceCents??null,f=l!=null?l/100:null,u=G.useRef(new Map);if(l!=null){const x=Wt.get(t.id);u.current.get(t.id)&&x!=null&&l>x&&oe("credits_topped_up_detected",{organization_id:t.id,delta_cents:l-x,previous_balance_cents:x,new_balance_cents:l}),Wt.set(t.id,l),u.current.set(t.id,!0)}const m=!!o,d=l!=null&&l>0,p=l!=null&&l===0,h=l!=null&&l===200,g=s.length>0&&s.every(x=>x.providerId==="deco");return{hasDecoKey:m,decoKeyId:o?.id??null,balanceCents:l,balanceDollars:f,hasCredits:d,isZeroBalance:p,isInitialFreeCredit:h,hasOnlyDecoProvider:g,isLoading:r,isFetching:c,refetch:i}}const ci=4,di="TASK";function ui(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,ci)||di}function fi(t,e){return e==null?null:`${ui(t)}-${String(e).padStart(2,"0")}`}const mi=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function pi(t){const e=mi.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Yt(t){const e=O.c(8),{size:s,className:o}=t,a=s===void 0?16:s;let r;e[0]!==a?(r={width:a,height:a},e[0]=a,e[1]=r):r=e[1];let i;e[2]!==o?(i=J("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==r||e[6]!==i?(c=n.jsx("img",{src:bn,alt:"Super Agent",width:a,height:a,style:r,className:i}),e[4]=a,e[5]=r,e[6]=i,e[7]=c):c=e[7],c}const Xe=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],gi=["overview","reports","board","site-editor"],Mt=1,hi=["assets","hosting","e2e","analytics","cdn"];function ja(t,e,s){if(!t)return{project:s??null,resolvedScopeId:null};const o=e?.id===t?e:s?.id===t?s:null;return{project:o,resolvedScopeId:o?t:null}}function ba(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function Bs(t,e){const s=new Set(t??[]);if(e!==Mt)for(const o of gi)s.add(o);return Xe.filter(o=>s.has(o))}function xi(t){return Xe.some(e=>e===t)}function ji(t){return hi.some(e=>e===t)}function bi(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function ya(t,e,s){const o=bi(e,s);return t?o:{...o,overview:!0,reports:!0,board:!0}}function va(t,e,s){const o=new Set(Bs(t,s));return Xe.filter(a=>e[a]&&o.has(a))}function Ca(t,e,s){return s||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ka(t){return Xe.filter(e=>t[e])}function yi(t,e,s){return!xi(t)||e[t]?!1:ji(t)?!(t==="assets"?s.assets:s.siteAccess):!0}function Na(t,e,s,o,a){return yi(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,s)||t==="content"&&!o.includes("content")||t==="code"&&a&&!o.includes("code")}function Sa(t,e,s,o){const a=new Set(Bs(t,o));return s?a.add(e):a.delete(e),Xe.filter(r=>a.has(r))}function We(t,e){return fe.optimisticProjectSidebarViews(t,e)}function st(t){return typeof t=="object"&&t!==null}function Fs(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function vi(t,e){if(!st(t))return t;if("item"in t&&st(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!st(t.structuredContent))return t;const s=t.structuredContent.items;if(!Array.isArray(s))return t;let o=!1;const a=s.map(r=>!st(r)||r.id!==e.id?r:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:a}}:t}function wa(t,e,s){t.setQueriesData({predicate:o=>Fs(o.queryKey,e)},o=>vi(o,s))}function _a(t,e,s){const o=t.getQueriesData({predicate:a=>Fs(a.queryKey,e)&&a.queryKey[5]===s});for(const[,a]of o)if(a?.item?.id===s)return a.item;return null}function Lt(t,e,s){return t.getQueryData(We(e,s))??null}function Ci(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Mt};const s=t?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function Da(t,e,s){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Mt}:s===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:Ci(s,null)}function ki(t,e,s,o,a){const r=Lt(t,e,s),i={revision:(r?.revision??0)+1,views:[...o],rollbackViews:r?[...r.rollbackViews]:[...a]};return t.setQueryData(We(e,s),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function Ni(t,e,s){const o=Lt(t,e,s);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function Ps(t,e){const s=new Set(t),o=new Set(e);return s.size===o.size&&[...s].every(a=>o.has(a))}function Aa(t){return t?!Ps(t.views,t.persistedViews):!1}function Si(t,e,s,{snapshot:o,saved:a,authoritativeViews:r}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=Lt(t,e,s);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const c=r!==void 0?[...r]:a?[...o.views]:null,l={...i,rollbackViews:c??i.rollbackViews};return l.rollbackViews!==i.rollbackViews&&t.setQueryData(We(e,s),l),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(We(e,s),null),{settledLatest:!0,reconciledViews:a?c&&!Ps(c,o.views)?c:null:[...l.rollbackViews]})}function Ta(t){const e=O.c(5),{org:s}=le(),o=t??"";let a;e[0]!==s.id||e[1]!==o?(a=We(s.id,o),e[0]=s.id,e[1]=o,e[2]=a):a=e[2];let r;e[3]!==a?(r={queryKey:a,queryFn:wi,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=a,e[4]=r):r=e[4];const{data:i}=lt(r);return i?.views}async function wi(){return null}function Ia(t){const e=O.c(4),{org:s}=le(),o=at();let a;return e[0]!==s||e[1]!==o||e[2]!==t?(a={stage:(r,i)=>ki(o,s.id,t,r,i),snapshot:()=>Ni(o,s.id,t),settle:r=>Si(o,s.id,t,r)},e[0]=s,e[1]=o,e[2]=t,e[3]=a):a=e[3],a}function _i(t,e){if(!e)return null;const s=e.toLowerCase();return t.find(o=>{const a=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===s||a===s||a===`deco-assets-${s}`})??null}function Ba(t){const e=O.c(10),{org:s}=le(),o=Zs(),a=uo(),r=co(),i=fo(t),c=o.hostingEnabled===!0,l=o.monitorEnabled===!0||o.auth.localMode===!0,f=(c||l)&&!!i,u=lt({queryKey:fe.hostingAccess(s.slug,i??""),queryFn:async()=>{const C=await fetch(`/api/${s.slug}/hosting/${encodeURIComponent(i??"")}/access`);return C.ok?await C.json():{owned:!1,canWrite:!1}},enabled:f,staleTime:6e4}),m=u.data?.owned===!0,d=!!_i(r.data?.configs??[],i),p=c&&m&&a.hosting,h=c&&m&&a.e2e,g=c&&m&&a.analytics,x=l&&m&&a.monitor;let j;e[0]!==d||e[1]!==p||e[2]!==h||e[3]!==g||e[4]!==x?(j={assets:d,hosting:p,e2e:h,analytics:g,cdn:x},e[0]=d,e[1]=p,e[2]=h,e[3]=g,e[4]=x,e[5]=j):j=e[5];const N=!!i&&r.isPending,y=f&&u.isPending;let v;return e[6]!==j||e[7]!==N||e[8]!==y?(v={presence:j,assetsPending:N,siteAccessPending:y},e[6]=j,e[7]=N,e[8]=y,e[9]=v):v=e[9],v}const Xt=()=>0;function Di(t){const{orgSlug:e,enabled:s=!0,onUpdate:o,onDelete:a,onResync:r}=t,i=G.useRef(o);i.current=o;const c=G.useRef(a);c.current=a;const l=G.useRef(r);l.current=r;const f=G.useRef(null),u=G.useRef(s),m=G.useRef(e);(!f.current||u.current!==s||m.current!==e)&&(u.current=s,m.current=e,f.current=p=>{if(!s||!e)return()=>{};const h=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===mo?c.current?.(x.data.id):i.current(x.data)),p()};return ho.subscribe(e,h,()=>l.current?.())}),G.useSyncExternalStore(f.current,Xt,Xt)}function Ai(t,e){return{queryKey:fe.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:s}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:s}}}}function Ti(){const t=O.c(21),{org:e,locator:s}=le(),o=at();let a;t[0]!==s?(a=fe.taskBoardItems(s),t[0]=s,t[1]=a):a=t[1];const r=a;let i;t[2]!==s||t[3]!==o||t[4]!==r?(i=d=>{o.cancelQueries({queryKey:r}),o.setQueryData(r,p=>p&&{...p,items:p.items.some(h=>h.id===d.id)?p.items.map(h=>h.id===d.id?d:h):[d,...p.items]}),o.invalidateQueries({queryKey:fe.taskBoardActivity(s,d.id)})},t[2]=s,t[3]=o,t[4]=r,t[5]=i):i=t[5];let c,l;t[6]!==o||t[7]!==r?(c=()=>{o.invalidateQueries({queryKey:r})},l=d=>{o.cancelQueries({queryKey:r}),o.setQueryData(r,p=>p&&{...p,items:p.items.filter(h=>h.id!==d)})},t[6]=o,t[7]=r,t[8]=c,t[9]=l):(c=t[8],l=t[9]);let f;t[10]!==e.slug||t[11]!==i||t[12]!==c||t[13]!==l?(f={orgSlug:e.slug,onUpdate:i,onResync:c,onDelete:l},t[10]=e.slug,t[11]=i,t[12]=c,t[13]=l,t[14]=f):f=t[14],Di(f);let u;t[15]!==o||t[16]!==r?(u=d=>{const p=d.subject,h=d.data.status;o.cancelQueries({queryKey:r}),o.setQueryData(r,g=>g&&{...g,items:g.items.map(x=>x.threads.some(j=>j.threadId===p)?{...x,threads:x.threads.map(j=>j.threadId===p?{...j,status:h}:j)}:x)})},t[15]=o,t[16]=r,t[17]=u):u=t[17];let m;t[18]!==e.slug||t[19]!==u?(m={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=m):m=t[20],xo(m)}function Fa(){const t=O.c(9),{locator:e}=le(),s=At();let o;t[0]!==e||t[1]!==s?(o=Ai(e,s),t[0]=e,t[1]=s,t[2]=o):o=t[2];const a=lt(o);Ti();let r;t[3]!==a.data?.items?(r=a.data?.items??[],t[3]=a.data?.items,t[4]=r):r=t[4];let i;return t[5]!==a.error||t[6]!==a.isLoading||t[7]!==r?(i={items:r,isLoading:a.isLoading,error:a.error},t[5]=a.error,t[6]=a.isLoading,t[7]=r,t[8]=i):i=t[8],i}function Pa(){const t=O.c(70),{org:e,locator:s}=le(),o=At(),a=at(),r=Q();let i;t[0]!==s?(i=fe.taskBoardItems(s),t[0]=s,t[1]=i):i=t[1];const c=i;let l;t[2]!==a||t[3]!==c?(l=()=>a.invalidateQueries({queryKey:c}),t[2]=a,t[3]=c,t[4]=l):l=t[4];const f=l;let u;t[5]!==o?(u=F=>o.call("TASK_BOARD_ITEM_CREATE",F),t[5]=o,t[6]=u):u=t[6];let m;t[7]!==f||t[8]!==u?(m={mutationFn:u,onSuccess:f},t[7]=f,t[8]=u,t[9]=m):m=t[9];const d=Oe(m);let p;t[10]!==o?(p=F=>o.call("TASK_BOARD_ITEM_UPDATE",F),t[10]=o,t[11]=p):p=t[11];let h;t[12]!==a||t[13]!==c?(h=async F=>{await a.cancelQueries({queryKey:c});const U=a.getQueryData(c);return a.setQueryData(c,$=>$&&{...$,items:$.items.map(H=>H.id===F.id?{...H,...F}:H)}),{previous:U}},t[12]=a,t[13]=c,t[14]=h):h=t[14];let g;t[15]!==e?(g=(F,U)=>{U.status==="done"&&oe("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==a||t[18]!==c?(x=(F,U,$)=>{$?.previous&&a.setQueryData(c,$.previous)},t[17]=a,t[18]=c,t[19]=x):x=t[19];let j;t[20]!==f||t[21]!==s||t[22]!==a?(j=(F,U,$)=>{f(),a.invalidateQueries({queryKey:fe.taskBoardActivity(s,$.id)})},t[20]=f,t[21]=s,t[22]=a,t[23]=j):j=t[23];let N;t[24]!==p||t[25]!==h||t[26]!==g||t[27]!==x||t[28]!==j?(N={mutationFn:p,onMutate:h,onSuccess:g,onError:x,onSettled:j},t[24]=p,t[25]=h,t[26]=g,t[27]=x,t[28]=j,t[29]=N):N=t[29];const y=Oe(N);let v;t[30]!==o?(v=F=>o.call("TASK_BOARD_ITEM_DELETE",{id:F}),t[30]=o,t[31]=v):v=t[31];let C;t[32]!==f||t[33]!==r?(C=F=>{de.error(F instanceof Error&&F.message?F.message:r("taskBoard.taskBoard.deleteError")),f()},t[32]=f,t[33]=r,t[34]=C):C=t[34];let k;t[35]!==f||t[36]!==v||t[37]!==C?(k={mutationFn:v,onSuccess:f,onError:C},t[35]=f,t[36]=v,t[37]=C,t[38]=k):k=t[38];const D=Oe(k);let b;t[39]!==o?(b=async F=>{const U=await Promise.allSettled(F.map($=>o.call("TASK_BOARD_ITEM_DELETE",{id:$})));return{total:F.length,failed:U.filter(Ii).length}},t[39]=o,t[40]=b):b=t[40];let w,_;t[41]!==r?(w=F=>{const{total:U,failed:$}=F;$!==0&&de.error(r("taskBoard.taskBoard.deleteBulkError",{failed:String($),total:String(U)}))},_=()=>de.error(r("taskBoard.taskBoard.deleteError")),t[41]=r,t[42]=w,t[43]=_):(w=t[42],_=t[43]);let I;t[44]!==f||t[45]!==b||t[46]!==w||t[47]!==_?(I={mutationFn:b,onSuccess:w,onError:_,onSettled:f},t[44]=f,t[45]=b,t[46]=w,t[47]=_,t[48]=I):I=t[48];const P=Oe(I);let S;t[49]!==o?(S=F=>o.call("TASK_BOARD_ITEM_UPDATE",F),t[49]=o,t[50]=S):S=t[50];let A;t[51]!==f||t[52]!==S?(A={mutationFn:S,onSuccess:f},t[51]=f,t[52]=S,t[53]=A):A=t[53];const T=Oe(A);let R;t[54]!==o?(R=F=>o.call("TASK_BOARD_ITEM_RERUN",F),t[54]=o,t[55]=R):R=t[55];let E;t[56]!==f||t[57]!==s||t[58]!==a?(E=(F,U,$)=>{f(),a.invalidateQueries({queryKey:fe.taskBoardActivity(s,$.id)})},t[56]=f,t[57]=s,t[58]=a,t[59]=E):E=t[59];let B;t[60]!==R||t[61]!==E?(B={mutationFn:R,onSettled:E},t[60]=R,t[61]=E,t[62]=B):B=t[62];const M=Oe(B);let q;return t[63]!==d||t[64]!==T||t[65]!==D||t[66]!==P||t[67]!==M||t[68]!==y?(q={create:d,update:y,remove:D,removeMany:P,link:T,rerun:M},t[63]=d,t[64]=T,t[65]=D,t[66]=P,t[67]=M,t[68]=y,t[69]=q):q=t[69],q}function Ii(t){return t.status==="rejected"}const Bi=["ended_after_delivery","superseded"];function Fi(t){return!!t&&Bi.includes(t)}function Ea(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function Va(t){return t.failureKind!=="superseded"}function Es(t){return t.threads.some(e=>e.status==="requires_action")}function $a(t){return t.status==="in_review"&&!t.assigneeId}function Oa(t){return Es(t)}function Ma(t){return t.status==="in_progress"&&Es(t)?"text-warning animate-pulse":$s(t.status).iconClassName}function La(t){return t.threads.some(s=>s.status==="in_progress")?"running":t.threads.some(s=>s.status==="failed"&&!Fi(s.failureKind))?"failed":null}function Ra(t,e,s){const o=t.findIndex(u=>u.id===s),a=e===s?t[o+1]?.id??null:e,r=t.filter(u=>u.id!==s),i=a?r.findIndex(u=>u.id===a):-1,c=i===-1?r.length:i,l=r[c-1],f=r[c];return l&&f?(l.sortOrder+f.sortOrder)/2:l?l.sortOrder+1:f?f.sortOrder-1:0}function Ka(t,e){return Array.from({length:e},(s,o)=>t-(e-1-o)*1e-4)}const Pi=["archived"],Vs={triage:{labelKey:"taskBoard.config.statusBacklog",icon:yo,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:As,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:dn,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Co,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:cn,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Xn,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ln,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:vo,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:en,iconClassName:"text-muted-foreground"}},Ei={icon:As,iconClassName:"text-muted-foreground"},Vi=Vs;function $s(t){return Vi[t]??Ei}function za(t,e){const s=Vs[t];return{label:s?e(s.labelKey):t,visual:$s(t)}}const Ua=["bug","feature","chore","spike","security"],Ga={bug:{labelKey:"taskBoard.config.typeBug",icon:No,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:mn,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:fn,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:un,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:ko,iconClassName:"text-purple-500"}};function St(t){return go.includes(t)}function Ha(t){return Pt.filter(e=>t||!St(e))}function Qa({deliveryEnabled:t,shownLanes:e,occupied:s}){const o=Pt.filter(i=>t||!St(i)||s.includes(i)),a=o.filter(i=>Pi.includes(i)||!t&&St(i)),r=a.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!r.includes(i)),hidden:r,hideable:a}}const Jt="lane:";function $i(t){return Pt.includes(t)}function qa({overId:t,statusOf:e}){if(t===void 0)return null;const s=String(t),o=s.startsWith(Jt)?s.slice(Jt.length):e(s);return o!==void 0&&$i(o)?o:null}const Oi=["none","low","medium","high","urgent"],nt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Kt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:an,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Kt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:rn,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:on,iconClassName:"text-destructive"}};function Wa(t,e=Date.now()){const s=new Date(t).getTime();return Number.isNaN(s)?null:s<e?"overdue":s-e<=Mi*864e5?"soon":null}const Mi=3;function Zt(t){return`color-mix(in oklab, ${t??po} var(--user-color-strength), transparent)`}function Os(t){return t?.projects.length===1?t.projects[0]:void 0}function Li(t){return Os(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Ms(t){const e=O.c(6),{entry:s}=t;let o;e[0]!==s?(o=Os(s),e[0]=s,e[1]=o):o=e[1];const a=o;if(a){let i;return e[2]!==a.icon||e[3]!==a.title?(i=n.jsx(En,{icon:a.icon,name:a.title}),e[2]=a.icon,e[3]=a.title,e[4]=i):i=e[4],i}let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(ms,{className:"size-3"})}),e[5]=r):r=e[5],r}function Ri(t){const e=O.c(14),{entry:s}=t;let o;e[0]!==s?(o=Li(s),e[0]=s,e[1]=o):o=e[1];const a=o;let r;e[2]!==s?(r=n.jsx(Ms,{entry:s}),e[2]=s,e[3]=r):r=e[3];let i;e[4]!==s.title?(i=n.jsx("span",{className:"truncate",children:s.title}),e[4]=s.title,e[5]=i):i=e[5];let c;e[6]!==a?(c=a&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:a}),e[6]=a,e[7]=c):c=e[7];let l;e[8]!==i||e[9]!==c?(l=n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10];let f;return e[11]!==r||e[12]!==l?(f=n.jsxs(n.Fragment,{children:[r,l]}),e[11]=r,e[12]=l,e[13]=f):f=e[13],f}const ut="__no_repo__";function we(t){return(t??"").trim().toLowerCase()}function Ki(t,e){const s=(t.created_at??"").localeCompare(e.created_at??"");return s!==0?s:t.id.localeCompare(e.id)}function zi(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Ya(t,e=[]){const s=new Map,o=new Map,a=[],r=u=>{const m=we(u),d=s.get(m);if(d)return d;const p={id:m,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return s.set(m,p),p};for(const u of t){const m=Cn(u);if(m){const p=r(m);p.projects.push(u),o.set(u.id,p);continue}const d={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};a.push(d),o.set(u.id,d)}for(const u of e){const m=(u??"").trim();m&&r(m)}for(const u of s.values())u.projects.sort(Ki),u.title=zi(u);const i=[...s.values()].filter(u=>u.projects.length>0),c=[...s.values()].filter(u=>u.projects.length===0),l=(u,m)=>u.title.localeCompare(m.title),f=[...[...i,...a].sort(l),...c.sort(l)];return{entries:f,byId:new Map(f.map(u=>[u.id,u])),byRepo:s,byProject:o}}function wt(t,e){for(const o of t.threads??[]){const a=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(a)return a}const s=we(t.repo);return(s?e.byRepo.get(s):void 0)??null}function Ui(t,e){const s=wt(t,e);if(!s)return[];if(s.projects.length<=1)return s.projects;for(const o of t.threads??[]){const a=o.virtualMcpId?s.projects.find(r=>r.id===o.virtualMcpId):void 0;if(a)return[a]}return s.projects}function Xa(t,e){const s=Ui(t,e);return s.length===1?s[0]??null:null}function Rt(t,e){return e.byId.get(t)??e.byRepo.get(we(t))??e.byProject.get(t)}function Ls(t,e,s){if(e===null)return!0;if(e===ut)return wt(t,s)===null;const o=Rt(e,s);return o?o.repo&&we(t.repo)===we(o.repo)?!0:wt(t,s)===o:e.includes("/")?we(t.repo)===we(e):!0}function ft(t,e){return t===null?!1:t===ut?!0:!!Rt(t,e)||t.includes("/")}function Ja(t,e,s){return e===null?null:Ls(t,e,s)?e:null}function Za(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(s=>kn(s).status!=="detached")))}const _t="__unassigned__",ze="__any__",Rs={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Gi(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||ft(t.project,e)||t.search.trim()!==""}function Hi(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(ft(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const Qi=864e5;function qi(t,e){const s=new Date(t),o=new Date(e);return s.getFullYear()===o.getFullYear()&&s.getMonth()===o.getMonth()&&s.getDate()===o.getDate()}function Ks(t,e){const s=t.trim();return s===""?!1:e!=null&&pi(s)===e}function Wi(t,e){return t.assigneeId===e?!0:t.assigneeId===Nt&&t.assignedBy===e}function el(t,e,s){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!Ks(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===_t){if(t.assigneeId!==null)return!1}else if(!Wi(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const a=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&a>=r||e.due==="today"&&!qi(a,r)||e.due==="week"&&(a<r||a>r+7*Qi))return!1}if(e.tags.length>0){const a=t.tags.map(r=>r.id);if(!e.tags.some(r=>a.includes(r)))return!1}return!!Ls(t,e.project,s)}const es={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function _e(t,e=!1){return J("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Yi(t){const e=O.c(107),{value:s,members:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Qt,{size:14,className:"shrink-0"}),e[0]=f):f=e[0];let u=f,m;e[1]!==i?(m=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=m):m=e[2];let d=m;if(s===_t){let L;e[3]!==i?(L=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=L):L=e[4],d=L}else if(s===Nt){let L;e[5]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Yt,{size:14}),e[5]=L):L=e[5],u=L;let K;e[6]!==i?(K=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=K):K=e[7],d=K}else if(s){let L,K,ae,Y;if(e[8]!==o||e[9]!==s){let De;e[14]!==s?(De=Ae=>Ae.userId===s,e[14]=s,e[15]=De):De=e[15],K=o.find(De),L=Ht,ae=K?.user?.image??void 0,Y=qt(K?.user?.name),e[8]=o,e[9]=s,e[10]=L,e[11]=K,e[12]=ae,e[13]=Y}else L=e[10],K=e[11],ae=e[12],Y=e[13];let ve;e[16]!==L||e[17]!==ae||e[18]!==Y?(ve=n.jsx(L,{url:ae,fallback:Y,shape:"circle",size:"2xs"}),e[16]=L,e[17]=ae,e[18]=Y,e[19]=ve):ve=e[19],u=ve;let ue;e[20]!==K?.user?.name||e[21]!==i?(ue=K?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=K?.user?.name,e[21]=i,e[22]=ue):ue=e[22],d=ue}let p;e[23]!==a?(p=L=>{a(L),l(!1)},e[23]=a,e[24]=p):p=e[24];const h=p,g=s!==null;let x;e[25]!==r||e[26]!==g?(x=_e(g,r),e[25]=r,e[26]=g,e[27]=x):x=e[27];const j=x,N=r&&"ml-auto";let y;e[28]!==N?(y=J("shrink-0 opacity-60",N),e[28]=N,e[29]=y):y=e[29];const v=y;let C;e[30]!==d?(C=n.jsx("span",{className:"max-w-[10rem] truncate",children:d}),e[30]=d,e[31]=C):C=e[31];let k;e[32]!==v?(k=n.jsx(Ge,{size:12,className:v}),e[32]=v,e[33]=k):k=e[33];let D;e[34]!==u||e[35]!==C||e[36]!==k||e[37]!==j?(D=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:j,children:[u,C,k]})}),e[34]=u,e[35]=C,e[36]=k,e[37]=j,e[38]=D):D=e[38];let b;e[39]!==i?(b=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=b):b=e[40];let w;e[41]!==i?(w=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=w):w=e[42];let _;e[43]!==b||e[44]!==w?(_=n.jsx(Et,{placeholder:b,"aria-label":w,className:"h-9"}),e[43]=b,e[44]=w,e[45]=_):_=e[45];let I;e[46]!==i?(I=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=I):I=e[47];let P;e[48]!==I?(P=n.jsx(Vt,{children:I}),e[48]=I,e[49]=P):P=e[49];let S;e[50]!==i?(S=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=S):S=e[51];let A;e[52]!==h?(A=()=>h(null),e[52]=h,e[53]=A):A=e[53];let T;e[54]!==i?(T=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=T):T=e[55];let R;e[56]!==S||e[57]!==A||e[58]!==T?(R=n.jsx(Ce,{value:S,onSelect:A,children:T}),e[56]=S,e[57]=A,e[58]=T,e[59]=R):R=e[59];let E;e[60]!==i?(E=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=E):E=e[61];let B;e[62]!==h?(B=()=>h(_t),e[62]=h,e[63]=B):B=e[63];let M;e[64]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(Qt,{size:16,className:"text-muted-foreground"}),e[64]=M):M=e[64];let q;e[65]!==i?(q=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=q):q=e[66];let F;e[67]!==E||e[68]!==B||e[69]!==q?(F=n.jsxs(Ce,{value:E,onSelect:B,className:"gap-2",children:[M,q]}),e[67]=E,e[68]=B,e[69]=q,e[70]=F):F=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let $;e[73]!==h?($=()=>h(Nt),e[73]=h,e[74]=$):$=e[74];let H;e[75]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(Yt,{size:16}),e[75]=H):H=e[75];let z;e[76]!==i?(z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=z):z=e[77];let se;e[78]!==U||e[79]!==$||e[80]!==z?(se=n.jsxs(Ce,{value:U,onSelect:$,className:"gap-2",children:[H,z]}),e[78]=U,e[79]=$,e[80]=z,e[81]=se):se=e[81];let W;e[82]!==R||e[83]!==F||e[84]!==se?(W=n.jsxs(Ke,{children:[R,F,se]}),e[82]=R,e[83]=F,e[84]=se,e[85]=W):W=e[85];let ie;e[86]!==i?(ie=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ie):ie=e[87];let Z;if(e[88]!==o||e[89]!==h){let L;e[91]!==h?(L=K=>n.jsxs(Ce,{value:K.user?.name??K.userId,onSelect:()=>h(K.userId),className:"gap-2",children:[n.jsx(Ht,{url:K.user?.image??void 0,fallback:qt(K.user?.name),shape:"circle",size:"2xs"}),n.jsx("span",{className:"truncate",children:K.user?.name??K.userId})]},K.userId),e[91]=h,e[92]=L):L=e[92],Z=o.map(L),e[88]=o,e[89]=h,e[90]=Z}else Z=e[90];let ee;e[93]!==ie||e[94]!==Z?(ee=n.jsx(Ke,{heading:ie,children:Z}),e[93]=ie,e[94]=Z,e[95]=ee):ee=e[95];let te;e[96]!==P||e[97]!==W||e[98]!==ee?(te=n.jsxs($t,{children:[P,W,ee]}),e[96]=P,e[97]=W,e[98]=ee,e[99]=te):te=e[99];let ne;e[100]!==_||e[101]!==te?(ne=n.jsx(dt,{align:"start",className:"w-56 p-0",children:n.jsxs(Ot,{children:[_,te]})}),e[100]=_,e[101]=te,e[102]=ne):ne=e[102];let re;return e[103]!==c||e[104]!==D||e[105]!==ne?(re=n.jsxs(ct,{open:c,onOpenChange:l,children:[D,ne]}),e[103]=c,e[104]=D,e[105]=ne,e[106]=re):re=e[106],re}function Xi(t){const e=O.c(33),{value:s,onChange:o,block:a}=t,r=Q(),i=s!==null;let c;e[0]!==a||e[1]!==i?(c=_e(i,a),e[0]=a,e[1]=i,e[2]=c):c=e[2];const l=c,f=a&&"ml-auto";let u;e[3]!==f?(u=J("shrink-0 opacity-60",f),e[3]=f,e[4]=u):u=e[4];const m=u;let d;e[5]!==s?(d=s?n.jsx("span",{className:J("size-2 shrink-0 rounded-full",nt[s].dotClassName)}):n.jsx(jo,{size:14,className:"shrink-0"}),e[5]=s,e[6]=d):d=e[6];let p;e[7]!==r||e[8]!==s?(p=r(s?nt[s].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=r,e[8]=s,e[9]=p):p=e[9];let h;e[10]!==m?(h=n.jsx(Ge,{size:12,className:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==p||e[14]!==h||e[15]!==l?(g=n.jsx(Ss,{asChild:!0,children:n.jsxs("button",{type:"button",className:l,children:[d,p,h]})}),e[12]=d,e[13]=p,e[14]=h,e[15]=l,e[16]=g):g=e[16];const x=s??ze;let j;e[17]!==o?(j=D=>o(D===ze?null:D),e[17]=o,e[18]=j):j=e[18];let N;e[19]!==r?(N=r("taskBoard.taskFilters.priorityAnyPriority"),e[19]=r,e[20]=N):N=e[20];let y;e[21]!==N?(y=n.jsx(rt,{value:ze,children:N}),e[21]=N,e[22]=y):y=e[22];let v;e[23]!==r?(v=Oi.map(D=>n.jsxs(rt,{value:D,className:"gap-2",children:[n.jsx("span",{className:J("size-2 rounded-full",nt[D].dotClassName)}),r(nt[D].labelKey)]},D)),e[23]=r,e[24]=v):v=e[24];let C;e[25]!==j||e[26]!==y||e[27]!==v||e[28]!==x?(C=n.jsx(ws,{align:"start",className:"w-40",children:n.jsxs(_s,{value:x,onValueChange:j,children:[y,v]})}),e[25]=j,e[26]=y,e[27]=v,e[28]=x,e[29]=C):C=e[29];let k;return e[30]!==C||e[31]!==g?(k=n.jsxs(Ds,{children:[g,C]}),e[30]=C,e[31]=g,e[32]=k):k=e[32],k}function Ji(t){const e=O.c(35),{value:s,onChange:o,block:a}=t,r=Q();let i;e[0]!==r||e[1]!==s?(i=s?r(es[s]):void 0,e[0]=r,e[1]=s,e[2]=i):i=e[2];const c=i,l=s!==null;let f;e[3]!==a||e[4]!==l?(f=_e(l,a),e[3]=a,e[4]=l,e[5]=f):f=e[5];const u=f,m=a&&"ml-auto";let d;e[6]!==m?(d=J("shrink-0 opacity-60",m),e[6]=m,e[7]=d):d=e[7];const p=d;let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(bt,{size:14,className:"shrink-0"}),e[8]=h):h=e[8];let g;e[9]!==c||e[10]!==r?(g=c??r("taskBoard.taskFilters.dueDateLabel"),e[9]=c,e[10]=r,e[11]=g):g=e[11];let x;e[12]!==p?(x=n.jsx(Ge,{size:12,className:p}),e[12]=p,e[13]=x):x=e[13];let j;e[14]!==g||e[15]!==x||e[16]!==u?(j=n.jsx(Ss,{asChild:!0,children:n.jsxs("button",{type:"button",className:u,children:[h,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=j):j=e[17];const N=s??ze;let y;e[18]!==o?(y=_=>o(_===ze?null:_),e[18]=o,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(bt,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let C;e[21]!==r?(C=r("taskBoard.taskFilters.dueDateAnyTime"),e[21]=r,e[22]=C):C=e[22];let k;e[23]!==C?(k=n.jsxs(rt,{value:ze,className:"gap-2",children:[v,C]}),e[23]=C,e[24]=k):k=e[24];let D;e[25]!==r?(D=Object.entries(es).map(_=>{const[I,P]=_,S=I==="overdue";return n.jsxs(rt,{value:I,className:J("gap-2",S&&"text-destructive"),children:[n.jsx(bt,{size:16,className:J("shrink-0",S?"text-destructive":"text-muted-foreground")}),r(P)]},I)}),e[25]=r,e[26]=D):D=e[26];let b;e[27]!==N||e[28]!==y||e[29]!==k||e[30]!==D?(b=n.jsx(ws,{align:"start",className:"w-44",children:n.jsxs(_s,{value:N,onValueChange:y,children:[k,D]})}),e[27]=N,e[28]=y,e[29]=k,e[30]=D,e[31]=b):b=e[31];let w;return e[32]!==b||e[33]!==j?(w=n.jsxs(Ds,{children:[j,b]}),e[32]=b,e[33]=j,e[34]=w):w=e[34],w}function Zi(t){const e=O.c(56),{value:s,tags:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f;e[0]!==a||e[1]!==s?(f=E=>a(s.includes(E)?s.filter(B=>B!==E):[...s,E]),e[0]=a,e[1]=s,e[2]=f):f=e[2];const u=f;let m;e[3]!==i||e[4]!==o||e[5]!==s[0]||e[6]!==s.length?(m=s.length===0?i("taskBoard.taskFilters.tagsLabel"):s.length===1?o.find(E=>E.id===s[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:s.length}),e[3]=i,e[4]=o,e[5]=s[0],e[6]=s.length,e[7]=m):m=e[7];const d=m,p=s.length>0;let h;e[8]!==r||e[9]!==p?(h=_e(p,r),e[8]=r,e[9]=p,e[10]=h):h=e[10];const g=h,x=r&&"ml-auto";let j;e[11]!==x?(j=J("shrink-0 opacity-60",x),e[11]=x,e[12]=j):j=e[12];const N=j;let y;e[13]!==o||e[14]!==s[0]||e[15]!==s.length?(y=s.length===1?n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Zt(o.find(E=>E.id===s[0])?.color)}}):n.jsx(pn,{size:14,className:"shrink-0"}),e[13]=o,e[14]=s[0],e[15]=s.length,e[16]=y):y=e[16];let v;e[17]!==d?(v=n.jsx("span",{className:"max-w-[10rem] truncate",children:d}),e[17]=d,e[18]=v):v=e[18];let C;e[19]!==N?(C=n.jsx(Ge,{size:12,className:N}),e[19]=N,e[20]=C):C=e[20];let k;e[21]!==y||e[22]!==v||e[23]!==C||e[24]!==g?(k=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:g,children:[y,v,C]})}),e[21]=y,e[22]=v,e[23]=C,e[24]=g,e[25]=k):k=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let b;e[28]!==i?(b=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=b):b=e[29];let w;e[30]!==D||e[31]!==b?(w=n.jsx(Et,{placeholder:D,"aria-label":b,className:"h-9"}),e[30]=D,e[31]=b,e[32]=w):w=e[32];let _;e[33]!==i?(_=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=_):_=e[34];let I;e[35]!==_?(I=n.jsx(Vt,{children:_}),e[35]=_,e[36]=I):I=e[36];let P;if(e[37]!==o||e[38]!==u||e[39]!==s){let E;e[41]!==u||e[42]!==s?(E=B=>n.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Zt(B.color)}}),n.jsx("span",{className:"flex-1 truncate",children:B.name}),s.includes(B.id)&&n.jsx(qe,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=s,e[43]=E):E=e[43],P=o.map(E),e[37]=o,e[38]=u,e[39]=s,e[40]=P}else P=e[40];let S;e[44]!==P?(S=n.jsx(Ke,{children:P}),e[44]=P,e[45]=S):S=e[45];let A;e[46]!==I||e[47]!==S?(A=n.jsxs($t,{children:[I,S]}),e[46]=I,e[47]=S,e[48]=A):A=e[48];let T;e[49]!==w||e[50]!==A?(T=n.jsx(dt,{align:"start",className:"w-56 p-0",children:n.jsxs(Ot,{children:[w,A]})}),e[49]=w,e[50]=A,e[51]=T):T=e[51];let R;return e[52]!==c||e[53]!==k||e[54]!==T?(R=n.jsxs(ct,{open:c,onOpenChange:l,children:[k,T]}),e[52]=c,e[53]=k,e[54]=T,e[55]=R):R=e[55],R}function ts(t){const e=O.c(11),{entry:s,selected:o,onSelect:a}=t,r=s.id,i=s.title;let c;e[0]!==s.projects?(c=s.projects.map(er).join(" "),e[0]=s.projects,e[1]=c):c=e[1];const l=`${r} ${i} ${s.repo??""} ${c}`;let f;e[2]!==s?(f=n.jsx(Ri,{entry:s}),e[2]=s,e[3]=f):f=e[3];let u;e[4]!==o?(u=o&&n.jsx(qe,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let m;return e[6]!==a||e[7]!==l||e[8]!==f||e[9]!==u?(m=n.jsxs(Ce,{value:l,onSelect:a,className:"gap-2",children:[f,u]}),e[6]=a,e[7]=l,e[8]=f,e[9]=u,e[10]=m):m=e[10],m}function er(t){return t.title}function tr(t,e,s,o){return t===null||!s?o("taskBoard.taskFilters.projectLabel"):t===ut?o("taskBoard.taskFilters.projectNone"):e?.title??t}function sr(t){const e=O.c(90),{value:s,index:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f,u,m,d,p,h,g,x,j,N,y,v,C,k;if(e[0]!==r||e[1]!==o||e[2]!==a||e[3]!==c||e[4]!==i||e[5]!==s){const I=s===null?void 0:Rt(s,o),P=ft(s,o),S=tr(s,I,P,i);let A;e[20]!==a?(A=Y=>{a(Y),l(!1)},e[20]=a,e[21]=A):A=e[21];const T=A,R=o.entries.filter(or),E=o.entries.filter(nr),B=_e(P,r),M=r&&"ml-auto";let q;e[22]!==M?(q=J("shrink-0 opacity-60",M),e[22]=M,e[23]=q):q=e[23];const F=q;d=ct,C=c,k=l;const U=P?I:void 0;let $;e[24]!==U?($=n.jsx(Ms,{entry:U}),e[24]=U,e[25]=$):$=e[25];let H;e[26]!==S?(H=n.jsx("span",{className:"max-w-[12rem] truncate",children:S}),e[26]=S,e[27]=H):H=e[27];let z;e[28]!==F?(z=n.jsx(Ge,{size:12,className:F}),e[28]=F,e[29]=z):z=e[29],e[30]!==$||e[31]!==H||e[32]!==z||e[33]!==B?(h=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:B,children:[$,H,z]})}),e[30]=$,e[31]=H,e[32]=z,e[33]=B,e[34]=h):h=e[34],m=dt,y="start",v="w-72 p-0",u=Ot;let se;e[35]!==i?(se=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=se):se=e[36];let W;e[37]!==i?(W=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=W):W=e[38],e[39]!==se||e[40]!==W?(N=n.jsx(Et,{placeholder:se,"aria-label":W,className:"h-9"}),e[39]=se,e[40]=W,e[41]=N):N=e[41],f=$t;let ie;e[42]!==i?(ie=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ie):ie=e[43],e[44]!==ie?(p=n.jsx(Vt,{children:ie}),e[44]=ie,e[45]=p):p=e[45];let Z;e[46]!==i?(Z=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=Z):Z=e[47];let ee;e[48]!==T?(ee=()=>T(null),e[48]=T,e[49]=ee):ee=e[49];let te;e[50]!==i?(te=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=te):te=e[51];let ne;e[52]!==Z||e[53]!==ee||e[54]!==te?(ne=n.jsx(Ce,{value:Z,onSelect:ee,children:te}),e[52]=Z,e[53]=ee,e[54]=te,e[55]=ne):ne=e[55];let re;e[56]!==i?(re=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=re):re=e[57];let L;e[58]!==T?(L=()=>T(ut),e[58]=T,e[59]=L):L=e[59];let K;e[60]!==i?(K=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=K):K=e[61];let ae;e[62]!==re||e[63]!==L||e[64]!==K?(ae=n.jsx(Ce,{value:re,onSelect:L,children:K}),e[62]=re,e[63]=L,e[64]=K,e[65]=ae):ae=e[65],e[66]!==ne||e[67]!==ae?(g=n.jsxs(Ke,{children:[ne,ae]}),e[66]=ne,e[67]=ae,e[68]=g):g=e[68],x=R.length>0&&n.jsx(Ke,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:R.map(Y=>n.jsx(ts,{entry:Y,selected:I===Y,onSelect:()=>T(Y.id)},Y.id))}),j=E.length>0&&n.jsx(Ke,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:E.map(Y=>n.jsx(ts,{entry:Y,selected:I===Y,onSelect:()=>T(Y.id)},Y.id))}),e[0]=r,e[1]=o,e[2]=a,e[3]=c,e[4]=i,e[5]=s,e[6]=f,e[7]=u,e[8]=m,e[9]=d,e[10]=p,e[11]=h,e[12]=g,e[13]=x,e[14]=j,e[15]=N,e[16]=y,e[17]=v,e[18]=C,e[19]=k}else f=e[6],u=e[7],m=e[8],d=e[9],p=e[10],h=e[11],g=e[12],x=e[13],j=e[14],N=e[15],y=e[16],v=e[17],C=e[18],k=e[19];let D;e[69]!==f||e[70]!==p||e[71]!==g||e[72]!==x||e[73]!==j?(D=n.jsxs(f,{children:[p,g,x,j]}),e[69]=f,e[70]=p,e[71]=g,e[72]=x,e[73]=j,e[74]=D):D=e[74];let b;e[75]!==u||e[76]!==D||e[77]!==N?(b=n.jsxs(u,{children:[N,D]}),e[75]=u,e[76]=D,e[77]=N,e[78]=b):b=e[78];let w;e[79]!==m||e[80]!==b||e[81]!==y||e[82]!==v?(w=n.jsx(m,{align:y,className:v,children:b}),e[79]=m,e[80]=b,e[81]=y,e[82]=v,e[83]=w):w=e[83];let _;return e[84]!==d||e[85]!==h||e[86]!==w||e[87]!==C||e[88]!==k?(_=n.jsxs(d,{open:C,onOpenChange:k,children:[h,w]}),e[84]=d,e[85]=h,e[86]=w,e[87]=C,e[88]=k,e[89]=_):_=e[89],_}function nr(t){return t.projects.length===0}function or(t){return t.projects.length>0}function ir(t){const e=O.c(25),{value:s,onChange:o,block:a}=t,r=Q(),[i,c]=G.useState(s!==""),[l,f]=G.useState(!1),[u,m]=G.useState(s);s!==u&&(m(s),s===""&&!l&&c(!1));const d=i||a,p=d?"w-32 sm:w-44":"w-8 px-0 justify-center",h=a&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==p||e[1]!==h?(g=J("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",p,h),e[0]=p,e[1]=h,e[2]=g):g=e[2];let x;e[3]!==r?(x=r("taskBoard.taskFilters.searchLabel"),e[3]=r,e[4]=x):x=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=()=>c(!0),e[5]=j):j=e[5];let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(gn,{size:14}),e[6]=N):N=e[6];let y;e[7]!==x?(y=n.jsx("button",{type:"button","aria-label":x,onClick:j,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:N}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==a||e[10]!==d||e[11]!==o||e[12]!==r||e[13]!==s?(v=d&&n.jsx("input",{autoFocus:!a,value:s,onChange:D=>o(D.target.value),onFocus:()=>f(!0),onBlur:()=>{f(!1),s===""&&c(!1)},placeholder:r("taskBoard.taskFilters.searchPlaceholder"),"aria-label":r("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=a,e[10]=d,e[11]=o,e[12]=r,e[13]=s,e[14]=v):v=e[14];let C;e[15]!==a||e[16]!==o||e[17]!==r||e[18]!==s?(C=s!==""&&n.jsx("button",{type:"button","aria-label":r("taskBoard.taskFilters.searchClearLabel"),onMouseDown:rr,onClick:()=>{o(""),a||c(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:n.jsx(tn,{size:14})}),e[15]=a,e[16]=o,e[17]=r,e[18]=s,e[19]=C):C=e[19];let k;return e[20]!==g||e[21]!==y||e[22]!==v||e[23]!==C?(k=n.jsxs("div",{className:g,children:[y,v,C]}),e[20]=g,e[21]=y,e[22]=v,e[23]=C,e[24]=k):k=e[24],k}function rr(t){return t.preventDefault()}function ar(t){const e=O.c(20),{block:s,onClick:o}=t,a=Q();let r;e[0]!==a?(r=a("taskBoard.taskFilters.boardSettingsLabel"),e[0]=a,e[1]=r):r=e[1];const i=r;let c;e[2]!==s?(c=J(_e(!1,s),s?"h-10 w-full":"w-8 justify-center px-0"),e[2]=s,e[3]=c):c=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(bo,{size:14,className:"shrink-0"}),e[4]=l):l=e[4];let f;e[5]!==s||e[6]!==i?(f=s&&n.jsx("span",{children:i}),e[5]=s,e[6]=i,e[7]=f):f=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==c||e[11]!==f?(u=n.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:c,children:[l,f]}),e[8]=i,e[9]=o,e[10]=c,e[11]=f,e[12]=u):u=e[12];const m=u;if(s)return m;let d;e[13]!==m?(d=n.jsx(Me,{asChild:!0,children:m}),e[13]=m,e[14]=d):d=e[14];let p;e[15]!==i?(p=n.jsx(Le,{side:"top",children:i}),e[15]=i,e[16]=p):p=e[16];let h;return e[17]!==d||e[18]!==p?(h=n.jsxs(Re,{children:[d,p]}),e[17]=d,e[18]=p,e[19]=h):h=e[19],h}function zs(t){const e=O.c(53),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c,block:l}=t;let f;e[0]!==s||e[1]!==i?(f=k=>i({...s,search:k}),e[0]=s,e[1]=i,e[2]=f):f=e[2];let u;e[3]!==l||e[4]!==s.search||e[5]!==f?(u=n.jsx(ir,{block:l,value:s.search,onChange:f}),e[3]=l,e[4]=s.search,e[5]=f,e[6]=u):u=e[6];let m;e[7]!==s||e[8]!==i?(m=k=>i({...s,assignee:k}),e[7]=s,e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l||e[11]!==s.assignee||e[12]!==o||e[13]!==m?(d=n.jsx(Yi,{block:l,value:s.assignee,members:o,onChange:m}),e[10]=l,e[11]=s.assignee,e[12]=o,e[13]=m,e[14]=d):d=e[14];let p;e[15]!==s||e[16]!==i?(p=k=>i({...s,priority:k}),e[15]=s,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==l||e[19]!==s.priority||e[20]!==p?(h=n.jsx(Xi,{block:l,value:s.priority,onChange:p}),e[18]=l,e[19]=s.priority,e[20]=p,e[21]=h):h=e[21];let g;e[22]!==s||e[23]!==i?(g=k=>i({...s,due:k}),e[22]=s,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==l||e[26]!==s.due||e[27]!==g?(x=n.jsx(Ji,{block:l,value:s.due,onChange:g}),e[25]=l,e[26]=s.due,e[27]=g,e[28]=x):x=e[28];let j;e[29]!==s||e[30]!==i?(j=k=>i({...s,tags:k}),e[29]=s,e[30]=i,e[31]=j):j=e[31];let N;e[32]!==l||e[33]!==s.tags||e[34]!==j||e[35]!==a?(N=n.jsx(Zi,{block:l,value:s.tags,tags:a,onChange:j}),e[32]=l,e[33]=s.tags,e[34]=j,e[35]=a,e[36]=N):N=e[36];let y;e[37]!==l||e[38]!==s||e[39]!==r||e[40]!==i?(y=(r.entries.length>0||ft(s.project,r))&&n.jsx(sr,{block:l,value:s.project,index:r,onChange:k=>i({...s,project:k})}),e[37]=l,e[38]=s,e[39]=r,e[40]=i,e[41]=y):y=e[41];let v;e[42]!==l||e[43]!==c?(v=n.jsx(ar,{block:l,onClick:c}),e[42]=l,e[43]=c,e[44]=v):v=e[44];let C;return e[45]!==N||e[46]!==y||e[47]!==v||e[48]!==u||e[49]!==d||e[50]!==h||e[51]!==x?(C=n.jsxs(n.Fragment,{children:[u,d,h,x,N,y,v]}),e[45]=N,e[46]=y,e[47]=v,e[48]=u,e[49]=d,e[50]=h,e[51]=x,e[52]=C):C=e[52],C}function tl(t){const e=O.c(16),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}=t,l=Q();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ns,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=f):f=e[0];let u;e[1]!==s||e[2]!==r||e[3]!==o||e[4]!==i||e[5]!==c||e[6]!==a?(u=n.jsx(zs,{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}),e[1]=s,e[2]=r,e[3]=o,e[4]=i,e[5]=c,e[6]=a,e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==r||e[10]!==i||e[11]!==l?(m=Gi(s,r)&&n.jsx("button",{type:"button",onClick:()=>i(Rs),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:l("taskBoard.taskFilters.clearButton")}),e[8]=s,e[9]=r,e[10]=i,e[11]=l,e[12]=m):m=e[12];let d;return e[13]!==u||e[14]!==m?(d=n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f,u,m]}),e[13]=u,e[14]=m,e[15]=d):d=e[15],d}function sl(t){const e=O.c(41),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}=t,l=Q(),[f,u]=G.useState(!1),m=Hi(s,r),d=m>0;let p;e[0]!==d?(p=_e(d),e[0]=d,e[1]=p):p=e[1];const h=p;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ns,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=l,e[4]=x):x=e[4];let j;e[5]!==m?(j=m>0&&n.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:m}),e[5]=m,e[6]=j):j=e[6];let N;e[7]!==x||e[8]!==j||e[9]!==h?(N=n.jsx(An,{asChild:!0,children:n.jsxs("button",{type:"button",className:h,children:[g,x,j]})}),e[7]=x,e[8]=j,e[9]=h,e[10]=N):N=e[10];let y;e[11]!==l?(y=l("taskBoard.taskFilters.filterDrawerTitle"),e[11]=l,e[12]=y):y=e[12];let v;e[13]!==y?(v=n.jsx(Ft,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let C;e[15]!==s||e[16]!==r||e[17]!==o||e[18]!==i||e[19]!==c||e[20]!==a?(C=n.jsx("div",{className:"flex flex-col gap-2 p-4",children:n.jsx(zs,{block:!0,filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c})}),e[15]=s,e[16]=r,e[17]=o,e[18]=i,e[19]=c,e[20]=a,e[21]=C):C=e[21];let k;e[22]!==m||e[23]!==i||e[24]!==l?(k=m>0&&n.jsx(ye,{variant:"outline",className:"flex-1",onClick:()=>i(Rs),children:l("taskBoard.taskFilters.clearAllButton")}),e[22]=m,e[23]=i,e[24]=l,e[25]=k):k=e[25];let D;e[26]!==l?(D=l("taskBoard.taskFilters.doneButton"),e[26]=l,e[27]=D):D=e[27];let b;e[28]!==D?(b=n.jsx(us,{asChild:!0,children:n.jsx(ye,{className:"flex-1",children:D})}),e[28]=D,e[29]=b):b=e[29];let w;e[30]!==k||e[31]!==b?(w=n.jsxs(fs,{className:"flex-row gap-2",children:[k,b]}),e[30]=k,e[31]=b,e[32]=w):w=e[32];let _;e[33]!==w||e[34]!==v||e[35]!==C?(_=n.jsxs(Bt,{className:"p-0",children:[v,C,w]}),e[33]=w,e[34]=v,e[35]=C,e[36]=_):_=e[36];let I;return e[37]!==f||e[38]!==_||e[39]!==N?(I=n.jsxs(It,{open:f,onOpenChange:u,direction:"bottom",children:[N,_]}),e[37]=f,e[38]=_,e[39]=N,e[40]=I):I=e[40],I}function nl(t,e){return fi(t,e.keySeq)??e.id}function ol(t,e){const s=e?.trim();if(s)return t.find(o=>Ks(s,o.keySeq))??t.find(o=>o.id===s)}export{Ea as $,ha as A,wo as B,Aa as C,_a as D,Da as E,wa as F,Fs as G,Mt as H,Ti as I,wt as J,Xa as K,za as L,nt as M,Rt as N,Pa as O,hi as P,Oi as Q,Ua as R,Yt as S,Ga as T,Zt as U,Za as V,Ma as W,$s as X,Ha as Y,Ms as Z,Ri as _,Ta as a,Va as a0,Fi as a1,Vs as a2,Fa as a3,ol as a4,sl as a5,tl as a6,Ka as a7,Qa as a8,Rs as a9,La as aa,Oa as ab,Jt as ac,Ra as ad,qa as ae,el as af,Pi as ag,Ja as ah,Wa as ai,_i as aj,Wo as ak,ga as al,Ba as b,Ya as c,Ui as d,Bs as e,nl as f,$a as g,Ai as h,Es as i,ma as j,pa as k,ja as l,ya as m,Na as n,yi as o,bi as p,Ia as q,ba as r,va as s,fi as t,xa as u,ka as v,Sa as w,Ca as x,Ci as y,_o as z};
|
|
1
|
+
import{bV as Us,c as O,l as J,j as n,h as Qe,r as G,J as ss,H as Gs,o as oe,b as Q,b4 as Hs,G as le,d as ns,a6 as os,_ as is,L as Qs,a1 as Me,a2 as Le,a4 as Re,a as Dt,F as qs,aq as Ws,ar as Ys,B as ye,t as de,I as Xs,M as Js,K as fe,n as at,a7 as At,m as lt,bu as Zs,e as Oe,bk as en,ap as tn}from"./index-Db96eOyL.js";import{c as rs,u as sn,d as as}from"./thread-route-DnMeCT5b.js";import{t as Ge}from"./ChevronUp-B7eB07ok.js";import{A as ls,N as nn,s as jt,aI as on,aJ as rn,aK as Kt,aL as an,t as ln,aM as cn,a6 as dn,aN as un,p as fn,aO as mn,a4 as bt,a3 as pn,aa as gn}from"./agent-icon-Dp7ilfSA.js";import{a as cs,i as hn,e as xn,S as jn,f as bn}from"./constants-DNuUCxmW.js";import{a as Tt,u as yn}from"./use-virtual-mcp-TDdC23NB.js";import{g as vn,p as Cn,r as kn}from"./github-repo-COLY3wWI.js";import{l as Nn,j as Sn,q as wn}from"./use-navigate-to-agent-VH5AAfU9.js";import{T as ds}from"./toolbar-icon-button-BjsE6ye3.js";import{P as ct,a as Ue,b as dt}from"./popover-BJRufN5E.js";import{D as It,a as Bt,b as Ft,c as _n,e as Dn,f as us,g as fs,d as An}from"./drawer-BhTJZiCl.js";import{i as Tn}from"./SearchMd-TZRK7Jjy.js";import{i as qe}from"./Check-DhyLPiiJ.js";import{s as Ye}from"./Plus-DpDZOmhb.js";import{G as ms,a as In}from"./github-repo-picker-CardHb2H.js";import{g as Bn,u as Fn,b as ps}from"./hooks-BVfnO0Aw.js";import{g as Pn,b as gs,P as En}from"./project-icon-DW2b1tpw.js";import{b as hs}from"./shell-layout--n0X6oT8.js";import{d as Vn}from"./thread-intent-BpQob6u5.js";import{C as $n}from"./collection-search-CoaljN3t.js";import{g as On,b as Mn,a as Ln,e as Rn}from"./extract-connection-data-ovzHbL2Q.js";import{u as xs,a as js,g as Kn,C as yt}from"./connection-card-B3IJPiNj.js";import{D as bs,b as ys,c as vs,d as Cs,h as zn,e as Un}from"./dialog--s8x0s1I.js";import{d as pe,a as ge,e as he,b as xe,c as je,F as zt}from"./form-Bz464I8y.js";import{I as Se}from"./input-Cwwyr7Rh.js";import{S as Gn,b as Hn,a as Qn,d as qn,c as He}from"./select-CaIqJLnH.js";import{T as Wn}from"./textarea-fFyq39OK.js";import{b as ks}from"./use-connection-Dy0Z_WuU.js";import{n as ot,a as vt,i as Ns}from"./Tool02-D8KfndCv.js";import{b as Yn,d as Xn}from"./UserSquare-B0qUe-aI.js";import{s as Jn}from"./XClose-B53vZH_B.js";import{c as Zn,i as et,a as Ut,E as eo,p as to,b as so,d as no}from"./connection-form-helpers-Do9xG8iy.js";import{a as Ct}from"./authenticate-and-persist-oauth-DHpekAO-.js";import{g as oo}from"./connection-slug-CITJ0kGN.js";import{C as io}from"./collection-tabs-DV5Bk6yE.js";import{u as Gt}from"./use-infinite-scroll-DO_cvi6-.js";import{B as tt}from"./badge-jE0YdZz3.js";import{u as ro}from"./useSuspenseInfiniteQuery-BeaYkvve.js";import{u as ao}from"./use-mcp-client-CrXQAzxs.js";import{g as it}from"./metadata-dUsYcpuu.js";import{u as lo}from"./use-ai-providers-9OMyWZ-c.js";import{a as co}from"./use-file-configs-DDYv5LKG.js";import{d as uo}from"./use-organization-settings-CEqsZkOR.js";import{r as fo}from"./site-slug-uya6Wp4-.js";import{T as mo,C as Pt,c as po,d as go,S as Nt}from"./task-board-CPnu2vHn.js";import{t as ho}from"./decopilot-sse-pool-DuxzrK6E.js";import{u as xo}from"./use-decopilot-events-CXqAHm8B.js";import{A as Ht}from"./avatar-CYvGTxVT.js";import{h as rt,D as Ss,b as ws,g as _s,c as Ds}from"./dropdown-menu-B1CAYfZn.js";import{e as Ke,a as Et,c as Vt,d as Ce,b as $t,C as Ot}from"./command-DHa5RJaq.js";import{s as jo}from"./TrendUp01-DBzB_6-8.js";import{a as bo}from"./Settings02-BvEJJ01O.js";import{s as Qt}from"./User01-EYes367B.js";import{g as qt}from"./get-initials-D-f_fDFw.js";import{i as yo}from"./AlertCircle-CTUkQXgs.js";import{i as vo}from"./CheckCircle-CtgjJb3s.js";import{a as As}from"./DotsVertical-alsvv1gj.js";import{s as Co}from"./Eye-T_5uiyBH.js";import{i as ko}from"./Shield01-C7gp23VU.js";const No=Us("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function So(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function wo(t){return t?.name||t?.email?.split("@")[0]||void 0}function _o(t){const e=So(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function Do(t){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:r,className:i,isSearching:c,disabled:l}=t,f=a===void 0?"Search...":a;let u;e[0]!==i?(u=J("shrink-0 w-full border-b border-border h-12",i),e[0]=i,e[1]=u):u=e[1];const m=l?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==m?(d=J("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=d):d=e[3];let p;e[4]!==c?(p=c?n.jsx(Qe,{className:"size-4 text-muted-foreground shrink-0"}):n.jsx(Tn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let h;e[6]!==o?(h=N=>o(N.target.value),e[6]=o,e[7]=h):h=e[7];let g;e[8]!==l||e[9]!==r||e[10]!==f||e[11]!==h||e[12]!==s?(g=n.jsx("input",{type:"text",value:s,onChange:h,onKeyDown:r,placeholder:f,disabled:l,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=l,e[9]=r,e[10]=f,e[11]=h,e[12]=s,e[13]=g):g=e[13];let x;e[14]!==d||e[15]!==p||e[16]!==g?(x=n.jsxs("label",{className:d,children:[p,g]}),e[14]=d,e[15]=p,e[16]=g,e[17]=x):x=e[17];let j;return e[18]!==u||e[19]!==x?(j=n.jsx("div",{className:u,children:x}),e[18]=u,e[19]=x,e[20]=j):j=e[20],j}function Ao(t,e,s){if(!s)return null;const o=Bn(t,e);return o?o.threads.get().find(r=>r.id===s)?.branch??null:null}const Ts=G.createContext(null);function ma(t){const e=O.c(5),{children:s}=t,[o,a]=G.useState(!1);let r;e[0]!==o?(r={empty:o,setEmpty:a},e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx(Ts.Provider,{value:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function To(){return G.useContext(Ts)?.empty??!1}function Io(t){const e=O.c(6),{value:s,onChange:o}=t,a=Q();let r;e[0]!==a?(r=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==o||e[3]!==r||e[4]!==s?(i=n.jsx(Do,{value:s,onChange:o,placeholder:r}),e[2]=o,e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function Bo(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),t[2]=s,t[3]=o):o=t[3],o}function Fo(t){const e=O.c(10),{org:s,onClose:o}=t,a=Q();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let i;e[2]!==o?(i=()=>o(),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let l;return e[6]!==r||e[7]!==i||e[8]!==c?(l=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Qs,{to:"/$org/settings/agents",params:r,onClick:i,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=i,e[8]=c,e[9]=l):l=e[9],l}function Po(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx(Is,{children:s}),t[2]=s,t[3]=o):o=t[3],o}function Eo(t){const e=O.c(11),{onImportFromGithub:s}=t,o=Q();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ms,{className:"size-3.5"}),e[0]=a):a=e[0];let r;e[1]!==o?(r=o("sidebar.agentsSection.import"),e[1]=o,e[2]=r):r=e[2];let i;e[3]!==s||e[4]!==r?(i=n.jsxs("button",{type:"button",onClick:s,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:[a,r]}),e[3]=s,e[4]=r,e[5]=i):i=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsx(Is,{action:i,children:c}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function Vo(t){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=t,a=Q();let r;e[0]!==a?(r=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=r):r=e[1];let i;e[2]!==o?(i=J(o),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==s?(c=()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ye,{className:"size-4"}),e[6]=l):l=e[6];let f;return e[7]!==r||e[8]!==i||e[9]!==c?(f=n.jsx(ds,{"aria-label":r,className:i,onClick:c,children:l}),e[7]=r,e[8]=i,e[9]=c,e[10]=f):f=e[10],f}function $o(t){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=t,r=Q();let i;e[0]!==o||e[1]!==r?(i=o?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==a?(c=J(a),e[3]=a,e[4]=c):c=e[4];let l;e[5]!==s?(l=()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=l):l=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ye,{}),e[7]=f):f=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let m;e[10]!==u?(m=n.jsx("span",{children:u}),e[10]=u,e[11]=m):m=e[11];let d;return e[12]!==i||e[13]!==c||e[14]!==l||e[15]!==m?(d=n.jsx(os,{children:n.jsxs(is,{tooltip:i,className:c,onClick:l,children:[f,m]})}),e[12]=i,e[13]=c,e[14]=l,e[15]=m,e[16]=d):d=e[16],d}function Oo(){const t=O.c(4),e=Q();let s;t[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=s):s=t[1];let o;return t[2]!==s?(o=n.jsx(Ft,{className:"sr-only",children:s}),t[2]=s,t[3]=o):o=t[3],o}function Mo(t){const e=O.c(8),{emptyCtaClass:s}=t,o=Q();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let r;e[2]!==s?(r=J(s),e[2]=s,e[3]=r):r=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{className:"size-4"}),e[4]=i):i=e[4];let c;return e[5]!==a||e[6]!==r?(c=n.jsx(ds,{"aria-label":a,className:r,children:i}),e[5]=a,e[6]=r,e[7]=c):c=e[7],c}function Lo(t){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=t,r=Q();let i;e[0]!==o||e[1]!==r?(i=o?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==a?(c=J(a),e[3]=a,e[4]=c):c=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ye,{}),e[5]=l):l=e[5];let f;e[6]!==r?(f=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=f):f=e[7];let u;e[8]!==f?(u=n.jsx("span",{children:f}),e[8]=f,e[9]=u):u=e[9];let m;e[10]!==i||e[11]!==c||e[12]!==u?(m=n.jsx(Ue,{asChild:!0,children:n.jsxs(is,{tooltip:i,className:c,children:[l,u]})}),e[10]=i,e[11]=c,e[12]=u,e[13]=m):m=e[13];let d;e[14]!==m||e[15]!==s?(d=s(m),e[14]=m,e[15]=s,e[16]=d):d=e[16];let p;return e[17]!==d?(p=n.jsx(os,{children:d}),e[17]=d,e[18]=p):p=e[18],p}function Ro(t){const e=O.c(9),{children:s}=t,o=Q();let a;e[0]!==s?(a=n.jsx(Me,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let r;e[2]!==o?(r=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=r):r=e[3];let i;e[4]!==r?(i=n.jsx(Le,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=i):i=e[5];let c;return e[6]!==a||e[7]!==i?(c=n.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[a,i]}),e[6]=a,e[7]=i,e[8]=c):c=e[8],c}function Ko(t){const e=ns(),{create:s}=Fn(),{locator:o}=le(),a=rs(),r=sn();return async i=>{const c=crypto.randomUUID(),l=i===r?Ao(t,o,a??""):null;try{await s({id:c,virtual_mcp_id:i,...l?{branch:l}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:i}})}}function kt(t){const e=O.c(20),{agent:s,selected:o,onClick:a}=t,r=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let i;e[0]!==r?(i=J("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]=i):i=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=n.jsx(ls,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let l;e[5]!==s.title?(l=n.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=l):l=e[6];let f;e[7]!==s.description?(f=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=f):f=e[8];let u;e[9]!==l||e[10]!==f?(u=n.jsxs("div",{className:"flex-1 min-w-0",children:[l,f]}),e[9]=l,e[10]=f,e[11]=u):u=e[11];let m;e[12]!==o?(m=o&&n.jsx(qe,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=m):m=e[13];let d;return e[14]!==a||e[15]!==i||e[16]!==c||e[17]!==u||e[18]!==m?(d=n.jsxs("button",{type:"button",onClick:a,className:i,children:[c,u,m]}),e[14]=a,e[15]=i,e[16]=c,e[17]=u,e[18]=m,e[19]=d):d=e[19],d}function Is(t){const e=O.c(5),{children:s,action:o}=t;let a;e[0]!==s?(a=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let r;return e[2]!==o||e[3]!==a?(r=n.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=r):r=e[4],r}function zo(t){const e=O.c(43),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:r}=t,[i,c]=G.useState(""),l=G.useDeferredValue(i),f=l||void 0;let u;e[0]!==f?(u={searchTerm:f},e[0]=f,e[1]=u):u=e[1];const m=Tt(u),d=m??[],{org:p}=le(),h=Ko(p.slug),g=Pn(m),x=l.toLowerCase(),j=d.filter(Qo).filter(z=>!g.has(z.id)).filter(Ho),N=j.filter(Go),y=j.filter(Uo),v=cs(p.id),C=!l||v.title.toLowerCase().includes(x),k=!!(o&&C);let D;e[2]!==s||e[3]!==o?(D=()=>{o?.(null),s(),c("")},e[2]=s,e[3]=o,e[4]=D):D=e[4];const b=D;let w;e[5]!==h||e[6]!==s||e[7]!==o?(w=z=>{if(o){o(z.id),s(),c("");return}s(),c(""),h(z.id)},e[5]=h,e[6]=s,e[7]=o,e[8]=w):w=e[8];const _=w,I="flex flex-col max-h-[min(640px,80dvh)]";let P;e[9]!==i?(P=n.jsx(Io,{value:i,onChange:c}),e[9]=i,e[10]=P):P=e[10];const S="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==o||e[13]!==b||e[14]!==a||e[15]!==C?(A=o&&C&&v&&n.jsx(kt,{agent:v,selected:!a||a===v.id,onClick:b}),e[11]=v,e[12]=o,e[13]=b,e[14]=a,e[15]=C,e[16]=A):A=e[16];const T=(N.length>0||!l)&&n.jsx(Eo,{onImportFromGithub:r});let R;e[17]!==_||e[18]!==o||e[19]!==a?(R=z=>n.jsx(kt,{agent:z,selected:o?a===z.id:void 0,onClick:()=>_(z)},z.id),e[17]=_,e[18]=o,e[19]=a,e[20]=R):R=e[20];const E=N.map(R),B=y.length>0&&n.jsx(Po,{});let M;e[21]!==_||e[22]!==o||e[23]!==a?(M=z=>n.jsx(kt,{agent:z,selected:o?a===z.id:void 0,onClick:()=>_(z)},z.id),e[21]=_,e[22]=o,e[23]=a,e[24]=M):M=e[24];const q=y.map(M);let F;e[25]!==k||e[26]!==l||e[27]!==j.length?(F=j.length===0&&!k&&l&&n.jsx(Bo,{}),e[25]=k,e[26]=l,e[27]=j.length,e[28]=F):F=e[28];let U;e[29]!==E||e[30]!==B||e[31]!==q||e[32]!==F||e[33]!==A||e[34]!==T?(U=n.jsxs("div",{className:S,children:[A,T,E,B,q,F]}),e[29]=E,e[30]=B,e[31]=q,e[32]=F,e[33]=A,e[34]=T,e[35]=U):U=e[35];let $;e[36]!==s||e[37]!==p?($=n.jsx(Fo,{org:p,onClose:s}),e[36]=s,e[37]=p,e[38]=$):$=e[38];let H;return e[39]!==U||e[40]!==$||e[41]!==P?(H=n.jsxs("div",{className:I,children:[P,U,$]}),e[39]=U,e[40]=$,e[41]=P,e[42]=H):H=e[42],H}function Uo(t){return!gs(t.metadata)}function Go(t){return gs(t.metadata)}function Ho(t){return!xn(t.id)}function Qo(t){return!hn(t.id)}function qo(t){const e=O.c(14),{compact:s,trigger:o,onSelectAgent:a,selectedAgentId:r,side:i,align:c}=t===void 0?{}:t,l=s===void 0?!1:s,f=i===void 0?"right":i,u=c===void 0?"start":c,[m,d]=G.useState(!1),[p,h]=G.useState(!1),g=ss(),{setOpenMobile:x}=Gs(),j=To(),N=j?"border border-border":void 0;let y;e[0]!==j?(y=S=>j?n.jsx(Ro,{children:S}):S,e[0]=j,e[1]=y):y=e[1];const v=y;let C;e[2]!==g||e[3]!==x?(C=()=>{d(!1),g&&x(!1)},e[2]=g,e[3]=x,e[4]=C):C=e[4];const k=C;let D;e[5]!==k||e[6]!==h?(D=()=>{k(),h(!0)},e[5]=k,e[6]=h,e[7]=D):D=e[7];const b=D,w=m&&n.jsx(G.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Hs,{className:"h-4 w-24"})}),children:n.jsx(zo,{onClose:k,onSelectAgent:a,selectedAgentId:r,onImportFromGithub:b})}),_=g?n.jsxs(n.Fragment,{children:[o?G.cloneElement(o,{onClick:S=>{o.props.onClick?.(S),d(!0)}}):l?v(n.jsx(Vo,{setOpen:d,emptyCtaClass:N})):n.jsx($o,{setOpen:d,highlightEmpty:j,emptyCtaClass:N}),n.jsx(It,{open:m,onOpenChange:d,direction:"bottom",children:n.jsxs(Bt,{className:"max-h-[85dvh] p-0",children:[n.jsx(Oo,{}),w]})})]}):n.jsxs(ct,{open:m,onOpenChange:S=>{S&&!m&&oe("agent_browser_opened",{surface:"desktop_popover"}),d(S)},children:[o?n.jsx(Ue,{asChild:!0,children:o}):l?v(n.jsx(Ue,{asChild:!0,children:n.jsx(Mo,{emptyCtaClass:N})})):n.jsx(Lo,{wrapEmptyHint:v,highlightEmpty:j,emptyCtaClass:N}),n.jsx(dt,{className:"w-[380px] p-0 overflow-hidden",side:f,align:u,children:w})]});let I;e[8]!==p||e[9]!==h?(I=n.jsx(In,{open:p,onOpenChange:h,mode:"agent"}),e[8]=p,e[9]=h,e[10]=I):I=e[10];let P;return e[11]!==_||e[12]!==I?(P=n.jsxs(n.Fragment,{children:[_,I]}),e[11]=_,e[12]=I,e[13]=P):P=e[13],P}function Wo(){const t=O.c(2),e=Tt()??[];let s;return t[0]!==e?(s=o=>{if(!o)return;const a=e.find(r=>r.id===o);return a?Vn(a.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}const Yo="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 Xo(t){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:r}=t,i=Q(),c=yn(s)??o??null;let l,f,u,m,d;e[0]!==c?.title||e[1]!==a||e[2]!==i?(d=c?.title??i("header.shellBreadcrumb.superAgentDefaultName"),m="flex min-w-0 items-center gap-0",l="button",f=a,u=i("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=a,e[2]=i,e[3]=l,e[4]=f,e[5]=u,e[6]=m,e[7]=d):(l=e[3],f=e[4],u=e[5],m=e[6],d=e[7]);const p=c?.icon??null;let h;e[8]!==p||e[9]!==d?(h=n.jsx(ls,{icon:p,name:d,size:"xs"}),e[8]=p,e[9]=d,e[10]=h):h=e[10];let g;e[11]!==l||e[12]!==f||e[13]!==u||e[14]!==h?(g=n.jsx("button",{type:l,onClick:f,"aria-label":u,className:"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:h}),e[11]=l,e[12]=f,e[13]=u,e[14]=h,e[15]=g):g=e[15];let x;e[16]!==d?(x=n.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ge,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let N;e[19]!==x?(N=n.jsxs("button",{type:"button",className:Yo,children:[x,j]}),e[19]=x,e[20]=N):N=e[20];let y;e[21]!==s||e[22]!==r||e[23]!==N?(y=n.jsx(qo,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:N}),e[21]=s,e[22]=r,e[23]=N,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==m||e[27]!==g?(v=n.jsxs("div",{className:m,children:[g,y]}),e[25]=y,e[26]=m,e[27]=g,e[28]=v):v=e[28],v}function pa(t){const e=O.c(23);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=le(),{threads:r}=ps(),i=Tt(),{data:c}=Dt.useSession(),{setTaskId:l,createNewTask:f}=hs(),u=Wo(),m=Nn(void 0,null);let d;e[2]!==a.id?(d=cs(a.id),e[2]=a.id,e[3]=d):d=e[3];const p=d,h=p.id,g=as();let x;e[4]!==i||e[5]!==m||e[6]!==f||e[7]!==h||e[8]!==o||e[9]!==u||e[10]!==c?.user||e[11]!==l||e[12]!==r?(x=k=>{const D=k??h,b=(i??[]).find(I=>I.id===D),w=Sn(b),_=wn(r,D,c?.user?.id,u(D),!!(b&&vn(b)),{knownBranches:new Set([m,...(b?.metadata?.releases??[]).map(Jo)]),draftsMode:w,baseBranch:m});_?l(_.id,D):f(D,w?_o(wo(c?.user)):void 0),o?.()},e[4]=i,e[5]=m,e[6]=f,e[7]=h,e[8]=o,e[9]=u,e[10]=c?.user,e[11]=l,e[12]=r,e[13]=x):x=e[13];const j=x;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[14]=N):N=e[14];const y=g===h?p:void 0;let v;e[15]!==g||e[16]!==j?(v=()=>j(g),e[15]=g,e[16]=j,e[17]=v):v=e[17];let C;return e[18]!==g||e[19]!==j||e[20]!==y||e[21]!==v?(C=n.jsx(G.Suspense,{fallback:N,children:n.jsx(Xo,{agentId:g,fallback:y,onOpenHome:v,onPick:j})}),e[18]=g,e[19]=j,e[20]=y,e[21]=v,e[22]=C):C=e[22],C}function Jo(t){return t.branch}function ga(){const t=O.c(20),e=Q(),{threads:s}=ps(),{createNewTask:o}=hs(),a=as(),r=rs();let i;t[0]!==r||t[1]!==s?(i=s.find(x=>x.id===r)?.branch??null,t[0]=r,t[1]=s,t[2]=i):i=t[2];const c=i;let l;t[3]!==a||t[4]!==o||t[5]!==c?(l=()=>{o(a,c)},t[3]=a,t[4]=o,t[5]=c,t[6]=l):l=t[6];const f=l;let u;t[7]!==e?(u=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=u):u=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(nn,{size:16}),t[9]=m):m=t[9];let d;t[10]!==f||t[11]!==u?(d=n.jsx(Me,{asChild:!0,children:n.jsx("button",{type:"button",onClick:f,"aria-label":u,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m})}),t[10]=f,t[11]=u,t[12]=d):d=t[12];let p;t[13]!==e?(p=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=p):p=t[14];let h;t[15]!==p?(h=n.jsx(Le,{side:"bottom",children:p}),t[15]=p,t[16]=h):h=t[16];let g;return t[17]!==d||t[18]!==h?(g=n.jsxs(Re,{children:[d,h]}),t[17]=d,t[18]=h,t[19]=g):g=t[19],g}function Zo({open:t,onOpenChange:e,onCreated:s}){const o=Q(),{org:a}=le(),{data:r}=Dt.useSession(),{stdioEnabled:i}=qs(),c=ss(),l=ks(),f=xs(),m=js(f,"").items,d=Ws({resolver:Ys(Zn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=d.watch("ui_type"),h=d.watch("connection_url"),g=d.watch("npx_package"),x=et({uiType:p,connectionUrl:h??"",npxPackage:g??""})??Ut({uiType:p,connectionUrl:h??"",registryItems:m}),j=b=>{const w=b.trim();if(!w)return;const _=!!d.formState.dirtyFields.title,I=!!d.formState.dirtyFields.description,P=!!d.formState.dirtyFields.env_vars,S=T=>{if(T&&(!_&&!d.getValues("title").trim()&&T.title&&d.setValue("title",T.title,{shouldDirty:!1}),!I&&!(d.getValues("description")??"").trim()&&T.description&&d.setValue("description",T.description,{shouldDirty:!1}),!P&&T.envVarKeys?.length)){const R=d.getValues("env_vars")??[],E=new Set(R.map(M=>M.key)),B=T.envVarKeys.filter(M=>!E.has(M));B.length>0&&d.setValue("env_vars",[...R,...B.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},A=to(w);if(A&&i){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",A.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),S(et({uiType:"NPX",npxPackage:A.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const T=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";d.setValue("ui_type",T,{shouldDirty:!0}),d.setValue("connection_url",w,{shouldDirty:!0}),S(et({uiType:T,connectionUrl:w})??Ut({uiType:T,connectionUrl:w,registryItems:m}));return}p==="NPX"&&S(et({uiType:"NPX",npxPackage:w}))},N=b=>{b||d.reset(),e(b)},y=async b=>{let w,_=null,I=null,P=null;b.ui_type==="NPX"?(w="STDIO",_="",P=so(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(w="STDIO",_="",P=no(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(w=b.ui_type,_=b.connection_url||"",I=b.connection_token||null);const S=On("conn");try{await l.create.mutateAsync({id:S,title:b.title,description:b.description||null,connection_type:w,connection_url:_,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:a.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(S)}catch{de.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},v=o("connections.createConnectionDialog.title"),C=o("connections.createConnectionDialog.description"),k=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=n.jsxs("div",{className:"grid gap-4",children:[n.jsx(pe,{control:d.control,name:"ui_type",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.typeLabel")}),n.jsxs(Gn,{value:b.value,onValueChange:b.onChange,children:[n.jsx(xe,{children:n.jsx(Hn,{children:n.jsx(Qn,{})})}),n.jsxs(qn,{children:[n.jsx(He,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),n.jsx(He,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),n.jsx(He,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(jt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&n.jsxs(n.Fragment,{children:[n.jsx(He,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(ot,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),n.jsx(He,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Yn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),n.jsx(je,{})]})}),p==="NPX"&&n.jsx(pe,{control:d.control,name:"npx_package",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.npmPackageLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...b,value:b.value??"",onPaste:w=>{const _=w.clipboardData.getData("text");_&&(w.preventDefault(),d.setValue("npx_package",_.trim(),{shouldDirty:!0}),j(_))},onBlur:w=>{j(w.target.value),b.onBlur()}})}),n.jsx(je,{})]})}),p==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[n.jsx(pe,{control:d.control,name:"stdio_command",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.commandLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...b,value:b.value??""})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"stdio_args",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.argumentsLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...b,value:b.value??""})}),n.jsx(je,{})]})})]}),n.jsx(pe,{control:d.control,name:"stdio_cwd",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...b,value:b.value??""})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),n.jsx(je,{})]})})]}),(p==="NPX"||p==="STDIO")&&n.jsx(pe,{control:d.control,name:"env_vars",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),n.jsx(xe,{children:n.jsx(eo,{value:b.value??[],onChange:b.onChange})}),n.jsx(je,{})]})}),p!=="NPX"&&p!=="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsx(pe,{control:d.control,name:"connection_url",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.urlLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...b,value:b.value??"",onPaste:w=>{const _=w.clipboardData.getData("text");_&&(w.preventDefault(),d.setValue("connection_url",_.trim(),{shouldDirty:!0}),j(_))},onBlur:w=>{j(w.target.value),b.onBlur()}})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"connection_token",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),n.jsx(xe,{children:n.jsx(Se,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...b,value:b.value??""})}),x?.token?.helperText&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&n.jsxs(n.Fragment,{children:[" ","·"," ",n.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),n.jsx(je,{})]})})]}),n.jsx(pe,{control:d.control,name:"title",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.nameLabel")}),n.jsx(xe,{children:n.jsx(Se,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...b})}),n.jsx(je,{})]})}),n.jsx(pe,{control:d.control,name:"description",render:({field:b})=>n.jsxs(ge,{children:[n.jsx(he,{children:o("connections.createConnectionDialog.descriptionLabel")}),n.jsx(xe,{children:n.jsx(Wn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...b,value:b.value??""})}),n.jsx(je,{})]})})]});return c?n.jsx(It,{open:t,onOpenChange:N,children:n.jsxs(Bt,{className:"max-h-[90vh]",children:[n.jsx(_n,{className:"pb-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex-1 text-left",children:[n.jsx(Ft,{children:v}),n.jsx(Dn,{className:"mt-1",children:C})]}),n.jsx(us,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:n.jsx(Jn,{size:16})})})]})}),n.jsx(zt,{...d,children:n.jsxs("form",{onSubmit:d.handleSubmit(y),children:[n.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),n.jsx(fs,{children:n.jsx(ye,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):n.jsx(bs,{open:t,onOpenChange:N,children:n.jsxs(ys,{className:"sm:max-w-[525px]",children:[n.jsxs(vs,{children:[n.jsx(Cs,{children:v}),n.jsx(zn,{children:C})]}),n.jsx(zt,{...d,children:n.jsxs("form",{onSubmit:d.handleSubmit(y),children:[n.jsx("div",{className:"py-4",children:D}),n.jsxs(Un,{children:[n.jsx(ye,{type:"button",variant:"outline",onClick:()=>N(!1),children:o("connections.createConnectionDialog.cancelButton")}),n.jsx(ye,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function ei(t){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:r,onCloneAndAdd:i,onConnectAndAdd:c,connectingItemId:l,search:f,onCreateConnection:u,onBrowseNavigate:m,defaultTab:d}=t,p=s===void 0?"add":s,h=d===void 0?"connected":d,g=Q(),{org:x}=le(),j=G.useDeferredValue(f),N=f!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const v=y;let C;e[2]!==h?(C=V=>V??h,e[2]=h,e[3]=C):C=e[3];const[k,D]=Xs(Js.connectionsTab(x.slug)+(h==="all"?":home-modal":":agent-modal"),C);let b;e[4]!==k||e[5]!==D?(b=V=>{V!==k&&oe("connections_dialog_tab_changed",{to_tab:V}),D(V)},e[4]=k,e[5]=D,e[6]=b):b=e[6];const w=b;let _;e[7]!==x.id||e[8]!==x.slug?(_={connectionId:jn,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=_):_=e[9];const I=ao(_),P=j?.trim().split(/\s+/).filter(Boolean)??[],S=P.length>0?{operator:"or",conditions:P.flatMap(li)}:void 0,A={...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:R,fetchNextPage:E,hasNextPage:B,isFetchingNextPage:M}=ro({queryKey:fe.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async V=>{const{pageParam:X}=V,be=X===void 0?0:X;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:be}})).structuredContent},initialPageParam:0,getNextPageParam:ri,staleTime:3e4}),q=R?.pages.flatMap(ii)??[],F=Kn(q),U=new Set(q.filter(oi).map(ni)),$=xs(),H=js($,j),z=Gt(H.loadMore,H.hasMore,H.isLoadingMore),se=Gt(E,B??!1,M),W=k==="all"||!!v,ie=W?H.items.filter(V=>{const X=Mn(V);if(X&&U.has(X))return!1;if(!v)return!0;const be=it(V._meta),ke=[V.title,V.description,V.name,V.server?.title,V.server?.description,V.server?.name,be?.friendly_name,be?.friendlyName].filter(Boolean).join(" ").toLowerCase();return P.some(me=>ke.includes(me.toLowerCase()))}):[],Z=ie.filter(si),ee=ie.filter(ti);let te;e[10]!==a?(te=V=>V.some(X=>a.has(X.id)),e[10]=a,e[11]=te):te=e[11];const ne=te;let re;e[12]!==a||e[13]!==o||e[14]!==l||e[15]!==ne||e[16]!==p||e[17]!==r||e[18]!==m||e[19]!==i||e[20]!==g?(re=(V,X,be,ke,me)=>{const Ze=ne(me),$e=me.find(Ne=>!a.has(Ne.id)),ce=me[0];if(p==="browse"){const Ne=oo(ce);return n.jsx(yt,{connection:{title:X,icon:be,description:me.length>1?`${me.length} instances`:ke??void 0},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs(tt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(qe,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{oe("connection_browse_clicked",{app_name:ce.app_name??null,connection_id:ce.id,instances_count:me.length}),m?.(Ne)}},V)}return n.jsx(yt,{connection:{title:X,icon:be,description:ke},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[Ze&&n.jsxs(tt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[n.jsx(qe,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),n.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Ne=>{Ne.stopPropagation(),$e?(oe("connection_add_clicked",{action:"use_existing",app_name:ce.app_name??null,connection_id:$e.id}),o&&oe("agent_connection_attached",{agent_id:o,connection_id:$e.id,app_name:ce.app_name??null,mode:"existing"}),r($e.id)):(oe("connection_add_clicked",{action:"clone",app_name:ce.app_name??null,base_connection_id:ce.id}),i(ce))},children:g("virtualMcp.connectionDialogContent.add")})]})},V)},e[12]=a,e[13]=o,e[14]=l,e[15]=ne,e[16]=p,e[17]=r,e[18]=m,e[19]=i,e[20]=g,e[21]=re):re=e[21];const L=re;let K;e[22]!==l||e[23]!==p||e[24]!==c||e[25]!==g?(K=V=>{const X=it(V._meta),be=X?.friendlyName||X?.friendly_name||V.server?.title||V.title||V.server?.name||V.name||V.id||"",ke=V.server?.description||V.description||null,me=V.server?.icons?.[0]?.src||Ln(V.server?.repository)||null,Ze=X?.official===!0,$e=X?.verified===!0,ce=X?.owner==="deco";return n.jsx(yt,{connection:{title:be,description:ke,icon:me},fallbackIcon:n.jsx(ot,{}),headerActionsAlwaysVisible:!0,headerActions:n.jsxs("div",{className:"flex items-center gap-1.5",children:[ce&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:n.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ce&&Ze&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx(tt,{variant:"outline",size:"icon",children:n.jsx(vt,{})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ce&&!Ze&&$e&&n.jsxs(Re,{children:[n.jsx(Me,{asChild:!0,children:n.jsx(tt,{variant:"outline",size:"icon",children:n.jsx(vt,{})})}),n.jsx(Le,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),n.jsx(ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Ne=>{Ne.stopPropagation(),oe("connection_add_clicked",{action:"connect_new",registry_item_id:V.id,app_name:X?.friendlyName||V.server?.name||V.name||null}),c(V)},children:l===V.id?n.jsx(Qe,{className:"size-3.5"}):g(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${V.id}`)},e[22]=l,e[23]=p,e[24]=c,e[25]=g,e[26]=K):K=e[26];const ae=K;let Y;e[27]!==k||e[28]!==w||e[29]!==u||e[30]!==v||e[31]!==g?(Y=!v&&n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[n.jsx(io,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:V=>w(V)}),n.jsxs(ye,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{oe("connections_dialog_custom_clicked"),u()},children:[n.jsx(Ye,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=w,e[29]=u,e[30]=v,e[31]=g,e[32]=Y):Y=e[32];const ve=N&&"opacity-50 pointer-events-none";let ue;e[33]!==ve?(ue=J("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=ue):ue=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Ae;e[35]!==L?(Ae=V=>{if(V.type==="group")return L(V.key,V.title,V.icon,null,V.connections);const X=V.connection;return L(X.id,X.title,X.icon,X.description??null,[X])},e[35]=L,e[36]=Ae):Ae=e[36];const mt=F.map(Ae);let Te;e[37]!==se?(Te=n.jsx("div",{ref:se,className:"col-span-full h-1"}),e[37]=se,e[38]=Te):Te=e[38];let Ie;e[39]!==M?(Ie=M&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),e[39]=M,e[40]=Ie):Ie=e[40];const pt=W&&Z.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx(vt,{size:13,className:"text-muted-foreground shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),gt=W&&Z.map(ae),ht=W&&ee.length>0&&n.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[n.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),n.jsx("div",{className:"flex-1 h-px bg-border"})]}),xt=W&&ee.map(ae);let Be;e[41]!==z||e[42]!==$||e[43]!==W?(Be=W&&$.length>0&&n.jsx("div",{ref:z,className:"col-span-full h-1"}),e[41]=z,e[42]=$,e[43]=W,e[44]=Be):Be=e[44];let Fe;e[45]!==H.isLoadingMore||e[46]!==W?(Fe=W&&H.isLoadingMore&&n.jsx("div",{className:"col-span-full flex justify-center py-6",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),e[45]=H.isLoadingMore,e[46]=W,e[47]=Fe):Fe=e[47];let Pe;e[48]!==mt||e[49]!==Te||e[50]!==Ie||e[51]!==pt||e[52]!==gt||e[53]!==ht||e[54]!==xt||e[55]!==Be||e[56]!==Fe?(Pe=n.jsxs("div",{className:De,children:[mt,Te,Ie,pt,gt,ht,xt,Be,Fe]}),e[48]=mt,e[49]=Te,e[50]=Ie,e[51]=pt,e[52]=gt,e[53]=ht,e[54]=xt,e[55]=Be,e[56]=Fe,e[57]=Pe):Pe=e[57];let Ee;e[58]!==k||e[59]!==F.length||e[60]!==ee||e[61]!==f||e[62]!==g||e[63]!==Z?(Ee=F.length===0&&Z.length===0&&ee.length===0&&n.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:f?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:f}):g(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=F.length,e[60]=ee,e[61]=f,e[62]=g,e[63]=Z,e[64]=Ee):Ee=e[64];let Ve;e[65]!==ue||e[66]!==Pe||e[67]!==Ee?(Ve=n.jsxs("div",{className:ue,children:[Pe,Ee]}),e[65]=ue,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Je;return e[69]!==Y||e[70]!==Ve?(Je=n.jsxs(n.Fragment,{children:[Y,Ve]}),e[69]=Y,e[70]=Ve,e[71]=Je):Je=e[71],Je}function ti(t){return!t.verified&&!it(t._meta)?.verified&&!t.meta?.verified}function si(t){return t.verified||it(t._meta)?.verified||t.meta?.verified}function ni(t){return t.app_name}function oi(t){return t.app_name}function ii(t){return t?.items??[]}function ri(t,e){if(t?.hasMore)return e.reduce(ai,0)}function ai(t,e){return t+(e?.items?.length??0)}function li(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function ha({open:t,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const r=Q(),i=a.mode??"add",c="agentId"in a?a.agentId:void 0,l="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,f="onAdd"in a&&a.onAdd?a.onAdd:S=>{},u=(S,A,T)=>{c&&oe("agent_connection_attached",{agent_id:c,connection_id:S,app_name:A,mode:T})},[m,d]=G.useState(null),[p,h]=G.useState(o),[g,x]=G.useState(!1),[j,N]=G.useState(t);t!==j&&(N(t),t&&h(o));const{org:y}=le(),{data:v}=Dt.useSession(),C=ks(),k=at(),D=ns(),b=S=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:S}})},w=()=>{k.invalidateQueries({predicate:S=>{const A=S.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},_=async(S,A)=>{oe("connection_oauth_succeeded",{connection_id:S,flow:A});const T=new URL(`/api/${y.slug}/mcp/${S}`,window.location.origin);await k.invalidateQueries({queryKey:fe.isMCPAuthenticated(T.href,null)}),w()},I=async S=>{d(S.app_name??S.id);try{const T=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,E=(await C.create.mutateAsync({title:T,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,B=await Ct({connectionId:E,orgId:y.id,orgSlug:y.slug,persistFallback:M=>C.update.mutateAsync({id:E,data:{connection_token:M}}).then(()=>{})});if(B.ran&&!B.ok){oe("connection_oauth_failed",{connection_id:E,flow:"clone",error:B.error??"no_token"}),de.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await C.delete.mutateAsync(E);return}B.ran&&await _(E,"clone"),u(E,S.app_name??null,"clone"),f(E)}catch(A){console.error("Failed to add connection:",A),de.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},P=async S=>{if(!(!y||!v?.user?.id)){d(S.id);try{const A=Rn(S,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",R=!!A.connection_url,E=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!R&&!E){de.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:B}=await C.create.mutateAsync(A),M=await Ct({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:q=>C.update.mutateAsync({id:B,data:{connection_token:q}}).then(()=>{})});if(M.ran&&!M.ok){oe("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:M.error??"no_token"}),de.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:M.error??"no token received"})}),u(B,A.app_name??null,"new"),f(B);return}M.ran?(await _(B,"connect_new"),de.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):de.success(r("virtualMcp.addConnectionDialog.connected")),u(B,A.app_name??null,"new"),f(B)}catch(A){console.error("Failed to connect:",A),de.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return n.jsxs(bs,{open:t,onOpenChange:e,children:[n.jsxs(ys,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[n.jsx(vs,{className:"px-6 pt-5 pb-0 shrink-0",children:n.jsx(Cs,{className:"text-base font-semibold",children:r(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),n.jsx("div",{className:"pt-3 shrink-0",children:n.jsx($n,{value:p,onChange:h,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),n.jsx(G.Suspense,{fallback:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Qe,{className:"size-6 text-muted-foreground"})}),children:n.jsx(ei,{mode:i,agentId:c,addedConnectionIds:l,onAdd:f,onCloneAndAdd:I,onConnectAndAdd:P,connectingItemId:m,search:p,onCreateConnection:()=>x(!0),onBrowseNavigate:b,defaultTab:s})})]}),n.jsx(Zo,{open:g,onOpenChange:x,onCreated:async S=>{x(!1);const A=await Ct({connectionId:S,orgId:y.id,orgSlug:y.slug,persistFallback:T=>C.update.mutateAsync({id:S,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){oe("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:A.error??"no_token"}),de.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),u(S,null,"custom"),f(S),e(!1);return}A.ran&&await _(S,"custom_create"),u(S,null,"custom"),f(S),e(!1)}})]})}const Wt=new Map;function xa(){const{org:t}=le(),e=At(),s=lo(),o=s.find(x=>x.providerId==="deco"),{data:a,isLoading:r,refetch:i,isFetching:c}=lt({queryKey:fe.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=a?.balanceCents??null,f=l!=null?l/100:null,u=G.useRef(new Map);if(l!=null){const x=Wt.get(t.id);u.current.get(t.id)&&x!=null&&l>x&&oe("credits_topped_up_detected",{organization_id:t.id,delta_cents:l-x,previous_balance_cents:x,new_balance_cents:l}),Wt.set(t.id,l),u.current.set(t.id,!0)}const m=!!o,d=l!=null&&l>0,p=l!=null&&l===0,h=l!=null&&l===200,g=s.length>0&&s.every(x=>x.providerId==="deco");return{hasDecoKey:m,decoKeyId:o?.id??null,balanceCents:l,balanceDollars:f,hasCredits:d,isZeroBalance:p,isInitialFreeCredit:h,hasOnlyDecoProvider:g,isLoading:r,isFetching:c,refetch:i}}const ci=4,di="TASK";function ui(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,ci)||di}function fi(t,e){return e==null?null:`${ui(t)}-${String(e).padStart(2,"0")}`}const mi=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function pi(t){const e=mi.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Yt(t){const e=O.c(8),{size:s,className:o}=t,a=s===void 0?16:s;let r;e[0]!==a?(r={width:a,height:a},e[0]=a,e[1]=r):r=e[1];let i;e[2]!==o?(i=J("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==r||e[6]!==i?(c=n.jsx("img",{src:bn,alt:"Super Agent",width:a,height:a,style:r,className:i}),e[4]=a,e[5]=r,e[6]=i,e[7]=c):c=e[7],c}const Xe=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],gi=["overview","reports","board","site-editor"],Mt=1,hi=["assets","hosting","e2e","analytics","cdn"];function ja(t,e,s){if(!t)return{project:s??null,resolvedScopeId:null};const o=e?.id===t?e:s?.id===t?s:null;return{project:o,resolvedScopeId:o?t:null}}function ba(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function Bs(t,e){const s=new Set(t??[]);if(e!==Mt)for(const o of gi)s.add(o);return Xe.filter(o=>s.has(o))}function xi(t){return Xe.some(e=>e===t)}function ji(t){return hi.some(e=>e===t)}function bi(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function ya(t,e,s){const o=bi(e,s);return t?o:{...o,overview:!0,reports:!0,board:!0}}function va(t,e,s){const o=new Set(Bs(t,s));return Xe.filter(a=>e[a]&&o.has(a))}function Ca(t,e,s){return s||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ka(t){return Xe.filter(e=>t[e])}function yi(t,e,s){return!xi(t)||e[t]?!1:ji(t)?!(t==="assets"?s.assets:s.siteAccess):!0}function Na(t,e,s,o,a){return yi(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,s)||t==="content"&&!o.includes("content")||t==="code"&&a&&!o.includes("code")}function Sa(t,e,s,o){const a=new Set(Bs(t,o));return s?a.add(e):a.delete(e),Xe.filter(r=>a.has(r))}function We(t,e){return fe.optimisticProjectSidebarViews(t,e)}function st(t){return typeof t=="object"&&t!==null}function Fs(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function vi(t,e){if(!st(t))return t;if("item"in t&&st(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!st(t.structuredContent))return t;const s=t.structuredContent.items;if(!Array.isArray(s))return t;let o=!1;const a=s.map(r=>!st(r)||r.id!==e.id?r:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:a}}:t}function wa(t,e,s){t.setQueriesData({predicate:o=>Fs(o.queryKey,e)},o=>vi(o,s))}function _a(t,e,s){const o=t.getQueriesData({predicate:a=>Fs(a.queryKey,e)&&a.queryKey[5]===s});for(const[,a]of o)if(a?.item?.id===s)return a.item;return null}function Lt(t,e,s){return t.getQueryData(We(e,s))??null}function Ci(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Mt};const s=t?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function Da(t,e,s){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Mt}:s===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:Ci(s,null)}function ki(t,e,s,o,a){const r=Lt(t,e,s),i={revision:(r?.revision??0)+1,views:[...o],rollbackViews:r?[...r.rollbackViews]:[...a]};return t.setQueryData(We(e,s),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function Ni(t,e,s){const o=Lt(t,e,s);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function Ps(t,e){const s=new Set(t),o=new Set(e);return s.size===o.size&&[...s].every(a=>o.has(a))}function Aa(t){return t?!Ps(t.views,t.persistedViews):!1}function Si(t,e,s,{snapshot:o,saved:a,authoritativeViews:r}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=Lt(t,e,s);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const c=r!==void 0?[...r]:a?[...o.views]:null,l={...i,rollbackViews:c??i.rollbackViews};return l.rollbackViews!==i.rollbackViews&&t.setQueryData(We(e,s),l),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(We(e,s),null),{settledLatest:!0,reconciledViews:a?c&&!Ps(c,o.views)?c:null:[...l.rollbackViews]})}function Ta(t){const e=O.c(5),{org:s}=le(),o=t??"";let a;e[0]!==s.id||e[1]!==o?(a=We(s.id,o),e[0]=s.id,e[1]=o,e[2]=a):a=e[2];let r;e[3]!==a?(r={queryKey:a,queryFn:wi,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=a,e[4]=r):r=e[4];const{data:i}=lt(r);return i?.views}async function wi(){return null}function Ia(t){const e=O.c(4),{org:s}=le(),o=at();let a;return e[0]!==s||e[1]!==o||e[2]!==t?(a={stage:(r,i)=>ki(o,s.id,t,r,i),snapshot:()=>Ni(o,s.id,t),settle:r=>Si(o,s.id,t,r)},e[0]=s,e[1]=o,e[2]=t,e[3]=a):a=e[3],a}function _i(t,e){if(!e)return null;const s=e.toLowerCase();return t.find(o=>{const a=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===s||a===s||a===`deco-assets-${s}`})??null}function Ba(t){const e=O.c(10),{org:s}=le(),o=Zs(),a=uo(),r=co(),i=fo(t),c=o.hostingEnabled===!0,l=o.monitorEnabled===!0||o.auth.localMode===!0,f=(c||l)&&!!i,u=lt({queryKey:fe.hostingAccess(s.slug,i??""),queryFn:async()=>{const C=await fetch(`/api/${s.slug}/hosting/${encodeURIComponent(i??"")}/access`);return C.ok?await C.json():{owned:!1,canWrite:!1}},enabled:f,staleTime:6e4}),m=u.data?.owned===!0,d=!!_i(r.data?.configs??[],i),p=c&&m&&a.hosting,h=c&&m&&a.e2e,g=c&&m&&a.analytics,x=l&&m&&a.monitor;let j;e[0]!==d||e[1]!==p||e[2]!==h||e[3]!==g||e[4]!==x?(j={assets:d,hosting:p,e2e:h,analytics:g,cdn:x},e[0]=d,e[1]=p,e[2]=h,e[3]=g,e[4]=x,e[5]=j):j=e[5];const N=!!i&&r.isPending,y=f&&u.isPending;let v;return e[6]!==j||e[7]!==N||e[8]!==y?(v={presence:j,assetsPending:N,siteAccessPending:y},e[6]=j,e[7]=N,e[8]=y,e[9]=v):v=e[9],v}const Xt=()=>0;function Di(t){const{orgSlug:e,enabled:s=!0,onUpdate:o,onDelete:a,onResync:r}=t,i=G.useRef(o);i.current=o;const c=G.useRef(a);c.current=a;const l=G.useRef(r);l.current=r;const f=G.useRef(null),u=G.useRef(s),m=G.useRef(e);(!f.current||u.current!==s||m.current!==e)&&(u.current=s,m.current=e,f.current=p=>{if(!s||!e)return()=>{};const h=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===mo?c.current?.(x.data.id):i.current(x.data)),p()};return ho.subscribe(e,h,()=>l.current?.())}),G.useSyncExternalStore(f.current,Xt,Xt)}function Ai(t,e){return{queryKey:fe.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:s}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:s}}}}function Ti(){const t=O.c(21),{org:e,locator:s}=le(),o=at();let a;t[0]!==s?(a=fe.taskBoardItems(s),t[0]=s,t[1]=a):a=t[1];const r=a;let i;t[2]!==s||t[3]!==o||t[4]!==r?(i=d=>{o.cancelQueries({queryKey:r}),o.setQueryData(r,p=>p&&{...p,items:p.items.some(h=>h.id===d.id)?p.items.map(h=>h.id===d.id?d:h):[d,...p.items]}),o.invalidateQueries({queryKey:fe.taskBoardActivity(s,d.id)})},t[2]=s,t[3]=o,t[4]=r,t[5]=i):i=t[5];let c,l;t[6]!==o||t[7]!==r?(c=()=>{o.invalidateQueries({queryKey:r})},l=d=>{o.cancelQueries({queryKey:r}),o.setQueryData(r,p=>p&&{...p,items:p.items.filter(h=>h.id!==d)})},t[6]=o,t[7]=r,t[8]=c,t[9]=l):(c=t[8],l=t[9]);let f;t[10]!==e.slug||t[11]!==i||t[12]!==c||t[13]!==l?(f={orgSlug:e.slug,onUpdate:i,onResync:c,onDelete:l},t[10]=e.slug,t[11]=i,t[12]=c,t[13]=l,t[14]=f):f=t[14],Di(f);let u;t[15]!==o||t[16]!==r?(u=d=>{const p=d.subject,h=d.data.status;o.cancelQueries({queryKey:r}),o.setQueryData(r,g=>g&&{...g,items:g.items.map(x=>x.threads.some(j=>j.threadId===p)?{...x,threads:x.threads.map(j=>j.threadId===p?{...j,status:h}:j)}:x)})},t[15]=o,t[16]=r,t[17]=u):u=t[17];let m;t[18]!==e.slug||t[19]!==u?(m={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=m):m=t[20],xo(m)}function Fa(){const t=O.c(9),{locator:e}=le(),s=At();let o;t[0]!==e||t[1]!==s?(o=Ai(e,s),t[0]=e,t[1]=s,t[2]=o):o=t[2];const a=lt(o);Ti();let r;t[3]!==a.data?.items?(r=a.data?.items??[],t[3]=a.data?.items,t[4]=r):r=t[4];let i;return t[5]!==a.error||t[6]!==a.isLoading||t[7]!==r?(i={items:r,isLoading:a.isLoading,error:a.error},t[5]=a.error,t[6]=a.isLoading,t[7]=r,t[8]=i):i=t[8],i}function Pa(){const t=O.c(70),{org:e,locator:s}=le(),o=At(),a=at(),r=Q();let i;t[0]!==s?(i=fe.taskBoardItems(s),t[0]=s,t[1]=i):i=t[1];const c=i;let l;t[2]!==a||t[3]!==c?(l=()=>a.invalidateQueries({queryKey:c}),t[2]=a,t[3]=c,t[4]=l):l=t[4];const f=l;let u;t[5]!==o?(u=F=>o.call("TASK_BOARD_ITEM_CREATE",F),t[5]=o,t[6]=u):u=t[6];let m;t[7]!==f||t[8]!==u?(m={mutationFn:u,onSuccess:f},t[7]=f,t[8]=u,t[9]=m):m=t[9];const d=Oe(m);let p;t[10]!==o?(p=F=>o.call("TASK_BOARD_ITEM_UPDATE",F),t[10]=o,t[11]=p):p=t[11];let h;t[12]!==a||t[13]!==c?(h=async F=>{await a.cancelQueries({queryKey:c});const U=a.getQueryData(c);return a.setQueryData(c,$=>$&&{...$,items:$.items.map(H=>H.id===F.id?{...H,...F}:H)}),{previous:U}},t[12]=a,t[13]=c,t[14]=h):h=t[14];let g;t[15]!==e?(g=(F,U)=>{U.status==="done"&&oe("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==a||t[18]!==c?(x=(F,U,$)=>{$?.previous&&a.setQueryData(c,$.previous)},t[17]=a,t[18]=c,t[19]=x):x=t[19];let j;t[20]!==f||t[21]!==s||t[22]!==a?(j=(F,U,$)=>{f(),a.invalidateQueries({queryKey:fe.taskBoardActivity(s,$.id)})},t[20]=f,t[21]=s,t[22]=a,t[23]=j):j=t[23];let N;t[24]!==p||t[25]!==h||t[26]!==g||t[27]!==x||t[28]!==j?(N={mutationFn:p,onMutate:h,onSuccess:g,onError:x,onSettled:j},t[24]=p,t[25]=h,t[26]=g,t[27]=x,t[28]=j,t[29]=N):N=t[29];const y=Oe(N);let v;t[30]!==o?(v=F=>o.call("TASK_BOARD_ITEM_DELETE",{id:F}),t[30]=o,t[31]=v):v=t[31];let C;t[32]!==f||t[33]!==r?(C=F=>{de.error(F instanceof Error&&F.message?F.message:r("taskBoard.taskBoard.deleteError")),f()},t[32]=f,t[33]=r,t[34]=C):C=t[34];let k;t[35]!==f||t[36]!==v||t[37]!==C?(k={mutationFn:v,onSuccess:f,onError:C},t[35]=f,t[36]=v,t[37]=C,t[38]=k):k=t[38];const D=Oe(k);let b;t[39]!==o?(b=async F=>{const U=await Promise.allSettled(F.map($=>o.call("TASK_BOARD_ITEM_DELETE",{id:$})));return{total:F.length,failed:U.filter(Ii).length}},t[39]=o,t[40]=b):b=t[40];let w,_;t[41]!==r?(w=F=>{const{total:U,failed:$}=F;$!==0&&de.error(r("taskBoard.taskBoard.deleteBulkError",{failed:String($),total:String(U)}))},_=()=>de.error(r("taskBoard.taskBoard.deleteError")),t[41]=r,t[42]=w,t[43]=_):(w=t[42],_=t[43]);let I;t[44]!==f||t[45]!==b||t[46]!==w||t[47]!==_?(I={mutationFn:b,onSuccess:w,onError:_,onSettled:f},t[44]=f,t[45]=b,t[46]=w,t[47]=_,t[48]=I):I=t[48];const P=Oe(I);let S;t[49]!==o?(S=F=>o.call("TASK_BOARD_ITEM_UPDATE",F),t[49]=o,t[50]=S):S=t[50];let A;t[51]!==f||t[52]!==S?(A={mutationFn:S,onSuccess:f},t[51]=f,t[52]=S,t[53]=A):A=t[53];const T=Oe(A);let R;t[54]!==o?(R=F=>o.call("TASK_BOARD_ITEM_RERUN",F),t[54]=o,t[55]=R):R=t[55];let E;t[56]!==f||t[57]!==s||t[58]!==a?(E=(F,U,$)=>{f(),a.invalidateQueries({queryKey:fe.taskBoardActivity(s,$.id)})},t[56]=f,t[57]=s,t[58]=a,t[59]=E):E=t[59];let B;t[60]!==R||t[61]!==E?(B={mutationFn:R,onSettled:E},t[60]=R,t[61]=E,t[62]=B):B=t[62];const M=Oe(B);let q;return t[63]!==d||t[64]!==T||t[65]!==D||t[66]!==P||t[67]!==M||t[68]!==y?(q={create:d,update:y,remove:D,removeMany:P,link:T,rerun:M},t[63]=d,t[64]=T,t[65]=D,t[66]=P,t[67]=M,t[68]=y,t[69]=q):q=t[69],q}function Ii(t){return t.status==="rejected"}const Bi=["ended_after_delivery","superseded"];function Fi(t){return!!t&&Bi.includes(t)}function Ea(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function Va(t){return t.failureKind!=="superseded"}function Es(t){return t.threads.some(e=>e.status==="requires_action")}function $a(t){return t.status==="in_review"&&!t.assigneeId}function Oa(t){return Es(t)}function Ma(t){return t.status==="in_progress"&&Es(t)?"text-warning animate-pulse":$s(t.status).iconClassName}function La(t){return t.threads.some(s=>s.status==="in_progress")?"running":t.threads.some(s=>s.status==="failed"&&!Fi(s.failureKind))?"failed":null}function Ra(t,e,s){const o=t.findIndex(u=>u.id===s),a=e===s?t[o+1]?.id??null:e,r=t.filter(u=>u.id!==s),i=a?r.findIndex(u=>u.id===a):-1,c=i===-1?r.length:i,l=r[c-1],f=r[c];return l&&f?(l.sortOrder+f.sortOrder)/2:l?l.sortOrder+1:f?f.sortOrder-1:0}function Ka(t,e){return Array.from({length:e},(s,o)=>t-(e-1-o)*1e-4)}const Pi=["archived"],Vs={triage:{labelKey:"taskBoard.config.statusBacklog",icon:yo,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:As,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:dn,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Co,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:cn,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Xn,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ln,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:vo,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:en,iconClassName:"text-muted-foreground"}},Ei={icon:As,iconClassName:"text-muted-foreground"},Vi=Vs;function $s(t){return Vi[t]??Ei}function za(t,e){const s=Vs[t];return{label:s?e(s.labelKey):t,visual:$s(t)}}const Ua=["bug","feature","chore","spike","security"],Ga={bug:{labelKey:"taskBoard.config.typeBug",icon:No,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:mn,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:fn,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:un,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:ko,iconClassName:"text-purple-500"}};function St(t){return go.includes(t)}function Ha(t){return Pt.filter(e=>t||!St(e))}function Qa({deliveryEnabled:t,shownLanes:e,occupied:s}){const o=Pt.filter(i=>t||!St(i)||s.includes(i)),a=o.filter(i=>Pi.includes(i)||!t&&St(i)),r=a.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!r.includes(i)),hidden:r,hideable:a}}const Jt="lane:";function $i(t){return Pt.includes(t)}function qa({overId:t,statusOf:e}){if(t===void 0)return null;const s=String(t),o=s.startsWith(Jt)?s.slice(Jt.length):e(s);return o!==void 0&&$i(o)?o:null}const Oi=["none","low","medium","high","urgent"],nt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Kt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:an,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Kt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:rn,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:on,iconClassName:"text-destructive"}};function Wa(t,e=Date.now()){const s=new Date(t).getTime();return Number.isNaN(s)?null:s<e?"overdue":s-e<=Mi*864e5?"soon":null}const Mi=3;function Zt(t){return`color-mix(in oklab, ${t??po} var(--user-color-strength), transparent)`}function Os(t){return t?.projects.length===1?t.projects[0]:void 0}function Li(t){return Os(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Ms(t){const e=O.c(6),{entry:s}=t;let o;e[0]!==s?(o=Os(s),e[0]=s,e[1]=o):o=e[1];const a=o;if(a){let i;return e[2]!==a.icon||e[3]!==a.title?(i=n.jsx(En,{icon:a.icon,name:a.title}),e[2]=a.icon,e[3]=a.title,e[4]=i):i=e[4],i}let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(ms,{className:"size-3"})}),e[5]=r):r=e[5],r}function Ri(t){const e=O.c(14),{entry:s}=t;let o;e[0]!==s?(o=Li(s),e[0]=s,e[1]=o):o=e[1];const a=o;let r;e[2]!==s?(r=n.jsx(Ms,{entry:s}),e[2]=s,e[3]=r):r=e[3];let i;e[4]!==s.title?(i=n.jsx("span",{className:"truncate",children:s.title}),e[4]=s.title,e[5]=i):i=e[5];let c;e[6]!==a?(c=a&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:a}),e[6]=a,e[7]=c):c=e[7];let l;e[8]!==i||e[9]!==c?(l=n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10];let f;return e[11]!==r||e[12]!==l?(f=n.jsxs(n.Fragment,{children:[r,l]}),e[11]=r,e[12]=l,e[13]=f):f=e[13],f}const ut="__no_repo__";function we(t){return(t??"").trim().toLowerCase()}function Ki(t,e){const s=(t.created_at??"").localeCompare(e.created_at??"");return s!==0?s:t.id.localeCompare(e.id)}function zi(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Ya(t,e=[]){const s=new Map,o=new Map,a=[],r=u=>{const m=we(u),d=s.get(m);if(d)return d;const p={id:m,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return s.set(m,p),p};for(const u of t){const m=Cn(u);if(m){const p=r(m);p.projects.push(u),o.set(u.id,p);continue}const d={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};a.push(d),o.set(u.id,d)}for(const u of e){const m=(u??"").trim();m&&r(m)}for(const u of s.values())u.projects.sort(Ki),u.title=zi(u);const i=[...s.values()].filter(u=>u.projects.length>0),c=[...s.values()].filter(u=>u.projects.length===0),l=(u,m)=>u.title.localeCompare(m.title),f=[...[...i,...a].sort(l),...c.sort(l)];return{entries:f,byId:new Map(f.map(u=>[u.id,u])),byRepo:s,byProject:o}}function wt(t,e){for(const o of t.threads??[]){const a=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(a)return a}const s=we(t.repo);return(s?e.byRepo.get(s):void 0)??null}function Ui(t,e){const s=wt(t,e);if(!s)return[];if(s.projects.length<=1)return s.projects;for(const o of t.threads??[]){const a=o.virtualMcpId?s.projects.find(r=>r.id===o.virtualMcpId):void 0;if(a)return[a]}return s.projects}function Xa(t,e){const s=Ui(t,e);return s.length===1?s[0]??null:null}function Rt(t,e){return e.byId.get(t)??e.byRepo.get(we(t))??e.byProject.get(t)}function Ls(t,e,s){if(e===null)return!0;if(e===ut)return wt(t,s)===null;const o=Rt(e,s);return o?o.repo&&we(t.repo)===we(o.repo)?!0:wt(t,s)===o:e.includes("/")?we(t.repo)===we(e):!0}function ft(t,e){return t===null?!1:t===ut?!0:!!Rt(t,e)||t.includes("/")}function Ja(t,e,s){return e===null?null:Ls(t,e,s)?e:null}function Za(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(s=>kn(s).status!=="detached")))}const _t="__unassigned__",ze="__any__",Rs={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Gi(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||ft(t.project,e)||t.search.trim()!==""}function Hi(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(ft(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const Qi=864e5;function qi(t,e){const s=new Date(t),o=new Date(e);return s.getFullYear()===o.getFullYear()&&s.getMonth()===o.getMonth()&&s.getDate()===o.getDate()}function Ks(t,e){const s=t.trim();return s===""?!1:e!=null&&pi(s)===e}function Wi(t,e){return t.assigneeId===e?!0:t.assigneeId===Nt&&t.assignedBy===e}function el(t,e,s){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!Ks(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===_t){if(t.assigneeId!==null)return!1}else if(!Wi(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const a=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&a>=r||e.due==="today"&&!qi(a,r)||e.due==="week"&&(a<r||a>r+7*Qi))return!1}if(e.tags.length>0){const a=t.tags.map(r=>r.id);if(!e.tags.some(r=>a.includes(r)))return!1}return!!Ls(t,e.project,s)}const es={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function _e(t,e=!1){return J("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Yi(t){const e=O.c(107),{value:s,members:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Qt,{size:14,className:"shrink-0"}),e[0]=f):f=e[0];let u=f,m;e[1]!==i?(m=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=m):m=e[2];let d=m;if(s===_t){let L;e[3]!==i?(L=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=L):L=e[4],d=L}else if(s===Nt){let L;e[5]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Yt,{size:14}),e[5]=L):L=e[5],u=L;let K;e[6]!==i?(K=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=K):K=e[7],d=K}else if(s){let L,K,ae,Y;if(e[8]!==o||e[9]!==s){let De;e[14]!==s?(De=Ae=>Ae.userId===s,e[14]=s,e[15]=De):De=e[15],K=o.find(De),L=Ht,ae=K?.user?.image??void 0,Y=qt(K?.user?.name),e[8]=o,e[9]=s,e[10]=L,e[11]=K,e[12]=ae,e[13]=Y}else L=e[10],K=e[11],ae=e[12],Y=e[13];let ve;e[16]!==L||e[17]!==ae||e[18]!==Y?(ve=n.jsx(L,{url:ae,fallback:Y,shape:"circle",size:"2xs"}),e[16]=L,e[17]=ae,e[18]=Y,e[19]=ve):ve=e[19],u=ve;let ue;e[20]!==K?.user?.name||e[21]!==i?(ue=K?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=K?.user?.name,e[21]=i,e[22]=ue):ue=e[22],d=ue}let p;e[23]!==a?(p=L=>{a(L),l(!1)},e[23]=a,e[24]=p):p=e[24];const h=p,g=s!==null;let x;e[25]!==r||e[26]!==g?(x=_e(g,r),e[25]=r,e[26]=g,e[27]=x):x=e[27];const j=x,N=r&&"ml-auto";let y;e[28]!==N?(y=J("shrink-0 opacity-60",N),e[28]=N,e[29]=y):y=e[29];const v=y;let C;e[30]!==d?(C=n.jsx("span",{className:"max-w-[10rem] truncate",children:d}),e[30]=d,e[31]=C):C=e[31];let k;e[32]!==v?(k=n.jsx(Ge,{size:12,className:v}),e[32]=v,e[33]=k):k=e[33];let D;e[34]!==u||e[35]!==C||e[36]!==k||e[37]!==j?(D=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:j,children:[u,C,k]})}),e[34]=u,e[35]=C,e[36]=k,e[37]=j,e[38]=D):D=e[38];let b;e[39]!==i?(b=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=b):b=e[40];let w;e[41]!==i?(w=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=w):w=e[42];let _;e[43]!==b||e[44]!==w?(_=n.jsx(Et,{placeholder:b,"aria-label":w,className:"h-9"}),e[43]=b,e[44]=w,e[45]=_):_=e[45];let I;e[46]!==i?(I=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=I):I=e[47];let P;e[48]!==I?(P=n.jsx(Vt,{children:I}),e[48]=I,e[49]=P):P=e[49];let S;e[50]!==i?(S=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=S):S=e[51];let A;e[52]!==h?(A=()=>h(null),e[52]=h,e[53]=A):A=e[53];let T;e[54]!==i?(T=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=T):T=e[55];let R;e[56]!==S||e[57]!==A||e[58]!==T?(R=n.jsx(Ce,{value:S,onSelect:A,children:T}),e[56]=S,e[57]=A,e[58]=T,e[59]=R):R=e[59];let E;e[60]!==i?(E=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=E):E=e[61];let B;e[62]!==h?(B=()=>h(_t),e[62]=h,e[63]=B):B=e[63];let M;e[64]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(Qt,{size:16,className:"text-muted-foreground"}),e[64]=M):M=e[64];let q;e[65]!==i?(q=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=q):q=e[66];let F;e[67]!==E||e[68]!==B||e[69]!==q?(F=n.jsxs(Ce,{value:E,onSelect:B,className:"gap-2",children:[M,q]}),e[67]=E,e[68]=B,e[69]=q,e[70]=F):F=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let $;e[73]!==h?($=()=>h(Nt),e[73]=h,e[74]=$):$=e[74];let H;e[75]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(Yt,{size:16}),e[75]=H):H=e[75];let z;e[76]!==i?(z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=z):z=e[77];let se;e[78]!==U||e[79]!==$||e[80]!==z?(se=n.jsxs(Ce,{value:U,onSelect:$,className:"gap-2",children:[H,z]}),e[78]=U,e[79]=$,e[80]=z,e[81]=se):se=e[81];let W;e[82]!==R||e[83]!==F||e[84]!==se?(W=n.jsxs(Ke,{children:[R,F,se]}),e[82]=R,e[83]=F,e[84]=se,e[85]=W):W=e[85];let ie;e[86]!==i?(ie=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ie):ie=e[87];let Z;if(e[88]!==o||e[89]!==h){let L;e[91]!==h?(L=K=>n.jsxs(Ce,{value:K.user?.name??K.userId,onSelect:()=>h(K.userId),className:"gap-2",children:[n.jsx(Ht,{url:K.user?.image??void 0,fallback:qt(K.user?.name),shape:"circle",size:"2xs"}),n.jsx("span",{className:"truncate",children:K.user?.name??K.userId})]},K.userId),e[91]=h,e[92]=L):L=e[92],Z=o.map(L),e[88]=o,e[89]=h,e[90]=Z}else Z=e[90];let ee;e[93]!==ie||e[94]!==Z?(ee=n.jsx(Ke,{heading:ie,children:Z}),e[93]=ie,e[94]=Z,e[95]=ee):ee=e[95];let te;e[96]!==P||e[97]!==W||e[98]!==ee?(te=n.jsxs($t,{children:[P,W,ee]}),e[96]=P,e[97]=W,e[98]=ee,e[99]=te):te=e[99];let ne;e[100]!==_||e[101]!==te?(ne=n.jsx(dt,{align:"start",className:"w-56 p-0",children:n.jsxs(Ot,{children:[_,te]})}),e[100]=_,e[101]=te,e[102]=ne):ne=e[102];let re;return e[103]!==c||e[104]!==D||e[105]!==ne?(re=n.jsxs(ct,{open:c,onOpenChange:l,children:[D,ne]}),e[103]=c,e[104]=D,e[105]=ne,e[106]=re):re=e[106],re}function Xi(t){const e=O.c(33),{value:s,onChange:o,block:a}=t,r=Q(),i=s!==null;let c;e[0]!==a||e[1]!==i?(c=_e(i,a),e[0]=a,e[1]=i,e[2]=c):c=e[2];const l=c,f=a&&"ml-auto";let u;e[3]!==f?(u=J("shrink-0 opacity-60",f),e[3]=f,e[4]=u):u=e[4];const m=u;let d;e[5]!==s?(d=s?n.jsx("span",{className:J("size-2 shrink-0 rounded-full",nt[s].dotClassName)}):n.jsx(jo,{size:14,className:"shrink-0"}),e[5]=s,e[6]=d):d=e[6];let p;e[7]!==r||e[8]!==s?(p=r(s?nt[s].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=r,e[8]=s,e[9]=p):p=e[9];let h;e[10]!==m?(h=n.jsx(Ge,{size:12,className:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==p||e[14]!==h||e[15]!==l?(g=n.jsx(Ss,{asChild:!0,children:n.jsxs("button",{type:"button",className:l,children:[d,p,h]})}),e[12]=d,e[13]=p,e[14]=h,e[15]=l,e[16]=g):g=e[16];const x=s??ze;let j;e[17]!==o?(j=D=>o(D===ze?null:D),e[17]=o,e[18]=j):j=e[18];let N;e[19]!==r?(N=r("taskBoard.taskFilters.priorityAnyPriority"),e[19]=r,e[20]=N):N=e[20];let y;e[21]!==N?(y=n.jsx(rt,{value:ze,children:N}),e[21]=N,e[22]=y):y=e[22];let v;e[23]!==r?(v=Oi.map(D=>n.jsxs(rt,{value:D,className:"gap-2",children:[n.jsx("span",{className:J("size-2 rounded-full",nt[D].dotClassName)}),r(nt[D].labelKey)]},D)),e[23]=r,e[24]=v):v=e[24];let C;e[25]!==j||e[26]!==y||e[27]!==v||e[28]!==x?(C=n.jsx(ws,{align:"start",className:"w-40",children:n.jsxs(_s,{value:x,onValueChange:j,children:[y,v]})}),e[25]=j,e[26]=y,e[27]=v,e[28]=x,e[29]=C):C=e[29];let k;return e[30]!==C||e[31]!==g?(k=n.jsxs(Ds,{children:[g,C]}),e[30]=C,e[31]=g,e[32]=k):k=e[32],k}function Ji(t){const e=O.c(35),{value:s,onChange:o,block:a}=t,r=Q();let i;e[0]!==r||e[1]!==s?(i=s?r(es[s]):void 0,e[0]=r,e[1]=s,e[2]=i):i=e[2];const c=i,l=s!==null;let f;e[3]!==a||e[4]!==l?(f=_e(l,a),e[3]=a,e[4]=l,e[5]=f):f=e[5];const u=f,m=a&&"ml-auto";let d;e[6]!==m?(d=J("shrink-0 opacity-60",m),e[6]=m,e[7]=d):d=e[7];const p=d;let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(bt,{size:14,className:"shrink-0"}),e[8]=h):h=e[8];let g;e[9]!==c||e[10]!==r?(g=c??r("taskBoard.taskFilters.dueDateLabel"),e[9]=c,e[10]=r,e[11]=g):g=e[11];let x;e[12]!==p?(x=n.jsx(Ge,{size:12,className:p}),e[12]=p,e[13]=x):x=e[13];let j;e[14]!==g||e[15]!==x||e[16]!==u?(j=n.jsx(Ss,{asChild:!0,children:n.jsxs("button",{type:"button",className:u,children:[h,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=j):j=e[17];const N=s??ze;let y;e[18]!==o?(y=_=>o(_===ze?null:_),e[18]=o,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(bt,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let C;e[21]!==r?(C=r("taskBoard.taskFilters.dueDateAnyTime"),e[21]=r,e[22]=C):C=e[22];let k;e[23]!==C?(k=n.jsxs(rt,{value:ze,className:"gap-2",children:[v,C]}),e[23]=C,e[24]=k):k=e[24];let D;e[25]!==r?(D=Object.entries(es).map(_=>{const[I,P]=_,S=I==="overdue";return n.jsxs(rt,{value:I,className:J("gap-2",S&&"text-destructive"),children:[n.jsx(bt,{size:16,className:J("shrink-0",S?"text-destructive":"text-muted-foreground")}),r(P)]},I)}),e[25]=r,e[26]=D):D=e[26];let b;e[27]!==N||e[28]!==y||e[29]!==k||e[30]!==D?(b=n.jsx(ws,{align:"start",className:"w-44",children:n.jsxs(_s,{value:N,onValueChange:y,children:[k,D]})}),e[27]=N,e[28]=y,e[29]=k,e[30]=D,e[31]=b):b=e[31];let w;return e[32]!==b||e[33]!==j?(w=n.jsxs(Ds,{children:[j,b]}),e[32]=b,e[33]=j,e[34]=w):w=e[34],w}function Zi(t){const e=O.c(56),{value:s,tags:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f;e[0]!==a||e[1]!==s?(f=E=>a(s.includes(E)?s.filter(B=>B!==E):[...s,E]),e[0]=a,e[1]=s,e[2]=f):f=e[2];const u=f;let m;e[3]!==i||e[4]!==o||e[5]!==s[0]||e[6]!==s.length?(m=s.length===0?i("taskBoard.taskFilters.tagsLabel"):s.length===1?o.find(E=>E.id===s[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:s.length}),e[3]=i,e[4]=o,e[5]=s[0],e[6]=s.length,e[7]=m):m=e[7];const d=m,p=s.length>0;let h;e[8]!==r||e[9]!==p?(h=_e(p,r),e[8]=r,e[9]=p,e[10]=h):h=e[10];const g=h,x=r&&"ml-auto";let j;e[11]!==x?(j=J("shrink-0 opacity-60",x),e[11]=x,e[12]=j):j=e[12];const N=j;let y;e[13]!==o||e[14]!==s[0]||e[15]!==s.length?(y=s.length===1?n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Zt(o.find(E=>E.id===s[0])?.color)}}):n.jsx(pn,{size:14,className:"shrink-0"}),e[13]=o,e[14]=s[0],e[15]=s.length,e[16]=y):y=e[16];let v;e[17]!==d?(v=n.jsx("span",{className:"max-w-[10rem] truncate",children:d}),e[17]=d,e[18]=v):v=e[18];let C;e[19]!==N?(C=n.jsx(Ge,{size:12,className:N}),e[19]=N,e[20]=C):C=e[20];let k;e[21]!==y||e[22]!==v||e[23]!==C||e[24]!==g?(k=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:g,children:[y,v,C]})}),e[21]=y,e[22]=v,e[23]=C,e[24]=g,e[25]=k):k=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let b;e[28]!==i?(b=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=b):b=e[29];let w;e[30]!==D||e[31]!==b?(w=n.jsx(Et,{placeholder:D,"aria-label":b,className:"h-9"}),e[30]=D,e[31]=b,e[32]=w):w=e[32];let _;e[33]!==i?(_=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=_):_=e[34];let I;e[35]!==_?(I=n.jsx(Vt,{children:_}),e[35]=_,e[36]=I):I=e[36];let P;if(e[37]!==o||e[38]!==u||e[39]!==s){let E;e[41]!==u||e[42]!==s?(E=B=>n.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Zt(B.color)}}),n.jsx("span",{className:"flex-1 truncate",children:B.name}),s.includes(B.id)&&n.jsx(qe,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=s,e[43]=E):E=e[43],P=o.map(E),e[37]=o,e[38]=u,e[39]=s,e[40]=P}else P=e[40];let S;e[44]!==P?(S=n.jsx(Ke,{children:P}),e[44]=P,e[45]=S):S=e[45];let A;e[46]!==I||e[47]!==S?(A=n.jsxs($t,{children:[I,S]}),e[46]=I,e[47]=S,e[48]=A):A=e[48];let T;e[49]!==w||e[50]!==A?(T=n.jsx(dt,{align:"start",className:"w-56 p-0",children:n.jsxs(Ot,{children:[w,A]})}),e[49]=w,e[50]=A,e[51]=T):T=e[51];let R;return e[52]!==c||e[53]!==k||e[54]!==T?(R=n.jsxs(ct,{open:c,onOpenChange:l,children:[k,T]}),e[52]=c,e[53]=k,e[54]=T,e[55]=R):R=e[55],R}function ts(t){const e=O.c(11),{entry:s,selected:o,onSelect:a}=t,r=s.id,i=s.title;let c;e[0]!==s.projects?(c=s.projects.map(er).join(" "),e[0]=s.projects,e[1]=c):c=e[1];const l=`${r} ${i} ${s.repo??""} ${c}`;let f;e[2]!==s?(f=n.jsx(Ri,{entry:s}),e[2]=s,e[3]=f):f=e[3];let u;e[4]!==o?(u=o&&n.jsx(qe,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let m;return e[6]!==a||e[7]!==l||e[8]!==f||e[9]!==u?(m=n.jsxs(Ce,{value:l,onSelect:a,className:"gap-2",children:[f,u]}),e[6]=a,e[7]=l,e[8]=f,e[9]=u,e[10]=m):m=e[10],m}function er(t){return t.title}function tr(t,e,s,o){return t===null||!s?o("taskBoard.taskFilters.projectLabel"):t===ut?o("taskBoard.taskFilters.projectNone"):e?.title??t}function sr(t){const e=O.c(90),{value:s,index:o,onChange:a,block:r}=t,i=Q(),[c,l]=G.useState(!1);let f,u,m,d,p,h,g,x,j,N,y,v,C,k;if(e[0]!==r||e[1]!==o||e[2]!==a||e[3]!==c||e[4]!==i||e[5]!==s){const I=s===null?void 0:Rt(s,o),P=ft(s,o),S=tr(s,I,P,i);let A;e[20]!==a?(A=Y=>{a(Y),l(!1)},e[20]=a,e[21]=A):A=e[21];const T=A,R=o.entries.filter(or),E=o.entries.filter(nr),B=_e(P,r),M=r&&"ml-auto";let q;e[22]!==M?(q=J("shrink-0 opacity-60",M),e[22]=M,e[23]=q):q=e[23];const F=q;d=ct,C=c,k=l;const U=P?I:void 0;let $;e[24]!==U?($=n.jsx(Ms,{entry:U}),e[24]=U,e[25]=$):$=e[25];let H;e[26]!==S?(H=n.jsx("span",{className:"max-w-[12rem] truncate",children:S}),e[26]=S,e[27]=H):H=e[27];let z;e[28]!==F?(z=n.jsx(Ge,{size:12,className:F}),e[28]=F,e[29]=z):z=e[29],e[30]!==$||e[31]!==H||e[32]!==z||e[33]!==B?(h=n.jsx(Ue,{asChild:!0,children:n.jsxs("button",{type:"button",className:B,children:[$,H,z]})}),e[30]=$,e[31]=H,e[32]=z,e[33]=B,e[34]=h):h=e[34],m=dt,y="start",v="w-72 p-0",u=Ot;let se;e[35]!==i?(se=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=se):se=e[36];let W;e[37]!==i?(W=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=W):W=e[38],e[39]!==se||e[40]!==W?(N=n.jsx(Et,{placeholder:se,"aria-label":W,className:"h-9"}),e[39]=se,e[40]=W,e[41]=N):N=e[41],f=$t;let ie;e[42]!==i?(ie=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ie):ie=e[43],e[44]!==ie?(p=n.jsx(Vt,{children:ie}),e[44]=ie,e[45]=p):p=e[45];let Z;e[46]!==i?(Z=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=Z):Z=e[47];let ee;e[48]!==T?(ee=()=>T(null),e[48]=T,e[49]=ee):ee=e[49];let te;e[50]!==i?(te=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=te):te=e[51];let ne;e[52]!==Z||e[53]!==ee||e[54]!==te?(ne=n.jsx(Ce,{value:Z,onSelect:ee,children:te}),e[52]=Z,e[53]=ee,e[54]=te,e[55]=ne):ne=e[55];let re;e[56]!==i?(re=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=re):re=e[57];let L;e[58]!==T?(L=()=>T(ut),e[58]=T,e[59]=L):L=e[59];let K;e[60]!==i?(K=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=K):K=e[61];let ae;e[62]!==re||e[63]!==L||e[64]!==K?(ae=n.jsx(Ce,{value:re,onSelect:L,children:K}),e[62]=re,e[63]=L,e[64]=K,e[65]=ae):ae=e[65],e[66]!==ne||e[67]!==ae?(g=n.jsxs(Ke,{children:[ne,ae]}),e[66]=ne,e[67]=ae,e[68]=g):g=e[68],x=R.length>0&&n.jsx(Ke,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:R.map(Y=>n.jsx(ts,{entry:Y,selected:I===Y,onSelect:()=>T(Y.id)},Y.id))}),j=E.length>0&&n.jsx(Ke,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:E.map(Y=>n.jsx(ts,{entry:Y,selected:I===Y,onSelect:()=>T(Y.id)},Y.id))}),e[0]=r,e[1]=o,e[2]=a,e[3]=c,e[4]=i,e[5]=s,e[6]=f,e[7]=u,e[8]=m,e[9]=d,e[10]=p,e[11]=h,e[12]=g,e[13]=x,e[14]=j,e[15]=N,e[16]=y,e[17]=v,e[18]=C,e[19]=k}else f=e[6],u=e[7],m=e[8],d=e[9],p=e[10],h=e[11],g=e[12],x=e[13],j=e[14],N=e[15],y=e[16],v=e[17],C=e[18],k=e[19];let D;e[69]!==f||e[70]!==p||e[71]!==g||e[72]!==x||e[73]!==j?(D=n.jsxs(f,{children:[p,g,x,j]}),e[69]=f,e[70]=p,e[71]=g,e[72]=x,e[73]=j,e[74]=D):D=e[74];let b;e[75]!==u||e[76]!==D||e[77]!==N?(b=n.jsxs(u,{children:[N,D]}),e[75]=u,e[76]=D,e[77]=N,e[78]=b):b=e[78];let w;e[79]!==m||e[80]!==b||e[81]!==y||e[82]!==v?(w=n.jsx(m,{align:y,className:v,children:b}),e[79]=m,e[80]=b,e[81]=y,e[82]=v,e[83]=w):w=e[83];let _;return e[84]!==d||e[85]!==h||e[86]!==w||e[87]!==C||e[88]!==k?(_=n.jsxs(d,{open:C,onOpenChange:k,children:[h,w]}),e[84]=d,e[85]=h,e[86]=w,e[87]=C,e[88]=k,e[89]=_):_=e[89],_}function nr(t){return t.projects.length===0}function or(t){return t.projects.length>0}function ir(t){const e=O.c(25),{value:s,onChange:o,block:a}=t,r=Q(),[i,c]=G.useState(s!==""),[l,f]=G.useState(!1),[u,m]=G.useState(s);s!==u&&(m(s),s===""&&!l&&c(!1));const d=i||a,p=d?"w-32 sm:w-44":"w-8 px-0 justify-center",h=a&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==p||e[1]!==h?(g=J("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",p,h),e[0]=p,e[1]=h,e[2]=g):g=e[2];let x;e[3]!==r?(x=r("taskBoard.taskFilters.searchLabel"),e[3]=r,e[4]=x):x=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=()=>c(!0),e[5]=j):j=e[5];let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(gn,{size:14}),e[6]=N):N=e[6];let y;e[7]!==x?(y=n.jsx("button",{type:"button","aria-label":x,onClick:j,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:N}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==a||e[10]!==d||e[11]!==o||e[12]!==r||e[13]!==s?(v=d&&n.jsx("input",{autoFocus:!a,value:s,onChange:D=>o(D.target.value),onFocus:()=>f(!0),onBlur:()=>{f(!1),s===""&&c(!1)},placeholder:r("taskBoard.taskFilters.searchPlaceholder"),"aria-label":r("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=a,e[10]=d,e[11]=o,e[12]=r,e[13]=s,e[14]=v):v=e[14];let C;e[15]!==a||e[16]!==o||e[17]!==r||e[18]!==s?(C=s!==""&&n.jsx("button",{type:"button","aria-label":r("taskBoard.taskFilters.searchClearLabel"),onMouseDown:rr,onClick:()=>{o(""),a||c(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:n.jsx(tn,{size:14})}),e[15]=a,e[16]=o,e[17]=r,e[18]=s,e[19]=C):C=e[19];let k;return e[20]!==g||e[21]!==y||e[22]!==v||e[23]!==C?(k=n.jsxs("div",{className:g,children:[y,v,C]}),e[20]=g,e[21]=y,e[22]=v,e[23]=C,e[24]=k):k=e[24],k}function rr(t){return t.preventDefault()}function ar(t){const e=O.c(20),{block:s,onClick:o}=t,a=Q();let r;e[0]!==a?(r=a("taskBoard.taskFilters.boardSettingsLabel"),e[0]=a,e[1]=r):r=e[1];const i=r;let c;e[2]!==s?(c=J(_e(!1,s),s?"h-10 w-full":"w-8 justify-center px-0"),e[2]=s,e[3]=c):c=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(bo,{size:14,className:"shrink-0"}),e[4]=l):l=e[4];let f;e[5]!==s||e[6]!==i?(f=s&&n.jsx("span",{children:i}),e[5]=s,e[6]=i,e[7]=f):f=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==c||e[11]!==f?(u=n.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:c,children:[l,f]}),e[8]=i,e[9]=o,e[10]=c,e[11]=f,e[12]=u):u=e[12];const m=u;if(s)return m;let d;e[13]!==m?(d=n.jsx(Me,{asChild:!0,children:m}),e[13]=m,e[14]=d):d=e[14];let p;e[15]!==i?(p=n.jsx(Le,{side:"top",children:i}),e[15]=i,e[16]=p):p=e[16];let h;return e[17]!==d||e[18]!==p?(h=n.jsxs(Re,{children:[d,p]}),e[17]=d,e[18]=p,e[19]=h):h=e[19],h}function zs(t){const e=O.c(53),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c,block:l}=t;let f;e[0]!==s||e[1]!==i?(f=k=>i({...s,search:k}),e[0]=s,e[1]=i,e[2]=f):f=e[2];let u;e[3]!==l||e[4]!==s.search||e[5]!==f?(u=n.jsx(ir,{block:l,value:s.search,onChange:f}),e[3]=l,e[4]=s.search,e[5]=f,e[6]=u):u=e[6];let m;e[7]!==s||e[8]!==i?(m=k=>i({...s,assignee:k}),e[7]=s,e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l||e[11]!==s.assignee||e[12]!==o||e[13]!==m?(d=n.jsx(Yi,{block:l,value:s.assignee,members:o,onChange:m}),e[10]=l,e[11]=s.assignee,e[12]=o,e[13]=m,e[14]=d):d=e[14];let p;e[15]!==s||e[16]!==i?(p=k=>i({...s,priority:k}),e[15]=s,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==l||e[19]!==s.priority||e[20]!==p?(h=n.jsx(Xi,{block:l,value:s.priority,onChange:p}),e[18]=l,e[19]=s.priority,e[20]=p,e[21]=h):h=e[21];let g;e[22]!==s||e[23]!==i?(g=k=>i({...s,due:k}),e[22]=s,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==l||e[26]!==s.due||e[27]!==g?(x=n.jsx(Ji,{block:l,value:s.due,onChange:g}),e[25]=l,e[26]=s.due,e[27]=g,e[28]=x):x=e[28];let j;e[29]!==s||e[30]!==i?(j=k=>i({...s,tags:k}),e[29]=s,e[30]=i,e[31]=j):j=e[31];let N;e[32]!==l||e[33]!==s.tags||e[34]!==j||e[35]!==a?(N=n.jsx(Zi,{block:l,value:s.tags,tags:a,onChange:j}),e[32]=l,e[33]=s.tags,e[34]=j,e[35]=a,e[36]=N):N=e[36];let y;e[37]!==l||e[38]!==s||e[39]!==r||e[40]!==i?(y=(r.entries.length>0||ft(s.project,r))&&n.jsx(sr,{block:l,value:s.project,index:r,onChange:k=>i({...s,project:k})}),e[37]=l,e[38]=s,e[39]=r,e[40]=i,e[41]=y):y=e[41];let v;e[42]!==l||e[43]!==c?(v=n.jsx(ar,{block:l,onClick:c}),e[42]=l,e[43]=c,e[44]=v):v=e[44];let C;return e[45]!==N||e[46]!==y||e[47]!==v||e[48]!==u||e[49]!==d||e[50]!==h||e[51]!==x?(C=n.jsxs(n.Fragment,{children:[u,d,h,x,N,y,v]}),e[45]=N,e[46]=y,e[47]=v,e[48]=u,e[49]=d,e[50]=h,e[51]=x,e[52]=C):C=e[52],C}function tl(t){const e=O.c(16),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}=t,l=Q();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ns,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=f):f=e[0];let u;e[1]!==s||e[2]!==r||e[3]!==o||e[4]!==i||e[5]!==c||e[6]!==a?(u=n.jsx(zs,{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}),e[1]=s,e[2]=r,e[3]=o,e[4]=i,e[5]=c,e[6]=a,e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==r||e[10]!==i||e[11]!==l?(m=Gi(s,r)&&n.jsx("button",{type:"button",onClick:()=>i(Rs),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:l("taskBoard.taskFilters.clearButton")}),e[8]=s,e[9]=r,e[10]=i,e[11]=l,e[12]=m):m=e[12];let d;return e[13]!==u||e[14]!==m?(d=n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f,u,m]}),e[13]=u,e[14]=m,e[15]=d):d=e[15],d}function sl(t){const e=O.c(41),{filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c}=t,l=Q(),[f,u]=G.useState(!1),m=Hi(s,r),d=m>0;let p;e[0]!==d?(p=_e(d),e[0]=d,e[1]=p):p=e[1];const h=p;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ns,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=l,e[4]=x):x=e[4];let j;e[5]!==m?(j=m>0&&n.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:m}),e[5]=m,e[6]=j):j=e[6];let N;e[7]!==x||e[8]!==j||e[9]!==h?(N=n.jsx(An,{asChild:!0,children:n.jsxs("button",{type:"button",className:h,children:[g,x,j]})}),e[7]=x,e[8]=j,e[9]=h,e[10]=N):N=e[10];let y;e[11]!==l?(y=l("taskBoard.taskFilters.filterDrawerTitle"),e[11]=l,e[12]=y):y=e[12];let v;e[13]!==y?(v=n.jsx(Ft,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let C;e[15]!==s||e[16]!==r||e[17]!==o||e[18]!==i||e[19]!==c||e[20]!==a?(C=n.jsx("div",{className:"flex flex-col gap-2 p-4",children:n.jsx(zs,{block:!0,filters:s,members:o,tags:a,index:r,onChange:i,onOpenBoardSettings:c})}),e[15]=s,e[16]=r,e[17]=o,e[18]=i,e[19]=c,e[20]=a,e[21]=C):C=e[21];let k;e[22]!==m||e[23]!==i||e[24]!==l?(k=m>0&&n.jsx(ye,{variant:"outline",className:"flex-1",onClick:()=>i(Rs),children:l("taskBoard.taskFilters.clearAllButton")}),e[22]=m,e[23]=i,e[24]=l,e[25]=k):k=e[25];let D;e[26]!==l?(D=l("taskBoard.taskFilters.doneButton"),e[26]=l,e[27]=D):D=e[27];let b;e[28]!==D?(b=n.jsx(us,{asChild:!0,children:n.jsx(ye,{className:"flex-1",children:D})}),e[28]=D,e[29]=b):b=e[29];let w;e[30]!==k||e[31]!==b?(w=n.jsxs(fs,{className:"flex-row gap-2",children:[k,b]}),e[30]=k,e[31]=b,e[32]=w):w=e[32];let _;e[33]!==w||e[34]!==v||e[35]!==C?(_=n.jsxs(Bt,{className:"p-0",children:[v,C,w]}),e[33]=w,e[34]=v,e[35]=C,e[36]=_):_=e[36];let I;return e[37]!==f||e[38]!==_||e[39]!==N?(I=n.jsxs(It,{open:f,onOpenChange:u,direction:"bottom",children:[N,_]}),e[37]=f,e[38]=_,e[39]=N,e[40]=I):I=e[40],I}function nl(t,e){return fi(t,e.keySeq)??e.id}function ol(t,e){const s=e?.trim();if(s)return t.find(o=>Ks(s,o.keySeq))??t.find(o=>o.id===s)}export{Ea as $,ha as A,wo as B,Aa as C,_a as D,Da as E,wa as F,Fs as G,Mt as H,Ti as I,wt as J,Xa as K,za as L,nt as M,Rt as N,Pa as O,hi as P,Oi as Q,Ua as R,Yt as S,Ga as T,Zt as U,Za as V,Ma as W,$s as X,Ha as Y,Ms as Z,Ri as _,Ta as a,Va as a0,Fi as a1,Vs as a2,Fa as a3,ol as a4,sl as a5,tl as a6,Ka as a7,Qa as a8,Rs as a9,La as aa,Oa as ab,Jt as ac,Ra as ad,qa as ae,el as af,Pi as ag,Ja as ah,Wa as ai,_i as aj,Wo as ak,ga as al,Ba as b,Ya as c,Ui as d,Bs as e,nl as f,$a as g,Ai as h,Es as i,ma as j,pa as k,ja as l,ya as m,Na as n,yi as o,bi as p,Ia as q,ba as r,va as s,fi as t,xa as u,ka as v,Sa as w,Ca as x,Ci as y,_o as z};
|