decocms 3.97.7 → 3.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BbWDb4P3.js → AlertCircle-B2tKCnm8.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Cpa1HdMK.js → ArrowUpRight-C-ZXCXeN.js} +1 -1
- package/dist/client/assets/{CheckCircle-B5Cs3cJn.js → CheckCircle-BcI3T1tO.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bdmn9wxy.js → ChevronDown-DKlpkOB2.js} +1 -1
- package/dist/client/assets/{ChevronLeft-E01n7Kl2.js → ChevronLeft-vu3jmJdt.js} +1 -1
- package/dist/client/assets/{ChevronRight-BwHVl1Gx.js → ChevronRight-CdRT7LjU.js} +1 -1
- package/dist/client/assets/{ChevronUp-DTAXKGQ5.js → ChevronUp-B0N31Im_.js} +1 -1
- package/dist/client/assets/{DotsVertical-BX0mUqDP.js → DotsVertical-wEiyEk6D.js} +1 -1
- package/dist/client/assets/{Eye-DpOHfPKV.js → Eye-5boS9nIv.js} +1 -1
- package/dist/client/assets/{FilterLines-DNJHlTjF.js → FilterLines-OqKdZVKs.js} +1 -1
- package/dist/client/assets/{Globe01-CzN1edxV.js → Globe01-CRm2mh-P.js} +1 -1
- package/dist/client/assets/{Globe04-CmTV4j_6.js → Globe04-BtSgO3H5.js} +1 -1
- package/dist/client/assets/{HardDrive-CZQneyxc.js → HardDrive-DxtF-IY8.js} +1 -1
- package/dist/client/assets/{Key01-CBdkPJJY.js → Key01-LrqIifxa.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BBIkUylk.js → LayoutLeft-BFka2GeR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BCUpwug1.js → LinkExternal01-DgECMeuC.js} +1 -1
- package/dist/client/assets/{Monitor01-BukoJELB.js → Monitor01-TMDQZq46.js} +1 -1
- package/dist/client/assets/{Palette-StdAZEDj.js → Palette-D-5q-DfS.js} +1 -1
- package/dist/client/assets/{Play-B9ziq0DG.js → Play-Mf5cQSsU.js} +1 -1
- package/dist/client/assets/{Plus-CzEd_7C2.js → Plus-CpiYI_4d.js} +1 -1
- package/dist/client/assets/{SearchMd-B5oXD3je.js → SearchMd-Dj_Z4iwH.js} +1 -1
- package/dist/client/assets/{Settings02-YfBGKTKi.js → Settings02-C_rkmGxP.js} +1 -1
- package/dist/client/assets/{Shield01-D1SLus1-.js → Shield01-DputbTqH.js} +1 -1
- package/dist/client/assets/{Star01-Blw95h5T.js → Star01-DTKqRt_Y.js} +1 -1
- package/dist/client/assets/{Stars01-C8qwraWO.js → Stars01-CmPmyHdC.js} +1 -1
- package/dist/client/assets/{Stars02-CBmeuYJq.js → Stars02-C3IQpZYm.js} +1 -1
- package/dist/client/assets/{Sun-ffimMdFe.js → Sun-CY-48C0Q.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CWvc9zWe.js → SwitchHorizontal01-Bt5waFYC.js} +1 -1
- package/dist/client/assets/{Tool01-Co8bLuOG.js → Tool01-DIyxkJuF.js} +1 -1
- package/dist/client/assets/{Trash01-BDZ5N1so.js → Trash01-B4wYspRk.js} +1 -1
- package/dist/client/assets/{Upload01-BcQbyRUH.js → Upload01-Cx3iHgDj.js} +1 -1
- package/dist/client/assets/{User01-BmjG1Rsr.js → User01-bHHH-hCd.js} +1 -1
- package/dist/client/assets/{Users01-DaRZooOq.js → Users01-CUJ27ws5.js} +1 -1
- package/dist/client/assets/{Users03-BE5xe78Y.js → Users03-BwME7x2o.js} +1 -1
- package/dist/client/assets/{X-DN8Tc-8X.js → X-CyEH-HLB.js} +1 -1
- package/dist/client/assets/{XCircle-CbLW5tD6.js → XCircle-1yG7DJUE.js} +1 -1
- package/dist/client/assets/{XClose-CQmwzAVh.js → XClose-DrdWWhVa.js} +1 -1
- package/dist/client/assets/{Zap-Cf0CiCn8.js → Zap-BcROp_Sw.js} +1 -1
- package/dist/client/assets/{ZapSquare-BJwoqAGp.js → ZapSquare-CQGn3oRj.js} +1 -1
- package/dist/client/assets/{ZoomOut-BpayHaSz.js → ZoomOut-CP848i3T.js} +1 -1
- package/dist/client/assets/{access-gate-7TuRzUIC.js → access-gate-UYvjesC4.js} +1 -1
- package/dist/client/assets/{add-section-modal-S5GAD2Yv.js → add-section-modal-DjiKr-mG.js} +1 -1
- package/dist/client/assets/{agent-icon-CNuTyxJf.js → agent-icon-D4izi-0m.js} +1 -1
- package/dist/client/assets/{agents-list-Cw_hhlo7.js → agents-list-Bo4o9py9.js} +1 -1
- package/dist/client/assets/{ai-providers-BEQEsSMi.js → ai-providers-BeO7EK0W.js} +1 -1
- package/dist/client/assets/{alert-DS064q_2.js → alert-LYCfBUZh.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bi8YxknI.js → alert-dialog-CPIOFM7U.js} +1 -1
- package/dist/client/assets/{app-editor-D4EFBUDJ.js → app-editor-BIHJ9_p3.js} +1 -1
- package/dist/client/assets/{auth-DyAYzXhN.js → auth-BQJ4901M.js} +1 -1
- package/dist/client/assets/{auth-catchall-DPS4cXaM.js → auth-catchall-CvyCi0R5.js} +1 -1
- package/dist/client/assets/{auth-entry-CWk3k_C0.js → auth-entry-DkeNnDdz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-72PoTt3E.js → auth-split-layout-CsPWd72V.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-3kYKrfE-.js → authenticate-and-persist-oauth-DxcPuu6b.js} +1 -1
- package/dist/client/assets/{automation-list-row-W4J4D1Fl.js → automation-list-row-DJWQr3ii.js} +1 -1
- package/dist/client/assets/{automation-runs-DrUx0_JN.js → automation-runs-CBbmdd2g.js} +1 -1
- package/dist/client/assets/{automations-x4thNlJ4.js → automations-OwxtB2xV.js} +1 -1
- package/dist/client/assets/{avatar-ZBal56C9.js → avatar-6LwZYACh.js} +1 -1
- package/dist/client/assets/{badge-D0AzPgAt.js → badge-ClC_mVXH.js} +1 -1
- package/dist/client/assets/{block-document-CjUb2Jhk.js → block-document-BDP5bqaW.js} +1 -1
- package/dist/client/assets/{brand-context-DSRz4la_.js → brand-context-BPI754XR.js} +1 -1
- package/dist/client/assets/{buckets-qiUs41xV.js → buckets-lxivknwg.js} +1 -1
- package/dist/client/assets/{capability-load-error-By_-eER2.js → capability-load-error-BZ3C4jEm.js} +1 -1
- package/dist/client/assets/{card-MXiCFjBP.js → card-QhB5x9Lx.js} +1 -1
- package/dist/client/assets/{category-editor-DYJwtrMA.js → category-editor-Dh3xmOe5.js} +1 -1
- package/dist/client/assets/{chat-context-DiBX9-Ov.js → chat-context-B0mmOd9g.js} +1 -1
- package/dist/client/assets/{checkbox-CstNHCWX.js → checkbox-N0X_3WAx.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CbEuLxQe.js → cli-auth-success-CXFyuCJj.js} +1 -1
- package/dist/client/assets/{collection-detail-CngrY_hE.js → collection-detail-BvUolk38.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cw0Rs8aH.js → collection-display-button-Dm0u8Icp.js} +1 -1
- package/dist/client/assets/{collection-search-DSBtDMrO.js → collection-search-CCJeZtSC.js} +1 -1
- package/dist/client/assets/{collection-tabs-HvCY1XOD.js → collection-tabs-CIbS_aRk.js} +1 -1
- package/dist/client/assets/{command-CZ7zKXxJ.js → command-CyTNhGQi.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-C_iLtzOc.js → commerce-onboarding-CEaL1-82.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CR3IauEw.js → connect-desktop-dialog-BXO2k7fs.js} +1 -1
- package/dist/client/assets/{connection-card-CTIqzaKu.js → connection-card-CS3v7rYN.js} +1 -1
- package/dist/client/assets/{connection-detail-C_6J-SPE.js → connection-detail-BI4w3NxZ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bm9rH8r-.js → connection-form-helpers-DhabLQU7.js} +1 -1
- package/dist/client/assets/{connections-D5tqJTyw.js → connections-BYrLijy4.js} +1 -1
- package/dist/client/assets/{context-menu-D9umYpZZ.js → context-menu-Q1Owjt7Z.js} +1 -1
- package/dist/client/assets/decopilot-Cw641gWp.js +4 -0
- package/dist/client/assets/{decopilot-sse-pool-BVQiWKqJ.js → decopilot-sse-pool-DGROjFUX.js} +1 -1
- package/dist/client/assets/{dialog-Cflfh_Tw.js → dialog-Cg3rcVr2.js} +1 -1
- package/dist/client/assets/{domain-settings-DCa9Ocnq.js → domain-settings-HOF2Zwde.js} +1 -1
- package/dist/client/assets/{drawer-0UiugAj3.js → drawer-CAJEFb6a.js} +1 -1
- package/dist/client/assets/{dropdown-menu-AY92Z-dd.js → dropdown-menu-DwkP3R-M.js} +1 -1
- package/dist/client/assets/{empty-state-Dx0oWv9I.js → empty-state-BA-8VXvV.js} +1 -1
- package/dist/client/assets/{extract-connection-data-OXojd7qP.js → extract-connection-data-CtVNT5JS.js} +1 -1
- package/dist/client/assets/{file-explorer-DFB16XEX.js → file-explorer-Dh4ucUbU.js} +1 -1
- package/dist/client/assets/{file-type-icon-6zbFot2C.js → file-type-icon-Dtw8pMpt.js} +1 -1
- package/dist/client/assets/{files-CV61ORwb.js → files-BrIfSgdo.js} +1 -1
- package/dist/client/assets/{form-kI1-d2Ap.js → form-r_9hbLn7.js} +1 -1
- package/dist/client/assets/{general-1Be5WBPJ.js → general-Dsili3D1.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B6lDEWtg.js → github-repo-picker-BlOw6wWo.js} +1 -1
- package/dist/client/assets/{hooks-DSw61L3q.js → hooks-BZmjB2Y3.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DVF2YKW-.js → import-from-deco-dialog-CllLsuxG.js} +1 -1
- package/dist/client/assets/{index-DnVkFYRm.js → index-B6RuHW2d.js} +1 -1
- package/dist/client/assets/{index-BeCmcioi.js → index-BBDWvYlB.js} +1 -1
- package/dist/client/assets/{index-CeeMvg3X.js → index-BES1tco7.js} +1 -1
- package/dist/client/assets/{index-DQiUFldO.js → index-Bzybgde3.js} +1 -1
- package/dist/client/assets/{index-GuH7_k30.js → index-C-Ms0LlR.js} +1 -1
- package/dist/client/assets/{index-CbZvNsMe.js → index-CcEQJ9TP.js} +1 -1
- package/dist/client/assets/{index-DO84G1Ma.js → index-Cx-rmUTX.js} +1 -1
- package/dist/client/assets/{index-DRlZtDVf.js → index-D5VRKG0h.js} +1 -1
- package/dist/client/assets/{index-DqDkObQs.js → index-DDmZcB2_.js} +26 -26
- package/dist/client/assets/{index-DodzLX-5.js → index-DGQR8QX-.js} +1 -1
- package/dist/client/assets/{index-B5aMoJd5.js → index-DKxonbsE.js} +1 -1
- package/dist/client/assets/{index-smTHcnUA.js → index-MpjPxskG.js} +4 -4
- package/dist/client/assets/{index-C4RqHqQ-.js → index-V7Ke-ddW.js} +1 -1
- package/dist/client/assets/{index-C3lBPlh5.js → index-cEjDb0yt.js} +1 -1
- package/dist/client/assets/{index-redirect-CT2MUfLH.js → index-redirect-DNBN6D1L.js} +1 -1
- package/dist/client/assets/{input-3jBb-uLt.js → input-Cr9jBfB7.js} +1 -1
- package/dist/client/assets/{integration-icon-Bn0wvmtz.js → integration-icon-CcZDYv2E.js} +1 -1
- package/dist/client/assets/{label-DYbtyKk_.js → label-DE6yKu0U.js} +1 -1
- package/dist/client/assets/{login-Cs72_6kj.js → login-C3viYTk8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BDYi7sDB.js → mcp-oauth-DpS4HNDv.js} +1 -1
- package/dist/client/assets/{members-DDUmE_tS.js → members-B_6V5QSG.js} +1 -1
- package/dist/client/assets/{monaco-editor-uPlGLArC.js → monaco-editor-riosOl5g.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cx1pSXL3.js → monitoring-stats-row-Btsxp-Ss.js} +1 -1
- package/dist/client/assets/{oauth-callback-B1PoSivY.js → oauth-callback-D4zeeUFW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BHR_VU_e.js → oauth-callback-ai-provider-DGPhZiOX.js} +1 -1
- package/dist/client/assets/{onboarding-CuBcXom9.js → onboarding-De6fLW8h.js} +1 -1
- package/dist/client/assets/{org-install-Ce4Nl2nf.js → org-install-CUEkUiAv.js} +1 -1
- package/dist/client/assets/{org-layout-CywML7Tg.js → org-layout-QBJAyIrm.js} +1 -1
- package/dist/client/assets/{organization-choice-Dm4HbuQ0.js → organization-choice-Dv2OwI-t.js} +1 -1
- package/dist/client/assets/{page-seo-form-oeCi9CFa.js → page-seo-form-BOzWRvsQ.js} +1 -1
- package/dist/client/assets/page-seo-sheet-nyf66LRp.js +1 -0
- package/dist/client/assets/{popover-DG4qK6ZG.js → popover-CJe04WOy.js} +1 -1
- package/dist/client/assets/{post-editor-BHqMx9wf.js → post-editor-Rp79NJZ3.js} +1 -1
- package/dist/client/assets/{preview-dialog-D5QAlFg9.js → preview-dialog-BJCgRVN3.js} +1 -1
- package/dist/client/assets/{primitives-BjDrMu1e.js → primitives-r_FHuESN.js} +1 -1
- package/dist/client/assets/{profile-DPSRl9oD.js → profile-5-dOYDST.js} +1 -1
- package/dist/client/assets/project-app-view-DOzoLGgs.js +1 -0
- package/dist/client/assets/record-editor-DGsVK72Y.js +1 -0
- package/dist/client/assets/registry-BtQv7iAE.js +2 -0
- package/dist/client/assets/{registry-layout-B04NCkil.js → registry-layout-BqS7mSoz.js} +1 -1
- package/dist/client/assets/{require-capability-BBor_4EA.js → require-capability-a44oc3tu.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CnBiGFWB.js → required-auth-layout-QkAj4QVN.js} +1 -1
- package/dist/client/assets/{reset-password-DXYp8lVw.js → reset-password-CvATWsJB.js} +1 -1
- package/dist/client/assets/{roles-CoSM2yC_.js → roles-B37QLVHE.js} +1 -1
- package/dist/client/assets/{save-status-ce87Zgi0.js → save-status-xtYw_K9n.js} +1 -1
- package/dist/client/assets/{scroll-area-B42MPIw3.js → scroll-area-BPQwtIHi.js} +1 -1
- package/dist/client/assets/{search-input-CC_aa0Gt.js → search-input-BzADBDiR.js} +1 -1
- package/dist/client/assets/{secrets-Bys8E3nN.js → secrets-s5veILtZ.js} +1 -1
- package/dist/client/assets/{sections-editor-Ck_gejiB.js → sections-editor-Dihe2f7L.js} +1 -1
- package/dist/client/assets/{select-DieoiSYl.js → select-CP2O-MPr.js} +1 -1
- package/dist/client/assets/{select-model-CV7D1CvA.js → select-model-Bt5mshkF.js} +1 -1
- package/dist/client/assets/{seo-editor-aTRXaVxH.js → seo-editor-D-p1HMD9.js} +1 -1
- package/dist/client/assets/{settings-layout-BcLFii5a.js → settings-layout-CLYXRsYz.js} +1 -1
- package/dist/client/assets/{settings-section-VnNyBtnl.js → settings-section-C91STDXl.js} +1 -1
- package/dist/client/assets/{sheet-Pqbb_nLq.js → sheet-qUAd_2vk.js} +1 -1
- package/dist/client/assets/{shell-controls-DKdbxI5l.js → shell-controls-TBi4Bs6a.js} +1 -1
- package/dist/client/assets/{shell-layout-DQydNkht.js → shell-layout-D2QUbgoY.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CMccwwVE.js → shell-route-loading-CZ7PjWkH.js} +1 -1
- package/dist/client/assets/{sidebar-BLOsSoN_.js → sidebar-BHss58rk.js} +1 -1
- package/dist/client/assets/{skeleton-CLfhTXx-.js → skeleton-BxYVo1ej.js} +1 -1
- package/dist/client/assets/{sortable.esm-Cc0x-CQz.js → sortable.esm-CxO66Aqu.js} +1 -1
- package/dist/client/assets/{sso--kjp7-8f.js → sso-CQXCda0c.js} +1 -1
- package/dist/client/assets/{store-BIZZek5w.js → store-f9SUFb27.js} +1 -1
- package/dist/client/assets/store-registry-CzotbzeO.js +2 -0
- package/dist/client/assets/{studio-tools-FklJDanw.js → studio-tools-DVojvDEr.js} +1 -1
- package/dist/client/assets/{switch-CHco2opq.js → switch-C86XM8Lb.js} +1 -1
- package/dist/client/assets/{table-BPRYh1TO.js → table-CNjcUwhh.js} +1 -1
- package/dist/client/assets/{tabs-Ca-c7EUe.js → tabs-Bq1ZowRE.js} +1 -1
- package/dist/client/assets/{task-status-Cekf3ZU9.js → task-status-DXwOekTG.js} +1 -1
- package/dist/client/assets/{textarea-BAEhJXU5.js → textarea-CixyZRlq.js} +1 -1
- package/dist/client/assets/{toggle-group-OTavjf1W.js → toggle-group-BdCNGWln.js} +1 -1
- package/dist/client/assets/{toolbar-DDBdnwsl.js → toolbar-DbGfvfdI.js} +1 -1
- package/dist/client/assets/{tooltip-C8EAE8WH.js → tooltip-CEM9S4pg.js} +1 -1
- package/dist/client/assets/{types-BqGw3gnw.js → types-DDQhAUH9.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BUofhQwM.js → use-ai-providers-CpTKYZRn.js} +1 -1
- package/dist/client/assets/{use-automations-E5-3gLDv.js → use-automations-D5oUll8g.js} +1 -1
- package/dist/client/assets/{use-capability-BbL91qJb.js → use-capability-t-9WULPE.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CytvSUpz.js → use-clock-tick-BySyJdAG.js} +1 -1
- package/dist/client/assets/{use-collections-Dh2p4suc.js → use-collections-CVlcIFcl.js} +1 -1
- package/dist/client/assets/{use-connection-h3hvIRkK.js → use-connection-B7hehSBo.js} +1 -1
- package/dist/client/assets/{use-copy-DFWhQKHC.js → use-copy-T1Xud-C6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DXsZDQcc.js → use-create-virtual-mcp-CI7JmXUA.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DbY-cSB7.js → use-debounced-autosave-BJyLUAIB.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BOJATnTh.js → use-delete-connection-BkhqKngp.js} +1 -1
- package/dist/client/assets/{use-file-configs-DG6KTQKj.js → use-file-configs-zP_QQ_ZA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-zQ1y1b1L.js → use-infinite-scroll-Bzqu-Hgc.js} +1 -1
- package/dist/client/assets/{use-join-requests-CFs0Vp2p.js → use-join-requests-DaCmnTl9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-SQJoN-V8.js → use-mcp-client-D0CDCf2C.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BsdifcZC.js → use-mcp-prompts-CFOe4FP5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cle5Kd84.js → use-mcp-tools-oAYlV_rV.js} +1 -1
- package/dist/client/assets/{use-members-Ch1XITTN.js → use-members-uzLM9gLc.js} +1 -1
- package/dist/client/assets/{use-mobile-CvCMlflA.js → use-mobile-taJ6Byue.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DQghLhaf.js → use-navigate-to-agent-NCPMRSC-.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CVxnVAwj.js → use-org-auth-client-BI60dBQ8.js} +1 -1
- package/dist/client/assets/{use-org-sso-CWXefYPz.js → use-org-sso-DRd1kOa9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DBbnxQm7.js → use-organization-roles-DHLS6-m5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-0OKnMPr2.js → use-organization-settings-BCL7l3Gq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bw564Fn1.js → use-registry-connections-C1tYRr1m.js} +1 -1
- package/dist/client/assets/{use-secrets-Cox1bfg5.js → use-secrets-CrkSMWB9.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Dxz86iWd.js → use-status-sounds-DEhsbseD.js} +1 -1
- package/dist/client/assets/{use-view-mode-BTmAO-eH.js → use-view-mode-CXKeWsQW.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-nCKsVOOs.js → use-virtual-mcp-q2Cm2W65.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B5tA5pfi.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DtIVyYSY.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-CKsQYhMg.js → useSuspenseQueries-DvUMI2b6.js} +1 -1
- package/dist/client/assets/{variant-calendar-D4xtrF_C.js → variant-calendar-DNxbSxzY.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-qPa51MgO.js → view-mode-toggle-DfJxMNM0.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +437 -437
- package/dist/server/server.js +300 -300
- package/package.json +1 -1
- package/dist/client/assets/decopilot-DeMlzLYJ.js +0 -4
- package/dist/client/assets/page-seo-sheet-REU1FYqG.js +0 -1
- package/dist/client/assets/project-app-view-DIuhFpla.js +0 -1
- package/dist/client/assets/record-editor-DVsbJOpA.js +0 -1
- package/dist/client/assets/registry-BFYHD6vu.js +0 -2
- package/dist/client/assets/store-registry-BU7RcCrC.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DaeGOmGx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DOQWnPwU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,j as s,C as us,r as z,l as Q,i as Ks,w as ee,D as ue,a as we,F as Vs,K as ms,k as fs,b as Ee,e as Ys,u as er,G as tr,R as sr,H as nr,o as rr,s as or,n as ir,p as lr,d as ar,B as pt,I as cr,J as dr,t as Ae,M as ur,P as mr,x as fr,m as pr,y as xr,T as hr,U as gr,V as br,W as ze,X as Xs,Y as jr,Z as Qs,_ as vr,$ as yr,a0 as Sr,a1 as _r,a2 as Nr,a3 as Cr,a4 as wr,a5 as kr,E as Js,O as Ir}from"./index-smTHcnUA.js";import{u as Qe,S as he,a as ke,b as Lt,c as Ht,d as Oe,e as Zs,f as en,g as Tr,h as $r,i as rs,j as Ar,k as zr,l as Or}from"./sidebar-BLOsSoN_.js";import{u as ps}from"./use-mobile-CvCMlflA.js";import{u as Pr,S as Ns,M as Dr}from"./shell-controls-DKdbxI5l.js";import{a as Mr,b as Rr,c as Er}from"./ZoomOut-BpayHaSz.js";import{T as ge,a as ae}from"./toolbar-DDBdnwsl.js";import{a as Pe,b as De,T as Me,c as Cs}from"./tooltip-C8EAE8WH.js";import{S as Ne}from"./skeleton-CLfhTXx-.js";import{P as Bt,a as xt,b as Ut}from"./popover-DG4qK6ZG.js";import{D as tn,a as sn,b as nn}from"./drawer-0UiugAj3.js";import{i as rn}from"./SearchMd-B5oXD3je.js";import{s as Fr}from"./Star01-Blw95h5T.js";import{s as Ce}from"./Plus-CzEd_7C2.js";import{i as Gr,a as Lr}from"./use-mcp-client-SQJoN-V8.js";import{u as on,a as jt,b as Hr}from"./use-virtual-mcp-nCKsVOOs.js";import{u as Br}from"./use-create-virtual-mcp-DXsZDQcc.js";import{I as Ur,u as qr,W as Wr,H as Kr,S as Vr}from"./import-from-deco-dialog-DVF2YKW-.js";import{A as Re,a as ws,b as ks,c as ln,d as Yr,e as Xr,i as Qr,f as Jr}from"./agent-icon-CNuTyxJf.js";import{G as Zr,a as eo}from"./github-repo-picker-B6lDEWtg.js";import{u as an,a as to,b as cn,T as so}from"./hooks-DSw61L3q.js";import{r as no,u as ro,R as oo,a as io,b as dn}from"./shell-layout-DQydNkht.js";import{u as lo,g as un,a as ao,b as co,s as uo,c as mo,r as fo,d as po,e as xo,f as ho,p as go,T as os,h as bo,i as jo,j as vo,k as yo,l as So,m as _o,n as No,o as Co,q as wo,S as Is,t as mn}from"./use-navigate-to-agent-DQghLhaf.js";import{g as ko,u as fn,A as pn,a as Io,b as To,c as Ts,K as $o,P as Ao,s as zo,S as Oo,v as Po,D as Do,d as Mo,e as Ro,C as Eo,f as Fo}from"./sortable.esm-Cc0x-CQz.js";import{i as Go}from"./LayoutLeft-BBIkUylk.js";import{i as xn}from"./Monitor01-BukoJELB.js";import{u as Lo,v as Ho,C as Bo}from"./connect-desktop-dialog-CR3IauEw.js";import{A as is}from"./avatar-ZBal56C9.js";import{i as xs}from"./ChevronUp-DTAXKGQ5.js";import{a as $s}from"./Eye-DpOHfPKV.js";import{n as Uo,i as qo}from"./Globe01-CzN1edxV.js";import{i as Wo,a as hn}from"./ZapSquare-BJwoqAGp.js";import{n as Ko,a as Vo}from"./Sun-ffimMdFe.js";import{a as vt,b as Yo,i as Xo}from"./Settings02-YfBGKTKi.js";import{i as Qo}from"./Shield01-D1SLus1-.js";import{a as Jo}from"./Users03-BE5xe78Y.js";import{s as hs}from"./XClose-CQmwzAVh.js";import{A as Zo,a as ei,b as ti,c as si,d as ni,e as ri,f as oi}from"./alert-dialog-Bi8YxknI.js";import{F as ii,a as li,b as ai,c as ci,d as di,f as ui,e as mi}from"./form-kI1-d2Ap.js";import{I as fi}from"./input-3jBb-uLt.js";import{S as pi,C as xi}from"./chat-context-DiBX9-Ov.js";import"./index-GuH7_k30.js";import{n as gs}from"./Stars02-CBmeuYJq.js";import{u as hi,a as gi}from"./use-join-requests-CFs0Vp2p.js";import{i as bs}from"./ChevronRight-BwHVl1Gx.js";import{i as bi}from"./FilterLines-DNJHlTjF.js";import{t as ji}from"./Users01-DaRZooOq.js";import{S as As,a as gn,b as zs,c as Os,d as Ps}from"./select-DieoiSYl.js";import{c as vi,d as yi,e as Si,b as _i,a as Ni}from"./dialog-Cflfh_Tw.js";import{C as Ci,a as wi,b as ki,c as Ii,d as Ti}from"./command-CZ7zKXxJ.js";import{u as bn}from"./studio-tools-FklJDanw.js";import{i as jn}from"./Zap-Cf0CiCn8.js";import{u as $i}from"./use-org-auth-client-CVxnVAwj.js";import{C as Ot,a as Ds,b as vn,c as yn,d as Sn}from"./context-menu-D9umYpZZ.js";import{g as Ai,S as zi}from"./task-status-Cekf3ZU9.js";import{u as Oi,f as Pi}from"./use-clock-tick-CytvSUpz.js";import{t as _n}from"./ChevronDown-Bdmn9wxy.js";import{S as Di}from"./shell-route-loading-CMccwwVE.js";import"./sheet-Pqbb_nLq.js";import"./X-DN8Tc-8X.js";import"./ChevronLeft-E01n7Kl2.js";import"./auth-DyAYzXhN.js";import"./use-collections-Dh2p4suc.js";import"./use-connection-h3hvIRkK.js";import"./collection-search-DSBtDMrO.js";import"./AlertCircle-BbWDb4P3.js";import"./Tool01-Co8bLuOG.js";import"./SwitchHorizontal01-CWvc9zWe.js";import"./XCircle-CbLW5tD6.js";import"./ArrowUpRight-Cpa1HdMK.js";import"./CheckCircle-B5Cs3cJn.js";import"./DotsVertical-BX0mUqDP.js";import"./Globe04-CmTV4j_6.js";import"./HardDrive-CZQneyxc.js";import"./Key01-CBdkPJJY.js";import"./LinkExternal01-BCUpwug1.js";import"./Palette-StdAZEDj.js";import"./Play-B9ziq0DG.js";import"./Stars01-C8qwraWO.js";import"./Trash01-BDZ5N1so.js";import"./Upload01-BcQbyRUH.js";import"./User01-BmjG1Rsr.js";import"./checkbox-CstNHCWX.js";import"./authenticate-and-persist-oauth-3kYKrfE-.js";import"./mcp-oauth-BDYi7sDB.js";import"./use-mcp-tools-Cle5Kd84.js";import"./extract-connection-data-OXojd7qP.js";import"./decopilot-sse-pool-BVQiWKqJ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-CnBiGFWB.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-0OKnMPr2.js";import"./use-org-sso-CWXefYPz.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CTIqzaKu.js";import"./use-registry-connections-Bw564Fn1.js";import"./useInfiniteQuery-DaeGOmGx.js";import"./use-infinite-scroll-zQ1y1b1L.js";import"./card-MXiCFjBP.js";import"./integration-icon-Bn0wvmtz.js";import"./collection-tabs-HvCY1XOD.js";import"./badge-D0AzPgAt.js";import"./textarea-BAEhJXU5.js";import"./connection-form-helpers-Bm9rH8r-.js";import"./useSuspenseInfiniteQuery-DOQWnPwU.js";import"./use-ai-providers-BUofhQwM.js";import"./label-DYbtyKk_.js";import"./use-capability-BbL91qJb.js";import"./index-B5aMoJd5.js";import"./differenceInSeconds-NQ4PDo0z.js";function Mi(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Qe();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const js=240,Ri=400,Ei="sidebar.width";function bt(t){return Math.max(js,Math.min(Ri,t))}function Fi(){const t=N.c(11),[e,n]=us(Ei,Gi),r=z.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=bt(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=bt(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=bt(f+(b.clientX-m));n(j);for(const y of p)y.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(js)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=bt(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Gi(t){return typeof t=="number"?bt(t):js}function Li(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=Q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Ks,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const Hi="Select an existing agent";function Bi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Pe,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(De,{side:"right",sideOffset:8,children:Hi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Me,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function Ui(){const t=N.c(5),{enableDecoImport:e}=Vs(),{data:n}=we.useSession();let r;t[0]!==n?.user?.email?(r=ms.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:qi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=fs(i);return l?.isDecoUser??!1}async function qi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Wi(t){const e=Ee(),{create:n}=an(),{locator:r}=ue(),o=Ys({strict:!1}),i=er({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?no(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ki(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Re,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Vi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=z.useState(""),a=on(),c=a??[],{org:d}=ue(),{data:u}=we.useSession(),m=u?.user?.id??"anon",f=un(a),h=ao();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:x,isCreating:g}=Br(p),{createFromTemplate:b,isCreating:j}=qr(),y=Ui(),v=Wi(d.slug),_=ko(a),k=i.toLowerCase(),S=c.filter(Yi).filter(oe=>!_.has(oe.id)).filter(oe=>!i||oe.title.toLowerCase().includes(k)),I=oe=>{co({orgId:d.id,userId:m},oe.id,f),h(),n(),l(""),v(oe.id)},T="flex flex-col max-h-[min(640px,80dvh)]";let $;e[1]!==i?($=s.jsx(Li,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=$):$=e[2];const O="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const C="grid grid-cols-3 gap-1";let M;e[4]!==x||e[5]!==n?(M=async()=>{ee("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=M):M=e[6];let K,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ce,{size:16,className:"text-muted-foreground"})}),U=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=K,e[8]=U):(K=e[7],U=e[8]);let E;e[9]!==g||e[10]!==M?(E=s.jsxs("button",{type:"button",disabled:g,onClick:M,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[K,U]}),e[9]=g,e[10]=M,e[11]=E):E=e[11];let L;e[12]!==b||e[13]!==n?(L=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(Wr),n()},e[12]=b,e[13]=n,e[14]=L):L=e[14];let R,H;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Fr,{className:"size-5 text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=R,e[16]=H):(R=e[15],H=e[16]);let P;e[17]!==j||e[18]!==L?(P=s.jsxs("button",{type:"button",disabled:j,onClick:L,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[R,H]}),e[17]=j,e[18]=L,e[19]=P):P=e[19];let G;e[20]!==b||e[21]!==n?(G=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await b(Kr),n()},e[20]=b,e[21]=n,e[22]=G):G=e[22];let D,B;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Vr,alt:"",className:"size-5 object-contain"})}),B=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=D,e[24]=B):(D=e[23],B=e[24]);let F;e[25]!==j||e[26]!==G?(F=s.jsxs("button",{type:"button",disabled:j,onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[D,B]}),e[25]=j,e[26]=G,e[27]=F):F=e[27];let Y;e[28]!==n||e[29]!==o?(Y=()=>{ee("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=Y):Y=e[30];let Z,V;e[31]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(eo,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=Z,e[32]=V):(Z=e[31],V=e[32]);let J;e[33]!==Y?(J=s.jsxs("button",{type:"button",onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[Z,V]}),e[33]=Y,e[34]=J):J=e[34];let X;e[35]!==y||e[36]!==n||e[37]!==r?(X=y&&s.jsxs("button",{type:"button",onClick:()=>{ee("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=y,e[36]=n,e[37]=r,e[38]=X):X=e[38];const W=S.map(oe=>s.jsx(Ki,{agent:oe,onClick:()=>I(oe)},oe.id));let ne;e[39]!==E||e[40]!==P||e[41]!==F||e[42]!==J||e[43]!==X||e[44]!==W?(ne=s.jsxs("div",{className:C,children:[E,P,F,J,X,W]}),e[39]=E,e[40]=P,e[41]=F,e[42]=J,e[43]=X,e[44]=W,e[45]=ne):ne=e[45];let ie;e[46]!==g||e[47]!==i||e[48]!==S.length?(ie=S.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=g,e[47]=i,e[48]=S.length,e[49]=ie):ie=e[49];let ce;e[50]!==ne||e[51]!==ie||e[52]!==A?(ce=s.jsxs("div",{className:O,children:[A,ne,ie]}),e[50]=ne,e[51]=ie,e[52]=A,e[53]=ce):ce=e[53];let se;e[54]!==d.slug?(se={org:d.slug},e[54]=d.slug,e[55]=se):se=e[55];let re;e[56]!==n?(re=()=>n(),e[56]=n,e[57]=re):re=e[57];let le;e[58]!==se||e[59]!==re?(le=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(tr,{to:"/$org/settings/agents",params:se,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=se,e[59]=re,e[60]=le):le=e[60];let me;return e[61]!==ce||e[62]!==$||e[63]!==le?(me=s.jsxs("div",{className:T,children:[$,ce,le]}),e[61]=ce,e[62]=$,e[63]=le,e[64]=me):me=e[64],me}function Yi(t){return!Gr(t.id)}function Nn(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=z.useState(!1),[a,c]=z.useState(!1),[d,u]=z.useState(!1),m=ps(),{setOpenMobile:f}=Qe(),h=lo(),p=h?"border border-border":void 0;let x;e[2]!==h?(x=T=>h?s.jsx(Bi,{children:T}):T,e[2]=h,e[3]=x):x=e[3];const g=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ne,{className:"h-4 w-24"})}),children:s.jsx(Vi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==g?(_=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(he,{children:g(s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(tn,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(sn,{className:"max-h-[85dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Bt,{open:i,onOpenChange:T=>{T&&!i&&ee("agent_browser_opened",{surface:"desktop_popover"}),l(T)},children:[o?g(s.jsx(xt,{asChild:!0,children:s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(he,{children:g(s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ut,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=h,e[13]=m,e[14]=i,e[15]=v,e[16]=g,e[17]=_):_=e[17];let k;e[18]!==a?(k=s.jsx(Ur,{open:a,onOpenChange:c}),e[18]=a,e[19]=k):k=e[19];let S;e[20]!==d?(S=s.jsx(Zr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let I;return e[22]!==_||e[23]!==k||e[24]!==S?(I=s.jsxs(s.Fragment,{children:[_,k,S]}),e[22]=_,e[23]=k,e[24]=S,e[25]=I):I=e[25],I}function Cn(){const t=N.c(24),{org:e}=ue(),n=Ee(),o=Pr().location.pathname,i=e.slug,{state:l,isMobile:a}=Qe(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const h=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let g;t[11]!==n||t[12]!==i?(g=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=g):g=t[13];let b;t[14]!==x||t[15]!==g?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:g},t[14]=x,t[15]=g,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==h?(y={type:"items",items:[h,j]},t[17]=j,t[18]=h,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:s.jsx(Nn,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Rt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(sr,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function wn(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function kn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Qe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{ee("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=Q(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(he,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Xi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Zs,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ji),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(wn,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Qi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Qi(t){return s.jsx(kn,{item:t},t.key)}function Ji(t){return s.jsx(kn,{item:t},t.key)}function Zi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=Q("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(el),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(en,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Tr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function el(t,e){return s.jsx(Xi,{section:t},e)}function In(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}In.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ne,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ls(){const t=N.c(22),e=Lo(),[n,r]=z.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=Ho(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xn,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(De,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(Bo,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function tl(t){const e=N.c(17),{onToggle:n,className:r}=t,i=Vs().logo??nr,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=Q("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Go,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ge,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ls,{}),e[12]=p):p=e[12];let x;return e[13]!==c||e[14]!==m||e[15]!==h?(x=s.jsxs($r,{className:c,children:[m,h,p]}),e[13]=c,e[14]=m,e[15]=h,e[16]=x):x=e[16],x}function Ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=Q(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(he,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function sl(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Zs,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(Ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(wn,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(Ms,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function nl(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(z.Suspense,{fallback:l,children:s.jsx(tl,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(sl,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(en,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function Tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rl=rr({name:or().min(2,"Organization name is required")});function ol(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:ir(rl),defaultValues:{name:""}},e[0]=o):o=e[0];const i=lr(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:ll,onSuccess:il},e[1]=l):l=e[1];const a=ar(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(ti,{children:[s.jsx(si,{children:"Create a new organization"}),s.jsx(ni,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=I=>a.mutateAsync(I),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:I}=S;return s.jsxs(ai,{children:[s.jsx(ci,{children:"Organization Name"}),s.jsx(di,{children:s.jsx(fi,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(ui,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Tn(I.value)]})]}),s.jsx(mi,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(ii,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(Zo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(pi,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(pt,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(ri,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=h,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(ei,{children:[d,s.jsx(li,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(oi,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=Tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await we.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function as(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function al(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=Q(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:as(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:Q("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function Pt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Rs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=fr();let l;e[0]!==n?(l=(C,M)=>C.slug===n?-1:M.slug===n?1:C.name.localeCompare(M.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=z.useState(!1),[u,m]=z.useState(""),f=u.toLowerCase(),h=f?a.filter(C=>C.name.toLowerCase().includes(f)||C.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(cl)},e[2]=c,e[3]=p):p=e[3];const x=p;let g;e[4]!==u||e[5]!==c||e[6]!==x?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:C=>m(C.target.value),onKeyDown:C=>C.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(hs,{size:16}):s.jsx(rn,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ce,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let k;e[19]!==g||e[20]!==_?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,_]}),e[19]=g,e[20]=_,e[21]=k):k=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let T;e[22]!==r||e[23]!==n?(T=C=>s.jsxs("button",{type:"button",onClick:()=>r(C.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",C.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(al,{org:C,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:C.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.slug})]}),C.slug===n&&s.jsx(xs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},C.id),e[22]=r,e[23]=n,e[24]=T):T=e[24];const $=h.map(T);let O;e[25]!==I||e[26]!==$?(O=s.jsxs("div",{className:S,children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==k?(A=s.jsxs(s.Fragment,{children:[k,O]}),e[28]=O,e[29]=k,e[30]=A):A=e[30],A}function cl(t){return!t}function Es(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:p}=t;if(h){const X=n?.name??"U";let W;e[0]!==X||e[1]!==r?(W=s.jsx(is,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=W):W=e[2];const ne=n?.name??"User";let ie;e[3]!==ne?(ie=s.jsx("p",{className:"text-sm font-medium truncate",children:ne}),e[3]=ne,e[4]=ie):ie=e[4];const ce=n?.email;let se;e[5]!==ce?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ce}),e[5]=ce,e[6]=se):se=e[6];let re;e[7]!==ie||e[8]!==se?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,se]}),e[7]=ie,e[8]=se,e[9]=re):re=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(fl)},e[10]=n,e[11]=le):le=e[11];let me;e[12]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx($s,{size:14}),e[12]=me):me=e[12];let oe;e[13]!==le?(oe=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:me})}),e[13]=le,e[14]=oe):oe=e[14];let Ie;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ie):Ie=e[15];let Fe;e[16]!==oe?(Fe=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[oe,Ie]})}),e[16]=oe,e[17]=Fe):Fe=e[17];let fe;e[18]!==Fe||e[19]!==W||e[20]!==re?(fe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,re,Fe]}),e[18]=Fe,e[19]=W,e[20]=re,e[21]=fe):fe=e[21];const Ge=String(p);let pe;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==Ge?(pe=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Ge)}),e[22]=m,e[23]=u,e[24]=d,e[25]=Ge,e[26]=pe):pe=e[26];let be;if(e[27]!==f||e[28]!==o){let ye;e[30]!==f?(ye=Ve=>s.jsx(Pt,{item:Ve,onClose:f},Ve.key),e[30]=f,e[31]=ye):ye=e[31],be=o.map(ye),e[27]=f,e[28]=o,e[29]=be}else be=e[29];let xe;e[32]!==f||e[33]!==i?(xe=s.jsx(Pt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=xe):xe=e[34];let Te;e[35]!==be||e[36]!==xe?(Te=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[be,xe]}),e[35]=be,e[36]=xe,e[37]=Te):Te=e[37];let je;e[38]!==pe||e[39]!==Te?(je=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[pe,Te]}),e[38]=pe,e[39]=Te,e[40]=je):je=e[40];let Le;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ye;e[45]!==a.theme||e[46]!==c?(ye=Ve=>{const{value:_e,icon:Ye,label:Je}=Ve;return s.jsx("button",{type:"button","aria-label":Je,onClick:()=>c(Xe=>({...Xe,theme:_e})),className:Q("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===_e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ye},_e)},e[45]=a.theme,e[46]=c,e[47]=ye):ye=e[47],Le=l.map(ye),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=Le}else Le=e[44];let Se;e[48]!==Le?(Se=s.jsx("div",{className:"flex items-center gap-0.5",children:Le}),e[48]=Le,e[49]=Se):Se=e[49];const He=a.enableSounds?"Disable sounds":"Enable sounds";let Be;e[50]!==c?(Be=()=>c(ml),e[50]=c,e[51]=Be):Be=e[51];const ht=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ue;e[52]!==ht?(Ue=Q("size-8 rounded-md flex items-center justify-center transition-colors",ht),e[52]=ht,e[53]=Ue):Ue=e[53];let qe;e[54]!==a.enableSounds?(qe=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[54]=a.enableSounds,e[55]=qe):qe=e[55];let $e;e[56]!==He||e[57]!==Be||e[58]!==Ue||e[59]!==qe?($e=s.jsx("button",{type:"button","aria-label":He,onClick:Be,className:Ue,children:qe}),e[56]=He,e[57]=Be,e[58]=Ue,e[59]=qe,e[60]=$e):$e=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.97.7"]}),e[61]=ve):ve=e[61];let We;e[62]!==$e?(We=s.jsxs("div",{className:"flex items-center gap-2",children:[$e,ve]}),e[62]=$e,e[63]=We):We=e[63];let Ke;e[64]!==Se||e[65]!==We?(Ke=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Se,We]}),e[64]=Se,e[65]=We,e[66]=Ke):Ke=e[66];let gt;return e[67]!==fe||e[68]!==je||e[69]!==Ke?(gt=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[fe,je,Ke]}),e[67]=fe,e[68]=je,e[69]=Ke,e[70]=gt):gt=e[70],gt}const x=n?.name??"U";let g;e[71]!==x||e[72]!==r?(g=s.jsx(is,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ul)},e[81]=n,e[82]=k):k=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx($s,{size:14}),e[83]=S):S=e[83];let I;e[84]!==k?(I=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=k,e[85]=I):I=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let $;e[87]!==I?($=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[I,T]})}),e[87]=I,e[88]=$):$=e[88];let O;e[89]!==$||e[90]!==g||e[91]!==_?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,_,$]}),e[89]=$,e[90]=g,e[91]=_,e[92]=O):O=e[92];let A;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=W=>s.jsx(Pt,{item:W,onClose:f},W.key),e[96]=f,e[97]=X):X=e[97],A=o.map(X),e[93]=f,e[94]=o,e[95]=A}else A=e[95];let C;e[98]!==f||e[99]!==i?(C=s.jsx(Pt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=C):C=e[100];let M;e[101]!==A||e[102]!==C?(M=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,C]}),e[101]=A,e[102]=C,e[103]=M):M=e[103];let K;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=W=>{const{value:ne,icon:ie,label:ce}=W;return s.jsx("button",{type:"button","aria-label":ce,onClick:()=>c(se=>({...se,theme:ne})),className:Q("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ne?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ie},ne)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],K=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=K}else K=e[107];let U;e[111]!==K?(U=s.jsx("div",{className:"flex items-center gap-0.5",children:K}),e[111]=K,e[112]=U):U=e[112];const E=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(dl),e[113]=c,e[114]=L):L=e[114];const R=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[115]!==R?(H=Q("size-7 rounded-md flex items-center justify-center transition-colors",R),e[115]=R,e[116]=H):H=e[116];let P;e[117]!==a.enableSounds?(P=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[117]=a.enableSounds,e[118]=P):P=e[118];let G;e[119]!==E||e[120]!==L||e[121]!==H||e[122]!==P?(G=s.jsx("button",{type:"button","aria-label":E,onClick:L,className:H,children:P}),e[119]=E,e[120]=L,e[121]=H,e[122]=P,e[123]=G):G=e[123];let D;e[124]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.97.7"]}),e[124]=D):D=e[124];let B;e[125]!==G?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[G,D]}),e[125]=G,e[126]=B):B=e[126];let F;e[127]!==U||e[128]!==B?(F=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[U,B]}),e[127]=U,e[128]=B,e[129]=F):F=e[129];let Y;e[130]!==O||e[131]!==M||e[132]!==F?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,M,F]}),e[130]=O,e[131]=M,e[132]=F,e[133]=Y):Y=e[133];const Z=String(p);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==Z?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Z)}),e[134]=m,e[135]=u,e[136]=d,e[137]=Z,e[138]=V):V=e[138];let J;return e[139]!==Y||e[140]!==V?(J=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,V]}),e[139]=Y,e[140]=V,e[141]=J):J=e[141],J}function dl(t){return{...t,enableSounds:!t.enableSounds}}function ul(){Ae.success("User ID copied")}function ml(t){return{...t,enableSounds:!t.enableSounds}}function fl(){Ae.success("User ID copied")}function cs(){const t=N.c(44),{data:e}=we.useSession(),{org:n}=ue(),r=Ee();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=cr(o)?.params.org,[a,c]=dr(),d=ps(),[u,m]=z.useState(!1),[f,h]=z.useState(!1),p=e?.user,x=p?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(vt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Uo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Er,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(Qo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={key:"github",label:"decocms/studio",icon:s.jsx(ur,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=T):T=t[13];let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={key:"community",label:"Community",icon:s.jsx(Jo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=$):$=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(qo,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let A;t[16]!==_||t[17]!==k?(A=[_,...k,S,I,T,$,O],t[16]=_,t[17]=k,t[18]=A):A=t[18];const C=A;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M={key:"logout",label:"Sign out",icon:s.jsx(Wo,{size:16}),onClick:xl},t[19]=M):M=t[19];const K=M;let U;t[20]===Symbol.for("react.memo_cache_sentinel")?(U={value:"light",icon:s.jsx(Ko,{size:14}),label:"Light theme"},t[20]=U):U=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(Vo,{size:14}),label:"Dark theme"},t[21]=E):E=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=[U,E,{value:"system",icon:s.jsx(xn,{size:14}),label:"System theme"}],t[22]=L):L=t[22];const R=L;let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{m(!1),h(!0)},t[23]=H):H=t[23];let P;t[24]!==b||t[25]!==d||t[26]!==C||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(P={user:p,userImage:x,menuItems:C,signOutItem:K,themeOptions:R,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:H,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=C,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=P):P=t[33];const G=P;let D;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==G?(D=d?s.jsxs(tn,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(sn,{className:"h-[80dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Account"}),s.jsx(Es,{...G})]})]}):s.jsxs(Bt,{open:u,onOpenChange:m,children:[s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Ut,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:pl,children:s.jsx(Es,{...G})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=G,t[38]=D):D=t[38];let B;t[39]!==f?(B=s.jsx(ol,{open:f,onOpenChange:h}),t[39]=f,t[40]=B):B=t[40];let F;return t[41]!==D||t[42]!==B?(F=s.jsxs(s.Fragment,{children:[D,B]}),t[41]=D,t[42]=B,t[43]=F):F=t[43],F}function pl(t){return t.preventDefault()}function xl(){ee("signed_out",{source:"account_popover"}),mr(),we.signOut()}function hl({invitation:t}){const[e,n]=z.useState(!1),[r,o]=z.useState(!1),i=pr(),l=async()=>{n(!0);try{const d=await we.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),xr();let c;try{c=(await we.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await we.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(xs,{size:14})}),s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(hs,{size:14})})]})]})}function gl(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=hi(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(is,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xs,{size:14}),e[11]=h):h=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==o||e[16]!==n.id?(x=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(hs,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==x?(b=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let y;return e[25]!==j||e[26]!==d||e[27]!==m?(y=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=y):y=e[28],y}function bl(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(bs,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function jl(){const t=z.useContext(hr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function $n(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=ro(),o=jl(),i=gi();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Nl).map(_l),u=[...o].sort(Sl).map(yl);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...oo].sort(vl).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function vl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function yl(t){return{type:"invitation",invitation:t}}function Sl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function _l(t){return{type:"join-request",request:t}}function Nl(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class An extends z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function zn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Cl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=Q(o!=null&&zn(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ln,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Oe,{children:s.jsx(he,{children:s.jsxs(ke,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function wl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Cl,{})})}),t[0]=e):e=t[0],e}function kl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=Q(o!=null&&zn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ln,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(De,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Il(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(kl,{})})}),t[0]=e):e=t[0],e}function On(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=$n(),[i,l]=z.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(Ut,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Yo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(io,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(gs,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(gl,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(hl,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(bl,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Bt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function Pn(){const{redDotCount:t}=$n();return t>0}function Tl(){const t=N.c(6),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(On,{children:s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function $l(){const t=N.c(8),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(xt,{asChild:!0,children:s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(De,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(On,{children:s.jsxs(Me,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Al(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(hn,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function zl(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Me,{delayDuration:300,children:[s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(hn,{className:"size-4"})})}),s.jsx(De,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Ol(){const t=N.c(7),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Pl(){const t=N.c(9),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(De,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Me,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Dl(){const t=N.c(6),{state:e}=Qe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(wl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Al,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(Tl,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Ol,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(rs,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Oe,{children:[i,l,a,s.jsx(he,{children:s.jsx(cs,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),s.jsx(Pl,{}),s.jsx($l,{}),s.jsx(zl,{}),s.jsx(Il,{})]})}),t[5]=r):r=t[5],r}function Ml(){const t=N.c(8),e=Ee(),{org:n}=ue(),{setOpenMobile:r}=Qe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ge,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Rl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(El,{virtualMcpId:n,size:i}):s.jsx(Re,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(jn,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function El(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=jt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Re,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Re,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Fl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=z.useState(""),{org:l}=ue(),{setTaskId:a}=dn(),c=bn();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=fs,d=ms.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=C=>{C||i(""),r(C)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=C=>{v(!1),a(C.id,C.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const k=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(vi,{className:"sr-only",children:[s.jsx(yi,{children:"Search"}),s.jsx(Si,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let I;e[20]!==o?(I=s.jsx(ki,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let T;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==m?(T=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ci,{children:"No results."}):j.map(C=>C.type==="thread"?s.jsxs(wi,{value:`thread:${C.id}:${C.title}`,onSelect:()=>k(C),className:"gap-2.5",children:[s.jsx(Rl,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=m,e[26]=T):T=e[26];let $;e[27]!==T?($=s.jsx(Ii,{children:T}),e[27]=T,e[28]=$):$=e[28];let O;e[29]!==I||e[30]!==$?(O=s.jsxs(_i,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(Ti,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,$]})]}),e[29]=I,e[30]=$,e[31]=O):O=e[31];let A;return e[32]!==v||e[33]!==n||e[34]!==O?(A=s.jsx(Ni,{open:n,onOpenChange:v,children:O}),e[32]=v,e[33]=n,e[34]=O,e[35]=A):A=e[35],A}function Gl(t){return t==="owner"||t==="admin"}function Ll(){const t=N.c(11),{locator:e}=ue(),n=$i(),{data:r}=we.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=ms.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=fs(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=Gl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var ss,qt="HoverCard",[Dn]=jr(qt,[Xs]),Wt=Xs(),[Hl,Kt]=Dn(qt),Mn=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=Wt(e),d=z.useRef(0),u=z.useRef(0),m=z.useRef(!1),f=z.useRef(!1),[h,p]=Cr({prop:r,defaultProp:o??!1,onChange:i,caller:qt}),x=z.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=z.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),b=z.useCallback(()=>p(!1),[p]);return z.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(Hl,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(wr,{...c,children:n})})};Mn.displayName=qt;var Rn="HoverCardTrigger",En=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Kt(Rn,n),i=Wt(n);return s.jsx(gr,{asChild:!0,...i,children:s.jsx(br.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:ze(t.onPointerEnter,Ft(o.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(o.onClose)),onFocus:ze(t.onFocus,o.onOpen),onBlur:ze(t.onBlur,o.onClose),onTouchStart:ze(t.onTouchStart,l=>l.preventDefault())})})});En.displayName=Rn;var vs="HoverCardPortal",[Bl,Ul]=Dn(vs,{forceMount:void 0}),Fn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=Kt(vs,e);return s.jsx(Bl,{scope:e,forceMount:n,children:s.jsx(Qs,{present:n||i.open,children:s.jsx(Nr,{asChild:!0,container:o,children:r})})})};Fn.displayName=vs;var Et="HoverCardContent",Gn=z.forwardRef((t,e)=>{const n=Ul(Et,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=Kt(Et,t.__scopeHoverCard);return s.jsx(Qs,{present:r||i.open,children:s.jsx(ql,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ze(t.onPointerEnter,Ft(i.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(i.onClose)),ref:e})})});Gn.displayName=Et;var ql=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=Kt(Et,n),d=Wt(n),u=z.useRef(null),m=vr(e,u),[f,h]=z.useState(!1);return z.useEffect(()=>{if(f){const p=document.body;return ss=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=ss,p.style.webkitUserSelect=ss}}},[f]),z.useEffect(()=>{if(u.current){const p=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),z.useEffect(()=>{u.current&&Vl(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),s.jsx(yr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ze(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(Sr,{...d,...a,onPointerDown:ze(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Wl="HoverCardArrow",Kl=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Wt(n);return s.jsx(_r,{...o,...r,ref:e})});Kl.displayName=Wl;function Ft(t){return e=>e.pointerType==="touch"?void 0:t()}function Vl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Yl=Mn,Xl=En,Ql=Fn,Jl=Gn;function Zl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Yl,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function ea(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Xl,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function ta(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(Ql,{"data-slot":"hover-card-portal",children:s.jsx(Jl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Ln(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ce,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(Ot,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(vt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let p;e[10]!==f?(p=s.jsxs(Ot,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>a(n,!r),children:[s.jsx(Yr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>c(n),children:[s.jsx(Xo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,p,x,g]}),e[21]=m,e[22]=p,e[23]=x,e[24]=g,e[25]=b):b=e[25],b}function sa(t){return t==="ephemeral"||t.startsWith("thread:")}function Vt(t){const e=N.c(46),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c,indented:d}=t,u=Ai(n.status),m=u.icon,f=n.metadata?.kind==="tool_call_run",h=jt(f?void 0:n.virtual_mcp_id);let p;e[0]!==h?(p=Io(h),e[0]=h,e[1]=p):p=e[1];const x=p;Oi(6e4);const g=l||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==o?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=d?"-ml-4 pl-6":"pl-2",k=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_||e[5]!==k?(S=Q("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",k),e[4]=_,e[5]=k,e[6]=S):S=e[6];let I;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(I=a&&!f&&s.jsx(Re,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=I):I=e[11];let T;e[12]!==g?(T=g&&s.jsx(jn,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=g,e[13]=T):T=e[13];const $=n.title||"Untitled task";let O;e[14]!==$?(O=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[14]=$,e[15]=O):O=e[15];let A;e[16]!==T||e[17]!==O?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[T,O]}),e[16]=T,e[17]=O,e[18]=A):A=e[18];let C;e[19]!==x||e[20]!==r||e[21]!==n.branch||e[22]!==n.updated_at?(C=n.updated_at&&s.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!sa(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Pi(new Date(n.updated_at))})]}),e[19]=x,e[20]=r,e[21]=n.branch,e[22]=n.updated_at,e[23]=C):C=e[23];let M;e[24]!==A||e[25]!==C?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,C]}),e[24]=A,e[25]=C,e[26]=M):M=e[26];const K="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(m,{size:14,className:Q(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[27]!==i?(E=B=>{B.stopPropagation(),i()},e[27]=i,e[28]=E):E=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(kr,{size:14}),e[29]=L):L=e[29];let R;e[30]!==E?(R=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:L})}),e[30]=E,e[31]=R):R=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(De,{side:"right",children:"Archive"}),e[32]=H):H=e[32];let P;e[33]!==R?(P=s.jsxs(Me,{children:[R,H]}),e[33]=R,e[34]=P):P=e[34];let G;e[35]!==U||e[36]!==P?(G=s.jsxs("div",{className:K,children:[U,P]}),e[35]=U,e[36]=P,e[37]=G):G=e[37];let D;return e[38]!==o||e[39]!==M||e[40]!==G||e[41]!==v||e[42]!==S||e[43]!==I||e[44]!==n.id?(D=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:o,onKeyDown:v,className:S,children:[I,M,G]}),e[38]=o,e[39]=M,e[40]=G,e[41]=v,e[42]=S,e[43]=I,e[44]=n.id,e[45]=D):D=e[45],D}function ys(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(Ks,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function na(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function ra(t){return t.member==="mine"&&!t.currentUserId}const Hn=4;let Mt=0;const ds=[];function oa(){for(;Mt<Hn&&ds.length>0;){const t=ds.shift();t&&t()}}function Bn(t){return new Promise((e,n)=>{const r=()=>{Mt++,t().then(e,n).finally(()=>{Mt--,oa()})};Mt<Hn?r():ds.push(r)})}const Yt=10;function Fs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ia(t,e,n,r){let o=0;for(const i of t)Ss(i,e,n,r)&&o++;return o}function ns(t,e,n,r){return ia(t,e,n,r)}function la(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Ss(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function aa(t,e){return!!(t>=Yt||t===0&&e)}function Gs(t,e){return t<e}function ca(t,e){return e===!1?!1:e===!0?!0:t}function Ss(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Gt=new Map,Dt=new Map;function da(t,e){return e?t>=Yt?!0:null:!1}function Ls(t){return Gt.get(t)}function ua(t,e){Gt.set(t,e)}function ma(t,e,n){const r=Gt.get(t);if(r!==void 0){n(r);return}let o=Dt.get(t);o||(o=Bn(e).then(i=>(Gt.set(t,i),Dt.delete(t),i)).catch(()=>(Dt.delete(t),Promise.reject(new Error("group probe failed")))),Dt.set(t,o)),o.then(n,()=>n(!1))}function Hs(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Yt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function fa(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Ss(l,n,r,o)&&i++;return i}function _s(t,e,n,r){const o=N.c(8),{org:i}=ue(),l=na(i.id,t,e,n);let a;o[0]!==n?(a=ra(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=to(),{threads:f,hasMore:h}=cn(),p=r??ns(f,t,e,n),x=aa(p,h),g=da(p,h),b=bn();if(d.identity===l&&d.serverHasMore===null){const S=g??Ls(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&Ls(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),ma(l,async()=>{const S=Fs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:T}=Hs(I),$=ns(m.threads.get(),t,e,n);return T===void 0?!1:Gs($,T)},S=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(T=>T.identity===I?{...T,isFetching:!0}:T);try{const T=ns(f,t,e,n),$=Fs(t,e,T,n,Yt),O=await Bn(()=>b.call("COLLECTION_THREADS_LIST",$)),{items:A,hasMore:C,totalCount:M}=Hs(O),K=new Set(f.map(pa)),U=fa(A,K,t,e,n),E=T;m.mergeThreads(A),u(L=>{if(L.identity!==I)return L;let R;return M!==void 0?R=Gs(E+U,M):R=A.length===0||U===0?!1:C,ua(I,R),{...L,isFetching:!1,serverHasMore:R}})}catch(T){const $=T,O=$ instanceof Error?$.message:String($);Ae.error(`Could not load more tasks: ${O}`),u(A=>A.identity===I?{...A,isFetching:!1}:A)}},v=d.isFetching||d.isProbing,_=!c&&!v&&ca(x,d.serverHasMore);let k;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function pa(t){return t.id}function Un(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:p,groupVisibleCount:x}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=jt(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,k=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=X=>{p?.isDragging||X&&ee("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const I=!!(y&&o&&y.id===o),T=p?"Drag to reorder":void 0;let $;e[8]!==p?($=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=$):$=e[9];const O=p&&"cursor-pointer active:cursor-grabbing touch-none",A=p?.isDragging&&"cursor-grabbing";let C;e[10]!==A||e[11]!==O?(C=Q("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",O,A),e[10]=A,e[11]=O,e[12]=C):C=e[12];const M=j?.icon??null,K=j?.title??"?";let U;e[13]!==M||e[14]!==K?(U=s.jsx(Re,{icon:M,name:K,size:"sm+",className:"rounded-lg"}),e[13]=M,e[14]=K,e[15]=U):U=e[15];let E;e[16]!==_||e[17]!==C||e[18]!==U||e[19]!==I||e[20]!==T||e[21]!==$?(E=s.jsx(he,{children:s.jsx(vn,{asChild:!0,children:s.jsx(ea,{asChild:!0,children:s.jsx(ke,{onClick:_,isActive:I,title:T,...$,className:C,children:U})})})}),e[16]=_,e[17]=C,e[18]=U,e[19]=I,e[20]=T,e[21]=$,e[22]=E):E=e[22];const L=h??xa;let R;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==L||e[29]!==n?(R=s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:L,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=L,e[29]=n,e[30]=R):R=e[30];let H;e[31]!==E||e[32]!==R?(H=s.jsxs(Sn,{children:[E,R]}),e[31]=E,e[32]=R,e[33]=H):H=e[33];const P=j?.title??"Agent";let G;e[34]!==P?(G=s.jsx("span",{className:"truncate",children:P}),e[34]=P,e[35]=G):G=e[35];let D;e[36]!==c||e[37]!==n?(D=()=>c(n),e[36]=c,e[37]=n,e[38]=D):D=e[38];let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ce,{size:14}),e[39]=B):B=e[39];let F;e[40]!==D?(F=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:D,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:B}),e[40]=D,e[41]=F):F=e[41];let Y;e[42]!==G||e[43]!==F?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,F]}),e[42]=G,e[43]=F,e[44]=Y):Y=e[44];let Z;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(Z=s.jsx(ha,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=Z):Z=e[52];let V;e[53]!==Y||e[54]!==Z?(V=s.jsxs(ta,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,Z]}),e[53]=Y,e[54]=Z,e[55]=V):V=e[55];let J;return e[56]!==H||e[57]!==V||e[58]!==k||e[59]!==S?(J=s.jsxs(Zl,{open:k,openDelay:120,closeDelay:150,onOpenChange:S,children:[H,V]}),e[56]=H,e[57]=V,e[58]=k,e[59]=S,e[60]=J):J=e[60],J}function xa(){}function ha(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=_s("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Vt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(ys,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ga(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:zo},a[1]=u):u=a[1];const m=To(Ts(Ao,d),Ts($o,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=uo(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!mo(v,_,o))return;const k=fo(h,v,_),S=po(e,n,o,k);e==="org"?xo(n.orgId,S):ho(n,S),ee("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=p):p=a[13];const x=p;let g;return a[14]!==x||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function ba(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function ja(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ro(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:Eo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Bs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:p}=ga(r,n,o,i,l,a,c);if(r.length===0)return null;const x=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(y=v=>{const _=d(v);return h.includes(v.virtualMcpId)?s.jsx(ja,{id:v.virtualMcpId,children:k=>{const{setNodeRef:S,style:I,isDragging:T,attributes:$,listeners:O}=k;return s.jsx("div",{ref:S,style:I,className:Q(T&&"opacity-50"),children:u(_,{attributes:$,listeners:O,isDragging:T})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=y):y=e[10],g=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==x||e[12]!==g?(b=s.jsx(Oo,{items:x,strategy:Po,children:g}),e[11]=x,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Do,{sensors:f,collisionDetection:Mo,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function qn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:p,user:x,toolCallRuns:g}=go(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ba,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(Bs,{section:"org",groups:p,...y}),v,s.jsx(Bs,{section:"user",groups:x,...y}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function va(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Sa,renderSortable:ya}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ya(t,e){return s.jsx(Un,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Sa(t){return s.jsx(Un,{...t},t.virtualMcpId)}const _a="sidebar.group.expanded.";function Wn(t,e){const n=N.c(3),[r,o]=us(`${_a}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Kn(t){const e=N.c(70),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:h,groupVisibleCount:p,devPartnerId:x,devGroupVisibleCount:g,sortable:b}=t,j=u===void 0?!1:u,y=m===void 0?!1:m,v=x===void 0?null:x,[_,k]=Wn(n,!1),S=n===os,I=b?.isDragging??!1;let T;e[0]!==v||e[1]!==r?(T=v?r.filter(W=>W.virtual_mcp_id===v):[],e[0]=v,e[1]=r,e[2]=T):T=e[2];const $=T;let O;e[3]!==v||e[4]!==r?(O=v?r.filter(W=>W.virtual_mcp_id!==v):r,e[3]=v,e[4]=r,e[5]=O):O=e[5];const A=O,C=!!v&&($.length>0||(g??0)>0);let M;e[6]!==_||e[7]!==k?(M=function(){k(!_)},e[6]=_,e[7]=k,e[8]=M):M=e[8];const K=M;let U;e[9]!==S||e[10]!==b?(U=b&&!S?{...b.attributes,...b.listeners}:{},e[9]=S,e[10]=b,e[11]=U):U=e[11];let E;e[12]!==K?(E=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),K())},e[12]=K,e[13]=E):E=e[13];const L=b&&!S&&"touch-none active:cursor-grabbing",R=I&&"shadow-md bg-accent/40 cursor-grabbing";let H;e[14]!==R||e[15]!==L?(H=Q("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",L,R),e[14]=R,e[15]=L,e[16]=H):H=e[16];let P;e[17]!==S||e[18]!==n?(P=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:S})}),e[17]=S,e[18]=n,e[19]=P):P=e[19];let G;e[20]!==_?(G=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:_?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[20]=_,e[21]=G):G=e[21];let D;e[22]!==P||e[23]!==G?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[P,G]}),e[22]=P,e[23]=G,e[24]=D):D=e[24];let B;e[25]!==S||e[26]!==n?(B=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ka,{virtualMcpId:n,isToolCallRuns:S})}),e[25]=S,e[26]=n,e[27]=B):B=e[27];let F;e[28]!==S||e[29]!==a||e[30]!==n?(F=!S&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:W=>{W.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ce,{size:14})}),e[28]=S,e[29]=a,e[30]=n,e[31]=F):F=e[31];let Y;e[32]!==_||e[33]!==K||e[34]!==H||e[35]!==D||e[36]!==B||e[37]!==F||e[38]!==U||e[39]!==E?(Y=s.jsxs("div",{...U,role:"button",tabIndex:0,"aria-expanded":_,onClick:K,onKeyDown:E,className:H,children:[D,B,F]}),e[32]=_,e[33]=K,e[34]=H,e[35]=D,e[36]=B,e[37]=F,e[38]=U,e[39]=E,e[40]=Y):Y=e[40];const Z=Y;let V;e[41]!==y||e[42]!==Z||e[43]!==j||e[44]!==S||e[45]!==d||e[46]!==a||e[47]!==c||e[48]!==f||e[49]!==n?(V=S?Z:s.jsxs(Sn,{children:[s.jsx(vn,{asChild:!0,children:Z}),s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:j,canManageOrgPin:y,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??Na,onHideGroup:d})})]}),e[41]=y,e[42]=Z,e[43]=j,e[44]=S,e[45]=d,e[46]=a,e[47]=c,e[48]=f,e[49]=n,e[50]=V):V=e[50];let J;e[51]!==o||e[52]!==g||e[53]!==v||e[54]!==$||e[55]!==_||e[56]!==h||e[57]!==p||e[58]!==S||e[59]!==A||e[60]!==l||e[61]!==a||e[62]!==i||e[63]!==C||e[64]!==r||e[65]!==n?(J=_&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:S?r.map(W=>s.jsx(Vt,{task:W,isActive:o===W.id,onClick:()=>i(W),onArchive:()=>l(W),showAutomationBadge:!!W.trigger_id,indented:!0},W.id)):s.jsxs(s.Fragment,{children:[s.jsx(Us,{virtualMcpId:n,threads:A,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:p}),C&&v&&s.jsxs("div",{className:"flex flex-col gap-0.5 mt-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80",children:[s.jsx(Xr,{size:11}),"Develop"]}),s.jsx(Us,{virtualMcpId:v,threads:$,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:g})]})]})}),e[51]=o,e[52]=g,e[53]=v,e[54]=$,e[55]=_,e[56]=h,e[57]=p,e[58]=S,e[59]=A,e[60]=l,e[61]=a,e[62]=i,e[63]=C,e[64]=r,e[65]=n,e[66]=J):J=e[66];let X;return e[67]!==V||e[68]!==J?(X=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[V,J]}),e[67]=V,e[68]=J,e[69]=X):X=e[69],X}function Na(){}function Ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Re,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(wa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wa(t){const e=N.c(4),{virtualMcpId:n}=t,r=jt(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Re,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ka(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Ia,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Ia(t){const e=N.c(2),{virtualMcpId:n}=t,o=jt(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Us(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=_s("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:h,serverHasMore:p}=u,[x,g]=z.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(g(!0),queueMicrotask(()=>{h()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==h||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 -ml-4 pl-6 pr-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ce,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,indented:!0},y.id)),(b||m)&&s.jsx(ys,{onClick:()=>{h()},isFetching:m,indented:!0})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=h,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function Ta(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=_s("status",n,a),[h,p]=z.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let g;e[9]!==m||e[10]!==c||e[11]!==u?(g=(m||c)&&s.jsx(ys,{onClick:()=>{u()},isFetching:c,indented:!0}),e[9]=m,e[10]=c,e[11]=u,e[12]=g):g=e[12];let b;return e[13]!==x||e[14]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[13]=x,e[14]=g,e[15]=b):b=e[15],b}function $a(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=zi[n],d=c.icon,[u,m]=Wn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,y]}),e[17]=u,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ta,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==v||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=k):k=e[34],k}function Aa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Oa,renderSortable:za}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function za(t,e){return s.jsx(Kn,{...t,sortable:e},t.virtualMcpId)}function Oa(t){return s.jsx(Kn,{...t},t.virtualMcpId)}function Pa(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Da(t,e,n,r,o){const i=N.c(5),l=Pa(t,e,r,o),[a,c]=z.useState("");a!==l&&(bo(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=jo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const Vn={all:"All tasks",manual:"Chats",automation:"Automation"},Yn={all:"All members",mine:"Mine only"},qs={agent:"Agent",status:"Status"};function Xn(t){const e=N.c(95);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:r}=n,{data:o}=we.useSession(),i=o?.user?.id,l=i??"anon",{org:a}=ue(),c=Lr(a.id).id,d=on(),{liveToDev:u,devToLive:m}=Fo(d),f=un(d),h=Ll(),p=Hr();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];const[g,b]=z.useState(x),j=new Set(f),y={},v=[];let _;e[3]!==g?(_=Object.entries(g),e[3]=g,e[4]=_):_=e[4];for(const[w,q]of _)j.has(w)!==q?y[w]=q:v.push(w);v.length>0&&b(w=>{const q={...w};for(const te of v)delete q[te];return q});const k=new Set(f);for(const[w,q]of Object.entries(y))q?k.add(w):k.delete(w);const S=[...k],I=new Set(S),{threads:T}=cn(),$=T.filter(Wa),{hide:O}=an(),A=Ee(),{setTaskId:C,createNewTask:M}=dn();let K;e[5]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},e[5]=K):K=e[5];const E=Ys(K).taskId??null;let L;e[6]!==r?(L=()=>{r?.()},e[6]=r,e[7]=L):L=e[7];const R=L,H=[...$].sort(qa),[P,G]=z.useState("all"),[D,B]=z.useState("mine"),[F,Y]=z.useState("agent"),[Z,V]=z.useState(!1),[J,X]=z.useState(!1),[W,ne]=z.useState(0),ie=vo(),ce=W+ie;let se;e[8]!==a.id||e[9]!==l?(se={orgId:a.id,userId:l},e[8]=a.id,e[9]=l,e[10]=se):se=e[10];const re=se,le={type:P,member:D,currentUserId:i??null},me=la(H,"agent",le),oe=Da(re,yo(So(H,c),m),c,S,ce);let Ie;e[11]!==d?(Ie=new Set(d.map(Ua).filter(Ba)),e[11]=d,e[12]=Ie):Ie=e[12];const Fe=Ie,fe=oe.filter(w=>w.virtualMcpId===c||w.virtualMcpId===os||Fe.has(w.virtualMcpId));let Ge;e[13]!==i||e[14]!==D?(Ge=w=>D==="mine"&&i?w.filter(q=>q.created_by===i):w,e[13]=i,e[14]=D,e[15]=Ge):Ge=e[15];const pe=Ge;let be;e[16]!==P?(be=w=>P==="automation"?w.filter(Ha):P==="manual"?w.filter(La):w,e[16]=P,e[17]=be):be=e[17];const xe=be,Te=w=>{const q=w.id===E;if(O(w.id),!q)return;const te=H.find(de=>de.id!==w.id&&de.virtual_mcp_id===w.virtual_mcp_id&&de.created_by===i);R(),te?C(te.id,te.virtual_mcp_id):A({to:"/$org",params:{org:a.slug}})};let je;e[18]!==R||e[19]!==M?(je=w=>{ee("sidebar_group_new_clicked",{virtual_mcp_id:w}),R(),M(w)},e[18]=R,e[19]=M,e[20]=je):je=e[20];const Le=je,Se=_o();let He;e[21]!==R||e[22]!==Se?(He=w=>{ee("sidebar_group_settings_clicked",{virtual_mcp_id:w}),R(),Se(w,{search:{main:"instructions"}})},e[21]=R,e[22]=Se,e[23]=He):He=e[23];const Be=He,ht=w=>{if(I.has(w))return;ee("sidebar_group_hide_clicked",{virtual_mcp_id:w});const q=fe.find(te=>te.virtualMcpId===w);if(q)for(const te of q.threads)O(te.id);Co(re,w,S),ne(Ga)},Ue=async(w,q)=>{if(h&&y[w]===void 0){ee("sidebar_group_org_pin_toggled",{virtual_mcp_id:w,pinned:q}),b(te=>({...te,[w]:q}));try{await p.update.mutateAsync({id:w,data:{pinned:q}})}catch{wo(re,w,!q),b(te=>{const de={...te};return delete de[w],de})}}},qe=w=>{const q=w===c||w===os;return{isOrgPinned:q||I.has(w),canManageOrgPin:q?!1:h,onToggleOrgPin:q?void 0:Ue}},$e=w=>{const q=xe(pe(w.threads)),te=u.get(w.virtualMcpId)??null;return{virtualMcpId:w.virtualMcpId,threads:q,devPartnerId:te,devGroupVisibleCount:te?me.get(te)??0:0,activeTaskId:E,filters:le,groupVisibleCount:me.get(w.virtualMcpId)??0,onSelectTask:de=>{R(),C(de.id,de.virtual_mcp_id)},onArchiveTask:Te,onNewTaskInGroup:Le,onShowSettings:Be,onHideGroup:ht,...qe(w.virtualMcpId)}},ve=P!=="all"||D!=="mine",{state:We,isMobile:Ke}=Qe();if(We==="collapsed"&&!Ke){let w;e[24]!==ve||e[25]!==pe||e[26]!==xe?(w=ts=>{const Zn=xe(pe(ts.threads));return!(ve&&Zn.length===0)},e[24]=ve,e[25]=pe,e[26]=xe,e[27]=w):w=e[27];const q=fe.filter(w),te=F==="agent"&&fe.length===0;let de;e[28]!==te?(de=s.jsx(Is,{value:te}),e[28]=te,e[29]=de):de=e[29];let zt;return e[30]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>ne(Fa),e[30]=zt):zt=e[30],s.jsxs(s.Fragment,{children:[de,s.jsx(Oe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(va,{groups:q,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:zt,renderGroup:ts=>$e(ts)})})]})}const ye="flex flex-col h-full min-h-0",Ve=F==="agent"&&fe.length===0;let _e;e[31]!==Ve?(_e=s.jsx(Is,{value:Ve}),e[31]=Ve,e[32]=_e):_e=e[32];let Ye;e[33]!==V?(Ye=()=>{ee("tasks_panel_search_opened"),X(!0),V(!0)},e[33]=V,e[34]=Ye):Ye=e[34];let Je;e[35]===Symbol.for("react.memo_cache_sentinel")?(Je=s.jsx(Qr,{size:16}),e[35]=Je):Je=e[35];let Xe;e[36]!==Ye?(Xe=s.jsx(ge,{"aria-label":"Search threads",onClick:Ye,children:Je}),e[36]=Ye,e[37]=Xe):Xe=e[37];const Xt=qs[F==="agent"?"status":"agent"];let yt;e[38]!==Xt?(yt=Xt.toLowerCase(),e[38]=Xt,e[39]=yt):yt=e[39];const Qt=`Group by ${yt}`,Jt=qs[F];let St;e[40]!==Jt?(St=Jt.toLowerCase(),e[40]=Jt,e[41]=St):St=e[41];const Zt=`Grouped by ${St}`;let Ze,et;e[42]!==F?(Ze=()=>{const w=F==="agent"?"status":"agent";ee("tasks_panel_group_by_changed",{to_value:w}),Y(w)},et=F==="agent"?s.jsx(ji,{size:16}):s.jsx(Jr,{size:16}),e[42]=F,e[43]=Ze,e[44]=et):(Ze=e[43],et=e[44]);let tt;e[45]!==Qt||e[46]!==Zt||e[47]!==Ze||e[48]!==et?(tt=s.jsx(ge,{"aria-label":Qt,title:Zt,onClick:Ze,children:et}),e[45]=Qt,e[46]=Zt,e[47]=Ze,e[48]=et,e[49]=tt):tt=e[49];let _t;e[50]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(bi,{size:16}),e[50]=_t):_t=e[50];let st;e[51]!==ve?(st=ve&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),e[51]=ve,e[52]=st):st=e[52];let nt;e[53]!==st?(nt=s.jsx(xt,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Filter tasks",children:[_t,st]})}),e[53]=st,e[54]=nt):nt=e[54];let rt;e[55]!==D?(rt=w=>{const q=w;q!==D&&ee("tasks_panel_member_filter_changed",{to_value:q}),B(q)},e[55]=D,e[56]=rt):rt=e[56];let Nt;e[57]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[57]=Nt):Nt=e[57];let Ct;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ct=Object.keys(Yn),e[58]=Ct):Ct=e[58];let wt;e[59]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(As,{children:Ct.map(Ea)}),e[59]=wt):wt=e[59];let ot;e[60]!==D||e[61]!==rt?(ot=s.jsx(Ws,{label:"Members",children:s.jsxs(Ps,{value:D,onValueChange:rt,children:[Nt,wt]})}),e[60]=D,e[61]=rt,e[62]=ot):ot=e[62];let it;e[63]!==P?(it=w=>{const q=w;q!==P&&ee("tasks_panel_filter_changed",{to_value:q}),G(q)},e[63]=P,e[64]=it):it=e[64];let kt;e[65]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[65]=kt):kt=e[65];let It;e[66]===Symbol.for("react.memo_cache_sentinel")?(It=Object.keys(Vn),e[66]=It):It=e[66];let Tt;e[67]===Symbol.for("react.memo_cache_sentinel")?(Tt=s.jsx(As,{children:It.map(Ra)}),e[67]=Tt):Tt=e[67];let lt;e[68]!==it||e[69]!==P?(lt=s.jsx(Ws,{label:"Type",children:s.jsxs(Ps,{value:P,onValueChange:it,children:[kt,Tt]})}),e[68]=it,e[69]=P,e[70]=lt):lt=e[70];let at;e[71]!==ot||e[72]!==lt?(at=s.jsx(Ut,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[ot,lt]})}),e[71]=ot,e[72]=lt,e[73]=at):at=e[73];let ct;e[74]!==nt||e[75]!==at?(ct=s.jsxs(Bt,{children:[nt,at]}),e[74]=nt,e[75]=at,e[76]=ct):ct=e[76];let dt;e[77]!==Xe||e[78]!==tt||e[79]!==ct?(dt=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Xe,tt,ct]}),e[77]=Xe,e[78]=tt,e[79]=ct,e[80]=dt):dt=e[80];let $t;e[81]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(Nn,{compact:!0}),e[81]=$t):$t=e[81];let ut;e[82]!==dt?(ut=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[dt,$t]}),e[82]=dt,e[83]=ut):ut=e[83];const Jn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",es=F==="status"?s.jsx(s.Fragment,{children:No(xe(pe(H))).map(w=>s.jsx($a,{status:w.status,threads:w.threads,activeTaskId:E,onSelectTask:q=>{R(),C(q.id,q.virtual_mcp_id)},onArchiveTask:Te,filters:le},w.status))}):s.jsx(Aa,{groups:fe,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:()=>ne(Ma),renderGroup:w=>({...$e(w)})});let mt;e[84]!==es?(mt=s.jsx("div",{className:Jn,children:es}),e[84]=es,e[85]=mt):mt=e[85];let ft;e[86]!==J||e[87]!==Z||e[88]!==V?(ft=J&&s.jsx(Fl,{open:Z,onOpenChange:V}),e[86]=J,e[87]=Z,e[88]=V,e[89]=ft):ft=e[89];let At;return e[90]!==_e||e[91]!==ut||e[92]!==mt||e[93]!==ft?(At=s.jsxs("div",{className:ye,children:[_e,ut,mt,ft]}),e[90]=_e,e[91]=ut,e[92]=mt,e[93]=ft,e[94]=At):At=e[94],At}function Ma(t){return t+1}function Ra(t){return s.jsx(gn,{value:t,children:Vn[t]},t)}function Ea(t){return s.jsx(gn,{value:t,children:Yn[t]},t)}function Fa(t){return t+1}function Ga(t){return t+1}function La(t){return!t.trigger_id}function Ha(t){return!!t.trigger_id}function Ba(t){return!!t}function Ua(t){return t.id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ws(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ka=5,Va=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Qn(){const t=N.c(3),{state:e}=Qe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ka}).map(Qa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"})]}),s.jsx(Ne,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Va.map(Ya)})]}),t[2]=r):r=t[2],r}function Ya(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(Ne,{className:"size-5 rounded-full shrink-0"}),s.jsx(Ne,{className:Q("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Xa)})]},e)}function Xa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Ne,{className:"h-3 flex-1 rounded-sm"})},e)}function Qa(t,e){return s.jsx(Ne,{className:"size-10 rounded-lg mx-auto"},e)}function Ja(){const t=N.c(4),e=Cn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Xn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(mn,{children:s.jsx(In,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Za(t){const e=N.c(9),{onClose:n}=t,r=Cn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ml,{}),e[0]=o):o=e[0];let i,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),l=s.jsx(Rt,{className:"mb-2"}),e[1]=i,e[2]=l):(i=e[1],l=e[2]);let a;e[3]!==n?(a=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:i,children:[l,s.jsx(Xn,{onNavigate:n})]})}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==r||e[7]!==a?(c=s.jsx(mn,{children:s.jsx(nl,{sections:r,onClose:n,footer:o,additionalContent:a})}),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}const ec="sidebar.open";function tc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Di,{}),t[0]=e):e=t[0],e}function ou(){const t=N.c(24),e=ps(),[n,r]=us(ec,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Fi();let c;t[0]!==e?(c=e?s.jsxs(ae.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx(ls,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ae.TogglesSlot,{}),s.jsx(ae.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ae.CenterSlot,{}),s.jsx(ae.RightSlot,{})]}):s.jsxs(ae.Header,{children:[s.jsxs(ae.LeftColumn,{children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx("span",{className:"hidden md:contents",children:s.jsx(ae.Nav,{})}),s.jsx(ae.TogglesSlot,{}),s.jsx(ls,{})]}),s.jsx(ae.CenterSlot,{}),s.jsxs(ae.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ae.TabsSlot,{})}),s.jsx(ae.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Ja,{}),s.jsx(Mi,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ar,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(z.Suspense,{fallback:s.jsx(tc,{}),children:s.jsx(Ir,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==m||t[11]!==f||t[12]!==i?(x=s.jsxs(zr,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,p]}),t[10]=m,t[11]=f,t[12]=i,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dr,{renderSidebar:sc}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(xi,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(so,{children:s.jsx(ae.Provider,{children:s.jsx(Or,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function sc(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Za,{onClose:e})})})}export{ou as default};
|
|
1
|
+
import{c as N,j as s,C as us,r as z,l as Q,i as Ks,w as ee,D as ue,a as we,F as Vs,K as ms,k as fs,b as Ee,e as Ys,u as er,G as tr,R as sr,H as nr,o as rr,s as or,n as ir,p as lr,d as ar,B as pt,I as cr,J as dr,t as Ae,M as ur,P as mr,x as fr,m as pr,y as xr,T as hr,U as gr,V as br,W as ze,X as Xs,Y as jr,Z as Qs,_ as vr,$ as yr,a0 as Sr,a1 as _r,a2 as Nr,a3 as Cr,a4 as wr,a5 as kr,E as Js,O as Ir}from"./index-MpjPxskG.js";import{u as Qe,S as he,a as ke,b as Lt,c as Ht,d as Oe,e as Zs,f as en,g as Tr,h as $r,i as rs,j as Ar,k as zr,l as Or}from"./sidebar-BHss58rk.js";import{u as ps}from"./use-mobile-taJ6Byue.js";import{u as Pr,S as Ns,M as Dr}from"./shell-controls-TBi4Bs6a.js";import{a as Mr,b as Rr,c as Er}from"./ZoomOut-CP848i3T.js";import{T as ge,a as ae}from"./toolbar-DbGfvfdI.js";import{a as Pe,b as De,T as Me,c as Cs}from"./tooltip-CEM9S4pg.js";import{S as Ne}from"./skeleton-BxYVo1ej.js";import{P as Bt,a as xt,b as Ut}from"./popover-CJe04WOy.js";import{D as tn,a as sn,b as nn}from"./drawer-CAJEFb6a.js";import{i as rn}from"./SearchMd-Dj_Z4iwH.js";import{s as Fr}from"./Star01-DTKqRt_Y.js";import{s as Ce}from"./Plus-CpiYI_4d.js";import{i as Gr,a as Lr}from"./use-mcp-client-D0CDCf2C.js";import{u as on,a as jt,b as Hr}from"./use-virtual-mcp-q2Cm2W65.js";import{u as Br}from"./use-create-virtual-mcp-CI7JmXUA.js";import{I as Ur,u as qr,W as Wr,H as Kr,S as Vr}from"./import-from-deco-dialog-CllLsuxG.js";import{A as Re,a as ws,b as ks,c as ln,d as Yr,e as Xr,i as Qr,f as Jr}from"./agent-icon-D4izi-0m.js";import{G as Zr,a as eo}from"./github-repo-picker-BlOw6wWo.js";import{u as an,a as to,b as cn,T as so}from"./hooks-BZmjB2Y3.js";import{r as no,u as ro,R as oo,a as io,b as dn}from"./shell-layout-D2QUbgoY.js";import{u as lo,g as un,a as ao,b as co,s as uo,c as mo,r as fo,d as po,e as xo,f as ho,p as go,T as os,h as bo,i as jo,j as vo,k as yo,l as So,m as _o,n as No,o as Co,q as wo,S as Is,t as mn}from"./use-navigate-to-agent-NCPMRSC-.js";import{g as ko,u as fn,A as pn,a as Io,b as To,c as Ts,K as $o,P as Ao,s as zo,S as Oo,v as Po,D as Do,d as Mo,e as Ro,C as Eo,f as Fo}from"./sortable.esm-CxO66Aqu.js";import{i as Go}from"./LayoutLeft-BFka2GeR.js";import{i as xn}from"./Monitor01-TMDQZq46.js";import{u as Lo,v as Ho,C as Bo}from"./connect-desktop-dialog-BXO2k7fs.js";import{A as is}from"./avatar-6LwZYACh.js";import{i as xs}from"./ChevronUp-B0N31Im_.js";import{a as $s}from"./Eye-5boS9nIv.js";import{n as Uo,i as qo}from"./Globe01-CRm2mh-P.js";import{i as Wo,a as hn}from"./ZapSquare-CQGn3oRj.js";import{n as Ko,a as Vo}from"./Sun-CY-48C0Q.js";import{a as vt,b as Yo,i as Xo}from"./Settings02-C_rkmGxP.js";import{i as Qo}from"./Shield01-DputbTqH.js";import{a as Jo}from"./Users03-BwME7x2o.js";import{s as hs}from"./XClose-DrdWWhVa.js";import{A as Zo,a as ei,b as ti,c as si,d as ni,e as ri,f as oi}from"./alert-dialog-CPIOFM7U.js";import{F as ii,a as li,b as ai,c as ci,d as di,f as ui,e as mi}from"./form-r_9hbLn7.js";import{I as fi}from"./input-Cr9jBfB7.js";import{S as pi,C as xi}from"./chat-context-B0mmOd9g.js";import"./index-C-Ms0LlR.js";import{n as gs}from"./Stars02-C3IQpZYm.js";import{u as hi,a as gi}from"./use-join-requests-DaCmnTl9.js";import{i as bs}from"./ChevronRight-CdRT7LjU.js";import{i as bi}from"./FilterLines-OqKdZVKs.js";import{t as ji}from"./Users01-CUJ27ws5.js";import{S as As,a as gn,b as zs,c as Os,d as Ps}from"./select-CP2O-MPr.js";import{c as vi,d as yi,e as Si,b as _i,a as Ni}from"./dialog-Cg3rcVr2.js";import{C as Ci,a as wi,b as ki,c as Ii,d as Ti}from"./command-CyTNhGQi.js";import{u as bn}from"./studio-tools-DVojvDEr.js";import{i as jn}from"./Zap-BcROp_Sw.js";import{u as $i}from"./use-org-auth-client-BI60dBQ8.js";import{C as Ot,a as Ds,b as vn,c as yn,d as Sn}from"./context-menu-Q1Owjt7Z.js";import{g as Ai,S as zi}from"./task-status-DXwOekTG.js";import{u as Oi,f as Pi}from"./use-clock-tick-BySyJdAG.js";import{t as _n}from"./ChevronDown-DKlpkOB2.js";import{S as Di}from"./shell-route-loading-CZ7PjWkH.js";import"./sheet-qUAd_2vk.js";import"./X-CyEH-HLB.js";import"./ChevronLeft-vu3jmJdt.js";import"./auth-BQJ4901M.js";import"./use-collections-CVlcIFcl.js";import"./use-connection-B7hehSBo.js";import"./collection-search-CCJeZtSC.js";import"./AlertCircle-B2tKCnm8.js";import"./Tool01-DIyxkJuF.js";import"./SwitchHorizontal01-Bt5waFYC.js";import"./XCircle-1yG7DJUE.js";import"./ArrowUpRight-C-ZXCXeN.js";import"./CheckCircle-BcI3T1tO.js";import"./DotsVertical-wEiyEk6D.js";import"./Globe04-BtSgO3H5.js";import"./HardDrive-DxtF-IY8.js";import"./Key01-LrqIifxa.js";import"./LinkExternal01-DgECMeuC.js";import"./Palette-D-5q-DfS.js";import"./Play-Mf5cQSsU.js";import"./Stars01-CmPmyHdC.js";import"./Trash01-B4wYspRk.js";import"./Upload01-Cx3iHgDj.js";import"./User01-bHHH-hCd.js";import"./checkbox-N0X_3WAx.js";import"./authenticate-and-persist-oauth-DxcPuu6b.js";import"./mcp-oauth-DpS4HNDv.js";import"./use-mcp-tools-oAYlV_rV.js";import"./extract-connection-data-CtVNT5JS.js";import"./decopilot-sse-pool-DGROjFUX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-QkAj4QVN.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-BCL7l3Gq.js";import"./use-org-sso-DRd1kOa9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CS3v7rYN.js";import"./use-registry-connections-C1tYRr1m.js";import"./useInfiniteQuery-B5tA5pfi.js";import"./use-infinite-scroll-Bzqu-Hgc.js";import"./card-QhB5x9Lx.js";import"./integration-icon-CcZDYv2E.js";import"./collection-tabs-CIbS_aRk.js";import"./badge-ClC_mVXH.js";import"./textarea-CixyZRlq.js";import"./connection-form-helpers-DhabLQU7.js";import"./useSuspenseInfiniteQuery-DtIVyYSY.js";import"./use-ai-providers-CpTKYZRn.js";import"./label-DE6yKu0U.js";import"./use-capability-t-9WULPE.js";import"./index-DKxonbsE.js";import"./differenceInSeconds-NQ4PDo0z.js";function Mi(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Qe();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const js=240,Ri=400,Ei="sidebar.width";function bt(t){return Math.max(js,Math.min(Ri,t))}function Fi(){const t=N.c(11),[e,n]=us(Ei,Gi),r=z.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=bt(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=bt(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=bt(f+(b.clientX-m));n(j);for(const y of p)y.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(js)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=bt(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Gi(t){return typeof t=="number"?bt(t):js}function Li(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=Q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Ks,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const Hi="Select an existing agent";function Bi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Pe,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(De,{side:"right",sideOffset:8,children:Hi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Me,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function Ui(){const t=N.c(5),{enableDecoImport:e}=Vs(),{data:n}=we.useSession();let r;t[0]!==n?.user?.email?(r=ms.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:qi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=fs(i);return l?.isDecoUser??!1}async function qi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Wi(t){const e=Ee(),{create:n}=an(),{locator:r}=ue(),o=Ys({strict:!1}),i=er({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?no(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ki(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Re,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Vi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=z.useState(""),a=on(),c=a??[],{org:d}=ue(),{data:u}=we.useSession(),m=u?.user?.id??"anon",f=un(a),h=ao();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:x,isCreating:g}=Br(p),{createFromTemplate:b,isCreating:j}=qr(),y=Ui(),v=Wi(d.slug),_=ko(a),k=i.toLowerCase(),S=c.filter(Yi).filter(oe=>!_.has(oe.id)).filter(oe=>!i||oe.title.toLowerCase().includes(k)),I=oe=>{co({orgId:d.id,userId:m},oe.id,f),h(),n(),l(""),v(oe.id)},T="flex flex-col max-h-[min(640px,80dvh)]";let $;e[1]!==i?($=s.jsx(Li,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=$):$=e[2];const O="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const C="grid grid-cols-3 gap-1";let M;e[4]!==x||e[5]!==n?(M=async()=>{ee("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=M):M=e[6];let K,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ce,{size:16,className:"text-muted-foreground"})}),U=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=K,e[8]=U):(K=e[7],U=e[8]);let E;e[9]!==g||e[10]!==M?(E=s.jsxs("button",{type:"button",disabled:g,onClick:M,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[K,U]}),e[9]=g,e[10]=M,e[11]=E):E=e[11];let L;e[12]!==b||e[13]!==n?(L=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(Wr),n()},e[12]=b,e[13]=n,e[14]=L):L=e[14];let R,H;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Fr,{className:"size-5 text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=R,e[16]=H):(R=e[15],H=e[16]);let P;e[17]!==j||e[18]!==L?(P=s.jsxs("button",{type:"button",disabled:j,onClick:L,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[R,H]}),e[17]=j,e[18]=L,e[19]=P):P=e[19];let G;e[20]!==b||e[21]!==n?(G=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await b(Kr),n()},e[20]=b,e[21]=n,e[22]=G):G=e[22];let D,B;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Vr,alt:"",className:"size-5 object-contain"})}),B=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=D,e[24]=B):(D=e[23],B=e[24]);let F;e[25]!==j||e[26]!==G?(F=s.jsxs("button",{type:"button",disabled:j,onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[D,B]}),e[25]=j,e[26]=G,e[27]=F):F=e[27];let Y;e[28]!==n||e[29]!==o?(Y=()=>{ee("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=Y):Y=e[30];let Z,V;e[31]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(eo,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=Z,e[32]=V):(Z=e[31],V=e[32]);let J;e[33]!==Y?(J=s.jsxs("button",{type:"button",onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[Z,V]}),e[33]=Y,e[34]=J):J=e[34];let X;e[35]!==y||e[36]!==n||e[37]!==r?(X=y&&s.jsxs("button",{type:"button",onClick:()=>{ee("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=y,e[36]=n,e[37]=r,e[38]=X):X=e[38];const W=S.map(oe=>s.jsx(Ki,{agent:oe,onClick:()=>I(oe)},oe.id));let ne;e[39]!==E||e[40]!==P||e[41]!==F||e[42]!==J||e[43]!==X||e[44]!==W?(ne=s.jsxs("div",{className:C,children:[E,P,F,J,X,W]}),e[39]=E,e[40]=P,e[41]=F,e[42]=J,e[43]=X,e[44]=W,e[45]=ne):ne=e[45];let ie;e[46]!==g||e[47]!==i||e[48]!==S.length?(ie=S.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=g,e[47]=i,e[48]=S.length,e[49]=ie):ie=e[49];let ce;e[50]!==ne||e[51]!==ie||e[52]!==A?(ce=s.jsxs("div",{className:O,children:[A,ne,ie]}),e[50]=ne,e[51]=ie,e[52]=A,e[53]=ce):ce=e[53];let se;e[54]!==d.slug?(se={org:d.slug},e[54]=d.slug,e[55]=se):se=e[55];let re;e[56]!==n?(re=()=>n(),e[56]=n,e[57]=re):re=e[57];let le;e[58]!==se||e[59]!==re?(le=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(tr,{to:"/$org/settings/agents",params:se,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=se,e[59]=re,e[60]=le):le=e[60];let me;return e[61]!==ce||e[62]!==$||e[63]!==le?(me=s.jsxs("div",{className:T,children:[$,ce,le]}),e[61]=ce,e[62]=$,e[63]=le,e[64]=me):me=e[64],me}function Yi(t){return!Gr(t.id)}function Nn(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=z.useState(!1),[a,c]=z.useState(!1),[d,u]=z.useState(!1),m=ps(),{setOpenMobile:f}=Qe(),h=lo(),p=h?"border border-border":void 0;let x;e[2]!==h?(x=T=>h?s.jsx(Bi,{children:T}):T,e[2]=h,e[3]=x):x=e[3];const g=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ne,{className:"h-4 w-24"})}),children:s.jsx(Vi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==g?(_=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(he,{children:g(s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(tn,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(sn,{className:"max-h-[85dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Bt,{open:i,onOpenChange:T=>{T&&!i&&ee("agent_browser_opened",{surface:"desktop_popover"}),l(T)},children:[o?g(s.jsx(xt,{asChild:!0,children:s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(he,{children:g(s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ut,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=h,e[13]=m,e[14]=i,e[15]=v,e[16]=g,e[17]=_):_=e[17];let k;e[18]!==a?(k=s.jsx(Ur,{open:a,onOpenChange:c}),e[18]=a,e[19]=k):k=e[19];let S;e[20]!==d?(S=s.jsx(Zr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let I;return e[22]!==_||e[23]!==k||e[24]!==S?(I=s.jsxs(s.Fragment,{children:[_,k,S]}),e[22]=_,e[23]=k,e[24]=S,e[25]=I):I=e[25],I}function Cn(){const t=N.c(24),{org:e}=ue(),n=Ee(),o=Pr().location.pathname,i=e.slug,{state:l,isMobile:a}=Qe(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const h=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let g;t[11]!==n||t[12]!==i?(g=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=g):g=t[13];let b;t[14]!==x||t[15]!==g?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:g},t[14]=x,t[15]=g,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==h?(y={type:"items",items:[h,j]},t[17]=j,t[18]=h,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:s.jsx(Nn,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Rt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(sr,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function wn(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function kn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Qe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{ee("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=Q(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(he,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Xi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Zs,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ji),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(wn,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Qi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Qi(t){return s.jsx(kn,{item:t},t.key)}function Ji(t){return s.jsx(kn,{item:t},t.key)}function Zi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=Q("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(el),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(en,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Tr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function el(t,e){return s.jsx(Xi,{section:t},e)}function In(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}In.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ne,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ls(){const t=N.c(22),e=Lo(),[n,r]=z.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=Ho(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xn,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(De,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(Bo,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function tl(t){const e=N.c(17),{onToggle:n,className:r}=t,i=Vs().logo??nr,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=Q("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Go,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ge,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ls,{}),e[12]=p):p=e[12];let x;return e[13]!==c||e[14]!==m||e[15]!==h?(x=s.jsxs($r,{className:c,children:[m,h,p]}),e[13]=c,e[14]=m,e[15]=h,e[16]=x):x=e[16],x}function Ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=Q(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(he,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function sl(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Zs,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(Ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(wn,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(Ms,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function nl(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(z.Suspense,{fallback:l,children:s.jsx(tl,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(sl,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(en,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function Tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rl=rr({name:or().min(2,"Organization name is required")});function ol(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:ir(rl),defaultValues:{name:""}},e[0]=o):o=e[0];const i=lr(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:ll,onSuccess:il},e[1]=l):l=e[1];const a=ar(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(ti,{children:[s.jsx(si,{children:"Create a new organization"}),s.jsx(ni,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=I=>a.mutateAsync(I),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:I}=S;return s.jsxs(ai,{children:[s.jsx(ci,{children:"Organization Name"}),s.jsx(di,{children:s.jsx(fi,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(ui,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Tn(I.value)]})]}),s.jsx(mi,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(ii,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(Zo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(pi,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(pt,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(ri,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=h,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(ei,{children:[d,s.jsx(li,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(oi,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=Tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await we.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function as(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function al(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=Q(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:as(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:Q("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function Pt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Rs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=fr();let l;e[0]!==n?(l=(C,M)=>C.slug===n?-1:M.slug===n?1:C.name.localeCompare(M.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=z.useState(!1),[u,m]=z.useState(""),f=u.toLowerCase(),h=f?a.filter(C=>C.name.toLowerCase().includes(f)||C.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(cl)},e[2]=c,e[3]=p):p=e[3];const x=p;let g;e[4]!==u||e[5]!==c||e[6]!==x?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:C=>m(C.target.value),onKeyDown:C=>C.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(hs,{size:16}):s.jsx(rn,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ce,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let k;e[19]!==g||e[20]!==_?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,_]}),e[19]=g,e[20]=_,e[21]=k):k=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let T;e[22]!==r||e[23]!==n?(T=C=>s.jsxs("button",{type:"button",onClick:()=>r(C.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",C.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(al,{org:C,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:C.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.slug})]}),C.slug===n&&s.jsx(xs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},C.id),e[22]=r,e[23]=n,e[24]=T):T=e[24];const $=h.map(T);let O;e[25]!==I||e[26]!==$?(O=s.jsxs("div",{className:S,children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==k?(A=s.jsxs(s.Fragment,{children:[k,O]}),e[28]=O,e[29]=k,e[30]=A):A=e[30],A}function cl(t){return!t}function Es(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:p}=t;if(h){const X=n?.name??"U";let W;e[0]!==X||e[1]!==r?(W=s.jsx(is,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=W):W=e[2];const ne=n?.name??"User";let ie;e[3]!==ne?(ie=s.jsx("p",{className:"text-sm font-medium truncate",children:ne}),e[3]=ne,e[4]=ie):ie=e[4];const ce=n?.email;let se;e[5]!==ce?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ce}),e[5]=ce,e[6]=se):se=e[6];let re;e[7]!==ie||e[8]!==se?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,se]}),e[7]=ie,e[8]=se,e[9]=re):re=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(fl)},e[10]=n,e[11]=le):le=e[11];let me;e[12]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx($s,{size:14}),e[12]=me):me=e[12];let oe;e[13]!==le?(oe=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:me})}),e[13]=le,e[14]=oe):oe=e[14];let Ie;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ie):Ie=e[15];let Fe;e[16]!==oe?(Fe=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[oe,Ie]})}),e[16]=oe,e[17]=Fe):Fe=e[17];let fe;e[18]!==Fe||e[19]!==W||e[20]!==re?(fe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,re,Fe]}),e[18]=Fe,e[19]=W,e[20]=re,e[21]=fe):fe=e[21];const Ge=String(p);let pe;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==Ge?(pe=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Ge)}),e[22]=m,e[23]=u,e[24]=d,e[25]=Ge,e[26]=pe):pe=e[26];let be;if(e[27]!==f||e[28]!==o){let ye;e[30]!==f?(ye=Ve=>s.jsx(Pt,{item:Ve,onClose:f},Ve.key),e[30]=f,e[31]=ye):ye=e[31],be=o.map(ye),e[27]=f,e[28]=o,e[29]=be}else be=e[29];let xe;e[32]!==f||e[33]!==i?(xe=s.jsx(Pt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=xe):xe=e[34];let Te;e[35]!==be||e[36]!==xe?(Te=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[be,xe]}),e[35]=be,e[36]=xe,e[37]=Te):Te=e[37];let je;e[38]!==pe||e[39]!==Te?(je=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[pe,Te]}),e[38]=pe,e[39]=Te,e[40]=je):je=e[40];let Le;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ye;e[45]!==a.theme||e[46]!==c?(ye=Ve=>{const{value:_e,icon:Ye,label:Je}=Ve;return s.jsx("button",{type:"button","aria-label":Je,onClick:()=>c(Xe=>({...Xe,theme:_e})),className:Q("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===_e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ye},_e)},e[45]=a.theme,e[46]=c,e[47]=ye):ye=e[47],Le=l.map(ye),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=Le}else Le=e[44];let Se;e[48]!==Le?(Se=s.jsx("div",{className:"flex items-center gap-0.5",children:Le}),e[48]=Le,e[49]=Se):Se=e[49];const He=a.enableSounds?"Disable sounds":"Enable sounds";let Be;e[50]!==c?(Be=()=>c(ml),e[50]=c,e[51]=Be):Be=e[51];const ht=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ue;e[52]!==ht?(Ue=Q("size-8 rounded-md flex items-center justify-center transition-colors",ht),e[52]=ht,e[53]=Ue):Ue=e[53];let qe;e[54]!==a.enableSounds?(qe=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[54]=a.enableSounds,e[55]=qe):qe=e[55];let $e;e[56]!==He||e[57]!==Be||e[58]!==Ue||e[59]!==qe?($e=s.jsx("button",{type:"button","aria-label":He,onClick:Be,className:Ue,children:qe}),e[56]=He,e[57]=Be,e[58]=Ue,e[59]=qe,e[60]=$e):$e=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.99.0"]}),e[61]=ve):ve=e[61];let We;e[62]!==$e?(We=s.jsxs("div",{className:"flex items-center gap-2",children:[$e,ve]}),e[62]=$e,e[63]=We):We=e[63];let Ke;e[64]!==Se||e[65]!==We?(Ke=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Se,We]}),e[64]=Se,e[65]=We,e[66]=Ke):Ke=e[66];let gt;return e[67]!==fe||e[68]!==je||e[69]!==Ke?(gt=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[fe,je,Ke]}),e[67]=fe,e[68]=je,e[69]=Ke,e[70]=gt):gt=e[70],gt}const x=n?.name??"U";let g;e[71]!==x||e[72]!==r?(g=s.jsx(is,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ul)},e[81]=n,e[82]=k):k=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx($s,{size:14}),e[83]=S):S=e[83];let I;e[84]!==k?(I=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=k,e[85]=I):I=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let $;e[87]!==I?($=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[I,T]})}),e[87]=I,e[88]=$):$=e[88];let O;e[89]!==$||e[90]!==g||e[91]!==_?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,_,$]}),e[89]=$,e[90]=g,e[91]=_,e[92]=O):O=e[92];let A;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=W=>s.jsx(Pt,{item:W,onClose:f},W.key),e[96]=f,e[97]=X):X=e[97],A=o.map(X),e[93]=f,e[94]=o,e[95]=A}else A=e[95];let C;e[98]!==f||e[99]!==i?(C=s.jsx(Pt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=C):C=e[100];let M;e[101]!==A||e[102]!==C?(M=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,C]}),e[101]=A,e[102]=C,e[103]=M):M=e[103];let K;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=W=>{const{value:ne,icon:ie,label:ce}=W;return s.jsx("button",{type:"button","aria-label":ce,onClick:()=>c(se=>({...se,theme:ne})),className:Q("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ne?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ie},ne)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],K=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=K}else K=e[107];let U;e[111]!==K?(U=s.jsx("div",{className:"flex items-center gap-0.5",children:K}),e[111]=K,e[112]=U):U=e[112];const E=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(dl),e[113]=c,e[114]=L):L=e[114];const R=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[115]!==R?(H=Q("size-7 rounded-md flex items-center justify-center transition-colors",R),e[115]=R,e[116]=H):H=e[116];let P;e[117]!==a.enableSounds?(P=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[117]=a.enableSounds,e[118]=P):P=e[118];let G;e[119]!==E||e[120]!==L||e[121]!==H||e[122]!==P?(G=s.jsx("button",{type:"button","aria-label":E,onClick:L,className:H,children:P}),e[119]=E,e[120]=L,e[121]=H,e[122]=P,e[123]=G):G=e[123];let D;e[124]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.99.0"]}),e[124]=D):D=e[124];let B;e[125]!==G?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[G,D]}),e[125]=G,e[126]=B):B=e[126];let F;e[127]!==U||e[128]!==B?(F=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[U,B]}),e[127]=U,e[128]=B,e[129]=F):F=e[129];let Y;e[130]!==O||e[131]!==M||e[132]!==F?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,M,F]}),e[130]=O,e[131]=M,e[132]=F,e[133]=Y):Y=e[133];const Z=String(p);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==Z?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Z)}),e[134]=m,e[135]=u,e[136]=d,e[137]=Z,e[138]=V):V=e[138];let J;return e[139]!==Y||e[140]!==V?(J=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,V]}),e[139]=Y,e[140]=V,e[141]=J):J=e[141],J}function dl(t){return{...t,enableSounds:!t.enableSounds}}function ul(){Ae.success("User ID copied")}function ml(t){return{...t,enableSounds:!t.enableSounds}}function fl(){Ae.success("User ID copied")}function cs(){const t=N.c(44),{data:e}=we.useSession(),{org:n}=ue(),r=Ee();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=cr(o)?.params.org,[a,c]=dr(),d=ps(),[u,m]=z.useState(!1),[f,h]=z.useState(!1),p=e?.user,x=p?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(vt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Uo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Er,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(Qo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={key:"github",label:"decocms/studio",icon:s.jsx(ur,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=T):T=t[13];let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={key:"community",label:"Community",icon:s.jsx(Jo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=$):$=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(qo,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let A;t[16]!==_||t[17]!==k?(A=[_,...k,S,I,T,$,O],t[16]=_,t[17]=k,t[18]=A):A=t[18];const C=A;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M={key:"logout",label:"Sign out",icon:s.jsx(Wo,{size:16}),onClick:xl},t[19]=M):M=t[19];const K=M;let U;t[20]===Symbol.for("react.memo_cache_sentinel")?(U={value:"light",icon:s.jsx(Ko,{size:14}),label:"Light theme"},t[20]=U):U=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(Vo,{size:14}),label:"Dark theme"},t[21]=E):E=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=[U,E,{value:"system",icon:s.jsx(xn,{size:14}),label:"System theme"}],t[22]=L):L=t[22];const R=L;let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{m(!1),h(!0)},t[23]=H):H=t[23];let P;t[24]!==b||t[25]!==d||t[26]!==C||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(P={user:p,userImage:x,menuItems:C,signOutItem:K,themeOptions:R,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:H,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=C,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=P):P=t[33];const G=P;let D;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==G?(D=d?s.jsxs(tn,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(sn,{className:"h-[80dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Account"}),s.jsx(Es,{...G})]})]}):s.jsxs(Bt,{open:u,onOpenChange:m,children:[s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Ut,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:pl,children:s.jsx(Es,{...G})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=G,t[38]=D):D=t[38];let B;t[39]!==f?(B=s.jsx(ol,{open:f,onOpenChange:h}),t[39]=f,t[40]=B):B=t[40];let F;return t[41]!==D||t[42]!==B?(F=s.jsxs(s.Fragment,{children:[D,B]}),t[41]=D,t[42]=B,t[43]=F):F=t[43],F}function pl(t){return t.preventDefault()}function xl(){ee("signed_out",{source:"account_popover"}),mr(),we.signOut()}function hl({invitation:t}){const[e,n]=z.useState(!1),[r,o]=z.useState(!1),i=pr(),l=async()=>{n(!0);try{const d=await we.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),xr();let c;try{c=(await we.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await we.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(xs,{size:14})}),s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(hs,{size:14})})]})]})}function gl(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=hi(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(is,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xs,{size:14}),e[11]=h):h=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==o||e[16]!==n.id?(x=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(hs,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==x?(b=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let y;return e[25]!==j||e[26]!==d||e[27]!==m?(y=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=y):y=e[28],y}function bl(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(bs,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function jl(){const t=z.useContext(hr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function $n(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=ro(),o=jl(),i=gi();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Nl).map(_l),u=[...o].sort(Sl).map(yl);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...oo].sort(vl).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function vl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function yl(t){return{type:"invitation",invitation:t}}function Sl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function _l(t){return{type:"join-request",request:t}}function Nl(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class An extends z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function zn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Cl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=Q(o!=null&&zn(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ln,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Oe,{children:s.jsx(he,{children:s.jsxs(ke,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function wl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Cl,{})})}),t[0]=e):e=t[0],e}function kl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=Q(o!=null&&zn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ln,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(De,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Il(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(kl,{})})}),t[0]=e):e=t[0],e}function On(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=$n(),[i,l]=z.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(Ut,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Yo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(io,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(gs,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(gl,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(hl,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(bl,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Bt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function Pn(){const{redDotCount:t}=$n();return t>0}function Tl(){const t=N.c(6),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(On,{children:s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function $l(){const t=N.c(8),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(xt,{asChild:!0,children:s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(De,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(On,{children:s.jsxs(Me,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Al(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(hn,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function zl(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Me,{delayDuration:300,children:[s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(hn,{className:"size-4"})})}),s.jsx(De,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Ol(){const t=N.c(7),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Pl(){const t=N.c(9),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(De,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Me,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Dl(){const t=N.c(6),{state:e}=Qe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(wl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Al,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(Tl,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Ol,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(rs,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Oe,{children:[i,l,a,s.jsx(he,{children:s.jsx(cs,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),s.jsx(Pl,{}),s.jsx($l,{}),s.jsx(zl,{}),s.jsx(Il,{})]})}),t[5]=r):r=t[5],r}function Ml(){const t=N.c(8),e=Ee(),{org:n}=ue(),{setOpenMobile:r}=Qe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ge,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Rl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(El,{virtualMcpId:n,size:i}):s.jsx(Re,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(jn,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function El(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=jt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Re,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Re,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Fl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=z.useState(""),{org:l}=ue(),{setTaskId:a}=dn(),c=bn();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=fs,d=ms.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=C=>{C||i(""),r(C)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=C=>{v(!1),a(C.id,C.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const k=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(vi,{className:"sr-only",children:[s.jsx(yi,{children:"Search"}),s.jsx(Si,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let I;e[20]!==o?(I=s.jsx(ki,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let T;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==m?(T=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ci,{children:"No results."}):j.map(C=>C.type==="thread"?s.jsxs(wi,{value:`thread:${C.id}:${C.title}`,onSelect:()=>k(C),className:"gap-2.5",children:[s.jsx(Rl,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=m,e[26]=T):T=e[26];let $;e[27]!==T?($=s.jsx(Ii,{children:T}),e[27]=T,e[28]=$):$=e[28];let O;e[29]!==I||e[30]!==$?(O=s.jsxs(_i,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(Ti,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,$]})]}),e[29]=I,e[30]=$,e[31]=O):O=e[31];let A;return e[32]!==v||e[33]!==n||e[34]!==O?(A=s.jsx(Ni,{open:n,onOpenChange:v,children:O}),e[32]=v,e[33]=n,e[34]=O,e[35]=A):A=e[35],A}function Gl(t){return t==="owner"||t==="admin"}function Ll(){const t=N.c(11),{locator:e}=ue(),n=$i(),{data:r}=we.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=ms.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=fs(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=Gl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var ss,qt="HoverCard",[Dn]=jr(qt,[Xs]),Wt=Xs(),[Hl,Kt]=Dn(qt),Mn=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=Wt(e),d=z.useRef(0),u=z.useRef(0),m=z.useRef(!1),f=z.useRef(!1),[h,p]=Cr({prop:r,defaultProp:o??!1,onChange:i,caller:qt}),x=z.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=z.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),b=z.useCallback(()=>p(!1),[p]);return z.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(Hl,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(wr,{...c,children:n})})};Mn.displayName=qt;var Rn="HoverCardTrigger",En=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Kt(Rn,n),i=Wt(n);return s.jsx(gr,{asChild:!0,...i,children:s.jsx(br.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:ze(t.onPointerEnter,Ft(o.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(o.onClose)),onFocus:ze(t.onFocus,o.onOpen),onBlur:ze(t.onBlur,o.onClose),onTouchStart:ze(t.onTouchStart,l=>l.preventDefault())})})});En.displayName=Rn;var vs="HoverCardPortal",[Bl,Ul]=Dn(vs,{forceMount:void 0}),Fn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=Kt(vs,e);return s.jsx(Bl,{scope:e,forceMount:n,children:s.jsx(Qs,{present:n||i.open,children:s.jsx(Nr,{asChild:!0,container:o,children:r})})})};Fn.displayName=vs;var Et="HoverCardContent",Gn=z.forwardRef((t,e)=>{const n=Ul(Et,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=Kt(Et,t.__scopeHoverCard);return s.jsx(Qs,{present:r||i.open,children:s.jsx(ql,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ze(t.onPointerEnter,Ft(i.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(i.onClose)),ref:e})})});Gn.displayName=Et;var ql=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=Kt(Et,n),d=Wt(n),u=z.useRef(null),m=vr(e,u),[f,h]=z.useState(!1);return z.useEffect(()=>{if(f){const p=document.body;return ss=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=ss,p.style.webkitUserSelect=ss}}},[f]),z.useEffect(()=>{if(u.current){const p=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),z.useEffect(()=>{u.current&&Vl(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),s.jsx(yr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ze(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(Sr,{...d,...a,onPointerDown:ze(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Wl="HoverCardArrow",Kl=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Wt(n);return s.jsx(_r,{...o,...r,ref:e})});Kl.displayName=Wl;function Ft(t){return e=>e.pointerType==="touch"?void 0:t()}function Vl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Yl=Mn,Xl=En,Ql=Fn,Jl=Gn;function Zl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Yl,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function ea(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Xl,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function ta(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(Ql,{"data-slot":"hover-card-portal",children:s.jsx(Jl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Ln(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ce,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(Ot,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(vt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let p;e[10]!==f?(p=s.jsxs(Ot,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>a(n,!r),children:[s.jsx(Yr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>c(n),children:[s.jsx(Xo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,p,x,g]}),e[21]=m,e[22]=p,e[23]=x,e[24]=g,e[25]=b):b=e[25],b}function sa(t){return t==="ephemeral"||t.startsWith("thread:")}function Vt(t){const e=N.c(46),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c,indented:d}=t,u=Ai(n.status),m=u.icon,f=n.metadata?.kind==="tool_call_run",h=jt(f?void 0:n.virtual_mcp_id);let p;e[0]!==h?(p=Io(h),e[0]=h,e[1]=p):p=e[1];const x=p;Oi(6e4);const g=l||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==o?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=d?"-ml-4 pl-6":"pl-2",k=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_||e[5]!==k?(S=Q("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",k),e[4]=_,e[5]=k,e[6]=S):S=e[6];let I;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(I=a&&!f&&s.jsx(Re,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=I):I=e[11];let T;e[12]!==g?(T=g&&s.jsx(jn,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=g,e[13]=T):T=e[13];const $=n.title||"Untitled task";let O;e[14]!==$?(O=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[14]=$,e[15]=O):O=e[15];let A;e[16]!==T||e[17]!==O?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[T,O]}),e[16]=T,e[17]=O,e[18]=A):A=e[18];let C;e[19]!==x||e[20]!==r||e[21]!==n.branch||e[22]!==n.updated_at?(C=n.updated_at&&s.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!sa(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Pi(new Date(n.updated_at))})]}),e[19]=x,e[20]=r,e[21]=n.branch,e[22]=n.updated_at,e[23]=C):C=e[23];let M;e[24]!==A||e[25]!==C?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,C]}),e[24]=A,e[25]=C,e[26]=M):M=e[26];const K="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(m,{size:14,className:Q(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[27]!==i?(E=B=>{B.stopPropagation(),i()},e[27]=i,e[28]=E):E=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(kr,{size:14}),e[29]=L):L=e[29];let R;e[30]!==E?(R=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:L})}),e[30]=E,e[31]=R):R=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(De,{side:"right",children:"Archive"}),e[32]=H):H=e[32];let P;e[33]!==R?(P=s.jsxs(Me,{children:[R,H]}),e[33]=R,e[34]=P):P=e[34];let G;e[35]!==U||e[36]!==P?(G=s.jsxs("div",{className:K,children:[U,P]}),e[35]=U,e[36]=P,e[37]=G):G=e[37];let D;return e[38]!==o||e[39]!==M||e[40]!==G||e[41]!==v||e[42]!==S||e[43]!==I||e[44]!==n.id?(D=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:o,onKeyDown:v,className:S,children:[I,M,G]}),e[38]=o,e[39]=M,e[40]=G,e[41]=v,e[42]=S,e[43]=I,e[44]=n.id,e[45]=D):D=e[45],D}function ys(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(Ks,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function na(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function ra(t){return t.member==="mine"&&!t.currentUserId}const Hn=4;let Mt=0;const ds=[];function oa(){for(;Mt<Hn&&ds.length>0;){const t=ds.shift();t&&t()}}function Bn(t){return new Promise((e,n)=>{const r=()=>{Mt++,t().then(e,n).finally(()=>{Mt--,oa()})};Mt<Hn?r():ds.push(r)})}const Yt=10;function Fs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ia(t,e,n,r){let o=0;for(const i of t)Ss(i,e,n,r)&&o++;return o}function ns(t,e,n,r){return ia(t,e,n,r)}function la(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Ss(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function aa(t,e){return!!(t>=Yt||t===0&&e)}function Gs(t,e){return t<e}function ca(t,e){return e===!1?!1:e===!0?!0:t}function Ss(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Gt=new Map,Dt=new Map;function da(t,e){return e?t>=Yt?!0:null:!1}function Ls(t){return Gt.get(t)}function ua(t,e){Gt.set(t,e)}function ma(t,e,n){const r=Gt.get(t);if(r!==void 0){n(r);return}let o=Dt.get(t);o||(o=Bn(e).then(i=>(Gt.set(t,i),Dt.delete(t),i)).catch(()=>(Dt.delete(t),Promise.reject(new Error("group probe failed")))),Dt.set(t,o)),o.then(n,()=>n(!1))}function Hs(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Yt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function fa(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Ss(l,n,r,o)&&i++;return i}function _s(t,e,n,r){const o=N.c(8),{org:i}=ue(),l=na(i.id,t,e,n);let a;o[0]!==n?(a=ra(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=to(),{threads:f,hasMore:h}=cn(),p=r??ns(f,t,e,n),x=aa(p,h),g=da(p,h),b=bn();if(d.identity===l&&d.serverHasMore===null){const S=g??Ls(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&Ls(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),ma(l,async()=>{const S=Fs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:T}=Hs(I),$=ns(m.threads.get(),t,e,n);return T===void 0?!1:Gs($,T)},S=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(T=>T.identity===I?{...T,isFetching:!0}:T);try{const T=ns(f,t,e,n),$=Fs(t,e,T,n,Yt),O=await Bn(()=>b.call("COLLECTION_THREADS_LIST",$)),{items:A,hasMore:C,totalCount:M}=Hs(O),K=new Set(f.map(pa)),U=fa(A,K,t,e,n),E=T;m.mergeThreads(A),u(L=>{if(L.identity!==I)return L;let R;return M!==void 0?R=Gs(E+U,M):R=A.length===0||U===0?!1:C,ua(I,R),{...L,isFetching:!1,serverHasMore:R}})}catch(T){const $=T,O=$ instanceof Error?$.message:String($);Ae.error(`Could not load more tasks: ${O}`),u(A=>A.identity===I?{...A,isFetching:!1}:A)}},v=d.isFetching||d.isProbing,_=!c&&!v&&ca(x,d.serverHasMore);let k;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function pa(t){return t.id}function Un(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:p,groupVisibleCount:x}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=jt(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,k=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=X=>{p?.isDragging||X&&ee("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const I=!!(y&&o&&y.id===o),T=p?"Drag to reorder":void 0;let $;e[8]!==p?($=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=$):$=e[9];const O=p&&"cursor-pointer active:cursor-grabbing touch-none",A=p?.isDragging&&"cursor-grabbing";let C;e[10]!==A||e[11]!==O?(C=Q("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",O,A),e[10]=A,e[11]=O,e[12]=C):C=e[12];const M=j?.icon??null,K=j?.title??"?";let U;e[13]!==M||e[14]!==K?(U=s.jsx(Re,{icon:M,name:K,size:"sm+",className:"rounded-lg"}),e[13]=M,e[14]=K,e[15]=U):U=e[15];let E;e[16]!==_||e[17]!==C||e[18]!==U||e[19]!==I||e[20]!==T||e[21]!==$?(E=s.jsx(he,{children:s.jsx(vn,{asChild:!0,children:s.jsx(ea,{asChild:!0,children:s.jsx(ke,{onClick:_,isActive:I,title:T,...$,className:C,children:U})})})}),e[16]=_,e[17]=C,e[18]=U,e[19]=I,e[20]=T,e[21]=$,e[22]=E):E=e[22];const L=h??xa;let R;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==L||e[29]!==n?(R=s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:L,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=L,e[29]=n,e[30]=R):R=e[30];let H;e[31]!==E||e[32]!==R?(H=s.jsxs(Sn,{children:[E,R]}),e[31]=E,e[32]=R,e[33]=H):H=e[33];const P=j?.title??"Agent";let G;e[34]!==P?(G=s.jsx("span",{className:"truncate",children:P}),e[34]=P,e[35]=G):G=e[35];let D;e[36]!==c||e[37]!==n?(D=()=>c(n),e[36]=c,e[37]=n,e[38]=D):D=e[38];let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ce,{size:14}),e[39]=B):B=e[39];let F;e[40]!==D?(F=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:D,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:B}),e[40]=D,e[41]=F):F=e[41];let Y;e[42]!==G||e[43]!==F?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,F]}),e[42]=G,e[43]=F,e[44]=Y):Y=e[44];let Z;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(Z=s.jsx(ha,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=Z):Z=e[52];let V;e[53]!==Y||e[54]!==Z?(V=s.jsxs(ta,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,Z]}),e[53]=Y,e[54]=Z,e[55]=V):V=e[55];let J;return e[56]!==H||e[57]!==V||e[58]!==k||e[59]!==S?(J=s.jsxs(Zl,{open:k,openDelay:120,closeDelay:150,onOpenChange:S,children:[H,V]}),e[56]=H,e[57]=V,e[58]=k,e[59]=S,e[60]=J):J=e[60],J}function xa(){}function ha(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=_s("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Vt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(ys,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ga(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:zo},a[1]=u):u=a[1];const m=To(Ts(Ao,d),Ts($o,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=uo(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!mo(v,_,o))return;const k=fo(h,v,_),S=po(e,n,o,k);e==="org"?xo(n.orgId,S):ho(n,S),ee("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=p):p=a[13];const x=p;let g;return a[14]!==x||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function ba(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function ja(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ro(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:Eo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Bs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:p}=ga(r,n,o,i,l,a,c);if(r.length===0)return null;const x=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(y=v=>{const _=d(v);return h.includes(v.virtualMcpId)?s.jsx(ja,{id:v.virtualMcpId,children:k=>{const{setNodeRef:S,style:I,isDragging:T,attributes:$,listeners:O}=k;return s.jsx("div",{ref:S,style:I,className:Q(T&&"opacity-50"),children:u(_,{attributes:$,listeners:O,isDragging:T})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=y):y=e[10],g=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==x||e[12]!==g?(b=s.jsx(Oo,{items:x,strategy:Po,children:g}),e[11]=x,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Do,{sensors:f,collisionDetection:Mo,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function qn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:p,user:x,toolCallRuns:g}=go(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ba,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(Bs,{section:"org",groups:p,...y}),v,s.jsx(Bs,{section:"user",groups:x,...y}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function va(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Sa,renderSortable:ya}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ya(t,e){return s.jsx(Un,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Sa(t){return s.jsx(Un,{...t},t.virtualMcpId)}const _a="sidebar.group.expanded.";function Wn(t,e){const n=N.c(3),[r,o]=us(`${_a}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Kn(t){const e=N.c(70),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:h,groupVisibleCount:p,devPartnerId:x,devGroupVisibleCount:g,sortable:b}=t,j=u===void 0?!1:u,y=m===void 0?!1:m,v=x===void 0?null:x,[_,k]=Wn(n,!1),S=n===os,I=b?.isDragging??!1;let T;e[0]!==v||e[1]!==r?(T=v?r.filter(W=>W.virtual_mcp_id===v):[],e[0]=v,e[1]=r,e[2]=T):T=e[2];const $=T;let O;e[3]!==v||e[4]!==r?(O=v?r.filter(W=>W.virtual_mcp_id!==v):r,e[3]=v,e[4]=r,e[5]=O):O=e[5];const A=O,C=!!v&&($.length>0||(g??0)>0);let M;e[6]!==_||e[7]!==k?(M=function(){k(!_)},e[6]=_,e[7]=k,e[8]=M):M=e[8];const K=M;let U;e[9]!==S||e[10]!==b?(U=b&&!S?{...b.attributes,...b.listeners}:{},e[9]=S,e[10]=b,e[11]=U):U=e[11];let E;e[12]!==K?(E=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),K())},e[12]=K,e[13]=E):E=e[13];const L=b&&!S&&"touch-none active:cursor-grabbing",R=I&&"shadow-md bg-accent/40 cursor-grabbing";let H;e[14]!==R||e[15]!==L?(H=Q("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",L,R),e[14]=R,e[15]=L,e[16]=H):H=e[16];let P;e[17]!==S||e[18]!==n?(P=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:S})}),e[17]=S,e[18]=n,e[19]=P):P=e[19];let G;e[20]!==_?(G=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:_?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[20]=_,e[21]=G):G=e[21];let D;e[22]!==P||e[23]!==G?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[P,G]}),e[22]=P,e[23]=G,e[24]=D):D=e[24];let B;e[25]!==S||e[26]!==n?(B=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ka,{virtualMcpId:n,isToolCallRuns:S})}),e[25]=S,e[26]=n,e[27]=B):B=e[27];let F;e[28]!==S||e[29]!==a||e[30]!==n?(F=!S&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:W=>{W.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ce,{size:14})}),e[28]=S,e[29]=a,e[30]=n,e[31]=F):F=e[31];let Y;e[32]!==_||e[33]!==K||e[34]!==H||e[35]!==D||e[36]!==B||e[37]!==F||e[38]!==U||e[39]!==E?(Y=s.jsxs("div",{...U,role:"button",tabIndex:0,"aria-expanded":_,onClick:K,onKeyDown:E,className:H,children:[D,B,F]}),e[32]=_,e[33]=K,e[34]=H,e[35]=D,e[36]=B,e[37]=F,e[38]=U,e[39]=E,e[40]=Y):Y=e[40];const Z=Y;let V;e[41]!==y||e[42]!==Z||e[43]!==j||e[44]!==S||e[45]!==d||e[46]!==a||e[47]!==c||e[48]!==f||e[49]!==n?(V=S?Z:s.jsxs(Sn,{children:[s.jsx(vn,{asChild:!0,children:Z}),s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:j,canManageOrgPin:y,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??Na,onHideGroup:d})})]}),e[41]=y,e[42]=Z,e[43]=j,e[44]=S,e[45]=d,e[46]=a,e[47]=c,e[48]=f,e[49]=n,e[50]=V):V=e[50];let J;e[51]!==o||e[52]!==g||e[53]!==v||e[54]!==$||e[55]!==_||e[56]!==h||e[57]!==p||e[58]!==S||e[59]!==A||e[60]!==l||e[61]!==a||e[62]!==i||e[63]!==C||e[64]!==r||e[65]!==n?(J=_&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:S?r.map(W=>s.jsx(Vt,{task:W,isActive:o===W.id,onClick:()=>i(W),onArchive:()=>l(W),showAutomationBadge:!!W.trigger_id,indented:!0},W.id)):s.jsxs(s.Fragment,{children:[s.jsx(Us,{virtualMcpId:n,threads:A,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:p}),C&&v&&s.jsxs("div",{className:"flex flex-col gap-0.5 mt-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80",children:[s.jsx(Xr,{size:11}),"Develop"]}),s.jsx(Us,{virtualMcpId:v,threads:$,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:g})]})]})}),e[51]=o,e[52]=g,e[53]=v,e[54]=$,e[55]=_,e[56]=h,e[57]=p,e[58]=S,e[59]=A,e[60]=l,e[61]=a,e[62]=i,e[63]=C,e[64]=r,e[65]=n,e[66]=J):J=e[66];let X;return e[67]!==V||e[68]!==J?(X=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[V,J]}),e[67]=V,e[68]=J,e[69]=X):X=e[69],X}function Na(){}function Ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Re,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(wa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wa(t){const e=N.c(4),{virtualMcpId:n}=t,r=jt(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Re,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ka(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Ia,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Ia(t){const e=N.c(2),{virtualMcpId:n}=t,o=jt(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Us(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=_s("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:h,serverHasMore:p}=u,[x,g]=z.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(g(!0),queueMicrotask(()=>{h()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==h||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 -ml-4 pl-6 pr-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ce,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,indented:!0},y.id)),(b||m)&&s.jsx(ys,{onClick:()=>{h()},isFetching:m,indented:!0})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=h,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function Ta(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=_s("status",n,a),[h,p]=z.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let g;e[9]!==m||e[10]!==c||e[11]!==u?(g=(m||c)&&s.jsx(ys,{onClick:()=>{u()},isFetching:c,indented:!0}),e[9]=m,e[10]=c,e[11]=u,e[12]=g):g=e[12];let b;return e[13]!==x||e[14]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[13]=x,e[14]=g,e[15]=b):b=e[15],b}function $a(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=zi[n],d=c.icon,[u,m]=Wn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,y]}),e[17]=u,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ta,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==v||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=k):k=e[34],k}function Aa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Oa,renderSortable:za}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function za(t,e){return s.jsx(Kn,{...t,sortable:e},t.virtualMcpId)}function Oa(t){return s.jsx(Kn,{...t},t.virtualMcpId)}function Pa(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Da(t,e,n,r,o){const i=N.c(5),l=Pa(t,e,r,o),[a,c]=z.useState("");a!==l&&(bo(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=jo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const Vn={all:"All tasks",manual:"Chats",automation:"Automation"},Yn={all:"All members",mine:"Mine only"},qs={agent:"Agent",status:"Status"};function Xn(t){const e=N.c(95);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:r}=n,{data:o}=we.useSession(),i=o?.user?.id,l=i??"anon",{org:a}=ue(),c=Lr(a.id).id,d=on(),{liveToDev:u,devToLive:m}=Fo(d),f=un(d),h=Ll(),p=Hr();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];const[g,b]=z.useState(x),j=new Set(f),y={},v=[];let _;e[3]!==g?(_=Object.entries(g),e[3]=g,e[4]=_):_=e[4];for(const[w,q]of _)j.has(w)!==q?y[w]=q:v.push(w);v.length>0&&b(w=>{const q={...w};for(const te of v)delete q[te];return q});const k=new Set(f);for(const[w,q]of Object.entries(y))q?k.add(w):k.delete(w);const S=[...k],I=new Set(S),{threads:T}=cn(),$=T.filter(Wa),{hide:O}=an(),A=Ee(),{setTaskId:C,createNewTask:M}=dn();let K;e[5]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},e[5]=K):K=e[5];const E=Ys(K).taskId??null;let L;e[6]!==r?(L=()=>{r?.()},e[6]=r,e[7]=L):L=e[7];const R=L,H=[...$].sort(qa),[P,G]=z.useState("all"),[D,B]=z.useState("mine"),[F,Y]=z.useState("agent"),[Z,V]=z.useState(!1),[J,X]=z.useState(!1),[W,ne]=z.useState(0),ie=vo(),ce=W+ie;let se;e[8]!==a.id||e[9]!==l?(se={orgId:a.id,userId:l},e[8]=a.id,e[9]=l,e[10]=se):se=e[10];const re=se,le={type:P,member:D,currentUserId:i??null},me=la(H,"agent",le),oe=Da(re,yo(So(H,c),m),c,S,ce);let Ie;e[11]!==d?(Ie=new Set(d.map(Ua).filter(Ba)),e[11]=d,e[12]=Ie):Ie=e[12];const Fe=Ie,fe=oe.filter(w=>w.virtualMcpId===c||w.virtualMcpId===os||Fe.has(w.virtualMcpId));let Ge;e[13]!==i||e[14]!==D?(Ge=w=>D==="mine"&&i?w.filter(q=>q.created_by===i):w,e[13]=i,e[14]=D,e[15]=Ge):Ge=e[15];const pe=Ge;let be;e[16]!==P?(be=w=>P==="automation"?w.filter(Ha):P==="manual"?w.filter(La):w,e[16]=P,e[17]=be):be=e[17];const xe=be,Te=w=>{const q=w.id===E;if(O(w.id),!q)return;const te=H.find(de=>de.id!==w.id&&de.virtual_mcp_id===w.virtual_mcp_id&&de.created_by===i);R(),te?C(te.id,te.virtual_mcp_id):A({to:"/$org",params:{org:a.slug}})};let je;e[18]!==R||e[19]!==M?(je=w=>{ee("sidebar_group_new_clicked",{virtual_mcp_id:w}),R(),M(w)},e[18]=R,e[19]=M,e[20]=je):je=e[20];const Le=je,Se=_o();let He;e[21]!==R||e[22]!==Se?(He=w=>{ee("sidebar_group_settings_clicked",{virtual_mcp_id:w}),R(),Se(w,{search:{main:"instructions"}})},e[21]=R,e[22]=Se,e[23]=He):He=e[23];const Be=He,ht=w=>{if(I.has(w))return;ee("sidebar_group_hide_clicked",{virtual_mcp_id:w});const q=fe.find(te=>te.virtualMcpId===w);if(q)for(const te of q.threads)O(te.id);Co(re,w,S),ne(Ga)},Ue=async(w,q)=>{if(h&&y[w]===void 0){ee("sidebar_group_org_pin_toggled",{virtual_mcp_id:w,pinned:q}),b(te=>({...te,[w]:q}));try{await p.update.mutateAsync({id:w,data:{pinned:q}})}catch{wo(re,w,!q),b(te=>{const de={...te};return delete de[w],de})}}},qe=w=>{const q=w===c||w===os;return{isOrgPinned:q||I.has(w),canManageOrgPin:q?!1:h,onToggleOrgPin:q?void 0:Ue}},$e=w=>{const q=xe(pe(w.threads)),te=u.get(w.virtualMcpId)??null;return{virtualMcpId:w.virtualMcpId,threads:q,devPartnerId:te,devGroupVisibleCount:te?me.get(te)??0:0,activeTaskId:E,filters:le,groupVisibleCount:me.get(w.virtualMcpId)??0,onSelectTask:de=>{R(),C(de.id,de.virtual_mcp_id)},onArchiveTask:Te,onNewTaskInGroup:Le,onShowSettings:Be,onHideGroup:ht,...qe(w.virtualMcpId)}},ve=P!=="all"||D!=="mine",{state:We,isMobile:Ke}=Qe();if(We==="collapsed"&&!Ke){let w;e[24]!==ve||e[25]!==pe||e[26]!==xe?(w=ts=>{const Zn=xe(pe(ts.threads));return!(ve&&Zn.length===0)},e[24]=ve,e[25]=pe,e[26]=xe,e[27]=w):w=e[27];const q=fe.filter(w),te=F==="agent"&&fe.length===0;let de;e[28]!==te?(de=s.jsx(Is,{value:te}),e[28]=te,e[29]=de):de=e[29];let zt;return e[30]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>ne(Fa),e[30]=zt):zt=e[30],s.jsxs(s.Fragment,{children:[de,s.jsx(Oe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(va,{groups:q,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:zt,renderGroup:ts=>$e(ts)})})]})}const ye="flex flex-col h-full min-h-0",Ve=F==="agent"&&fe.length===0;let _e;e[31]!==Ve?(_e=s.jsx(Is,{value:Ve}),e[31]=Ve,e[32]=_e):_e=e[32];let Ye;e[33]!==V?(Ye=()=>{ee("tasks_panel_search_opened"),X(!0),V(!0)},e[33]=V,e[34]=Ye):Ye=e[34];let Je;e[35]===Symbol.for("react.memo_cache_sentinel")?(Je=s.jsx(Qr,{size:16}),e[35]=Je):Je=e[35];let Xe;e[36]!==Ye?(Xe=s.jsx(ge,{"aria-label":"Search threads",onClick:Ye,children:Je}),e[36]=Ye,e[37]=Xe):Xe=e[37];const Xt=qs[F==="agent"?"status":"agent"];let yt;e[38]!==Xt?(yt=Xt.toLowerCase(),e[38]=Xt,e[39]=yt):yt=e[39];const Qt=`Group by ${yt}`,Jt=qs[F];let St;e[40]!==Jt?(St=Jt.toLowerCase(),e[40]=Jt,e[41]=St):St=e[41];const Zt=`Grouped by ${St}`;let Ze,et;e[42]!==F?(Ze=()=>{const w=F==="agent"?"status":"agent";ee("tasks_panel_group_by_changed",{to_value:w}),Y(w)},et=F==="agent"?s.jsx(ji,{size:16}):s.jsx(Jr,{size:16}),e[42]=F,e[43]=Ze,e[44]=et):(Ze=e[43],et=e[44]);let tt;e[45]!==Qt||e[46]!==Zt||e[47]!==Ze||e[48]!==et?(tt=s.jsx(ge,{"aria-label":Qt,title:Zt,onClick:Ze,children:et}),e[45]=Qt,e[46]=Zt,e[47]=Ze,e[48]=et,e[49]=tt):tt=e[49];let _t;e[50]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(bi,{size:16}),e[50]=_t):_t=e[50];let st;e[51]!==ve?(st=ve&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),e[51]=ve,e[52]=st):st=e[52];let nt;e[53]!==st?(nt=s.jsx(xt,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Filter tasks",children:[_t,st]})}),e[53]=st,e[54]=nt):nt=e[54];let rt;e[55]!==D?(rt=w=>{const q=w;q!==D&&ee("tasks_panel_member_filter_changed",{to_value:q}),B(q)},e[55]=D,e[56]=rt):rt=e[56];let Nt;e[57]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[57]=Nt):Nt=e[57];let Ct;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ct=Object.keys(Yn),e[58]=Ct):Ct=e[58];let wt;e[59]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(As,{children:Ct.map(Ea)}),e[59]=wt):wt=e[59];let ot;e[60]!==D||e[61]!==rt?(ot=s.jsx(Ws,{label:"Members",children:s.jsxs(Ps,{value:D,onValueChange:rt,children:[Nt,wt]})}),e[60]=D,e[61]=rt,e[62]=ot):ot=e[62];let it;e[63]!==P?(it=w=>{const q=w;q!==P&&ee("tasks_panel_filter_changed",{to_value:q}),G(q)},e[63]=P,e[64]=it):it=e[64];let kt;e[65]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[65]=kt):kt=e[65];let It;e[66]===Symbol.for("react.memo_cache_sentinel")?(It=Object.keys(Vn),e[66]=It):It=e[66];let Tt;e[67]===Symbol.for("react.memo_cache_sentinel")?(Tt=s.jsx(As,{children:It.map(Ra)}),e[67]=Tt):Tt=e[67];let lt;e[68]!==it||e[69]!==P?(lt=s.jsx(Ws,{label:"Type",children:s.jsxs(Ps,{value:P,onValueChange:it,children:[kt,Tt]})}),e[68]=it,e[69]=P,e[70]=lt):lt=e[70];let at;e[71]!==ot||e[72]!==lt?(at=s.jsx(Ut,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[ot,lt]})}),e[71]=ot,e[72]=lt,e[73]=at):at=e[73];let ct;e[74]!==nt||e[75]!==at?(ct=s.jsxs(Bt,{children:[nt,at]}),e[74]=nt,e[75]=at,e[76]=ct):ct=e[76];let dt;e[77]!==Xe||e[78]!==tt||e[79]!==ct?(dt=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Xe,tt,ct]}),e[77]=Xe,e[78]=tt,e[79]=ct,e[80]=dt):dt=e[80];let $t;e[81]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(Nn,{compact:!0}),e[81]=$t):$t=e[81];let ut;e[82]!==dt?(ut=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[dt,$t]}),e[82]=dt,e[83]=ut):ut=e[83];const Jn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",es=F==="status"?s.jsx(s.Fragment,{children:No(xe(pe(H))).map(w=>s.jsx($a,{status:w.status,threads:w.threads,activeTaskId:E,onSelectTask:q=>{R(),C(q.id,q.virtual_mcp_id)},onArchiveTask:Te,filters:le},w.status))}):s.jsx(Aa,{groups:fe,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:()=>ne(Ma),renderGroup:w=>({...$e(w)})});let mt;e[84]!==es?(mt=s.jsx("div",{className:Jn,children:es}),e[84]=es,e[85]=mt):mt=e[85];let ft;e[86]!==J||e[87]!==Z||e[88]!==V?(ft=J&&s.jsx(Fl,{open:Z,onOpenChange:V}),e[86]=J,e[87]=Z,e[88]=V,e[89]=ft):ft=e[89];let At;return e[90]!==_e||e[91]!==ut||e[92]!==mt||e[93]!==ft?(At=s.jsxs("div",{className:ye,children:[_e,ut,mt,ft]}),e[90]=_e,e[91]=ut,e[92]=mt,e[93]=ft,e[94]=At):At=e[94],At}function Ma(t){return t+1}function Ra(t){return s.jsx(gn,{value:t,children:Vn[t]},t)}function Ea(t){return s.jsx(gn,{value:t,children:Yn[t]},t)}function Fa(t){return t+1}function Ga(t){return t+1}function La(t){return!t.trigger_id}function Ha(t){return!!t.trigger_id}function Ba(t){return!!t}function Ua(t){return t.id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ws(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ka=5,Va=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Qn(){const t=N.c(3),{state:e}=Qe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ka}).map(Qa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"})]}),s.jsx(Ne,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Va.map(Ya)})]}),t[2]=r):r=t[2],r}function Ya(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(Ne,{className:"size-5 rounded-full shrink-0"}),s.jsx(Ne,{className:Q("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Xa)})]},e)}function Xa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Ne,{className:"h-3 flex-1 rounded-sm"})},e)}function Qa(t,e){return s.jsx(Ne,{className:"size-10 rounded-lg mx-auto"},e)}function Ja(){const t=N.c(4),e=Cn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Xn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(mn,{children:s.jsx(In,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Za(t){const e=N.c(9),{onClose:n}=t,r=Cn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ml,{}),e[0]=o):o=e[0];let i,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),l=s.jsx(Rt,{className:"mb-2"}),e[1]=i,e[2]=l):(i=e[1],l=e[2]);let a;e[3]!==n?(a=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:i,children:[l,s.jsx(Xn,{onNavigate:n})]})}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==r||e[7]!==a?(c=s.jsx(mn,{children:s.jsx(nl,{sections:r,onClose:n,footer:o,additionalContent:a})}),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}const ec="sidebar.open";function tc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Di,{}),t[0]=e):e=t[0],e}function ou(){const t=N.c(24),e=ps(),[n,r]=us(ec,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Fi();let c;t[0]!==e?(c=e?s.jsxs(ae.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx(ls,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ae.TogglesSlot,{}),s.jsx(ae.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ae.CenterSlot,{}),s.jsx(ae.RightSlot,{})]}):s.jsxs(ae.Header,{children:[s.jsxs(ae.LeftColumn,{children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx("span",{className:"hidden md:contents",children:s.jsx(ae.Nav,{})}),s.jsx(ae.TogglesSlot,{}),s.jsx(ls,{})]}),s.jsx(ae.CenterSlot,{}),s.jsxs(ae.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ae.TabsSlot,{})}),s.jsx(ae.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Ja,{}),s.jsx(Mi,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ar,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(z.Suspense,{fallback:s.jsx(tc,{}),children:s.jsx(Ir,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==m||t[11]!==f||t[12]!==i?(x=s.jsxs(zr,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,p]}),t[10]=m,t[11]=f,t[12]=i,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dr,{renderSidebar:sc}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(xi,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(so,{children:s.jsx(ae.Provider,{children:s.jsx(Or,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function sc(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Za,{onClose:e})})})}export{ou as default};
|