decocms 4.17.0 → 4.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D8gnDqwf.js → AlertCircle-CWgtpDgs.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BlXghneM.js → ArrowUpRight-O2h0Esun.js} +1 -1
- package/dist/client/assets/{CheckCircle-DCCFCHyS.js → CheckCircle-CzbMe8sq.js} +1 -1
- package/dist/client/assets/{ChevronDown-BLALKRGM.js → ChevronDown-B0d3gCJ4.js} +1 -1
- package/dist/client/assets/{ChevronRight-Gacf5_E2.js → ChevronRight-D8G4YOXh.js} +1 -1
- package/dist/client/assets/{ChevronUp-DBXbYduj.js → ChevronUp-2KGxjR7x.js} +1 -1
- package/dist/client/assets/{DotsVertical-D7ryssxp.js → DotsVertical-B-sq-ide.js} +1 -1
- package/dist/client/assets/{Eye-BFLaa-Ve.js → Eye-DmGPRR_e.js} +1 -1
- package/dist/client/assets/{FilterLines-CK4jmUMp.js → FilterLines-DEMLsHE0.js} +1 -1
- package/dist/client/assets/{Globe01-Bx-hz-as.js → Globe01-DO0D_c2f.js} +1 -1
- package/dist/client/assets/{Globe04-u6eY2Kop.js → Globe04-XJoX6kmZ.js} +1 -1
- package/dist/client/assets/{HardDrive-B06hZ2KP.js → HardDrive-BICUWfOq.js} +1 -1
- package/dist/client/assets/{Key01-D0oVN5CX.js → Key01-BtQzPiv-.js} +1 -1
- package/dist/client/assets/{LayoutLeft-1bN-FR8E.js → LayoutLeft-Bi6Cd7VR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D4vA-I3a.js → LinkExternal01-CB818nxD.js} +1 -1
- package/dist/client/assets/{Monitor01-DrJKeSJ4.js → Monitor01-DG_zJQKB.js} +1 -1
- package/dist/client/assets/{Palette-CvuWqoBi.js → Palette-D5uFHHtD.js} +1 -1
- package/dist/client/assets/{Play-DuOwU6E2.js → Play-8mfsN5e2.js} +1 -1
- package/dist/client/assets/{Plus-Bz2JwGOE.js → Plus-tW6PYhLA.js} +1 -1
- package/dist/client/assets/{SearchLg-CfwbHNr5.js → SearchLg-BRB4E-a6.js} +1 -1
- package/dist/client/assets/{SearchMd-Bn2Kbs9E.js → SearchMd-DCtxyy_L.js} +1 -1
- package/dist/client/assets/{Settings02-N32UBNZq.js → Settings02-CYQjLDZe.js} +1 -1
- package/dist/client/assets/{Shield01-BztOm8mA.js → Shield01-BmIMMGLU.js} +1 -1
- package/dist/client/assets/{Star01-GFElhP7X.js → Star01-BiHTCvVR.js} +1 -1
- package/dist/client/assets/{Stars01-CK-XatBt.js → Stars01-BoOQBwEf.js} +1 -1
- package/dist/client/assets/{Stars02-BpRz9194.js → Stars02-DBhfsTYG.js} +1 -1
- package/dist/client/assets/{Sun-CRJdfBLT.js → Sun-YyXJklY4.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Bcp8nSOf.js → SwitchHorizontal01-DCwK87MF.js} +1 -1
- package/dist/client/assets/{Tool01-DrE6CqtR.js → Tool01-D68BO4Z1.js} +1 -1
- package/dist/client/assets/{Trash01-kVRWRMat.js → Trash01-BDaXEXf_.js} +1 -1
- package/dist/client/assets/{Upload01-TiHLQTwG.js → Upload01-B14hHeGP.js} +1 -1
- package/dist/client/assets/{User01-9o9EbE3X.js → User01-D26yJD3f.js} +1 -1
- package/dist/client/assets/{Users01-CMbqiB_R.js → Users01-DcpQUESq.js} +1 -1
- package/dist/client/assets/{Users03-K1B4uaw7.js → Users03-DdlXwWfA.js} +1 -1
- package/dist/client/assets/{X-BQZZQdg0.js → X-C54nvkaE.js} +1 -1
- package/dist/client/assets/{XCircle-BOFvuFHl.js → XCircle-DMTFcHqR.js} +1 -1
- package/dist/client/assets/{XClose-ChRyc7zA.js → XClose-DnDy-OvD.js} +1 -1
- package/dist/client/assets/{Zap-RN8PAcZE.js → Zap-DtiJN-LC.js} +1 -1
- package/dist/client/assets/{ZapSquare-D4RqdrSL.js → ZapSquare-BOyZ6Rgl.js} +1 -1
- package/dist/client/assets/{ZoomOut-CwXzA7X6.js → ZoomOut-BVzIyFeW.js} +1 -1
- package/dist/client/assets/{access-gate-DayZt2qh.js → access-gate-CahH-m4n.js} +1 -1
- package/dist/client/assets/{add-section-modal-BgsTQi1S.js → add-section-modal-BmSyVksR.js} +1 -1
- package/dist/client/assets/{agent-capabilities-C8WZk9re.js → agent-capabilities-2TzzHD_U.js} +1 -1
- package/dist/client/assets/{agent-icon-BRuLsBYY.js → agent-icon-XUhQzRLX.js} +1 -1
- package/dist/client/assets/{agents-list-Bb32bFe0.js → agents-list-DK_ZBuLv.js} +1 -1
- package/dist/client/assets/{ai-providers-CtFbvrBB.js → ai-providers-DlWOFrVq.js} +1 -1
- package/dist/client/assets/{alert-DGlfAxXY.js → alert-BY6dLNYK.js} +1 -1
- package/dist/client/assets/{alert-dialog-D87-BKea.js → alert-dialog-depKBGzY.js} +1 -1
- package/dist/client/assets/{app-editor-BTeZcD9G.js → app-editor-DcpXXBks.js} +1 -1
- package/dist/client/assets/{auth-pLLkIszG.js → auth-JzTDloGx.js} +1 -1
- package/dist/client/assets/{auth-catchall-CDZHIENi.js → auth-catchall-3AJlIltf.js} +1 -1
- package/dist/client/assets/{auth-entry--IJuST3G.js → auth-entry-CN6penGo.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Cm8DpBZy.js → auth-split-layout-DG4yNxsb.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-VdmVLbtW.js → authenticate-and-persist-oauth-DBxyWtpZ.js} +1 -1
- package/dist/client/assets/{automation-list-row-DJcYtMaz.js → automation-list-row-BIgl3VhR.js} +1 -1
- package/dist/client/assets/{automation-runs-BQZ05VJM.js → automation-runs-DT5n-ItD.js} +1 -1
- package/dist/client/assets/{automations-DXzG8kgd.js → automations-CkBsMFYI.js} +1 -1
- package/dist/client/assets/{avatar-DxH3BnSs.js → avatar-CQ--7kDr.js} +1 -1
- package/dist/client/assets/{badge-wh5eWpb9.js → badge-Cu9Vf21V.js} +1 -1
- package/dist/client/assets/{block-document-OYJ-kskh.js → block-document-6rmSaazN.js} +1 -1
- package/dist/client/assets/{brand-context-Dkhy-emW.js → brand-context-Bx9fuG7L.js} +1 -1
- package/dist/client/assets/{breadcrumb-DZbB5tzN.js → breadcrumb-Iv2RnKdx.js} +1 -1
- package/dist/client/assets/{buckets-DWf7-mkQ.js → buckets-DhP3Px4o.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BfqGc7PR.js → bulk-category-panel-Ry5Wrf4t.js} +1 -1
- package/dist/client/assets/{capability-load-error-B0knfbbl.js → capability-load-error-CZgYniY2.js} +1 -1
- package/dist/client/assets/{card-D-LCVQQb.js → card-BtxpfIMO.js} +1 -1
- package/dist/client/assets/{category-editor-dubEmgpx.js → category-editor-B79PzaJo.js} +1 -1
- package/dist/client/assets/{chat-context-CIKFBD8u.js → chat-context-BXYlU18c.js} +1 -1
- package/dist/client/assets/{checkbox-CFdij7Ei.js → checkbox-_ejCMjxu.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BJWjcvwa.js → cli-auth-success-JyzfdETB.js} +1 -1
- package/dist/client/assets/{collection-detail-C8jnHEZw.js → collection-detail-Bs_bKbq1.js} +1 -1
- package/dist/client/assets/{collection-display-button-DDEI8eBI.js → collection-display-button-x3VETGSA.js} +1 -1
- package/dist/client/assets/{collection-search-B0gYtEWh.js → collection-search-CVteq94G.js} +1 -1
- package/dist/client/assets/{collection-tabs-DGDRpyxJ.js → collection-tabs-DHih69-0.js} +1 -1
- package/dist/client/assets/{command-VE4J0WmB.js → command-B9iUw_Wf.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DtwhvPKV.js → commerce-onboarding-D7yN_rh5.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DRNK5Zqx.js → connect-desktop-dialog-BP-u_roi.js} +1 -1
- package/dist/client/assets/{connection-card-Dzp4nWAC.js → connection-card-syvtXQo3.js} +1 -1
- package/dist/client/assets/{connection-detail-BnRE6ILz.js → connection-detail-LdZiPrUN.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BKzMCiDP.js → connection-form-helpers-NLjgFKGu.js} +1 -1
- package/dist/client/assets/{connections-BPohRO-Z.js → connections-CFiPE6LL.js} +1 -1
- package/dist/client/assets/{decopilot-D_-94MU_.js → decopilot-BzscZwEe.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DA88fFcW.js → decopilot-sse-pool-4ct7M3nK.js} +1 -1
- package/dist/client/assets/{dialog-BdIjDk0G.js → dialog-a5ZkDZhy.js} +1 -1
- package/dist/client/assets/{domain-settings-CTC9j3wY.js → domain-settings-C3cSnSXe.js} +1 -1
- package/dist/client/assets/{drawer-D1X6O6Aa.js → drawer-CKH1wPOe.js} +1 -1
- package/dist/client/assets/{dropdown-menu-8PMbgM0q.js → dropdown-menu-BsT801zR.js} +1 -1
- package/dist/client/assets/{empty-state-y_scHUYK.js → empty-state-Cd23QDa9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BhI39RpO.js → extract-connection-data--lA2dih1.js} +1 -1
- package/dist/client/assets/{file-explorer-BD0vY2dd.js → file-explorer-DIYnWmFv.js} +1 -1
- package/dist/client/assets/{file-type-icon-Bx1NX_Gy.js → file-type-icon-BpvAmzSL.js} +1 -1
- package/dist/client/assets/{files-BFgu7BJp.js → files-DmRhHPaD.js} +1 -1
- package/dist/client/assets/{form-P-LOMg0X.js → form-B8xO7s3Q.js} +1 -1
- package/dist/client/assets/{general-DaU6Yz-f.js → general-BerFQJYO.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CmustdLW.js → github-repo-picker-CNVz0qrC.js} +1 -1
- package/dist/client/assets/{hooks-UY6BFV6z.js → hooks-DFBNXh69.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CopvXqdM.js → import-from-deco-dialog-DdhvtCEU.js} +1 -1
- package/dist/client/assets/{index-BgCyOgdF.js → index-BEAvVWMY.js} +5 -5
- package/dist/client/assets/{index-CAQVV5KO.js → index-BmhWpNA2.js} +1 -1
- package/dist/client/assets/{index-DStyXwbT.js → index-CBxJPtyP.js} +1 -1
- package/dist/client/assets/{index-Cgz2WBho.js → index-COdjrItE.js} +1 -1
- package/dist/client/assets/{index-DJMmArQj.js → index-DGvdL2uz.js} +1 -1
- package/dist/client/assets/{index-Dq2Ts3Yi.js → index-DIWWb6ZU.js} +1 -1
- package/dist/client/assets/{index-DHTICC_v.js → index-DIyNSN96.js} +3 -3
- package/dist/client/assets/{index-D4EP6iY-.js → index-DJkBk8Ax.js} +1 -1
- package/dist/client/assets/{index-BZCHEyhA.js → index-Dn1UY3fg.js} +1 -1
- package/dist/client/assets/{index-BbFfuuHN.js → index-Dzrzv-LN.js} +1 -1
- package/dist/client/assets/{index-BrtU3HWl.js → index-NOL0uTvV.js} +1 -1
- package/dist/client/assets/{index-BwaOBBZ-.js → index-PDu5YsgJ.js} +1 -1
- package/dist/client/assets/{index-redirect-YHMCgUs4.js → index-redirect-B55CPpl6.js} +1 -1
- package/dist/client/assets/{index-DTpadbju.js → index-xcUq28N4.js} +1 -1
- package/dist/client/assets/{input-DgsFOGyM.js → input-CaPkg-tG.js} +1 -1
- package/dist/client/assets/{integration-icon-m6Sa_hcd.js → integration-icon-BVqUmyhK.js} +1 -1
- package/dist/client/assets/{label-CwMsBEmc.js → label-D0Oq_enN.js} +1 -1
- package/dist/client/assets/{library-tab-DZNwBek9.js → library-tab-pbqcFRtG.js} +1 -1
- package/dist/client/assets/{login-DDPQBbDq.js → login-CsVa9y82.js} +1 -1
- package/dist/client/assets/{mcp-oauth-SxDhA9AX.js → mcp-oauth-DkfCvuSl.js} +1 -1
- package/dist/client/assets/{members-DiR3wVIq.js → members-DVCX1OGf.js} +1 -1
- package/dist/client/assets/{monaco-editor-iFVtSMuF.js → monaco-editor-CQvQ4wyD.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D6W0tudn.js → monitoring-stats-row-N_7BtDVw.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cj-8kU65.js → oauth-callback-C_nBi9hb.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Dc1dGP3j.js → oauth-callback-ai-provider-JgWSWhQO.js} +1 -1
- package/dist/client/assets/{onboarding-DF_zbux6.js → onboarding-CRvfQK7U.js} +1 -1
- package/dist/client/assets/{org-install-CEMN6R-y.js → org-install-DlfY4HcA.js} +1 -1
- package/dist/client/assets/{org-layout-bk5Xtfa_.js → org-layout-BNkJ-PnS.js} +1 -1
- package/dist/client/assets/{organization-choice-CE_aU8pP.js → organization-choice-C3OXP1wc.js} +1 -1
- package/dist/client/assets/{page-seo-form-Derb8U-C.js → page-seo-form-DtixMLnX.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DQkpfhcZ.js +1 -0
- package/dist/client/assets/{popover-4-S-2t4S.js → popover-Q1EdqSJG.js} +1 -1
- package/dist/client/assets/{post-editor-CHJjQHP8.js → post-editor-BxN87jA0.js} +1 -1
- package/dist/client/assets/{primitives-DFOak6EH.js → primitives-Dn_2KW04.js} +1 -1
- package/dist/client/assets/{profile-BNOuWcgq.js → profile-C2BABr7w.js} +1 -1
- package/dist/client/assets/project-app-view-E9wqVY5b.js +1 -0
- package/dist/client/assets/record-editor-ZFaj6Wi4.js +1 -0
- package/dist/client/assets/registry-TjO0PApk.js +2 -0
- package/dist/client/assets/{registry-layout-BPKVzNcW.js → registry-layout-C4d4IZ2d.js} +1 -1
- package/dist/client/assets/{require-capability-BJprrccL.js → require-capability-DwU8Ss9R.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B0YEEBld.js → required-auth-layout-C_pN8svZ.js} +1 -1
- package/dist/client/assets/{reset-password-CkXuGUs6.js → reset-password-tIJsS-gp.js} +1 -1
- package/dist/client/assets/{roles-lfwag5Tp.js → roles-BK-t6UPP.js} +1 -1
- package/dist/client/assets/{scroll-area-C8YtCymQ.js → scroll-area-DSkli5k_.js} +1 -1
- package/dist/client/assets/{search-input-Du_36cRj.js → search-input-BiiOvDrk.js} +1 -1
- package/dist/client/assets/{secrets-CnPg0qON.js → secrets-CNbF_xMH.js} +1 -1
- package/dist/client/assets/{sections-editor-BR6KfAKE.js → sections-editor-CBzzlQi2.js} +1 -1
- package/dist/client/assets/{select-model-F8Y_Cf3t.js → select-model-CxlVTA2J.js} +1 -1
- package/dist/client/assets/{select-DzzBmNmo.js → select-z6yZBkEp.js} +1 -1
- package/dist/client/assets/{seo-editor-gJ1HxoCF.js → seo-editor-BENQBDhy.js} +1 -1
- package/dist/client/assets/{settings-layout-CGT7LCro.js → settings-layout-B89sZDAn.js} +1 -1
- package/dist/client/assets/{settings-section-rq7s23q-.js → settings-section-Cn_5NRzd.js} +1 -1
- package/dist/client/assets/{sheet-B3q7nz8B.js → sheet-B0u11yoj.js} +1 -1
- package/dist/client/assets/{shell-controls-mi9y4ySh.js → shell-controls-CYHtSsaG.js} +1 -1
- package/dist/client/assets/{shell-layout-QzfqSuxf.js → shell-layout-BCl91e2n.js} +1 -1
- package/dist/client/assets/{shell-route-loading-Bpj8AlnX.js → shell-route-loading-D29sfZCo.js} +1 -1
- package/dist/client/assets/{sidebar-D2BmctMK.js → sidebar-haKmZZ-W.js} +1 -1
- package/dist/client/assets/{skeleton-f0d6RrIL.js → skeleton-BuPVKDK7.js} +1 -1
- package/dist/client/assets/{sso-D4e1TwT3.js → sso-CWL1a3Ph.js} +1 -1
- package/dist/client/assets/{store-DxI78Zhs.js → store-Cca_yMwP.js} +1 -1
- package/dist/client/assets/store-registry-Bn93Vvrq.js +2 -0
- package/dist/client/assets/{studio-tools-D6ANxpFE.js → studio-tools-Bs0xo1Z2.js} +1 -1
- package/dist/client/assets/{switch-BRlkUTqX.js → switch-xjp3ajZN.js} +1 -1
- package/dist/client/assets/{table-65-g1dd8.js → table-CyATWOpP.js} +1 -1
- package/dist/client/assets/{tabs-ByVhqny2.js → tabs-ChaZLm39.js} +1 -1
- package/dist/client/assets/{task-status-BMnLETgS.js → task-status-DTdpp4Y7.js} +1 -1
- package/dist/client/assets/{textarea-Dp78LmPE.js → textarea-CvJkxwG_.js} +1 -1
- package/dist/client/assets/{toggle-group-BIoy7tOG.js → toggle-group-C5lfVqY9.js} +1 -1
- package/dist/client/assets/{toolbar-C1WgDWOZ.js → toolbar-DfZcXUSS.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DdAIuoK2.js → toolbar-icon-button-BJjnMzvJ.js} +1 -1
- package/dist/client/assets/{tools-list-BrZf2-sc.js → tools-list-BKWr5wCK.js} +1 -1
- package/dist/client/assets/{tooltip-CWNyrHYY.js → tooltip-Dn6TT4fb.js} +1 -1
- package/dist/client/assets/{types-BHL4d6ji.js → types-CZ4rLOEl.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CVS8EjHf.js → use-ai-providers-zyN1ygBC.js} +1 -1
- package/dist/client/assets/{use-automations-DJ1_UqKB.js → use-automations-DME2P9Yb.js} +1 -1
- package/dist/client/assets/{use-capability-BmznXR_9.js → use-capability-BKrWdNMG.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BXZK-6ig.js → use-clock-tick-nZuMTIzb.js} +1 -1
- package/dist/client/assets/{use-collections-BnOL5hT8.js → use-collections-BS7_MipP.js} +1 -1
- package/dist/client/assets/{use-connection-CRsO-Bab.js → use-connection-Cs21veSc.js} +1 -1
- package/dist/client/assets/{use-copy-DK8lBdjB.js → use-copy-CY1tiWSY.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C50juX43.js → use-create-virtual-mcp-BRn7Xglj.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Q8tZcL7-.js → use-debounced-autosave-Cl9vOVRq.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C2hJqHIV.js → use-debounced-value-fFVCMUXm.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BB7o7ets.js → use-decopilot-events-CtfZfAhc.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D7WMNDAi.js → use-delete-connection-B695Tef1.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bxsm4MXe.js → use-file-configs-DxHSl6ZD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DFBavgZf.js → use-infinite-scroll-BUhxpG1i.js} +1 -1
- package/dist/client/assets/{use-join-requests-CNT469hS.js → use-join-requests-COO3fg4J.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DAJmDOVO.js → use-mcp-client-tU9_Q31R.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D3eulxzR.js → use-mcp-prompts-CVL6RAIG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-AjHzJbIQ.js → use-mcp-tools-B2LI7RR7.js} +1 -1
- package/dist/client/assets/{use-members-BZroloWO.js → use-members-Bm9KhrJN.js} +1 -1
- package/dist/client/assets/{use-mobile-BkWraisf.js → use-mobile-Dd_g0aui.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Dlhjy-0a.js → use-navigate-to-agent-KaAiMohr.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BG_aw3vg.js → use-org-auth-client-CqXitYKc.js} +1 -1
- package/dist/client/assets/{use-org-sso-CEETlaem.js → use-org-sso-2HCpkr8C.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BrhJCA0y.js → use-organization-roles-D4lESRwM.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D9G2tGsW.js → use-organization-settings-DrjygbOR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CTTYiKTQ.js → use-registry-connections-D1C6nHHR.js} +1 -1
- package/dist/client/assets/{use-secrets-sB7thdOD.js → use-secrets-CLseSmaH.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DuOBmrHo.js → use-status-sounds-DX4ADJSs.js} +1 -1
- package/dist/client/assets/{use-view-mode-CFXBQhh0.js → use-view-mode-CIr8WEyc.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CJycW-Qv.js → use-virtual-mcp-WZNqIa1a.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CG1m_ZaE.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-9_oq2OeL.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-DohIOUYY.js → useSuspenseQueries-84o7R4r8.js} +1 -1
- package/dist/client/assets/{variant-calendar-DxXS9CiZ.js → variant-calendar-Dzqm1NJv.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D2SvIjQW.js → view-mode-toggle-C24MUWOu.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-BoNARuVh.js +0 -1
- package/dist/client/assets/project-app-view-ChmoDNv-.js +0 -1
- package/dist/client/assets/record-editor-CS39Vomm.js +0 -1
- package/dist/client/assets/registry-D4tm3ZFm.js +0 -2
- package/dist/client/assets/store-registry-DKwI23vv.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Bl42Nudd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-uA0LQwFa.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as s,C as We,r as O,l as F,v as ae,D as Dt,F as Cs,a as be,G as de,b as he,H as ws,I as ks,t as ge,J as Is,M as zs,m as $s,B as Te,y as As,P as Ts,K as Ot,k as Mt,i as Pt,e as ot,u as it,E as Et,o as Ds,s as Os,n as Ms,p as Ps,d as Es,x as Fs,R as Ft,O as Rs}from"./index-DHTICC_v.js";import{u as Ce,S as at,a as ct,b as _e,c as ue,d as se,e as Rt,f as Lt,g as Ls,h as Bs,i as tt,j as Hs,k as Us,l as Gs}from"./sidebar-D2BmctMK.js";import{u as dt}from"./use-mobile-BkWraisf.js";import{S as fe}from"./skeleton-f0d6RrIL.js";import{i as Bt}from"./LayoutLeft-1bN-FR8E.js";import{T as xe}from"./toolbar-icon-button-DdAIuoK2.js";import{P as Pe,a as Ne,b as Ee}from"./popover-4-S-2t4S.js";import{D as Ht,a as Ut,b as Gt}from"./drawer-D1X6O6Aa.js";import{A as Me}from"./avatar-DxH3BnSs.js";import{a as je,b as ve,c as st,T as ye}from"./tooltip-CWNyrHYY.js";import{a as ht}from"./Eye-BFLaa-Ve.js";import{n as qs,i as Ws}from"./Globe01-Bx-hz-as.js";import{i as Ks}from"./ZoomOut-CwXzA7X6.js";import{i as Vs}from"./ZapSquare-D4RqdrSL.js";import{i as qt}from"./Monitor01-DrJKeSJ4.js";import{n as Xs,a as Qs}from"./Sun-CRJdfBLT.js";import{a as Ke,b as Ys}from"./Settings02-N32UBNZq.js";import{i as Js}from"./Shield01-BztOm8mA.js";import{a as Zs}from"./Users03-K1B4uaw7.js";import{a as pt,b as gt,c as Wt,A as De,d as bt,i as en,s as tn,e as sn}from"./agent-icon-BRuLsBYY.js";import"./index-Dq2Ts3Yi.js";import{n as Ve}from"./Stars02-BpRz9194.js";import{u as nn,v as rn,C as ln}from"./connect-desktop-dialog-DRNK5Zqx.js";import{i as Xe}from"./ChevronUp-DBXbYduj.js";import{s as Kt}from"./XClose-ChRyc7zA.js";import{u as on,a as an}from"./use-join-requests-CNT469hS.js";import{i as Vt}from"./ChevronRight-Gacf5_E2.js";import{u as cn,R as dn,a as mn,b as mt,r as un}from"./shell-layout-QzfqSuxf.js";import{u as Xt,g as fn}from"./agent-capabilities-C8WZk9re.js";import{i as xn}from"./FilterLines-CK4jmUMp.js";import{T as hn,a as pn}from"./toggle-group-BIoy7tOG.js";import{u as gn,S as bn,a as Ge,i as jn}from"./use-mcp-client-DAJmDOVO.js";import{u as Qt,a as Yt}from"./use-virtual-mcp-CJycW-Qv.js";import{u as vn,a as ut,b as Jt,T as yn}from"./hooks-UY6BFV6z.js";import{c as Sn,a as Nn,b as _n,d as Cn,e as wn}from"./dialog-BdIjDk0G.js";import{C as kn,a as In,b as zn,c as $n,d as An}from"./command-VE4J0WmB.js";import{u as Zt}from"./studio-tools-D6ANxpFE.js";import{i as Tn}from"./Zap-RN8PAcZE.js";import{S as es,M as Dn}from"./shell-controls-mi9y4ySh.js";import{T as ts,S as On}from"./shell-route-loading-Bpj8AlnX.js";import{t as ft}from"./ChevronDown-BLALKRGM.js";import{S as Mn}from"./task-status-BMnLETgS.js";import{S as ss,u as Pn,g as En,a as Fn,b as Rn}from"./use-navigate-to-agent-Dlhjy-0a.js";import{S as Ln,C as Bn}from"./chat-context-CIKFBD8u.js";import{B as jt,a as Hn,b as Un,c as Gn}from"./breadcrumb-DZbB5tzN.js";import{T as te}from"./toolbar-C1WgDWOZ.js";import{s as Ae}from"./Plus-Bz2JwGOE.js";import{i as ns}from"./SearchMd-Bn2Kbs9E.js";import{A as qn,a as Wn,b as Kn,c as Vn,d as Xn,e as Qn,f as Yn}from"./alert-dialog-D87-BKea.js";import{F as Jn,a as Zn,b as er,c as tr,d as sr,f as nr,e as rr}from"./form-P-LOMg0X.js";import{I as lr}from"./input-DgsFOGyM.js";import{s as or}from"./Star01-GFElhP7X.js";import{u as ir}from"./use-create-virtual-mcp-C50juX43.js";import{I as ar,u as cr,W as dr}from"./import-from-deco-dialog-CopvXqdM.js";import{G as mr,a as ur}from"./github-repo-picker-CmustdLW.js";import"./sheet-B3q7nz8B.js";import"./X-BQZZQdg0.js";import"./User01-9o9EbE3X.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./CheckCircle-DCCFCHyS.js";import"./DotsVertical-D7ryssxp.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LinkExternal01-D4vA-I3a.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./SearchLg-CfwbHNr5.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./Users01-CMbqiB_R.js";import"./use-capability-BmznXR_9.js";import"./required-auth-layout-B0YEEBld.js";import"./tab-id-DPNwWMUY.js";import"./use-organization-settings-D9G2tGsW.js";import"./use-org-sso-CEETlaem.js";import"./use-ai-providers-CVS8EjHf.js";import"./auth-pLLkIszG.js";import"./use-collections-BnOL5hT8.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-BbFfuuHN.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-BB7o7ets.js";import"./label-CwMsBEmc.js";import"./use-connection-CRsO-Bab.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-B0gYtEWh.js";import"./checkbox-CFdij7Ei.js";import"./use-debounced-value-C2hJqHIV.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./extract-connection-data-BhI39RpO.js";function fr(t){const e=w.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:l,isMobile:o}=Ce();if(o||l==="collapsed")return null;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={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]=i,e[1]=a):(i=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:i,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const xt=240,xr=400,hr="sidebar.width";function Oe(t){return Math.max(xt,Math.min(xr,t))}function pr(){const t=w.c(11),[e,n]=We(hr,gr),r=O.useRef(null);let l;t[0]!==n||t[1]!==e?(l=m=>{m.preventDefault();const u=m.clientX,f=Oe(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=Oe(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Oe(f+(b.clientX-u));n(j);for(const v of p)v.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]=l):l=t[2];const o=l;let i;t[3]!==n?(i=()=>{n(xt)},t[3]=n,t[4]=i):i=t[4];const a=i;let c;t[5]!==e?(c=Oe(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==o||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function gr(t){return typeof t=="number"?Oe(t):xt}function rs(){return[]}function ls(t){const e=w.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 l;return e[1]!==n?(l=s.jsxs(at,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ct,{children:s.jsx(_e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=l):l=e[2],l}function os(t){const e=w.c(18),{item:n}=t,{isMobile:r,setOpenMobile:l}=Ce();let o;e[0]!==r||e[1]!==n||e[2]!==l?(o=()=>{ae("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&l(!1)},e[0]=r,e[1]=n,e[2]=l,e[3]=o):o=e[3];const i=o,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=F(c),e[4]=c,e[5]=d):d=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==i||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=i,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==u?(f=s.jsx(se,{className:d,children:u},a),e[14]=n.key,e[15]=d,e[16]=u,e[17]=f):f=e[17],f}function br(t){const e=w.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Rt,{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,l=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map(vr),e[2]=n.group.items,e[3]=o):o=e[3];let i;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(i=s.jsx(ls,{label:r,defaultExpanded:l,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=i):i=e[7],i}case"items":{let r;e[8]!==n.items?(r=n.items.map(jr),e[8]=n.items,e[9]=r):r=e[9];let l;return e[10]!==r?(l=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=l):l=e[11],l}case"custom":return n.content}}function jr(t){return s.jsx(os,{item:t},t.key)}function vr(t){return s.jsx(os,{item:t},t.key)}function yr(t){const e=w.c(14),{sections:n,footer:r,additionalContent:l,variant:o,contentClassName:i}=t,a=o===void 0?"sidebar":o;let c;e[0]!==i?(c=F("flex flex-col flex-1 px-2 py-2 gap-0.5",i),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Sr),e[2]=n,e[3]=d):d=e[3];let m;e[4]!==l?(m=l&&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:l}),e[4]=l,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==d||e[8]!==m?(u=s.jsxs(Lt,{className:c,children:[d,m]}),e[6]=c,e[7]=d,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==r||e[11]!==u||e[12]!==a?(f=s.jsxs(Ls,{variant:a,children:[u,r]}),e[10]=r,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Sr(t,e){return s.jsx(br,{section:t},e)}function is(t){const e=w.c(2);let n;return e[0]!==t?(n=s.jsx(yr,{...t}),e[0]=t,e[1]=n):n=e[1],n}is.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(fe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Nr(t){const e=w.c(16),{onToggle:n,className:r}=t,o=Dt().logo??Cs,i=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let c;e[0]!==r?(c=F("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]!==i?(d=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=i,e[3]=d):d=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==m?(u=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,m]})}),e[6]=d,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(xe,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;return e[12]!==c||e[13]!==u||e[14]!==h?(p=s.jsxs(Bs,{className:c,children:[u,h]}),e[12]=c,e[13]=u,e[14]=h,e[15]=p):p=e[15],p}function vt(t){const e=w.c(18),{item:n,onClose:r}=t,l=n.isActive&&"z-10";let o;e[0]!==l?(o=F(l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n||e[3]!==r?(i=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=i):i=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]!==i||e[12]!==a||e[13]!==c?(d=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=i,e[12]=a,e[13]=c,e[14]=d):d=e[14];let m;return e[15]!==o||e[16]!==d?(m=s.jsx(se,{className:o,children:d}),e[15]=o,e[16]=d,e[17]=m):m=e[17],m}function _r(t){const e=w.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,o=n.group.defaultExpanded;let i;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(vt,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],i=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=i}else i=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==i?(a=s.jsx(ls,{label:l,defaultExpanded:o,children:i}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=i,e[10]=a):a=e[10],a}case"items":{let l;if(e[11]!==r||e[12]!==n.items){let i;e[14]!==r?(i=a=>s.jsx(vt,{item:a,onClose:r},a.key),e[14]=r,e[15]=i):i=e[15],l=n.items.map(i),e[11]=r,e[12]=n.items,e[13]=l}else l=e[13];let o;return e[16]!==l?(o=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:l})})}),e[16]=l,e[17]=o):o=e[17],o}case"custom":return n.content}}function Cr(t){const e=w.c(17),{sections:n,onClose:r,footer:l,additionalContent:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=i):i=e[0];let a;e[1]!==r?(a=s.jsx(O.Suspense,{fallback:i,children:s.jsx(Nr,{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(_r,{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]!==o?(d=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==c||e[11]!==d?(m=s.jsxs(Lt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=m):m=e[12];let u;return e[13]!==l||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,l]}),e[13]=l,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=w.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 m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==m||e[9]!==u?(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:[m,u]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let l;e[11]!==n||e[12]!==r?(l=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=l):l=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let i;e[16]!==n.label?(i=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=i):i=e[17];let a;return e[18]!==l||e[19]!==o||e[20]!==i?(a=s.jsxs("button",{type:"button",onClick:l,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:[o,i]}),e[18]=l,e[19]=o,e[20]=i,e[21]=a):a=e[21],a}function yt(t){const e=w.c(126),{user:n,userImage:r,menuItems:l,signOutItem:o,themeOptions:i,preferences:a,setPreferences:c,close:d,isMobile:m}=t;if(m){const L=n?.name??"U";let H;e[0]!==L||e[1]!==r?(H=s.jsx(Me,{url:r,fallback:L,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=L,e[1]=r,e[2]=H):H=e[2];const Z=n?.name??"User";let K;e[3]!==Z?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=K):K=e[4];const ee=n?.email;let G;e[5]!==ee?(G=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee}),e[5]=ee,e[6]=G):G=e[6];let le;e[7]!==K||e[8]!==G?(le=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,G]}),e[7]=K,e[8]=G,e[9]=le):le=e[9];let ce;e[10]!==n?(ce=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(zr)},e[10]=n,e[11]=ce):ce=e[11];let V;e[12]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(ht,{size:14}),e[12]=V):V=e[12];let J;e[13]!==ce?(J=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ce,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:V})}),e[13]=ce,e[14]=J):J=e[14];let me;e[15]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=me):me=e[15];let I;e[16]!==J?(I=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[J,me]})}),e[16]=J,e[17]=I):I=e[17];let D;e[18]!==I||e[19]!==H||e[20]!==le?(D=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[H,le,I]}),e[18]=I,e[19]=H,e[20]=le,e[21]=D):D=e[21];let B;if(e[22]!==d||e[23]!==l){let pe;e[25]!==d?(pe=Le=>s.jsx(Be,{item:Le,onClose:d},Le.key),e[25]=d,e[26]=pe):pe=e[26],B=l.map(pe),e[22]=d,e[23]=l,e[24]=B}else B=e[24];let P;e[27]!==d||e[28]!==o?(P=s.jsx(Be,{item:o,onClose:d}),e[27]=d,e[28]=o,e[29]=P):P=e[29];let X;e[30]!==B||e[31]!==P?(X=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[B,P]})}),e[30]=B,e[31]=P,e[32]=X):X=e[32];let oe;if(e[33]!==a.theme||e[34]!==c||e[35]!==i){let pe;e[37]!==a.theme||e[38]!==c?(pe=Le=>{const{value:Je,icon:Ss,label:Ns}=Le;return s.jsx("button",{type:"button","aria-label":Ns,onClick:()=>c(_s=>({..._s,theme:Je})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Je?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ss},Je)},e[37]=a.theme,e[38]=c,e[39]=pe):pe=e[39],oe=i.map(pe),e[33]=a.theme,e[34]=c,e[35]=i,e[36]=oe}else oe=e[36];let ie;e[40]!==oe?(ie=s.jsx("div",{className:"flex items-center gap-0.5",children:oe}),e[40]=oe,e[41]=ie):ie=e[41];const Se=a.enableSounds?"Disable sounds":"Enable sounds";let U;e[42]!==c?(U=()=>c(Ir),e[42]=c,e[43]=U):U=e[43];const Ye=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Ye?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Ye),e[44]=Ye,e[45]=we):we=e[45];let ke;e[46]!==a.enableSounds?(ke=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[46]=a.enableSounds,e[47]=ke):ke=e[47];let Ie;e[48]!==Se||e[49]!==U||e[50]!==we||e[51]!==ke?(Ie=s.jsx("button",{type:"button","aria-label":Se,onClick:U,className:we,children:ke}),e[48]=Se,e[49]=U,e[50]=we,e[51]=ke,e[52]=Ie):Ie=e[52];let Fe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.0"]}),e[53]=Fe):Fe=e[53];let ze;e[54]!==Ie?(ze=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Fe]}),e[54]=Ie,e[55]=ze):ze=e[55];let $e;e[56]!==ie||e[57]!==ze?($e=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ie,ze]}),e[56]=ie,e[57]=ze,e[58]=$e):$e=e[58];let Re;return e[59]!==D||e[60]!==X||e[61]!==$e?(Re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,X,$e]}),e[59]=D,e[60]=X,e[61]=$e,e[62]=Re):Re=e[62],Re}const u=n?.name??"U";let f;e[63]!==u||e[64]!==r?(f=s.jsx(Me,{url:r,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=r,e[65]=f):f=e[65];const h=n?.name??"User";let p;e[66]!==h?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=p):p=e[67];const x=n?.email;let g;e[68]!==x?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x}),e[68]=x,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(kr)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ht,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let _;e[78]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=_):_=e[78];let k;e[79]!==y?(k=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[y,_]})}),e[79]=y,e[80]=k):k=e[80];let N;e[81]!==k||e[82]!==f||e[83]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=N):N=e[84];let C;if(e[85]!==d||e[86]!==l){let L;e[88]!==d?(L=H=>s.jsx(Be,{item:H,onClose:d},H.key),e[88]=d,e[89]=L):L=e[89],C=l.map(L),e[85]=d,e[86]=l,e[87]=C}else C=e[87];let S;e[90]!==d||e[91]!==o?(S=s.jsx(Be,{item:o,onClose:d}),e[90]=d,e[91]=o,e[92]=S):S=e[92];let z;e[93]!==C||e[94]!==S?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[C,S]}),e[93]=C,e[94]=S,e[95]=z):z=e[95];let T;if(e[96]!==a.theme||e[97]!==c||e[98]!==i){let L;e[100]!==a.theme||e[101]!==c?(L=H=>{const{value:Z,icon:K,label:ee}=H;return s.jsx("button",{type:"button","aria-label":ee,onClick:()=>c(G=>({...G,theme:Z})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Z)},e[100]=a.theme,e[101]=c,e[102]=L):L=e[102],T=i.map(L),e[96]=a.theme,e[97]=c,e[98]=i,e[99]=T}else T=e[99];let A;e[103]!==T?(A=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[103]=T,e[104]=A):A=e[104];const $=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[105]!==c?(E=()=>c(wr),e[105]=c,e[106]=E):E=e[106];const W=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let M;e[107]!==W?(M=F("size-7 rounded-md flex items-center justify-center transition-colors",W),e[107]=W,e[108]=M):M=e[108];let q;e[109]!==a.enableSounds?(q=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[109]=a.enableSounds,e[110]=q):q=e[110];let R;e[111]!==$||e[112]!==E||e[113]!==M||e[114]!==q?(R=s.jsx("button",{type:"button","aria-label":$,onClick:E,className:M,children:q}),e[111]=$,e[112]=E,e[113]=M,e[114]=q,e[115]=R):R=e[115];let Q;e[116]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.0"]}),e[116]=Q):Q=e[116];let Y;e[117]!==R?(Y=s.jsxs("div",{className:"flex items-center gap-2",children:[R,Q]}),e[117]=R,e[118]=Y):Y=e[118];let ne;e[119]!==A||e[120]!==Y?(ne=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[A,Y]}),e[119]=A,e[120]=Y,e[121]=ne):ne=e[121];let re;return e[122]!==N||e[123]!==z||e[124]!==ne?(re=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,z,ne]})}),e[122]=N,e[123]=z,e[124]=ne,e[125]=re):re=e[125],re}function wr(t){return{...t,enableSounds:!t.enableSounds}}function kr(){ge.success("User ID copied")}function Ir(t){return{...t,enableSounds:!t.enableSounds}}function zr(){ge.success("User ID copied")}function nt(){const t=w.c(34),{data:e}=be.useSession(),{org:n}=de(),r=he();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org",shouldThrow:!1},t[0]=l):l=t[0];const i=ws(l)?.params.org,[a,c]=ks(),d=dt(),[m,u]=O.useState(!1),f=e?.user,h=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const x=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ke,{size:16}),t[2]=g):g=t[2];let b;t[3]!==r||t[4]!==i?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{r({to:"/$org/settings/profile",params:{org:i??""}})}},t[3]=r,t[4]=i,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==r?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(qs,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=r,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(Ks,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(Js,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Is,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Ws,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let C;t[14]!==b||t[15]!==j?(C=[b,...j,v,y,_,k,N],t[14]=b,t[15]=j,t[16]=C):C=t[16];const S=C;let z;t[17]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Vs,{size:16}),onClick:Ar},t[17]=z):z=t[17];const T=z;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=A):A=t[18];let $;t[19]===Symbol.for("react.memo_cache_sentinel")?($={value:"dark",icon:s.jsx(Qs,{size:14}),label:"Dark theme"},t[19]=$):$=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=[A,$,{value:"system",icon:s.jsx(qt,{size:14}),label:"System theme"}],t[20]=E):E=t[20];const W=E;let M;t[21]!==d||t[22]!==S||t[23]!==a||t[24]!==c||t[25]!==f||t[26]!==h?(M={user:f,userImage:h,menuItems:S,signOutItem:T,themeOptions:W,preferences:a,setPreferences:c,close:x,isMobile:d},t[21]=d,t[22]=S,t[23]=a,t[24]=c,t[25]=f,t[26]=h,t[27]=M):M=t[27];const q=M;let R;return t[28]!==d||t[29]!==m||t[30]!==q||t[31]!==f?.name||t[32]!==h?(R=s.jsx(s.Fragment,{children:d?s.jsxs(Ht,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!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(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Ut,{className:"h-[80dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Account"}),s.jsx(yt,{...q})]})]}):s.jsxs(Pe,{open:m,onOpenChange:u,children:[s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ee,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:$r,children:s.jsx(yt,{...q})})]})}),t[28]=d,t[29]=m,t[30]=q,t[31]=f?.name,t[32]=h,t[33]=R):R=t[33],R}function $r(t){return t.preventDefault()}function Ar(){ae("signed_out",{source:"account_popover"}),zs(),be.signOut()}function rt(){const t=w.c(22),e=nn(),[n,r]=O.useState(!1);let l;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=rn(e.capabilities);l=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]=l}else l=t[4];const o=l;let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>r(!0),t[5]=i):i=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qt,{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 m;t[9]!==a||t[10]!==d?(m=s.jsx(je,{asChild:!0,children:s.jsxs(xe,{onClick:i,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(ve,{side:"bottom",children:o}),t[12]=o,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(ln,{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 Tr({invitation:t}){const[e,n]=O.useState(!1),[r,l]=O.useState(!1),o=$s(),i=async()=>{n(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){ge.error(d.error.message),n(!1);return}}catch{ge.error("Failed to accept invitation"),n(!1);return}ge.success("Invitation accepted!"),As();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{l(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});c.error?(ge.error(c.error.message),l(!1)):(ge.success("Invitation declined"),o.invalidateQueries())}catch{ge.error("Failed to decline invitation"),l(!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(Te,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:i,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Xe,{size:14})}),s.jsx(Te,{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(Kt,{size:14})})]})]})}function Dr(t){const e=w.c(29),{request:n}=t,{approve:r,deny:l}=on(),o=r.isPending||l.isPending,i=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==i?(c=i.charAt(0).toUpperCase(),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(Me,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==i?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:i})]}),e[6]=i,e[7]=u):u=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(Xe,{size:14}),e[11]=h):h=e[11];let p;e[12]!==o||e[13]!==f?(p=s.jsx(Te,{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:o,"aria-label":"Approve join request",children:h}),e[12]=o,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==l||e[16]!==n.id?(x=()=>l.mutate(n.id),e[15]=l,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Kt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==o||e[20]!==x?(b=s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:o,"aria-label":"Deny join request",children:g}),e[19]=o,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 v;return e[25]!==j||e[26]!==d||e[27]!==u?(v=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,u,j]}),e[25]=j,e[26]=d,e[27]=u,e[28]=v):v=e[28],v}function Or(t){const e=w.c(14),{release:n,isSeen:r,onSelect:l}=t;let o;e[0]!==r?(o=!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]=o):o=e[1];let i;e[2]!==n.eyebrow?(i=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=i):i=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]!==i||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[i,a]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Vt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let m;return e[10]!==l||e[11]!==o||e[12]!==c?(m=s.jsxs("button",{type:"button",onClick:l,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:[o,c,d]}),e[10]=l,e[11]=o,e[12]=c,e[13]=m):m=e[13],m}function Mr(){const t=O.useContext(Ts),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function as(){const t=w.c(11),{isSeen:e,markSeen:n,unseenCount:r}=cn(),l=Mr(),o=an();let i;if(t[0]!==e||t[1]!==l||t[2]!==o){const d=[...o].sort(Lr).map(Rr),m=[...l].sort(Fr).map(Er);let u;t[4]!==e?(u=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...dn].sort(Pr).map(u);i=[...d,...m,...f],t[0]=e,t[1]=l,t[2]=o,t[3]=i}else i=t[3];const a=r+l.length+o.length;let c;return t[6]!==n||t[7]!==l||t[8]!==i||t[9]!==a?(c={items:i,pendingInvitations:l,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=l,t[8]=i,t[9]=a,t[10]=c):c=t[10],c}function Pr(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Er(t){return{type:"invitation",invitation:t}}function Fr(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Rr(t){return{type:"join-request",request:t}}function Lr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class cs extends O.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 ds(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Br(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];let i;t[2]!==l?(i=F(l!=null&&ds(l)),t[2]=l,t[3]=i):i=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(Wt,{}),t[7]=c):c=t[7];let d;t[8]!==l?(d=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,t[9]=d):d=t[9];let m;t[10]!==d?(m=s.jsx("span",{children:d}),t[10]=d,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==i||t[14]!==a||t[15]!==m?(u=s.jsx(_e,{children:s.jsx(se,{children:s.jsxs(ue,{tooltip:o,className:i,onClick:a,children:[c,m]})})}),t[12]=o,t[13]=i,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function Hr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Br,{})})}),t[0]=e):e=t[0],e}function Ur(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];const i=o;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]!==l?(c=F(l!=null&&ds(l)),t[5]=l,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Wt,{className:"size-4"}),t[7]=d):d=t[7];let m;t[8]!==a||t[9]!==c||t[10]!==i?(m=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":i,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=i,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(ve,{side:"top",children:i}),t[12]=i,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function Gr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Ur,{})})}),t[0]=e):e=t[0],e}function ms(t){const e=w.c(15),{children:n}=t,{items:r,markReleaseSeen:l}=as(),[o,i]=O.useState(null);let a;if(e[0]!==r||e[1]!==o){let x;e[3]!==o?(x=g=>g.type==="release"&&g.release.id===o,e[3]=o,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=o,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let m;e[5]!==l?(m=x=>{i(x),l(x)},e[5]=l,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||i(null)},e[7]=f):f=e[7];let h;e[8]!==u||e[9]!==r||e[10]!==d?(h=s.jsx(Ee,{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(Te,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>i(null),children:s.jsx(Ys,{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(mn,{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(Ve,{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(Dr,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(Tr,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Or,{release:x.release,isSeen:x.isSeen,onSelect:()=>u(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=u,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Pe,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function us(){const{redDotCount:t}=as();return t>0}function qr(){const t=w.c(6),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{}),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 l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{children:"Inbox"}),t[3]=l):l=t[3];let o;return t[4]!==r?(o=s.jsx(ms,{children:s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:"Inbox",className:"relative",children:[n,r,l]})})}),t[4]=r,t[5]=o):o=t[5],o}function Wr(){const t=w.c(8),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{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 l;t[3]!==r?(l=s.jsx(Ne,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=l):l=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ve,{side:"top",children:"Inbox"}),t[5]=o):o=t[5];let i;return t[6]!==l?(i=s.jsx(ms,{children:s.jsxs(ye,{delayDuration:300,children:[l,o]})}),t[6]=l,t[7]=i):i=t[7],i}function Kr(){const t=w.c(7),e=he(),{org:n}=de();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 l,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{}),o=s.jsx("span",{children:"Settings"}),t[3]=l,t[4]=o):(l=t[3],o=t[4]);let i;return t[5]!==r?(i=s.jsxs(ue,{tooltip:"Settings",onClick:r,children:[l,o]}),t[5]=r,t[6]=i):i=t[6],i}function Vr(){const t=w.c(9),e=he(),{org:n}=de();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 l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{className:"size-4"}),t[3]=l):l=t[3];let o;t[4]!==r?(o=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":"Settings",onClick:r,children:l})}),t[4]=r,t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ve,{side:"top",children:"Settings"}),t[6]=i):i=t[6];let a;return t[7]!==o?(a=s.jsxs(ye,{delayDuration:300,children:[o,i]}),t[7]=o,t[8]=a):a=t[8],a}function Xr(){const t=w.c(6),{state:e}=Ce();if(e==="collapsed"){let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Hr,{}),t[0]=l):l=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(se,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(rt,{})})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(se,{children:s.jsx(qr,{})}),t[2]=i):i=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(se,{children:s.jsx(Kr,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(tt,{className:"px-2 pb-3 gap-1",children:[l,s.jsxs(_e,{children:[o,i,a,s.jsx(se,{children:s.jsx(nt,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(tt,{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(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),s.jsx(Vr,{}),s.jsx(Wr,{}),s.jsx(rt,{}),s.jsx(Gr,{})]})}),t[5]=r):r=t[5],r}function Qr(){const t=w.c(8),e=he(),{org:n}=de(),{setOpenMobile:r}=Ce();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),t[0]=l):l=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==r?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ke,{className:"size-4"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(tt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[l,s.jsx(xe,{"aria-label":"Settings",onClick:o,children:i})]})}),t[6]=o,t[7]=a):a=t[7],a}function St(t){const e=w.c(15),{className:n,wrapperClassName:r,children:l}=t,[o,i]=O.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&i(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;i(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const m=d;let u;e[2]!==r?(u=F("relative",r),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==l||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:m,className:n,children:l}),e[4]=l,e[5]=n,e[6]=f):f=e[6];const h=o?"opacity-100":"opacity-0";let p;e[7]!==h?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=p):p=e[8];let x;e[9]!==p?(x=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=x):x=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==x?(g=s.jsxs("div",{className:u,children:[f,x]}),e[11]=u,e[12]=f,e[13]=x,e[14]=g):g=e[14],g}function Yr(t){const e=w.c(8),{virtualMcpId:n,size:r,showAutomationBadge:l}=t,o=r===void 0?"sm":r;let i;e[0]!==o||e[1]!==n?(i=n?s.jsx(Jr,{virtualMcpId:n,size:o}):s.jsx(De,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==l?(a=l&&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(Tn,{size:10,className:"text-white"})}),e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Jr(t){const e=w.c(6),{virtualMcpId:n,size:r}=t,l=Qt(n);if(!l){let a;return e[0]!==r?(a=s.jsx(De,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const o=l.icon??null;let i;return e[2]!==l.title||e[3]!==r||e[4]!==o?(i=s.jsx(De,{icon:o,name:l.title,size:r}),e[2]=l.title,e[3]=r,e[4]=o,e[5]=i):i=e[5],i}function Nt(t){const e=w.c(36),{open:n,onOpenChange:r}=t,[l,o]=O.useState(""),{org:i}=de(),{setTaskId:a}=mt(),c=Zt();let d,m,u;e[0]!==i.id||e[1]!==l?(u=l.trim(),m=Mt,d=Ot.globalSearch(i.id,u),e[0]=i.id,e[1]=l,e[2]=d,e[3]=m,e[4]=u):(d=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==c||e[6]!==u?(h=async()=>await c.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=c,e[6]=u,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}=m(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==r?(v=$=>{$||o(""),r($)},e[14]=r,e[15]=v):v=e[15];const y=v;let _;e[16]!==y||e[17]!==a?(_=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=_):_=e[18];const k=_;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Sn,{className:"sr-only",children:[s.jsx(Nn,{children:"Search"}),s.jsx(_n,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let C;e[20]!==l?(C=s.jsx(zn,{value:l,onValueChange:o,placeholder:"Search..."}),e[20]=l,e[21]=C):C=e[21];let S;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(S=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(kn,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(In,{value:`thread:${$.id}:${$.title}`,onSelect:()=>k($),className:"gap-2.5",children:[s.jsx(Yr,{virtualMcpId:$.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:$.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=S):S=e[26];let z;e[27]!==S?(z=s.jsx($n,{children:S}),e[27]=S,e[28]=z):z=e[28];let T;e[29]!==C||e[30]!==z?(T=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(An,{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:[C,z]})]}),e[29]=C,e[30]=z,e[31]=T):T=e[31];let A;return e[32]!==y||e[33]!==n||e[34]!==T?(A=s.jsx(wn,{open:n,onOpenChange:y,children:T}),e[32]=y,e[33]=n,e[34]=T,e[35]=A):A=e[35],A}const _t=["requires_action","in_progress","failed","expired","completed"];function Zr(t){const e=new Map(_t.map(n=>[n,[]]));for(const n of t){const r=n.status??"completed";(e.get(r)??e.get("completed")).push(n)}return _t.map(n=>({status:n,threads:e.get(n)}))}const el="sidebar.group.expanded.";function tl(t,e){const n=w.c(3),[r,l]=We(`${el}${t}`,e);let o;return n[0]!==r||n[1]!==l?(o=[r,l],n[0]=r,n[1]=l,n[2]=o):o=n[2],o}function fs(t){const e=w.c(12),{onClick:n,isFetching:r,indented:l}=t,o=l?"-ml-4 pl-6 pr-2":"px-2";let i;e[0]!==o?(i=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"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]=o,e[1]=i):i=e[1];let a;e[2]!==r?(a=r&&s.jsx(Pt,{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 m;return e[6]!==r||e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==d?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:i,children:[a,d]}),e[6]=r,e[7]=n,e[8]=i,e[9]=a,e[10]=d,e[11]=m):m=e[11],m}function sl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function nl(t){return t.member==="mine"&&!t.currentUserId}const xs=4;let Ue=0;const lt=[];function rl(){for(;Ue<xs&<.length>0;){const t=lt.shift();t&&t()}}function hs(t){return new Promise((e,n)=>{const r=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,rl()})};Ue<xs?r():lt.push(r)})}const Qe=10;function Ct(t,e,n,r,l){const o={hidden:!1};r.member==="mine"&&r.currentUserId&&(o.created_by=r.currentUserId),r.type==="automation"&&(o.has_trigger=!0),r.type==="manual"&&(o.has_trigger=!1);const i={where:o,limit:l,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return i.status=e,i}function ll(t,e,n,r){let l=0;for(const o of t)ps(o,e,n,r)&&l++;return l}function Ze(t,e,n,r){return ll(t,e,n,r)}function ol(t,e){return!!(t>=Qe||t===0&&e)}function wt(t,e){return t<e}function il(t,e){return e===!1?!1:e===!0?!0:t}function ps(t,e,n,r){return!(t.hidden||(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 qe=new Map,He=new Map;function al(t,e){return e?t>=Qe?!0:null:!1}function kt(t){return qe.get(t)}function cl(t,e){qe.set(t,e)}function dl(t,e,n){const r=qe.get(t);if(r!==void 0){n(r);return}let l=He.get(t);l||(l=hs(e).then(o=>(qe.set(t,o),He.delete(t),o)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,l)),l.then(n,()=>n(!1))}function It(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ml(t,e,n,r,l){let o=0;for(const i of t)e.has(i.id)||ps(i,n,r,l)&&o++;return o}function ul(t,e,n,r){const l=w.c(8),{org:o}=de(),i=sl(o.id,t,e,n);let a;l[0]!==n?(a=nl(n),l[0]=n,l[1]=a):a=l[1];const c=a,[d,m]=O.useState({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==i&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});const u=vn(),{threads:f,hasMore:h}=ut(),p=Ze(f,t,e,n),x=ol(p,h),g=al(p,h),b=Zt();if(d.identity===i&&d.serverHasMore===null){const N=g??kt(i);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:N})}!c&&d.identity===i&&d.serverHasMore===null&&g===null&&kt(i)===void 0&&d.probeSubscribedIdentity!==i&&(m(N=>N.identity===i?{...N,isProbing:!0,probeSubscribedIdentity:i}:N),dl(i,async()=>{const N=Ct(t,e,0,n,1),C=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:S}=It(C),z=Ze(u.threads.get(),t,e,n);return S===void 0?!1:wt(z,S)},N=>{m(C=>C.identity!==i?C:{...C,isProbing:!1,serverHasMore:N})}));const v=async function(){if(d.isFetching||d.isProbing||c)return;const C=i;m(S=>S.identity===C?{...S,isFetching:!0}:S);try{const S=Ze(f,t,e,n),z=Ct(t,e,S,n,Qe),T=await hs(()=>b.call("COLLECTION_THREADS_LIST",z)),{items:A,hasMore:$,totalCount:E}=It(T),W=new Set(f.map(fl)),M=ml(A,W,t,e,n),q=S;u.mergeThreads(A),m(R=>{if(R.identity!==C)return R;let Q;return E!==void 0?Q=wt(q+M,E):Q=A.length===0||M===0?!1:$,cl(C,Q),{...R,isFetching:!1,serverHasMore:Q}})}catch(S){const z=S,T=z instanceof Error?z.message:String(z);ge.error(`Could not load more tasks: ${T}`),m(A=>A.identity===C?{...A,isFetching:!1}:A)}},y=d.isFetching||d.isProbing,_=!c&&!y&&il(x,d.serverHasMore);let k;return l[2]!==y||l[3]!==v||l[4]!==_||l[5]!==d.isProbing||l[6]!==d.serverHasMore?(k={hasMore:_,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:v},l[2]=y,l[3]=v,l[4]=_,l[5]=d.isProbing,l[6]=d.serverHasMore,l[7]=k):k=l[7],k}function fl(t){return t.id}function xl(t){const e=w.c(18),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,{isFetching:c,isProbing:d,loadMore:m,hasMore:u,serverHasMore:f}=ul("status",n,a),[h,p]=O.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{m()}));let x;if(e[0]!==l||e[1]!==a||e[2]!==i||e[3]!==o||e[4]!==r){let j;e[6]!==l||e[7]!==a||e[8]!==i||e[9]!==o?(j=v=>s.jsx(ts,{task:v,isActive:l===v.id,onClick:()=>o(v),onArchive:v.created_by===a.currentUserId?()=>i(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=l,e[7]=a,e[8]=i,e[9]=o,e[10]=j):j=e[10],x=r.map(j),e[0]=l,e[1]=a,e[2]=i,e[3]=o,e[4]=r,e[5]=x}else x=e[5];let g;e[11]!==u||e[12]!==c||e[13]!==m?(g=(u||c)&&s.jsx(fs,{onClick:()=>{m()},isFetching:c,indented:!0}),e[11]=u,e[12]=c,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==x||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function hl(t){const e=w.c(35),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,c=Mn[n],d=c.icon,[m,u]=tl(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.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]!==m?(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:m?s.jsx(ft,{size:14}):s.jsx(Vt,{size:14})}),e[8]=m,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 v;e[15]!==r.length?(v=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]=v):v=e[16];let y;e[17]!==m||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,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,v]}),e[17]=m,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let _;e[24]!==l||e[25]!==m||e[26]!==a||e[27]!==i||e[28]!==o||e[29]!==n||e[30]!==r?(_=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xl,{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a})}),e[24]=l,e[25]=m,e[26]=a,e[27]=i,e[28]=o,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==y||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,_]}),e[32]=y,e[33]=_,e[34]=k):k=e[34],k}function zt(t){const e=w.c(34),{threads:n,groupBy:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!c&&!d){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ve,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(r==="status"){let x;if(e[3]!==l||e[4]!==a||e[5]!==i||e[6]!==o||e[7]!==n){let b;e[9]!==l||e[10]!==a||e[11]!==i||e[12]!==o?(b=j=>s.jsx(hl,{status:j.status,threads:j.threads,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a},j.status),e[9]=l,e[10]=a,e[11]=i,e[12]=o,e[13]=b):b=e[13],x=Zr(n).map(b),e[3]=l,e[4]=a,e[5]=i,e[6]=o,e[7]=n,e[8]=x}else x=e[8];let g;return e[14]!==x?(g=s.jsx(s.Fragment,{children:x}),e[14]=x,e[15]=g):g=e[15],g}let f;if(e[16]!==l||e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==n){let x;e[22]!==l||e[23]!==a||e[24]!==i||e[25]!==o?(x=g=>s.jsx(ts,{task:g,isActive:l===g.id,onClick:()=>o(g),onArchive:g.created_by===a.currentUserId?()=>i(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=l,e[23]=a,e[24]=i,e[25]=o,e[26]=x):x=e[26],f=n.map(x),e[16]=l,e[17]=a,e[18]=i,e[19]=o,e[20]=n,e[21]=f}else f=e[21];let h;e[27]!==c||e[28]!==d||e[29]!==m?(h=(c||d)&&s.jsx(fs,{onClick:m,isFetching:d}),e[27]=c,e[28]=d,e[29]=m,e[30]=h):h=e[30];let p;return e[31]!==f||e[32]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),e[31]=f,e[32]=h,e[33]=p):p=e[33],p}function $t(t){const e=w.c(17),{label:n,onClick:r,active:l,children:o}=t,[i,a]=O.useState(!1);let c,d,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>a(!0),d=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=c,e[1]=d,e[2]=m,e[3]=u):(c=e[0],d=e[1],m=e[2],u=e[3]);const f=l&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=F(f),e[4]=f,e[5]=h):h=e[5];let p;e[6]!==o||e[7]!==n||e[8]!==r||e[9]!==h?(p=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":n,onClick:r,onPointerEnter:c,onPointerLeave:d,onFocus:m,onBlur:u,className:h,children:o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=h,e[10]=p):p=e[10];let x;e[11]!==n?(x=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=x):x=e[12];let g;return e[13]!==i||e[14]!==p||e[15]!==x?(g=s.jsxs(ye,{open:i,children:[p,x]}),e[13]=i,e[14]=p,e[15]=x,e[16]=g):g=e[16],g}function et(t){const e=w.c(13),{label:n,value:r,onChange:l,options:o}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==l?(a=u=>u&&l(u),e[2]=l,e[3]=a):a=e[3];let c;e[4]!==o?(c=o.map(pl),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==r?(d=s.jsx(pn,{type:"single",size:"sm",value:r,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:c}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9];let m;return e[10]!==i||e[11]!==d?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i,d]}),e[10]=i,e[11]=d,e[12]=m):m=e[12],m}function pl(t){return s.jsxs(hn,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:r}=de(),l=gn({connectionId:bn,orgId:r.id,orgSlug:r.slug}),o=Ge(r.id).id,i=Yt(),{threads:a,hasMore:c,isFetchingMore:d,fetchNextPage:m}=ut(),u=a.filter(I=>!I.hidden),{hide:f}=Jt(),h=he(),{setTaskId:p,createNewTask:x}=mt(),g=ot({strict:!1}),b=it({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},_=[...u].sort((I,D)=>(D.updated_at??"").localeCompare(I.updated_at??"")),[k,N]=O.useState("all"),[C,S]=O.useState("flat"),[z,T]=We("sidebar-threads-scope-all",!1),[A,$]=O.useState(!1),[E,W]=O.useState(!1),M={type:k,member:"mine",currentUserId:n??null},q=I=>n?I.filter(D=>D.created_by===n):[],R=I=>k==="automation"?I.filter(D=>!!D.trigger_id):k==="manual"?I.filter(D=>!D.trigger_id):I,Q=q(_),Y=R(Q),ne=R(_),re=z?ne:Y,L=I=>{if(n&&I.created_by&&I.created_by!==n)return;const D=I.id===j;if(f(I.id),!D)return;const B=Q.find(P=>P.id!==I.id&&P.virtual_mcp_id===I.virtual_mcp_id);y(),B?p(B.id,B.virtual_mcp_id):h({to:"/$org",params:{org:r.slug}})},H=I=>{y(),p(I.id,I.virtual_mcp_id)},Z=async I=>{try{const D=await l.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((D.structuredContent??D).items?.length??0)===0}catch{return!1}},K=async()=>{const I=v??o;ae("sidebar_new_thread_clicked",{virtual_mcp_id:I});const D=Q.find(B=>B.virtual_mcp_id===I&&B.title==="New chat");if(D&&await Z(D.id)){y(),p(D.id,I);return}y(),x(I)},{state:ee,isMobile:G,toggleSidebar:le}=Ce();if(ee==="collapsed"&&!G){const I=Ge(r.id),D=new Map((i??[]).map(P=>[P.id,P])),B=P=>(P?D.get(P):void 0)??(P===o?I:void 0);return s.jsxs(_e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(se,{children:s.jsx(ue,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:le,children:s.jsx(Bt,{size:16})})}),s.jsx(se,{children:s.jsx(ue,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})}),re.map(P=>{const X=B(P.virtual_mcp_id);return s.jsx(se,{children:s.jsx(ue,{tooltip:P.title||"New chat",isActive:P.id===j,onClick:()=>H(P),children:s.jsx(De,{icon:X?.icon??null,name:X?.title??"Agent",size:"2xs"})})},P.id)})]})}const V=C!=="flat"||k!=="all"||z===!0,J=s.jsxs(Pe,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(Ne,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Filter threads",active:V,children:[s.jsx(xn,{size:16}),V&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ve,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ee,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(et,{label:"View",value:C,onChange:I=>{ae("tasks_panel_group_by_changed",{to_value:I}),S(I)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(et,{label:"Type",value:k,onChange:I=>{ae("tasks_panel_filter_changed",{to_value:I}),N(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(et,{label:"Scope",value:z?"team":"mine",onChange:I=>T(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),me=I=>s.jsx(st,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(es,{}),J]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx($t,{label:"Search threads",onClick:()=>{ae("tasks_panel_search_opened"),W(!0),$(!0)},children:s.jsx(en,{size:16})}),s.jsx($t,{label:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})]})]})});return G?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!0),s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]})}const gl=5,bl=[{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 bs(){const t=w.c(3),{state:e}=Ce();if(e==="collapsed"){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:gl}).map(yl)}),t[0]=l):l=t[0],l}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(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"})]}),s.jsx(fe,{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:bl.map(jl)})]}),t[2]=r):r=t[2],r}function jl(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(fe,{className:"size-5 rounded-full shrink-0"}),s.jsx(fe,{className:F("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(vl)})]},e)}function vl(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(fe,{className:"h-3 flex-1 rounded-sm"})},e)}function yl(t,e){return s.jsx(fe,{className:"size-10 rounded-lg mx-auto"},e)}function Sl(){const t=w.c(4),e=rs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xr,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=r):r=t[1];let l;return t[2]!==e?(l=s.jsx(ss,{children:s.jsx(is,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=l):l=t[3],l}function Nl(t){const e=w.c(8),{onClose:n}=t,r=rs();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Qr,{}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let i;e[2]!==n?(i=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a=s.jsx(ss,{children:s.jsx(Cr,{sections:r,onClose:n,footer:l,additionalContent:i})}),e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const _l=Ds({name:Os().min(2,"Organization name is required")});function Cl(t){const e=w.c(41),{open:n,onOpenChange:r}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={resolver:Ms(_l),defaultValues:{name:""}},e[0]=l):l=e[0];const o=Ps(l);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={mutationFn:kl,onSuccess:wl},e[1]=i):i=e[1];const a=Es(i),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(Kn,{children:[s.jsx(Vn,{children:"Create a new organization"}),s.jsx(Xn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let m;if(e[3]!==a||e[4]!==o){let N;e[6]!==a?(N=C=>a.mutateAsync(C),e[6]=a,e[7]=N):N=e[7],m=o.handleSubmit(N),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=N=>{const{field:C}=N;return s.jsxs(er,{children:[s.jsx(tr,{children:"Organization Name"}),s.jsx(sr,{children:s.jsx(lr,{...C,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(nr,{children:"The name of your company or organization"}),C.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:"","/",js(C.value)]})]}),s.jsx(rr,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(Jn,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,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]!==o?(p=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=p):p=e[17];let x;e[18]!==o.formState.isSubmitting||e[19]!==p?(x=s.jsx(qn,{disabled:o.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!o.formState.isValid||o.formState.isSubmitting;let b;e[21]!==o.formState.isSubmitting?(b=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ln,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Te,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==x?(v=s.jsxs(Qn,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=h,e[33]=y):y=e[33];let _;e[34]!==o||e[35]!==y?(_=s.jsxs(Wn,{children:[d,s.jsx(Zn,{...o,children:y})]}),e[34]=o,e[35]=y,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(Yn,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function wl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function kl(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.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 Il(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 vs(t){const e=w.c(13),{org:n,size:r}=t,l=r===void 0?"sm":r,o=l==="xs"?"size-5":"size-6",i=l==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=F(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Il(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]!==i?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",i),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=i,e[8]=d):d=e[8];let m;return e[9]!==a||e[10]!==c||e[11]!==d?(m=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=m):m=e[12],m}function zl(t){const e=w.c(24),{orgParam:n,onSelectOrg:r,onCreateOrg:l}=t,{data:o}=Fs();let i;e[0]!==n?(i=(S,z)=>S.slug===n?-1:z.slug===n?1:S.name.localeCompare(z.name),e[0]=n,e[1]=i):i=e[1];const a=[...o??[]].sort(i),[c,d]=O.useState(""),m=c.toLowerCase(),u=m?a.filter(S=>S.name.toLowerCase().includes(m)||S.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ns,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=S=>d(S.target.value),e[3]=h):h=e[3];let p;e[4]!==c?(p=S=>S.key==="Escape"&&c&&d(""),e[4]=c,e[5]=p):p=e[5];let x;e[6]!==c||e[7]!==p?(x=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:c,onChange:h,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=c,e[7]=p,e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ae,{size:16}),e[9]=g):g=e[9];let b;e[10]!==l?(b=s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=l,e[11]=b):b=e[11];let j;e[12]!==x||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,x,b]}),e[12]=x,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:c?`No organizations match "${c}"`:"No organizations available"});let _;e[15]!==r||e[16]!==n?(_=S=>s.jsxs("button",{type:"button",onClick:()=>r(S.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",S.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(vs,{org:S,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.slug})]}),S.slug===n&&s.jsx(Xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},S.id),e[15]=r,e[16]=n,e[17]=_):_=e[17];const k=u.map(_);let N;e[18]!==y||e[19]!==k?(N=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=N):N=e[20];let C;return e[21]!==N||e[22]!==j?(C=s.jsxs(s.Fragment,{children:[j,N]}),e[21]=N,e[22]=j,e[23]=C):C=e[23],C}function $l(t){const e=w.c(22),{trigger:n,orgParam:r,align:l,side:o}=t,i=l===void 0?"start":l,a=o===void 0?"bottom":o,c=he(),[d,m]=O.useState(!1),[u,f]=O.useState(!1);let h;e[0]!==n?(h=s.jsx(Ne,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const p=String(d);let x;e[2]!==c?(x=k=>{m(!1),c({to:"/$org",params:{org:k}})},e[2]=c,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==r||e[6]!==p||e[7]!==x?(b=s.jsx(zl,{orgParam:r,onSelectOrg:x,onCreateOrg:g},p),e[5]=r,e[6]=p,e[7]=x,e[8]=b):b=e[8];let j;e[9]!==i||e[10]!==a||e[11]!==b?(j=s.jsx(Ee,{side:a,align:i,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Tl,onCloseAutoFocus:Al,children:b}),e[9]=i,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==d||e[14]!==h||e[15]!==j?(v=s.jsxs(Pe,{open:d,onOpenChange:m,children:[h,j]}),e[13]=d,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Cl,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let _;return e[19]!==y||e[20]!==v?(_=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=_):_=e[21],_}function Al(t){return t.preventDefault()}function Tl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Dl(t){const e=w.c(21),{value:n,onChange:r,placeholder:l,onKeyDown:o,className:i,isSearching:a,disabled:c}=t,d=l===void 0?"Search...":l;let m;e[0]!==i?(m=F("shrink-0 w-full border-b border-border h-12",i),e[0]=i,e[1]=m):m=e[1];const u=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Pt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ns,{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]!==o||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:o,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]=o,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]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Ol="Select an existing agent";function Ml(t){const e=w.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ve,{side:"right",sideOffset:8,children:Ol}),e[2]=l):l=e[2];let o;return e[3]!==r?(o=s.jsxs(ye,{defaultOpen:!0,delayDuration:0,children:[r,l]}),e[3]=r,e[4]=o):o=e[4],o}function Pl(){const t=w.c(5),{enableDecoImport:e}=Dt(),{data:n}=be.useSession();let r;t[0]!==n?.user?.email?(r=Ot.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const l=!!e&&!!n?.user?.email;let o;t[2]!==r||t[3]!==l?(o={queryKey:r,queryFn:El,enabled:l,staleTime:3e5},t[2]=r,t[3]=l,t[4]=o):o=t[4];const{data:i}=Mt(o);return i?.isDecoUser??!1}async function El(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Fl(t){const e=he(),{create:n}=Jt(),{locator:r}=de(),l=ot({strict:!1}),o=it({strict:!1});return async i=>{const a=crypto.randomUUID(),c=i===o.virtualmcpid?un(t,r,l.taskId??""):null;try{await n({id:a,virtual_mcp_id:i,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:i}})}}function At(t){const e=w.c(17),{agent:n,selected:r,onClick:l}=t,o=r?"bg-accent":"hover:bg-accent";let i;e[0]!==o?(i=F("flex flex-col items-center gap-2 p-3 rounded-xl transition-colors cursor-pointer group",o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(De,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let c;e[5]!==r?(c=r&&s.jsx("span",{className:"absolute -bottom-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-background",children:s.jsx(Xe,{size:10,className:"text-foreground"})}),e[5]=r,e[6]=c):c=e[6];let d;e[7]!==a||e[8]!==c?(d=s.jsxs("div",{className:"relative",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9];let m;e[10]!==n.title?(m=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[10]=n.title,e[11]=m):m=e[11];let u;return e[12]!==l||e[13]!==i||e[14]!==d||e[15]!==m?(u=s.jsxs("button",{type:"button",onClick:l,className:i,children:[d,m]}),e[12]=l,e[13]=i,e[14]=d,e[15]=m,e[16]=u):u=e[16],u}function Rl(t){const e=w.c(60),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:l,onSelectAgent:o,selectedAgentId:i}=t,[a,c]=O.useState(""),d=Yt(),m=d??[],{org:u}=de(),{data:f}=be.useSession(),h=f?.user?.id??"anon",p=En(d),x=Fn();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:b,isCreating:j}=ir(g),{createFromTemplate:v,isCreating:y}=cr(),_=Pl(),k=Fl(u.slug),N=fn(d),C=a.toLowerCase(),S=m.filter(Ll).filter(U=>!N.has(U.id)).filter(U=>!a||U.title.toLowerCase().includes(C)),z=Ge(u.id),T=!a||z.title.toLowerCase().includes(C);let A;e[1]!==n||e[2]!==o?(A=()=>{o?.(null),n(),c("")},e[1]=n,e[2]=o,e[3]=A):A=e[3];const $=A,E=U=>{if(o){o(U.id),n(),c("");return}Rn({orgId:u.id,userId:h},U.id,p),x(),n(),c(""),k(U.id)},W="flex flex-col max-h-[min(640px,80dvh)]";let M;e[4]!==a?(M=s.jsx(Dl,{value:a,onChange:c,placeholder:"Search agents..."}),e[4]=a,e[5]=M):M=e[5];const q="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let R;e[6]===Symbol.for("react.memo_cache_sentinel")?(R=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[6]=R):R=e[6];const Q="grid grid-cols-3 gap-1";let Y;e[7]!==b||e[8]!==n?(Y=async()=>{ae("agent_create_new_clicked",{source:"browse_popover"}),await b(),n()},e[7]=b,e[8]=n,e[9]=Y):Y=e[9];let ne,re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=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(Ae,{size:16,className:"text-muted-foreground"})}),ne=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[10]=ne,e[11]=re):(ne=e[10],re=e[11]);let L;e[12]!==j||e[13]!==Y?(L=s.jsxs("button",{type:"button",disabled:j,onClick:Y,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:[re,ne]}),e[12]=j,e[13]=Y,e[14]=L):L=e[14];let H;e[15]!==v||e[16]!==n?(H=async()=>{ae("agent_create_clicked",{source:"browse_popover",method:"website"}),await v(dr),n()},e[15]=v,e[16]=n,e[17]=H):H=e[17];let Z,K;e[18]===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(or,{className:"size-5 text-muted-foreground"})}),K=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[18]=Z,e[19]=K):(Z=e[18],K=e[19]);let ee;e[20]!==y||e[21]!==H?(ee=s.jsxs("button",{type:"button",disabled:y,onClick:H,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:[Z,K]}),e[20]=y,e[21]=H,e[22]=ee):ee=e[22];let G;e[23]!==n||e[24]!==l?(G=()=>{ae("agent_import_clicked",{source:"github"}),l(),n()},e[23]=n,e[24]=l,e[25]=G):G=e[25];let le,ce;e[26]===Symbol.for("react.memo_cache_sentinel")?(le=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(ur,{className:"size-5 text-muted-foreground"})}),ce=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[26]=le,e[27]=ce):(le=e[26],ce=e[27]);let V;e[28]!==G?(V=s.jsxs("button",{type:"button",onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[le,ce]}),e[28]=G,e[29]=V):V=e[29];let J;e[30]!==_||e[31]!==n||e[32]!==r?(J=_&&s.jsxs("button",{type:"button",onClick:()=>{ae("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[30]=_,e[31]=n,e[32]=r,e[33]=J):J=e[33];const me=o&&T&&z&&s.jsx(At,{agent:z,selected:!i||i===z.id,onClick:$}),I=S.map(U=>s.jsx(At,{agent:U,selected:o?i===U.id:void 0,onClick:()=>E(U)},U.id));let D;e[34]!==L||e[35]!==ee||e[36]!==V||e[37]!==J||e[38]!==me||e[39]!==I?(D=s.jsxs("div",{className:Q,children:[L,ee,V,J,me,I]}),e[34]=L,e[35]=ee,e[36]=V,e[37]=J,e[38]=me,e[39]=I,e[40]=D):D=e[40];let B;e[41]!==j||e[42]!==a||e[43]!==S.length?(B=S.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:a?"No agents found":"No agents yet"}),e[41]=j,e[42]=a,e[43]=S.length,e[44]=B):B=e[44];let P;e[45]!==D||e[46]!==B||e[47]!==R?(P=s.jsxs("div",{className:q,children:[R,D,B]}),e[45]=D,e[46]=B,e[47]=R,e[48]=P):P=e[48];let X;e[49]!==u.slug?(X={org:u.slug},e[49]=u.slug,e[50]=X):X=e[50];let oe;e[51]!==n?(oe=()=>n(),e[51]=n,e[52]=oe):oe=e[52];let ie;e[53]!==X||e[54]!==oe?(ie=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ft,{to:"/$org/settings/agents",params:X,onClick:oe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[53]=X,e[54]=oe,e[55]=ie):ie=e[55];let Se;return e[56]!==P||e[57]!==ie||e[58]!==M?(Se=s.jsxs("div",{className:W,children:[M,P,ie]}),e[56]=P,e[57]=ie,e[58]=M,e[59]=Se):Se=e[59],Se}function Ll(t){return!jn(t.id)}function Bl(t){const e=w.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r,trigger:l,onSelectAgent:o,selectedAgentId:i,side:a,align:c}=n,d=r===void 0?!1:r,m=a===void 0?"right":a,u=c===void 0?"start":c,[f,h]=O.useState(!1),[p,x]=O.useState(!1),[g,b]=O.useState(!1),j=dt(),{setOpenMobile:v}=Ce(),y=Pn(),_=y?"border border-border":void 0;let k;e[2]!==y?(k=M=>y?s.jsx(Ml,{children:M}):M,e[2]=y,e[3]=k):k=e[3];const N=k;let C;e[4]!==j||e[5]!==v?(C=()=>{h(!1),j&&v(!1)},e[4]=j,e[5]=v,e[6]=C):C=e[6];const S=C;let z;e[7]!==S||e[8]!==o||e[9]!==f||e[10]!==i?(z=f&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(fe,{className:"h-4 w-24"})}),children:s.jsx(Rl,{onClose:S,onOpenImportDeco:()=>x(!0),onOpenGithubImport:()=>{b(!0),S()},onSelectAgent:o,selectedAgentId:i})}),e[7]=S,e[8]=o,e[9]=f,e[10]=i,e[11]=z):z=e[11];const T=z;let A;e[12]!==u||e[13]!==d||e[14]!==_||e[15]!==y||e[16]!==j||e[17]!==f||e[18]!==T||e[19]!==m||e[20]!==l||e[21]!==N?(A=j?s.jsxs(s.Fragment,{children:[l?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:l}):d?N(s.jsx(xe,{"aria-label":"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Ae,{className:"size-4"})})):s.jsx(se,{children:N(s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ht,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Browse agents"}),T]})})]}):s.jsxs(Pe,{open:f,onOpenChange:M=>{M&&!f&&ae("agent_browser_opened",{surface:"desktop_popover"}),h(M)},children:[l?s.jsx(Ne,{asChild:!0,children:l}):d?N(s.jsx(Ne,{asChild:!0,children:s.jsx(xe,{"aria-label":"Browse agents",className:F(_),children:s.jsx(Ae,{className:"size-4"})})})):s.jsx(se,{children:N(s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ee,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:T})]}),e[12]=u,e[13]=d,e[14]=_,e[15]=y,e[16]=j,e[17]=f,e[18]=T,e[19]=m,e[20]=l,e[21]=N,e[22]=A):A=e[22];let $;e[23]!==p?($=s.jsx(ar,{open:p,onOpenChange:x}),e[23]=p,e[24]=$):$=e[24];let E;e[25]!==g?(E=s.jsx(mr,{open:g,onOpenChange:b}),e[25]=g,e[26]=E):E=e[26];let W;return e[27]!==E||e[28]!==A||e[29]!==$?(W=s.jsxs(s.Fragment,{children:[A,$,E]}),e[27]=E,e[28]=A,e[29]=$,e[30]=W):W=e[30],W}const ys="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Hl(t){const e=w.c(19),{agentId:n,onOpenHome:r,onPick:l}=t,o=Qt(n),i=o?.title??"Decopilot",a=`Open ${i} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==i?(d=s.jsx(De,{icon:c,name:i,size:"2xs"}),e[0]=c,e[1]=i,e[2]=d):d=e[2];let m;e[3]!==r||e[4]!==a||e[5]!==d?(m=s.jsx("button",{type:"button",onClick:r,"aria-label":a,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=r,e[4]=a,e[5]=d,e[6]=m):m=e[6];let u;e[7]!==i?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:i}),e[7]=i,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let h;e[10]!==u?(h=s.jsxs("button",{type:"button",className:ys,children:[u,f]}),e[10]=u,e[11]=h):h=e[11];let p;e[12]!==n||e[13]!==l||e[14]!==h?(p=s.jsx(Bl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:h}),e[12]=n,e[13]=l,e[14]=h,e[15]=p):p=e[15];let x;return e[16]!==m||e[17]!==p?(x=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=x):x=e[18],x}function Tt(){const t=w.c(34),{org:e}=de(),{state:n}=Ce(),r=n==="collapsed",l=he();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const i=ot(o);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const c=it(a),{threads:d}=ut(),{setTaskId:m,createNewTask:u}=mt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const h=f.id,p=i.taskId?c.virtualmcpid??h:h;let x;t[4]!==u||t[5]!==h||t[6]!==l||t[7]!==e.slug||t[8]!==m||t[9]!==d?(x=T=>{if(!T||T===h){l({to:"/$org",params:{org:e.slug}});return}const A=d.find($=>!$.hidden&&$.virtual_mcp_id===T&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));A?m(A.id,T):u(T)},t[4]=u,t[5]=h,t[6]=l,t[7]=e.slug,t[8]=m,t[9]=d,t[10]=x):x=t[10];const g=x;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(te.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ft,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==r?(y=!r&&s.jsx($l,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ys,children:[s.jsx(vs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=r,t[18]=y):y=t[18];let _;t[19]!==v||t[20]!==y?(_=s.jsxs(jt,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=_):_=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Hn,{}),t[22]=k):k=t[22];let N;t[23]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[23]=N):N=t[23];let C;t[24]!==p||t[25]!==g?(C=()=>g(p),t[24]=p,t[25]=g,t[26]=C):C=t[26];let S;t[27]!==p||t[28]!==g||t[29]!==C?(S=s.jsx(jt,{children:s.jsx(O.Suspense,{fallback:N,children:s.jsx(Hl,{agentId:p,onOpenHome:C,onPick:g})})}),t[27]=p,t[28]=g,t[29]=C,t[30]=S):S=t[30];let z;return t[31]!==S||t[32]!==_?(z=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Gn,{className:"flex-nowrap",children:[_,k,S]})}),t[31]=S,t[32]=_,t[33]=z):z=t[33],z}const Ul="sidebar.open";function Gl(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(On,{}),t[0]=e):e=t[0],e}function Li(){const t=w.c(24),e=dt(),[n,r]=We(Ul,!1),{width:l,wrapperRef:o,onStartResize:i,resetWidth:a}=pr();let c;t[0]!==e?(c=e?s.jsxs(te.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] items-center gap-2",children:[s.jsx(es,{}),s.jsx(Tt,{}),s.jsx(rt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(te.TogglesSlot,{}),s.jsx(te.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(te.CenterSlot,{}),s.jsx(te.RightSlot,{})]}):s.jsxs(te.Header,{children:[s.jsx(te.LeftColumn,{children:s.jsx(Tt,{})}),s.jsx(te.CenterSlot,{}),s.jsxs(te.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(te.TabsSlot,{})}),s.jsx(te.RightSlot,{}),s.jsx(te.TogglesSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${l}px`;let m;t[2]!==d?(m={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==i||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Sl,{}),s.jsx(fr,{onPointerDown:i,onDoubleClick:a})]}),t[4]=e,t[5]=i,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(Hs,{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(O.Suspense,{fallback:s.jsx(Gl,{}),children:s.jsx(Rs,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==u||t[11]!==f||t[12]!==o?(x=s.jsxs(Us,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=o,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dn,{renderSidebar:ql}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(Bn,{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(yn,{children:s.jsx(te.Provider,{children:s.jsx(Gs,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ql(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(Nl,{onClose:e})})})}export{Li as default};
|
|
1
|
+
import{c as w,j as s,C as We,r as O,l as F,v as ae,D as Dt,F as Cs,a as be,G as de,b as he,H as ws,I as ks,t as ge,J as Is,M as zs,m as $s,B as Te,y as As,P as Ts,K as Ot,k as Mt,i as Pt,e as ot,u as it,E as Et,o as Ds,s as Os,n as Ms,p as Ps,d as Es,x as Fs,R as Ft,O as Rs}from"./index-DIyNSN96.js";import{u as Ce,S as at,a as ct,b as _e,c as ue,d as se,e as Rt,f as Lt,g as Ls,h as Bs,i as tt,j as Hs,k as Us,l as Gs}from"./sidebar-haKmZZ-W.js";import{u as dt}from"./use-mobile-Dd_g0aui.js";import{S as fe}from"./skeleton-BuPVKDK7.js";import{i as Bt}from"./LayoutLeft-Bi6Cd7VR.js";import{T as xe}from"./toolbar-icon-button-BJjnMzvJ.js";import{P as Pe,a as Ne,b as Ee}from"./popover-Q1EdqSJG.js";import{D as Ht,a as Ut,b as Gt}from"./drawer-CKH1wPOe.js";import{A as Me}from"./avatar-CQ--7kDr.js";import{a as je,b as ve,c as st,T as ye}from"./tooltip-Dn6TT4fb.js";import{a as ht}from"./Eye-DmGPRR_e.js";import{n as qs,i as Ws}from"./Globe01-DO0D_c2f.js";import{i as Ks}from"./ZoomOut-BVzIyFeW.js";import{i as Vs}from"./ZapSquare-BOyZ6Rgl.js";import{i as qt}from"./Monitor01-DG_zJQKB.js";import{n as Xs,a as Qs}from"./Sun-YyXJklY4.js";import{a as Ke,b as Ys}from"./Settings02-CYQjLDZe.js";import{i as Js}from"./Shield01-BmIMMGLU.js";import{a as Zs}from"./Users03-DdlXwWfA.js";import{a as pt,b as gt,c as Wt,A as De,d as bt,i as en,s as tn,e as sn}from"./agent-icon-XUhQzRLX.js";import"./index-DIWWb6ZU.js";import{n as Ve}from"./Stars02-DBhfsTYG.js";import{u as nn,v as rn,C as ln}from"./connect-desktop-dialog-BP-u_roi.js";import{i as Xe}from"./ChevronUp-2KGxjR7x.js";import{s as Kt}from"./XClose-DnDy-OvD.js";import{u as on,a as an}from"./use-join-requests-COO3fg4J.js";import{i as Vt}from"./ChevronRight-D8G4YOXh.js";import{u as cn,R as dn,a as mn,b as mt,r as un}from"./shell-layout-BCl91e2n.js";import{u as Xt,g as fn}from"./agent-capabilities-2TzzHD_U.js";import{i as xn}from"./FilterLines-DEMLsHE0.js";import{T as hn,a as pn}from"./toggle-group-C5lfVqY9.js";import{u as gn,S as bn,a as Ge,i as jn}from"./use-mcp-client-tU9_Q31R.js";import{u as Qt,a as Yt}from"./use-virtual-mcp-WZNqIa1a.js";import{u as vn,a as ut,b as Jt,T as yn}from"./hooks-DFBNXh69.js";import{c as Sn,a as Nn,b as _n,d as Cn,e as wn}from"./dialog-a5ZkDZhy.js";import{C as kn,a as In,b as zn,c as $n,d as An}from"./command-B9iUw_Wf.js";import{u as Zt}from"./studio-tools-Bs0xo1Z2.js";import{i as Tn}from"./Zap-DtiJN-LC.js";import{S as es,M as Dn}from"./shell-controls-CYHtSsaG.js";import{T as ts,S as On}from"./shell-route-loading-D29sfZCo.js";import{t as ft}from"./ChevronDown-B0d3gCJ4.js";import{S as Mn}from"./task-status-DTdpp4Y7.js";import{S as ss,u as Pn,g as En,a as Fn,b as Rn}from"./use-navigate-to-agent-KaAiMohr.js";import{S as Ln,C as Bn}from"./chat-context-BXYlU18c.js";import{B as jt,a as Hn,b as Un,c as Gn}from"./breadcrumb-Iv2RnKdx.js";import{T as te}from"./toolbar-DfZcXUSS.js";import{s as Ae}from"./Plus-tW6PYhLA.js";import{i as ns}from"./SearchMd-DCtxyy_L.js";import{A as qn,a as Wn,b as Kn,c as Vn,d as Xn,e as Qn,f as Yn}from"./alert-dialog-depKBGzY.js";import{F as Jn,a as Zn,b as er,c as tr,d as sr,f as nr,e as rr}from"./form-B8xO7s3Q.js";import{I as lr}from"./input-CaPkg-tG.js";import{s as or}from"./Star01-BiHTCvVR.js";import{u as ir}from"./use-create-virtual-mcp-BRn7Xglj.js";import{I as ar,u as cr,W as dr}from"./import-from-deco-dialog-DdhvtCEU.js";import{G as mr,a as ur}from"./github-repo-picker-CNVz0qrC.js";import"./sheet-B0u11yoj.js";import"./X-C54nvkaE.js";import"./User01-D26yJD3f.js";import"./AlertCircle-CWgtpDgs.js";import"./Tool01-D68BO4Z1.js";import"./SwitchHorizontal01-DCwK87MF.js";import"./XCircle-DMTFcHqR.js";import"./ArrowUpRight-O2h0Esun.js";import"./CheckCircle-CzbMe8sq.js";import"./DotsVertical-B-sq-ide.js";import"./Globe04-XJoX6kmZ.js";import"./HardDrive-BICUWfOq.js";import"./Key01-BtQzPiv-.js";import"./LinkExternal01-CB818nxD.js";import"./Palette-D5uFHHtD.js";import"./Play-8mfsN5e2.js";import"./SearchLg-BRB4E-a6.js";import"./Stars01-BoOQBwEf.js";import"./Trash01-BDaXEXf_.js";import"./Upload01-B14hHeGP.js";import"./Users01-DcpQUESq.js";import"./use-capability-BKrWdNMG.js";import"./required-auth-layout-C_pN8svZ.js";import"./tab-id-DPNwWMUY.js";import"./use-organization-settings-DrjygbOR.js";import"./use-org-sso-2HCpkr8C.js";import"./use-ai-providers-zyN1ygBC.js";import"./auth-JzTDloGx.js";import"./use-collections-BS7_MipP.js";import"./decopilot-sse-pool-4ct7M3nK.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-Dzrzv-LN.js";import"./use-clock-tick-nZuMTIzb.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-CtfZfAhc.js";import"./label-D0Oq_enN.js";import"./use-connection-Cs21veSc.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-CVteq94G.js";import"./checkbox-_ejCMjxu.js";import"./use-debounced-value-fFVCMUXm.js";import"./authenticate-and-persist-oauth-DBxyWtpZ.js";import"./mcp-oauth-DkfCvuSl.js";import"./use-mcp-tools-B2LI7RR7.js";import"./extract-connection-data--lA2dih1.js";function fr(t){const e=w.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:l,isMobile:o}=Ce();if(o||l==="collapsed")return null;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={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]=i,e[1]=a):(i=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:i,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const xt=240,xr=400,hr="sidebar.width";function Oe(t){return Math.max(xt,Math.min(xr,t))}function pr(){const t=w.c(11),[e,n]=We(hr,gr),r=O.useRef(null);let l;t[0]!==n||t[1]!==e?(l=m=>{m.preventDefault();const u=m.clientX,f=Oe(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=Oe(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Oe(f+(b.clientX-u));n(j);for(const v of p)v.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]=l):l=t[2];const o=l;let i;t[3]!==n?(i=()=>{n(xt)},t[3]=n,t[4]=i):i=t[4];const a=i;let c;t[5]!==e?(c=Oe(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==o||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function gr(t){return typeof t=="number"?Oe(t):xt}function rs(){return[]}function ls(t){const e=w.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 l;return e[1]!==n?(l=s.jsxs(at,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ct,{children:s.jsx(_e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=l):l=e[2],l}function os(t){const e=w.c(18),{item:n}=t,{isMobile:r,setOpenMobile:l}=Ce();let o;e[0]!==r||e[1]!==n||e[2]!==l?(o=()=>{ae("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&l(!1)},e[0]=r,e[1]=n,e[2]=l,e[3]=o):o=e[3];const i=o,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=F(c),e[4]=c,e[5]=d):d=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==i||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=i,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==u?(f=s.jsx(se,{className:d,children:u},a),e[14]=n.key,e[15]=d,e[16]=u,e[17]=f):f=e[17],f}function br(t){const e=w.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Rt,{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,l=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map(vr),e[2]=n.group.items,e[3]=o):o=e[3];let i;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(i=s.jsx(ls,{label:r,defaultExpanded:l,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=i):i=e[7],i}case"items":{let r;e[8]!==n.items?(r=n.items.map(jr),e[8]=n.items,e[9]=r):r=e[9];let l;return e[10]!==r?(l=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=l):l=e[11],l}case"custom":return n.content}}function jr(t){return s.jsx(os,{item:t},t.key)}function vr(t){return s.jsx(os,{item:t},t.key)}function yr(t){const e=w.c(14),{sections:n,footer:r,additionalContent:l,variant:o,contentClassName:i}=t,a=o===void 0?"sidebar":o;let c;e[0]!==i?(c=F("flex flex-col flex-1 px-2 py-2 gap-0.5",i),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Sr),e[2]=n,e[3]=d):d=e[3];let m;e[4]!==l?(m=l&&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:l}),e[4]=l,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==d||e[8]!==m?(u=s.jsxs(Lt,{className:c,children:[d,m]}),e[6]=c,e[7]=d,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==r||e[11]!==u||e[12]!==a?(f=s.jsxs(Ls,{variant:a,children:[u,r]}),e[10]=r,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Sr(t,e){return s.jsx(br,{section:t},e)}function is(t){const e=w.c(2);let n;return e[0]!==t?(n=s.jsx(yr,{...t}),e[0]=t,e[1]=n):n=e[1],n}is.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(fe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Nr(t){const e=w.c(16),{onToggle:n,className:r}=t,o=Dt().logo??Cs,i=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let c;e[0]!==r?(c=F("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]!==i?(d=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=i,e[3]=d):d=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==m?(u=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,m]})}),e[6]=d,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(xe,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;return e[12]!==c||e[13]!==u||e[14]!==h?(p=s.jsxs(Bs,{className:c,children:[u,h]}),e[12]=c,e[13]=u,e[14]=h,e[15]=p):p=e[15],p}function vt(t){const e=w.c(18),{item:n,onClose:r}=t,l=n.isActive&&"z-10";let o;e[0]!==l?(o=F(l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n||e[3]!==r?(i=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=i):i=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]!==i||e[12]!==a||e[13]!==c?(d=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=i,e[12]=a,e[13]=c,e[14]=d):d=e[14];let m;return e[15]!==o||e[16]!==d?(m=s.jsx(se,{className:o,children:d}),e[15]=o,e[16]=d,e[17]=m):m=e[17],m}function _r(t){const e=w.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,o=n.group.defaultExpanded;let i;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(vt,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],i=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=i}else i=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==i?(a=s.jsx(ls,{label:l,defaultExpanded:o,children:i}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=i,e[10]=a):a=e[10],a}case"items":{let l;if(e[11]!==r||e[12]!==n.items){let i;e[14]!==r?(i=a=>s.jsx(vt,{item:a,onClose:r},a.key),e[14]=r,e[15]=i):i=e[15],l=n.items.map(i),e[11]=r,e[12]=n.items,e[13]=l}else l=e[13];let o;return e[16]!==l?(o=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:l})})}),e[16]=l,e[17]=o):o=e[17],o}case"custom":return n.content}}function Cr(t){const e=w.c(17),{sections:n,onClose:r,footer:l,additionalContent:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=i):i=e[0];let a;e[1]!==r?(a=s.jsx(O.Suspense,{fallback:i,children:s.jsx(Nr,{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(_r,{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]!==o?(d=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==c||e[11]!==d?(m=s.jsxs(Lt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=m):m=e[12];let u;return e[13]!==l||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,l]}),e[13]=l,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=w.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 m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==m||e[9]!==u?(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:[m,u]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let l;e[11]!==n||e[12]!==r?(l=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=l):l=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let i;e[16]!==n.label?(i=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=i):i=e[17];let a;return e[18]!==l||e[19]!==o||e[20]!==i?(a=s.jsxs("button",{type:"button",onClick:l,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:[o,i]}),e[18]=l,e[19]=o,e[20]=i,e[21]=a):a=e[21],a}function yt(t){const e=w.c(126),{user:n,userImage:r,menuItems:l,signOutItem:o,themeOptions:i,preferences:a,setPreferences:c,close:d,isMobile:m}=t;if(m){const L=n?.name??"U";let H;e[0]!==L||e[1]!==r?(H=s.jsx(Me,{url:r,fallback:L,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=L,e[1]=r,e[2]=H):H=e[2];const Z=n?.name??"User";let K;e[3]!==Z?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=K):K=e[4];const ee=n?.email;let G;e[5]!==ee?(G=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee}),e[5]=ee,e[6]=G):G=e[6];let le;e[7]!==K||e[8]!==G?(le=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,G]}),e[7]=K,e[8]=G,e[9]=le):le=e[9];let ce;e[10]!==n?(ce=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(zr)},e[10]=n,e[11]=ce):ce=e[11];let V;e[12]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(ht,{size:14}),e[12]=V):V=e[12];let J;e[13]!==ce?(J=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ce,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:V})}),e[13]=ce,e[14]=J):J=e[14];let me;e[15]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=me):me=e[15];let I;e[16]!==J?(I=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[J,me]})}),e[16]=J,e[17]=I):I=e[17];let D;e[18]!==I||e[19]!==H||e[20]!==le?(D=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[H,le,I]}),e[18]=I,e[19]=H,e[20]=le,e[21]=D):D=e[21];let B;if(e[22]!==d||e[23]!==l){let pe;e[25]!==d?(pe=Le=>s.jsx(Be,{item:Le,onClose:d},Le.key),e[25]=d,e[26]=pe):pe=e[26],B=l.map(pe),e[22]=d,e[23]=l,e[24]=B}else B=e[24];let P;e[27]!==d||e[28]!==o?(P=s.jsx(Be,{item:o,onClose:d}),e[27]=d,e[28]=o,e[29]=P):P=e[29];let X;e[30]!==B||e[31]!==P?(X=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[B,P]})}),e[30]=B,e[31]=P,e[32]=X):X=e[32];let oe;if(e[33]!==a.theme||e[34]!==c||e[35]!==i){let pe;e[37]!==a.theme||e[38]!==c?(pe=Le=>{const{value:Je,icon:Ss,label:Ns}=Le;return s.jsx("button",{type:"button","aria-label":Ns,onClick:()=>c(_s=>({..._s,theme:Je})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Je?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ss},Je)},e[37]=a.theme,e[38]=c,e[39]=pe):pe=e[39],oe=i.map(pe),e[33]=a.theme,e[34]=c,e[35]=i,e[36]=oe}else oe=e[36];let ie;e[40]!==oe?(ie=s.jsx("div",{className:"flex items-center gap-0.5",children:oe}),e[40]=oe,e[41]=ie):ie=e[41];const Se=a.enableSounds?"Disable sounds":"Enable sounds";let U;e[42]!==c?(U=()=>c(Ir),e[42]=c,e[43]=U):U=e[43];const Ye=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Ye?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Ye),e[44]=Ye,e[45]=we):we=e[45];let ke;e[46]!==a.enableSounds?(ke=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[46]=a.enableSounds,e[47]=ke):ke=e[47];let Ie;e[48]!==Se||e[49]!==U||e[50]!==we||e[51]!==ke?(Ie=s.jsx("button",{type:"button","aria-label":Se,onClick:U,className:we,children:ke}),e[48]=Se,e[49]=U,e[50]=we,e[51]=ke,e[52]=Ie):Ie=e[52];let Fe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.1"]}),e[53]=Fe):Fe=e[53];let ze;e[54]!==Ie?(ze=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Fe]}),e[54]=Ie,e[55]=ze):ze=e[55];let $e;e[56]!==ie||e[57]!==ze?($e=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ie,ze]}),e[56]=ie,e[57]=ze,e[58]=$e):$e=e[58];let Re;return e[59]!==D||e[60]!==X||e[61]!==$e?(Re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,X,$e]}),e[59]=D,e[60]=X,e[61]=$e,e[62]=Re):Re=e[62],Re}const u=n?.name??"U";let f;e[63]!==u||e[64]!==r?(f=s.jsx(Me,{url:r,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=r,e[65]=f):f=e[65];const h=n?.name??"User";let p;e[66]!==h?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=p):p=e[67];const x=n?.email;let g;e[68]!==x?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x}),e[68]=x,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(kr)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ht,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let _;e[78]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=_):_=e[78];let k;e[79]!==y?(k=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[y,_]})}),e[79]=y,e[80]=k):k=e[80];let N;e[81]!==k||e[82]!==f||e[83]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=N):N=e[84];let C;if(e[85]!==d||e[86]!==l){let L;e[88]!==d?(L=H=>s.jsx(Be,{item:H,onClose:d},H.key),e[88]=d,e[89]=L):L=e[89],C=l.map(L),e[85]=d,e[86]=l,e[87]=C}else C=e[87];let S;e[90]!==d||e[91]!==o?(S=s.jsx(Be,{item:o,onClose:d}),e[90]=d,e[91]=o,e[92]=S):S=e[92];let z;e[93]!==C||e[94]!==S?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[C,S]}),e[93]=C,e[94]=S,e[95]=z):z=e[95];let T;if(e[96]!==a.theme||e[97]!==c||e[98]!==i){let L;e[100]!==a.theme||e[101]!==c?(L=H=>{const{value:Z,icon:K,label:ee}=H;return s.jsx("button",{type:"button","aria-label":ee,onClick:()=>c(G=>({...G,theme:Z})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Z)},e[100]=a.theme,e[101]=c,e[102]=L):L=e[102],T=i.map(L),e[96]=a.theme,e[97]=c,e[98]=i,e[99]=T}else T=e[99];let A;e[103]!==T?(A=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[103]=T,e[104]=A):A=e[104];const $=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[105]!==c?(E=()=>c(wr),e[105]=c,e[106]=E):E=e[106];const W=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let M;e[107]!==W?(M=F("size-7 rounded-md flex items-center justify-center transition-colors",W),e[107]=W,e[108]=M):M=e[108];let q;e[109]!==a.enableSounds?(q=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[109]=a.enableSounds,e[110]=q):q=e[110];let R;e[111]!==$||e[112]!==E||e[113]!==M||e[114]!==q?(R=s.jsx("button",{type:"button","aria-label":$,onClick:E,className:M,children:q}),e[111]=$,e[112]=E,e[113]=M,e[114]=q,e[115]=R):R=e[115];let Q;e[116]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.1"]}),e[116]=Q):Q=e[116];let Y;e[117]!==R?(Y=s.jsxs("div",{className:"flex items-center gap-2",children:[R,Q]}),e[117]=R,e[118]=Y):Y=e[118];let ne;e[119]!==A||e[120]!==Y?(ne=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[A,Y]}),e[119]=A,e[120]=Y,e[121]=ne):ne=e[121];let re;return e[122]!==N||e[123]!==z||e[124]!==ne?(re=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,z,ne]})}),e[122]=N,e[123]=z,e[124]=ne,e[125]=re):re=e[125],re}function wr(t){return{...t,enableSounds:!t.enableSounds}}function kr(){ge.success("User ID copied")}function Ir(t){return{...t,enableSounds:!t.enableSounds}}function zr(){ge.success("User ID copied")}function nt(){const t=w.c(34),{data:e}=be.useSession(),{org:n}=de(),r=he();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org",shouldThrow:!1},t[0]=l):l=t[0];const i=ws(l)?.params.org,[a,c]=ks(),d=dt(),[m,u]=O.useState(!1),f=e?.user,h=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const x=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ke,{size:16}),t[2]=g):g=t[2];let b;t[3]!==r||t[4]!==i?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{r({to:"/$org/settings/profile",params:{org:i??""}})}},t[3]=r,t[4]=i,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==r?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(qs,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=r,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(Ks,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(Js,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Is,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Ws,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let C;t[14]!==b||t[15]!==j?(C=[b,...j,v,y,_,k,N],t[14]=b,t[15]=j,t[16]=C):C=t[16];const S=C;let z;t[17]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Vs,{size:16}),onClick:Ar},t[17]=z):z=t[17];const T=z;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=A):A=t[18];let $;t[19]===Symbol.for("react.memo_cache_sentinel")?($={value:"dark",icon:s.jsx(Qs,{size:14}),label:"Dark theme"},t[19]=$):$=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=[A,$,{value:"system",icon:s.jsx(qt,{size:14}),label:"System theme"}],t[20]=E):E=t[20];const W=E;let M;t[21]!==d||t[22]!==S||t[23]!==a||t[24]!==c||t[25]!==f||t[26]!==h?(M={user:f,userImage:h,menuItems:S,signOutItem:T,themeOptions:W,preferences:a,setPreferences:c,close:x,isMobile:d},t[21]=d,t[22]=S,t[23]=a,t[24]=c,t[25]=f,t[26]=h,t[27]=M):M=t[27];const q=M;let R;return t[28]!==d||t[29]!==m||t[30]!==q||t[31]!==f?.name||t[32]!==h?(R=s.jsx(s.Fragment,{children:d?s.jsxs(Ht,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!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(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Ut,{className:"h-[80dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Account"}),s.jsx(yt,{...q})]})]}):s.jsxs(Pe,{open:m,onOpenChange:u,children:[s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ee,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:$r,children:s.jsx(yt,{...q})})]})}),t[28]=d,t[29]=m,t[30]=q,t[31]=f?.name,t[32]=h,t[33]=R):R=t[33],R}function $r(t){return t.preventDefault()}function Ar(){ae("signed_out",{source:"account_popover"}),zs(),be.signOut()}function rt(){const t=w.c(22),e=nn(),[n,r]=O.useState(!1);let l;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=rn(e.capabilities);l=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]=l}else l=t[4];const o=l;let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>r(!0),t[5]=i):i=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qt,{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 m;t[9]!==a||t[10]!==d?(m=s.jsx(je,{asChild:!0,children:s.jsxs(xe,{onClick:i,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(ve,{side:"bottom",children:o}),t[12]=o,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(ln,{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 Tr({invitation:t}){const[e,n]=O.useState(!1),[r,l]=O.useState(!1),o=$s(),i=async()=>{n(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){ge.error(d.error.message),n(!1);return}}catch{ge.error("Failed to accept invitation"),n(!1);return}ge.success("Invitation accepted!"),As();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{l(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});c.error?(ge.error(c.error.message),l(!1)):(ge.success("Invitation declined"),o.invalidateQueries())}catch{ge.error("Failed to decline invitation"),l(!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(Te,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:i,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Xe,{size:14})}),s.jsx(Te,{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(Kt,{size:14})})]})]})}function Dr(t){const e=w.c(29),{request:n}=t,{approve:r,deny:l}=on(),o=r.isPending||l.isPending,i=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==i?(c=i.charAt(0).toUpperCase(),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(Me,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==i?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:i})]}),e[6]=i,e[7]=u):u=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(Xe,{size:14}),e[11]=h):h=e[11];let p;e[12]!==o||e[13]!==f?(p=s.jsx(Te,{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:o,"aria-label":"Approve join request",children:h}),e[12]=o,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==l||e[16]!==n.id?(x=()=>l.mutate(n.id),e[15]=l,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Kt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==o||e[20]!==x?(b=s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:o,"aria-label":"Deny join request",children:g}),e[19]=o,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 v;return e[25]!==j||e[26]!==d||e[27]!==u?(v=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,u,j]}),e[25]=j,e[26]=d,e[27]=u,e[28]=v):v=e[28],v}function Or(t){const e=w.c(14),{release:n,isSeen:r,onSelect:l}=t;let o;e[0]!==r?(o=!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]=o):o=e[1];let i;e[2]!==n.eyebrow?(i=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=i):i=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]!==i||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[i,a]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Vt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let m;return e[10]!==l||e[11]!==o||e[12]!==c?(m=s.jsxs("button",{type:"button",onClick:l,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:[o,c,d]}),e[10]=l,e[11]=o,e[12]=c,e[13]=m):m=e[13],m}function Mr(){const t=O.useContext(Ts),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function as(){const t=w.c(11),{isSeen:e,markSeen:n,unseenCount:r}=cn(),l=Mr(),o=an();let i;if(t[0]!==e||t[1]!==l||t[2]!==o){const d=[...o].sort(Lr).map(Rr),m=[...l].sort(Fr).map(Er);let u;t[4]!==e?(u=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...dn].sort(Pr).map(u);i=[...d,...m,...f],t[0]=e,t[1]=l,t[2]=o,t[3]=i}else i=t[3];const a=r+l.length+o.length;let c;return t[6]!==n||t[7]!==l||t[8]!==i||t[9]!==a?(c={items:i,pendingInvitations:l,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=l,t[8]=i,t[9]=a,t[10]=c):c=t[10],c}function Pr(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Er(t){return{type:"invitation",invitation:t}}function Fr(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Rr(t){return{type:"join-request",request:t}}function Lr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class cs extends O.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 ds(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Br(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];let i;t[2]!==l?(i=F(l!=null&&ds(l)),t[2]=l,t[3]=i):i=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(Wt,{}),t[7]=c):c=t[7];let d;t[8]!==l?(d=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,t[9]=d):d=t[9];let m;t[10]!==d?(m=s.jsx("span",{children:d}),t[10]=d,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==i||t[14]!==a||t[15]!==m?(u=s.jsx(_e,{children:s.jsx(se,{children:s.jsxs(ue,{tooltip:o,className:i,onClick:a,children:[c,m]})})}),t[12]=o,t[13]=i,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function Hr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Br,{})})}),t[0]=e):e=t[0],e}function Ur(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];const i=o;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]!==l?(c=F(l!=null&&ds(l)),t[5]=l,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Wt,{className:"size-4"}),t[7]=d):d=t[7];let m;t[8]!==a||t[9]!==c||t[10]!==i?(m=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":i,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=i,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(ve,{side:"top",children:i}),t[12]=i,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function Gr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Ur,{})})}),t[0]=e):e=t[0],e}function ms(t){const e=w.c(15),{children:n}=t,{items:r,markReleaseSeen:l}=as(),[o,i]=O.useState(null);let a;if(e[0]!==r||e[1]!==o){let x;e[3]!==o?(x=g=>g.type==="release"&&g.release.id===o,e[3]=o,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=o,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let m;e[5]!==l?(m=x=>{i(x),l(x)},e[5]=l,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||i(null)},e[7]=f):f=e[7];let h;e[8]!==u||e[9]!==r||e[10]!==d?(h=s.jsx(Ee,{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(Te,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>i(null),children:s.jsx(Ys,{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(mn,{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(Ve,{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(Dr,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(Tr,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Or,{release:x.release,isSeen:x.isSeen,onSelect:()=>u(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=u,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Pe,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function us(){const{redDotCount:t}=as();return t>0}function qr(){const t=w.c(6),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{}),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 l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{children:"Inbox"}),t[3]=l):l=t[3];let o;return t[4]!==r?(o=s.jsx(ms,{children:s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:"Inbox",className:"relative",children:[n,r,l]})})}),t[4]=r,t[5]=o):o=t[5],o}function Wr(){const t=w.c(8),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{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 l;t[3]!==r?(l=s.jsx(Ne,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=l):l=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ve,{side:"top",children:"Inbox"}),t[5]=o):o=t[5];let i;return t[6]!==l?(i=s.jsx(ms,{children:s.jsxs(ye,{delayDuration:300,children:[l,o]})}),t[6]=l,t[7]=i):i=t[7],i}function Kr(){const t=w.c(7),e=he(),{org:n}=de();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 l,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{}),o=s.jsx("span",{children:"Settings"}),t[3]=l,t[4]=o):(l=t[3],o=t[4]);let i;return t[5]!==r?(i=s.jsxs(ue,{tooltip:"Settings",onClick:r,children:[l,o]}),t[5]=r,t[6]=i):i=t[6],i}function Vr(){const t=w.c(9),e=he(),{org:n}=de();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 l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{className:"size-4"}),t[3]=l):l=t[3];let o;t[4]!==r?(o=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":"Settings",onClick:r,children:l})}),t[4]=r,t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ve,{side:"top",children:"Settings"}),t[6]=i):i=t[6];let a;return t[7]!==o?(a=s.jsxs(ye,{delayDuration:300,children:[o,i]}),t[7]=o,t[8]=a):a=t[8],a}function Xr(){const t=w.c(6),{state:e}=Ce();if(e==="collapsed"){let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Hr,{}),t[0]=l):l=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(se,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(rt,{})})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(se,{children:s.jsx(qr,{})}),t[2]=i):i=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(se,{children:s.jsx(Kr,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(tt,{className:"px-2 pb-3 gap-1",children:[l,s.jsxs(_e,{children:[o,i,a,s.jsx(se,{children:s.jsx(nt,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(tt,{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(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),s.jsx(Vr,{}),s.jsx(Wr,{}),s.jsx(rt,{}),s.jsx(Gr,{})]})}),t[5]=r):r=t[5],r}function Qr(){const t=w.c(8),e=he(),{org:n}=de(),{setOpenMobile:r}=Ce();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),t[0]=l):l=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==r?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ke,{className:"size-4"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(tt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[l,s.jsx(xe,{"aria-label":"Settings",onClick:o,children:i})]})}),t[6]=o,t[7]=a):a=t[7],a}function St(t){const e=w.c(15),{className:n,wrapperClassName:r,children:l}=t,[o,i]=O.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&i(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;i(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const m=d;let u;e[2]!==r?(u=F("relative",r),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==l||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:m,className:n,children:l}),e[4]=l,e[5]=n,e[6]=f):f=e[6];const h=o?"opacity-100":"opacity-0";let p;e[7]!==h?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=p):p=e[8];let x;e[9]!==p?(x=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=x):x=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==x?(g=s.jsxs("div",{className:u,children:[f,x]}),e[11]=u,e[12]=f,e[13]=x,e[14]=g):g=e[14],g}function Yr(t){const e=w.c(8),{virtualMcpId:n,size:r,showAutomationBadge:l}=t,o=r===void 0?"sm":r;let i;e[0]!==o||e[1]!==n?(i=n?s.jsx(Jr,{virtualMcpId:n,size:o}):s.jsx(De,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==l?(a=l&&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(Tn,{size:10,className:"text-white"})}),e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Jr(t){const e=w.c(6),{virtualMcpId:n,size:r}=t,l=Qt(n);if(!l){let a;return e[0]!==r?(a=s.jsx(De,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const o=l.icon??null;let i;return e[2]!==l.title||e[3]!==r||e[4]!==o?(i=s.jsx(De,{icon:o,name:l.title,size:r}),e[2]=l.title,e[3]=r,e[4]=o,e[5]=i):i=e[5],i}function Nt(t){const e=w.c(36),{open:n,onOpenChange:r}=t,[l,o]=O.useState(""),{org:i}=de(),{setTaskId:a}=mt(),c=Zt();let d,m,u;e[0]!==i.id||e[1]!==l?(u=l.trim(),m=Mt,d=Ot.globalSearch(i.id,u),e[0]=i.id,e[1]=l,e[2]=d,e[3]=m,e[4]=u):(d=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==c||e[6]!==u?(h=async()=>await c.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=c,e[6]=u,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}=m(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==r?(v=$=>{$||o(""),r($)},e[14]=r,e[15]=v):v=e[15];const y=v;let _;e[16]!==y||e[17]!==a?(_=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=_):_=e[18];const k=_;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Sn,{className:"sr-only",children:[s.jsx(Nn,{children:"Search"}),s.jsx(_n,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let C;e[20]!==l?(C=s.jsx(zn,{value:l,onValueChange:o,placeholder:"Search..."}),e[20]=l,e[21]=C):C=e[21];let S;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(S=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(kn,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(In,{value:`thread:${$.id}:${$.title}`,onSelect:()=>k($),className:"gap-2.5",children:[s.jsx(Yr,{virtualMcpId:$.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:$.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=S):S=e[26];let z;e[27]!==S?(z=s.jsx($n,{children:S}),e[27]=S,e[28]=z):z=e[28];let T;e[29]!==C||e[30]!==z?(T=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(An,{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:[C,z]})]}),e[29]=C,e[30]=z,e[31]=T):T=e[31];let A;return e[32]!==y||e[33]!==n||e[34]!==T?(A=s.jsx(wn,{open:n,onOpenChange:y,children:T}),e[32]=y,e[33]=n,e[34]=T,e[35]=A):A=e[35],A}const _t=["requires_action","in_progress","failed","expired","completed"];function Zr(t){const e=new Map(_t.map(n=>[n,[]]));for(const n of t){const r=n.status??"completed";(e.get(r)??e.get("completed")).push(n)}return _t.map(n=>({status:n,threads:e.get(n)}))}const el="sidebar.group.expanded.";function tl(t,e){const n=w.c(3),[r,l]=We(`${el}${t}`,e);let o;return n[0]!==r||n[1]!==l?(o=[r,l],n[0]=r,n[1]=l,n[2]=o):o=n[2],o}function fs(t){const e=w.c(12),{onClick:n,isFetching:r,indented:l}=t,o=l?"-ml-4 pl-6 pr-2":"px-2";let i;e[0]!==o?(i=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"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]=o,e[1]=i):i=e[1];let a;e[2]!==r?(a=r&&s.jsx(Pt,{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 m;return e[6]!==r||e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==d?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:i,children:[a,d]}),e[6]=r,e[7]=n,e[8]=i,e[9]=a,e[10]=d,e[11]=m):m=e[11],m}function sl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function nl(t){return t.member==="mine"&&!t.currentUserId}const xs=4;let Ue=0;const lt=[];function rl(){for(;Ue<xs&<.length>0;){const t=lt.shift();t&&t()}}function hs(t){return new Promise((e,n)=>{const r=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,rl()})};Ue<xs?r():lt.push(r)})}const Qe=10;function Ct(t,e,n,r,l){const o={hidden:!1};r.member==="mine"&&r.currentUserId&&(o.created_by=r.currentUserId),r.type==="automation"&&(o.has_trigger=!0),r.type==="manual"&&(o.has_trigger=!1);const i={where:o,limit:l,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return i.status=e,i}function ll(t,e,n,r){let l=0;for(const o of t)ps(o,e,n,r)&&l++;return l}function Ze(t,e,n,r){return ll(t,e,n,r)}function ol(t,e){return!!(t>=Qe||t===0&&e)}function wt(t,e){return t<e}function il(t,e){return e===!1?!1:e===!0?!0:t}function ps(t,e,n,r){return!(t.hidden||(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 qe=new Map,He=new Map;function al(t,e){return e?t>=Qe?!0:null:!1}function kt(t){return qe.get(t)}function cl(t,e){qe.set(t,e)}function dl(t,e,n){const r=qe.get(t);if(r!==void 0){n(r);return}let l=He.get(t);l||(l=hs(e).then(o=>(qe.set(t,o),He.delete(t),o)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,l)),l.then(n,()=>n(!1))}function It(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ml(t,e,n,r,l){let o=0;for(const i of t)e.has(i.id)||ps(i,n,r,l)&&o++;return o}function ul(t,e,n,r){const l=w.c(8),{org:o}=de(),i=sl(o.id,t,e,n);let a;l[0]!==n?(a=nl(n),l[0]=n,l[1]=a):a=l[1];const c=a,[d,m]=O.useState({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==i&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});const u=vn(),{threads:f,hasMore:h}=ut(),p=Ze(f,t,e,n),x=ol(p,h),g=al(p,h),b=Zt();if(d.identity===i&&d.serverHasMore===null){const N=g??kt(i);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:N})}!c&&d.identity===i&&d.serverHasMore===null&&g===null&&kt(i)===void 0&&d.probeSubscribedIdentity!==i&&(m(N=>N.identity===i?{...N,isProbing:!0,probeSubscribedIdentity:i}:N),dl(i,async()=>{const N=Ct(t,e,0,n,1),C=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:S}=It(C),z=Ze(u.threads.get(),t,e,n);return S===void 0?!1:wt(z,S)},N=>{m(C=>C.identity!==i?C:{...C,isProbing:!1,serverHasMore:N})}));const v=async function(){if(d.isFetching||d.isProbing||c)return;const C=i;m(S=>S.identity===C?{...S,isFetching:!0}:S);try{const S=Ze(f,t,e,n),z=Ct(t,e,S,n,Qe),T=await hs(()=>b.call("COLLECTION_THREADS_LIST",z)),{items:A,hasMore:$,totalCount:E}=It(T),W=new Set(f.map(fl)),M=ml(A,W,t,e,n),q=S;u.mergeThreads(A),m(R=>{if(R.identity!==C)return R;let Q;return E!==void 0?Q=wt(q+M,E):Q=A.length===0||M===0?!1:$,cl(C,Q),{...R,isFetching:!1,serverHasMore:Q}})}catch(S){const z=S,T=z instanceof Error?z.message:String(z);ge.error(`Could not load more tasks: ${T}`),m(A=>A.identity===C?{...A,isFetching:!1}:A)}},y=d.isFetching||d.isProbing,_=!c&&!y&&il(x,d.serverHasMore);let k;return l[2]!==y||l[3]!==v||l[4]!==_||l[5]!==d.isProbing||l[6]!==d.serverHasMore?(k={hasMore:_,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:v},l[2]=y,l[3]=v,l[4]=_,l[5]=d.isProbing,l[6]=d.serverHasMore,l[7]=k):k=l[7],k}function fl(t){return t.id}function xl(t){const e=w.c(18),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,{isFetching:c,isProbing:d,loadMore:m,hasMore:u,serverHasMore:f}=ul("status",n,a),[h,p]=O.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{m()}));let x;if(e[0]!==l||e[1]!==a||e[2]!==i||e[3]!==o||e[4]!==r){let j;e[6]!==l||e[7]!==a||e[8]!==i||e[9]!==o?(j=v=>s.jsx(ts,{task:v,isActive:l===v.id,onClick:()=>o(v),onArchive:v.created_by===a.currentUserId?()=>i(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=l,e[7]=a,e[8]=i,e[9]=o,e[10]=j):j=e[10],x=r.map(j),e[0]=l,e[1]=a,e[2]=i,e[3]=o,e[4]=r,e[5]=x}else x=e[5];let g;e[11]!==u||e[12]!==c||e[13]!==m?(g=(u||c)&&s.jsx(fs,{onClick:()=>{m()},isFetching:c,indented:!0}),e[11]=u,e[12]=c,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==x||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function hl(t){const e=w.c(35),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,c=Mn[n],d=c.icon,[m,u]=tl(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.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]!==m?(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:m?s.jsx(ft,{size:14}):s.jsx(Vt,{size:14})}),e[8]=m,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 v;e[15]!==r.length?(v=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]=v):v=e[16];let y;e[17]!==m||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,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,v]}),e[17]=m,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let _;e[24]!==l||e[25]!==m||e[26]!==a||e[27]!==i||e[28]!==o||e[29]!==n||e[30]!==r?(_=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xl,{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a})}),e[24]=l,e[25]=m,e[26]=a,e[27]=i,e[28]=o,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==y||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,_]}),e[32]=y,e[33]=_,e[34]=k):k=e[34],k}function zt(t){const e=w.c(34),{threads:n,groupBy:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!c&&!d){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ve,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(r==="status"){let x;if(e[3]!==l||e[4]!==a||e[5]!==i||e[6]!==o||e[7]!==n){let b;e[9]!==l||e[10]!==a||e[11]!==i||e[12]!==o?(b=j=>s.jsx(hl,{status:j.status,threads:j.threads,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a},j.status),e[9]=l,e[10]=a,e[11]=i,e[12]=o,e[13]=b):b=e[13],x=Zr(n).map(b),e[3]=l,e[4]=a,e[5]=i,e[6]=o,e[7]=n,e[8]=x}else x=e[8];let g;return e[14]!==x?(g=s.jsx(s.Fragment,{children:x}),e[14]=x,e[15]=g):g=e[15],g}let f;if(e[16]!==l||e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==n){let x;e[22]!==l||e[23]!==a||e[24]!==i||e[25]!==o?(x=g=>s.jsx(ts,{task:g,isActive:l===g.id,onClick:()=>o(g),onArchive:g.created_by===a.currentUserId?()=>i(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=l,e[23]=a,e[24]=i,e[25]=o,e[26]=x):x=e[26],f=n.map(x),e[16]=l,e[17]=a,e[18]=i,e[19]=o,e[20]=n,e[21]=f}else f=e[21];let h;e[27]!==c||e[28]!==d||e[29]!==m?(h=(c||d)&&s.jsx(fs,{onClick:m,isFetching:d}),e[27]=c,e[28]=d,e[29]=m,e[30]=h):h=e[30];let p;return e[31]!==f||e[32]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),e[31]=f,e[32]=h,e[33]=p):p=e[33],p}function $t(t){const e=w.c(17),{label:n,onClick:r,active:l,children:o}=t,[i,a]=O.useState(!1);let c,d,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>a(!0),d=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=c,e[1]=d,e[2]=m,e[3]=u):(c=e[0],d=e[1],m=e[2],u=e[3]);const f=l&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=F(f),e[4]=f,e[5]=h):h=e[5];let p;e[6]!==o||e[7]!==n||e[8]!==r||e[9]!==h?(p=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":n,onClick:r,onPointerEnter:c,onPointerLeave:d,onFocus:m,onBlur:u,className:h,children:o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=h,e[10]=p):p=e[10];let x;e[11]!==n?(x=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=x):x=e[12];let g;return e[13]!==i||e[14]!==p||e[15]!==x?(g=s.jsxs(ye,{open:i,children:[p,x]}),e[13]=i,e[14]=p,e[15]=x,e[16]=g):g=e[16],g}function et(t){const e=w.c(13),{label:n,value:r,onChange:l,options:o}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==l?(a=u=>u&&l(u),e[2]=l,e[3]=a):a=e[3];let c;e[4]!==o?(c=o.map(pl),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==r?(d=s.jsx(pn,{type:"single",size:"sm",value:r,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:c}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9];let m;return e[10]!==i||e[11]!==d?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i,d]}),e[10]=i,e[11]=d,e[12]=m):m=e[12],m}function pl(t){return s.jsxs(hn,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:r}=de(),l=gn({connectionId:bn,orgId:r.id,orgSlug:r.slug}),o=Ge(r.id).id,i=Yt(),{threads:a,hasMore:c,isFetchingMore:d,fetchNextPage:m}=ut(),u=a.filter(I=>!I.hidden),{hide:f}=Jt(),h=he(),{setTaskId:p,createNewTask:x}=mt(),g=ot({strict:!1}),b=it({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},_=[...u].sort((I,D)=>(D.updated_at??"").localeCompare(I.updated_at??"")),[k,N]=O.useState("all"),[C,S]=O.useState("flat"),[z,T]=We("sidebar-threads-scope-all",!1),[A,$]=O.useState(!1),[E,W]=O.useState(!1),M={type:k,member:"mine",currentUserId:n??null},q=I=>n?I.filter(D=>D.created_by===n):[],R=I=>k==="automation"?I.filter(D=>!!D.trigger_id):k==="manual"?I.filter(D=>!D.trigger_id):I,Q=q(_),Y=R(Q),ne=R(_),re=z?ne:Y,L=I=>{if(n&&I.created_by&&I.created_by!==n)return;const D=I.id===j;if(f(I.id),!D)return;const B=Q.find(P=>P.id!==I.id&&P.virtual_mcp_id===I.virtual_mcp_id);y(),B?p(B.id,B.virtual_mcp_id):h({to:"/$org",params:{org:r.slug}})},H=I=>{y(),p(I.id,I.virtual_mcp_id)},Z=async I=>{try{const D=await l.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((D.structuredContent??D).items?.length??0)===0}catch{return!1}},K=async()=>{const I=v??o;ae("sidebar_new_thread_clicked",{virtual_mcp_id:I});const D=Q.find(B=>B.virtual_mcp_id===I&&B.title==="New chat");if(D&&await Z(D.id)){y(),p(D.id,I);return}y(),x(I)},{state:ee,isMobile:G,toggleSidebar:le}=Ce();if(ee==="collapsed"&&!G){const I=Ge(r.id),D=new Map((i??[]).map(P=>[P.id,P])),B=P=>(P?D.get(P):void 0)??(P===o?I:void 0);return s.jsxs(_e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(se,{children:s.jsx(ue,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:le,children:s.jsx(Bt,{size:16})})}),s.jsx(se,{children:s.jsx(ue,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})}),re.map(P=>{const X=B(P.virtual_mcp_id);return s.jsx(se,{children:s.jsx(ue,{tooltip:P.title||"New chat",isActive:P.id===j,onClick:()=>H(P),children:s.jsx(De,{icon:X?.icon??null,name:X?.title??"Agent",size:"2xs"})})},P.id)})]})}const V=C!=="flat"||k!=="all"||z===!0,J=s.jsxs(Pe,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(Ne,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Filter threads",active:V,children:[s.jsx(xn,{size:16}),V&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ve,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ee,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(et,{label:"View",value:C,onChange:I=>{ae("tasks_panel_group_by_changed",{to_value:I}),S(I)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(et,{label:"Type",value:k,onChange:I=>{ae("tasks_panel_filter_changed",{to_value:I}),N(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(et,{label:"Scope",value:z?"team":"mine",onChange:I=>T(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),me=I=>s.jsx(st,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(es,{}),J]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx($t,{label:"Search threads",onClick:()=>{ae("tasks_panel_search_opened"),W(!0),$(!0)},children:s.jsx(en,{size:16})}),s.jsx($t,{label:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})]})]})});return G?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!0),s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]})}const gl=5,bl=[{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 bs(){const t=w.c(3),{state:e}=Ce();if(e==="collapsed"){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:gl}).map(yl)}),t[0]=l):l=t[0],l}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(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"})]}),s.jsx(fe,{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:bl.map(jl)})]}),t[2]=r):r=t[2],r}function jl(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(fe,{className:"size-5 rounded-full shrink-0"}),s.jsx(fe,{className:F("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(vl)})]},e)}function vl(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(fe,{className:"h-3 flex-1 rounded-sm"})},e)}function yl(t,e){return s.jsx(fe,{className:"size-10 rounded-lg mx-auto"},e)}function Sl(){const t=w.c(4),e=rs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xr,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=r):r=t[1];let l;return t[2]!==e?(l=s.jsx(ss,{children:s.jsx(is,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=l):l=t[3],l}function Nl(t){const e=w.c(8),{onClose:n}=t,r=rs();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Qr,{}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let i;e[2]!==n?(i=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a=s.jsx(ss,{children:s.jsx(Cr,{sections:r,onClose:n,footer:l,additionalContent:i})}),e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const _l=Ds({name:Os().min(2,"Organization name is required")});function Cl(t){const e=w.c(41),{open:n,onOpenChange:r}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={resolver:Ms(_l),defaultValues:{name:""}},e[0]=l):l=e[0];const o=Ps(l);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={mutationFn:kl,onSuccess:wl},e[1]=i):i=e[1];const a=Es(i),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(Kn,{children:[s.jsx(Vn,{children:"Create a new organization"}),s.jsx(Xn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let m;if(e[3]!==a||e[4]!==o){let N;e[6]!==a?(N=C=>a.mutateAsync(C),e[6]=a,e[7]=N):N=e[7],m=o.handleSubmit(N),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=N=>{const{field:C}=N;return s.jsxs(er,{children:[s.jsx(tr,{children:"Organization Name"}),s.jsx(sr,{children:s.jsx(lr,{...C,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(nr,{children:"The name of your company or organization"}),C.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:"","/",js(C.value)]})]}),s.jsx(rr,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(Jn,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,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]!==o?(p=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=p):p=e[17];let x;e[18]!==o.formState.isSubmitting||e[19]!==p?(x=s.jsx(qn,{disabled:o.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!o.formState.isValid||o.formState.isSubmitting;let b;e[21]!==o.formState.isSubmitting?(b=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ln,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Te,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==x?(v=s.jsxs(Qn,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=h,e[33]=y):y=e[33];let _;e[34]!==o||e[35]!==y?(_=s.jsxs(Wn,{children:[d,s.jsx(Zn,{...o,children:y})]}),e[34]=o,e[35]=y,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(Yn,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function wl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function kl(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.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 Il(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 vs(t){const e=w.c(13),{org:n,size:r}=t,l=r===void 0?"sm":r,o=l==="xs"?"size-5":"size-6",i=l==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=F(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Il(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]!==i?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",i),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=i,e[8]=d):d=e[8];let m;return e[9]!==a||e[10]!==c||e[11]!==d?(m=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=m):m=e[12],m}function zl(t){const e=w.c(24),{orgParam:n,onSelectOrg:r,onCreateOrg:l}=t,{data:o}=Fs();let i;e[0]!==n?(i=(S,z)=>S.slug===n?-1:z.slug===n?1:S.name.localeCompare(z.name),e[0]=n,e[1]=i):i=e[1];const a=[...o??[]].sort(i),[c,d]=O.useState(""),m=c.toLowerCase(),u=m?a.filter(S=>S.name.toLowerCase().includes(m)||S.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ns,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=S=>d(S.target.value),e[3]=h):h=e[3];let p;e[4]!==c?(p=S=>S.key==="Escape"&&c&&d(""),e[4]=c,e[5]=p):p=e[5];let x;e[6]!==c||e[7]!==p?(x=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:c,onChange:h,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=c,e[7]=p,e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ae,{size:16}),e[9]=g):g=e[9];let b;e[10]!==l?(b=s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=l,e[11]=b):b=e[11];let j;e[12]!==x||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,x,b]}),e[12]=x,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:c?`No organizations match "${c}"`:"No organizations available"});let _;e[15]!==r||e[16]!==n?(_=S=>s.jsxs("button",{type:"button",onClick:()=>r(S.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",S.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(vs,{org:S,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.slug})]}),S.slug===n&&s.jsx(Xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},S.id),e[15]=r,e[16]=n,e[17]=_):_=e[17];const k=u.map(_);let N;e[18]!==y||e[19]!==k?(N=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=N):N=e[20];let C;return e[21]!==N||e[22]!==j?(C=s.jsxs(s.Fragment,{children:[j,N]}),e[21]=N,e[22]=j,e[23]=C):C=e[23],C}function $l(t){const e=w.c(22),{trigger:n,orgParam:r,align:l,side:o}=t,i=l===void 0?"start":l,a=o===void 0?"bottom":o,c=he(),[d,m]=O.useState(!1),[u,f]=O.useState(!1);let h;e[0]!==n?(h=s.jsx(Ne,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const p=String(d);let x;e[2]!==c?(x=k=>{m(!1),c({to:"/$org",params:{org:k}})},e[2]=c,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==r||e[6]!==p||e[7]!==x?(b=s.jsx(zl,{orgParam:r,onSelectOrg:x,onCreateOrg:g},p),e[5]=r,e[6]=p,e[7]=x,e[8]=b):b=e[8];let j;e[9]!==i||e[10]!==a||e[11]!==b?(j=s.jsx(Ee,{side:a,align:i,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Tl,onCloseAutoFocus:Al,children:b}),e[9]=i,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==d||e[14]!==h||e[15]!==j?(v=s.jsxs(Pe,{open:d,onOpenChange:m,children:[h,j]}),e[13]=d,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Cl,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let _;return e[19]!==y||e[20]!==v?(_=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=_):_=e[21],_}function Al(t){return t.preventDefault()}function Tl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Dl(t){const e=w.c(21),{value:n,onChange:r,placeholder:l,onKeyDown:o,className:i,isSearching:a,disabled:c}=t,d=l===void 0?"Search...":l;let m;e[0]!==i?(m=F("shrink-0 w-full border-b border-border h-12",i),e[0]=i,e[1]=m):m=e[1];const u=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Pt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ns,{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]!==o||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:o,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]=o,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]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Ol="Select an existing agent";function Ml(t){const e=w.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ve,{side:"right",sideOffset:8,children:Ol}),e[2]=l):l=e[2];let o;return e[3]!==r?(o=s.jsxs(ye,{defaultOpen:!0,delayDuration:0,children:[r,l]}),e[3]=r,e[4]=o):o=e[4],o}function Pl(){const t=w.c(5),{enableDecoImport:e}=Dt(),{data:n}=be.useSession();let r;t[0]!==n?.user?.email?(r=Ot.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const l=!!e&&!!n?.user?.email;let o;t[2]!==r||t[3]!==l?(o={queryKey:r,queryFn:El,enabled:l,staleTime:3e5},t[2]=r,t[3]=l,t[4]=o):o=t[4];const{data:i}=Mt(o);return i?.isDecoUser??!1}async function El(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Fl(t){const e=he(),{create:n}=Jt(),{locator:r}=de(),l=ot({strict:!1}),o=it({strict:!1});return async i=>{const a=crypto.randomUUID(),c=i===o.virtualmcpid?un(t,r,l.taskId??""):null;try{await n({id:a,virtual_mcp_id:i,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:i}})}}function At(t){const e=w.c(17),{agent:n,selected:r,onClick:l}=t,o=r?"bg-accent":"hover:bg-accent";let i;e[0]!==o?(i=F("flex flex-col items-center gap-2 p-3 rounded-xl transition-colors cursor-pointer group",o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(De,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let c;e[5]!==r?(c=r&&s.jsx("span",{className:"absolute -bottom-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-background",children:s.jsx(Xe,{size:10,className:"text-foreground"})}),e[5]=r,e[6]=c):c=e[6];let d;e[7]!==a||e[8]!==c?(d=s.jsxs("div",{className:"relative",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9];let m;e[10]!==n.title?(m=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[10]=n.title,e[11]=m):m=e[11];let u;return e[12]!==l||e[13]!==i||e[14]!==d||e[15]!==m?(u=s.jsxs("button",{type:"button",onClick:l,className:i,children:[d,m]}),e[12]=l,e[13]=i,e[14]=d,e[15]=m,e[16]=u):u=e[16],u}function Rl(t){const e=w.c(60),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:l,onSelectAgent:o,selectedAgentId:i}=t,[a,c]=O.useState(""),d=Yt(),m=d??[],{org:u}=de(),{data:f}=be.useSession(),h=f?.user?.id??"anon",p=En(d),x=Fn();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:b,isCreating:j}=ir(g),{createFromTemplate:v,isCreating:y}=cr(),_=Pl(),k=Fl(u.slug),N=fn(d),C=a.toLowerCase(),S=m.filter(Ll).filter(U=>!N.has(U.id)).filter(U=>!a||U.title.toLowerCase().includes(C)),z=Ge(u.id),T=!a||z.title.toLowerCase().includes(C);let A;e[1]!==n||e[2]!==o?(A=()=>{o?.(null),n(),c("")},e[1]=n,e[2]=o,e[3]=A):A=e[3];const $=A,E=U=>{if(o){o(U.id),n(),c("");return}Rn({orgId:u.id,userId:h},U.id,p),x(),n(),c(""),k(U.id)},W="flex flex-col max-h-[min(640px,80dvh)]";let M;e[4]!==a?(M=s.jsx(Dl,{value:a,onChange:c,placeholder:"Search agents..."}),e[4]=a,e[5]=M):M=e[5];const q="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let R;e[6]===Symbol.for("react.memo_cache_sentinel")?(R=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[6]=R):R=e[6];const Q="grid grid-cols-3 gap-1";let Y;e[7]!==b||e[8]!==n?(Y=async()=>{ae("agent_create_new_clicked",{source:"browse_popover"}),await b(),n()},e[7]=b,e[8]=n,e[9]=Y):Y=e[9];let ne,re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=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(Ae,{size:16,className:"text-muted-foreground"})}),ne=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[10]=ne,e[11]=re):(ne=e[10],re=e[11]);let L;e[12]!==j||e[13]!==Y?(L=s.jsxs("button",{type:"button",disabled:j,onClick:Y,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:[re,ne]}),e[12]=j,e[13]=Y,e[14]=L):L=e[14];let H;e[15]!==v||e[16]!==n?(H=async()=>{ae("agent_create_clicked",{source:"browse_popover",method:"website"}),await v(dr),n()},e[15]=v,e[16]=n,e[17]=H):H=e[17];let Z,K;e[18]===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(or,{className:"size-5 text-muted-foreground"})}),K=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[18]=Z,e[19]=K):(Z=e[18],K=e[19]);let ee;e[20]!==y||e[21]!==H?(ee=s.jsxs("button",{type:"button",disabled:y,onClick:H,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:[Z,K]}),e[20]=y,e[21]=H,e[22]=ee):ee=e[22];let G;e[23]!==n||e[24]!==l?(G=()=>{ae("agent_import_clicked",{source:"github"}),l(),n()},e[23]=n,e[24]=l,e[25]=G):G=e[25];let le,ce;e[26]===Symbol.for("react.memo_cache_sentinel")?(le=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(ur,{className:"size-5 text-muted-foreground"})}),ce=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[26]=le,e[27]=ce):(le=e[26],ce=e[27]);let V;e[28]!==G?(V=s.jsxs("button",{type:"button",onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[le,ce]}),e[28]=G,e[29]=V):V=e[29];let J;e[30]!==_||e[31]!==n||e[32]!==r?(J=_&&s.jsxs("button",{type:"button",onClick:()=>{ae("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[30]=_,e[31]=n,e[32]=r,e[33]=J):J=e[33];const me=o&&T&&z&&s.jsx(At,{agent:z,selected:!i||i===z.id,onClick:$}),I=S.map(U=>s.jsx(At,{agent:U,selected:o?i===U.id:void 0,onClick:()=>E(U)},U.id));let D;e[34]!==L||e[35]!==ee||e[36]!==V||e[37]!==J||e[38]!==me||e[39]!==I?(D=s.jsxs("div",{className:Q,children:[L,ee,V,J,me,I]}),e[34]=L,e[35]=ee,e[36]=V,e[37]=J,e[38]=me,e[39]=I,e[40]=D):D=e[40];let B;e[41]!==j||e[42]!==a||e[43]!==S.length?(B=S.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:a?"No agents found":"No agents yet"}),e[41]=j,e[42]=a,e[43]=S.length,e[44]=B):B=e[44];let P;e[45]!==D||e[46]!==B||e[47]!==R?(P=s.jsxs("div",{className:q,children:[R,D,B]}),e[45]=D,e[46]=B,e[47]=R,e[48]=P):P=e[48];let X;e[49]!==u.slug?(X={org:u.slug},e[49]=u.slug,e[50]=X):X=e[50];let oe;e[51]!==n?(oe=()=>n(),e[51]=n,e[52]=oe):oe=e[52];let ie;e[53]!==X||e[54]!==oe?(ie=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ft,{to:"/$org/settings/agents",params:X,onClick:oe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[53]=X,e[54]=oe,e[55]=ie):ie=e[55];let Se;return e[56]!==P||e[57]!==ie||e[58]!==M?(Se=s.jsxs("div",{className:W,children:[M,P,ie]}),e[56]=P,e[57]=ie,e[58]=M,e[59]=Se):Se=e[59],Se}function Ll(t){return!jn(t.id)}function Bl(t){const e=w.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r,trigger:l,onSelectAgent:o,selectedAgentId:i,side:a,align:c}=n,d=r===void 0?!1:r,m=a===void 0?"right":a,u=c===void 0?"start":c,[f,h]=O.useState(!1),[p,x]=O.useState(!1),[g,b]=O.useState(!1),j=dt(),{setOpenMobile:v}=Ce(),y=Pn(),_=y?"border border-border":void 0;let k;e[2]!==y?(k=M=>y?s.jsx(Ml,{children:M}):M,e[2]=y,e[3]=k):k=e[3];const N=k;let C;e[4]!==j||e[5]!==v?(C=()=>{h(!1),j&&v(!1)},e[4]=j,e[5]=v,e[6]=C):C=e[6];const S=C;let z;e[7]!==S||e[8]!==o||e[9]!==f||e[10]!==i?(z=f&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(fe,{className:"h-4 w-24"})}),children:s.jsx(Rl,{onClose:S,onOpenImportDeco:()=>x(!0),onOpenGithubImport:()=>{b(!0),S()},onSelectAgent:o,selectedAgentId:i})}),e[7]=S,e[8]=o,e[9]=f,e[10]=i,e[11]=z):z=e[11];const T=z;let A;e[12]!==u||e[13]!==d||e[14]!==_||e[15]!==y||e[16]!==j||e[17]!==f||e[18]!==T||e[19]!==m||e[20]!==l||e[21]!==N?(A=j?s.jsxs(s.Fragment,{children:[l?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:l}):d?N(s.jsx(xe,{"aria-label":"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Ae,{className:"size-4"})})):s.jsx(se,{children:N(s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ht,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Browse agents"}),T]})})]}):s.jsxs(Pe,{open:f,onOpenChange:M=>{M&&!f&&ae("agent_browser_opened",{surface:"desktop_popover"}),h(M)},children:[l?s.jsx(Ne,{asChild:!0,children:l}):d?N(s.jsx(Ne,{asChild:!0,children:s.jsx(xe,{"aria-label":"Browse agents",className:F(_),children:s.jsx(Ae,{className:"size-4"})})})):s.jsx(se,{children:N(s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ee,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:T})]}),e[12]=u,e[13]=d,e[14]=_,e[15]=y,e[16]=j,e[17]=f,e[18]=T,e[19]=m,e[20]=l,e[21]=N,e[22]=A):A=e[22];let $;e[23]!==p?($=s.jsx(ar,{open:p,onOpenChange:x}),e[23]=p,e[24]=$):$=e[24];let E;e[25]!==g?(E=s.jsx(mr,{open:g,onOpenChange:b}),e[25]=g,e[26]=E):E=e[26];let W;return e[27]!==E||e[28]!==A||e[29]!==$?(W=s.jsxs(s.Fragment,{children:[A,$,E]}),e[27]=E,e[28]=A,e[29]=$,e[30]=W):W=e[30],W}const ys="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Hl(t){const e=w.c(19),{agentId:n,onOpenHome:r,onPick:l}=t,o=Qt(n),i=o?.title??"Decopilot",a=`Open ${i} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==i?(d=s.jsx(De,{icon:c,name:i,size:"2xs"}),e[0]=c,e[1]=i,e[2]=d):d=e[2];let m;e[3]!==r||e[4]!==a||e[5]!==d?(m=s.jsx("button",{type:"button",onClick:r,"aria-label":a,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=r,e[4]=a,e[5]=d,e[6]=m):m=e[6];let u;e[7]!==i?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:i}),e[7]=i,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let h;e[10]!==u?(h=s.jsxs("button",{type:"button",className:ys,children:[u,f]}),e[10]=u,e[11]=h):h=e[11];let p;e[12]!==n||e[13]!==l||e[14]!==h?(p=s.jsx(Bl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:h}),e[12]=n,e[13]=l,e[14]=h,e[15]=p):p=e[15];let x;return e[16]!==m||e[17]!==p?(x=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=x):x=e[18],x}function Tt(){const t=w.c(34),{org:e}=de(),{state:n}=Ce(),r=n==="collapsed",l=he();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const i=ot(o);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const c=it(a),{threads:d}=ut(),{setTaskId:m,createNewTask:u}=mt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const h=f.id,p=i.taskId?c.virtualmcpid??h:h;let x;t[4]!==u||t[5]!==h||t[6]!==l||t[7]!==e.slug||t[8]!==m||t[9]!==d?(x=T=>{if(!T||T===h){l({to:"/$org",params:{org:e.slug}});return}const A=d.find($=>!$.hidden&&$.virtual_mcp_id===T&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));A?m(A.id,T):u(T)},t[4]=u,t[5]=h,t[6]=l,t[7]=e.slug,t[8]=m,t[9]=d,t[10]=x):x=t[10];const g=x;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(te.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ft,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==r?(y=!r&&s.jsx($l,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ys,children:[s.jsx(vs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=r,t[18]=y):y=t[18];let _;t[19]!==v||t[20]!==y?(_=s.jsxs(jt,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=_):_=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Hn,{}),t[22]=k):k=t[22];let N;t[23]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[23]=N):N=t[23];let C;t[24]!==p||t[25]!==g?(C=()=>g(p),t[24]=p,t[25]=g,t[26]=C):C=t[26];let S;t[27]!==p||t[28]!==g||t[29]!==C?(S=s.jsx(jt,{children:s.jsx(O.Suspense,{fallback:N,children:s.jsx(Hl,{agentId:p,onOpenHome:C,onPick:g})})}),t[27]=p,t[28]=g,t[29]=C,t[30]=S):S=t[30];let z;return t[31]!==S||t[32]!==_?(z=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Gn,{className:"flex-nowrap",children:[_,k,S]})}),t[31]=S,t[32]=_,t[33]=z):z=t[33],z}const Ul="sidebar.open";function Gl(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(On,{}),t[0]=e):e=t[0],e}function Li(){const t=w.c(24),e=dt(),[n,r]=We(Ul,!1),{width:l,wrapperRef:o,onStartResize:i,resetWidth:a}=pr();let c;t[0]!==e?(c=e?s.jsxs(te.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] items-center gap-2",children:[s.jsx(es,{}),s.jsx(Tt,{}),s.jsx(rt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(te.TogglesSlot,{}),s.jsx(te.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(te.CenterSlot,{}),s.jsx(te.RightSlot,{})]}):s.jsxs(te.Header,{children:[s.jsx(te.LeftColumn,{children:s.jsx(Tt,{})}),s.jsx(te.CenterSlot,{}),s.jsxs(te.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(te.TabsSlot,{})}),s.jsx(te.RightSlot,{}),s.jsx(te.TogglesSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${l}px`;let m;t[2]!==d?(m={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==i||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Sl,{}),s.jsx(fr,{onPointerDown:i,onDoubleClick:a})]}),t[4]=e,t[5]=i,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(Hs,{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(O.Suspense,{fallback:s.jsx(Gl,{}),children:s.jsx(Rs,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==u||t[11]!==f||t[12]!==o?(x=s.jsxs(Us,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=o,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dn,{renderSidebar:ql}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(Bn,{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(yn,{children:s.jsx(te.Provider,{children:s.jsx(Gs,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ql(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(Nl,{onClose:e})})})}export{Li as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,l as a,j as d}from"./index-
|
|
1
|
+
import{c as s,l as a,j as d}from"./index-DIyNSN96.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-DIyNSN96.js";import{n as Z}from"./XCircle-DMTFcHqR.js";import{A as y}from"./agent-icon-XUhQzRLX.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as r,j as i,bB as p}from"./index-
|
|
1
|
+
import{c as n,l as r,j as i,bB as p}from"./index-DIyNSN96.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|