decocms 4.12.0 → 4.12.2
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-ClgAhfOn.js → AlertCircle-CoC6NNi4.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B862Up1l.js → ArrowUpRight-N57ebzBw.js} +1 -1
- package/dist/client/assets/{CheckCircle-D6Zd00g5.js → CheckCircle-kHQ2dQaQ.js} +1 -1
- package/dist/client/assets/{ChevronDown-CavzOb2e.js → ChevronDown-P5eS_rdB.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgXTGSyd.js → ChevronRight-CTea8Vrz.js} +1 -1
- package/dist/client/assets/{ChevronUp-DWl02poJ.js → ChevronUp-BoULmO5v.js} +1 -1
- package/dist/client/assets/{DotsVertical-BXUN7i-s.js → DotsVertical-pUzhcHbw.js} +1 -1
- package/dist/client/assets/{Eye-BfxF3_NG.js → Eye-XrixTuLa.js} +1 -1
- package/dist/client/assets/{FilterLines-CHINsit0.js → FilterLines-JU5CW8t2.js} +1 -1
- package/dist/client/assets/{Globe01-7w14Dv0L.js → Globe01-DA12A_gX.js} +1 -1
- package/dist/client/assets/{Globe04-BmVvGcdk.js → Globe04-DNnzQTTy.js} +1 -1
- package/dist/client/assets/{HardDrive-C3esngx2.js → HardDrive-A9TGjU2B.js} +1 -1
- package/dist/client/assets/{Key01-D84zmw8T.js → Key01-C3y_5bqB.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BzG5LgFk.js → LayoutLeft-CuSrrdEU.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DwRUHK9K.js → LinkExternal01-Cwj3iuhi.js} +1 -1
- package/dist/client/assets/{Monitor01-D6j19kcU.js → Monitor01-Cb1N7DaM.js} +1 -1
- package/dist/client/assets/{Palette-DVeyHPSn.js → Palette-B_aebYLe.js} +1 -1
- package/dist/client/assets/{Play-DnC6BFen.js → Play-DDWMuBvQ.js} +1 -1
- package/dist/client/assets/{Plus-DE2oM9NP.js → Plus-CqV2jOMI.js} +1 -1
- package/dist/client/assets/{SearchLg-wiFmsHKn.js → SearchLg-Dvo924kw.js} +1 -1
- package/dist/client/assets/{SearchMd-3hwS3MeL.js → SearchMd-5ihP7yVQ.js} +1 -1
- package/dist/client/assets/{Settings02-D77UEQ2p.js → Settings02-iYAu_otv.js} +1 -1
- package/dist/client/assets/{Shield01-DGllkrSj.js → Shield01-BzDwMZxQ.js} +1 -1
- package/dist/client/assets/{Star01-tqRKmSvv.js → Star01-BkFl7Mhr.js} +1 -1
- package/dist/client/assets/{Stars01-BcSQPbwD.js → Stars01-D1UrqdL4.js} +1 -1
- package/dist/client/assets/{Stars02-C-4lNJ_k.js → Stars02-COayjfFf.js} +1 -1
- package/dist/client/assets/{Sun-CWsRADe_.js → Sun-Brrmn0Wt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DcPy-VUg.js → SwitchHorizontal01-dqeKRNpy.js} +1 -1
- package/dist/client/assets/{Tool01-Cl2bl9JY.js → Tool01-BWmMjNUF.js} +1 -1
- package/dist/client/assets/{Trash01-D75-03uB.js → Trash01-66NrnGrm.js} +1 -1
- package/dist/client/assets/{Upload01-Z-VVijrs.js → Upload01-DZiCAA30.js} +1 -1
- package/dist/client/assets/{User01-BgkBgTes.js → User01-BU4AVwNl.js} +1 -1
- package/dist/client/assets/{Users01-Cmsl-eTQ.js → Users01-rcwVvUtr.js} +1 -1
- package/dist/client/assets/{Users03-DT08k8_1.js → Users03-DvCgevzn.js} +1 -1
- package/dist/client/assets/{X-BVAUYa_T.js → X-DBy4i4Lp.js} +1 -1
- package/dist/client/assets/{XCircle-QoSkb3Jx.js → XCircle-IJc8zbrl.js} +1 -1
- package/dist/client/assets/{XClose-CPn-2iye.js → XClose-CtyL8bYf.js} +1 -1
- package/dist/client/assets/{Zap-B36bkz1F.js → Zap-fhgO5dDS.js} +1 -1
- package/dist/client/assets/{ZapSquare-ogfO4bZI.js → ZapSquare-CfbyrH4x.js} +1 -1
- package/dist/client/assets/{ZoomOut-5HsDnkoy.js → ZoomOut-C0N4ehtv.js} +1 -1
- package/dist/client/assets/{access-gate-BRNjXWYe.js → access-gate-Cp9GeAB2.js} +1 -1
- package/dist/client/assets/{add-section-modal-BOqz-964.js → add-section-modal-L1hZYDnC.js} +1 -1
- package/dist/client/assets/{agent-icon-aNPmoaPd.js → agent-icon-CWPBFzIp.js} +1 -1
- package/dist/client/assets/{agents-list-B7j1GcyH.js → agents-list-BSN0z_rH.js} +1 -1
- package/dist/client/assets/{ai-providers-CYCuk9h-.js → ai-providers-DD1AOaea.js} +1 -1
- package/dist/client/assets/{alert-CuDjX_qg.js → alert-Ddy80ofE.js} +1 -1
- package/dist/client/assets/{alert-dialog-ac9d9PM5.js → alert-dialog-CNwxdflX.js} +1 -1
- package/dist/client/assets/{app-editor-0CPOfgpn.js → app-editor-2eTZe4V8.js} +1 -1
- package/dist/client/assets/{auth-CiRpWlv5.js → auth-DnBe9AUC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DOctWB-A.js → auth-catchall-BX9JI1QT.js} +1 -1
- package/dist/client/assets/{auth-entry-Am18NSNg.js → auth-entry-BHvc520u.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CO3AbWz1.js → auth-split-layout-BXqARZ71.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C7yk75O_.js → authenticate-and-persist-oauth-u3Bd-L7u.js} +1 -1
- package/dist/client/assets/{automation-list-row-D2B_rh4A.js → automation-list-row-B4HURQxP.js} +1 -1
- package/dist/client/assets/{automation-runs-8_dybPHZ.js → automation-runs-CqWPoh43.js} +1 -1
- package/dist/client/assets/{automations-CeEWyIs5.js → automations-f7OFHAXD.js} +1 -1
- package/dist/client/assets/{avatar-BjKWRNVB.js → avatar-Dx8vsnte.js} +1 -1
- package/dist/client/assets/{badge-BJNy0wyL.js → badge-BzEWqz_j.js} +1 -1
- package/dist/client/assets/{block-document-Bq8rRDx4.js → block-document-DzMywRI1.js} +1 -1
- package/dist/client/assets/{brand-context-BIrrLjGn.js → brand-context-CyctFpS3.js} +1 -1
- package/dist/client/assets/{buckets-obXQMBpg.js → buckets-DNWd4v4G.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Cod4y6Ks.js → bulk-category-panel-Bj5wuN0i.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8MHuUCF.js → capability-load-error-BehOb5ja.js} +1 -1
- package/dist/client/assets/{card-BmW79tCv.js → card-go8Ic7Q5.js} +1 -1
- package/dist/client/assets/{category-editor-BJepbxNv.js → category-editor-DApO1Yn8.js} +1 -1
- package/dist/client/assets/{chat-context-B5hrLcwj.js → chat-context-BvVy1XII.js} +1 -1
- package/dist/client/assets/{checkbox-Kg4LLU9D.js → checkbox-D_sfTX5R.js} +1 -1
- package/dist/client/assets/{cli-auth-success-gObPiJa8.js → cli-auth-success-PaSH5Vkc.js} +1 -1
- package/dist/client/assets/{collection-detail-B0-T4ILL.js → collection-detail-BJ1XKRbv.js} +1 -1
- package/dist/client/assets/{collection-display-button-BvXYTAAP.js → collection-display-button-gz2ZuERS.js} +1 -1
- package/dist/client/assets/{collection-search-DwhBerSk.js → collection-search-C001GdqX.js} +1 -1
- package/dist/client/assets/{collection-tabs-BQDCpcYC.js → collection-tabs-B_vVgFOt.js} +1 -1
- package/dist/client/assets/{command-SyxeX2nl.js → command-B1GcRSWc.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DB5OC1v0.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-DlP4AIXL.js → connect-desktop-dialog-DKo4CQJQ.js} +1 -1
- package/dist/client/assets/{connection-card-C4oOxnQb.js → connection-card-Bx0N6sI4.js} +1 -1
- package/dist/client/assets/{connection-detail-DBJW-Pxx.js → connection-detail-Bbou6ZUd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-FkUfzqP1.js → connection-form-helpers-B8AytMOg.js} +1 -1
- package/dist/client/assets/{connections-CM5IOfmS.js → connections-C-x_DlaR.js} +1 -1
- package/dist/client/assets/{context-menu-NrhGe5Oj.js → context-menu-DKP9RpkZ.js} +1 -1
- package/dist/client/assets/{decopilot-Cj_SKATh.js → decopilot-DdwBW5Gf.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Bxsm1x-g.js → decopilot-sse-pool-DCzhBR7p.js} +1 -1
- package/dist/client/assets/{dialog-DsOssLqX.js → dialog-DBpjZOCu.js} +1 -1
- package/dist/client/assets/{domain-settings-Dkt1DWnP.js → domain-settings-BknARBcV.js} +1 -1
- package/dist/client/assets/{drawer-AyckCMmd.js → drawer-DPby2hn2.js} +1 -1
- package/dist/client/assets/{dropdown-menu-wQ-uELKw.js → dropdown-menu-EKQ6fenT.js} +1 -1
- package/dist/client/assets/{empty-state-CNU5O4hk.js → empty-state-YIcxVemW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-wL-0uC4r.js → extract-connection-data-CPBy2fVV.js} +1 -1
- package/dist/client/assets/{file-explorer-BEoaplFh.js → file-explorer-B8ZjgRCr.js} +1 -1
- package/dist/client/assets/{file-type-icon-B0qdUvEN.js → file-type-icon-BoZkRxIi.js} +1 -1
- package/dist/client/assets/{files-dNTrWuZj.js → files-D-C7vNw1.js} +1 -1
- package/dist/client/assets/{form-BHvZi-GZ.js → form-x1EJEVpQ.js} +1 -1
- package/dist/client/assets/{general-Dp9n9ALL.js → general-DQG7TPkY.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B2FKQ_5-.js → github-repo-picker-DBhdsm3x.js} +1 -1
- package/dist/client/assets/{hooks-5_uPY02P.js → hooks-DnXDFfXX.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CtmOo7gy.js → import-from-deco-dialog-CQrNEd18.js} +1 -1
- package/dist/client/assets/{index-B3Ofs7GR.js → index-1C_mGQYK.js} +1 -1
- package/dist/client/assets/{index-18VPlu9_.js → index-8q5cTvfk.js} +14 -14
- package/dist/client/assets/{index-D0eNritY.js → index-BTv_6po3.js} +1 -1
- package/dist/client/assets/{index-DPOBsX9s.js → index-BZyixu4W.js} +1 -1
- package/dist/client/assets/{index-laMg9IJJ.js → index-CNk0u5Ob.js} +1 -1
- package/dist/client/assets/{index-C74-7rC_.js → index-ChoCV5RI.js} +3 -3
- package/dist/client/assets/{index-BkMvO6br.js → index-Cv5o-Jym.js} +1 -1
- package/dist/client/assets/{index-5GIHeL-g.js → index-D2U9e4pq.js} +1 -1
- package/dist/client/assets/{index-GxYhZPOH.js → index-DFKc4d3N.js} +1 -1
- package/dist/client/assets/{index-BihoOK2W.js → index-DWzP3fZX.js} +1 -1
- package/dist/client/assets/{index-CIxzNHgu.js → index-DjKzm_7S.js} +1 -1
- package/dist/client/assets/{index-BD6No7__.js → index-DweVBJpV.js} +1 -1
- package/dist/client/assets/{index-BP3Art5K.js → index-iKSYi9v5.js} +1 -1
- package/dist/client/assets/{index-redirect-qJTq73AQ.js → index-redirect-C4UtODiM.js} +1 -1
- package/dist/client/assets/{index-Dj_tbWDC.js → index-t5khoU6y.js} +1 -1
- package/dist/client/assets/{input-ClQQvwn8.js → input-BWamIMbN.js} +1 -1
- package/dist/client/assets/{integration-icon-CXTBoi-C.js → integration-icon-EdsPubVt.js} +1 -1
- package/dist/client/assets/{label-DtyPJXbW.js → label-BZcMuJ0q.js} +1 -1
- package/dist/client/assets/{login-DpEp4bzD.js → login-avUjz7eB.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BZR_sfsi.js → mcp-oauth-DCCT0QwD.js} +1 -1
- package/dist/client/assets/{members-Da-N4F4w.js → members-CdekeDqO.js} +1 -1
- package/dist/client/assets/{monaco-editor-C0-ORVvv.js → monaco-editor-B3SQ_IFm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DaKaZFWH.js → monitoring-stats-row-CZoNTUjo.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1VskdWn.js → oauth-callback-BKoLh3YW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DJ_dLXG7.js → oauth-callback-ai-provider-tPz-_25R.js} +1 -1
- package/dist/client/assets/{onboarding-CUBIxT9d.js → onboarding-DTsyZZax.js} +1 -1
- package/dist/client/assets/{org-install-Badols3M.js → org-install-CCP2NMYy.js} +1 -1
- package/dist/client/assets/{org-layout-UVOciCax.js → org-layout-CSn0d-8X.js} +1 -1
- package/dist/client/assets/{organization-choice-BzwxXw2g.js → organization-choice-CvQmoyRd.js} +1 -1
- package/dist/client/assets/{page-seo-form-C_2RUxxC.js → page-seo-form-f84r-XPs.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BtqV4Z8p.js +1 -0
- package/dist/client/assets/{popover-DESq8MlY.js → popover-CUdzevRE.js} +1 -1
- package/dist/client/assets/{post-editor-C6yPagcF.js → post-editor-MWqisYd8.js} +1 -1
- package/dist/client/assets/{primitives-BDfut_pc.js → primitives-BzNkeic7.js} +1 -1
- package/dist/client/assets/{profile-D5pYQlzN.js → profile-Cvi05jzq.js} +1 -1
- package/dist/client/assets/project-app-view-Cwvch2dA.js +1 -0
- package/dist/client/assets/record-editor-BIJZRDg_.js +1 -0
- package/dist/client/assets/registry-CrX03JF2.js +2 -0
- package/dist/client/assets/{registry-layout-ewdPobS9.js → registry-layout-CZIha2cO.js} +1 -1
- package/dist/client/assets/{require-capability-b5F_i--f.js → require-capability-Dr8mj9VJ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-FfHfv0VI.js → required-auth-layout-CS_iMldS.js} +1 -1
- package/dist/client/assets/{reset-password-_ID0Jmb1.js → reset-password-DxhV1tKz.js} +1 -1
- package/dist/client/assets/{roles-D4aPzPCN.js → roles-BKAYDZzp.js} +1 -1
- package/dist/client/assets/{scroll-area-Dt0A9lzL.js → scroll-area-C-3TY2YE.js} +1 -1
- package/dist/client/assets/{search-input-mkU8caHs.js → search-input-BKD3oaXK.js} +1 -1
- package/dist/client/assets/{secrets-DZHFxUYN.js → secrets-DZxFwhRj.js} +1 -1
- package/dist/client/assets/{sections-editor-BhbIeS6T.js → sections-editor-Hww0_uGb.js} +1 -1
- package/dist/client/assets/{select-CFMmW9o-.js → select-C-6PWfXp.js} +1 -1
- package/dist/client/assets/{select-model-oC-ZbdSY.js → select-model-DGiOgK0q.js} +1 -1
- package/dist/client/assets/{seo-editor-Cu1RCBm-.js → seo-editor-BThpvCjT.js} +1 -1
- package/dist/client/assets/{settings-layout-iHEQZNRo.js → settings-layout-CwGAAGlU.js} +1 -1
- package/dist/client/assets/{settings-section-CCA_rQPu.js → settings-section-CSq9f2ez.js} +1 -1
- package/dist/client/assets/{sheet-DpVVe07a.js → sheet-B7Lez_S9.js} +1 -1
- package/dist/client/assets/{shell-controls-0GymUxsw.js → shell-controls-u_iHFGU5.js} +1 -1
- package/dist/client/assets/{shell-layout-B6CDg-cg.js → shell-layout-DG441JjL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-Dfj-cl4w.js → shell-route-loading-BpdXUJEZ.js} +1 -1
- package/dist/client/assets/{sidebar-DUnL0V4N.js → sidebar-BXZd-GVd.js} +1 -1
- package/dist/client/assets/{skeleton-Biz6Vvdi.js → skeleton-CgP3V6Ja.js} +1 -1
- package/dist/client/assets/{sortable.esm-4-bXuIBY.js → sortable.esm-D9jMeHV1.js} +1 -1
- package/dist/client/assets/{sso-C3HkmRoG.js → sso-Co77Yyyt.js} +1 -1
- package/dist/client/assets/{store-DY5TOVQx.js → store-CmSf-e73.js} +1 -1
- package/dist/client/assets/store-registry-CWYXcSAH.js +2 -0
- package/dist/client/assets/{studio-tools-BnbQl4Xy.js → studio-tools-C9NKrR5C.js} +1 -1
- package/dist/client/assets/{switch-dyBEm-xz.js → switch-Cu2RC5pZ.js} +1 -1
- package/dist/client/assets/{table-DAb40UnL.js → table-DW50z9UL.js} +1 -1
- package/dist/client/assets/{tabs-Y-yEKkZ4.js → tabs-T8F8VZUh.js} +1 -1
- package/dist/client/assets/{task-status-CmHRRegX.js → task-status-DEWrBULH.js} +1 -1
- package/dist/client/assets/{textarea-CZ6lZT55.js → textarea-BK_9gLq0.js} +1 -1
- package/dist/client/assets/{toggle-group-BDe3fVGm.js → toggle-group-e24ylmWs.js} +1 -1
- package/dist/client/assets/{toolbar-DcLfNsL6.js → toolbar-BhxpIEsu.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BK4dVDIq.js → toolbar-icon-button-B27j_4W9.js} +1 -1
- package/dist/client/assets/{tools-list-5V41Fj5o.js → tools-list-DIWh8Oky.js} +1 -1
- package/dist/client/assets/{tooltip-BETVAZty.js → tooltip-D0ODOH5L.js} +1 -1
- package/dist/client/assets/{types-CbtfOW36.js → types-BOo0uLec.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BC-Unv9B.js → use-ai-providers-DjRW0TN5.js} +1 -1
- package/dist/client/assets/{use-automations-DM4xNubt.js → use-automations-CS_Nu0ry.js} +1 -1
- package/dist/client/assets/{use-capability-Buq2jVbm.js → use-capability-DbvoEB-N.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CVyOhRb1.js → use-clock-tick-DicB8A5f.js} +1 -1
- package/dist/client/assets/{use-collections-DJbkAyuY.js → use-collections-CRpuCmSx.js} +1 -1
- package/dist/client/assets/{use-connection-C7H28tUm.js → use-connection-homG8xHs.js} +1 -1
- package/dist/client/assets/{use-copy-DwhmZgzz.js → use-copy-Dq7f5A4R.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DIJXVLDA.js → use-create-virtual-mcp-CMc5HT0P.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-xRcrGDGN.js → use-debounced-autosave-DTd4mDNn.js} +1 -1
- package/dist/client/assets/{use-debounced-value-dGP0T3Z6.js → use-debounced-value-hi69DHr0.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-ZViPJ0gD.js → use-decopilot-events-2XegsErL.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B1HsoB0C.js → use-delete-connection-CP-e1UsZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-BqeK5-ZL.js → use-file-configs-BM_cxwPW.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DKD-IrVC.js → use-infinite-scroll-Cj4qMXbT.js} +1 -1
- package/dist/client/assets/{use-join-requests-D02lKKeN.js → use-join-requests-DGz2R0VR.js} +1 -1
- package/dist/client/assets/{use-mcp-client-A_C0OXe_.js → use-mcp-client-C9rZ5q5t.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BdtnL2tp.js → use-mcp-prompts-Bpm2lRaW.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D5KEYf26.js → use-mcp-tools-BP-8Q6Ct.js} +1 -1
- package/dist/client/assets/{use-members-S8u6cgH3.js → use-members-C6DHv6rG.js} +1 -1
- package/dist/client/assets/{use-mobile-DB_HbZdV.js → use-mobile-BzlsCeN5.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cpj0q3sa.js → use-navigate-to-agent-B4oyUjLa.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-1ug5pqiq.js → use-org-auth-client-BqLuGuER.js} +1 -1
- package/dist/client/assets/{use-org-fs-B8S0kCYo.js → use-org-fs-wGkM6ZHK.js} +1 -1
- package/dist/client/assets/{use-org-sso-CTXVLokg.js → use-org-sso-DNIk-jwi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BG3L6PMl.js → use-organization-roles-CE_g_E6L.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D13sMxOQ.js → use-organization-settings-DmBEnT-y.js} +1 -1
- package/dist/client/assets/{use-registry-connections-PtpSZeVH.js → use-registry-connections-DLscAznw.js} +1 -1
- package/dist/client/assets/{use-secrets-5DqxCpWf.js → use-secrets-C8LfdaIH.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C-U8Pnl-.js → use-status-sounds-B-cyYEUC.js} +1 -1
- package/dist/client/assets/{use-view-mode-B1BnO7yA.js → use-view-mode-DKBazBz2.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-De67qc1-.js → use-virtual-mcp-E-pwiiFM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DRJEgKeg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BYH-CQed.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BrkAIOFb.js → useSuspenseQueries-CV-fvbQG.js} +1 -1
- package/dist/client/assets/{variant-calendar-CGx_HG0U.js → variant-calendar-ByJrzabj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-az73HV8a.js → view-mode-toggle-qIYOoB-v.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-DGsLAJMy.js +0 -1
- package/dist/client/assets/page-seo-sheet-fhZUZgqS.js +0 -1
- package/dist/client/assets/project-app-view-DngS6f9y.js +0 -1
- package/dist/client/assets/record-editor-BkB44FqU.js +0 -1
- package/dist/client/assets/registry-oa3OK8EB.js +0 -2
- package/dist/client/assets/store-registry-o7Mh0_Kv.js +0 -2
- package/dist/client/assets/useInfiniteQuery-WHDQHpmx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CFE7ta84.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,j as s,C as tt,r as A,l as B,i as gs,v as J,D as ue,a as Se,F as bs,K as Pt,k as zt,b as He,e as js,u as hn,G as pn,H as gn,o as bn,s as jn,n as vn,p as Sn,d as yn,B as Qe,I as Nn,J as _n,t as we,M as Cn,P as wn,x as kn,m as In,y as Tn,R as On,T as An,U as $n,V as ke,W as vs,X as Pn,Y as Ss,Z as zn,_ as Mn,$ as Dn,a0 as Rn,a1 as En,a2 as Fn,a3 as Gn,E as ys,O as Hn}from"./index-C74-7rC_.js";import{u as Le,S as de,a as ye,b as mt,c as ft,d as Ie,e as Ns,f as _s,g as Ln,h as Bn,i as wt,j as Un,k as qn,l as Wn}from"./sidebar-DUnL0V4N.js";import{u as Mt}from"./use-mobile-DB_HbZdV.js";import{T as le}from"./toolbar-icon-button-BK4dVDIq.js";import{a as Te,b as Oe,T as Ae,c as kt}from"./tooltip-BETVAZty.js";import{S as ve}from"./skeleton-Biz6Vvdi.js";import{P as xt,a as Je,b as ht}from"./popover-DESq8MlY.js";import{D as Cs,a as ws,b as ks}from"./drawer-AyckCMmd.js";import{i as Is}from"./SearchMd-3hwS3MeL.js";import{s as Kn}from"./Star01-tqRKmSvv.js";import{s as Ge}from"./Plus-DE2oM9NP.js";import{i as Vn,u as Yn,S as Xn,a as Qn}from"./use-mcp-client-A_C0OXe_.js";import{u as Ts,a as pt,b as Jn}from"./use-virtual-mcp-De67qc1-.js";import{u as Zn}from"./use-create-virtual-mcp-DIJXVLDA.js";import{I as er,u as tr,W as sr}from"./import-from-deco-dialog-CtmOo7gy.js";import{A as We,a as Qt,b as Jt,c as Os,d as nr,i as rr,s as or,e as ir,f as lr}from"./agent-icon-aNPmoaPd.js";import{G as ar,a as cr}from"./github-repo-picker-B2FKQ_5-.js";import{u as As,a as dr,b as $s,T as ur}from"./hooks-5_uPY02P.js";import{r as mr,u as fr,R as xr,a as hr,b as Ps}from"./shell-layout-B6CDg-cg.js";import{u as pr,g as zs,a as gr,b as br,s as jr,c as vr,r as Sr,d as yr,e as Nr,f as _r,p as Cr,h as wr,i as kr,j as Ir,k as Tr,l as Or,m as Ar,n as $r,T as yt,S as Nt,o as Pr,q as zr,t as Ms}from"./use-navigate-to-agent-Cpj0q3sa.js";import{g as Mr,u as Ds,A as Rs,a as Dr,b as Zt,K as Rr,P as Er,s as Fr,S as Gr,v as Hr,D as Lr,c as Br,d as Ur,C as qr,e as Wr}from"./sortable.esm-4-bXuIBY.js";import{i as Kr}from"./LayoutLeft-BzG5LgFk.js";import{A as It}from"./avatar-BjKWRNVB.js";import{i as Dt}from"./ChevronUp-DWl02poJ.js";import{a as es}from"./Eye-BfxF3_NG.js";import{n as Vr,i as Yr}from"./Globe01-7w14Dv0L.js";import{i as Xr}from"./ZoomOut-5HsDnkoy.js";import{i as Qr,a as Es}from"./ZapSquare-ogfO4bZI.js";import{i as Fs}from"./Monitor01-D6j19kcU.js";import{n as Jr,a as Zr}from"./Sun-CWsRADe_.js";import{a as st,b as eo,i as to}from"./Settings02-D77UEQ2p.js";import{i as so}from"./Shield01-DGllkrSj.js";import{a as no}from"./Users03-DT08k8_1.js";import{s as Rt}from"./XClose-CPn-2iye.js";import{A as ro,a as oo,b as io,c as lo,d as ao,e as co,f as uo}from"./alert-dialog-ac9d9PM5.js";import{F as mo,a as fo,b as xo,c as ho,d as po,f as go,e as bo}from"./form-BHvZi-GZ.js";import{I as jo}from"./input-ClQQvwn8.js";import{S as vo,C as So}from"./chat-context-B5hrLcwj.js";import"./index-B3Ofs7GR.js";import{n as Et}from"./Stars02-C-4lNJ_k.js";import{u as yo,v as No,C as _o}from"./connect-desktop-dialog-DlP4AIXL.js";import{u as Co,a as wo}from"./use-join-requests-D02lKKeN.js";import{i as Ft}from"./ChevronRight-DgXTGSyd.js";import{i as ko}from"./FilterLines-CHINsit0.js";import{c as Io,i as To}from"./SwitchHorizontal01-DcPy-VUg.js";import{S as Oo,a as Ao,b as $o,c as Po,d as zo}from"./select-CFMmW9o-.js";import{u as Mo,S as ts,M as Do}from"./shell-controls-0GymUxsw.js";import{c as Ro,a as Eo,b as Fo,d as Go,e as Ho}from"./dialog-DsOssLqX.js";import{C as Lo,a as Bo,b as Uo,c as qo,d as Wo}from"./command-SyxeX2nl.js";import{u as Gs}from"./studio-tools-BnbQl4Xy.js";import{i as Ko}from"./Zap-B36bkz1F.js";import{u as Vo}from"./use-org-auth-client-1ug5pqiq.js";import{C as rt,a as ss,b as Gt,c as Ht,d as Lt}from"./context-menu-NrhGe5Oj.js";import{T as Bt,S as Yo}from"./shell-route-loading-Dfj-cl4w.js";import{t as Hs}from"./ChevronDown-CavzOb2e.js";import{S as Xo}from"./task-status-CmHRRegX.js";import{T as Qo,a as Jo,b as ns,c as rs}from"./tabs-Y-yEKkZ4.js";import{T as oe}from"./toolbar-DcLfNsL6.js";import"./sheet-DpVVe07a.js";import"./X-BVAUYa_T.js";import"./auth-CiRpWlv5.js";import"./use-collections-DJbkAyuY.js";import"./use-connection-C7H28tUm.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-DwhBerSk.js";import"./AlertCircle-ClgAhfOn.js";import"./Tool01-Cl2bl9JY.js";import"./XCircle-QoSkb3Jx.js";import"./ArrowUpRight-B862Up1l.js";import"./CheckCircle-D6Zd00g5.js";import"./DotsVertical-BXUN7i-s.js";import"./Globe04-BmVvGcdk.js";import"./HardDrive-C3esngx2.js";import"./Key01-D84zmw8T.js";import"./LinkExternal01-DwRUHK9K.js";import"./Palette-DVeyHPSn.js";import"./Play-DnC6BFen.js";import"./SearchLg-wiFmsHKn.js";import"./Stars01-BcSQPbwD.js";import"./Trash01-D75-03uB.js";import"./Upload01-Z-VVijrs.js";import"./User01-BgkBgTes.js";import"./Users01-Cmsl-eTQ.js";import"./checkbox-Kg4LLU9D.js";import"./use-debounced-value-dGP0T3Z6.js";import"./authenticate-and-persist-oauth-C7yk75O_.js";import"./mcp-oauth-BZR_sfsi.js";import"./use-mcp-tools-D5KEYf26.js";import"./extract-connection-data-wL-0uC4r.js";import"./decopilot-sse-pool-Bxsm1x-g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-FfHfv0VI.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-D13sMxOQ.js";import"./use-org-sso-CTXVLokg.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C4oOxnQb.js";import"./use-registry-connections-PtpSZeVH.js";import"./useInfiniteQuery-WHDQHpmx.js";import"./use-infinite-scroll-DKD-IrVC.js";import"./card-BmW79tCv.js";import"./integration-icon-CXTBoi-C.js";import"./collection-tabs-BQDCpcYC.js";import"./badge-BJNy0wyL.js";import"./textarea-CZ6lZT55.js";import"./connection-form-helpers-FkUfzqP1.js";import"./useSuspenseInfiniteQuery-CFE7ta84.js";import"./use-ai-providers-BC-Unv9B.js";import"./label-DtyPJXbW.js";import"./use-decopilot-events-ZViPJ0gD.js";import"./use-capability-Buq2jVbm.js";import"./index-CIxzNHgu.js";import"./use-clock-tick-CVyOhRb1.js";import"./differenceInSeconds-NQ4PDo0z.js";function Zo(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Le();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const Ut=240,ei=400,ti="sidebar.width";function et(t){return Math.max(Ut,Math.min(ei,t))}function si(){const t=N.c(11),[e,n]=tt(ti,ni),r=A.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=et(e),p=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const h=b=>{const j=et(f+(b.clientX-m));p?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=et(f+(b.clientX-m));n(j);for(const S of x)S.style.transition="";window.removeEventListener("pointermove",h),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",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(Ut)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=et(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function ni(t){return typeof t=="number"?et(t):Ut}function ri(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=B("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=B("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let p;e[4]!==a?(p=a?s.jsx(gs,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Is,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=p):p=e[5];let x;e[6]!==r?(x=j=>r(j.target.value),e[6]=r,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==x||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=x,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==p||e[16]!==h?(g=s.jsxs("label",{className:f,children:[p,h]}),e[14]=f,e[15]=p,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const oi="Select an existing agent";function ii(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Te,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:oi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ae,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function li(){const t=N.c(5),{enableDecoImport:e}=bs(),{data:n}=Se.useSession();let r;t[0]!==n?.user?.email?(r=Pt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:ai,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=zt(i);return l?.isDecoUser??!1}async function ai(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function ci(t){const e=He(),{create:n}=As(),{locator:r}=ue(),o=js({strict:!1}),i=hn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?mr(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function di(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(We,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function ui(t){const e=N.c(56),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=A.useState(""),a=Ts(),c=a??[],{org:d}=ue(),{data:u}=Se.useSession(),m=u?.user?.id??"anon",f=zs(a),p=gr();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={navigateOnCreate:!0},e[0]=x):x=e[0];const{createVirtualMCP:h,isCreating:g}=Zn(x),{createFromTemplate:b,isCreating:j}=tr(),S=li(),y=ci(d.slug),C=Mr(a),w=i.toLowerCase(),_=c.filter(mi).filter(ee=>!C.has(ee.id)).filter(ee=>!i||ee.title.toLowerCase().includes(w)),I=ee=>{br({orgId:d.id,userId:m},ee.id,f),p(),n(),l(""),y(ee.id)},O="flex flex-col max-h-[min(640px,80dvh)]";let T;e[1]!==i?(T=s.jsx(ri,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=T):T=e[2];const z="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let $;e[3]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=$):$=e[3];const k="grid grid-cols-3 gap-1";let R;e[4]!==h||e[5]!==n?(R=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await h(),n()},e[4]=h,e[5]=n,e[6]=R):R=e[6];let U,G;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=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(Ge,{size:16,className:"text-muted-foreground"})}),G=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=U,e[8]=G):(U=e[7],G=e[8]);let D;e[9]!==g||e[10]!==R?(D=s.jsxs("button",{type:"button",disabled:g,onClick:R,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:[U,G]}),e[9]=g,e[10]=R,e[11]=D):D=e[11];let E;e[12]!==b||e[13]!==n?(E=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(sr),n()},e[12]=b,e[13]=n,e[14]=E):E=e[14];let M,W;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=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(Kn,{className:"size-5 text-muted-foreground"})}),W=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=M,e[16]=W):(M=e[15],W=e[16]);let q;e[17]!==j||e[18]!==E?(q=s.jsxs("button",{type:"button",disabled:j,onClick:E,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:[M,W]}),e[17]=j,e[18]=E,e[19]=q):q=e[19];let K;e[20]!==n||e[21]!==o?(K=()=>{J("agent_import_clicked",{source:"github"}),o(),n()},e[20]=n,e[21]=o,e[22]=K):K=e[22];let L,V;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=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(cr,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[23]=L,e[24]=V):(L=e[23],V=e[24]);let H;e[25]!==K?(H=s.jsxs("button",{type:"button",onClick:K,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[L,V]}),e[25]=K,e[26]=H):H=e[26];let Y;e[27]!==S||e[28]!==n||e[29]!==r?(Y=S&&s.jsxs("button",{type:"button",onClick:()=>{J("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[27]=S,e[28]=n,e[29]=r,e[30]=Y):Y=e[30];const te=_.map(ee=>s.jsx(di,{agent:ee,onClick:()=>I(ee)},ee.id));let Q;e[31]!==D||e[32]!==q||e[33]!==H||e[34]!==Y||e[35]!==te?(Q=s.jsxs("div",{className:k,children:[D,q,H,Y,te]}),e[31]=D,e[32]=q,e[33]=H,e[34]=Y,e[35]=te,e[36]=Q):Q=e[36];let se;e[37]!==g||e[38]!==i||e[39]!==_.length?(se=_.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[37]=g,e[38]=i,e[39]=_.length,e[40]=se):se=e[40];let X;e[41]!==Q||e[42]!==se||e[43]!==$?(X=s.jsxs("div",{className:z,children:[$,Q,se]}),e[41]=Q,e[42]=se,e[43]=$,e[44]=X):X=e[44];let Z;e[45]!==d.slug?(Z={org:d.slug},e[45]=d.slug,e[46]=Z):Z=e[46];let ne;e[47]!==n?(ne=()=>n(),e[47]=n,e[48]=ne):ne=e[48];let re;e[49]!==Z||e[50]!==ne?(re=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(pn,{to:"/$org/settings/agents",params:Z,onClick:ne,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[49]=Z,e[50]=ne,e[51]=re):re=e[51];let me;return e[52]!==X||e[53]!==re||e[54]!==T?(me=s.jsxs("div",{className:O,children:[T,X,re]}),e[52]=X,e[53]=re,e[54]=T,e[55]=me):me=e[55],me}function mi(t){return!Vn(t.id)}function Ls(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=A.useState(!1),[a,c]=A.useState(!1),[d,u]=A.useState(!1),m=Mt(),{setOpenMobile:f}=Le(),p=pr(),x=p?"border border-border":void 0;let h;e[2]!==p?(h=O=>p?s.jsx(ii,{children:O}):O,e[2]=p,e[3]=h):h=e[3];const g=h;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let S;e[7]!==j||e[8]!==i?(S=i&&s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ve,{className:"h-4 w-24"})}),children:s.jsx(ui,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=S):S=e[9];const y=S;let C;e[10]!==o||e[11]!==x||e[12]!==p||e[13]!==m||e[14]!==i||e[15]!==y||e[16]!==g?(C=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(le,{"aria-label":"Browse agents",className:B(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ge,{className:"size-4"})})):s.jsx(de,{children:g(s.jsxs(ye,{tooltip:p?void 0:"Browse agents",className:B(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ge,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Cs,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(ws,{className:"max-h-[85dvh] p-0",children:[s.jsx(ks,{className:"sr-only",children:"Browse agents"}),y]})})]}):s.jsxs(xt,{open:i,onOpenChange:O=>{O&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),l(O)},children:[o?g(s.jsx(Je,{asChild:!0,children:s.jsx(le,{"aria-label":"Browse agents",className:B(x),children:s.jsx(Ge,{className:"size-4"})})})):s.jsx(de,{children:g(s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:p?void 0:"Browse agents",className:B(x),children:[s.jsx(Ge,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(ht,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:y})]}),e[10]=o,e[11]=x,e[12]=p,e[13]=m,e[14]=i,e[15]=y,e[16]=g,e[17]=C):C=e[17];let w;e[18]!==a?(w=s.jsx(er,{open:a,onOpenChange:c}),e[18]=a,e[19]=w):w=e[19];let _;e[20]!==d?(_=s.jsx(ar,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let I;return e[22]!==C||e[23]!==w||e[24]!==_?(I=s.jsxs(s.Fragment,{children:[C,w,_]}),e[22]=C,e[23]=w,e[24]=_,e[25]=I):I=e[25],I}function Bs(){const t=N.c(3);ue();const{state:e,isMobile:n}=Le(),r=!n&&e==="collapsed";let o;if(t[0]!==r){if(o=[],r){let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={type:"custom",key:"new-task",content:s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:s.jsx(Ls,{})})})})},t[2]=i):i=t[2],o.push(i)}t[0]=r,t[1]=o}else o=t[1];return o}function Us(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(mt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ft,{children:s.jsx(Ie,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function qs(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Le();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{J("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=B(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ye,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(de,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function fi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ns,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(hi),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(Us,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(xi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function xi(t){return s.jsx(qs,{item:t},t.key)}function hi(t){return s.jsx(qs,{item:t},t.key)}function pi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=B("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(gi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(_s,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Ln,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function gi(t,e){return s.jsx(fi,{section:t},e)}function Ws(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(pi,{...t}),e[0]=t,e[1]=n):n=e[1],n}Ws.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(ve,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function bi(t){const e=N.c(16),{onToggle:n,className:r}=t,i=bs().logo??gn,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=B("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Kr,{size:16}),e[9]=f):f=e[9];let p;e[10]!==n?(p=s.jsx(le,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=p):p=e[11];let x;return e[12]!==c||e[13]!==m||e[14]!==p?(x=s.jsxs(Bn,{className:c,children:[m,p]}),e[12]=c,e[13]=m,e[14]=p,e[15]=x):x=e[15],x}function os(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=B(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ye,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(de,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function ji(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ns,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(os,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(Us,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(os,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function vi(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(A.Suspense,{fallback:l,children:s.jsx(bi,{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=(p,x)=>s.jsx(ji,{section:p,onClose:r},x),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(_s,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function Ks(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Si=bn({name:jn().min(2,"Organization name is required")});function yi(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:vn(Si),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Sn(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:_i,onSuccess:Ni},e[1]=l):l=e[1];const a=yn(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(io,{children:[s.jsx(lo,{children:"Create a new organization"}),s.jsx(ao,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=I=>a.mutateAsync(I),e[6]=a,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:I}=_;return s.jsxs(xo,{children:[s.jsx(ho,{children:"Organization Name"}),s.jsx(po,{children:s.jsx(jo,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(go,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Ks(I.value)]})]}),s.jsx(bo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(mo,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let p;e[13]!==c?(p=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=p):p=e[14];let x;e[15]!==a||e[16]!==i?(x=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=x):x=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==x?(h=s.jsx(ro,{disabled:i.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=x,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(vo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Qe,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let S;e[26]!==j||e[27]!==h?(S=s.jsxs(co,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=S):S=e[28];let y;e[29]!==S||e[30]!==u||e[31]!==f||e[32]!==p?(y=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,p,S]}),e[29]=S,e[30]=u,e[31]=f,e[32]=p,e[33]=y):y=e[33];let C;e[34]!==i||e[35]!==y?(C=s.jsxs(oo,{children:[d,s.jsx(fo,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=C):C=e[36];let w;return e[37]!==r||e[38]!==n||e[39]!==C?(w=s.jsx(uo,{open:n,onOpenChange:r,children:C}),e[37]=r,e[38]=n,e[39]=C,e[40]=w):w=e[40],w}function Ni(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function _i(t){const e=Ks(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Se.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 Tt(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 Ci(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=B(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Tt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function ot(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function is(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=kn();let l;e[0]!==n?(l=(k,R)=>k.slug===n?-1:R.slug===n?1:k.name.localeCompare(R.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=A.useState(!1),[u,m]=A.useState(""),f=u.toLowerCase(),p=f?a.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):a;let x;e[2]!==c?(x=function(){c&&m(""),d(wi)},e[2]=c,e[3]=x):x=e[3];const h=x;let g;e[4]!==u||e[5]!==c||e[6]!==h?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:k=>m(k.target.value),onKeyDown:k=>k.key==="Escape"&&h(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=h,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(Rt,{size:16}):s.jsx(Is,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==h?(j=s.jsx("button",{type:"button",onClick:h,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=h,e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ge,{size:16}),e[13]=S):S=e[13];let y;e[14]!==o?(y=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:S}),e[14]=o,e[15]=y):y=e[15];let C;e[16]!==j||e[17]!==y?(C=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,y]}),e[16]=j,e[17]=y,e[18]=C):C=e[18];let w;e[19]!==g||e[20]!==C?(w=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,C]}),e[19]=g,e[20]=C,e[21]=w):w=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=p.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let O;e[22]!==r||e[23]!==n?(O=k=>s.jsxs("button",{type:"button",onClick:()=>r(k.slug),className:B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Ci,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(Dt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=r,e[23]=n,e[24]=O):O=e[24];const T=p.map(O);let z;e[25]!==I||e[26]!==T?(z=s.jsxs("div",{className:_,children:[I,T]}),e[25]=I,e[26]=T,e[27]=z):z=e[27];let $;return e[28]!==z||e[29]!==w?($=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=$):$=e[30],$}function wi(t){return!t}function ls(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:p,open:x}=t;if(p){const X=n?.name??"U";let Z;e[0]!==X||e[1]!==r?(Z=s.jsx(It,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=Z):Z=e[2];const ne=n?.name??"User";let re;e[3]!==ne?(re=s.jsx("p",{className:"text-sm font-medium truncate",children:ne}),e[3]=ne,e[4]=re):re=e[4];const me=n?.email;let ee;e[5]!==me?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:me}),e[5]=me,e[6]=ee):ee=e[6];let fe;e[7]!==re||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[re,ee]}),e[7]=re,e[8]=ee,e[9]=fe):fe=e[9];let $e;e[10]!==n?($e=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oi)},e[10]=n,e[11]=$e):$e=e[11];let Ke;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ke=s.jsx(es,{size:14}),e[12]=Ke):Ke=e[12];let ae;e[13]!==$e?(ae=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:$e,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ke})}),e[13]=$e,e[14]=ae):ae=e[14];let Ne;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(Oe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ne):Ne=e[15];let he;e[16]!==ae?(he=s.jsx(kt,{delayDuration:300,children:s.jsxs(Ae,{children:[ae,Ne]})}),e[16]=ae,e[17]=he):he=e[17];let Pe;e[18]!==he||e[19]!==Z||e[20]!==fe?(Pe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Z,fe,he]}),e[18]=he,e[19]=Z,e[20]=fe,e[21]=Pe):Pe=e[21];const Ze=String(x);let pe;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==Ze?(pe=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(is,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Ze)}),e[22]=m,e[23]=u,e[24]=d,e[25]=Ze,e[26]=pe):pe=e[26];let ie;if(e[27]!==f||e[28]!==o){let ce;e[30]!==f?(ce=Ye=>s.jsx(ot,{item:Ye,onClose:f},Ye.key),e[30]=f,e[31]=ce):ce=e[31],ie=o.map(ce),e[27]=f,e[28]=o,e[29]=ie}else ie=e[29];let ge;e[32]!==f||e[33]!==i?(ge=s.jsx(ot,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=ge):ge=e[34];let xe;e[35]!==ie||e[36]!==ge?(xe=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ie,ge]}),e[35]=ie,e[36]=ge,e[37]=xe):xe=e[37];let be;e[38]!==pe||e[39]!==xe?(be=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[pe,xe]}),e[38]=pe,e[39]=xe,e[40]=be):be=e[40];let ze;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ce;e[45]!==a.theme||e[46]!==c?(ce=Ye=>{const{value:Xe,icon:St,label:nt}=Ye;return s.jsx("button",{type:"button","aria-label":nt,onClick:()=>c(Yt=>({...Yt,theme:Xe})),className:B("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:St},Xe)},e[45]=a.theme,e[46]=c,e[47]=ce):ce=e[47],ze=l.map(ce),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=ze}else ze=e[44];let Me;e[48]!==ze?(Me=s.jsx("div",{className:"flex items-center gap-0.5",children:ze}),e[48]=ze,e[49]=Me):Me=e[49];const Ve=a.enableSounds?"Disable sounds":"Enable sounds";let je;e[50]!==c?(je=()=>c(Ti),e[50]=c,e[51]=je):je=e[51];const Be=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let _e;e[52]!==Be?(_e=B("size-8 rounded-md flex items-center justify-center transition-colors",Be),e[52]=Be,e[53]=_e):_e=e[53];let De;e[54]!==a.enableSounds?(De=a.enableSounds?s.jsx(Qt,{size:14}):s.jsx(Jt,{size:14}),e[54]=a.enableSounds,e[55]=De):De=e[55];let Re;e[56]!==Ve||e[57]!==je||e[58]!==_e||e[59]!==De?(Re=s.jsx("button",{type:"button","aria-label":Ve,onClick:je,className:_e,children:De}),e[56]=Ve,e[57]=je,e[58]=_e,e[59]=De,e[60]=Re):Re=e[60];let Ue;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ue=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.12.0"]}),e[61]=Ue):Ue=e[61];let Ce;e[62]!==Re?(Ce=s.jsxs("div",{className:"flex items-center gap-2",children:[Re,Ue]}),e[62]=Re,e[63]=Ce):Ce=e[63];let Ee;e[64]!==Me||e[65]!==Ce?(Ee=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Me,Ce]}),e[64]=Me,e[65]=Ce,e[66]=Ee):Ee=e[66];let qe;return e[67]!==Pe||e[68]!==be||e[69]!==Ee?(qe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Pe,be,Ee]}),e[67]=Pe,e[68]=be,e[69]=Ee,e[70]=qe):qe=e[70],qe}const h=n?.name??"U";let g;e[71]!==h||e[72]!==r?(g=s.jsx(It,{url:r,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=h,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const S=n?.email;let y;e[76]!==S?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S}),e[76]=S,e[77]=y):y=e[77];let C;e[78]!==j||e[79]!==y?(C=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,y]}),e[78]=j,e[79]=y,e[80]=C):C=e[80];let w;e[81]!==n?(w=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ii)},e[81]=n,e[82]=w):w=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(es,{size:14}),e[83]=_):_=e[83];let I;e[84]!==w?(I=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:w,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=w,e[85]=I):I=e[85];let O;e[86]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Oe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=O):O=e[86];let T;e[87]!==I?(T=s.jsx(kt,{delayDuration:300,children:s.jsxs(Ae,{children:[I,O]})}),e[87]=I,e[88]=T):T=e[88];let z;e[89]!==T||e[90]!==g||e[91]!==C?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,C,T]}),e[89]=T,e[90]=g,e[91]=C,e[92]=z):z=e[92];let $;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=Z=>s.jsx(ot,{item:Z,onClose:f},Z.key),e[96]=f,e[97]=X):X=e[97],$=o.map(X),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let k;e[98]!==f||e[99]!==i?(k=s.jsx(ot,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=k):k=e[100];let R;e[101]!==$||e[102]!==k?(R=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,k]}),e[101]=$,e[102]=k,e[103]=R):R=e[103];let U;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=Z=>{const{value:ne,icon:re,label:me}=Z;return s.jsx("button",{type:"button","aria-label":me,onClick:()=>c(ee=>({...ee,theme:ne})),className:B("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ne?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:re},ne)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],U=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=U}else U=e[107];let G;e[111]!==U?(G=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[111]=U,e[112]=G):G=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[113]!==c?(E=()=>c(ki),e[113]=c,e[114]=E):E=e[114];const M=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let W;e[115]!==M?(W=B("size-7 rounded-md flex items-center justify-center transition-colors",M),e[115]=M,e[116]=W):W=e[116];let q;e[117]!==a.enableSounds?(q=a.enableSounds?s.jsx(Qt,{size:14}):s.jsx(Jt,{size:14}),e[117]=a.enableSounds,e[118]=q):q=e[118];let K;e[119]!==D||e[120]!==E||e[121]!==W||e[122]!==q?(K=s.jsx("button",{type:"button","aria-label":D,onClick:E,className:W,children:q}),e[119]=D,e[120]=E,e[121]=W,e[122]=q,e[123]=K):K=e[123];let L;e[124]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.12.0"]}),e[124]=L):L=e[124];let V;e[125]!==K?(V=s.jsxs("div",{className:"flex items-center gap-2",children:[K,L]}),e[125]=K,e[126]=V):V=e[126];let H;e[127]!==G||e[128]!==V?(H=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[G,V]}),e[127]=G,e[128]=V,e[129]=H):H=e[129];let Y;e[130]!==z||e[131]!==R||e[132]!==H?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,R,H]}),e[130]=z,e[131]=R,e[132]=H,e[133]=Y):Y=e[133];const te=String(x);let Q;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==te?(Q=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(is,{orgParam:d,onSelectOrg:u,onCreateOrg:m},te)}),e[134]=m,e[135]=u,e[136]=d,e[137]=te,e[138]=Q):Q=e[138];let se;return e[139]!==Y||e[140]!==Q?(se=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,Q]}),e[139]=Y,e[140]=Q,e[141]=se):se=e[141],se}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ii(){we.success("User ID copied")}function Ti(t){return{...t,enableSounds:!t.enableSounds}}function Oi(){we.success("User ID copied")}function Ot(){const t=N.c(44),{data:e}=Se.useSession(),{org:n}=ue(),r=He();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=Nn(o)?.params.org,[a,c]=_n(),d=Mt(),[u,m]=A.useState(!1),[f,p]=A.useState(!1),x=e?.user,h=x?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const S=j;let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(st,{size:16}),t[4]=y):y=t[4];let C;t[5]!==r||t[6]!==l?(C={key:"preferences",label:"Preferences",icon:y,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=C):C=t[7];let w;t[8]!==n||t[9]!==r?(w=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Vr,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=w):w=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(Xr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(so,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let O;t[13]===Symbol.for("react.memo_cache_sentinel")?(O={key:"github",label:"decocms/studio",icon:s.jsx(Cn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=O):O=t[13];let T;t[14]===Symbol.for("react.memo_cache_sentinel")?(T={key:"community",label:"Community",icon:s.jsx(no,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=T):T=t[14];let z;t[15]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:s.jsx(Yr,{size:16}),href:"https://decocms.com",external:!0},t[15]=z):z=t[15];let $;t[16]!==C||t[17]!==w?($=[C,...w,_,I,O,T,z],t[16]=C,t[17]=w,t[18]=$):$=t[18];const k=$;let R;t[19]===Symbol.for("react.memo_cache_sentinel")?(R={key:"logout",label:"Sign out",icon:s.jsx(Qr,{size:16}),onClick:$i},t[19]=R):R=t[19];const U=R;let G;t[20]===Symbol.for("react.memo_cache_sentinel")?(G={value:"light",icon:s.jsx(Jr,{size:14}),label:"Light theme"},t[20]=G):G=t[20];let D;t[21]===Symbol.for("react.memo_cache_sentinel")?(D={value:"dark",icon:s.jsx(Zr,{size:14}),label:"Dark theme"},t[21]=D):D=t[21];let E;t[22]===Symbol.for("react.memo_cache_sentinel")?(E=[G,D,{value:"system",icon:s.jsx(Fs,{size:14}),label:"System theme"}],t[22]=E):E=t[22];const M=E;let W;t[23]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{m(!1),p(!0)},t[23]=W):W=t[23];let q;t[24]!==b||t[25]!==d||t[26]!==k||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==x||t[32]!==h?(q={user:x,userImage:h,menuItems:k,signOutItem:U,themeOptions:M,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:W,close:S,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=k,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=x,t[32]=h,t[33]=q):q=t[33];const K=q;let L;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==K?(L=d?s.jsxs(Cs,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Tt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(ws,{className:"h-[80dvh] p-0",children:[s.jsx(ks,{className:"sr-only",children:"Account"}),s.jsx(ls,{...K})]})]}):s.jsxs(xt,{open:u,onOpenChange:m,children:[s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Tt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(ht,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Ai,children:s.jsx(ls,{...K})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=K,t[38]=L):L=t[38];let V;t[39]!==f?(V=s.jsx(yi,{open:f,onOpenChange:p}),t[39]=f,t[40]=V):V=t[40];let H;return t[41]!==L||t[42]!==V?(H=s.jsxs(s.Fragment,{children:[L,V]}),t[41]=L,t[42]=V,t[43]=H):H=t[43],H}function Ai(t){return t.preventDefault()}function $i(){J("signed_out",{source:"account_popover"}),wn(),Se.signOut()}function At(){const t=N.c(22),e=yo(),[n,r]=A.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const h=No(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:h.length>0?`Available: ${h.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Fs,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Te,{asChild:!0,children:s.jsxs(le,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(Oe,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Ae,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let p;t[17]!==n?(p=s.jsx(_o,{open:n,onOpenChange:r}),t[17]=n,t[18]=p):p=t[18];let x;return t[19]!==f||t[20]!==p?(x=s.jsxs(s.Fragment,{children:[f,p]}),t[19]=f,t[20]=p,t[21]=x):x=t[21],x}function Pi({invitation:t}){const[e,n]=A.useState(!1),[r,o]=A.useState(!1),i=In(),l=async()=>{n(!0);try{const d=await Se.organization.acceptInvitation({invitationId:t.id});if(d.error){we.error(d.error.message),n(!1);return}}catch{we.error("Failed to accept invitation"),n(!1);return}we.success("Invitation accepted!"),Tn();let c;try{c=(await Se.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(we.error(c.error.message),o(!1)):(we.success("Invitation declined"),i.invalidateQueries())}catch{we.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Dt,{size:14})}),s.jsx(Qe,{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(Rt,{size:14})})]})]})}function zi(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=Co(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(It,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Dt,{size:14}),e[11]=p):p=e[11];let x;e[12]!==i||e[13]!==f?(x=s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:p}),e[12]=i,e[13]=f,e[14]=x):x=e[14];let h;e[15]!==o||e[16]!==n.id?(h=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Rt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==x?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[x,b]}),e[22]=b,e[23]=x,e[24]=j):j=e[24];let S;return e[25]!==j||e[26]!==d||e[27]!==m?(S=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=S):S=e[28],S}function Mi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ft,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Di(){const t=A.useContext(On),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function Vs(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=fr(),o=Di(),i=wo();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Hi).map(Gi),u=[...o].sort(Fi).map(Ei);let m;t[4]!==e?(m=p=>({type:"release",release:p,isSeen:e(p.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...xr].sort(Ri).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function Ri(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Ei(t){return{type:"invitation",invitation:t}}function Fi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Gi(t){return{type:"join-request",request:t}}function Hi(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class Ys extends A.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 Xs(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Li(){const t=N.c(17),e=He(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=Ds();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=B(o!=null&&Xs(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Os,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Ie,{children:s.jsx(de,{children:s.jsxs(ye,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function Bi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Li,{})})}),t[0]=e):e=t[0],e}function Ui(){const t=N.c(17),e=He(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=Ds();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=B(o!=null&&Xs(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Os,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(Oe,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ae,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function qi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Ui,{})})}),t[0]=e):e=t[0],e}function Qs(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=Vs(),[i,l]=A.useState(null);let a;if(e[0]!==r||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=r.find(h),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=h=>{l(h),o(h)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||l(null)},e[7]=f):f=e[7];let p;e[8]!==m||e[9]!==r||e[10]!==d?(p=s.jsx(ht,{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(Qe,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(eo,{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(hr,{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(Et,{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(h=>h.type==="join-request"?s.jsx(zi,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Pi,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Mi,{release:h.release,isSeen:h.isSeen,onSelect:()=>m(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=p):p=e[11];let x;return e[12]!==n||e[13]!==p?(x=s.jsxs(xt,{onOpenChange:f,children:[n,p]}),e[12]=n,e[13]=p,e[14]=x):x=e[14],x}function Js(){const{redDotCount:t}=Vs();return t>0}function Wi(){const t=N.c(6),e=Js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Et,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(Qs,{children:s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ki(){const t=N.c(8),e=Js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Et,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(Je,{asChild:!0,children:s.jsx(Te,{asChild:!0,children:s.jsxs(le,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(Qs,{children:s.jsxs(Ae,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Vi(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ye,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Es,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Rs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Yi(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ae,{delayDuration:300,children:[s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Es,{className:"size-4"})})}),s.jsx(Oe,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Rs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Xi(){const t=N.c(7),e=He(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(st,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ye,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Qi(){const t=N.c(9),e=He(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(st,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Ae,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Ji(){const t=N.c(7),{state:e}=Le();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Bi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(de,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(At,{})})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(de,{children:s.jsx(Vi,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(de,{children:s.jsx(Wi,{})}),t[3]=a):a=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(de,{children:s.jsx(Xi,{})}),t[4]=c):c=t[4];let d;return t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(wt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Ie,{children:[i,l,a,c,s.jsx(de,{children:s.jsx(Ot,{})})]})]}),t[5]=d):d=t[5],d}let r;return t[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(wt,{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(Ie,{children:s.jsx(de,{children:s.jsx(Ot,{})})})}),s.jsx(Qi,{}),s.jsx(Ki,{}),s.jsx(At,{}),s.jsx(Yi,{}),s.jsx(qi,{})]})}),t[6]=r):r=t[6],r}function Zi(){const t=N.c(8),e=He(),{org:n}=ue(),{setOpenMobile:r}=Le();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ie,{children:s.jsx(de,{children:s.jsx(Ot,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(st,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(wt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(le,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function it(t){const e=N.c(15),{className:n,wrapperClassName:r,children:o}=t,[i,l]=A.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&l(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const u=d;let m;e[2]!==r?(m=B("relative",r),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:u,className:n,children:o}),e[4]=o,e[5]=n,e[6]=f):f=e[6];const p=i?"opacity-100":"opacity-0";let x;e[7]!==p?(x=B("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",p),e[7]=p,e[8]=x):x=e[8];let h;e[9]!==x?(h=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=h):h=e[10];let g;return e[11]!==m||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:m,children:[f,h]}),e[11]=m,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function el(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(tl,{virtualMcpId:n,size:i}):s.jsx(We,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Ko,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function tl(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=pt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(We,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(We,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function as(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=A.useState(""),{org:l}=ue(),{setTaskId:a}=Ps(),c=Gs();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=zt,d=Pt.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let p;e[5]!==c||e[6]!==m?(p=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=p):p=e[7];let x;e[8]!==d||e[9]!==f||e[10]!==p?(x={queryKey:d,enabled:f,queryFn:p,staleTime:1e4},e[8]=d,e[9]=f,e[10]=p,e[11]=x):x=e[11];const{data:h,isFetching:g}=u(x);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let S;e[14]!==r?(S=k=>{k||i(""),r(k)},e[14]=r,e[15]=S):S=e[15];const y=S;let C;e[16]!==y||e[17]!==a?(C=k=>{y(!1),a(k.id,k.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=C):C=e[18];const w=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Ro,{className:"sr-only",children:[s.jsx(Eo,{children:"Search"}),s.jsx(Fo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let I;e[20]!==o?(I=s.jsx(Uo,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let O;e[22]!==w||e[23]!==g||e[24]!==j||e[25]!==m?(O=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Lo,{children:"No results."}):j.map(k=>k.type==="thread"?s.jsxs(Bo,{value:`thread:${k.id}:${k.title}`,onSelect:()=>w(k),className:"gap-2.5",children:[s.jsx(el,{virtualMcpId:k.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:k.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(k.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${k.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=w,e[23]=g,e[24]=j,e[25]=m,e[26]=O):O=e[26];let T;e[27]!==O?(T=s.jsx(qo,{children:O}),e[27]=O,e[28]=T):T=e[28];let z;e[29]!==I||e[30]!==T?(z=s.jsxs(Go,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Wo,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,T]})]}),e[29]=I,e[30]=T,e[31]=z):z=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==z?($=s.jsx(Ho,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=$):$=e[35],$}function sl(t){return t==="owner"||t==="admin"}function nl(){const t=N.c(11),{locator:e}=ue(),n=Vo(),{data:r}=Se.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Pt.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=zt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(p=>p.userId===o)?.role;u=sl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var _t,gt="HoverCard",[Zs]=Pn(gt,[vs]),bt=vs(),[rl,jt]=Zs(gt),en=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=bt(e),d=A.useRef(0),u=A.useRef(0),m=A.useRef(!1),f=A.useRef(!1),[p,x]=Fn({prop:r,defaultProp:o??!1,onChange:i,caller:gt}),h=A.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>x(!0),l)},[l,x]),g=A.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>x(!1),a))},[a,x]),b=A.useCallback(()=>x(!1),[x]);return A.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(rl,{scope:e,open:p,onOpenChange:x,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(Gn,{...c,children:n})})};en.displayName=gt;var tn="HoverCardTrigger",sn=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=jt(tn,n),i=bt(n);return s.jsx(An,{asChild:!0,...i,children:s.jsx($n.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:ke(t.onPointerEnter,dt(o.onOpen)),onPointerLeave:ke(t.onPointerLeave,dt(o.onClose)),onFocus:ke(t.onFocus,o.onOpen),onBlur:ke(t.onBlur,o.onClose),onTouchStart:ke(t.onTouchStart,l=>l.preventDefault())})})});sn.displayName=tn;var qt="HoverCardPortal",[ol,il]=Zs(qt,{forceMount:void 0}),nn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=jt(qt,e);return s.jsx(ol,{scope:e,forceMount:n,children:s.jsx(Ss,{present:n||i.open,children:s.jsx(En,{asChild:!0,container:o,children:r})})})};nn.displayName=qt;var ct="HoverCardContent",rn=A.forwardRef((t,e)=>{const n=il(ct,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=jt(ct,t.__scopeHoverCard);return s.jsx(Ss,{present:r||i.open,children:s.jsx(ll,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ke(t.onPointerEnter,dt(i.onOpen)),onPointerLeave:ke(t.onPointerLeave,dt(i.onClose)),ref:e})})});rn.displayName=ct;var ll=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=jt(ct,n),d=bt(n),u=A.useRef(null),m=zn(e,u),[f,p]=A.useState(!1);return A.useEffect(()=>{if(f){const x=document.body;return _t=x.style.userSelect||x.style.webkitUserSelect,x.style.userSelect="none",x.style.webkitUserSelect="none",()=>{x.style.userSelect=_t,x.style.webkitUserSelect=_t}}},[f]),A.useEffect(()=>{if(u.current){const x=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",x),()=>{document.removeEventListener("pointerup",x),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),A.useEffect(()=>{u.current&&dl(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),s.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,x=>{x.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(Dn,{...d,...a,onPointerDown:ke(a.onPointerDown,x=>{x.currentTarget.contains(x.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),al="HoverCardArrow",cl=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=bt(n);return s.jsx(Rn,{...o,...r,ref:e})});cl.displayName=al;function dt(t){return e=>e.pointerType==="touch"?void 0:t()}function dl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var ul=en,ml=sn,fl=nn,xl=rn;function hl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(ul,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function pl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(ml,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function gl(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(fl,{"data-slot":"hover-card-portal",children:s.jsx(xl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Wt(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ge,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(rt,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(st,{size:14,className:"mr-2"}),e[9]=p):p=e[9];let x;e[10]!==f?(x=s.jsxs(rt,{onSelect:f,children:[p,"Settings"]}),e[10]=f,e[11]=x):x=e[11];let h;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(h=o&&s.jsxs(s.Fragment,{children:[s.jsx(ss,{}),s.jsxs(rt,{onSelect:()=>a(n,!r),children:[s.jsx(nr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=h):h=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(ss,{}),s.jsxs(rt,{onSelect:()=>c(n),children:[s.jsx(to,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==x||e[23]!==h||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,x,h,g]}),e[21]=m,e[22]=x,e[23]=h,e[24]=g,e[25]=b):b=e[25],b}function Kt(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(gs,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function jl(t){return t.member==="mine"&&!t.currentUserId}const on=4;let at=0;const $t=[];function vl(){for(;at<on&&$t.length>0;){const t=$t.shift();t&&t()}}function ln(t){return new Promise((e,n)=>{const r=()=>{at++,t().then(e,n).finally(()=>{at--,vl()})};at<on?r():$t.push(r)})}const vt=10;function cs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function Sl(t,e,n,r){let o=0;for(const i of t)Vt(i,e,n,r)&&o++;return o}function Ct(t,e,n,r){return Sl(t,e,n,r)}function yl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Vt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Nl(t,e){return!!(t>=vt||t===0&&e)}function ds(t,e){return t<e}function _l(t,e){return e===!1?!1:e===!0?!0:t}function Vt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const ut=new Map,lt=new Map;function Cl(t,e){return e?t>=vt?!0:null:!1}function us(t){return ut.get(t)}function wl(t,e){ut.set(t,e)}function kl(t,e,n){const r=ut.get(t);if(r!==void 0){n(r);return}let o=lt.get(t);o||(o=ln(e).then(i=>(ut.set(t,i),lt.delete(t),i)).catch(()=>(lt.delete(t),Promise.reject(new Error("group probe failed")))),lt.set(t,o)),o.then(n,()=>n(!1))}function ms(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===vt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Il(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Vt(l,n,r,o)&&i++;return i}function an(t,e,n,r){const o=N.c(8),{org:i}=ue(),l=bl(i.id,t,e,n);let a;o[0]!==n?(a=jl(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=A.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=dr(),{threads:f,hasMore:p}=$s(),x=r??Ct(f,t,e,n),h=Nl(x,p),g=Cl(x,p),b=Gs();if(d.identity===l&&d.serverHasMore===null){const _=g??us(l);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&us(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),kl(l,async()=>{const _=cs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:O}=ms(I),T=Ct(m.threads.get(),t,e,n);return O===void 0?!1:ds(T,O)},_=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:_})}));const S=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(O=>O.identity===I?{...O,isFetching:!0}:O);try{const O=Ct(f,t,e,n),T=cs(t,e,O,n,vt),z=await ln(()=>b.call("COLLECTION_THREADS_LIST",T)),{items:$,hasMore:k,totalCount:R}=ms(z),U=new Set(f.map(Tl)),G=Il($,U,t,e,n),D=O;m.mergeThreads($),u(E=>{if(E.identity!==I)return E;let M;return R!==void 0?M=ds(D+G,R):M=$.length===0||G===0?!1:k,wl(I,M),{...E,isFetching:!1,serverHasMore:M}})}catch(O){const T=O,z=T instanceof Error?T.message:String(T);we.error(`Could not load more tasks: ${z}`),u($=>$.identity===I?{...$,isFetching:!1}:$)}},y=d.isFetching||d.isProbing,C=!c&&!y&&_l(h,d.serverHasMore);let w;return o[2]!==y||o[3]!==S||o[4]!==C||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(w={hasMore:C,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:S},o[2]=y,o[3]=S,o[4]=C,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=w):w=o[7],w}function Tl(t){return t.id}function cn(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:p,sortable:x,groupVisibleCount:h}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=pt(n),S=r[0];let y;e[0]!==S||e[1]!==c||e[2]!==l||e[3]!==n?(y=()=>{S?l(S):c(n)},e[0]=S,e[1]=c,e[2]=l,e[3]=n,e[4]=y):y=e[4];const C=y,w=x?.isDragging?!1:void 0;let _;e[5]!==x?.isDragging||e[6]!==n?(_=X=>{x?.isDragging||X&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=x?.isDragging,e[6]=n,e[7]=_):_=e[7];const I=!!(S&&o&&S.id===o),O=x?"Drag to reorder":void 0;let T;e[8]!==x?(T=x?{...x.attributes,...x.listeners}:{},e[8]=x,e[9]=T):T=e[9];const z=x&&"cursor-pointer active:cursor-grabbing touch-none",$=x?.isDragging&&"cursor-grabbing";let k;e[10]!==$||e[11]!==z?(k=B("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",z,$),e[10]=$,e[11]=z,e[12]=k):k=e[12];const R=j?.icon??null,U=j?.title??"?";let G;e[13]!==R||e[14]!==U?(G=s.jsx(We,{icon:R,name:U,size:"sm+",className:"rounded-lg"}),e[13]=R,e[14]=U,e[15]=G):G=e[15];let D;e[16]!==C||e[17]!==k||e[18]!==G||e[19]!==I||e[20]!==O||e[21]!==T?(D=s.jsx(de,{children:s.jsx(Gt,{asChild:!0,children:s.jsx(pl,{asChild:!0,children:s.jsx(ye,{onClick:C,isActive:I,title:O,...T,className:k,children:G})})})}),e[16]=C,e[17]=k,e[18]=G,e[19]=I,e[20]=O,e[21]=T,e[22]=D):D=e[22];const E=p??Ol;let M;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==E||e[29]!==n?(M=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:E,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=E,e[29]=n,e[30]=M):M=e[30];let W;e[31]!==D||e[32]!==M?(W=s.jsxs(Lt,{children:[D,M]}),e[31]=D,e[32]=M,e[33]=W):W=e[33];const q=j?.title??"Agent";let K;e[34]!==q?(K=s.jsx("span",{className:"truncate",children:q}),e[34]=q,e[35]=K):K=e[35];let L;e[36]!==c||e[37]!==n?(L=()=>c(n),e[36]=c,e[37]=n,e[38]=L):L=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ge,{size:14}),e[39]=V):V=e[39];let H;e[40]!==L?(H=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:L,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:V}),e[40]=L,e[41]=H):H=e[41];let Y;e[42]!==K||e[43]!==H?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[K,H]}),e[42]=K,e[43]=H,e[44]=Y):Y=e[44];let te;e[45]!==o||e[46]!==i||e[47]!==h||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(te=s.jsx(Al,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:h,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=h,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=te):te=e[52];let Q;e[53]!==Y||e[54]!==te?(Q=s.jsxs(gl,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,te]}),e[53]=Y,e[54]=te,e[55]=Q):Q=e[55];let se;return e[56]!==W||e[57]!==Q||e[58]!==w||e[59]!==_?(se=s.jsxs(hl,{open:w,openDelay:120,closeDelay:150,onOpenChange:_,children:[W,Q]}),e[56]=W,e[57]=Q,e[58]=w,e[59]=_,e[60]=se):se=e[60],se}function Ol(){}function Al(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=an("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Bt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Kt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function $l(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Fr},a[1]=u):u=a[1];const m=Dr(Zt(Er,d),Zt(Rr,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=jr(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const p=f;let x;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==p||a[12]!==c?(x=b=>{const{active:j,over:S}=b;if(!S||j.id===S.id)return;const y=String(j.id),C=String(S.id);if(!vr(y,C,o))return;const w=Sr(p,y,C),_=yr(e,n,o,w);e==="org"?Nr(n.orgId,_):_r(n,_),J("sidebar_group_reordered",{virtual_mcp_id:y,over_virtual_mcp_id:C,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=p,a[12]=c,a[13]=x):x=a[13];const h=x;let g;return a[14]!==h||a[15]!==m||a[16]!==p?(g={sensors:m,sortableIds:p,handleDragEnd:h},a[14]=h,a[15]=m,a[16]=p,a[17]=g):g=a[17],g}function Pl(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function zl(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ur(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const p={transform:qr.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:p,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function fs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:p,handleDragEnd:x}=$l(r,n,o,i,l,a,c);if(r.length===0)return null;const h=p;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==p){let S;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==p?(S=y=>{const C=d(y);return p.includes(y.virtualMcpId)?s.jsx(zl,{id:y.virtualMcpId,children:w=>{const{setNodeRef:_,style:I,isDragging:O,attributes:T,listeners:z}=w;return s.jsx("div",{ref:_,style:I,className:B(O&&"opacity-50"),children:u(C,{attributes:T,listeners:z,isDragging:O})})}},y.virtualMcpId):s.jsx("div",{children:m(C)},y.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=p,e[10]=S):S=e[10],g=r.map(S),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=p,e[5]=g}else g=e[5];let b;e[11]!==h||e[12]!==g?(b=s.jsx(Gr,{items:h,strategy:Hr,children:g}),e[11]=h,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==x||e[15]!==f||e[16]!==b?(j=s.jsx(Lr,{sensors:f,collisionDetection:Br,onDragEnd:x,children:b}),e[14]=x,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function dn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:p,orgPinned:x,user:h,toolCallRuns:g}=Cr(n,o,i),b=x.length>0&&h.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const S=j;let y;e[20]!==c||e[21]!==b?(y=b&&s.jsx(Pl,{collapsed:c}),e[20]=c,e[21]=b,e[22]=y):y=e[22],f=s.jsxs(s.Fragment,{children:[p&&m(d(p)),s.jsx(fs,{section:"org",groups:x,...S}),y,s.jsx(fs,{section:"user",groups:h,...S}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function Ml(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(dn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Rl,renderSortable:Dl}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function Dl(t,e){return s.jsx(cn,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Rl(t){return s.jsx(cn,{...t},t.virtualMcpId)}function un(t){const e=N.c(41),{virtualMcpId:n,isActive:r,threadCount:o,onOpen:i,onNewTask:l,onShowSettings:a,onHideGroup:c,isOrgPinned:d,canManageOrgPin:u,onToggleOrgPin:m,sortable:f}=t,p=d===void 0?!1:d,x=u===void 0?!1:u,h=pt(n),g=f?.isDragging??!1,b=h?.title??"Agent";let j;e[0]!==f?(j=f?{...f.attributes,...f.listeners}:{},e[0]=f,e[1]=j):j=e[1];let S;e[2]!==i||e[3]!==n?(S=()=>i(n),e[2]=i,e[3]=n,e[4]=S):S=e[4];let y;e[5]!==i||e[6]!==f?.listeners||e[7]!==n?(y=M=>{f?.listeners?.onKeyDown?.(M),!M.defaultPrevented&&M.target===M.currentTarget&&M.key==="Enter"&&(M.preventDefault(),i(n))},e[5]=i,e[6]=f?.listeners,e[7]=n,e[8]=y):y=e[8];const C=f&&"touch-none active:cursor-grabbing",w=r?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/60",_=g&&"shadow-md bg-accent/40 cursor-grabbing";let I;e[9]!==C||e[10]!==w||e[11]!==_?(I=B("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium transition-colors","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",C,w,_),e[9]=C,e[10]=w,e[11]=_,e[12]=I):I=e[12];const O=h?.icon??null;let T;e[13]!==O||e[14]!==b?(T=s.jsx(We,{icon:O,name:b,size:"2xs"}),e[13]=O,e[14]=b,e[15]=T):T=e[15];let z;e[16]!==b?(z=s.jsx("span",{className:"flex-1 truncate",children:b}),e[16]=b,e[17]=z):z=e[17];let $;e[18]!==o?($=typeof o=="number"&&o>0&&s.jsx("span",{className:"shrink-0 size-7 flex items-center justify-center text-xs text-muted-foreground tabular-nums",children:o}),e[18]=o,e[19]=$):$=e[19];let k;e[20]!==T||e[21]!==z||e[22]!==$||e[23]!==j||e[24]!==S||e[25]!==y||e[26]!==I?(k=s.jsxs("div",{...j,role:"button",tabIndex:0,onClick:S,onKeyDown:y,className:I,children:[T,z,$]}),e[20]=T,e[21]=z,e[22]=$,e[23]=j,e[24]=S,e[25]=y,e[26]=I,e[27]=k):k=e[27];const R=k;let U;e[28]!==R?(U=s.jsx(Gt,{asChild:!0,children:R}),e[28]=R,e[29]=U):U=e[29];const G=m??El;let D;e[30]!==x||e[31]!==p||e[32]!==c||e[33]!==l||e[34]!==a||e[35]!==G||e[36]!==n?(D=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:x,onNewTaskInGroup:l,onShowSettings:a,onToggleOrgPin:G,onHideGroup:c})}),e[30]=x,e[31]=p,e[32]=c,e[33]=l,e[34]=a,e[35]=G,e[36]=n,e[37]=D):D=e[37];let E;return e[38]!==U||e[39]!==D?(E=s.jsxs(Lt,{children:[U,D]}),e[38]=U,e[39]=D,e[40]=E):E=e[40],E}function El(){}function xs(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(dn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Gl,renderSortable:Fl}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function Fl(t,e){return s.jsx(un,{...t,sortable:e},t.virtualMcpId)}function Gl(t){return s.jsx(un,{...t},t.virtualMcpId)}function Hl(t){const e=N.c(29),{virtualMcpId:n,isActive:r,onOpen:o}=t,i=pt(n),l=i?.title??"Agent";let a;e[0]!==o||e[1]!==n?(a=()=>o(n),e[0]=o,e[1]=n,e[2]=a):a=e[2];const c=r?"bg-accent":"hover:bg-accent/60";let d;e[3]!==c?(d=B("flex items-center justify-center p-1 rounded-md transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",c),e[3]=c,e[4]=d):d=e[4];const u=i?.icon??null;let m;e[5]!==u||e[6]!==l?(m=s.jsx(We,{icon:u,name:l,size:"xs"}),e[5]=u,e[6]=l,e[7]=m):m=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==l?(f=s.jsx(Gt,{asChild:!0,children:s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":l,onClick:a,className:d,children:m})})}),e[8]=a,e[9]=d,e[10]=m,e[11]=l,e[12]=f):f=e[12];const p=t.isOrgPinned??!1,x=t.canManageOrgPin??!1,h=t.onToggleOrgPin??Ll;let g;e[13]!==t.onHideGroup||e[14]!==t.onNewTask||e[15]!==t.onShowSettings||e[16]!==p||e[17]!==x||e[18]!==h||e[19]!==n?(g=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:x,onNewTaskInGroup:t.onNewTask,onShowSettings:t.onShowSettings,onToggleOrgPin:h,onHideGroup:t.onHideGroup})}),e[13]=t.onHideGroup,e[14]=t.onNewTask,e[15]=t.onShowSettings,e[16]=p,e[17]=x,e[18]=h,e[19]=n,e[20]=g):g=e[20];let b;e[21]!==f||e[22]!==g?(b=s.jsxs(Lt,{children:[f,g]}),e[21]=f,e[22]=g,e[23]=b):b=e[23];let j;e[24]!==l?(j=s.jsx(Oe,{side:"right",children:l}),e[24]=l,e[25]=j):j=e[25];let S;return e[26]!==b||e[27]!==j?(S=s.jsxs(Ae,{children:[b,j]}),e[26]=b,e[27]=j,e[28]=S):S=e[28],S}function Ll(){}function Bl(t){const e=N.c(7),{groups:n,renderGroup:r}=t;let o;if(e[0]!==n||e[1]!==r){let l;e[3]!==r?(l=a=>{const c=r(a);return s.jsx(Hl,{...c},c.virtualMcpId)},e[3]=r,e[4]=l):l=e[4],o=n.map(l),e[0]=n,e[1]=r,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=s.jsx(kt,{delayDuration:300,children:s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(1.75rem,1fr))] gap-1 px-2 py-0.5",children:o})}),e[5]=o,e[6]=i):i=e[6],i}const Ul="sidebar.group.expanded.";function ql(t,e){const n=N.c(3),[r,o]=tt(`${Ul}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Wl(t){const e=N.c(18),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=an("status",n,a),[p,x]=A.useState(!1);!p&&r.length===0&&f===!0&&!c&&!d&&(x(!0),queueMicrotask(()=>{u()}));let h;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==r){let j;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(j=S=>s.jsx(Bt,{task:S,isActive:o===S.id,onClick:()=>i(S),onArchive:S.created_by===a.currentUserId?()=>l(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=j):j=e[10],h=r.map(j),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=r,e[5]=h}else h=e[5];let g;e[11]!==m||e[12]!==c||e[13]!==u?(g=(m||c)&&s.jsx(Kt,{onClick:()=>{u()},isFetching:c,indented:!0}),e[11]=m,e[12]=c,e[13]=u,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function Kl(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=Xo[n],d=c.icon,[u,m]=ql(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const p=f;let x;e[3]!==p?(x=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p())},e[3]=p,e[4]=x):x=e[4];let h;e[5]!==d||e[6]!==c.iconClassName?(h=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]=h):h=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Hs,{size:14}):s.jsx(Ft,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,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 S;e[15]!==r.length?(S=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]=S):S=e[16];let y;e[17]!==u||e[18]!==p||e[19]!==x||e[20]!==b||e[21]!==j||e[22]!==S?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:p,onKeyDown:x,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,S]}),e[17]=u,e[18]=p,e[19]=x,e[20]=b,e[21]=j,e[22]=S,e[23]=y):y=e[23];let C;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Wl,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=C):C=e[31];let w;return e[32]!==y||e[33]!==C?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,C]}),e[32]=y,e[33]=C,e[34]=w):w=e[34],w}function hs(t){const e=N.c(31),{threads:n,groupBy:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:u}=t;if(r==="status"){let x;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==n){let g;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(g=b=>s.jsx(Kl,{status:b.status,threads:b.threads,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a},b.status),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=g):g=e[10],x=wr(n).map(g),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=n,e[5]=x}else x=e[5];let h;return e[11]!==x?(h=s.jsx(s.Fragment,{children:x}),e[11]=x,e[12]=h):h=e[12],h}let m;if(e[13]!==o||e[14]!==a||e[15]!==l||e[16]!==i||e[17]!==n){let x;e[19]!==o||e[20]!==a||e[21]!==l||e[22]!==i?(x=h=>s.jsx(Bt,{task:h,isActive:o===h.id,onClick:()=>i(h),onArchive:h.created_by===a.currentUserId?()=>l(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[19]=o,e[20]=a,e[21]=l,e[22]=i,e[23]=x):x=e[23],m=n.map(x),e[13]=o,e[14]=a,e[15]=l,e[16]=i,e[17]=n,e[18]=m}else m=e[18];let f;e[24]!==c||e[25]!==d||e[26]!==u?(f=(c||d)&&s.jsx(Kt,{onClick:u,isFetching:d}),e[24]=c,e[25]=d,e[26]=u,e[27]=f):f=e[27];let p;return e[28]!==m||e[29]!==f?(p=s.jsxs(s.Fragment,{children:[m,f]}),e[28]=m,e[29]=f,e[30]=p):p=e[30],p}function Vl(t){const e=N.c(19),{label:n,open:r,onToggle:o,count:i,action:l,actionSlot:a,controlsId:c}=t;let d;e[0]!==r?(d=r?s.jsx(Hs,{size:12,className:"shrink-0"}):s.jsx(Ft,{size:12,className:"shrink-0"}),e[0]=r,e[1]=d):d=e[1];let u;e[2]!==n?(u=s.jsx("span",{className:"truncate",children:n}),e[2]=n,e[3]=u):u=e[3];let m;e[4]!==i?(m=typeof i=="number"&&i>0&&s.jsx("span",{className:"tabular-nums text-muted-foreground/60",children:i}),e[4]=i,e[5]=m):m=e[5];let f;e[6]!==c||e[7]!==o||e[8]!==r||e[9]!==d||e[10]!==u||e[11]!==m?(f=s.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:o,className:"flex flex-1 min-w-0 items-center gap-1 text-sm font-medium text-muted-foreground/80 hover:text-foreground transition-colors focus-visible:outline-none",children:[d,u,m]}),e[6]=c,e[7]=o,e[8]=r,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let p;e[13]!==l?(p=l&&s.jsxs("button",{type:"button",onClick:l.onClick,className:"shrink-0 flex items-center gap-0.5 text-sm font-medium text-muted-foreground/60 hover:text-foreground opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100 transition-opacity focus-visible:outline-none",children:[l.label,l.icon]}),e[13]=l,e[14]=p):p=e[14];let x;return e[15]!==a||e[16]!==f||e[17]!==p?(x=s.jsxs("div",{className:"group/section flex items-center gap-1 px-2 pt-1 pb-0.5",children:[f,p,a]}),e[15]=a,e[16]=f,e[17]=p,e[18]=x):x=e[18],x}function Yl(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Xl(t,e,n,r,o){const i=N.c(5),l=Yl(t,e,r,o),[a,c]=A.useState("");a!==l&&(kr(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=Ir(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const ps={all:"All tasks",manual:"Chats",automation:"Automation"};function mn({onNavigate:t}={}){const{data:e}=Se.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=ue(),i=Yn({connectionId:Xn,orgId:o.id,orgSlug:o.slug}),l=Qn(o.id).id,a=Ts(),{liveToDev:c,devToLive:d}=Wr(a),u=zs(a),m=nl(),f=Jn(),[p,x]=A.useState({}),h=new Set(u),g={},b=[];for(const[v,P]of Object.entries(p))h.has(v)!==P?g[v]=P:b.push(v);b.length>0&&x(v=>{const P={...v};for(const F of b)delete P[F];return P});const j=(()=>{const v=new Set(u);for(const[P,F]of Object.entries(g))F?v.add(P):v.delete(P);return[...v]})(),S=new Set(j),{threads:y,hasMore:C,isFetchingMore:w,fetchNextPage:_}=$s(),I=y.filter(v=>!v.hidden),{hide:O}=As(),T=He(),z=Tr(),{setTaskId:$,createNewTask:k}=Ps(),R=js({strict:!1}),U=Mo({select:v=>v.location.pathname}),G=U===`/${o.slug}`||U===`/${o.slug}/`,D=R.taskId??null,E=y.find(v=>v.id===D)?.virtual_mcp_id??null,M=()=>{t?.()},W=[...I].sort((v,P)=>(P.updated_at??"").localeCompare(v.updated_at??"")),[q,K]=A.useState("all"),[L,V]=A.useState("flat"),[H,Y]=A.useState(!0),[te,Q]=tt("sidebar-agents-view","list"),[se,X]=tt("sidebar-threads-scope-all",!1),[Z,ne]=A.useState(!1),[re,me]=A.useState(!1),[ee,fe]=A.useState(0),$e=Or(),Ke=ee+$e,ae={orgId:o.id,userId:r},Ne={type:q,member:"mine",currentUserId:n??null},he=yl(W,"agent",Ne),Pe=Xl(ae,Ar($r(W,l),d),l,j,Ke),Ze=new Set(a.map(v=>v.id).filter(v=>!!v)),pe=Pe.filter(v=>v.virtualMcpId===l||v.virtualMcpId===yt||Ze.has(v.virtualMcpId)),ie=pe.filter(v=>v.virtualMcpId!==yt),ge=v=>n?v.filter(P=>P.created_by===n):[],xe=v=>q==="automation"?v.filter(P=>!!P.trigger_id):q==="manual"?v.filter(P=>!P.trigger_id):v,be=ge(W),ze=xe(be),Me=xe(W),Ve=se?Me:ze,je=v=>{if(n&&v.created_by&&v.created_by!==n)return;const P=v.id===D;if(O(v.id),!P)return;const F=be.find(Fe=>Fe.id!==v.id&&Fe.virtual_mcp_id===v.virtual_mcp_id);M(),F?$(F.id,F.virtual_mcp_id):T({to:"/$org",params:{org:o.slug}})},Be=v=>{M(),$(v.id,v.virtual_mcp_id)},_e=v=>{J("sidebar_group_new_clicked",{virtual_mcp_id:v}),M(),k(v)},De=async()=>{const v=E??l;J("sidebar_new_thread_clicked",{virtual_mcp_id:v});const P=be.find(F=>F.virtual_mcp_id===v&&F.title==="New chat");if(P){let F=!1;try{const Fe=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P.id,limit:1,offset:0}});F=((Fe.structuredContent??Fe).items?.length??0)===0}catch{}if(F){M(),$(P.id,v);return}}M(),k(v)},Re=v=>{if(v===l){M(),T({to:"/$org",params:{org:o.slug}});return}J("sidebar_agent_opened",{virtual_mcp_id:v}),M(),z(v)},Ue=v=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:v}),M(),z(v,{search:{main:"instructions"}})},Ce=v=>{if(S.has(v))return;J("sidebar_group_hide_clicked",{virtual_mcp_id:v});const P=pe.find(F=>F.virtualMcpId===v);if(P)for(const F of P.threads)O(F.id);Pr(ae,v,j),fe(F=>F+1)},Ee=async(v,P)=>{if(m&&g[v]===void 0){J("sidebar_group_org_pin_toggled",{virtual_mcp_id:v,pinned:P}),x(F=>({...F,[v]:P}));try{await f.update.mutateAsync({id:v,data:{pinned:P}})}catch{zr(ae,v,!P),x(F=>{const Fe={...F};return delete Fe[v],Fe})}}},qe=v=>{const P=v===l||v===yt;return{isOrgPinned:P||S.has(v),canManageOrgPin:P?!1:m,onToggleOrgPin:P?void 0:Ee}},ce=v=>({virtualMcpId:v.virtualMcpId,isActive:v.virtualMcpId===l?G:E===v.virtualMcpId,threadCount:he.get(v.virtualMcpId)??0,onOpen:Re,onNewTask:_e,onShowSettings:Ue,onHideGroup:Ce,...qe(v.virtualMcpId)}),Ye=v=>{const P=xe(ge(v.threads)),F=c.get(v.virtualMcpId)??null;return{virtualMcpId:v.virtualMcpId,threads:P,devPartnerId:F,devGroupVisibleCount:F?he.get(F)??0:0,activeTaskId:D,filters:Ne,groupVisibleCount:he.get(v.virtualMcpId)??0,onSelectTask:Be,onArchiveTask:je,onNewTaskInGroup:_e,onShowSettings:Ue,onHideGroup:Ce,...qe(v.virtualMcpId)}},Xe=q!=="all",{state:St,isMobile:nt}=Le();if(St==="collapsed"&&!nt){const v=pe.filter(P=>{const F=xe(ge(P.threads));return!(Xe&&F.length===0)});return s.jsxs(s.Fragment,{children:[s.jsx(Nt,{value:ie.length===0}),s.jsx(Ie,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(Ml,{groups:v,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(P=>P+1),renderGroup:P=>Ye(P)})})]})}const xn=s.jsx("button",{type:"button",onClick:()=>X(v=>!v),className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:se?"All":"Mine"}),Xt=v=>s.jsxs("div",{className:B("shrink-0 px-1 flex items-center justify-between",v?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(le,{"aria-label":"Search threads",onClick:()=>{J("tasks_panel_search_opened"),me(!0),ne(!0)},children:s.jsx(rr,{size:16})}),s.jsx(le,{"aria-label":L==="flat"?"Group by status":"Show as flat list",title:L==="flat"?"Flat list":"Grouped by status",onClick:()=>{const P=L==="flat"?"status":"flat";J("tasks_panel_group_by_changed",{to_value:P}),V(P)},children:L==="flat"?s.jsx(or,{size:16}):s.jsx(ir,{size:16})}),!v&&s.jsxs(xt,{children:[s.jsx(Je,{asChild:!0,children:s.jsxs(le,{"aria-label":"Filter tasks",children:[s.jsx(ko,{size:16}),Xe&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"})]})}),s.jsx(ht,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsx("div",{className:"flex flex-col gap-2",children:s.jsx(Ql,{label:"Type",children:s.jsxs(Oo,{value:q,onValueChange:P=>{const F=P;F!==q&&J("tasks_panel_filter_changed",{to_value:F}),K(F)},children:[s.jsx(Ao,{size:"sm",className:"w-full",children:s.jsx($o,{})}),s.jsx(Po,{children:Object.keys(ps).map(P=>s.jsx(zo,{value:P,children:ps[P]},P))})]})})})})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[xn,s.jsx(le,{"aria-label":"New thread",title:"New thread",onClick:()=>{De()},children:s.jsx(lr,{size:16})})]})]});return nt?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(Nt,{value:ie.length===0}),Xt(!0),s.jsxs(Qo,{defaultValue:"threads",variant:"pill",className:"flex flex-col flex-1 min-h-0 gap-0",children:[s.jsxs(Jo,{variant:"pill",className:"shrink-0 mx-1 mb-2 w-[calc(100%-0.5rem)]",children:[s.jsx(ns,{variant:"pill",value:"threads",children:"Threads"}),s.jsx(ns,{variant:"pill",value:"agents",children:"Agents"})]}),s.jsx(rs,{value:"threads",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(it,{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(hs,{threads:Ve,groupBy:L,activeTaskId:D,onSelectTask:Be,onArchiveTask:je,filters:Ne,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})})}),s.jsx(rs,{value:"agents",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(it,{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(xs,{groups:ie,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(v=>v+1),renderGroup:ce})})})]}),re&&s.jsx(as,{open:Z,onOpenChange:ne})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(Nt,{value:ie.length===0}),Xt(!1),s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:[s.jsx(it,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(hs,{threads:Ve,groupBy:L,activeTaskId:D,onSelectTask:Be,onArchiveTask:je,filters:Ne,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})}),s.jsx("div",{className:"shrink-0 mx-2 my-2 border-b"}),s.jsxs("div",{className:B("flex flex-col min-h-0",H?"basis-[35%] shrink-0":"shrink-0"),children:[s.jsx(Vl,{label:"Agents",open:H,onToggle:()=>Y(v=>!v),count:ie.length,controlsId:"sidebar-section-agents",actionSlot:s.jsxs(s.Fragment,{children:[H&&s.jsx(le,{"aria-label":te==="list"?"Switch to grid view":"Switch to list view",title:te==="list"?"Grid view":"List view",onClick:()=>Q(v=>v==="list"?"grid":"list"),children:te==="list"?s.jsx(Io,{className:"size-4"}):s.jsx(To,{className:"size-4"})}),s.jsx(Ls,{compact:!0})]})}),s.jsx("div",{id:"sidebar-section-agents","aria-hidden":!H,className:"grid min-h-0 transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:H?"1fr":"0fr"},children:s.jsx("div",{className:"overflow-hidden min-h-0",children:s.jsx(it,{wrapperClassName:"h-full min-h-0",className:"flex flex-col gap-0.5 h-full overflow-y-auto overscroll-contain",children:te==="grid"?s.jsx(Bl,{groups:ie,renderGroup:ce}):s.jsx(xs,{groups:ie,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(v=>v+1),renderGroup:ce})})})})]})]}),re&&s.jsx(as,{open:Z,onOpenChange:ne})]})}function Ql(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Jl=5,Zl=[{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 fn(){const t=N.c(3),{state:e}=Le();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Jl}).map(sa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ve,{className:"size-6 rounded-md"}),s.jsx(ve,{className:"size-6 rounded-md"}),s.jsx(ve,{className:"size-6 rounded-md"})]}),s.jsx(ve,{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:Zl.map(ea)})]}),t[2]=r):r=t[2],r}function ea(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(ve,{className:"size-5 rounded-full shrink-0"}),s.jsx(ve,{className:B("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(ta)})]},e)}function ta(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(ve,{className:"h-3 flex-1 rounded-sm"})},e)}function sa(t,e){return s.jsx(ve,{className:"size-10 rounded-lg mx-auto"},e)}function na(){const t=N.c(4),e=Bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ji,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ys,{children:s.jsx(A.Suspense,{fallback:s.jsx(fn,{}),children:s.jsx(mn,{})})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Ms,{children:s.jsx(Ws,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function ra(t){const e=N.c(8),{onClose:n}=t,r=Bs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Zi,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fn,{}),e[1]=i):i=e[1];let l;e[2]!==n?(l=s.jsx(ys,{children:s.jsx(A.Suspense,{fallback:i,children:s.jsx(mn,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==l?(a=s.jsx(Ms,{children:s.jsx(vi,{sections:r,onClose:n,footer:o,additionalContent:l})}),e[4]=n,e[5]=r,e[6]=l,e[7]=a):a=e[7],a}const oa="sidebar.open";function ia(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Yo,{}),t[0]=e):e=t[0],e}function pd(){const t=N.c(24),e=Mt(),[n,r]=tt(oa,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=si();let c;t[0]!==e?(c=e?s.jsxs(oe.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(oe.LogoLink,{}),s.jsx(ts,{}),s.jsx(At,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(oe.TogglesSlot,{}),s.jsx(oe.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(oe.CenterSlot,{}),s.jsx(oe.RightSlot,{})]}):s.jsxs(oe.Header,{children:[s.jsxs(oe.LeftColumn,{children:[s.jsx(oe.LogoLink,{}),s.jsx(ts,{}),s.jsx(oe.TogglesSlot,{})]}),s.jsx(oe.CenterSlot,{}),s.jsxs(oe.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(oe.TabsSlot,{})}),s.jsx(oe.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(na,{}),s.jsx(Zo,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},t[8]=p):p=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Un,{className:"flex flex-col",style:p,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(A.Suspense,{fallback:s.jsx(ia,{}),children:s.jsx(Hn,{})})})})}),t[9]=x):x=t[9];let h;t[10]!==m||t[11]!==f||t[12]!==i?(h=s.jsxs(qn,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,x]}),t[10]=m,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(Do,{renderSidebar:la}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==h||t[18]!==g?(b=s.jsx(So,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,h,g]})}),t[16]=c,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(ur,{children:s.jsx(oe.Provider,{children:s.jsx(Wn,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function la(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(ra,{onClose:e})})})}export{pd as default};
|
|
1
|
+
import{c as N,j as s,C as tt,r as A,l as B,i as gs,v as J,D as ue,a as Se,F as bs,K as Pt,k as zt,b as He,e as js,u as hn,G as pn,H as gn,o as bn,s as jn,n as vn,p as Sn,d as yn,B as Qe,I as Nn,J as _n,t as we,M as Cn,P as wn,x as kn,m as In,y as Tn,R as On,T as An,U as $n,V as ke,W as vs,X as Pn,Y as Ss,Z as zn,_ as Mn,$ as Dn,a0 as Rn,a1 as En,a2 as Fn,a3 as Gn,E as ys,O as Hn}from"./index-ChoCV5RI.js";import{u as Le,S as de,a as ye,b as mt,c as ft,d as Ie,e as Ns,f as _s,g as Ln,h as Bn,i as wt,j as Un,k as qn,l as Wn}from"./sidebar-BXZd-GVd.js";import{u as Mt}from"./use-mobile-BzlsCeN5.js";import{T as le}from"./toolbar-icon-button-B27j_4W9.js";import{a as Te,b as Oe,T as Ae,c as kt}from"./tooltip-D0ODOH5L.js";import{S as ve}from"./skeleton-CgP3V6Ja.js";import{P as xt,a as Je,b as ht}from"./popover-CUdzevRE.js";import{D as Cs,a as ws,b as ks}from"./drawer-DPby2hn2.js";import{i as Is}from"./SearchMd-5ihP7yVQ.js";import{s as Kn}from"./Star01-BkFl7Mhr.js";import{s as Ge}from"./Plus-CqV2jOMI.js";import{i as Vn,u as Yn,S as Xn,a as Qn}from"./use-mcp-client-C9rZ5q5t.js";import{u as Ts,a as pt,b as Jn}from"./use-virtual-mcp-E-pwiiFM.js";import{u as Zn}from"./use-create-virtual-mcp-CMc5HT0P.js";import{I as er,u as tr,W as sr}from"./import-from-deco-dialog-CQrNEd18.js";import{A as We,a as Qt,b as Jt,c as Os,d as nr,i as rr,s as or,e as ir,f as lr}from"./agent-icon-CWPBFzIp.js";import{G as ar,a as cr}from"./github-repo-picker-DBhdsm3x.js";import{u as As,a as dr,b as $s,T as ur}from"./hooks-DnXDFfXX.js";import{r as mr,u as fr,R as xr,a as hr,b as Ps}from"./shell-layout-DG441JjL.js";import{u as pr,g as zs,a as gr,b as br,s as jr,c as vr,r as Sr,d as yr,e as Nr,f as _r,p as Cr,h as wr,i as kr,j as Ir,k as Tr,l as Or,m as Ar,n as $r,T as yt,S as Nt,o as Pr,q as zr,t as Ms}from"./use-navigate-to-agent-B4oyUjLa.js";import{g as Mr,u as Ds,A as Rs,a as Dr,b as Zt,K as Rr,P as Er,s as Fr,S as Gr,v as Hr,D as Lr,c as Br,d as Ur,C as qr,e as Wr}from"./sortable.esm-D9jMeHV1.js";import{i as Kr}from"./LayoutLeft-CuSrrdEU.js";import{A as It}from"./avatar-Dx8vsnte.js";import{i as Dt}from"./ChevronUp-BoULmO5v.js";import{a as es}from"./Eye-XrixTuLa.js";import{n as Vr,i as Yr}from"./Globe01-DA12A_gX.js";import{i as Xr}from"./ZoomOut-C0N4ehtv.js";import{i as Qr,a as Es}from"./ZapSquare-CfbyrH4x.js";import{i as Fs}from"./Monitor01-Cb1N7DaM.js";import{n as Jr,a as Zr}from"./Sun-Brrmn0Wt.js";import{a as st,b as eo,i as to}from"./Settings02-iYAu_otv.js";import{i as so}from"./Shield01-BzDwMZxQ.js";import{a as no}from"./Users03-DvCgevzn.js";import{s as Rt}from"./XClose-CtyL8bYf.js";import{A as ro,a as oo,b as io,c as lo,d as ao,e as co,f as uo}from"./alert-dialog-CNwxdflX.js";import{F as mo,a as fo,b as xo,c as ho,d as po,f as go,e as bo}from"./form-x1EJEVpQ.js";import{I as jo}from"./input-BWamIMbN.js";import{S as vo,C as So}from"./chat-context-BvVy1XII.js";import"./index-1C_mGQYK.js";import{n as Et}from"./Stars02-COayjfFf.js";import{u as yo,v as No,C as _o}from"./connect-desktop-dialog-DKo4CQJQ.js";import{u as Co,a as wo}from"./use-join-requests-DGz2R0VR.js";import{i as Ft}from"./ChevronRight-CTea8Vrz.js";import{i as ko}from"./FilterLines-JU5CW8t2.js";import{c as Io,i as To}from"./SwitchHorizontal01-dqeKRNpy.js";import{S as Oo,a as Ao,b as $o,c as Po,d as zo}from"./select-C-6PWfXp.js";import{u as Mo,S as ts,M as Do}from"./shell-controls-u_iHFGU5.js";import{c as Ro,a as Eo,b as Fo,d as Go,e as Ho}from"./dialog-DBpjZOCu.js";import{C as Lo,a as Bo,b as Uo,c as qo,d as Wo}from"./command-B1GcRSWc.js";import{u as Gs}from"./studio-tools-C9NKrR5C.js";import{i as Ko}from"./Zap-fhgO5dDS.js";import{u as Vo}from"./use-org-auth-client-BqLuGuER.js";import{C as rt,a as ss,b as Gt,c as Ht,d as Lt}from"./context-menu-DKP9RpkZ.js";import{T as Bt,S as Yo}from"./shell-route-loading-BpdXUJEZ.js";import{t as Hs}from"./ChevronDown-P5eS_rdB.js";import{S as Xo}from"./task-status-DEWrBULH.js";import{T as Qo,a as Jo,b as ns,c as rs}from"./tabs-T8F8VZUh.js";import{T as oe}from"./toolbar-BhxpIEsu.js";import"./sheet-B7Lez_S9.js";import"./X-DBy4i4Lp.js";import"./auth-DnBe9AUC.js";import"./use-collections-CRpuCmSx.js";import"./use-connection-homG8xHs.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-C001GdqX.js";import"./AlertCircle-CoC6NNi4.js";import"./Tool01-BWmMjNUF.js";import"./XCircle-IJc8zbrl.js";import"./ArrowUpRight-N57ebzBw.js";import"./CheckCircle-kHQ2dQaQ.js";import"./DotsVertical-pUzhcHbw.js";import"./Globe04-DNnzQTTy.js";import"./HardDrive-A9TGjU2B.js";import"./Key01-C3y_5bqB.js";import"./LinkExternal01-Cwj3iuhi.js";import"./Palette-B_aebYLe.js";import"./Play-DDWMuBvQ.js";import"./SearchLg-Dvo924kw.js";import"./Stars01-D1UrqdL4.js";import"./Trash01-66NrnGrm.js";import"./Upload01-DZiCAA30.js";import"./User01-BU4AVwNl.js";import"./Users01-rcwVvUtr.js";import"./checkbox-D_sfTX5R.js";import"./use-debounced-value-hi69DHr0.js";import"./authenticate-and-persist-oauth-u3Bd-L7u.js";import"./mcp-oauth-DCCT0QwD.js";import"./use-mcp-tools-BP-8Q6Ct.js";import"./extract-connection-data-CPBy2fVV.js";import"./decopilot-sse-pool-DCzhBR7p.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-CS_iMldS.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-DmBEnT-y.js";import"./use-org-sso-DNIk-jwi.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bx0N6sI4.js";import"./use-registry-connections-DLscAznw.js";import"./useInfiniteQuery-DRJEgKeg.js";import"./use-infinite-scroll-Cj4qMXbT.js";import"./card-go8Ic7Q5.js";import"./integration-icon-EdsPubVt.js";import"./collection-tabs-B_vVgFOt.js";import"./badge-BzEWqz_j.js";import"./textarea-BK_9gLq0.js";import"./connection-form-helpers-B8AytMOg.js";import"./useSuspenseInfiniteQuery-BYH-CQed.js";import"./use-ai-providers-DjRW0TN5.js";import"./label-BZcMuJ0q.js";import"./use-decopilot-events-2XegsErL.js";import"./use-capability-DbvoEB-N.js";import"./index-DjKzm_7S.js";import"./use-clock-tick-DicB8A5f.js";import"./differenceInSeconds-NQ4PDo0z.js";function Zo(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Le();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const Ut=240,ei=400,ti="sidebar.width";function et(t){return Math.max(Ut,Math.min(ei,t))}function si(){const t=N.c(11),[e,n]=tt(ti,ni),r=A.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=et(e),p=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const h=b=>{const j=et(f+(b.clientX-m));p?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=et(f+(b.clientX-m));n(j);for(const S of x)S.style.transition="";window.removeEventListener("pointermove",h),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",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(Ut)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=et(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function ni(t){return typeof t=="number"?et(t):Ut}function ri(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=B("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=B("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let p;e[4]!==a?(p=a?s.jsx(gs,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Is,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=p):p=e[5];let x;e[6]!==r?(x=j=>r(j.target.value),e[6]=r,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==x||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=x,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==p||e[16]!==h?(g=s.jsxs("label",{className:f,children:[p,h]}),e[14]=f,e[15]=p,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const oi="Select an existing agent";function ii(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Te,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:oi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ae,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function li(){const t=N.c(5),{enableDecoImport:e}=bs(),{data:n}=Se.useSession();let r;t[0]!==n?.user?.email?(r=Pt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:ai,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=zt(i);return l?.isDecoUser??!1}async function ai(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function ci(t){const e=He(),{create:n}=As(),{locator:r}=ue(),o=js({strict:!1}),i=hn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?mr(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function di(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(We,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function ui(t){const e=N.c(56),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=A.useState(""),a=Ts(),c=a??[],{org:d}=ue(),{data:u}=Se.useSession(),m=u?.user?.id??"anon",f=zs(a),p=gr();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={navigateOnCreate:!0},e[0]=x):x=e[0];const{createVirtualMCP:h,isCreating:g}=Zn(x),{createFromTemplate:b,isCreating:j}=tr(),S=li(),y=ci(d.slug),C=Mr(a),w=i.toLowerCase(),_=c.filter(mi).filter(ee=>!C.has(ee.id)).filter(ee=>!i||ee.title.toLowerCase().includes(w)),I=ee=>{br({orgId:d.id,userId:m},ee.id,f),p(),n(),l(""),y(ee.id)},O="flex flex-col max-h-[min(640px,80dvh)]";let T;e[1]!==i?(T=s.jsx(ri,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=T):T=e[2];const z="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let $;e[3]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=$):$=e[3];const k="grid grid-cols-3 gap-1";let R;e[4]!==h||e[5]!==n?(R=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await h(),n()},e[4]=h,e[5]=n,e[6]=R):R=e[6];let U,G;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=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(Ge,{size:16,className:"text-muted-foreground"})}),G=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=U,e[8]=G):(U=e[7],G=e[8]);let D;e[9]!==g||e[10]!==R?(D=s.jsxs("button",{type:"button",disabled:g,onClick:R,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:[U,G]}),e[9]=g,e[10]=R,e[11]=D):D=e[11];let E;e[12]!==b||e[13]!==n?(E=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(sr),n()},e[12]=b,e[13]=n,e[14]=E):E=e[14];let M,W;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=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(Kn,{className:"size-5 text-muted-foreground"})}),W=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=M,e[16]=W):(M=e[15],W=e[16]);let q;e[17]!==j||e[18]!==E?(q=s.jsxs("button",{type:"button",disabled:j,onClick:E,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:[M,W]}),e[17]=j,e[18]=E,e[19]=q):q=e[19];let K;e[20]!==n||e[21]!==o?(K=()=>{J("agent_import_clicked",{source:"github"}),o(),n()},e[20]=n,e[21]=o,e[22]=K):K=e[22];let L,V;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=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(cr,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[23]=L,e[24]=V):(L=e[23],V=e[24]);let H;e[25]!==K?(H=s.jsxs("button",{type:"button",onClick:K,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[L,V]}),e[25]=K,e[26]=H):H=e[26];let Y;e[27]!==S||e[28]!==n||e[29]!==r?(Y=S&&s.jsxs("button",{type:"button",onClick:()=>{J("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[27]=S,e[28]=n,e[29]=r,e[30]=Y):Y=e[30];const te=_.map(ee=>s.jsx(di,{agent:ee,onClick:()=>I(ee)},ee.id));let Q;e[31]!==D||e[32]!==q||e[33]!==H||e[34]!==Y||e[35]!==te?(Q=s.jsxs("div",{className:k,children:[D,q,H,Y,te]}),e[31]=D,e[32]=q,e[33]=H,e[34]=Y,e[35]=te,e[36]=Q):Q=e[36];let se;e[37]!==g||e[38]!==i||e[39]!==_.length?(se=_.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[37]=g,e[38]=i,e[39]=_.length,e[40]=se):se=e[40];let X;e[41]!==Q||e[42]!==se||e[43]!==$?(X=s.jsxs("div",{className:z,children:[$,Q,se]}),e[41]=Q,e[42]=se,e[43]=$,e[44]=X):X=e[44];let Z;e[45]!==d.slug?(Z={org:d.slug},e[45]=d.slug,e[46]=Z):Z=e[46];let ne;e[47]!==n?(ne=()=>n(),e[47]=n,e[48]=ne):ne=e[48];let re;e[49]!==Z||e[50]!==ne?(re=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(pn,{to:"/$org/settings/agents",params:Z,onClick:ne,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[49]=Z,e[50]=ne,e[51]=re):re=e[51];let me;return e[52]!==X||e[53]!==re||e[54]!==T?(me=s.jsxs("div",{className:O,children:[T,X,re]}),e[52]=X,e[53]=re,e[54]=T,e[55]=me):me=e[55],me}function mi(t){return!Vn(t.id)}function Ls(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=A.useState(!1),[a,c]=A.useState(!1),[d,u]=A.useState(!1),m=Mt(),{setOpenMobile:f}=Le(),p=pr(),x=p?"border border-border":void 0;let h;e[2]!==p?(h=O=>p?s.jsx(ii,{children:O}):O,e[2]=p,e[3]=h):h=e[3];const g=h;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let S;e[7]!==j||e[8]!==i?(S=i&&s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ve,{className:"h-4 w-24"})}),children:s.jsx(ui,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=S):S=e[9];const y=S;let C;e[10]!==o||e[11]!==x||e[12]!==p||e[13]!==m||e[14]!==i||e[15]!==y||e[16]!==g?(C=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(le,{"aria-label":"Browse agents",className:B(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ge,{className:"size-4"})})):s.jsx(de,{children:g(s.jsxs(ye,{tooltip:p?void 0:"Browse agents",className:B(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ge,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Cs,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(ws,{className:"max-h-[85dvh] p-0",children:[s.jsx(ks,{className:"sr-only",children:"Browse agents"}),y]})})]}):s.jsxs(xt,{open:i,onOpenChange:O=>{O&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),l(O)},children:[o?g(s.jsx(Je,{asChild:!0,children:s.jsx(le,{"aria-label":"Browse agents",className:B(x),children:s.jsx(Ge,{className:"size-4"})})})):s.jsx(de,{children:g(s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:p?void 0:"Browse agents",className:B(x),children:[s.jsx(Ge,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(ht,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:y})]}),e[10]=o,e[11]=x,e[12]=p,e[13]=m,e[14]=i,e[15]=y,e[16]=g,e[17]=C):C=e[17];let w;e[18]!==a?(w=s.jsx(er,{open:a,onOpenChange:c}),e[18]=a,e[19]=w):w=e[19];let _;e[20]!==d?(_=s.jsx(ar,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let I;return e[22]!==C||e[23]!==w||e[24]!==_?(I=s.jsxs(s.Fragment,{children:[C,w,_]}),e[22]=C,e[23]=w,e[24]=_,e[25]=I):I=e[25],I}function Bs(){const t=N.c(3);ue();const{state:e,isMobile:n}=Le(),r=!n&&e==="collapsed";let o;if(t[0]!==r){if(o=[],r){let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={type:"custom",key:"new-task",content:s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:s.jsx(Ls,{})})})})},t[2]=i):i=t[2],o.push(i)}t[0]=r,t[1]=o}else o=t[1];return o}function Us(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(mt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ft,{children:s.jsx(Ie,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function qs(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Le();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{J("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=B(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ye,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(de,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function fi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ns,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(hi),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(Us,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(xi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function xi(t){return s.jsx(qs,{item:t},t.key)}function hi(t){return s.jsx(qs,{item:t},t.key)}function pi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=B("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(gi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(_s,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Ln,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function gi(t,e){return s.jsx(fi,{section:t},e)}function Ws(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(pi,{...t}),e[0]=t,e[1]=n):n=e[1],n}Ws.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(ve,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function bi(t){const e=N.c(16),{onToggle:n,className:r}=t,i=bs().logo??gn,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=B("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Kr,{size:16}),e[9]=f):f=e[9];let p;e[10]!==n?(p=s.jsx(le,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=p):p=e[11];let x;return e[12]!==c||e[13]!==m||e[14]!==p?(x=s.jsxs(Bn,{className:c,children:[m,p]}),e[12]=c,e[13]=m,e[14]=p,e[15]=x):x=e[15],x}function os(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=B(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ye,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(de,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function ji(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ns,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(os,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(Us,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(os,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ie,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function vi(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(A.Suspense,{fallback:l,children:s.jsx(bi,{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=(p,x)=>s.jsx(ji,{section:p,onClose:r},x),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(_s,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function Ks(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Si=bn({name:jn().min(2,"Organization name is required")});function yi(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:vn(Si),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Sn(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:_i,onSuccess:Ni},e[1]=l):l=e[1];const a=yn(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(io,{children:[s.jsx(lo,{children:"Create a new organization"}),s.jsx(ao,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=I=>a.mutateAsync(I),e[6]=a,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:I}=_;return s.jsxs(xo,{children:[s.jsx(ho,{children:"Organization Name"}),s.jsx(po,{children:s.jsx(jo,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(go,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Ks(I.value)]})]}),s.jsx(bo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(mo,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let p;e[13]!==c?(p=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=p):p=e[14];let x;e[15]!==a||e[16]!==i?(x=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=x):x=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==x?(h=s.jsx(ro,{disabled:i.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=x,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(vo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Qe,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let S;e[26]!==j||e[27]!==h?(S=s.jsxs(co,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=S):S=e[28];let y;e[29]!==S||e[30]!==u||e[31]!==f||e[32]!==p?(y=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,p,S]}),e[29]=S,e[30]=u,e[31]=f,e[32]=p,e[33]=y):y=e[33];let C;e[34]!==i||e[35]!==y?(C=s.jsxs(oo,{children:[d,s.jsx(fo,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=C):C=e[36];let w;return e[37]!==r||e[38]!==n||e[39]!==C?(w=s.jsx(uo,{open:n,onOpenChange:r,children:C}),e[37]=r,e[38]=n,e[39]=C,e[40]=w):w=e[40],w}function Ni(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function _i(t){const e=Ks(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Se.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 Tt(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 Ci(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=B(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Tt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function ot(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function is(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=kn();let l;e[0]!==n?(l=(k,R)=>k.slug===n?-1:R.slug===n?1:k.name.localeCompare(R.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=A.useState(!1),[u,m]=A.useState(""),f=u.toLowerCase(),p=f?a.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):a;let x;e[2]!==c?(x=function(){c&&m(""),d(wi)},e[2]=c,e[3]=x):x=e[3];const h=x;let g;e[4]!==u||e[5]!==c||e[6]!==h?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:k=>m(k.target.value),onKeyDown:k=>k.key==="Escape"&&h(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=h,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(Rt,{size:16}):s.jsx(Is,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==h?(j=s.jsx("button",{type:"button",onClick:h,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=h,e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ge,{size:16}),e[13]=S):S=e[13];let y;e[14]!==o?(y=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:S}),e[14]=o,e[15]=y):y=e[15];let C;e[16]!==j||e[17]!==y?(C=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,y]}),e[16]=j,e[17]=y,e[18]=C):C=e[18];let w;e[19]!==g||e[20]!==C?(w=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,C]}),e[19]=g,e[20]=C,e[21]=w):w=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=p.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let O;e[22]!==r||e[23]!==n?(O=k=>s.jsxs("button",{type:"button",onClick:()=>r(k.slug),className:B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Ci,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(Dt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=r,e[23]=n,e[24]=O):O=e[24];const T=p.map(O);let z;e[25]!==I||e[26]!==T?(z=s.jsxs("div",{className:_,children:[I,T]}),e[25]=I,e[26]=T,e[27]=z):z=e[27];let $;return e[28]!==z||e[29]!==w?($=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=$):$=e[30],$}function wi(t){return!t}function ls(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:p,open:x}=t;if(p){const X=n?.name??"U";let Z;e[0]!==X||e[1]!==r?(Z=s.jsx(It,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=Z):Z=e[2];const ne=n?.name??"User";let re;e[3]!==ne?(re=s.jsx("p",{className:"text-sm font-medium truncate",children:ne}),e[3]=ne,e[4]=re):re=e[4];const me=n?.email;let ee;e[5]!==me?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:me}),e[5]=me,e[6]=ee):ee=e[6];let fe;e[7]!==re||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[re,ee]}),e[7]=re,e[8]=ee,e[9]=fe):fe=e[9];let $e;e[10]!==n?($e=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oi)},e[10]=n,e[11]=$e):$e=e[11];let Ke;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ke=s.jsx(es,{size:14}),e[12]=Ke):Ke=e[12];let ae;e[13]!==$e?(ae=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:$e,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ke})}),e[13]=$e,e[14]=ae):ae=e[14];let Ne;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(Oe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ne):Ne=e[15];let he;e[16]!==ae?(he=s.jsx(kt,{delayDuration:300,children:s.jsxs(Ae,{children:[ae,Ne]})}),e[16]=ae,e[17]=he):he=e[17];let Pe;e[18]!==he||e[19]!==Z||e[20]!==fe?(Pe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Z,fe,he]}),e[18]=he,e[19]=Z,e[20]=fe,e[21]=Pe):Pe=e[21];const Ze=String(x);let pe;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==Ze?(pe=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(is,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Ze)}),e[22]=m,e[23]=u,e[24]=d,e[25]=Ze,e[26]=pe):pe=e[26];let ie;if(e[27]!==f||e[28]!==o){let ce;e[30]!==f?(ce=Ye=>s.jsx(ot,{item:Ye,onClose:f},Ye.key),e[30]=f,e[31]=ce):ce=e[31],ie=o.map(ce),e[27]=f,e[28]=o,e[29]=ie}else ie=e[29];let ge;e[32]!==f||e[33]!==i?(ge=s.jsx(ot,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=ge):ge=e[34];let xe;e[35]!==ie||e[36]!==ge?(xe=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ie,ge]}),e[35]=ie,e[36]=ge,e[37]=xe):xe=e[37];let be;e[38]!==pe||e[39]!==xe?(be=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[pe,xe]}),e[38]=pe,e[39]=xe,e[40]=be):be=e[40];let ze;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ce;e[45]!==a.theme||e[46]!==c?(ce=Ye=>{const{value:Xe,icon:St,label:nt}=Ye;return s.jsx("button",{type:"button","aria-label":nt,onClick:()=>c(Yt=>({...Yt,theme:Xe})),className:B("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:St},Xe)},e[45]=a.theme,e[46]=c,e[47]=ce):ce=e[47],ze=l.map(ce),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=ze}else ze=e[44];let Me;e[48]!==ze?(Me=s.jsx("div",{className:"flex items-center gap-0.5",children:ze}),e[48]=ze,e[49]=Me):Me=e[49];const Ve=a.enableSounds?"Disable sounds":"Enable sounds";let je;e[50]!==c?(je=()=>c(Ti),e[50]=c,e[51]=je):je=e[51];const Be=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let _e;e[52]!==Be?(_e=B("size-8 rounded-md flex items-center justify-center transition-colors",Be),e[52]=Be,e[53]=_e):_e=e[53];let De;e[54]!==a.enableSounds?(De=a.enableSounds?s.jsx(Qt,{size:14}):s.jsx(Jt,{size:14}),e[54]=a.enableSounds,e[55]=De):De=e[55];let Re;e[56]!==Ve||e[57]!==je||e[58]!==_e||e[59]!==De?(Re=s.jsx("button",{type:"button","aria-label":Ve,onClick:je,className:_e,children:De}),e[56]=Ve,e[57]=je,e[58]=_e,e[59]=De,e[60]=Re):Re=e[60];let Ue;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ue=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.12.2"]}),e[61]=Ue):Ue=e[61];let Ce;e[62]!==Re?(Ce=s.jsxs("div",{className:"flex items-center gap-2",children:[Re,Ue]}),e[62]=Re,e[63]=Ce):Ce=e[63];let Ee;e[64]!==Me||e[65]!==Ce?(Ee=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Me,Ce]}),e[64]=Me,e[65]=Ce,e[66]=Ee):Ee=e[66];let qe;return e[67]!==Pe||e[68]!==be||e[69]!==Ee?(qe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Pe,be,Ee]}),e[67]=Pe,e[68]=be,e[69]=Ee,e[70]=qe):qe=e[70],qe}const h=n?.name??"U";let g;e[71]!==h||e[72]!==r?(g=s.jsx(It,{url:r,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=h,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const S=n?.email;let y;e[76]!==S?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S}),e[76]=S,e[77]=y):y=e[77];let C;e[78]!==j||e[79]!==y?(C=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,y]}),e[78]=j,e[79]=y,e[80]=C):C=e[80];let w;e[81]!==n?(w=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ii)},e[81]=n,e[82]=w):w=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(es,{size:14}),e[83]=_):_=e[83];let I;e[84]!==w?(I=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:w,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=w,e[85]=I):I=e[85];let O;e[86]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Oe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=O):O=e[86];let T;e[87]!==I?(T=s.jsx(kt,{delayDuration:300,children:s.jsxs(Ae,{children:[I,O]})}),e[87]=I,e[88]=T):T=e[88];let z;e[89]!==T||e[90]!==g||e[91]!==C?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,C,T]}),e[89]=T,e[90]=g,e[91]=C,e[92]=z):z=e[92];let $;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=Z=>s.jsx(ot,{item:Z,onClose:f},Z.key),e[96]=f,e[97]=X):X=e[97],$=o.map(X),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let k;e[98]!==f||e[99]!==i?(k=s.jsx(ot,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=k):k=e[100];let R;e[101]!==$||e[102]!==k?(R=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,k]}),e[101]=$,e[102]=k,e[103]=R):R=e[103];let U;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=Z=>{const{value:ne,icon:re,label:me}=Z;return s.jsx("button",{type:"button","aria-label":me,onClick:()=>c(ee=>({...ee,theme:ne})),className:B("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ne?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:re},ne)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],U=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=U}else U=e[107];let G;e[111]!==U?(G=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[111]=U,e[112]=G):G=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[113]!==c?(E=()=>c(ki),e[113]=c,e[114]=E):E=e[114];const M=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let W;e[115]!==M?(W=B("size-7 rounded-md flex items-center justify-center transition-colors",M),e[115]=M,e[116]=W):W=e[116];let q;e[117]!==a.enableSounds?(q=a.enableSounds?s.jsx(Qt,{size:14}):s.jsx(Jt,{size:14}),e[117]=a.enableSounds,e[118]=q):q=e[118];let K;e[119]!==D||e[120]!==E||e[121]!==W||e[122]!==q?(K=s.jsx("button",{type:"button","aria-label":D,onClick:E,className:W,children:q}),e[119]=D,e[120]=E,e[121]=W,e[122]=q,e[123]=K):K=e[123];let L;e[124]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.12.2"]}),e[124]=L):L=e[124];let V;e[125]!==K?(V=s.jsxs("div",{className:"flex items-center gap-2",children:[K,L]}),e[125]=K,e[126]=V):V=e[126];let H;e[127]!==G||e[128]!==V?(H=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[G,V]}),e[127]=G,e[128]=V,e[129]=H):H=e[129];let Y;e[130]!==z||e[131]!==R||e[132]!==H?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,R,H]}),e[130]=z,e[131]=R,e[132]=H,e[133]=Y):Y=e[133];const te=String(x);let Q;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==te?(Q=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(is,{orgParam:d,onSelectOrg:u,onCreateOrg:m},te)}),e[134]=m,e[135]=u,e[136]=d,e[137]=te,e[138]=Q):Q=e[138];let se;return e[139]!==Y||e[140]!==Q?(se=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,Q]}),e[139]=Y,e[140]=Q,e[141]=se):se=e[141],se}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ii(){we.success("User ID copied")}function Ti(t){return{...t,enableSounds:!t.enableSounds}}function Oi(){we.success("User ID copied")}function Ot(){const t=N.c(44),{data:e}=Se.useSession(),{org:n}=ue(),r=He();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=Nn(o)?.params.org,[a,c]=_n(),d=Mt(),[u,m]=A.useState(!1),[f,p]=A.useState(!1),x=e?.user,h=x?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const S=j;let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(st,{size:16}),t[4]=y):y=t[4];let C;t[5]!==r||t[6]!==l?(C={key:"preferences",label:"Preferences",icon:y,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=C):C=t[7];let w;t[8]!==n||t[9]!==r?(w=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Vr,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=w):w=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(Xr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(so,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let O;t[13]===Symbol.for("react.memo_cache_sentinel")?(O={key:"github",label:"decocms/studio",icon:s.jsx(Cn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=O):O=t[13];let T;t[14]===Symbol.for("react.memo_cache_sentinel")?(T={key:"community",label:"Community",icon:s.jsx(no,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=T):T=t[14];let z;t[15]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:s.jsx(Yr,{size:16}),href:"https://decocms.com",external:!0},t[15]=z):z=t[15];let $;t[16]!==C||t[17]!==w?($=[C,...w,_,I,O,T,z],t[16]=C,t[17]=w,t[18]=$):$=t[18];const k=$;let R;t[19]===Symbol.for("react.memo_cache_sentinel")?(R={key:"logout",label:"Sign out",icon:s.jsx(Qr,{size:16}),onClick:$i},t[19]=R):R=t[19];const U=R;let G;t[20]===Symbol.for("react.memo_cache_sentinel")?(G={value:"light",icon:s.jsx(Jr,{size:14}),label:"Light theme"},t[20]=G):G=t[20];let D;t[21]===Symbol.for("react.memo_cache_sentinel")?(D={value:"dark",icon:s.jsx(Zr,{size:14}),label:"Dark theme"},t[21]=D):D=t[21];let E;t[22]===Symbol.for("react.memo_cache_sentinel")?(E=[G,D,{value:"system",icon:s.jsx(Fs,{size:14}),label:"System theme"}],t[22]=E):E=t[22];const M=E;let W;t[23]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{m(!1),p(!0)},t[23]=W):W=t[23];let q;t[24]!==b||t[25]!==d||t[26]!==k||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==x||t[32]!==h?(q={user:x,userImage:h,menuItems:k,signOutItem:U,themeOptions:M,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:W,close:S,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=k,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=x,t[32]=h,t[33]=q):q=t[33];const K=q;let L;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==K?(L=d?s.jsxs(Cs,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Tt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(ws,{className:"h-[80dvh] p-0",children:[s.jsx(ks,{className:"sr-only",children:"Account"}),s.jsx(ls,{...K})]})]}):s.jsxs(xt,{open:u,onOpenChange:m,children:[s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Tt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(ht,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Ai,children:s.jsx(ls,{...K})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=K,t[38]=L):L=t[38];let V;t[39]!==f?(V=s.jsx(yi,{open:f,onOpenChange:p}),t[39]=f,t[40]=V):V=t[40];let H;return t[41]!==L||t[42]!==V?(H=s.jsxs(s.Fragment,{children:[L,V]}),t[41]=L,t[42]=V,t[43]=H):H=t[43],H}function Ai(t){return t.preventDefault()}function $i(){J("signed_out",{source:"account_popover"}),wn(),Se.signOut()}function At(){const t=N.c(22),e=yo(),[n,r]=A.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const h=No(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:h.length>0?`Available: ${h.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Fs,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Te,{asChild:!0,children:s.jsxs(le,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(Oe,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Ae,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let p;t[17]!==n?(p=s.jsx(_o,{open:n,onOpenChange:r}),t[17]=n,t[18]=p):p=t[18];let x;return t[19]!==f||t[20]!==p?(x=s.jsxs(s.Fragment,{children:[f,p]}),t[19]=f,t[20]=p,t[21]=x):x=t[21],x}function Pi({invitation:t}){const[e,n]=A.useState(!1),[r,o]=A.useState(!1),i=In(),l=async()=>{n(!0);try{const d=await Se.organization.acceptInvitation({invitationId:t.id});if(d.error){we.error(d.error.message),n(!1);return}}catch{we.error("Failed to accept invitation"),n(!1);return}we.success("Invitation accepted!"),Tn();let c;try{c=(await Se.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(we.error(c.error.message),o(!1)):(we.success("Invitation declined"),i.invalidateQueries())}catch{we.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Dt,{size:14})}),s.jsx(Qe,{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(Rt,{size:14})})]})]})}function zi(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=Co(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(It,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Dt,{size:14}),e[11]=p):p=e[11];let x;e[12]!==i||e[13]!==f?(x=s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:p}),e[12]=i,e[13]=f,e[14]=x):x=e[14];let h;e[15]!==o||e[16]!==n.id?(h=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Rt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==x?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[x,b]}),e[22]=b,e[23]=x,e[24]=j):j=e[24];let S;return e[25]!==j||e[26]!==d||e[27]!==m?(S=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=S):S=e[28],S}function Mi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ft,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Di(){const t=A.useContext(On),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function Vs(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=fr(),o=Di(),i=wo();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Hi).map(Gi),u=[...o].sort(Fi).map(Ei);let m;t[4]!==e?(m=p=>({type:"release",release:p,isSeen:e(p.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...xr].sort(Ri).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function Ri(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Ei(t){return{type:"invitation",invitation:t}}function Fi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Gi(t){return{type:"join-request",request:t}}function Hi(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class Ys extends A.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 Xs(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Li(){const t=N.c(17),e=He(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=Ds();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=B(o!=null&&Xs(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Os,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Ie,{children:s.jsx(de,{children:s.jsxs(ye,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function Bi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Li,{})})}),t[0]=e):e=t[0],e}function Ui(){const t=N.c(17),e=He(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=Ds();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=B(o!=null&&Xs(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Os,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(Oe,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ae,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function qi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Ui,{})})}),t[0]=e):e=t[0],e}function Qs(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=Vs(),[i,l]=A.useState(null);let a;if(e[0]!==r||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=r.find(h),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=h=>{l(h),o(h)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||l(null)},e[7]=f):f=e[7];let p;e[8]!==m||e[9]!==r||e[10]!==d?(p=s.jsx(ht,{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(Qe,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(eo,{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(hr,{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(Et,{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(h=>h.type==="join-request"?s.jsx(zi,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Pi,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Mi,{release:h.release,isSeen:h.isSeen,onSelect:()=>m(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=p):p=e[11];let x;return e[12]!==n||e[13]!==p?(x=s.jsxs(xt,{onOpenChange:f,children:[n,p]}),e[12]=n,e[13]=p,e[14]=x):x=e[14],x}function Js(){const{redDotCount:t}=Vs();return t>0}function Wi(){const t=N.c(6),e=Js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Et,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(Qs,{children:s.jsx(Je,{asChild:!0,children:s.jsxs(ye,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ki(){const t=N.c(8),e=Js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Et,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(Je,{asChild:!0,children:s.jsx(Te,{asChild:!0,children:s.jsxs(le,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(Qs,{children:s.jsxs(Ae,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Vi(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ye,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Es,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Rs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Yi(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ae,{delayDuration:300,children:[s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Es,{className:"size-4"})})}),s.jsx(Oe,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Rs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Xi(){const t=N.c(7),e=He(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(st,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ye,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Qi(){const t=N.c(9),e=He(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(st,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Te,{asChild:!0,children:s.jsx(le,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Ae,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Ji(){const t=N.c(7),{state:e}=Le();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Bi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(de,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(At,{})})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(de,{children:s.jsx(Vi,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(de,{children:s.jsx(Wi,{})}),t[3]=a):a=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(de,{children:s.jsx(Xi,{})}),t[4]=c):c=t[4];let d;return t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(wt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Ie,{children:[i,l,a,c,s.jsx(de,{children:s.jsx(Ot,{})})]})]}),t[5]=d):d=t[5],d}let r;return t[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(wt,{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(Ie,{children:s.jsx(de,{children:s.jsx(Ot,{})})})}),s.jsx(Qi,{}),s.jsx(Ki,{}),s.jsx(At,{}),s.jsx(Yi,{}),s.jsx(qi,{})]})}),t[6]=r):r=t[6],r}function Zi(){const t=N.c(8),e=He(),{org:n}=ue(),{setOpenMobile:r}=Le();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ie,{children:s.jsx(de,{children:s.jsx(Ot,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(st,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(wt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(le,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function it(t){const e=N.c(15),{className:n,wrapperClassName:r,children:o}=t,[i,l]=A.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&l(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const u=d;let m;e[2]!==r?(m=B("relative",r),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:u,className:n,children:o}),e[4]=o,e[5]=n,e[6]=f):f=e[6];const p=i?"opacity-100":"opacity-0";let x;e[7]!==p?(x=B("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",p),e[7]=p,e[8]=x):x=e[8];let h;e[9]!==x?(h=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=h):h=e[10];let g;return e[11]!==m||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:m,children:[f,h]}),e[11]=m,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function el(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(tl,{virtualMcpId:n,size:i}):s.jsx(We,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Ko,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function tl(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=pt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(We,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(We,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function as(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=A.useState(""),{org:l}=ue(),{setTaskId:a}=Ps(),c=Gs();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=zt,d=Pt.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let p;e[5]!==c||e[6]!==m?(p=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=p):p=e[7];let x;e[8]!==d||e[9]!==f||e[10]!==p?(x={queryKey:d,enabled:f,queryFn:p,staleTime:1e4},e[8]=d,e[9]=f,e[10]=p,e[11]=x):x=e[11];const{data:h,isFetching:g}=u(x);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let S;e[14]!==r?(S=k=>{k||i(""),r(k)},e[14]=r,e[15]=S):S=e[15];const y=S;let C;e[16]!==y||e[17]!==a?(C=k=>{y(!1),a(k.id,k.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=C):C=e[18];const w=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Ro,{className:"sr-only",children:[s.jsx(Eo,{children:"Search"}),s.jsx(Fo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let I;e[20]!==o?(I=s.jsx(Uo,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let O;e[22]!==w||e[23]!==g||e[24]!==j||e[25]!==m?(O=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Lo,{children:"No results."}):j.map(k=>k.type==="thread"?s.jsxs(Bo,{value:`thread:${k.id}:${k.title}`,onSelect:()=>w(k),className:"gap-2.5",children:[s.jsx(el,{virtualMcpId:k.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:k.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(k.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${k.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=w,e[23]=g,e[24]=j,e[25]=m,e[26]=O):O=e[26];let T;e[27]!==O?(T=s.jsx(qo,{children:O}),e[27]=O,e[28]=T):T=e[28];let z;e[29]!==I||e[30]!==T?(z=s.jsxs(Go,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Wo,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,T]})]}),e[29]=I,e[30]=T,e[31]=z):z=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==z?($=s.jsx(Ho,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=$):$=e[35],$}function sl(t){return t==="owner"||t==="admin"}function nl(){const t=N.c(11),{locator:e}=ue(),n=Vo(),{data:r}=Se.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Pt.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=zt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(p=>p.userId===o)?.role;u=sl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var _t,gt="HoverCard",[Zs]=Pn(gt,[vs]),bt=vs(),[rl,jt]=Zs(gt),en=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=bt(e),d=A.useRef(0),u=A.useRef(0),m=A.useRef(!1),f=A.useRef(!1),[p,x]=Fn({prop:r,defaultProp:o??!1,onChange:i,caller:gt}),h=A.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>x(!0),l)},[l,x]),g=A.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>x(!1),a))},[a,x]),b=A.useCallback(()=>x(!1),[x]);return A.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(rl,{scope:e,open:p,onOpenChange:x,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(Gn,{...c,children:n})})};en.displayName=gt;var tn="HoverCardTrigger",sn=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=jt(tn,n),i=bt(n);return s.jsx(An,{asChild:!0,...i,children:s.jsx($n.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:ke(t.onPointerEnter,dt(o.onOpen)),onPointerLeave:ke(t.onPointerLeave,dt(o.onClose)),onFocus:ke(t.onFocus,o.onOpen),onBlur:ke(t.onBlur,o.onClose),onTouchStart:ke(t.onTouchStart,l=>l.preventDefault())})})});sn.displayName=tn;var qt="HoverCardPortal",[ol,il]=Zs(qt,{forceMount:void 0}),nn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=jt(qt,e);return s.jsx(ol,{scope:e,forceMount:n,children:s.jsx(Ss,{present:n||i.open,children:s.jsx(En,{asChild:!0,container:o,children:r})})})};nn.displayName=qt;var ct="HoverCardContent",rn=A.forwardRef((t,e)=>{const n=il(ct,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=jt(ct,t.__scopeHoverCard);return s.jsx(Ss,{present:r||i.open,children:s.jsx(ll,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ke(t.onPointerEnter,dt(i.onOpen)),onPointerLeave:ke(t.onPointerLeave,dt(i.onClose)),ref:e})})});rn.displayName=ct;var ll=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=jt(ct,n),d=bt(n),u=A.useRef(null),m=zn(e,u),[f,p]=A.useState(!1);return A.useEffect(()=>{if(f){const x=document.body;return _t=x.style.userSelect||x.style.webkitUserSelect,x.style.userSelect="none",x.style.webkitUserSelect="none",()=>{x.style.userSelect=_t,x.style.webkitUserSelect=_t}}},[f]),A.useEffect(()=>{if(u.current){const x=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",x),()=>{document.removeEventListener("pointerup",x),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),A.useEffect(()=>{u.current&&dl(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),s.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,x=>{x.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(Dn,{...d,...a,onPointerDown:ke(a.onPointerDown,x=>{x.currentTarget.contains(x.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),al="HoverCardArrow",cl=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=bt(n);return s.jsx(Rn,{...o,...r,ref:e})});cl.displayName=al;function dt(t){return e=>e.pointerType==="touch"?void 0:t()}function dl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var ul=en,ml=sn,fl=nn,xl=rn;function hl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(ul,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function pl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(ml,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function gl(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(fl,{"data-slot":"hover-card-portal",children:s.jsx(xl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Wt(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ge,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(rt,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(st,{size:14,className:"mr-2"}),e[9]=p):p=e[9];let x;e[10]!==f?(x=s.jsxs(rt,{onSelect:f,children:[p,"Settings"]}),e[10]=f,e[11]=x):x=e[11];let h;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(h=o&&s.jsxs(s.Fragment,{children:[s.jsx(ss,{}),s.jsxs(rt,{onSelect:()=>a(n,!r),children:[s.jsx(nr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=h):h=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(ss,{}),s.jsxs(rt,{onSelect:()=>c(n),children:[s.jsx(to,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==x||e[23]!==h||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,x,h,g]}),e[21]=m,e[22]=x,e[23]=h,e[24]=g,e[25]=b):b=e[25],b}function Kt(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(gs,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function jl(t){return t.member==="mine"&&!t.currentUserId}const on=4;let at=0;const $t=[];function vl(){for(;at<on&&$t.length>0;){const t=$t.shift();t&&t()}}function ln(t){return new Promise((e,n)=>{const r=()=>{at++,t().then(e,n).finally(()=>{at--,vl()})};at<on?r():$t.push(r)})}const vt=10;function cs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function Sl(t,e,n,r){let o=0;for(const i of t)Vt(i,e,n,r)&&o++;return o}function Ct(t,e,n,r){return Sl(t,e,n,r)}function yl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Vt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Nl(t,e){return!!(t>=vt||t===0&&e)}function ds(t,e){return t<e}function _l(t,e){return e===!1?!1:e===!0?!0:t}function Vt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const ut=new Map,lt=new Map;function Cl(t,e){return e?t>=vt?!0:null:!1}function us(t){return ut.get(t)}function wl(t,e){ut.set(t,e)}function kl(t,e,n){const r=ut.get(t);if(r!==void 0){n(r);return}let o=lt.get(t);o||(o=ln(e).then(i=>(ut.set(t,i),lt.delete(t),i)).catch(()=>(lt.delete(t),Promise.reject(new Error("group probe failed")))),lt.set(t,o)),o.then(n,()=>n(!1))}function ms(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===vt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Il(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Vt(l,n,r,o)&&i++;return i}function an(t,e,n,r){const o=N.c(8),{org:i}=ue(),l=bl(i.id,t,e,n);let a;o[0]!==n?(a=jl(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=A.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=dr(),{threads:f,hasMore:p}=$s(),x=r??Ct(f,t,e,n),h=Nl(x,p),g=Cl(x,p),b=Gs();if(d.identity===l&&d.serverHasMore===null){const _=g??us(l);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&us(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),kl(l,async()=>{const _=cs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:O}=ms(I),T=Ct(m.threads.get(),t,e,n);return O===void 0?!1:ds(T,O)},_=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:_})}));const S=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(O=>O.identity===I?{...O,isFetching:!0}:O);try{const O=Ct(f,t,e,n),T=cs(t,e,O,n,vt),z=await ln(()=>b.call("COLLECTION_THREADS_LIST",T)),{items:$,hasMore:k,totalCount:R}=ms(z),U=new Set(f.map(Tl)),G=Il($,U,t,e,n),D=O;m.mergeThreads($),u(E=>{if(E.identity!==I)return E;let M;return R!==void 0?M=ds(D+G,R):M=$.length===0||G===0?!1:k,wl(I,M),{...E,isFetching:!1,serverHasMore:M}})}catch(O){const T=O,z=T instanceof Error?T.message:String(T);we.error(`Could not load more tasks: ${z}`),u($=>$.identity===I?{...$,isFetching:!1}:$)}},y=d.isFetching||d.isProbing,C=!c&&!y&&_l(h,d.serverHasMore);let w;return o[2]!==y||o[3]!==S||o[4]!==C||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(w={hasMore:C,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:S},o[2]=y,o[3]=S,o[4]=C,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=w):w=o[7],w}function Tl(t){return t.id}function cn(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:p,sortable:x,groupVisibleCount:h}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=pt(n),S=r[0];let y;e[0]!==S||e[1]!==c||e[2]!==l||e[3]!==n?(y=()=>{S?l(S):c(n)},e[0]=S,e[1]=c,e[2]=l,e[3]=n,e[4]=y):y=e[4];const C=y,w=x?.isDragging?!1:void 0;let _;e[5]!==x?.isDragging||e[6]!==n?(_=X=>{x?.isDragging||X&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=x?.isDragging,e[6]=n,e[7]=_):_=e[7];const I=!!(S&&o&&S.id===o),O=x?"Drag to reorder":void 0;let T;e[8]!==x?(T=x?{...x.attributes,...x.listeners}:{},e[8]=x,e[9]=T):T=e[9];const z=x&&"cursor-pointer active:cursor-grabbing touch-none",$=x?.isDragging&&"cursor-grabbing";let k;e[10]!==$||e[11]!==z?(k=B("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",z,$),e[10]=$,e[11]=z,e[12]=k):k=e[12];const R=j?.icon??null,U=j?.title??"?";let G;e[13]!==R||e[14]!==U?(G=s.jsx(We,{icon:R,name:U,size:"sm+",className:"rounded-lg"}),e[13]=R,e[14]=U,e[15]=G):G=e[15];let D;e[16]!==C||e[17]!==k||e[18]!==G||e[19]!==I||e[20]!==O||e[21]!==T?(D=s.jsx(de,{children:s.jsx(Gt,{asChild:!0,children:s.jsx(pl,{asChild:!0,children:s.jsx(ye,{onClick:C,isActive:I,title:O,...T,className:k,children:G})})})}),e[16]=C,e[17]=k,e[18]=G,e[19]=I,e[20]=O,e[21]=T,e[22]=D):D=e[22];const E=p??Ol;let M;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==E||e[29]!==n?(M=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:E,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=E,e[29]=n,e[30]=M):M=e[30];let W;e[31]!==D||e[32]!==M?(W=s.jsxs(Lt,{children:[D,M]}),e[31]=D,e[32]=M,e[33]=W):W=e[33];const q=j?.title??"Agent";let K;e[34]!==q?(K=s.jsx("span",{className:"truncate",children:q}),e[34]=q,e[35]=K):K=e[35];let L;e[36]!==c||e[37]!==n?(L=()=>c(n),e[36]=c,e[37]=n,e[38]=L):L=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ge,{size:14}),e[39]=V):V=e[39];let H;e[40]!==L?(H=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:L,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:V}),e[40]=L,e[41]=H):H=e[41];let Y;e[42]!==K||e[43]!==H?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[K,H]}),e[42]=K,e[43]=H,e[44]=Y):Y=e[44];let te;e[45]!==o||e[46]!==i||e[47]!==h||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(te=s.jsx(Al,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:h,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=h,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=te):te=e[52];let Q;e[53]!==Y||e[54]!==te?(Q=s.jsxs(gl,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,te]}),e[53]=Y,e[54]=te,e[55]=Q):Q=e[55];let se;return e[56]!==W||e[57]!==Q||e[58]!==w||e[59]!==_?(se=s.jsxs(hl,{open:w,openDelay:120,closeDelay:150,onOpenChange:_,children:[W,Q]}),e[56]=W,e[57]=Q,e[58]=w,e[59]=_,e[60]=se):se=e[60],se}function Ol(){}function Al(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=an("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Bt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Kt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function $l(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Fr},a[1]=u):u=a[1];const m=Dr(Zt(Er,d),Zt(Rr,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=jr(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const p=f;let x;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==p||a[12]!==c?(x=b=>{const{active:j,over:S}=b;if(!S||j.id===S.id)return;const y=String(j.id),C=String(S.id);if(!vr(y,C,o))return;const w=Sr(p,y,C),_=yr(e,n,o,w);e==="org"?Nr(n.orgId,_):_r(n,_),J("sidebar_group_reordered",{virtual_mcp_id:y,over_virtual_mcp_id:C,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=p,a[12]=c,a[13]=x):x=a[13];const h=x;let g;return a[14]!==h||a[15]!==m||a[16]!==p?(g={sensors:m,sortableIds:p,handleDragEnd:h},a[14]=h,a[15]=m,a[16]=p,a[17]=g):g=a[17],g}function Pl(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function zl(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ur(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const p={transform:qr.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:p,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function fs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:p,handleDragEnd:x}=$l(r,n,o,i,l,a,c);if(r.length===0)return null;const h=p;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==p){let S;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==p?(S=y=>{const C=d(y);return p.includes(y.virtualMcpId)?s.jsx(zl,{id:y.virtualMcpId,children:w=>{const{setNodeRef:_,style:I,isDragging:O,attributes:T,listeners:z}=w;return s.jsx("div",{ref:_,style:I,className:B(O&&"opacity-50"),children:u(C,{attributes:T,listeners:z,isDragging:O})})}},y.virtualMcpId):s.jsx("div",{children:m(C)},y.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=p,e[10]=S):S=e[10],g=r.map(S),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=p,e[5]=g}else g=e[5];let b;e[11]!==h||e[12]!==g?(b=s.jsx(Gr,{items:h,strategy:Hr,children:g}),e[11]=h,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==x||e[15]!==f||e[16]!==b?(j=s.jsx(Lr,{sensors:f,collisionDetection:Br,onDragEnd:x,children:b}),e[14]=x,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function dn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:p,orgPinned:x,user:h,toolCallRuns:g}=Cr(n,o,i),b=x.length>0&&h.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const S=j;let y;e[20]!==c||e[21]!==b?(y=b&&s.jsx(Pl,{collapsed:c}),e[20]=c,e[21]=b,e[22]=y):y=e[22],f=s.jsxs(s.Fragment,{children:[p&&m(d(p)),s.jsx(fs,{section:"org",groups:x,...S}),y,s.jsx(fs,{section:"user",groups:h,...S}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function Ml(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(dn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Rl,renderSortable:Dl}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function Dl(t,e){return s.jsx(cn,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Rl(t){return s.jsx(cn,{...t},t.virtualMcpId)}function un(t){const e=N.c(41),{virtualMcpId:n,isActive:r,threadCount:o,onOpen:i,onNewTask:l,onShowSettings:a,onHideGroup:c,isOrgPinned:d,canManageOrgPin:u,onToggleOrgPin:m,sortable:f}=t,p=d===void 0?!1:d,x=u===void 0?!1:u,h=pt(n),g=f?.isDragging??!1,b=h?.title??"Agent";let j;e[0]!==f?(j=f?{...f.attributes,...f.listeners}:{},e[0]=f,e[1]=j):j=e[1];let S;e[2]!==i||e[3]!==n?(S=()=>i(n),e[2]=i,e[3]=n,e[4]=S):S=e[4];let y;e[5]!==i||e[6]!==f?.listeners||e[7]!==n?(y=M=>{f?.listeners?.onKeyDown?.(M),!M.defaultPrevented&&M.target===M.currentTarget&&M.key==="Enter"&&(M.preventDefault(),i(n))},e[5]=i,e[6]=f?.listeners,e[7]=n,e[8]=y):y=e[8];const C=f&&"touch-none active:cursor-grabbing",w=r?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/60",_=g&&"shadow-md bg-accent/40 cursor-grabbing";let I;e[9]!==C||e[10]!==w||e[11]!==_?(I=B("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium transition-colors","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",C,w,_),e[9]=C,e[10]=w,e[11]=_,e[12]=I):I=e[12];const O=h?.icon??null;let T;e[13]!==O||e[14]!==b?(T=s.jsx(We,{icon:O,name:b,size:"2xs"}),e[13]=O,e[14]=b,e[15]=T):T=e[15];let z;e[16]!==b?(z=s.jsx("span",{className:"flex-1 truncate",children:b}),e[16]=b,e[17]=z):z=e[17];let $;e[18]!==o?($=typeof o=="number"&&o>0&&s.jsx("span",{className:"shrink-0 size-7 flex items-center justify-center text-xs text-muted-foreground tabular-nums",children:o}),e[18]=o,e[19]=$):$=e[19];let k;e[20]!==T||e[21]!==z||e[22]!==$||e[23]!==j||e[24]!==S||e[25]!==y||e[26]!==I?(k=s.jsxs("div",{...j,role:"button",tabIndex:0,onClick:S,onKeyDown:y,className:I,children:[T,z,$]}),e[20]=T,e[21]=z,e[22]=$,e[23]=j,e[24]=S,e[25]=y,e[26]=I,e[27]=k):k=e[27];const R=k;let U;e[28]!==R?(U=s.jsx(Gt,{asChild:!0,children:R}),e[28]=R,e[29]=U):U=e[29];const G=m??El;let D;e[30]!==x||e[31]!==p||e[32]!==c||e[33]!==l||e[34]!==a||e[35]!==G||e[36]!==n?(D=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:x,onNewTaskInGroup:l,onShowSettings:a,onToggleOrgPin:G,onHideGroup:c})}),e[30]=x,e[31]=p,e[32]=c,e[33]=l,e[34]=a,e[35]=G,e[36]=n,e[37]=D):D=e[37];let E;return e[38]!==U||e[39]!==D?(E=s.jsxs(Lt,{children:[U,D]}),e[38]=U,e[39]=D,e[40]=E):E=e[40],E}function El(){}function xs(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(dn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Gl,renderSortable:Fl}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function Fl(t,e){return s.jsx(un,{...t,sortable:e},t.virtualMcpId)}function Gl(t){return s.jsx(un,{...t},t.virtualMcpId)}function Hl(t){const e=N.c(29),{virtualMcpId:n,isActive:r,onOpen:o}=t,i=pt(n),l=i?.title??"Agent";let a;e[0]!==o||e[1]!==n?(a=()=>o(n),e[0]=o,e[1]=n,e[2]=a):a=e[2];const c=r?"bg-accent":"hover:bg-accent/60";let d;e[3]!==c?(d=B("flex items-center justify-center p-1 rounded-md transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",c),e[3]=c,e[4]=d):d=e[4];const u=i?.icon??null;let m;e[5]!==u||e[6]!==l?(m=s.jsx(We,{icon:u,name:l,size:"xs"}),e[5]=u,e[6]=l,e[7]=m):m=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==l?(f=s.jsx(Gt,{asChild:!0,children:s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":l,onClick:a,className:d,children:m})})}),e[8]=a,e[9]=d,e[10]=m,e[11]=l,e[12]=f):f=e[12];const p=t.isOrgPinned??!1,x=t.canManageOrgPin??!1,h=t.onToggleOrgPin??Ll;let g;e[13]!==t.onHideGroup||e[14]!==t.onNewTask||e[15]!==t.onShowSettings||e[16]!==p||e[17]!==x||e[18]!==h||e[19]!==n?(g=s.jsx(Ht,{className:"w-56",children:s.jsx(Wt,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:x,onNewTaskInGroup:t.onNewTask,onShowSettings:t.onShowSettings,onToggleOrgPin:h,onHideGroup:t.onHideGroup})}),e[13]=t.onHideGroup,e[14]=t.onNewTask,e[15]=t.onShowSettings,e[16]=p,e[17]=x,e[18]=h,e[19]=n,e[20]=g):g=e[20];let b;e[21]!==f||e[22]!==g?(b=s.jsxs(Lt,{children:[f,g]}),e[21]=f,e[22]=g,e[23]=b):b=e[23];let j;e[24]!==l?(j=s.jsx(Oe,{side:"right",children:l}),e[24]=l,e[25]=j):j=e[25];let S;return e[26]!==b||e[27]!==j?(S=s.jsxs(Ae,{children:[b,j]}),e[26]=b,e[27]=j,e[28]=S):S=e[28],S}function Ll(){}function Bl(t){const e=N.c(7),{groups:n,renderGroup:r}=t;let o;if(e[0]!==n||e[1]!==r){let l;e[3]!==r?(l=a=>{const c=r(a);return s.jsx(Hl,{...c},c.virtualMcpId)},e[3]=r,e[4]=l):l=e[4],o=n.map(l),e[0]=n,e[1]=r,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=s.jsx(kt,{delayDuration:300,children:s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(1.75rem,1fr))] gap-1 px-2 py-0.5",children:o})}),e[5]=o,e[6]=i):i=e[6],i}const Ul="sidebar.group.expanded.";function ql(t,e){const n=N.c(3),[r,o]=tt(`${Ul}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Wl(t){const e=N.c(18),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=an("status",n,a),[p,x]=A.useState(!1);!p&&r.length===0&&f===!0&&!c&&!d&&(x(!0),queueMicrotask(()=>{u()}));let h;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==r){let j;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(j=S=>s.jsx(Bt,{task:S,isActive:o===S.id,onClick:()=>i(S),onArchive:S.created_by===a.currentUserId?()=>l(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=j):j=e[10],h=r.map(j),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=r,e[5]=h}else h=e[5];let g;e[11]!==m||e[12]!==c||e[13]!==u?(g=(m||c)&&s.jsx(Kt,{onClick:()=>{u()},isFetching:c,indented:!0}),e[11]=m,e[12]=c,e[13]=u,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function Kl(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=Xo[n],d=c.icon,[u,m]=ql(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const p=f;let x;e[3]!==p?(x=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p())},e[3]=p,e[4]=x):x=e[4];let h;e[5]!==d||e[6]!==c.iconClassName?(h=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]=h):h=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Hs,{size:14}):s.jsx(Ft,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,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 S;e[15]!==r.length?(S=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]=S):S=e[16];let y;e[17]!==u||e[18]!==p||e[19]!==x||e[20]!==b||e[21]!==j||e[22]!==S?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:p,onKeyDown:x,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,S]}),e[17]=u,e[18]=p,e[19]=x,e[20]=b,e[21]=j,e[22]=S,e[23]=y):y=e[23];let C;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Wl,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=C):C=e[31];let w;return e[32]!==y||e[33]!==C?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,C]}),e[32]=y,e[33]=C,e[34]=w):w=e[34],w}function hs(t){const e=N.c(31),{threads:n,groupBy:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:u}=t;if(r==="status"){let x;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==n){let g;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(g=b=>s.jsx(Kl,{status:b.status,threads:b.threads,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a},b.status),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=g):g=e[10],x=wr(n).map(g),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=n,e[5]=x}else x=e[5];let h;return e[11]!==x?(h=s.jsx(s.Fragment,{children:x}),e[11]=x,e[12]=h):h=e[12],h}let m;if(e[13]!==o||e[14]!==a||e[15]!==l||e[16]!==i||e[17]!==n){let x;e[19]!==o||e[20]!==a||e[21]!==l||e[22]!==i?(x=h=>s.jsx(Bt,{task:h,isActive:o===h.id,onClick:()=>i(h),onArchive:h.created_by===a.currentUserId?()=>l(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[19]=o,e[20]=a,e[21]=l,e[22]=i,e[23]=x):x=e[23],m=n.map(x),e[13]=o,e[14]=a,e[15]=l,e[16]=i,e[17]=n,e[18]=m}else m=e[18];let f;e[24]!==c||e[25]!==d||e[26]!==u?(f=(c||d)&&s.jsx(Kt,{onClick:u,isFetching:d}),e[24]=c,e[25]=d,e[26]=u,e[27]=f):f=e[27];let p;return e[28]!==m||e[29]!==f?(p=s.jsxs(s.Fragment,{children:[m,f]}),e[28]=m,e[29]=f,e[30]=p):p=e[30],p}function Vl(t){const e=N.c(19),{label:n,open:r,onToggle:o,count:i,action:l,actionSlot:a,controlsId:c}=t;let d;e[0]!==r?(d=r?s.jsx(Hs,{size:12,className:"shrink-0"}):s.jsx(Ft,{size:12,className:"shrink-0"}),e[0]=r,e[1]=d):d=e[1];let u;e[2]!==n?(u=s.jsx("span",{className:"truncate",children:n}),e[2]=n,e[3]=u):u=e[3];let m;e[4]!==i?(m=typeof i=="number"&&i>0&&s.jsx("span",{className:"tabular-nums text-muted-foreground/60",children:i}),e[4]=i,e[5]=m):m=e[5];let f;e[6]!==c||e[7]!==o||e[8]!==r||e[9]!==d||e[10]!==u||e[11]!==m?(f=s.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:o,className:"flex flex-1 min-w-0 items-center gap-1 text-sm font-medium text-muted-foreground/80 hover:text-foreground transition-colors focus-visible:outline-none",children:[d,u,m]}),e[6]=c,e[7]=o,e[8]=r,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let p;e[13]!==l?(p=l&&s.jsxs("button",{type:"button",onClick:l.onClick,className:"shrink-0 flex items-center gap-0.5 text-sm font-medium text-muted-foreground/60 hover:text-foreground opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100 transition-opacity focus-visible:outline-none",children:[l.label,l.icon]}),e[13]=l,e[14]=p):p=e[14];let x;return e[15]!==a||e[16]!==f||e[17]!==p?(x=s.jsxs("div",{className:"group/section flex items-center gap-1 px-2 pt-1 pb-0.5",children:[f,p,a]}),e[15]=a,e[16]=f,e[17]=p,e[18]=x):x=e[18],x}function Yl(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Xl(t,e,n,r,o){const i=N.c(5),l=Yl(t,e,r,o),[a,c]=A.useState("");a!==l&&(kr(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=Ir(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const ps={all:"All tasks",manual:"Chats",automation:"Automation"};function mn({onNavigate:t}={}){const{data:e}=Se.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=ue(),i=Yn({connectionId:Xn,orgId:o.id,orgSlug:o.slug}),l=Qn(o.id).id,a=Ts(),{liveToDev:c,devToLive:d}=Wr(a),u=zs(a),m=nl(),f=Jn(),[p,x]=A.useState({}),h=new Set(u),g={},b=[];for(const[v,P]of Object.entries(p))h.has(v)!==P?g[v]=P:b.push(v);b.length>0&&x(v=>{const P={...v};for(const F of b)delete P[F];return P});const j=(()=>{const v=new Set(u);for(const[P,F]of Object.entries(g))F?v.add(P):v.delete(P);return[...v]})(),S=new Set(j),{threads:y,hasMore:C,isFetchingMore:w,fetchNextPage:_}=$s(),I=y.filter(v=>!v.hidden),{hide:O}=As(),T=He(),z=Tr(),{setTaskId:$,createNewTask:k}=Ps(),R=js({strict:!1}),U=Mo({select:v=>v.location.pathname}),G=U===`/${o.slug}`||U===`/${o.slug}/`,D=R.taskId??null,E=y.find(v=>v.id===D)?.virtual_mcp_id??null,M=()=>{t?.()},W=[...I].sort((v,P)=>(P.updated_at??"").localeCompare(v.updated_at??"")),[q,K]=A.useState("all"),[L,V]=A.useState("flat"),[H,Y]=A.useState(!0),[te,Q]=tt("sidebar-agents-view","list"),[se,X]=tt("sidebar-threads-scope-all",!1),[Z,ne]=A.useState(!1),[re,me]=A.useState(!1),[ee,fe]=A.useState(0),$e=Or(),Ke=ee+$e,ae={orgId:o.id,userId:r},Ne={type:q,member:"mine",currentUserId:n??null},he=yl(W,"agent",Ne),Pe=Xl(ae,Ar($r(W,l),d),l,j,Ke),Ze=new Set(a.map(v=>v.id).filter(v=>!!v)),pe=Pe.filter(v=>v.virtualMcpId===l||v.virtualMcpId===yt||Ze.has(v.virtualMcpId)),ie=pe.filter(v=>v.virtualMcpId!==yt),ge=v=>n?v.filter(P=>P.created_by===n):[],xe=v=>q==="automation"?v.filter(P=>!!P.trigger_id):q==="manual"?v.filter(P=>!P.trigger_id):v,be=ge(W),ze=xe(be),Me=xe(W),Ve=se?Me:ze,je=v=>{if(n&&v.created_by&&v.created_by!==n)return;const P=v.id===D;if(O(v.id),!P)return;const F=be.find(Fe=>Fe.id!==v.id&&Fe.virtual_mcp_id===v.virtual_mcp_id);M(),F?$(F.id,F.virtual_mcp_id):T({to:"/$org",params:{org:o.slug}})},Be=v=>{M(),$(v.id,v.virtual_mcp_id)},_e=v=>{J("sidebar_group_new_clicked",{virtual_mcp_id:v}),M(),k(v)},De=async()=>{const v=E??l;J("sidebar_new_thread_clicked",{virtual_mcp_id:v});const P=be.find(F=>F.virtual_mcp_id===v&&F.title==="New chat");if(P){let F=!1;try{const Fe=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P.id,limit:1,offset:0}});F=((Fe.structuredContent??Fe).items?.length??0)===0}catch{}if(F){M(),$(P.id,v);return}}M(),k(v)},Re=v=>{if(v===l){M(),T({to:"/$org",params:{org:o.slug}});return}J("sidebar_agent_opened",{virtual_mcp_id:v}),M(),z(v)},Ue=v=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:v}),M(),z(v,{search:{main:"instructions"}})},Ce=v=>{if(S.has(v))return;J("sidebar_group_hide_clicked",{virtual_mcp_id:v});const P=pe.find(F=>F.virtualMcpId===v);if(P)for(const F of P.threads)O(F.id);Pr(ae,v,j),fe(F=>F+1)},Ee=async(v,P)=>{if(m&&g[v]===void 0){J("sidebar_group_org_pin_toggled",{virtual_mcp_id:v,pinned:P}),x(F=>({...F,[v]:P}));try{await f.update.mutateAsync({id:v,data:{pinned:P}})}catch{zr(ae,v,!P),x(F=>{const Fe={...F};return delete Fe[v],Fe})}}},qe=v=>{const P=v===l||v===yt;return{isOrgPinned:P||S.has(v),canManageOrgPin:P?!1:m,onToggleOrgPin:P?void 0:Ee}},ce=v=>({virtualMcpId:v.virtualMcpId,isActive:v.virtualMcpId===l?G:E===v.virtualMcpId,threadCount:he.get(v.virtualMcpId)??0,onOpen:Re,onNewTask:_e,onShowSettings:Ue,onHideGroup:Ce,...qe(v.virtualMcpId)}),Ye=v=>{const P=xe(ge(v.threads)),F=c.get(v.virtualMcpId)??null;return{virtualMcpId:v.virtualMcpId,threads:P,devPartnerId:F,devGroupVisibleCount:F?he.get(F)??0:0,activeTaskId:D,filters:Ne,groupVisibleCount:he.get(v.virtualMcpId)??0,onSelectTask:Be,onArchiveTask:je,onNewTaskInGroup:_e,onShowSettings:Ue,onHideGroup:Ce,...qe(v.virtualMcpId)}},Xe=q!=="all",{state:St,isMobile:nt}=Le();if(St==="collapsed"&&!nt){const v=pe.filter(P=>{const F=xe(ge(P.threads));return!(Xe&&F.length===0)});return s.jsxs(s.Fragment,{children:[s.jsx(Nt,{value:ie.length===0}),s.jsx(Ie,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(Ml,{groups:v,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(P=>P+1),renderGroup:P=>Ye(P)})})]})}const xn=s.jsx("button",{type:"button",onClick:()=>X(v=>!v),className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:se?"All":"Mine"}),Xt=v=>s.jsxs("div",{className:B("shrink-0 px-1 flex items-center justify-between",v?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(le,{"aria-label":"Search threads",onClick:()=>{J("tasks_panel_search_opened"),me(!0),ne(!0)},children:s.jsx(rr,{size:16})}),s.jsx(le,{"aria-label":L==="flat"?"Group by status":"Show as flat list",title:L==="flat"?"Flat list":"Grouped by status",onClick:()=>{const P=L==="flat"?"status":"flat";J("tasks_panel_group_by_changed",{to_value:P}),V(P)},children:L==="flat"?s.jsx(or,{size:16}):s.jsx(ir,{size:16})}),!v&&s.jsxs(xt,{children:[s.jsx(Je,{asChild:!0,children:s.jsxs(le,{"aria-label":"Filter tasks",children:[s.jsx(ko,{size:16}),Xe&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"})]})}),s.jsx(ht,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsx("div",{className:"flex flex-col gap-2",children:s.jsx(Ql,{label:"Type",children:s.jsxs(Oo,{value:q,onValueChange:P=>{const F=P;F!==q&&J("tasks_panel_filter_changed",{to_value:F}),K(F)},children:[s.jsx(Ao,{size:"sm",className:"w-full",children:s.jsx($o,{})}),s.jsx(Po,{children:Object.keys(ps).map(P=>s.jsx(zo,{value:P,children:ps[P]},P))})]})})})})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[xn,s.jsx(le,{"aria-label":"New thread",title:"New thread",onClick:()=>{De()},children:s.jsx(lr,{size:16})})]})]});return nt?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(Nt,{value:ie.length===0}),Xt(!0),s.jsxs(Qo,{defaultValue:"threads",variant:"pill",className:"flex flex-col flex-1 min-h-0 gap-0",children:[s.jsxs(Jo,{variant:"pill",className:"shrink-0 mx-1 mb-2 w-[calc(100%-0.5rem)]",children:[s.jsx(ns,{variant:"pill",value:"threads",children:"Threads"}),s.jsx(ns,{variant:"pill",value:"agents",children:"Agents"})]}),s.jsx(rs,{value:"threads",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(it,{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(hs,{threads:Ve,groupBy:L,activeTaskId:D,onSelectTask:Be,onArchiveTask:je,filters:Ne,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})})}),s.jsx(rs,{value:"agents",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(it,{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(xs,{groups:ie,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(v=>v+1),renderGroup:ce})})})]}),re&&s.jsx(as,{open:Z,onOpenChange:ne})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(Nt,{value:ie.length===0}),Xt(!1),s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:[s.jsx(it,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(hs,{threads:Ve,groupBy:L,activeTaskId:D,onSelectTask:Be,onArchiveTask:je,filters:Ne,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})}),s.jsx("div",{className:"shrink-0 mx-2 my-2 border-b"}),s.jsxs("div",{className:B("flex flex-col min-h-0",H?"basis-[35%] shrink-0":"shrink-0"),children:[s.jsx(Vl,{label:"Agents",open:H,onToggle:()=>Y(v=>!v),count:ie.length,controlsId:"sidebar-section-agents",actionSlot:s.jsxs(s.Fragment,{children:[H&&s.jsx(le,{"aria-label":te==="list"?"Switch to grid view":"Switch to list view",title:te==="list"?"Grid view":"List view",onClick:()=>Q(v=>v==="list"?"grid":"list"),children:te==="list"?s.jsx(Io,{className:"size-4"}):s.jsx(To,{className:"size-4"})}),s.jsx(Ls,{compact:!0})]})}),s.jsx("div",{id:"sidebar-section-agents","aria-hidden":!H,className:"grid min-h-0 transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:H?"1fr":"0fr"},children:s.jsx("div",{className:"overflow-hidden min-h-0",children:s.jsx(it,{wrapperClassName:"h-full min-h-0",className:"flex flex-col gap-0.5 h-full overflow-y-auto overscroll-contain",children:te==="grid"?s.jsx(Bl,{groups:ie,renderGroup:ce}):s.jsx(xs,{groups:ie,orderScope:ae,decopilotId:l,orgPinnedIds:j,onReorder:()=>fe(v=>v+1),renderGroup:ce})})})})]})]}),re&&s.jsx(as,{open:Z,onOpenChange:ne})]})}function Ql(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Jl=5,Zl=[{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 fn(){const t=N.c(3),{state:e}=Le();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Jl}).map(sa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ve,{className:"size-6 rounded-md"}),s.jsx(ve,{className:"size-6 rounded-md"}),s.jsx(ve,{className:"size-6 rounded-md"})]}),s.jsx(ve,{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:Zl.map(ea)})]}),t[2]=r):r=t[2],r}function ea(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(ve,{className:"size-5 rounded-full shrink-0"}),s.jsx(ve,{className:B("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(ta)})]},e)}function ta(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(ve,{className:"h-3 flex-1 rounded-sm"})},e)}function sa(t,e){return s.jsx(ve,{className:"size-10 rounded-lg mx-auto"},e)}function na(){const t=N.c(4),e=Bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ji,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ys,{children:s.jsx(A.Suspense,{fallback:s.jsx(fn,{}),children:s.jsx(mn,{})})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Ms,{children:s.jsx(Ws,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function ra(t){const e=N.c(8),{onClose:n}=t,r=Bs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Zi,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fn,{}),e[1]=i):i=e[1];let l;e[2]!==n?(l=s.jsx(ys,{children:s.jsx(A.Suspense,{fallback:i,children:s.jsx(mn,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==l?(a=s.jsx(Ms,{children:s.jsx(vi,{sections:r,onClose:n,footer:o,additionalContent:l})}),e[4]=n,e[5]=r,e[6]=l,e[7]=a):a=e[7],a}const oa="sidebar.open";function ia(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Yo,{}),t[0]=e):e=t[0],e}function pd(){const t=N.c(24),e=Mt(),[n,r]=tt(oa,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=si();let c;t[0]!==e?(c=e?s.jsxs(oe.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(oe.LogoLink,{}),s.jsx(ts,{}),s.jsx(At,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(oe.TogglesSlot,{}),s.jsx(oe.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(oe.CenterSlot,{}),s.jsx(oe.RightSlot,{})]}):s.jsxs(oe.Header,{children:[s.jsxs(oe.LeftColumn,{children:[s.jsx(oe.LogoLink,{}),s.jsx(ts,{}),s.jsx(oe.TogglesSlot,{})]}),s.jsx(oe.CenterSlot,{}),s.jsxs(oe.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(oe.TabsSlot,{})}),s.jsx(oe.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(na,{}),s.jsx(Zo,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},t[8]=p):p=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Un,{className:"flex flex-col",style:p,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(A.Suspense,{fallback:s.jsx(ia,{}),children:s.jsx(Hn,{})})})})}),t[9]=x):x=t[9];let h;t[10]!==m||t[11]!==f||t[12]!==i?(h=s.jsxs(qn,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,x]}),t[10]=m,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(Do,{renderSidebar:la}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==h||t[18]!==g?(b=s.jsx(So,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,h,g]})}),t[16]=c,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(ur,{children:s.jsx(oe.Provider,{children:s.jsx(Wn,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function la(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(ra,{onClose:e})})})}export{pd as default};
|