decocms 3.34.0 → 3.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CZCJdLyi.js → AlertCircle-rpaL6q8T.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CHxGqtjn.js → ArrowUpRight-D7_4FAQ5.js} +1 -1
- package/dist/client/assets/{Check-DZFgb4Aq.js → Check-6LmIKXJj.js} +1 -1
- package/dist/client/assets/{CheckCircle-CG-wMven.js → CheckCircle-D0kUlRsN.js} +1 -1
- package/dist/client/assets/{ChevronDown-B7QgMo_j.js → ChevronDown-CaCYdoie.js} +1 -1
- package/dist/client/assets/{ChevronLeft-TMVSDJlu.js → ChevronLeft-BuXkBFIm.js} +1 -1
- package/dist/client/assets/{ChevronRight-BZDLAZs0.js → ChevronRight-kLRVkGUs.js} +1 -1
- package/dist/client/assets/{ChevronUp-D4NcsGJa.js → ChevronUp-DkGtzqyl.js} +1 -1
- package/dist/client/assets/{Container-CIoK_JLI.js → Container-Bl0qWNtu.js} +1 -1
- package/dist/client/assets/{DotsVertical-BTWgDSCZ.js → DotsVertical-CvhOKI-w.js} +1 -1
- package/dist/client/assets/{Eye-BaBZSaML.js → Eye-BNS1RmzG.js} +1 -1
- package/dist/client/assets/{FilterLines-CuEfbFlC.js → FilterLines-BSmtfAHG.js} +1 -1
- package/dist/client/assets/{Globe01-Bu-3l6NI.js → Globe01-DjWlKHom.js} +1 -1
- package/dist/client/assets/{HardDrive-FmjuSfEd.js → HardDrive-Dx3Blqhn.js} +1 -1
- package/dist/client/assets/{Key01-Bnc16AFY.js → Key01-D6jyUgYu.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D2epCZ9e.js → LayoutLeft-C7Cmt2J8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-il-vFJO5.js → LinkExternal01-B6flmd1s.js} +1 -1
- package/dist/client/assets/{Monitor01-s9F0MGZm.js → Monitor01-DBfOkkx9.js} +1 -1
- package/dist/client/assets/{Palette-BXG1B7a_.js → Palette-BX6fdd-v.js} +1 -1
- package/dist/client/assets/{Play-CArhP18b.js → Play-DApzrsBx.js} +1 -1
- package/dist/client/assets/{Plus-BMFN7EYn.js → Plus-Do6ZWheh.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CKC-7KpZ.js → RefreshCcw01-CW918RSV.js} +1 -1
- package/dist/client/assets/{SearchMd-Cp07lkq4.js → SearchMd-B4Lavo8e.js} +1 -1
- package/dist/client/assets/{Settings02-D4_HBk9b.js → Settings02-B57k_aEv.js} +1 -1
- package/dist/client/assets/{Shield01-C5CB9ixt.js → Shield01-CFDfVqiL.js} +1 -1
- package/dist/client/assets/{Star01-B5uhWV3B.js → Star01-QoJ-qcfh.js} +1 -1
- package/dist/client/assets/{Stars01-Bbj7Y0Z1.js → Stars01-ANwy09AP.js} +1 -1
- package/dist/client/assets/{Stars02-KpOwsvid.js → Stars02-C17u9BVa.js} +1 -1
- package/dist/client/assets/{Sun-BAloSVhR.js → Sun-D4yzlyEv.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Cu45oyoo.js → SwitchHorizontal01-CkwE98n9.js} +1 -1
- package/dist/client/assets/{Tool01-41oNA8tk.js → Tool01-B0zT3ots.js} +1 -1
- package/dist/client/assets/{Trash01-BxDpcA3C.js → Trash01-Bifm5Wb3.js} +1 -1
- package/dist/client/assets/{Upload01-D32r7qgX.js → Upload01-mjA8r4Fi.js} +1 -1
- package/dist/client/assets/{User01-jR83WsDH.js → User01-BZL6tFVt.js} +1 -1
- package/dist/client/assets/{Users01-BBxMW_TC.js → Users01-CqVfleMx.js} +1 -1
- package/dist/client/assets/{Users03-BLIawTyD.js → Users03-C5i2CKOP.js} +1 -1
- package/dist/client/assets/{X-D5a6VwmP.js → X-BWR0-4rz.js} +1 -1
- package/dist/client/assets/{XCircle-uxFEtClP.js → XCircle-CiiIVhRh.js} +1 -1
- package/dist/client/assets/{XClose-DutYcJf9.js → XClose-D0wmxYTF.js} +1 -1
- package/dist/client/assets/{Zap-Dn5qc0WK.js → Zap-BGp3QjmM.js} +1 -1
- package/dist/client/assets/{ZapSquare-rlEq1cG8.js → ZapSquare-CxE5iHdd.js} +1 -1
- package/dist/client/assets/{ZoomOut-BVY1Bb5M.js → ZoomOut-B1VNHI1K.js} +1 -1
- package/dist/client/assets/{access-gate-BG1y9Hug.js → access-gate-BELP4oqa.js} +1 -1
- package/dist/client/assets/{accordion-Dzk41U9r.js → accordion-Dsx4jZXX.js} +1 -1
- package/dist/client/assets/{add-section-modal-DsL7vxG4.js → add-section-modal-BPiyATcO.js} +1 -1
- package/dist/client/assets/agent-capabilities-CmHO-Kgo.js +3 -0
- package/dist/client/assets/{agent-icon-eJeBIKuQ.js → agent-icon-CpBAbwoh.js} +1 -1
- package/dist/client/assets/{agent-icons-BQS7GC08.js → agent-icons-C_pHQRgk.js} +1 -1
- package/dist/client/assets/{agents-list-BuzrDWIw.js → agents-list-ud8B7XUs.js} +1 -1
- package/dist/client/assets/{ai-providers-CVvDeHAY.js → ai-providers-DuT9vieJ.js} +1 -1
- package/dist/client/assets/{alert-B7wpmBJc.js → alert-C_aVuLV8.js} +1 -1
- package/dist/client/assets/{alert-dialog-D0THW25_.js → alert-dialog-Dsb6KPFM.js} +1 -1
- package/dist/client/assets/app-editor-CJE_W_Dn.js +1 -0
- package/dist/client/assets/{auth-catchall-B9qDAn3E.js → auth-catchall-DsJQjIZu.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B_xfyQiq.js → auth-split-layout-BBz1-8cc.js} +1 -1
- package/dist/client/assets/{automation-list-row-D582neu3.js → automation-list-row-DTcrDIUh.js} +1 -1
- package/dist/client/assets/{automation-runs-Bbg-0UVN.js → automation-runs-D8yf4pum.js} +1 -1
- package/dist/client/assets/{automations-CocDDisF.js → automations-BqoqwiaS.js} +1 -1
- package/dist/client/assets/{avatar-BWTRU-cH.js → avatar-nCSKoB6F.js} +1 -1
- package/dist/client/assets/{badge-DAzOgiKc.js → badge-CY1rqnYU.js} +1 -1
- package/dist/client/assets/{brand-context-BxzBhuxy.js → brand-context-DCIkJfS8.js} +1 -1
- package/dist/client/assets/{buckets-OgmEkXt4.js → buckets-CvxCU-Mg.js} +1 -1
- package/dist/client/assets/{calendar-CTsGuWmk.js → calendar-vde5tCHf.js} +1 -1
- package/dist/client/assets/{capability-load-error-B6TBCUEJ.js → capability-load-error-DYWpzVHl.js} +1 -1
- package/dist/client/assets/{card-D4pgDcd2.js → card-CYGsSb57.js} +1 -1
- package/dist/client/assets/{chat-context-DLsfZ4X8.js → chat-context-CDygsN4Q.js} +1 -1
- package/dist/client/assets/{checkbox-NCgkpQdG.js → checkbox-vKl7eadT.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cg7MVUxb.js → cli-auth-success-BgBSOhsv.js} +1 -1
- package/dist/client/assets/{collection-detail-BTIBM7UV.js → collection-detail-Cl0_mdap.js} +1 -1
- package/dist/client/assets/{collection-display-button-BD_cZwBu.js → collection-display-button-VpCmWGot.js} +1 -1
- package/dist/client/assets/{collection-search-FDG1Rlpn.js → collection-search-CjkYy_AH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CLs6D3Gl.js → collection-table-wrapper-CuUrD2rg.js} +1 -1
- package/dist/client/assets/{collection-tabs-pv_RnATY.js → collection-tabs-BGsvaOVA.js} +1 -1
- package/dist/client/assets/{collections-2LTOAuNh.js → collections-NCEoL2EX.js} +1 -1
- package/dist/client/assets/{command-Eg_TSNDN.js → command-KCI9wvsu.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BfZ9n3Q0.js → connect-desktop-dialog-CgeQRUKM.js} +1 -1
- package/dist/client/assets/{connection-card-CBcUqWOS.js → connection-card-BioQsepZ.js} +1 -1
- package/dist/client/assets/{connection-detail-CLOt0X5i.js → connection-detail-szcerrZK.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DQ1R8Rbb.js → connection-form-helpers-DC_9yJsF.js} +1 -1
- package/dist/client/assets/{connections-anSV4FAS.js → connections-ZTcaOmQJ.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-C2fCSDxg.js +1 -0
- package/dist/client/assets/{dialog-GbkSCCDE.js → dialog-CxpeEAA2.js} +1 -1
- package/dist/client/assets/{domain-settings-CfTQTVXk.js → domain-settings-FkOLC-vc.js} +1 -1
- package/dist/client/assets/{drawer-CDEJbPQ_.js → drawer-R-Q-vfsa.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bp4U1b45.js → dropdown-menu-Xj0lVIXK.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BwhGs18I.js → dynamic-plugin-layout-ggJeSS9L.js} +1 -1
- package/dist/client/assets/{empty-state-B8atRyt1.js → empty-state-BEE0EBKQ.js} +1 -1
- package/dist/client/assets/{empty-state-v8piTmBi.js → empty-state-BhV-zl-f.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CWzL0whb.js → extract-connection-data-BJ4lD3eO.js} +1 -1
- package/dist/client/assets/{features-DqRtKUxF.js → features-2oa5PE-D.js} +1 -1
- package/dist/client/assets/{file-explorer-COzE78zi.js → file-explorer-mkpu5feK.js} +1 -1
- package/dist/client/assets/{file-type-icon-CrGaQHZH.js → file-type-icon-35VBMVCk.js} +1 -1
- package/dist/client/assets/{files-DcXaeN54.js → files-C37GYe47.js} +1 -1
- package/dist/client/assets/{form-Ct1q5ZTT.js → form-Ci8PGt-R.js} +1 -1
- package/dist/client/assets/{general-6k9CLiVk.js → general-NmglolSe.js} +1 -1
- package/dist/client/assets/{generate-id-Ck2Vi4il.js → generate-id-nWw_PZwJ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Dh-z3MS6.js → github-repo-picker-DY4w_1I0.js} +1 -1
- package/dist/client/assets/{header-tab-button-TaP3yUvX.js → header-tab-button-C7XZ27Uv.js} +1 -1
- package/dist/client/assets/{hover-card-DUG7qFNS.js → hover-card-DY9PmUZF.js} +1 -1
- package/dist/client/assets/{image-field-BvfbFQCq.js → image-field-DXfNSgLy.js} +1 -1
- package/dist/client/assets/{index-2GwD8zs9.js → index-61WbL3ye.js} +1 -1
- package/dist/client/assets/{index-C4S4NH7_.js → index-BEe1oLVg.js} +1 -1
- package/dist/client/assets/{index-CH5_jbBh.js → index-BToBsTv0.js} +1 -1
- package/dist/client/assets/{index-DUFETPUS.js → index-BvKb9qza.js} +1 -1
- package/dist/client/assets/{index-BG09-Pj6.js → index-Czr8nkWj.js} +1 -1
- package/dist/client/assets/{index-Bg77DGkv.js → index-D9SSFpE5.js} +1 -1
- package/dist/client/assets/{index-C99xN5mu.js → index-DO3UwA_I.js} +1 -1
- package/dist/client/assets/{index-Ca_51Bdz.js → index-DUiGV32e.js} +1 -1
- package/dist/client/assets/{index-D7JjC_Ha.js → index-Dczuf3at.js} +1 -1
- package/dist/client/assets/{index-EWthEHT2.js → index-DppjWA7O.js} +1 -1
- package/dist/client/assets/{index-BQjtT112.js → index-Rf_PdJ5z.js} +1 -1
- package/dist/client/assets/{index-Bo0y-IeN.js → index-So-S11eP.js} +1 -1
- package/dist/client/assets/{index-DrZPYOCw.js → index-czuYZ_ID.js} +1 -1
- package/dist/client/assets/{index-DvjfZyh_.js → index-rZ1TPVyD.js} +3 -3
- package/dist/client/assets/{index-redirect-BQdYxzJo.js → index-redirect-Mq-_t69h.js} +1 -1
- package/dist/client/assets/{index-BwfKFYWi.js → index-u2XUNnQk.js} +12 -12
- package/dist/client/assets/{input-irp5a6Ig.js → input-BPXWlz46.js} +1 -1
- package/dist/client/assets/{integration-icon-FcIrg4H7.js → integration-icon-CWT0gSfx.js} +1 -1
- package/dist/client/assets/{label-BjwEjfOc.js → label-CzVCjiiL.js} +1 -1
- package/dist/client/assets/{layout-s4c1VBr3.js → layout-DRDhyVmm.js} +1 -1
- package/dist/client/assets/{login-DvesO_NT.js → login-BDymjDs5.js} +1 -1
- package/dist/client/assets/{members-C60Aey5n.js → members-CtJP3l4D.js} +1 -1
- package/dist/client/assets/{monaco-editor-CIyIIOLP.js → monaco-editor-C-H4UmIT.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B8f5t9as.js → monitoring-stats-row-Bjwv0PCc.js} +1 -1
- package/dist/client/assets/{oauth-callback-BHpZxMn4.js → oauth-callback-BS0_f_H5.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BsfNZx3Q.js → oauth-callback-ai-provider-Bp-Z15lU.js} +1 -1
- package/dist/client/assets/{onboarding-B2qJIBXT.js → onboarding-tR6ID9Ba.js} +1 -1
- package/dist/client/assets/{org-install-D8vuUVF_.js → org-install-Dao8BW5b.js} +1 -1
- package/dist/client/assets/{org-layout-BlXjXW59.js → org-layout-3WhlK4a0.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CX3CIxiU.js → org-plugin-layout-C-NqJRXX.js} +1 -1
- package/dist/client/assets/{page-seo-form-Bj1ei9Gv.js → page-seo-form-Dk6e77BM.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Ceb0gnAp.js +1 -0
- package/dist/client/assets/{pair-QNI_4vE-.js → pair-DYb6YfcG.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BxAyfpRL.js → plugin-empty-state-YbbYO5hU.js} +1 -1
- package/dist/client/assets/{plugin-header-BmTvDEmx.js → plugin-header-8P4QiIoH.js} +1 -1
- package/dist/client/assets/{plugin-layout-AAC2IROJ.js → plugin-layout-CKmZivzq.js} +1 -1
- package/dist/client/assets/{popover-DKADBzsx.js → popover-Bk3EwUPD.js} +1 -1
- package/dist/client/assets/{post-editor-Dkob_Nf9.js → post-editor-Bw21I9pc.js} +1 -1
- package/dist/client/assets/{primitives-BD_skIF2.js → primitives-Dql_hUCU.js} +1 -1
- package/dist/client/assets/{profile-B7jiHx0p.js → profile-DVNKZaX-.js} +1 -1
- package/dist/client/assets/project-app-view-CMCeiidr.js +1 -0
- package/dist/client/assets/record-editor-803FPqaV.js +1 -0
- package/dist/client/assets/registry-BZxoTJql.js +2 -0
- package/dist/client/assets/{registry-layout-CyYeZQFC.js → registry-layout-DwX4dFWX.js} +1 -1
- package/dist/client/assets/{require-capability-D2k7Kzha.js → require-capability-6kSOKhdT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dlm8pGwG.js → required-auth-layout-YEZh9H2w.js} +1 -1
- package/dist/client/assets/{reset-password-Bj1irBT9.js → reset-password-DaCJM4Eh.js} +1 -1
- package/dist/client/assets/{resizable-CflvFHn-.js → resizable-23UTrxEL.js} +1 -1
- package/dist/client/assets/{roles-C-0y_YIa.js → roles-xmvI7O0C.js} +1 -1
- package/dist/client/assets/save-referenced-block-CMYI5Fv0.js +1 -0
- package/dist/client/assets/{save-status-BT2K7vMi.js → save-status-BkzFYIeb.js} +1 -1
- package/dist/client/assets/{schema-form-BmsIuFe9.js → schema-form-DNaVud8y.js} +1 -1
- package/dist/client/assets/{scroll-area-Bcd6M0ah.js → scroll-area-QXSqgT3C.js} +1 -1
- package/dist/client/assets/{search-input-DMce5FEj.js → search-input-DbmU5zU8.js} +1 -1
- package/dist/client/assets/{secrets-DFqTlIhT.js → secrets-CrK7EU6I.js} +1 -1
- package/dist/client/assets/{sections-editor-DPjqmRcC.js → sections-editor-DJ6-AL_q.js} +1 -1
- package/dist/client/assets/{select-DBJdJQxs.js → select-DRqZIuLQ.js} +1 -1
- package/dist/client/assets/{select-model-C6zKg0NG.js → select-model-CZe_eVYF.js} +1 -1
- package/dist/client/assets/{seo-editor-70uW1Cgu.js → seo-editor-pRBB6PMK.js} +1 -1
- package/dist/client/assets/{settings-layout-BL3d6TJ_.js → settings-layout-osjNi_Qw.js} +1 -1
- package/dist/client/assets/{settings-section-C7OUTn7i.js → settings-section-5LNAbhU4.js} +1 -1
- package/dist/client/assets/{sheet-BwH8pS-i.js → sheet-Dsfk9URc.js} +1 -1
- package/dist/client/assets/{shell-controls-CMgf8y54.js → shell-controls-BvG0M9XK.js} +1 -1
- package/dist/client/assets/{shell-layout-C6cd7iM5.js → shell-layout-DkW3B_MZ.js} +1 -1
- package/dist/client/assets/shell-route-loading-CKElD_Av.js +1 -0
- package/dist/client/assets/{sidebar-TMNnGTum.js → sidebar-B3SsvTHC.js} +1 -1
- package/dist/client/assets/{skeleton-l4y2bxXO.js → skeleton-DvVUqja_.js} +1 -1
- package/dist/client/assets/sortable.esm-CnPAeADV.js +5 -0
- package/dist/client/assets/{spinner-BtGInCsG.js → spinner-DZmgr2qu.js} +1 -1
- package/dist/client/assets/{sso-BGAtG4Za.js → sso-Ce8-uwYP.js} +1 -1
- package/dist/client/assets/{store-C3y6O23u.js → store-Cy7UQOIx.js} +1 -1
- package/dist/client/assets/store-registry-Cn522mzq.js +2 -0
- package/dist/client/assets/{studio-tools-B1Ixjcw5.js → studio-tools-jbRVdtpc.js} +1 -1
- package/dist/client/assets/{switch-BFEJpvlr.js → switch-rL3a0x4B.js} +1 -1
- package/dist/client/assets/{tab-id-t-YFcZzw.js → tab-id-hZWLCmfc.js} +1 -1
- package/dist/client/assets/{table-M2WJKO5P.js → table-cHRXPecF.js} +1 -1
- package/dist/client/assets/{tabs-w6d9uq3S.js → tabs-B68TQ0Dt.js} +1 -1
- package/dist/client/assets/{task-status-CfFWQAcK.js → task-status-Cqn0_tco.js} +1 -1
- package/dist/client/assets/{textarea-BGXAM3FF.js → textarea-Bymi75yx.js} +1 -1
- package/dist/client/assets/{toggle-group-C4U40EOv.js → toggle-group-DnRl91Ne.js} +1 -1
- package/dist/client/assets/{toolbar-C2En0zPi.js → toolbar-Cb06hfKk.js} +1 -1
- package/dist/client/assets/{tools-list-CCVW8omn.js → tools-list-D12nTCg-.js} +1 -1
- package/dist/client/assets/{tooltip-6LKHApWj.js → tooltip-ua4lJTzI.js} +1 -1
- package/dist/client/assets/{types-CoBpfu3U.js → types-DJl0mitR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dph4wlM9.js → use-ai-providers-P6PF7YRx.js} +1 -1
- package/dist/client/assets/{use-automations-DV8VwbjR.js → use-automations-DGe3A7k6.js} +1 -1
- package/dist/client/assets/{use-capability-CRrm1ogD.js → use-capability-B2IrzHkM.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CyQ108_a.js → use-clock-tick-x-ip1-Lp.js} +1 -1
- package/dist/client/assets/{use-collections-MWh87Qf9.js → use-collections-Dvp_IbhN.js} +1 -1
- package/dist/client/assets/{use-connection-BwjVlVqI.js → use-connection-CyWLUiRu.js} +1 -1
- package/dist/client/assets/{use-copy-BDBsQ8lw.js → use-copy-nAd5EMaO.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp--Yql-2p8.js → use-create-virtual-mcp-DmdlMapL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B6SxjuaG.js → use-debounced-autosave-DSZqKaTf.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CE3T6gZf.js → use-delete-connection-VJfJqSrZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-WBUPEX1z.js → use-file-configs-DXD_Hwrv.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C_ORywxv.js → use-infinite-scroll-B2zyjKex.js} +1 -1
- package/dist/client/assets/{use-list-state-ZUm8O0U3.js → use-list-state-ByLS4CFA.js} +1 -1
- package/dist/client/assets/{use-mcp-client-kBcr-yIi.js → use-mcp-client-CGBZ7ekq.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cu_s_Tgp.js → use-mcp-prompts-BQNNtRte.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BVCosz4Y.js → use-mcp-tools-Dn2JgISP.js} +1 -1
- package/dist/client/assets/{use-members-CQwZpJh1.js → use-members-BaX0tyb1.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Dqwftn0z.js → use-navigate-to-agent-5w6ZqBss.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CKzivxvb.js → use-org-auth-client-CLnnUl3h.js} +1 -1
- package/dist/client/assets/{use-org-sso-CizTzcrl.js → use-org-sso-B8CLPiZl.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DFIysUWU.js → use-organization-roles-UOgWPl1e.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C83zobOQ.js → use-organization-settings-D68AqLOQ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-D2z51tYu.js → use-registry-connections-CRtbznIm.js} +1 -1
- package/dist/client/assets/{use-secrets-DuBDIHg_.js → use-secrets--KIFsJ5I.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C1N5nKtC.js → use-status-sounds-B8VUkU2E.js} +1 -1
- package/dist/client/assets/{use-view-mode-CdGJFg5T.js → use-view-mode-CvlKEBCR.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BH7eFRNT.js → use-virtual-mcp-mhycHzLS.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-k6dph5MZ.js +1 -0
- package/dist/client/assets/{useRouterState-mLoytFp1.js → useRouterState-qr3F3XJE.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DGO3SU3a.js +1 -0
- package/dist/client/assets/{user-Bu_LWzDf.js → user-D73GXODW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BFVBLid1.js → view-mode-toggle-3i0Tx7_t.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-PpWWHENZ.js → watch-sse-pool-Bo209v56.js} +1 -1
- package/dist/client/assets/{workflow-mBb6h1mU.js → workflow-DoAXdkx8.js} +1 -1
- package/dist/client/assets/workflow-detail-BVmen01p.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-BTQpzJzY.js +0 -3
- package/dist/client/assets/app-editor-mnWJa4OB.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-J9IBtPGQ.js +0 -1
- package/dist/client/assets/page-seo-sheet-CAj4OnGN.js +0 -1
- package/dist/client/assets/project-app-view-Bxi1-sx3.js +0 -1
- package/dist/client/assets/record-editor-DhS1gQiJ.js +0 -1
- package/dist/client/assets/registry-CLfDV8ZJ.js +0 -2
- package/dist/client/assets/save-referenced-block-Dm8Vu_wn.js +0 -1
- package/dist/client/assets/shell-route-loading-C_Trke1w.js +0 -1
- package/dist/client/assets/sortable.esm-DzvMqAvs.js +0 -5
- package/dist/client/assets/store-registry-CTUY1_0P.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DCizzYPk.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BlGj7aqQ.js +0 -1
- package/dist/client/assets/workflow-detail-GZhsuAzj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as N,c as K,j as s,l as Wt,r as O,t as Z,q as fe,b as Ce,X as _s,K as qt,n as Vt,f as Te,g as Ns,d as zn,P as Pn,Y as Rn,Z as Dn,T as En,W as Fn,I as Gn,H as Bn,a as Ln,B as $t,$ as Hn,a0 as Un,o as Ae,a1 as Kn,a2 as Wn,a3 as qn,G as Vn,a4 as Yn,a5 as Xn,a6 as Qn,a7 as Zn,a8 as xt,a9 as Jn,aa as er,ab as tr,ac as sr,ad as nr,ae as rr,af as Cs,ag as or,ah as ir,ai as lr,aj as ar,ak as cr,al as dr,am as ur,an as mr,ao as fr,ap as xr,aq as hr,p as pr,E as ws}from"./index-rZ1TPVyD.js";import{u as gr}from"./useRouterState-qr3F3XJE.js";import{c as br,i as jr,a as vr}from"./ZoomOut-B1VNHI1K.js";import{u as Xe,c as xe,d as ke,e as zt,f as Pt,g as $e,h as ks,i as Is,j as yr,k as Sr,l as Lt}from"./sidebar-B3SsvTHC.js";import{T as we}from"./toolbar-Cb06hfKk.js";import{u as Ms,T as We,a as qe,b as Ve,c as ts}from"./tooltip-ua4lJTzI.js";import{S as _e}from"./skeleton-DvVUqja_.js";import{P as Rt,a as ut,b as Dt}from"./popover-Bk3EwUPD.js";import{b as As,a as $s,D as Os}from"./drawer-R-Q-vfsa.js";import{i as Ts}from"./SearchMd-B4Lavo8e.js";import{s as _r}from"./Star01-QoJ-qcfh.js";import{s as Ne}from"./Plus-Do6ZWheh.js";import{i as Nr,g as Cr}from"./use-mcp-client-CGBZ7ekq.js";import{a as zs,u as ht,b as wr}from"./use-virtual-mcp-mhycHzLS.js";import{u as kr}from"./use-create-virtual-mcp-DmdlMapL.js";import{I as Ir,a as Mr,u as Ar,W as $r,H as Or,S as Tr,G as zr}from"./github-repo-picker-DY4w_1I0.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Pr,_ as Rr,$ as Dr}from"./agent-icon-CpBAbwoh.js";import{u as Rs,d as Er,k as Ds}from"./tab-id-hZWLCmfc.js";import{r as Fr,a as Gr,R as Br,b as Lr,u as Es}from"./shell-layout-DkW3B_MZ.js";import{u as Hr,a as Ur,b as Kr,s as Wr,c as qr,r as Vr,d as Yr,e as Xr,f as Qr,p as Zr,T as Fs,g as Jr,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,S as rs,o as Gs}from"./use-navigate-to-agent-5w6ZqBss.js";import{A as os}from"./avatar-nCSKoB6F.js";import{i as Bs}from"./Check-6LmIKXJj.js";import{a as is}from"./Eye-BNS1RmzG.js";import{n as lo,i as ao}from"./Globe01-DjWlKHom.js";import{i as co,a as Ls}from"./ZapSquare-CxE5iHdd.js";import{i as uo}from"./Monitor01-DBfOkkx9.js";import{n as mo,a as fo}from"./Sun-D4yzlyEv.js";import{a as pt}from"./Settings02-B57k_aEv.js";import{i as xo}from"./Shield01-CFDfVqiL.js";import{a as ho}from"./Users03-C5i2CKOP.js";import{s as Hs}from"./XClose-D0wmxYTF.js";import{f as po,a as go,b as bo,c as jo,d as vo,e as yo,A as So}from"./alert-dialog-Dsb6KPFM.js";import{F as _o,a as No,b as Co,c as wo,d as ko,e as Io,f as Mo}from"./form-Ci8PGt-R.js";import{I as Ao}from"./input-BPXWlz46.js";import{S as $o}from"./spinner-DZmgr2qu.js";import"./index-czuYZ_ID.js";import{i as Oo,a as To}from"./RefreshCcw01-CW918RSV.js";import{n as Yt}from"./Stars02-C17u9BVa.js";import{u as Us,A as Ks,g as zo,a as Po,b as ls,K as Ro,P as Do,s as Eo,S as Fo,v as Go,D as Bo,c as Lo,d as Ho,C as Uo}from"./sortable.esm-CnPAeADV.js";import{i as Xt}from"./ChevronRight-kLRVkGUs.js";import{i as Ko}from"./FilterLines-BSmtfAHG.js";import{t as Wo}from"./Users01-CqVfleMx.js";import{b as as,c as Ws,S as cs,a as ds,d as us}from"./select-DRqZIuLQ.js";import{b as qo,c as Vo,e as Yo,a as Xo,D as Qo}from"./dialog-CxpeEAA2.js";import{C as Zo,e as Jo,c as ei,d as ti,b as si}from"./command-KCI9wvsu.js";import{u as qs}from"./studio-tools-jbRVdtpc.js";import{i as Vs}from"./Zap-BGp3QjmM.js";import{u as ni}from"./use-org-auth-client-CLnnUl3h.js";import{H as ri,a as oi,b as ii}from"./hover-card-DY9PmUZF.js";import{g as li,S as ai}from"./task-status-Cqn0_tco.js";import{u as ci,f as di}from"./use-clock-tick-x-ip1-Lp.js";import{t as Ys}from"./ChevronDown-CaCYdoie.js";function ui(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let h;e[14]!==f||e[15]!==g||e[16]!==x?(h=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=h):h=e[17];let v;return e[18]!==u||e[19]!==h?(v=s.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=v):v=e[20],v}const mi="Select an existing agent";function fi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{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(qe,{side:"right",sideOffset:8,children:mi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ve,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function xi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=Ce.useSession();let r;t[0]!==n?.user?.email?(r=qt.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:hi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=Vt(i);return a?.isDecoUser??!1}async function hi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function pi(t){const e=Te(),{create:n}=Rs(),{locator:r}=fe(),o=Ns({strict:!1}),i=zn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Fr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function gi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{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 a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=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]=a):a=e[8],a}function bi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=O.useState(""),l=zs(),{org:c}=fe(),{data:d}=Ce.useSession(),u=d?.user?.id??"anon",m=l.filter(yi).map(vi),f=Ur();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:p,isCreating:x}=kr(g),{createFromTemplate:h,isCreating:v}=Ar(),j=xi(),y=pi(c.slug),b=i.toLowerCase(),S=l.filter(ji).filter(le=>!i||le.title.toLowerCase().includes(b)),k=le=>{Kr({orgId:c.id,userId:u},le.id,m),f(),n(),a(""),y(le.id)},_="flex flex-col max-h-[min(640px,80dvh)]";let C;e[1]!==i?(C=s.jsx(ui,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=C):C=e[2];const I="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const P="grid grid-cols-3 gap-1";let $;e[4]!==p||e[5]!==n?($=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=$):$=e[6];let w,z;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=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(Ne,{size:16,className:"text-muted-foreground"})}),z=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=w,e[8]=z):(w=e[7],z=e[8]);let H;e[9]!==x||e[10]!==$?(H=s.jsxs("button",{type:"button",disabled:x,onClick:$,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:[w,z]}),e[9]=x,e[10]=$,e[11]=H):H=e[11];let T;e[12]!==h||e[13]!==n?(T=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await h($r),n()},e[12]=h,e[13]=n,e[14]=T):T=e[14];let B,R;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=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(_r,{className:"size-5 text-muted-foreground"})}),R=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=B,e[16]=R):(B=e[15],R=e[16]);let L;e[17]!==v||e[18]!==T?(L=s.jsxs("button",{type:"button",disabled:v,onClick:T,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:[B,R]}),e[17]=v,e[18]=T,e[19]=L):L=e[19];let D;e[20]!==h||e[21]!==n?(D=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await h(Or),n()},e[20]=h,e[21]=n,e[22]=D):D=e[22];let G,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=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:Tr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=G,e[24]=F):(G=e[23],F=e[24]);let E;e[25]!==v||e[26]!==D?(E=s.jsxs("button",{type:"button",disabled:v,onClick:D,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:[G,F]}),e[25]=v,e[26]=D,e[27]=E):E=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let q,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=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(zr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=q,e[32]=X):(q=e[31],X=e[32]);let re;e[33]!==W?(re=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[q,X]}),e[33]=W,e[34]=re):re=e[34];let Y;e[35]!==j||e[36]!==n||e[37]!==r?(Y=j&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=j,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=S.map(le=>s.jsx(gi,{agent:le,onClick:()=>k(le)},le.id));let V;e[39]!==H||e[40]!==L||e[41]!==E||e[42]!==re||e[43]!==Y||e[44]!==oe?(V=s.jsxs("div",{className:P,children:[H,L,E,re,Y,oe]}),e[39]=H,e[40]=L,e[41]=E,e[42]=re,e[43]=Y,e[44]=oe,e[45]=V):V=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==S.length?(J=S.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=x,e[47]=i,e[48]=S.length,e[49]=J):J=e[49];let Q;e[50]!==V||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:I,children:[A,V,J]}),e[50]=V,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Pn,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==C||e[63]!==se?(ie=s.jsxs("div",{className:_,children:[C,Q,se]}),e[61]=Q,e[62]=C,e[63]=se,e[64]=ie):ie=e[64],ie}function ji(t){return!Nr(t.id)}function vi(t){return t.id}function yi(t){return t.pinned}function Xs(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,a]=O.useState(!1),[l,c]=O.useState(!1),[d,u]=O.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Hr(),p=g?"border border-border":void 0;let x;e[2]!==g?(x=I=>g?s.jsx(fi,{children:I}):I,e[2]=g,e[3]=x):x=e[3];const h=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const j=v;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(_e,{className:"h-4 w-24"})}),children:s.jsx(bi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const b=y;let S;e[10]!==o||e[11]!==p||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==b||e[16]!==h?(S=m?s.jsxs(s.Fragment,{children:[o?h(s.jsx(we,{"aria-label":"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ne,{className:"size-4"})})):s.jsx(xe,{children:h(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),b]})})]}):s.jsxs(Rt,{open:i,onOpenChange:I=>{I&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),a(I)},children:[o?h(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(p),children:s.jsx(Ne,{className:"size-4"})})})):s.jsx(xe,{children:h(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:b})]}),e[10]=o,e[11]=p,e[12]=g,e[13]=m,e[14]=i,e[15]=b,e[16]=h,e[17]=S):S=e[17];let k;e[18]!==l?(k=s.jsx(Ir,{open:l,onOpenChange:c}),e[18]=l,e[19]=k):k=e[19];let _;e[20]!==d?(_=s.jsx(Mr,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let C;return e[22]!==S||e[23]!==k||e[24]!==_?(C=s.jsxs(s.Fragment,{children:[S,k,_]}),e[22]=S,e[23]=k,e[24]=_,e[25]=C):C=e[25],C}function Qs(){const t=N.c(24),{org:e}=fe(),n=Te(),o=gr().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(br,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const g=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(jr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let h;t[11]!==n||t[12]!==i?(h=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=h):h=t[13];let v;t[14]!==x||t[15]!==h?(v={key:"files",label:"Library",icon:p,isActive:x,onClick:h},t[14]=x,t[15]=h,t[16]=v):v=t[16];const j=v;let y;t[17]!==j||t[18]!==g?(y={type:"items",items:[g,j]},t[17]=j,t[18]=g,t[19]=y):y=t[19];let b;if(t[20]!==c||t[21]!==y){if(b=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Xs,{})})})})},t[23]=S):S=t[23],b.push(S)}t[20]=c,t[21]=y,t[22]=b}else b=t[22];return b}function Ot(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Rn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Zs(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(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Js(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("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 a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(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]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,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(xe,{className:d,children:m},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Si(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(ks,{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(Ni),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Zs,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(_i),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function _i(t){return s.jsx(Js,{item:t},t.key)}function Ni(t){return s.jsx(Js,{item:t},t.key)}function Ci(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(wi),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(Is,{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]!==l?(f=s.jsxs(yr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function wi(t,e){return s.jsx(Si,{section:t},e)}function en(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ci,{...t}),e[0]=t,e[1]=n):n=e[1],n}en.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(_e,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ki(){const t=N.c(7),n=_s().logo??Dn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(Sr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=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]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(xe,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function Ii(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(ks,{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 a;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Zs,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Mi(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(ki,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(Ii,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ai=En({name:Fn().min(2,"Organization name is required")});function $i(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Gn(Ai),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Bn(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Ti,onSuccess:Oi},e[1]=a):a=e[1];const l=Ln(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(bo,{children:[s.jsx(jo,{children:"Create a new organization"}),s.jsx(vo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=C=>l.mutateAsync(C),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:C}=_;return s.jsxs(Co,{children:[s.jsx(wo,{children:"Organization Name"}),s.jsx(ko,{children:s.jsx(Ao,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Io,{children:"The name of your company or organization"}),C.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",tn(C.value)]})]}),s.jsx(Mo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(_o,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let p;e[15]!==l||e[16]!==i?(p=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(po,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const h=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx($o,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let j;e[23]!==h||e[24]!==v?(j=s.jsx($t,{type:"submit",variant:"default",disabled:h,children:v}),e[23]=h,e[24]=v,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(yo,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let b;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(b=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=b):b=e[33];let S;e[34]!==i||e[35]!==b?(S=s.jsxs(go,{children:[d,s.jsx(No,{...i,children:b})]}),e[34]=i,e[35]=b,e[36]=S):S=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==S?(k=s.jsx(So,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=k):k=e[40],k}function Oi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ti(t){const e=tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ce.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 Ht(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 zi(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(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]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(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 a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=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,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=qn();let a;e[0]!==n?(a=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=O.useState(!1),[u,m]=O.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let p;e[2]!==c?(p=function(){c&&m(""),d(Pi)},e[2]=c,e[3]=p):p=e[3];const x=p;let h;e[4]!==u||e[5]!==c||e[6]!==x?(h=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=h):h=e[7];let v;e[8]!==c?(v=c?s.jsx(Hs,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let j;e[10]!==v||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:v}),e[10]=v,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{size:16}),e[13]=y):y=e[13];let b;e[14]!==o?(b=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=b):b=e[15];let S;e[16]!==j||e[17]!==b?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,b]}),e[16]=j,e[17]=b,e[18]=S):S=e[18];let k;e[19]!==h||e[20]!==S?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[h,S]}),e[19]=h,e[20]=S,e[21]=k):k=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",C=g.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 I;e[22]!==r||e[23]!==n?(I=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(zi,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(Bs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=I):I=e[24];const A=g.map(I);let P;e[25]!==C||e[26]!==A?(P=s.jsxs("div",{className:_,children:[C,A]}),e[25]=C,e[26]=A,e[27]=P):P=e[27];let $;return e[28]!==P||e[29]!==k?($=s.jsxs(s.Fragment,{children:[k,P]}),e[28]=P,e[29]=k,e[30]=$):$=e[30],$}function Pi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:p}=t;if(g){const V=n?.name??"U";let J;e[0]!==V||e[1]!==r?(J=s.jsx(os,{url:r,fallback:V,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=V,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Fi)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(is,{size:14}),e[12]=Ie):Ie=e[12];let ze;e[13]!==le?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let he;e[16]!==ze?(he=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[ze,Pe]})}),e[16]=ze,e[17]=he):he=e[17];let Re;e[18]!==he||e[19]!==J||e[20]!==ie?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Re):Re=e[21];const mt=String(p);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],Ee=o.map(de),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let de;e[45]!==l.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=l.theme,e[46]=c,e[47]=de):de=e[47],Ge=a.map(de),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Ei),e[50]=c,e[51]=be):be=e[51];const je=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==l.enableSounds?(pe=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.1"]}),e[61]=Be):Be=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Be]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==ve?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,ve]}),e[67]=Re,e[68]=Fe,e[69]=ve,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let h;e[71]!==x||e[72]!==r?(h=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=h):h=e[73];const v=n?.name??"User";let j;e[74]!==v?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=j):j=e[75];const y=n?.email;let b;e[76]!==y?(b=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=b):b=e[77];let S;e[78]!==j||e[79]!==b?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,b]}),e[78]=j,e[79]=b,e[80]=S):S=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Di)},e[81]=n,e[82]=k):k=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let C;e[84]!==k?(C=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=k,e[85]=C):C=e[85];let I;e[86]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=I):I=e[86];let A;e[87]!==C?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[C,I]})}),e[87]=C,e[88]=A):A=e[88];let P;e[89]!==A||e[90]!==h||e[91]!==S?(P=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,S,A]}),e[89]=A,e[90]=h,e[91]=S,e[92]=P):P=e[92];let $;if(e[93]!==f||e[94]!==o){let V;e[96]!==f?(V=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=V):V=e[97],$=o.map(V),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let z;e[101]!==$||e[102]!==w?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,w]}),e[101]=$,e[102]=w,e[103]=z):z=e[103];let H;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let V;e[108]!==l.theme||e[109]!==c?(V=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=l.theme,e[109]=c,e[110]=V):V=e[110],H=a.map(V),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=H}else H=e[107];let T;e[111]!==H?(T=s.jsx("div",{className:"flex items-center gap-0.5",children:H}),e[111]=H,e[112]=T):T=e[112];const B=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ri),e[113]=c,e[114]=R):R=e[114];const L=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==L?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",L),e[115]=L,e[116]=D):D=e[116];let G;e[117]!==l.enableSounds?(G=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=G):G=e[118];let F;e[119]!==B||e[120]!==R||e[121]!==D||e[122]!==G?(F=s.jsx("button",{type:"button","aria-label":B,onClick:R,className:D,children:G}),e[119]=B,e[120]=R,e[121]=D,e[122]=G,e[123]=F):F=e[123];let E;e[124]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.1"]}),e[124]=E):E=e[124];let W;e[125]!==F?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[125]=F,e[126]=W):W=e[126];let q;e[127]!==T||e[128]!==W?(q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[T,W]}),e[127]=T,e[128]=W,e[129]=q):q=e[129];let X;e[130]!==P||e[131]!==z||e[132]!==q?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[P,z,q]}),e[130]=P,e[131]=z,e[132]=q,e[133]=X):X=e[133];const re=String(p);let Y;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},re)}),e[134]=m,e[135]=u,e[136]=d,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Ri(t){return{...t,enableSounds:!t.enableSounds}}function Di(){Ae.success("User ID copied")}function Ei(t){return{...t,enableSounds:!t.enableSounds}}function Fi(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=Ce.useSession(),{org:n}=fe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Hn(o)?.params.org,[l,c]=Un(),d=Ms(),[u,m]=O.useState(!1),[f,g]=O.useState(!1),p=e?.user,x=p?.image;let h;t[1]!==r?(h=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=h):h=t[2];const v=h;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let b;t[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(pt,{size:16}),t[4]=b):b=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:b,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(lo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(vr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(xo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=C):C=t[12];let I;t[13]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(Kn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=I):I=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(ho,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P={key:"homepage",label:"Homepage",icon:s.jsx(ao,{size:16}),href:"https://decocms.com",external:!0},t[15]=P):P=t[15];let $;t[16]!==S||t[17]!==k?($=[S,...k,_,C,I,A,P],t[16]=S,t[17]=k,t[18]=$):$=t[18];const w=$;let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(co,{size:16}),onClick:Bi},t[19]=z):z=t[19];const H=z;let T;t[20]===Symbol.for("react.memo_cache_sentinel")?(T={value:"light",icon:s.jsx(mo,{size:14}),label:"Light theme"},t[20]=T):T=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B={value:"dark",icon:s.jsx(fo,{size:14}),label:"Dark theme"},t[21]=B):B=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[T,B,{value:"system",icon:s.jsx(uo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const L=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let G;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==p||t[32]!==x?(G={user:p,userImage:x,menuItems:w,signOutItem:H,themeOptions:L,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=p,t[32]=x,t[33]=G):G=t[33];const F=G;let E;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==F?(E=d?s.jsxs(As,{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:Ht(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($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...F})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(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(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Gi,children:s.jsx(xs,{...F})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=F,t[38]=E):E=t[38];let W;t[39]!==f?(W=s.jsx($i,{open:f,onOpenChange:g}),t[39]=f,t[40]=W):W=t[40];let q;return t[41]!==E||t[42]!==W?(q=s.jsxs(s.Fragment,{children:[E,W]}),t[41]=E,t[42]=W,t[43]=q):q=t[43],q}function Gi(t){return t.preventDefault()}function Bi(){Z("signed_out",{source:"account_popover"}),Wn(),Ce.signOut()}function Li({invitation:t}){const[e,n]=O.useState(!1),[r,o]=O.useState(!1),i=Vn(),a=async()=>{n(!0);try{const d=await Ce.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),Yn();let c;try{c=(await Ce.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Ce.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Bs,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Hs,{size:14})})]})]})}function Hi(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 a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{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 Ui(){const t=O.useContext(Xn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function sn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Gr(),o=Ui();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(qi).map(Wi);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Br].sort(Ki).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ki(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Wi(t){return{type:"invitation",invitation:t}}function qi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class nn extends O.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function rn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Vi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();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 a;t[2]!==o?(a=K(o!=null&&rn(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),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]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Yi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Vi,{})})}),t[0]=e):e=t[0],e}function Xi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();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 a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&rn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(qe,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ve,{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(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function on(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=sn(),[i,a]=O.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=h=>h.type==="release"&&h.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{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($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(Oo,{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(Lr,{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(Yt,{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 and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Li,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Hi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=g):g=e[11];let p;return e[12]!==n||e[13]!==g?(p=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=p):p=e[14],p}function ln(){const{redDotCount:t}=sn();return t>0}function Zi(){const t=N.c(6),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(on,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ji(){const t=N.c(8),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{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(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(we,{"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(qe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(on,{children:s.jsxs(Ve,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function el(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Ls,{}),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(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ve,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Ls,{className:"size-4"})})}),s.jsx(qe,{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(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function sl(){const t=N.c(7),e=Te(),{org:n}=fe();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(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function nl(){const t=N.c(9),e=Te(),{org:n}=fe();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(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qe,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(Ve,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function rl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Yi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(el,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(Zi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(sl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(xe,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),s.jsx(nl,{}),s.jsx(Ji,{}),s.jsx(tl,{}),s.jsx(Qi,{})]})}),t[5]=r):r=t[5],r}function ol(){const t=N.c(8),e=Te(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),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 a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function il(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(ll,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=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(Vs,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ll(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function al(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=O.useState(""),{org:a}=fe(),{setTaskId:l}=Es(),c=qs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=Vt,d=qt.globalSearch(a.id,m),e[0]=a.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 g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==g?(p={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=p):p=e[11];const{data:x,isFetching:h}=u(p);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const j=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const b=y;let S;e[16]!==b||e[17]!==l?(S=w=>{b(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=b,e[17]=l,e[18]=S):S=e[18];const k=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qo,{className:"sr-only",children:[s.jsx(Vo,{children:"Search"}),s.jsx(Yo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let C;e[20]!==o?(C=s.jsx(ei,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=C):C=e[21];let I;e[22]!==k||e[23]!==h||e[24]!==j||e[25]!==m?(I=m?h&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Zo,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(Jo,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(il,{virtualMcpId:w.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:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=h,e[24]=j,e[25]=m,e[26]=I):I=e[26];let A;e[27]!==I?(A=s.jsx(ti,{children:I}),e[27]=I,e[28]=A):A=e[28];let P;e[29]!==C||e[30]!==A?(P=s.jsxs(Xo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(si,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[C,A]})]}),e[29]=C,e[30]=A,e[31]=P):P=e[31];let $;return e[32]!==b||e[33]!==n||e[34]!==P?($=s.jsx(Qo,{open:n,onOpenChange:b,children:P}),e[32]=b,e[33]=n,e[34]=P,e[35]=$):$=e[35],$}function cl(t){return t==="owner"||t==="admin"}function dl(){const t=N.c(11),{locator:e}=fe(),n=ni(),{data:r}=Ce.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=qt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=Vt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=cl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[ul]=or(Qt,[Cs]),ce=Cs(),[ml,an]=ul(Qt),cn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=O.useState(!1),c=ce(e),d=nr(r),u=O.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ml,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(rr,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};cn.displayName=Qt;var dn="ContextMenuTrigger",un=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=an(dn,n),a=ce(n),l=O.useRef({x:0,y:0}),c=O.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=O.useRef(0),u=O.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return O.useEffect(()=>u,[u]),O.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Qn,{...a,virtualRef:c}),s.jsx(Zn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});un.displayName=dn;var fl="ContextMenuPortal",mn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(tr,{...r,...n})};mn.displayName=fl;var fn="ContextMenuContent",xn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=an(fn,n),i=ce(n),a=O.useRef(!1);return s.jsx(sr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xn.displayName=fn;var xl="ContextMenuGroup",hl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ir,{...o,...r,ref:e})});hl.displayName=xl;var pl="ContextMenuLabel",gl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});gl.displayName=pl;var bl="ContextMenuItem",hn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(Jn,{...o,...r,ref:e})});hn.displayName=bl;var jl="ContextMenuCheckboxItem",vl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});vl.displayName=jl;var yl="ContextMenuRadioGroup",Sl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});Sl.displayName=yl;var _l="ContextMenuRadioItem",Nl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});Nl.displayName=_l;var Cl="ContextMenuItemIndicator",wl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});wl.displayName=Cl;var kl="ContextMenuSeparator",pn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=kl;var Il="ContextMenuArrow",Ml=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Ml.displayName=Il;var Al="ContextMenuSubTrigger",$l=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});$l.displayName=Al;var Ol="ContextMenuSubContent",Tl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Tl.displayName=Ol;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zl=cn,Pl=un,Rl=mn,Dl=xn,El=hn,Fl=pn;function gn(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(zl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function bn(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(Pl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Rl,{children:s.jsx(Dl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=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 a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(El,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Fl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,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(Ne,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let p;e[10]!==f?(p=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Pr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let h;e[17]!==r||e[18]!==c||e[19]!==n?(h=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(To,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=h):h=e[20];let v;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==h?(v=s.jsxs(s.Fragment,{children:[m,p,x,h]}),e[21]=m,e[22]=p,e[23]=x,e[24]=h,e[25]=v):v=e[25],v}function Gl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=li(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=zo(f),e[0]=f,e[1]=g):g=e[1];const p=g;ci(6e4);const x=a||!!n.trigger_id,h=n.id,v="button",j=0;let y;e[2]!==o?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const b=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==b?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",b),e[4]=b,e[5]=S):S=e[5];let k;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(k=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=k):k=e[10];let _;e[11]!==x?(_=x&&s.jsx(Vs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const C=n.title||"Untitled task";let I;e[13]!==C?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=I):I=e[14];let A;e[15]!==I||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,I]}),e[15]=I,e[16]=_,e[17]=A):A=e[17];let P;e[18]!==p||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(P=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Gl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[p.owner,"/",p.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:di(new Date(n.updated_at))})]}),e[18]=p,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=P):P=e[22];let $;e[23]!==A||e[24]!==P?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,P]}),e[23]=A,e[24]=P,e[25]=$):$=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",z=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let H;e[26]!==i?(H=F=>{F.stopPropagation(),i()},e[26]=i,e[27]=H):H=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(hr,{size:14}),e[28]=T):T=e[28];let B;e[29]!==H?(B=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:T})}),e[29]=H,e[30]=B):B=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(qe,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let L;e[32]!==B?(L=s.jsxs(Ve,{children:[B,R]}),e[32]=B,e[33]=L):L=e[33];let D;e[34]!==z||e[35]!==L?(D=s.jsxs("div",{className:w,children:[z,L]}),e[34]=z,e[35]=L,e[36]=D):D=e[36];let G;return e[37]!==o||e[38]!==$||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==k||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":h,role:v,tabIndex:j,onClick:o,onKeyDown:y,className:S,children:[k,$,D]}),e[37]=o,e[38]=$,e[39]=D,e[40]=y,e[41]=S,e[42]=k,e[43]=n.id,e[44]=G):G=e[44],G}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const yn=4;let At=0;const Kt=[];function Hl(){for(;At<yn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function Sn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Hl()})};At<yn?r():Kt.push(r)})}const Ft=10;function ps(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 a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Ul(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Ul(t,e,n,r)}function Kl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Wl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function ql(t,e){return e===!1?!1:e===!0?!0:t}function Jt(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 Tt=new Map,Mt=new Map;function Vl(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Yl(t,e){Tt.set(t,e)}function Xl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=Sn(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ql(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=fe(),a=Bl(i.id,t,e,n);let l;o[0]!==n?(l=Ll(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=O.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Er(),{threads:f,hasMore:g}=Ds(),p=r??Bt(f,t,e,n),x=Wl(p,g),h=Vl(p,g),v=qs();if(d.identity===a&&d.serverHasMore===null){const _=h??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&h===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Xl(a,async()=>{const _=ps(t,e,0,n,1),C=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:I}=js(C),A=Bt(m.threads.get(),t,e,n);return I===void 0?!1:gs(A,I)},_=>{u(C=>C.identity!==a?C:{...C,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const C=a;u(I=>I.identity===C?{...I,isFetching:!0}:I);try{const I=Bt(f,t,e,n),A=ps(t,e,I,n,Ft),P=await Sn(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:w,totalCount:z}=js(P),H=new Set(f.map(Zl)),T=Ql($,H,t,e,n),B=I;m.mergeThreads($),u(R=>{if(R.identity!==C)return R;let L;return z!==void 0?L=gs(B+T,z):L=$.length===0||T===0?!1:w,Yl(C,L),{...R,isFetching:!1,serverHasMore:L}})}catch(I){const A=I,P=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${P}`),u($=>$.identity===C?{...$,isFetching:!1}:$)}},b=d.isFetching||d.isProbing,S=!c&&!b&&ql(x,d.serverHasMore);let k;return o[2]!==b||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:S,isFetching:b,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=b,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function Zl(t){return t.id}function _n(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:p,groupVisibleCount:x}=t,h=m===void 0?!1:m,v=f===void 0?!1:f,j=ht(n),y=r[0];let b;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(b=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=b):b=e[4];const S=b,k=p?.isDragging?!1:void 0;let _;e[5]!==p?.isDragging||e[6]!==n?(_=V=>{p?.isDragging||V&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=_):_=e[7];const C=!!(y&&o&&y.id===o),I=p?"Drag to reorder":void 0;let A;e[8]!==p?(A=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=A):A=e[9];const P=p&&"cursor-pointer active:cursor-grabbing touch-none",$=p?.isDragging&&"cursor-grabbing";let w;e[10]!==$||e[11]!==P?(w=K("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",P,$),e[10]=$,e[11]=P,e[12]=w):w=e[12];const z=j?.icon??null,H=j?.title??"?";let T;e[13]!==z||e[14]!==H?(T=s.jsx(Oe,{icon:z,name:H,size:"sm+",className:"rounded-lg"}),e[13]=z,e[14]=H,e[15]=T):T=e[15];let B;e[16]!==S||e[17]!==w||e[18]!==T||e[19]!==C||e[20]!==I||e[21]!==A?(B=s.jsx(xe,{children:s.jsx(bn,{asChild:!0,children:s.jsx(ri,{asChild:!0,children:s.jsx(ke,{onClick:S,isActive:C,title:I,...A,className:w,children:T})})})}),e[16]=S,e[17]=w,e[18]=T,e[19]=C,e[20]=I,e[21]=A,e[22]=B):B=e[22];const R=g??Jl;let L;e[23]!==v||e[24]!==h||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(L=s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=h,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=L):L=e[30];let D;e[31]!==B||e[32]!==L?(D=s.jsxs(gn,{children:[B,L]}),e[31]=B,e[32]=L,e[33]=D):D=e[33];const G=j?.title??"Agent";let F;e[34]!==G?(F=s.jsx("span",{className:"truncate",children:G}),e[34]=G,e[35]=F):F=e[35];let E;e[36]!==c||e[37]!==n?(E=()=>c(n),e[36]=c,e[37]=n,e[38]=E):E=e[38];let W;e[39]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:14}),e[39]=W):W=e[39];let q;e[40]!==E?(q=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:W}),e[40]=E,e[41]=q):q=e[41];let X;e[42]!==F||e[43]!==q?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[F,q]}),e[42]=F,e[43]=q,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(re=s.jsx(ea,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(oi,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==D||e[57]!==Y||e[58]!==k||e[59]!==_?(oe=s.jsxs(ii,{open:k,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,Y]}),e[56]=D,e[57]=Y,e[58]=k,e[59]=_,e[60]=oe):oe=e[60],oe}function Jl(){}function ea(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||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(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ta(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Eo},l[1]=u):u=l[1];const m=Po(ls(Do,d),ls(Ro,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=Wr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let p;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(p=v=>{const{active:j,over:y}=v;if(!y||j.id===y.id)return;const b=String(j.id),S=String(y.id);if(!qr(b,S,o))return;const k=Vr(g,b,S),_=Yr(e,n,o,k);e==="org"?Xr(n.orgId,_):Qr(n,_),Z("sidebar_group_reordered",{virtual_mcp_id:b,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=p):p=l[13];const x=p;let h;return l[14]!==x||l[15]!==m||l[16]!==g?(h={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=h):h=l[17],h}function sa(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 na(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:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Ho(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Uo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,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 vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:p}=ta(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let h;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=b=>{const S=d(b);return g.includes(b.virtualMcpId)?s.jsx(na,{id:b.virtualMcpId,children:k=>{const{setNodeRef:_,style:C,isDragging:I,attributes:A,listeners:P}=k;return s.jsx("div",{ref:_,style:C,className:K(I&&"opacity-50"),children:u(S,{attributes:A,listeners:P,isDragging:I})})}},b.virtualMcpId):s.jsx("div",{children:m(S)},b.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],h=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=h}else h=e[5];let v;e[11]!==x||e[12]!==h?(v=s.jsx(Fo,{items:x,strategy:Go,children:h}),e[11]=x,e[12]=h,e[13]=v):v=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==v?(j=s.jsx(Bo,{sensors:f,collisionDetection:Lo,onDragEnd:p,children:v}),e[14]=p,e[15]=f,e[16]=v,e[17]=j):j=e[17],j}function Nn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:p,user:x,toolCallRuns:h}=Zr(n,o,i),v=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=j):j=e[19];const y=j;let b;e[20]!==c||e[21]!==v?(b=v&&s.jsx(sa,{collapsed:c}),e[20]=c,e[21]=v,e[22]=b):b=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:p,...y}),b,s.jsx(vs,{section:"user",groups:x,...y}),h&&m(d(h))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function ra(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:ia,renderSortable:oa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function oa(t,e){return s.jsx(_n,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function ia(t){return s.jsx(_n,{...t},t.virtualMcpId)}const la="sidebar.group.expanded.";function Cn(t,e){const n=N.c(3),[r,o]=pr(`${la}${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 wn(t){const e=N.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:p,sortable:x}=t,h=u===void 0?!1:u,v=m===void 0?!1:m,[j,y]=Cn(n,!1),b=n===Fs,S=x?.isDragging??!1;let k;e[0]!==j||e[1]!==y?(k=function(){y(!j)},e[0]=j,e[1]=y,e[2]=k):k=e[2];const _=k;let C;e[3]!==b||e[4]!==x?(C=x&&!b?{...x.attributes,...x.listeners}:{},e[3]=b,e[4]=x,e[5]=C):C=e[5];let I;e[6]!==_?(I=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),_())},e[6]=_,e[7]=I):I=e[7];const A=x&&!b&&"touch-none active:cursor-grabbing",P=S&&"shadow-md bg-accent/40 cursor-grabbing";let $;e[8]!==A||e[9]!==P?($=K("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",A,P),e[8]=A,e[9]=P,e[10]=$):$=e[10];let w;e[11]!==b||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(ca,{virtualMcpId:n,isToolCallRuns:b})}),e[11]=b,e[12]=n,e[13]=w):w=e[13];let z;e[14]!==j?(z=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:j?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[14]=j,e[15]=z):z=e[15];let H;e[16]!==z||e[17]!==w?(H=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,z]}),e[16]=z,e[17]=w,e[18]=H):H=e[18];let T;e[19]!==b||e[20]!==n?(T=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ua,{virtualMcpId:n,isToolCallRuns:b})}),e[19]=b,e[20]=n,e[21]=T):T=e[21];let B;e[22]!==b||e[23]!==l||e[24]!==n?(B=!b&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E=>{E.stopPropagation(),l(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ne,{size:14})}),e[22]=b,e[23]=l,e[24]=n,e[25]=B):B=e[25];let R;e[26]!==j||e[27]!==_||e[28]!==H||e[29]!==T||e[30]!==B||e[31]!==C||e[32]!==I||e[33]!==$?(R=s.jsxs("div",{...C,role:"button",tabIndex:0,"aria-expanded":j,onClick:_,onKeyDown:I,className:$,children:[H,T,B]}),e[26]=j,e[27]=_,e[28]=H,e[29]=T,e[30]=B,e[31]=C,e[32]=I,e[33]=$,e[34]=R):R=e[34];const L=R;let D;e[35]!==v||e[36]!==L||e[37]!==h||e[38]!==b||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=b?L:s.jsxs(gn,{children:[s.jsx(bn,{asChild:!0,children:L}),s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??aa,onHideGroup:d})})]}),e[35]=v,e[36]=L,e[37]=h,e[38]=b,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let G;e[45]!==o||e[46]!==j||e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(G=j&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:b?r.map(E=>s.jsx(Et,{task:E,isActive:o===E.id,onClick:()=>i(E),onArchive:()=>a(E),showAutomationBadge:!!E.trigger_id},E.id)):s.jsx(fa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:p})}),e[45]=o,e[46]=j,e[47]=g,e[48]=p,e[49]=b,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=G):G=e[55];let F;return e[56]!==D||e[57]!==G?(F=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,G]}),e[56]=D,e[57]=G,e[58]=F):F=e[58],F}function aa(){}function ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(da,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function da(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ua(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ma,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ma(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function fa(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:p}=u,[x,h]=O.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(h(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let j;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ne,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function xa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,p]=O.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==a||e[7]!==i?(j=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let h;e[9]!==m||e[10]!==c||e[11]!==u?(h=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=h):h=e[12];let v;return e[13]!==x||e[14]!==h?(v=s.jsxs(s.Fragment,{children:[x,h]}),e[13]=x,e[14]=h,e[15]=v):v=e[15],v}function ha(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ai[n],d=c.icon,[u,m]=Cn(`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 g=f;let p;e[3]!==g?(p=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let h;e[8]!==u?(h=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(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=h):h=e[9];let v;e[10]!==x||e[11]!==h?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,h]}),e[10]=x,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let b;e[17]!==u||e[18]!==g||e[19]!==p||e[20]!==v||e[21]!==j||e[22]!==y?(b=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,j,y]}),e[17]=u,e[18]=g,e[19]=p,e[20]=v,e[21]=j,e[22]=y,e[23]=b):b=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let k;return e[32]!==b||e[33]!==S?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b,S]}),e[32]=b,e[33]=S,e[34]=k):k=e[34],k}function pa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ba,renderSortable:ga}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ga(t,e){return s.jsx(wn,{...t,sortable:e},t.virtualMcpId)}function ba(t){return s.jsx(wn,{...t},t.virtualMcpId)}function ja(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function va(t,e,n,r,o){const i=N.c(5),a=ja(t,e,r,o),[l,c]=O.useState("");l!==a&&(Jr(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=eo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const kn={all:"All tasks",manual:"Chats",automation:"Automation"},In={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function Mn(){const t=N.c(92),{data:e}=Ce.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Cr(o.id).id,l=zs().filter($a).map(Aa),c=dl(),d=wr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=O.useState(u),g=new Set(l),p={},x=[];let h;t[1]!==m?(h=Object.entries(m),t[1]=m,t[2]=h):h=t[2];for(const[M,U]of h)g.has(M)!==U?p[M]=U:x.push(M);x.length>0&&f(M=>{const U={...M};for(const ne of x)delete U[ne];return U});const v=new Set(l);for(const[M,U]of Object.entries(p))U?v.add(M):v.delete(M);const j=[...v],y=new Set(j),{threads:b}=Ds(),S=b.filter(Ma),{hide:k}=Rs(),_=Te(),{setTaskId:C,createNewTask:I}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const $=Ns(A).taskId??null,w=[...S].sort(Ia),[z,H]=O.useState("all"),[T,B]=O.useState("mine"),[R,L]=O.useState("agent"),[D,G]=O.useState(!1),[F,E]=O.useState(!1),[W,q]=O.useState(0),X=to(),re=W+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,V={type:z,member:T,currentUserId:n??null},J=Kl(w,"agent",V),Q=va(oe,so(w,i),i,j,re);let ee;t[7]!==n||t[8]!==T?(ee=M=>T==="mine"&&n?M.filter(U=>U.created_by===n):M,t[7]=n,t[8]=T,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==z?(se=M=>z==="automation"?M.filter(ka):z==="manual"?M.filter(wa):M,t[10]=z,t[11]=se):se=t[11];const ie=se,le=M=>{const U=M.id===$;if(k(M.id),!U)return;const ne=w.find(Se=>Se.id!==M.id&&Se.virtual_mcp_id===M.virtual_mcp_id);ne?C(ne.id,ne.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==I?(Ie=M=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:M}),I(M)},t[12]=I,t[13]=Ie):Ie=t[13];const ze=Ie,Pe=no();let he;t[14]!==Pe?(he=M=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=he):he=t[15];const Re=he,mt=M=>{if(y.has(M))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:M});const U=Q.find(ne=>ne.virtualMcpId===M);if(U)for(const ne of U.threads)k(ne.id);oo(oe,M,j),q(Ca)},De=async(M,U)=>{if(c&&p[M]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:U}),f(ne=>({...ne,[M]:U}));try{await d.update.mutateAsync({id:M,data:{pinned:U}})}catch{io(oe,M,!U),f(ne=>{const Se={...ne};return delete Se[M],Se})}}},Ee=M=>{const U=M===i||M===Fs;return{isOrgPinned:y.has(M),canManageOrgPin:U?!1:c,onToggleOrgPin:U?void 0:De}},Me=M=>{const U=ie(te(M.threads));return{virtualMcpId:M.virtualMcpId,threads:U,activeTaskId:$,filters:V,groupVisibleCount:J.get(M.virtualMcpId)??0,onSelectTask:ne=>C(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=z!=="all"||T!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=On=>{const Tn=ie(te(On.threads));return!(ae&&Tn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],M=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=M}else M=t[20];const U=M,ne=R==="agent"&&Q.length===0;let Se;t[25]!==ne?(Se=s.jsx(rs,{value:ne}),t[25]=ne,t[26]=Se):Se=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>q(Na),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[Se,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ra,{groups:U,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=R==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(rs,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==G?(ue=()=>{Z("tasks_panel_search_opened"),E(!0),G(!0)},t[30]=G,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Rr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Be=ys[R==="agent"?"status":"agent"];let ge;t[35]!==Be?(ge=Be.toLowerCase(),t[35]=Be,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Le=ys[R];let de;t[37]!==Le?(de=Le.toLowerCase(),t[37]=Le,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==R?(ye=()=>{const M=R==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:M}),L(M)},Ue=R==="agent"?s.jsx(Wo,{size:16}):s.jsx(Dr,{size:16}),t[39]=R,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Ko,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&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"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==T?(et=M=>{const U=M;U!==T&&Z("tasks_panel_member_filter_changed",{to_value:U}),B(U)},t[52]=T,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(In),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(_a)}),t[56]=jt):jt=t[56];let tt;t[57]!==T||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:T,onValueChange:et,children:[gt,jt]})}),t[57]=T,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==z?(st=M=>{const U=M;U!==z&&Z("tasks_panel_filter_changed",{to_value:U}),H(U)},t[60]=z,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(kn),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(Sa)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==z?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:z,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=z,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Xs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const $n="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:ro(ie(te(w))).map(M=>s.jsx(ha,{status:M.status,threads:M.threads,activeTaskId:$,onSelectTask:U=>C(U.id,U.virtual_mcp_id),onArchiveTask:le,filters:V},M.status))}):s.jsx(pa,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:()=>q(ya),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:$n,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==F||t[84]!==D||t[85]!==G?(ct=F&&s.jsx(al,{open:D,onOpenChange:G}),t[83]=F,t[84]=D,t[85]=G,t[86]=ct):ct=t[86];let Nt;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function ya(t){return t+1}function Sa(t){return s.jsx(Ws,{value:t,children:kn[t]},t)}function _a(t){return s.jsx(Ws,{value:t,children:In[t]},t)}function Na(t){return t+1}function Ca(t){return t+1}function wa(t){return!t.trigger_id}function ka(t){return!!t.trigger_id}function Ia(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ma(t){return!t.hidden}function Aa(t){return t.id}function $a(t){return t.pinned}function Ss(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 a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Oa=5,Ta=[{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 An(){const t=N.c(3),{state:e}=Xe();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:Oa}).map(Ra)}),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(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"})]}),s.jsx(_e,{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:Ta.map(za)})]}),t[2]=r):r=t[2],r}function za(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(_e,{className:"size-5 rounded-full shrink-0"}),s.jsx(_e,{className:K("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(Pa)})]},e)}function Pa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(_e,{className:"h-3 flex-1 rounded-sm"})},e)}function Ra(t,e){return s.jsx(_e,{className:"size-10 rounded-lg mx-auto"},e)}function Pc(){const t=N.c(4),e=Qs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(rl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Gs,{children:s.jsx(en,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Rc(t){const e=N.c(5),{onClose:n}=t,r=Qs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ol,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Gs,{children:s.jsx(Mi,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function Dc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{bn as C,Pc as S,Rc as a,Dc as b,It as c,hs as d,jn as e,gn as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as S,c as w,j as r,r as T,bn as A,bt as H,B as P}from"./index-DvjfZyh_.js";import{i as R}from"./LayoutLeft-D2epCZ9e.js";import{u as V,c as D,a as B,T as E,b as z}from"./tooltip-6LKHApWj.js";import{b as W,d as G,S as L,c as q,a as F}from"./sheet-BwH8pS-i.js";const J="15rem",K="18rem",Q="4.5rem",k=T.createContext(null);function O(){const l=T.useContext(k);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function se(l){const e=S.c(19),{children:t,defaultOpen:s,open:a,onOpenChange:i}=l,d=s===void 0?!1:s,n=V(),[o,h]=T.useState(d),[u,g]=T.useState(!1),c=a!==void 0,b=c?a:o;let N;e[0]!==c||e[1]!==i?(N=_=>{c||h(_),i?.(_)},e[0]=c,e[1]=i,e[2]=N):N=e[2];const f=N;let j;e[3]!==n||e[4]!==b||e[5]!==f?(j=()=>{n?g(U):f(!b)},e[3]=n,e[4]=b,e[5]=f,e[6]=j):j=e[6];const y=j,m=b?"expanded":"collapsed";let p;e[7]!==n||e[8]!==b||e[9]!==u||e[10]!==f||e[11]!==m||e[12]!==y?(p={state:m,open:b,setOpen:f,isMobile:n,openMobile:u,setOpenMobile:g,toggleSidebar:y},e[7]=n,e[8]=b,e[9]=u,e[10]=f,e[11]=m,e[12]=y,e[13]=p):p=e[13];const v=p;let x;e[14]!==t?(x=r.jsx(D,{delayDuration:0,children:t}),e[14]=t,e[15]=x):x=e[15];let C;return e[16]!==v||e[17]!==x?(C=r.jsx(k.Provider,{value:v,children:x}),e[16]=v,e[17]=x,e[18]=C):C=e[18],C}function U(l){return!l}function ie(l){const e=S.c(14);let t,s,a,i;e[0]!==l?({className:s,style:i,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i):(t=e[1],s=e[2],a=e[3],i=e[4]);let d;e[5]!==i?(d={"--sidebar-width":J,"--sidebar-width-icon":Q,...i},e[5]=i,e[6]=d):d=e[6];const n=d;let o;e[7]!==s?(o=w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=o):o=e[8];let h;return e[9]!==t||e[10]!==a||e[11]!==n||e[12]!==o?(h=r.jsx("div",{"data-slot":"sidebar-wrapper",style:n,className:o,...a,children:t}),e[9]=t,e[10]=a,e[11]=n,e[12]=o,e[13]=h):h=e[13],h}function le(l){const e=S.c(36);let t,s,a,i,d;e[0]!==l?({side:i,variant:d,className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5]);const n=i===void 0?"left":i,o=d===void 0?"sidebar":d,{isMobile:h,state:u,openMobile:g,setOpenMobile:c}=O();if(h){let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":K},e[6]=C):C=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsxs(G,{className:"sr-only",children:[r.jsx(L,{children:"Sidebar"}),r.jsx(q,{children:"Displays the mobile sidebar."})]}),e[7]=_):_=e[7];let $;e[8]!==t?($=r.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let M;e[10]!==n||e[11]!==$?(M=r.jsxs(F,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:n,children:[_,$]}),e[10]=n,e[11]=$,e[12]=M):M=e[12];let I;return e[13]!==g||e[14]!==a||e[15]!==c||e[16]!==M?(I=r.jsx(W,{open:g,onOpenChange:c,...a,children:M}),e[13]=g,e[14]=a,e[15]=c,e[16]=M,e[17]=I):I=e[17],I}const b=u==="expanded",N=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let f;e[18]!==N?(f=w("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",N),e[18]=N,e[19]=f):f=e[19];const j=b?void 0:"icon",y=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let m;e[20]!==s||e[21]!==y?(m=w("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",y,s),e[20]=s,e[21]=y,e[22]=m):m=e[22];let p;e[23]!==t?(p=r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=p):p=e[24];let v;e[25]!==a||e[26]!==m||e[27]!==p?(v=r.jsx("div",{"data-slot":"sidebar-container",className:m,...a,children:p}),e[25]=a,e[26]=m,e[27]=p,e[28]=v):v=e[28];let x;return e[29]!==n||e[30]!==u||e[31]!==f||e[32]!==j||e[33]!==v||e[34]!==o?(x=r.jsx("div",{className:f,"data-state":u,"data-collapsible":j,"data-variant":o,"data-side":n,"data-slot":"sidebar",children:v}),e[29]=n,e[30]=u,e[31]=f,e[32]=j,e[33]=v,e[34]=o,e[35]=x):x=e[35],x}function re(l){const e=S.c(18);let t,s,a;e[0]!==l?({className:t,onClick:s,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:i}=O();let d;e[4]!==t?(d=w("size-7",t),e[4]=t,e[5]=d):d=e[5];let n;e[6]!==s||e[7]!==i?(n=b=>{s?.(b),i()},e[6]=s,e[7]=i,e[8]=n):n=e[8];let o,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(R,{}),h=r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=o,e[10]=h):(o=e[9],h=e[10]);let u;e[11]!==a||e[12]!==d||e[13]!==n?(u=r.jsx(E,{asChild:!0,children:r.jsxs(P,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d,onClick:n,...a,children:[o,h]})}),e[11]=a,e[12]=d,e[13]=n,e[14]=u):u=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsxs(B,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",r.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(X)})]}),e[15]=g):g=e[15];let c;return e[16]!==u?(c=r.jsx(D,{delayDuration:300,children:r.jsxs(z,{children:[u,g]})}),e[16]=u,e[17]=c):c=e[17],c}function X(l){return r.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:l},l)}function ne(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function oe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function de(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ce(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function fe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ue(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function pe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function be(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function me(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}const Y=H("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:max-w-[calc(var(--sidebar-width-icon)-1rem)]! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function xe(l){const e=S.c(28);let t,s,a,i,d,n,o;e[0]!==l?({asChild:a,isActive:i,variant:d,size:n,tooltip:o,className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d,e[6]=n,e[7]=o):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5],n=e[6],o=e[7]);const h=a===void 0?!1:a,u=i===void 0?!1:i,g=d===void 0?"default":d,c=n===void 0?"default":n,b=h?A:"button",{isMobile:N}=O();let f;e[8]!==t||e[9]!==c||e[10]!==g?(f=w(Y({variant:g,size:c}),t),e[8]=t,e[9]=c,e[10]=g,e[11]=f):f=e[11];let j;e[12]!==b||e[13]!==u||e[14]!==s||e[15]!==c||e[16]!==f?(j=r.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":c,"data-active":u,className:f,...s}),e[12]=b,e[13]=u,e[14]=s,e[15]=c,e[16]=f,e[17]=j):j=e[17];const y=j;if(!o)return y;if(typeof o=="string"){let x;e[18]!==o?(x={children:o},e[18]=o,e[19]=x):x=e[19],o=x}let m;e[20]!==y?(m=r.jsx(E,{asChild:!0,children:y}),e[20]=y,e[21]=m):m=e[21];let p;e[22]!==N||e[23]!==o?(p=r.jsx(B,{side:"right",align:"center",hidden:N,...o}),e[22]=N,e[23]=o,e[24]=p):p=e[24];let v;return e[25]!==m||e[26]!==p?(v=r.jsxs(z,{children:[m,p]}),e[25]=m,e[26]=p,e[27]=v):v=e[27],v}export{ne as S,ie as a,se as b,me as c,xe as d,ue as e,pe as f,be as g,ce as h,fe as i,le as j,oe as k,de as l,re as m,O as u};
|
|
1
|
+
import{e as S,c as w,j as r,r as T,bn as A,bt as H,B as P}from"./index-rZ1TPVyD.js";import{i as R}from"./LayoutLeft-C7Cmt2J8.js";import{u as V,c as D,a as B,T as E,b as z}from"./tooltip-ua4lJTzI.js";import{b as W,d as G,S as L,c as q,a as F}from"./sheet-Dsfk9URc.js";const J="15rem",K="18rem",Q="4.5rem",k=T.createContext(null);function O(){const l=T.useContext(k);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function se(l){const e=S.c(19),{children:t,defaultOpen:s,open:a,onOpenChange:i}=l,d=s===void 0?!1:s,n=V(),[o,h]=T.useState(d),[u,g]=T.useState(!1),c=a!==void 0,b=c?a:o;let N;e[0]!==c||e[1]!==i?(N=_=>{c||h(_),i?.(_)},e[0]=c,e[1]=i,e[2]=N):N=e[2];const f=N;let j;e[3]!==n||e[4]!==b||e[5]!==f?(j=()=>{n?g(U):f(!b)},e[3]=n,e[4]=b,e[5]=f,e[6]=j):j=e[6];const y=j,m=b?"expanded":"collapsed";let p;e[7]!==n||e[8]!==b||e[9]!==u||e[10]!==f||e[11]!==m||e[12]!==y?(p={state:m,open:b,setOpen:f,isMobile:n,openMobile:u,setOpenMobile:g,toggleSidebar:y},e[7]=n,e[8]=b,e[9]=u,e[10]=f,e[11]=m,e[12]=y,e[13]=p):p=e[13];const v=p;let x;e[14]!==t?(x=r.jsx(D,{delayDuration:0,children:t}),e[14]=t,e[15]=x):x=e[15];let C;return e[16]!==v||e[17]!==x?(C=r.jsx(k.Provider,{value:v,children:x}),e[16]=v,e[17]=x,e[18]=C):C=e[18],C}function U(l){return!l}function ie(l){const e=S.c(14);let t,s,a,i;e[0]!==l?({className:s,style:i,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i):(t=e[1],s=e[2],a=e[3],i=e[4]);let d;e[5]!==i?(d={"--sidebar-width":J,"--sidebar-width-icon":Q,...i},e[5]=i,e[6]=d):d=e[6];const n=d;let o;e[7]!==s?(o=w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=o):o=e[8];let h;return e[9]!==t||e[10]!==a||e[11]!==n||e[12]!==o?(h=r.jsx("div",{"data-slot":"sidebar-wrapper",style:n,className:o,...a,children:t}),e[9]=t,e[10]=a,e[11]=n,e[12]=o,e[13]=h):h=e[13],h}function le(l){const e=S.c(36);let t,s,a,i,d;e[0]!==l?({side:i,variant:d,className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5]);const n=i===void 0?"left":i,o=d===void 0?"sidebar":d,{isMobile:h,state:u,openMobile:g,setOpenMobile:c}=O();if(h){let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":K},e[6]=C):C=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsxs(G,{className:"sr-only",children:[r.jsx(L,{children:"Sidebar"}),r.jsx(q,{children:"Displays the mobile sidebar."})]}),e[7]=_):_=e[7];let $;e[8]!==t?($=r.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let M;e[10]!==n||e[11]!==$?(M=r.jsxs(F,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:n,children:[_,$]}),e[10]=n,e[11]=$,e[12]=M):M=e[12];let I;return e[13]!==g||e[14]!==a||e[15]!==c||e[16]!==M?(I=r.jsx(W,{open:g,onOpenChange:c,...a,children:M}),e[13]=g,e[14]=a,e[15]=c,e[16]=M,e[17]=I):I=e[17],I}const b=u==="expanded",N=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let f;e[18]!==N?(f=w("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",N),e[18]=N,e[19]=f):f=e[19];const j=b?void 0:"icon",y=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let m;e[20]!==s||e[21]!==y?(m=w("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",y,s),e[20]=s,e[21]=y,e[22]=m):m=e[22];let p;e[23]!==t?(p=r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=p):p=e[24];let v;e[25]!==a||e[26]!==m||e[27]!==p?(v=r.jsx("div",{"data-slot":"sidebar-container",className:m,...a,children:p}),e[25]=a,e[26]=m,e[27]=p,e[28]=v):v=e[28];let x;return e[29]!==n||e[30]!==u||e[31]!==f||e[32]!==j||e[33]!==v||e[34]!==o?(x=r.jsx("div",{className:f,"data-state":u,"data-collapsible":j,"data-variant":o,"data-side":n,"data-slot":"sidebar",children:v}),e[29]=n,e[30]=u,e[31]=f,e[32]=j,e[33]=v,e[34]=o,e[35]=x):x=e[35],x}function re(l){const e=S.c(18);let t,s,a;e[0]!==l?({className:t,onClick:s,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:i}=O();let d;e[4]!==t?(d=w("size-7",t),e[4]=t,e[5]=d):d=e[5];let n;e[6]!==s||e[7]!==i?(n=b=>{s?.(b),i()},e[6]=s,e[7]=i,e[8]=n):n=e[8];let o,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(R,{}),h=r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=o,e[10]=h):(o=e[9],h=e[10]);let u;e[11]!==a||e[12]!==d||e[13]!==n?(u=r.jsx(E,{asChild:!0,children:r.jsxs(P,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d,onClick:n,...a,children:[o,h]})}),e[11]=a,e[12]=d,e[13]=n,e[14]=u):u=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsxs(B,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",r.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(X)})]}),e[15]=g):g=e[15];let c;return e[16]!==u?(c=r.jsx(D,{delayDuration:300,children:r.jsxs(z,{children:[u,g]})}),e[16]=u,e[17]=c):c=e[17],c}function X(l){return r.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:l},l)}function ne(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function oe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function de(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ce(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function fe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ue(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function pe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function be(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function me(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}const Y=H("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:max-w-[calc(var(--sidebar-width-icon)-1rem)]! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function xe(l){const e=S.c(28);let t,s,a,i,d,n,o;e[0]!==l?({asChild:a,isActive:i,variant:d,size:n,tooltip:o,className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d,e[6]=n,e[7]=o):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5],n=e[6],o=e[7]);const h=a===void 0?!1:a,u=i===void 0?!1:i,g=d===void 0?"default":d,c=n===void 0?"default":n,b=h?A:"button",{isMobile:N}=O();let f;e[8]!==t||e[9]!==c||e[10]!==g?(f=w(Y({variant:g,size:c}),t),e[8]=t,e[9]=c,e[10]=g,e[11]=f):f=e[11];let j;e[12]!==b||e[13]!==u||e[14]!==s||e[15]!==c||e[16]!==f?(j=r.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":c,"data-active":u,className:f,...s}),e[12]=b,e[13]=u,e[14]=s,e[15]=c,e[16]=f,e[17]=j):j=e[17];const y=j;if(!o)return y;if(typeof o=="string"){let x;e[18]!==o?(x={children:o},e[18]=o,e[19]=x):x=e[19],o=x}let m;e[20]!==y?(m=r.jsx(E,{asChild:!0,children:y}),e[20]=y,e[21]=m):m=e[21];let p;e[22]!==N||e[23]!==o?(p=r.jsx(B,{side:"right",align:"center",hidden:N,...o}),e[22]=N,e[23]=o,e[24]=p):p=e[24];let v;return e[25]!==m||e[26]!==p?(v=r.jsxs(z,{children:[m,p]}),e[25]=m,e[26]=p,e[27]=v):v=e[27],v}export{ne as S,ie as a,se as b,me as c,xe as d,ue as e,pe as f,be as g,ce as h,fe as i,le as j,oe as k,de as l,re as m,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c,j as i}from"./index-
|
|
1
|
+
import{e as n,c,j as i}from"./index-rZ1TPVyD.js";function m(o){const e=n.c(8);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=c("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=l):l=e[4];let a;return e[5]!==t||e[6]!==l?(a=i.jsx("div",{"data-slot":"skeleton",className:l,...t}),e[5]=t,e[6]=l,e[7]=a):a=e[7],a}export{m as S};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{q as Ft,b as Tn,u as mr,H as vr,I as br,j as i,B as He,o as Le,r as u,G as xr,f as yr,l as At,M as Yt,J as Ht,t as Q,K as ht,e as wr,p as Cr,L as Sr,c as Dr,n as Rr,b5 as B,aU as ft}from"./index-rZ1TPVyD.js";import{g as jr}from"./connection-slug-eyAPH6o3.js";import{u as _n,a as On,g as Nr,C as Wt}from"./connection-card-BioQsepZ.js";import{C as Ir}from"./collection-search-CjkYy_AH.js";import{C as Ar}from"./collection-tabs-BGsvaOVA.js";import{g as Er}from"./generate-id-nWw_PZwJ.js";import{D as Mn,a as Pn,b as Ln,c as Fn,e as kr,d as Tr}from"./dialog-CxpeEAA2.js";import{b as _r,a as Or,c as Mr,D as Pr,d as Lr,e as Fr,f as zr}from"./drawer-R-Q-vfsa.js";import{u as Br,b as qt,T as Gt,a as Jt}from"./tooltip-ua4lJTzI.js";import{F as De,b as Re,c as je,d as Ne,f as Ie,a as hn}from"./form-Ci8PGt-R.js";import{I as Ye}from"./input-BPXWlz46.js";import{d as $r,S as Vr,a as Xr,b as Kr,c as ut}from"./select-DRqZIuLQ.js";import{T as Ur}from"./textarea-Bymi75yx.js";import{b as zn}from"./use-connection-CyWLUiRu.js";import{n as Et}from"./Container-Bl0qWNtu.js";import{s as Qt}from"./Star01-QoJ-qcfh.js";import{S as Yr}from"./agent-icon-CpBAbwoh.js";import{s as Hr}from"./XClose-D0wmxYTF.js";import{c as Wr,i as Dt,a as pn,E as qr,p as Gr,b as Jr,d as Qr}from"./connection-form-helpers-DC_9yJsF.js";import{u as gn}from"./use-infinite-scroll-B2zyjKex.js";import{u as Zr}from"./useSuspenseInfiniteQuery-DGO3SU3a.js";import{a as eo,u as to}from"./use-mcp-client-CGBZ7ekq.js";import{g as no,e as ro,a as oo}from"./extract-connection-data-BJ4lD3eO.js";import{B as Rt}from"./badge-CY1rqnYU.js";import{c as Zt}from"./XCircle-CiiIVhRh.js";import{i as mn}from"./Check-6LmIKXJj.js";import{s as so}from"./Plus-Do6ZWheh.js";import{u as io}from"./studio-tools-jbRVdtpc.js";import{u as ao}from"./use-ai-providers-P6PF7YRx.js";function co({open:t,onOpenChange:e,onCreated:n}){const{org:r}=Ft(),{data:o}=Tn.useSession(),{stdioEnabled:s}=mr(),a=Br(),c=zn(),l=_n(),h=On(l,"").items,d=vr({resolver:br(Wr),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),b=d.watch("connection_url"),N=d.watch("npx_package"),x=Dt({uiType:g,connectionUrl:b??"",npxPackage:N??""})??pn({uiType:g,connectionUrl:b??"",registryItems:h}),v=m=>{const p=m.trim();if(!p)return;const y=!!d.formState.dirtyFields.title,T=!!d.formState.dirtyFields.description,I=!!d.formState.dirtyFields.env_vars,S=O=>{if(O&&(!y&&!d.getValues("title").trim()&&O.title&&d.setValue("title",O.title,{shouldDirty:!1}),!T&&!(d.getValues("description")??"").trim()&&O.description&&d.setValue("description",O.description,{shouldDirty:!1}),!I&&O.envVarKeys?.length)){const U=d.getValues("env_vars")??[],$=new Set(U.map(V=>V.key)),P=O.envVarKeys.filter(V=>!$.has(V));P.length>0&&d.setValue("env_vars",[...U,...P.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},A=Gr(p);if(A&&s){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",A.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),S(Dt({uiType:"NPX",npxPackage:A.packageName}));return}if(p.startsWith("http://")||p.startsWith("https://")){const O=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",O,{shouldDirty:!0}),d.setValue("connection_url",p,{shouldDirty:!0}),S(Dt({uiType:O,connectionUrl:p})??pn({uiType:O,connectionUrl:p,registryItems:h}));return}g==="NPX"&&S(Dt({uiType:"NPX",npxPackage:p}))},R=m=>{m||d.reset(),e(m)},w=async m=>{let p,y=null,T=null,I=null;m.ui_type==="NPX"?(p="STDIO",y="",I=Jr(m.npx_package||"",m.env_vars||[])):m.ui_type==="STDIO"?(p="STDIO",y="",I=Qr(m.stdio_command||"",m.stdio_args||"",m.stdio_cwd,m.env_vars||[])):(p=m.ui_type,y=m.connection_url||"",T=m.connection_token||null);const S=Er("conn");try{await c.create.mutateAsync({id:S,title:m.title,description:m.description||null,connection_type:p,connection_url:y,connection_token:T,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:r.id,icon:m.icon??null,app_name:null,app_id:null,connection_headers:I,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),n?.(S)}catch{Le.error("Failed to create connection")}},C="Create Connection",j="Create a custom connection in your organization. Fill in the details below.",k=d.formState.isSubmitting?"Saving...":"Create Connection",E=i.jsxs("div",{className:"grid gap-4",children:[i.jsx(De,{control:d.control,name:"ui_type",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Type *"}),i.jsxs($r,{value:m.value,onValueChange:m.onChange,children:[i.jsx(Ne,{children:i.jsx(Vr,{children:i.jsx(Xr,{})})}),i.jsxs(Kr,{children:[i.jsx(ut,{value:"HTTP",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Qt,{className:"w-4 h-4"}),"HTTP"]})}),i.jsx(ut,{value:"SSE",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Qt,{className:"w-4 h-4"}),"SSE"]})}),i.jsx(ut,{value:"Websocket",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Qt,{className:"w-4 h-4"}),"Websocket"]})}),s&&i.jsxs(i.Fragment,{children:[i.jsx(ut,{value:"NPX",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Et,{className:"w-4 h-4"}),"NPX Package"]})}),i.jsx(ut,{value:"STDIO",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Yr,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),i.jsx(Ie,{})]})}),g==="NPX"&&i.jsx(De,{control:d.control,name:"npx_package",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"NPM Package *"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"@perplexity-ai/mcp-server",...m,value:m.value??"",onPaste:p=>{const y=p.clipboardData.getData("text");y&&(p.preventDefault(),d.setValue("npx_package",y.trim(),{shouldDirty:!0}),v(y))},onBlur:p=>{v(p.target.value),m.onBlur()}})}),i.jsx(Ie,{})]})}),g==="STDIO"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[i.jsx(De,{control:d.control,name:"stdio_command",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Command *"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"node, bun, python...",...m,value:m.value??""})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"stdio_args",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Arguments"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"arg1 arg2 --flag value",...m,value:m.value??""})}),i.jsx(Ie,{})]})})]}),i.jsx(De,{control:d.control,name:"stdio_cwd",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Working Directory"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"/path/to/project (optional)",...m,value:m.value??""})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),i.jsx(Ie,{})]})})]}),(g==="NPX"||g==="STDIO")&&i.jsx(De,{control:d.control,name:"env_vars",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Environment Variables"}),i.jsx(Ne,{children:i.jsx(qr,{value:m.value??[],onChange:m.onChange})}),i.jsx(Ie,{})]})}),g!=="NPX"&&g!=="STDIO"&&i.jsxs(i.Fragment,{children:[i.jsx(De,{control:d.control,name:"connection_url",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"URL *"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"https://example.com/mcp",...m,value:m.value??"",onPaste:p=>{const y=p.clipboardData.getData("text");y&&(p.preventDefault(),d.setValue("connection_url",y.trim(),{shouldDirty:!0}),v(y))},onBlur:p=>{v(p.target.value),m.onBlur()}})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"connection_token",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:x?.token?.label??"Token (optional)"}),i.jsx(Ne,{children:i.jsx(Ye,{type:"password",placeholder:x?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...m,value:m.value??""})}),x?.token?.helperText&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&i.jsxs(i.Fragment,{children:[" ","·"," ",i.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),i.jsx(Ie,{})]})})]}),i.jsx(De,{control:d.control,name:"title",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Name *"}),i.jsx(Ne,{children:i.jsx(Ye,{placeholder:"My Connection",...m})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"description",render:({field:m})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Description"}),i.jsx(Ne,{children:i.jsx(Ur,{placeholder:"A brief description of this connection",rows:3,...m,value:m.value??""})}),i.jsx(Ie,{})]})})]});return a?i.jsx(_r,{open:t,onOpenChange:R,children:i.jsxs(Or,{className:"max-h-[90vh]",children:[i.jsx(Mr,{className:"pb-2",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 text-left",children:[i.jsx(Pr,{children:C}),i.jsx(Lr,{className:"mt-1",children:j})]}),i.jsx(Fr,{asChild:!0,children:i.jsx(He,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:i.jsx(Hr,{size:16})})})]})}),i.jsx(hn,{...d,children:i.jsxs("form",{onSubmit:d.handleSubmit(w),children:[i.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:E}),i.jsx(zr,{children:i.jsx(He,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):i.jsx(Mn,{open:t,onOpenChange:R,children:i.jsxs(Pn,{className:"sm:max-w-[525px]",children:[i.jsxs(Ln,{children:[i.jsx(Fn,{children:C}),i.jsx(kr,{children:j})]}),i.jsx(hn,{...d,children:i.jsxs("form",{onSubmit:d.handleSubmit(w),children:[i.jsx("div",{className:"py-4",children:E}),i.jsxs(Tr,{children:[i.jsx(He,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),i.jsx(He,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function lo(t){const e=wr.c(73),{mode:n,agentId:r,addedConnectionIds:o,onAdd:s,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:l,search:f,onCreateConnection:h,onBrowseNavigate:d,defaultTab:g}=t,b=n===void 0?"add":n,N=g===void 0?"connected":g,{org:x}=Ft(),v=u.useDeferredValue(f),R=f!==v,w=v.trim().toLowerCase();let C;e[0]!==N?(C=D=>D??N,e[0]=N,e[1]=C):C=e[1];const[j,k]=Cr(Sr.connectionsTab(x.slug)+(N==="all"?":home-modal":":agent-modal"),C);let E;e[2]!==j||e[3]!==k?(E=D=>{D!==j&&Q("connections_dialog_tab_changed",{to_tab:D}),k(D)},e[2]=j,e[3]=k,e[4]=E):E=e[4];const m=E;let p;e[5]!==x.id||e[6]!==x.slug?(p={connectionId:eo,orgId:x.id,orgSlug:x.slug},e[5]=x.id,e[6]=x.slug,e[7]=p):p=e[7];const y=to(p);let T,I,S;if(e[8]!==y||e[9]!==v||e[10]!==x.id){S=v?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:v.trim()},{field:["description"],operator:"contains",value:v.trim()}]}:void 0;const D={...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},L=JSON.stringify(D);I=Zr,T=ht.collectionListInfinite(y,x.id,"","CONNECTIONS",L),e[8]=y,e[9]=v,e[10]=x.id,e[11]=T,e[12]=I,e[13]=S}else T=e[11],I=e[12],S=e[13];let A;e[14]!==y||e[15]!==S?(A=async D=>{const{pageParam:L}=D,de=L===void 0?0:L;return(await y.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...S&&{where:S},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:de}})).structuredContent},e[14]=y,e[15]=S,e[16]=A):A=e[16];let O;e[17]!==T||e[18]!==A?(O={queryKey:T,queryFn:A,initialPageParam:0,getNextPageParam:mo,staleTime:3e4},e[17]=T,e[18]=A,e[19]=O):O=e[19];const{data:U,fetchNextPage:$,hasNextPage:P,isFetchingNextPage:V}=I(O),re=U?.pages.flatMap(go)??[],xe=Nr(re),qe=new Set(re.filter(po).map(ho)),X=_n(),H=On(X,v),he=gn(H.loadMore,H.hasMore,H.isLoadingMore),Ae=gn($,P??!1,V),F=j==="all"||!!w,Ue=F?H.items.filter(D=>{const L=no(D);if(L&&qe.has(L))return!1;if(!w)return!0;const de=D._meta?.["mcp.mesh"];return[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,de?.friendly_name,de?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(w)}):[],ee=Ue.filter(fo),q=Ue.filter(uo);let M;e[20]!==o?(M=D=>D.some(L=>o.has(L.id)),e[20]=o,e[21]=M):M=e[21];const Ee=M;let G;e[22]!==o||e[23]!==r||e[24]!==l||e[25]!==Ee||e[26]!==b||e[27]!==s||e[28]!==d||e[29]!==a?(G=(D,L,de,ze,me)=>{const Ze=Ee(me),Be=me.find(z=>!o.has(z.id)),ne=me[0];if(b==="browse"){const z=jr(ne);return i.jsx(Wt,{connection:{title:L,icon:de,description:me.length>1?`${me.length} instances`:ze??void 0},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs(Rt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[i.jsx(mn,{size:11})," Connected"]}),onClick:()=>{Q("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:me.length}),d?.(z)}},D)}return i.jsx(Wt,{connection:{title:L,icon:de,description:ze},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs("div",{className:"flex items-center gap-1.5",children:[Ze&&i.jsxs(Rt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[i.jsx(mn,{size:11})," Added"]}),i.jsx(He,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:z=>{z.stopPropagation(),Be?(Q("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Be.id}),r&&Q("agent_connection_attached",{agent_id:r,connection_id:Be.id,app_name:ne.app_name??null,mode:"existing"}),s(Be.id)):(Q("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),a(ne))},children:"Add"})]})},D)},e[22]=o,e[23]=r,e[24]=l,e[25]=Ee,e[26]=b,e[27]=s,e[28]=d,e[29]=a,e[30]=G):G=e[30];const pe=G;let te;e[31]!==l||e[32]!==b||e[33]!==c?(te=D=>{const L=D._meta?.["mcp.mesh"],de=L?.friendlyName||L?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ze=D.server?.description||D.description||null,me=D.server?.icons?.[0]?.src||oo(D.server?.repository)||null,Ze=L?.official===!0,Be=L?.verified===!0,ne=L?.owner==="deco";return i.jsx(Wt,{connection:{title:de,description:ze,icon:me},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&i.jsxs(qt,{children:[i.jsx(Gt,{asChild:!0,children:i.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:i.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),i.jsx(Jt,{children:"Built and maintained by Deco"})]}),!ne&&Ze&&i.jsxs(qt,{children:[i.jsx(Gt,{asChild:!0,children:i.jsx(Rt,{variant:"outline",size:"icon",children:i.jsx(Zt,{})})}),i.jsx(Jt,{children:"Built and maintained by the official vendor"})]}),!ne&&!Ze&&Be&&i.jsxs(qt,{children:[i.jsx(Gt,{asChild:!0,children:i.jsx(Rt,{variant:"outline",size:"icon",children:i.jsx(Zt,{})})}),i.jsx(Jt,{children:"Verified by the Deco team"})]}),i.jsx(He,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:z=>{z.stopPropagation(),Q("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:L?.friendlyName||D.server?.name||D.name||null}),c(D)},children:l===D.id?i.jsx(At,{size:14,className:"animate-spin"}):b==="browse"?"Connect":"Add"})]})},`catalog-${D.id}`)},e[31]=l,e[32]=b,e[33]=c,e[34]=te):te=e[34];const ke=te,ye=!w&&i.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[i.jsx(Ar,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:D=>m(D)}),i.jsxs(He,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Q("connections_dialog_custom_clicked"),h()},children:[i.jsx(so,{size:12}),"Custom Connection"]})]}),Ge=R&&"opacity-50 pointer-events-none";let Te;e[35]!==Ge?(Te=Dr("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[35]=Ge,e[36]=Te):Te=e[36];const st="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let oe;e[37]!==pe?(oe=D=>{if(D.type==="group")return pe(D.key,D.title,D.icon,null,D.connections);const L=D.connection;return pe(L.id,L.title,L.icon,L.description??null,[L])},e[37]=pe,e[38]=oe):oe=e[38];const Fe=xe.map(oe);let ge;e[39]!==Ae?(ge=i.jsx("div",{ref:Ae,className:"col-span-full h-1"}),e[39]=Ae,e[40]=ge):ge=e[40];let _e;e[41]!==V?(_e=V&&i.jsx("div",{className:"col-span-full flex justify-center py-6",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),e[41]=V,e[42]=_e):_e=e[42];const Je=F&&ee.length>0&&i.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[i.jsx(Zt,{size:13,className:"text-muted-foreground shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),i.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=F&&ee.map(ke),at=F&&q.length>0&&i.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[i.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),i.jsx("div",{className:"flex-1 h-px bg-border"})]}),we=F&&q.map(ke);let se;e[43]!==he||e[44]!==X||e[45]!==F?(se=F&&X.length>0&&i.jsx("div",{ref:he,className:"col-span-full h-1"}),e[43]=he,e[44]=X,e[45]=F,e[46]=se):se=e[46];let le;e[47]!==H.isLoadingMore||e[48]!==F?(le=F&&H.isLoadingMore&&i.jsx("div",{className:"col-span-full flex justify-center py-6",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),e[47]=H.isLoadingMore,e[48]=F,e[49]=le):le=e[49];let Oe;e[50]!==Fe||e[51]!==ge||e[52]!==_e||e[53]!==Je||e[54]!==it||e[55]!==at||e[56]!==we||e[57]!==se||e[58]!==le?(Oe=i.jsxs("div",{className:st,children:[Fe,ge,_e,Je,it,at,we,se,le]}),e[50]=Fe,e[51]=ge,e[52]=_e,e[53]=Je,e[54]=it,e[55]=at,e[56]=we,e[57]=se,e[58]=le,e[59]=Oe):Oe=e[59];let J;e[60]!==j||e[61]!==xe.length||e[62]!==q||e[63]!==f||e[64]!==ee?(J=xe.length===0&&ee.length===0&&q.length===0&&i.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:f?`No connections match "${f}"`:j==="connected"?"No connections yet":"No connections available"}),e[60]=j,e[61]=xe.length,e[62]=q,e[63]=f,e[64]=ee,e[65]=J):J=e[65];let Me;e[66]!==Te||e[67]!==Oe||e[68]!==J?(Me=i.jsxs("div",{className:Te,children:[Oe,J]}),e[66]=Te,e[67]=Oe,e[68]=J,e[69]=Me):Me=e[69];let Qe;return e[70]!==ye||e[71]!==Me?(Qe=i.jsxs(i.Fragment,{children:[ye,Me]}),e[70]=ye,e[71]=Me,e[72]=Qe):Qe=e[72],Qe}function uo(t){return!t.verified&&!t._meta?.["mcp.mesh"]?.verified&&!t.meta?.verified}function fo(t){return t.verified||t._meta?.["mcp.mesh"]?.verified||t.meta?.verified}function ho(t){return t.app_name}function po(t){return t.app_name}function go(t){return t?.items??[]}function mo(t,e){if(t?.hasMore)return e.reduce(vo,0)}function vo(t,e){return t+(e?.items?.length??0)}function Mi({open:t,onOpenChange:e,defaultTab:n,initialSearch:r="",...o}){const s=o.mode??"add",a="agentId"in o?o.agentId:void 0,c="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,l="onAdd"in o&&o.onAdd?o.onAdd:p=>{},f=(p,y,T)=>{a&&Q("agent_connection_attached",{agent_id:a,connection_id:p,app_name:y,mode:T})},[h,d]=u.useState(null),[g,b]=u.useState(r),[N,x]=u.useState(!1),{org:v}=Ft(),{data:R}=Tn.useSession(),w=zn(),C=xr(),j=yr(),k=p=>{e(!1),j({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:p}})},E=async p=>{d(p.app_name??p.id);try{const T=`${p.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,S=(await w.create.mutateAsync({title:T,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null})).id,A=new URL(`/api/${v.slug}/mcp/${S}`,window.location.origin),O=await Yt({url:A.href,token:null,orgId:v.id});if(O.supportsOAuth&&!O.isAuthenticated){const{token:U,tokenInfo:$,error:P}=await Ht({connectionId:S,orgSlug:v.slug,scope:"offline_access"});if(P||!U){Q("connection_oauth_failed",{connection_id:S,flow:"clone",error:P??"no_token"}),Le.error(`Authentication failed: ${P??"no token received"}`),await w.delete.mutateAsync(S);return}if(Q("connection_oauth_succeeded",{connection_id:S,flow:"clone"}),$)try{(await fetch(`/api/${v.slug}/connections/${S}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})})).ok?await w.update.mutateAsync({id:S,data:{}}):await w.update.mutateAsync({id:S,data:{connection_token:U}})}catch{await w.update.mutateAsync({id:S,data:{connection_token:U}})}else await w.update.mutateAsync({id:S,data:{connection_token:U}});await C.invalidateQueries({queryKey:ht.isMCPAuthenticated(A.href,null)})}f(S,p.app_name??null,"clone"),l(S)}catch(y){console.error("Failed to add connection:",y),Le.error("Failed to add connection")}finally{d(null)}},m=async p=>{if(!(!v||!R?.user?.id)){d(p.id);try{const y=ro(p,v.id,R.user.id,{remoteIndex:0}),T=y.connection_type==="STDIO",I=!!y.connection_url,S=T&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!S){Le.error("This MCP Server cannot be connected: no connection method available"),d(null);return}const{id:A}=await w.create.mutateAsync(y),O=new URL(`/api/${v.slug}/mcp/${A}`,window.location.origin),U=await Yt({url:O.href,token:null,orgId:v.id});if(U.supportsOAuth&&!U.isAuthenticated){const{token:$,tokenInfo:P,error:V}=await Ht({connectionId:A,orgSlug:v.slug,scope:"offline_access"});if(V||!$){Q("connection_oauth_failed",{connection_id:A,flow:"connect_new",error:V??"no_token"}),Le.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${V??"no token received"})`}),f(A,y.app_name??null,"new"),l(A);return}if(Q("connection_oauth_succeeded",{connection_id:A,flow:"connect_new"}),P)try{(await fetch(`/api/${v.slug}/connections/${A}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:P.accessToken,refreshToken:P.refreshToken,expiresIn:P.expiresIn,scope:P.scope,clientId:P.clientId,clientSecret:P.clientSecret,tokenEndpoint:P.tokenEndpoint})})).ok?await w.update.mutateAsync({id:A,data:{}}):await w.update.mutateAsync({id:A,data:{connection_token:$}})}catch{await w.update.mutateAsync({id:A,data:{connection_token:$}})}else await w.update.mutateAsync({id:A,data:{connection_token:$}});await C.invalidateQueries({queryKey:ht.isMCPAuthenticated(O.href,null)}),Le.success("Connected and authenticated")}else Le.success("Connected");f(A,y.app_name??null,"new"),l(A)}catch(y){console.error("Failed to connect:",y),Le.error("Failed to connect")}finally{d(null)}}};return i.jsxs(Mn,{open:t,onOpenChange:e,children:[i.jsxs(Pn,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[i.jsx(Ln,{className:"px-6 pt-5 pb-0 shrink-0",children:i.jsx(Fn,{className:"text-base font-semibold",children:s==="browse"?"Connections":"Add Connection"})}),i.jsx("div",{className:"pt-3 shrink-0",children:i.jsx(Ir,{value:g,onChange:b,placeholder:"Search connections..."})}),i.jsx(u.Suspense,{fallback:i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),children:i.jsx(lo,{mode:s,agentId:a,addedConnectionIds:c,onAdd:l,onCloneAndAdd:E,onConnectAndAdd:m,connectingItemId:h,search:g,onCreateConnection:()=>x(!0),onBrowseNavigate:k,defaultTab:n})})]}),i.jsx(co,{open:N,onOpenChange:x,onCreated:async p=>{x(!1);const y=new URL(`/api/${v.slug}/mcp/${p}`,window.location.origin),T=await Yt({url:y.href,token:null,orgId:v.id});if(T.supportsOAuth&&!T.isAuthenticated){const{token:I,tokenInfo:S,error:A}=await Ht({connectionId:p,orgSlug:v.slug,scope:"offline_access"});if(A||!I){Q("connection_oauth_failed",{connection_id:p,flow:"custom_create",error:A??"no_token"}),Le.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${A??"no token received"})`}),f(p,null,"custom"),l(p),e(!1);return}if(Q("connection_oauth_succeeded",{connection_id:p,flow:"custom_create"}),S)try{(await fetch(`/api/${v.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:S.accessToken,refreshToken:S.refreshToken,expiresIn:S.expiresIn,scope:S.scope,clientId:S.clientId,clientSecret:S.clientSecret,tokenEndpoint:S.tokenEndpoint})})).ok?await w.update.mutateAsync({id:p,data:{}}):await w.update.mutateAsync({id:p,data:{connection_token:I}})}catch{await w.update.mutateAsync({id:p,data:{connection_token:I}})}else await w.update.mutateAsync({id:p,data:{connection_token:I}});await C.invalidateQueries({queryKey:ht.isMCPAuthenticated(y.href,null)})}f(p,null,"custom"),l(p),e(!1)}})]})}const vn=new Map;function Pi(){const{org:t}=Ft(),e=io(),n=ao(),r=n.find(v=>v.providerId==="deco"),{data:o,isLoading:s,refetch:a,isFetching:c}=Rr({queryKey:ht.aiProviderCredits(t.id,"deco"),enabled:!!r,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=o?.balanceCents??null,f=l!=null?l/100:null,h=u.useRef(new Map);if(l!=null){const v=vn.get(t.id);h.current.get(t.id)&&v!=null&&l>v&&Q("credits_topped_up_detected",{organization_id:t.id,delta_cents:l-v,previous_balance_cents:v,new_balance_cents:l}),vn.set(t.id,l),h.current.set(t.id,!0)}const d=!!r,g=l!=null&&l>0,b=l!=null&&l===0,N=l!=null&&l===200,x=n.length>0&&n.every(v=>v.providerId==="deco");return{hasDecoKey:d,decoKeyId:r?.id??null,balanceCents:l,balanceDollars:f,hasCredits:g,isZeroBalance:b,isInitialFreeCredit:N,hasOnlyDecoProvider:x,isLoading:s,isFetching:c,refetch:a}}function Li(t){const e=t?.metadata?.githubRepo;return e?e.connectionId?t?.connections?.some(r=>r.connection_id===e.connectionId)?e:null:e:null}function bo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const zt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nt(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function cn(t){return"nodeType"in t}function Z(t){var e,n;return t?nt(t)?t:cn(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function ln(t){const{Document:e}=Z(t);return t instanceof e}function yt(t){return nt(t)?!1:t instanceof Z(t).HTMLElement}function Bn(t){return t instanceof Z(t).SVGElement}function rt(t){return t?nt(t)?t.document:cn(t)?ln(t)?t:yt(t)||Bn(t)?t.ownerDocument:document:document:document}const ve=zt?u.useLayoutEffect:u.useEffect;function Bt(t){const e=u.useRef(t);return ve(()=>{e.current=t}),u.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function xo(){const t=u.useRef(null),e=u.useCallback((r,o)=>{t.current=setInterval(r,o)},[]),n=u.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function vt(t,e){e===void 0&&(e=[t]);const n=u.useRef(t);return ve(()=>{n.current!==t&&(n.current=t)},e),n}function wt(t,e){const n=u.useRef();return u.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Tt(t){const e=Bt(t),n=u.useRef(null),r=u.useCallback(o=>{o!==n.current&&e?.(o,n.current),n.current=o},[]);return[n,r]}function _t(t){const e=u.useRef();return u.useEffect(()=>{e.current=t},[t]),e.current}let en={};function Ct(t,e){return u.useMemo(()=>{if(e)return e;const n=en[t]==null?0:en[t]+1;return en[t]=n,t+"-"+n},[t,e])}function $n(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const c=Object.entries(a);for(const[l,f]of c){const h=s[l];h!=null&&(s[l]=h+t*f)}return s},{...e})}}const tt=$n(1),bt=$n(-1);function yo(t){return"clientX"in t&&"clientY"in t}function $t(t){if(!t)return!1;const{KeyboardEvent:e}=Z(t.target);return e&&t instanceof e}function wo(t){if(!t)return!1;const{TouchEvent:e}=Z(t.target);return e&&t instanceof e}function Ot(t){if(wo(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return yo(t)?{x:t.clientX,y:t.clientY}:null}const We=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[We.Translate.toString(t),We.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),bn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Co(t){return t.matches(bn)?t:t.querySelector(bn)}const So={display:"none"};function Do(t){let{id:e,value:n}=t;return B.createElement("div",{id:e,style:So},n)}function Ro(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return B.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function jo(){const[t,e]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const Vn=u.createContext(null);function No(t){const e=u.useContext(Vn);u.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Io(){const[t]=u.useState(()=>new Set),e=u.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[u.useCallback(r=>{let{type:o,event:s}=r;t.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,s)})},[t]),e]}const Ao={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},Eo={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function ko(t){let{announcements:e=Eo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Ao}=t;const{announce:s,announcement:a}=jo(),c=Ct("DndLiveRegion"),[l,f]=u.useState(!1);if(u.useEffect(()=>{f(!0)},[]),No(u.useMemo(()=>({onDragStart(d){let{active:g}=d;s(e.onDragStart({active:g}))},onDragMove(d){let{active:g,over:b}=d;e.onDragMove&&s(e.onDragMove({active:g,over:b}))},onDragOver(d){let{active:g,over:b}=d;s(e.onDragOver({active:g,over:b}))},onDragEnd(d){let{active:g,over:b}=d;s(e.onDragEnd({active:g,over:b}))},onDragCancel(d){let{active:g,over:b}=d;s(e.onDragCancel({active:g,over:b}))}}),[s,e])),!l)return null;const h=B.createElement(B.Fragment,null,B.createElement(Do,{id:r,value:o.draggable}),B.createElement(Ro,{id:c,announcement:a}));return n?ft.createPortal(h,n):h}var K;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(K||(K={}));function Mt(){}function Fi(t,e){return u.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function zi(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const be=Object.freeze({x:0,y:0});function Xn(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function To(t,e){const n=Ot(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function Kn(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function _o(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function xn(t){let{left:e,top:n,height:r,width:o}=t;return[{x:e,y:n},{x:e+o,y:n},{x:e,y:n+r},{x:e+o,y:n+r}]}function Un(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function yn(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Bi=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=yn(e,e.left,e.top),s=[];for(const a of r){const{id:c}=a,l=n.get(c);if(l){const f=Xn(yn(l),o);s.push({id:c,data:{droppableContainer:a,value:f}})}}return s.sort(Kn)},Oo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=xn(e),s=[];for(const a of r){const{id:c}=a,l=n.get(c);if(l){const f=xn(l),h=o.reduce((g,b,N)=>g+Xn(f[N],b),0),d=Number((h/4).toFixed(4));s.push({id:c,data:{droppableContainer:a,value:d}})}}return s.sort(Kn)};function Mo(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),o=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=o-r,c=s-n;if(r<o&&n<s){const l=e.width*e.height,f=t.width*t.height,h=a*c,d=h/(l+f-h);return Number(d.toFixed(4))}return 0}const Po=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const l=Mo(c,e);l>0&&o.push({id:a,data:{droppableContainer:s,value:l}})}}return o.sort(_o)};function Lo(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Yn(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:be}function Fo(t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,c)=>({...a,top:a.top+t*c.y,bottom:a.bottom+t*c.y,left:a.left+t*c.x,right:a.right+t*c.x}),{...n})}}const zo=Fo(1);function Hn(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function Bo(t,e,n){const r=Hn(e);if(!r)return t;const{scaleX:o,scaleY:s,x:a,y:c}=r,l=t.left-a-(1-o)*parseFloat(n),f=t.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?t.width/o:t.width,d=s?t.height/s:t.height;return{width:h,height:d,top:f,right:l+h,bottom:f+d,left:l}}const $o={ignoreTransform:!1};function ot(t,e){e===void 0&&(e=$o);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:f,transformOrigin:h}=Z(t).getComputedStyle(t);f&&(n=Bo(n,f,h))}const{top:r,left:o,width:s,height:a,bottom:c,right:l}=n;return{top:r,left:o,width:s,height:a,bottom:c,right:l}}function wn(t){return ot(t,{ignoreTransform:!0})}function Vo(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Xo(t,e){return e===void 0&&(e=Z(t).getComputedStyle(t)),e.position==="fixed"}function Ko(t,e){e===void 0&&(e=Z(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=e[o];return typeof s=="string"?n.test(s):!1})}function Vt(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(ln(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!yt(o)||Bn(o)||n.includes(o))return n;const s=Z(t).getComputedStyle(o);return o!==t&&Ko(o,s)&&n.push(o),Xo(o,s)?n:r(o.parentNode)}return t?r(t):n}function Wn(t){const[e]=Vt(t,1);return e??null}function tn(t){return!zt||!t?null:nt(t)?t:cn(t)?ln(t)||t===rt(t).scrollingElement?window:yt(t)?t:null:null}function qn(t){return nt(t)?t.scrollX:t.scrollLeft}function Gn(t){return nt(t)?t.scrollY:t.scrollTop}function on(t){return{x:qn(t),y:Gn(t)}}var Y;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Y||(Y={}));function Jn(t){return!zt||!t?!1:t===document.scrollingElement}function Qn(t){const e={x:0,y:0},n=Jn(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,c=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:c,maxScroll:r,minScroll:e}}const Uo={x:.2,y:.2};function Yo(t,e,n,r,o){let{top:s,left:a,right:c,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Uo);const{isTop:f,isBottom:h,isLeft:d,isRight:g}=Qn(t),b={x:0,y:0},N={x:0,y:0},x={height:e.height*o.y,width:e.width*o.x};return!f&&s<=e.top+x.height?(b.y=Y.Backward,N.y=r*Math.abs((e.top+x.height-s)/x.height)):!h&&l>=e.bottom-x.height&&(b.y=Y.Forward,N.y=r*Math.abs((e.bottom-x.height-l)/x.height)),!g&&c>=e.right-x.width?(b.x=Y.Forward,N.x=r*Math.abs((e.right-x.width-c)/x.width)):!d&&a<=e.left+x.width&&(b.x=Y.Backward,N.x=r*Math.abs((e.left+x.width-a)/x.width)),{direction:b,speed:N}}function Ho(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function Zn(t){return t.reduce((e,n)=>tt(e,on(n)),be)}function Wo(t){return t.reduce((e,n)=>e+qn(n),0)}function qo(t){return t.reduce((e,n)=>e+Gn(n),0)}function er(t,e){if(e===void 0&&(e=ot),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);Wn(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Go=[["x",["left","right"],Wo],["y",["top","bottom"],qo]];class dn{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Vt(n),o=Zn(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,c]of Go)for(const l of a)Object.defineProperty(this,l,{get:()=>{const f=c(r),h=o[s]-f;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class pt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function Jo(t){const{EventTarget:e}=Z(t);return t instanceof e?t:rt(t)}function nn(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var fe;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(fe||(fe={}));function Cn(t){t.preventDefault()}function Qo(t){t.stopPropagation()}var _;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(_||(_={}));const tr={start:[_.Space,_.Enter],cancel:[_.Esc],end:[_.Space,_.Enter,_.Tab]},Zo=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case _.Right:return{...n,x:n.x+25};case _.Left:return{...n,x:n.x-25};case _.Down:return{...n,y:n.y+25};case _.Up:return{...n,y:n.y-25}}};class nr{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new pt(rt(n)),this.windowListeners=new pt(Z(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&er(r),n(be)}handleKeyDown(e){if($t(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=tr,coordinateGetter:a=Zo,scrollBehavior:c="smooth"}=o,{code:l}=e;if(s.end.includes(l)){this.handleEnd(e);return}if(s.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:f}=r.current,h=f?{x:f.left,y:f.top}:be;this.referenceCoordinates||(this.referenceCoordinates=h);const d=a(e,{active:n,context:r.current,currentCoordinates:h});if(d){const g=bt(d,h),b={x:0,y:0},{scrollableAncestors:N}=r.current;for(const x of N){const v=e.code,{isTop:R,isRight:w,isLeft:C,isBottom:j,maxScroll:k,minScroll:E}=Qn(x),m=Ho(x),p={x:Math.min(v===_.Right?m.right-m.width/2:m.right,Math.max(v===_.Right?m.left:m.left+m.width/2,d.x)),y:Math.min(v===_.Down?m.bottom-m.height/2:m.bottom,Math.max(v===_.Down?m.top:m.top+m.height/2,d.y))},y=v===_.Right&&!w||v===_.Left&&!C,T=v===_.Down&&!j||v===_.Up&&!R;if(y&&p.x!==d.x){const I=x.scrollLeft+g.x,S=v===_.Right&&I<=k.x||v===_.Left&&I>=E.x;if(S&&!g.y){x.scrollTo({left:I,behavior:c});return}S?b.x=x.scrollLeft-I:b.x=v===_.Right?x.scrollLeft-k.x:x.scrollLeft-E.x,b.x&&x.scrollBy({left:-b.x,behavior:c});break}else if(T&&p.y!==d.y){const I=x.scrollTop+g.y,S=v===_.Down&&I<=k.y||v===_.Up&&I>=E.y;if(S&&!g.x){x.scrollTo({top:I,behavior:c});return}S?b.y=x.scrollTop-I:b.y=v===_.Down?x.scrollTop-k.y:x.scrollTop-E.y,b.y&&x.scrollBy({top:-b.y,behavior:c});break}}this.handleMove(e,tt(bt(d,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}nr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=tr,onActivation:o}=e,{active:s}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const c=s.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),o?.({event:t.nativeEvent}),!0)}return!1}}];function Sn(t){return!!(t&&"distance"in t)}function Dn(t){return!!(t&&"delay"in t)}class un{constructor(e,n,r){var o;r===void 0&&(r=Jo(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:a}=s;this.props=e,this.events=n,this.document=rt(a),this.documentListeners=new pt(this.document),this.listeners=new pt(r),this.windowListeners=new pt(Z(a)),this.initialCoordinates=(o=Ot(s))!=null?o:be,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,Cn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,Cn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Sn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:o}=this.props;o(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(fe.Click,Qo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:c}}=s;if(!o)return;const l=(n=Ot(e))!=null?n:be,f=bt(o,l);if(!r&&c){if(Sn(c)){if(c.tolerance!=null&&nn(f,c.tolerance))return this.handleCancel();if(nn(f,c.distance))return this.handleStart()}if(Dn(c)&&nn(f,c.tolerance))return this.handleCancel();this.handlePending(c,f);return}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===_.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const es={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rr extends un{constructor(e){const{event:n}=e,r=rt(n.target);super(e,es,r)}}rr.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const ts={move:{name:"mousemove"},end:{name:"mouseup"}};var sn;(function(t){t[t.RightClick=2]="RightClick"})(sn||(sn={}));class ns extends un{constructor(e){super(e,ts,rt(e.event.target))}}ns.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===sn.RightClick?!1:(r?.({event:n}),!0)}}];const rn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class rs extends un{constructor(e){super(e,rn)}static setup(){return window.addEventListener(rn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(rn.move.name,e)};function e(){}}}rs.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var gt;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(gt||(gt={}));var Pt;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pt||(Pt={}));function os(t){let{acceleration:e,activator:n=gt.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:c=Pt.TreeOrder,pointerCoordinates:l,scrollableAncestors:f,scrollableAncestorRects:h,delta:d,threshold:g}=t;const b=is({delta:d,disabled:!s}),[N,x]=xo(),v=u.useRef({x:0,y:0}),R=u.useRef({x:0,y:0}),w=u.useMemo(()=>{switch(n){case gt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case gt.DraggableRect:return o}},[n,o,l]),C=u.useRef(null),j=u.useCallback(()=>{const E=C.current;if(!E)return;const m=v.current.x*R.current.x,p=v.current.y*R.current.y;E.scrollBy(m,p)},[]),k=u.useMemo(()=>c===Pt.TreeOrder?[...f].reverse():f,[c,f]);u.useEffect(()=>{if(!s||!f.length||!w){x();return}for(const E of k){if(r?.(E)===!1)continue;const m=f.indexOf(E),p=h[m];if(!p)continue;const{direction:y,speed:T}=Yo(E,p,w,e,g);for(const I of["x","y"])b[I][y[I]]||(T[I]=0,y[I]=0);if(T.x>0||T.y>0){x(),C.current=E,N(j,a),v.current=T,R.current=y;return}}v.current={x:0,y:0},R.current={x:0,y:0},x()},[e,j,r,x,s,a,JSON.stringify(w),JSON.stringify(b),N,f,k,h,JSON.stringify(g)])}const ss={x:{[Y.Backward]:!1,[Y.Forward]:!1},y:{[Y.Backward]:!1,[Y.Forward]:!1}};function is(t){let{delta:e,disabled:n}=t;const r=_t(e);return wt(o=>{if(n||!r||!o)return ss;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Y.Backward]:o.x[Y.Backward]||s.x===-1,[Y.Forward]:o.x[Y.Forward]||s.x===1},y:{[Y.Backward]:o.y[Y.Backward]||s.y===-1,[Y.Forward]:o.y[Y.Forward]||s.y===1}}},[n,e,r])}function as(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return wt(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function cs(t,e){return u.useMemo(()=>t.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...s]},[]),[t,e])}var xt;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(xt||(xt={}));var an;(function(t){t.Optimized="optimized"})(an||(an={}));const Rn=new Map;function ls(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,a]=u.useState(null),{frequency:c,measure:l,strategy:f}=o,h=u.useRef(t),d=v(),g=vt(d),b=u.useCallback(function(R){R===void 0&&(R=[]),!g.current&&a(w=>w===null?R:w.concat(R.filter(C=>!w.includes(C))))},[g]),N=u.useRef(null),x=wt(R=>{if(d&&!n)return Rn;if(!R||R===Rn||h.current!==t||s!=null){const w=new Map;for(let C of t){if(!C)continue;if(s&&s.length>0&&!s.includes(C.id)&&C.rect.current){w.set(C.id,C.rect.current);continue}const j=C.node.current,k=j?new dn(l(j),j):null;C.rect.current=k,k&&w.set(C.id,k)}return w}return R},[t,s,n,d,l]);return u.useEffect(()=>{h.current=t},[t]),u.useEffect(()=>{d||b()},[n,d]),u.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),u.useEffect(()=>{d||typeof c!="number"||N.current!==null||(N.current=setTimeout(()=>{b(),N.current=null},c))},[c,d,b,...r]),{droppableRects:x,measureDroppableContainers:b,measuringScheduled:s!=null};function v(){switch(f){case xt.Always:return!1;case xt.BeforeDragging:return n;default:return!n}}}function fn(t,e){return wt(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function ds(t,e){return fn(t,e)}function us(t){let{callback:e,disabled:n}=t;const r=Bt(e),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return u.useEffect(()=>()=>o?.disconnect(),[o]),o}function Xt(t){let{callback:e,disabled:n}=t;const r=Bt(e),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return u.useEffect(()=>()=>o?.disconnect(),[o]),o}function fs(t){return new dn(ot(t),t)}function jn(t,e,n){e===void 0&&(e=fs);const[r,o]=u.useState(null);function s(){o(l=>{if(!t)return null;if(t.isConnected===!1){var f;return(f=l??n)!=null?f:null}const h=e(t);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const a=us({callback(l){if(t)for(const f of l){const{type:h,target:d}=f;if(h==="childList"&&d instanceof HTMLElement&&d.contains(t)){s();break}}}}),c=Xt({callback:s});return ve(()=>{s(),t?(c?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[t]),r}function hs(t){const e=fn(t);return Yn(t,e)}const Nn=[];function ps(t){const e=u.useRef(t),n=wt(r=>t?r&&r!==Nn&&t&&e.current&&t.parentNode===e.current.parentNode?r:Vt(t):Nn,[t]);return u.useEffect(()=>{e.current=t},[t]),n}function gs(t){const[e,n]=u.useState(null),r=u.useRef(t),o=u.useCallback(s=>{const a=tn(s.target);a&&n(c=>c?(c.set(a,on(a)),new Map(c)):null)},[]);return u.useEffect(()=>{const s=r.current;if(t!==s){a(s);const c=t.map(l=>{const f=tn(l);return f?(f.addEventListener("scroll",o,{passive:!0}),[f,on(f)]):null}).filter(l=>l!=null);n(c.length?new Map(c):null),r.current=t}return()=>{a(t),a(s)};function a(c){c.forEach(l=>{const f=tn(l);f?.removeEventListener("scroll",o)})}},[o,t]),u.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,a)=>tt(s,a),be):Zn(t):be,[t,e])}function In(t,e){e===void 0&&(e=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},e),u.useEffect(()=>{const r=t!==be;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?bt(t,n.current):be}function ms(t){u.useEffect(()=>{if(!zt)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function vs(t,e){return u.useMemo(()=>t.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,e)},n},{}),[t,e])}function or(t){return u.useMemo(()=>t?Vo(t):null,[t])}const An=[];function bs(t,e){e===void 0&&(e=ot);const[n]=t,r=or(n?Z(n):null),[o,s]=u.useState(An);function a(){s(()=>t.length?t.map(l=>Jn(l)?r:new dn(e(l),l)):An)}const c=Xt({callback:a});return ve(()=>{c?.disconnect(),a(),t.forEach(l=>c?.observe(l))},[t]),o}function sr(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return yt(e)?e:t}function xs(t){let{measure:e}=t;const[n,r]=u.useState(null),o=u.useCallback(f=>{for(const{target:h}of f)if(yt(h)){r(d=>{const g=e(h);return d?{...d,width:g.width,height:g.height}:g});break}},[e]),s=Xt({callback:o}),a=u.useCallback(f=>{const h=sr(f);s?.disconnect(),h&&s?.observe(h),r(h?e(h):null)},[e,s]),[c,l]=Tt(a);return u.useMemo(()=>({nodeRef:c,rect:n,setRef:l}),[n,c,l])}const ys=[{sensor:rr,options:{}},{sensor:nr,options:{}}],ws={current:{}},kt={draggable:{measure:wn},droppable:{measure:wn,strategy:xt.WhileDragging,frequency:an.Optimized},dragOverlay:{measure:ot}};class mt extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const Cs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:kt,measureDroppableContainers:Mt,windowRect:null,measuringScheduled:!1},ir={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mt,draggableNodes:new Map,over:null,measureDroppableContainers:Mt},St=u.createContext(ir),ar=u.createContext(Cs);function Ss(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mt}}}function Ds(t,e){switch(e.type){case K.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case K.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case K.DragEnd:case K.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case K.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new mt(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case K.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const a=new mt(t.droppable.containers);return a.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:a}}}case K.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new mt(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function Rs(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=u.useContext(St),s=_t(r),a=_t(n?.id);return u.useEffect(()=>{if(!e&&!r&&s&&a!=null){if(!$t(s)||document.activeElement===s.target)return;const c=o.get(a);if(!c)return;const{activatorNode:l,node:f}=c;if(!l.current&&!f.current)return;requestAnimationFrame(()=>{for(const h of[l.current,f.current]){if(!h)continue;const d=Co(h);if(d){d.focus();break}}})}},[r,e,o,a,s]),null}function cr(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function js(t){return u.useMemo(()=>({draggable:{...kt.draggable,...t?.draggable},droppable:{...kt.droppable,...t?.droppable},dragOverlay:{...kt.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Ns(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=u.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;ve(()=>{if(!a&&!c||!e){s.current=!1;return}if(s.current||!r)return;const f=e?.node.current;if(!f||f.isConnected===!1)return;const h=n(f),d=Yn(h,r);if(a||(d.x=0),c||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=Wn(f);g&&g.scrollBy({top:d.y,left:d.x})}},[e,a,c,r,n])}const Kt=u.createContext({...be,scaleX:1,scaleY:1});var Ke;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ke||(Ke={}));const $i=u.memo(function(e){var n,r,o,s;let{id:a,accessibility:c,autoScroll:l=!0,children:f,sensors:h=ys,collisionDetection:d=Po,measuring:g,modifiers:b,...N}=e;const x=u.useReducer(Ds,void 0,Ss),[v,R]=x,[w,C]=Io(),[j,k]=u.useState(Ke.Uninitialized),E=j===Ke.Initialized,{draggable:{active:m,nodes:p,translate:y},droppable:{containers:T}}=v,I=m!=null?p.get(m):null,S=u.useRef({initial:null,translated:null}),A=u.useMemo(()=>{var z;return m!=null?{id:m,data:(z=I?.data)!=null?z:ws,rect:S}:null},[m,I]),O=u.useRef(null),[U,$]=u.useState(null),[P,V]=u.useState(null),re=vt(N,Object.values(N)),xe=Ct("DndDescribedBy",a),qe=u.useMemo(()=>T.getEnabled(),[T]),X=js(g),{droppableRects:H,measureDroppableContainers:he,measuringScheduled:Ae}=ls(qe,{dragging:E,dependencies:[y.x,y.y],config:X.droppable}),F=as(p,m),Ue=u.useMemo(()=>P?Ot(P):null,[P]),ee=ne(),q=ds(F,X.draggable.measure);Ns({activeNode:m!=null?p.get(m):null,config:ee.layoutShiftCompensation,initialRect:q,measure:X.draggable.measure});const M=jn(F,X.draggable.measure,q),Ee=jn(F?F.parentElement:null),G=u.useRef({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:p,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=T.getNodeFor((n=G.current.over)==null?void 0:n.id),te=xs({measure:X.dragOverlay.measure}),ke=(r=te.nodeRef.current)!=null?r:F,ye=E?(o=te.rect)!=null?o:M:null,Ge=!!(te.nodeRef.current&&te.rect),Te=hs(Ge?null:M),st=or(ke?Z(ke):null),oe=ps(E?pe??F:null),Fe=bs(oe),ge=cr(b,{transform:{x:y.x-Te.x,y:y.y-Te.y,scaleX:1,scaleY:1},activatorEvent:P,active:A,activeNodeRect:M,containerNodeRect:Ee,draggingNodeRect:ye,over:G.current.over,overlayNodeRect:te.rect,scrollableAncestors:oe,scrollableAncestorRects:Fe,windowRect:st}),_e=Ue?tt(Ue,y):null,Je=gs(oe),it=In(Je),at=In(Je,[M]),we=tt(ge,it),se=ye?zo(ye,ge):null,le=A&&se?d({active:A,collisionRect:se,droppableRects:H,droppableContainers:qe,pointerCoordinates:_e}):null,Oe=Un(le,"id"),[J,Me]=u.useState(null),Qe=Ge?ge:tt(ge,at),D=Lo(Qe,(s=J?.rect)!=null?s:null,M),L=u.useRef(null),de=u.useCallback((z,ie)=>{let{sensor:ae,options:$e}=ie;if(O.current==null)return;const ue=p.get(O.current);if(!ue)return;const ce=z.nativeEvent,Ce=new ae({active:O.current,activeNode:ue,event:ce,options:$e,context:G,onAbort(W){if(!p.get(W))return;const{onDragAbort:Se}=re.current,Pe={id:W};Se?.(Pe),w({type:"onDragAbort",event:Pe})},onPending(W,Ve,Se,Pe){if(!p.get(W))return;const{onDragPending:lt}=re.current,Xe={id:W,constraint:Ve,initialCoordinates:Se,offset:Pe};lt?.(Xe),w({type:"onDragPending",event:Xe})},onStart(W){const Ve=O.current;if(Ve==null)return;const Se=p.get(Ve);if(!Se)return;const{onDragStart:Pe}=re.current,ct={activatorEvent:ce,active:{id:Ve,data:Se.data,rect:S}};ft.unstable_batchedUpdates(()=>{Pe?.(ct),k(Ke.Initializing),R({type:K.DragStart,initialCoordinates:W,active:Ve}),w({type:"onDragStart",event:ct}),$(L.current),V(ce)})},onMove(W){R({type:K.DragMove,coordinates:W})},onEnd:et(K.DragEnd),onCancel:et(K.DragCancel)});L.current=Ce;function et(W){return async function(){const{active:Se,collisions:Pe,over:ct,scrollAdjustedTranslate:lt}=G.current;let Xe=null;if(Se&<){const{cancelDrop:dt}=re.current;Xe={activatorEvent:ce,active:Se,collisions:Pe,delta:lt,over:ct},W===K.DragEnd&&typeof dt=="function"&&await Promise.resolve(dt(Xe))&&(W=K.DragCancel)}O.current=null,ft.unstable_batchedUpdates(()=>{R({type:W}),k(Ke.Uninitialized),Me(null),$(null),V(null),L.current=null;const dt=W===K.DragEnd?"onDragEnd":"onDragCancel";if(Xe){const Ut=re.current[dt];Ut?.(Xe),w({type:dt,event:Xe})}})}}},[p]),ze=u.useCallback((z,ie)=>(ae,$e)=>{const ue=ae.nativeEvent,ce=p.get($e);if(O.current!==null||!ce||ue.dndKit||ue.defaultPrevented)return;const Ce={active:ce};z(ae,ie.options,Ce)===!0&&(ue.dndKit={capturedBy:ie.sensor},O.current=$e,de(ae,ie))},[p,de]),me=cs(h,ze);ms(h),ve(()=>{M&&j===Ke.Initializing&&k(Ke.Initialized)},[M,j]),u.useEffect(()=>{const{onDragMove:z}=re.current,{active:ie,activatorEvent:ae,collisions:$e,over:ue}=G.current;if(!ie||!ae)return;const ce={active:ie,activatorEvent:ae,collisions:$e,delta:{x:we.x,y:we.y},over:ue};ft.unstable_batchedUpdates(()=>{z?.(ce),w({type:"onDragMove",event:ce})})},[we.x,we.y]),u.useEffect(()=>{const{active:z,activatorEvent:ie,collisions:ae,droppableContainers:$e,scrollAdjustedTranslate:ue}=G.current;if(!z||O.current==null||!ie||!ue)return;const{onDragOver:ce}=re.current,Ce=$e.get(Oe),et=Ce&&Ce.rect.current?{id:Ce.id,rect:Ce.rect.current,data:Ce.data,disabled:Ce.disabled}:null,W={active:z,activatorEvent:ie,collisions:ae,delta:{x:ue.x,y:ue.y},over:et};ft.unstable_batchedUpdates(()=>{Me(et),ce?.(W),w({type:"onDragOver",event:W})})},[Oe]),ve(()=>{G.current={activatorEvent:P,active:A,activeNode:F,collisionRect:se,collisions:le,droppableRects:H,draggableNodes:p,draggingNode:ke,draggingNodeRect:ye,droppableContainers:T,over:J,scrollableAncestors:oe,scrollAdjustedTranslate:we},S.current={initial:ye,translated:se}},[A,F,le,se,p,ke,ye,H,T,J,oe,we]),os({...ee,delta:y,draggingRect:se,pointerCoordinates:_e,scrollableAncestors:oe,scrollableAncestorRects:Fe});const Ze=u.useMemo(()=>({active:A,activeNode:F,activeNodeRect:M,activatorEvent:P,collisions:le,containerNodeRect:Ee,dragOverlay:te,draggableNodes:p,droppableContainers:T,droppableRects:H,over:J,measureDroppableContainers:he,scrollableAncestors:oe,scrollableAncestorRects:Fe,measuringConfiguration:X,measuringScheduled:Ae,windowRect:st}),[A,F,M,P,le,Ee,te,p,T,H,J,he,oe,Fe,X,Ae,st]),Be=u.useMemo(()=>({activatorEvent:P,activators:me,active:A,activeNodeRect:M,ariaDescribedById:{draggable:xe},dispatch:R,draggableNodes:p,over:J,measureDroppableContainers:he}),[P,me,A,M,R,xe,p,J,he]);return B.createElement(Vn.Provider,{value:C},B.createElement(St.Provider,{value:Be},B.createElement(ar.Provider,{value:Ze},B.createElement(Kt.Provider,{value:D},f)),B.createElement(Rs,{disabled:c?.restoreFocus===!1})),B.createElement(ko,{...c,hiddenTextDescribedById:xe}));function ne(){const z=U?.autoScrollEnabled===!1,ie=typeof l=="object"?l.enabled===!1:l===!1,ae=E&&!z&&!ie;return typeof l=="object"?{...l,enabled:ae}:{enabled:ae}}}),Is=u.createContext(null),En="button",As="Draggable";function Es(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=Ct(As),{activators:a,activatorEvent:c,active:l,activeNodeRect:f,ariaDescribedById:h,draggableNodes:d,over:g}=u.useContext(St),{role:b=En,roleDescription:N="draggable",tabIndex:x=0}=o??{},v=l?.id===e,R=u.useContext(v?Kt:Is),[w,C]=Tt(),[j,k]=Tt(),E=vs(a,e),m=vt(n);ve(()=>(d.set(e,{id:e,key:s,node:w,activatorNode:j,data:m}),()=>{const y=d.get(e);y&&y.key===s&&d.delete(e)}),[d,e]);const p=u.useMemo(()=>({role:b,tabIndex:x,"aria-disabled":r,"aria-pressed":v&&b===En?!0:void 0,"aria-roledescription":N,"aria-describedby":h.draggable}),[r,b,x,v,N,h.draggable]);return{active:l,activatorEvent:c,activeNodeRect:f,attributes:p,isDragging:v,listeners:r?void 0:E,node:w,over:g,setNodeRef:C,setActivatorNodeRef:k,transform:R}}function lr(){return u.useContext(ar)}const ks="Droppable",Ts={timeout:25};function _s(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=Ct(ks),{active:a,dispatch:c,over:l,measureDroppableContainers:f}=u.useContext(St),h=u.useRef({disabled:n}),d=u.useRef(!1),g=u.useRef(null),b=u.useRef(null),{disabled:N,updateMeasurementsFor:x,timeout:v}={...Ts,...o},R=vt(x??r),w=u.useCallback(()=>{if(!d.current){d.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{f(Array.isArray(R.current)?R.current:[R.current]),b.current=null},v)},[v]),C=Xt({callback:w,disabled:N||!a}),j=u.useCallback((p,y)=>{C&&(y&&(C.unobserve(y),d.current=!1),p&&C.observe(p))},[C]),[k,E]=Tt(j),m=vt(e);return u.useEffect(()=>{!C||!k.current||(C.disconnect(),d.current=!1,C.observe(k.current))},[k,C]),u.useEffect(()=>(c({type:K.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:g,data:m}}),()=>c({type:K.UnregisterDroppable,key:s,id:r})),[r]),u.useEffect(()=>{n!==h.current.disabled&&(c({type:K.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,c]),{active:a,rect:g,isOver:l?.id===r,node:k,over:l,setNodeRef:E}}function Os(t){let{animation:e,children:n}=t;const[r,o]=u.useState(null),[s,a]=u.useState(null),c=_t(n);return!n&&!r&&c&&o(c),ve(()=>{if(!s)return;const l=r?.key,f=r?.props.id;if(l==null||f==null){o(null);return}Promise.resolve(e(f,s)).then(()=>{o(null)})},[e,r,s]),B.createElement(B.Fragment,null,n,r?u.cloneElement(r,{ref:a}):null)}const Ms={x:0,y:0,scaleX:1,scaleY:1};function Ps(t){let{children:e}=t;return B.createElement(St.Provider,{value:ir},B.createElement(Kt.Provider,{value:Ms},e))}const Ls={position:"fixed",touchAction:"none"},Fs=t=>$t(t)?"transform 250ms ease":void 0,zs=u.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:a,rect:c,style:l,transform:f,transition:h=Fs}=t;if(!c)return null;const d=o?f:{...f,scaleX:1,scaleY:1},g={...Ls,width:c.width,height:c.height,top:c.top,left:c.left,transform:We.Transform.toString(d),transformOrigin:o&&r?To(r,c):void 0,transition:typeof h=="function"?h(r):h,...l};return B.createElement(n,{className:a,style:g,ref:e},s)}),Bs=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:a}=t;if(s!=null&&s.active)for(const[c,l]of Object.entries(s.active))l!==void 0&&(o[c]=n.node.style.getPropertyValue(c),n.node.style.setProperty(c,l));if(s!=null&&s.dragOverlay)for(const[c,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(c,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,f]of Object.entries(o))n.node.style.setProperty(l,f);a!=null&&a.active&&n.node.classList.remove(a.active)}},$s=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:We.Transform.toString(e)},{transform:We.Transform.toString(n)}]},Vs={duration:250,easing:"ease",keyframes:$s,sideEffects:Bs({styles:{active:{opacity:"0"}}})};function Xs(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return Bt((s,a)=>{if(e===null)return;const c=n.get(s);if(!c)return;const l=c.node.current;if(!l)return;const f=sr(a);if(!f)return;const{transform:h}=Z(a).getComputedStyle(a),d=Hn(h);if(!d)return;const g=typeof e=="function"?e:Ks(e);return er(l,o.draggable.measure),g({active:{id:s,data:c.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(f)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function Ks(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={...Vs,...t};return s=>{let{active:a,dragOverlay:c,transform:l,...f}=s;if(!e)return;const h={x:c.rect.left-a.rect.left,y:c.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/c.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/c.rect.height:1},g={x:l.x-h.x,y:l.y-h.y,...d},b=o({...f,active:a,dragOverlay:c,transform:{initial:l,final:g}}),[N]=b,x=b[b.length-1];if(JSON.stringify(N)===JSON.stringify(x))return;const v=r?.({active:a,dragOverlay:c,...f}),R=c.node.animate(b,{duration:e,easing:n,fill:"forwards"});return new Promise(w=>{R.onfinish=()=>{v?.(),w()}})}}let kn=0;function Us(t){return u.useMemo(()=>{if(t!=null)return kn++,kn},[t])}const Vi=B.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:a,wrapperElement:c="div",className:l,zIndex:f=999}=t;const{activatorEvent:h,active:d,activeNodeRect:g,containerNodeRect:b,draggableNodes:N,droppableContainers:x,dragOverlay:v,over:R,measuringConfiguration:w,scrollableAncestors:C,scrollableAncestorRects:j,windowRect:k}=lr(),E=u.useContext(Kt),m=Us(d?.id),p=cr(a,{activatorEvent:h,active:d,activeNodeRect:g,containerNodeRect:b,draggingNodeRect:v.rect,over:R,overlayNodeRect:v.rect,scrollableAncestors:C,scrollableAncestorRects:j,transform:E,windowRect:k}),y=fn(g),T=Xs({config:r,draggableNodes:N,droppableContainers:x,measuringConfiguration:w}),I=y?v.setRef:void 0;return B.createElement(Ps,null,B.createElement(Os,{animation:T},d&&m?B.createElement(zs,{key:m,id:d.id,ref:I,as:c,activatorEvent:h,adjustScale:e,className:l,transition:s,rect:y,style:{zIndex:f,...o},transform:p},n):null))});function dr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Ys(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function jt(t){return t!==null&&t>=0}function Hs(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Ws(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Nt={scaleX:1,scaleY:1},Xi=t=>{var e;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=t;const c=(e=n[o])!=null?e:r;if(!c)return null;const l=qs(n,a,o);if(a===o){const f=n[s];return f?{x:o<s?f.left+f.width-(c.left+c.width):f.left-c.left,y:0,...Nt}:null}return a>o&&a<=s?{x:-c.width-l,y:0,...Nt}:a<o&&a>=s?{x:c.width+l,y:0,...Nt}:{x:0,y:0,...Nt}};function qs(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return!r||!o&&!s?0:n<e?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const ur=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=dr(e,r,n),a=e[o],c=s[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},It={scaleX:1,scaleY:1},Ki=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=t;const c=(e=s[n])!=null?e:r;if(!c)return null;if(o===n){const f=s[a];return f?{x:0,y:n<a?f.top+f.height-(c.top+c.height):f.top-c.top,...It}:null}const l=Gs(s,o,n);return o>n&&o<=a?{x:0,y:-c.height-l,...It}:o<n&&o>=a?{x:0,y:c.height+l,...It}:{x:0,y:0,...It}};function Gs(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return r?n<e?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const fr="Sortable",hr=B.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ur,disabled:{draggable:!1,droppable:!1}});function Ui(t){let{children:e,id:n,items:r,strategy:o=ur,disabled:s=!1}=t;const{active:a,dragOverlay:c,droppableRects:l,over:f,measureDroppableContainers:h}=lr(),d=Ct(fr,n),g=c.rect!==null,b=u.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),N=a!=null,x=a?b.indexOf(a.id):-1,v=f?b.indexOf(f.id):-1,R=u.useRef(b),w=!Hs(b,R.current),C=v!==-1&&x===-1||w,j=Ws(s);ve(()=>{w&&N&&h(b)},[w,b,N,h]),u.useEffect(()=>{R.current=b},[b]);const k=u.useMemo(()=>({activeIndex:x,containerId:d,disabled:j,disableTransforms:C,items:b,overIndex:v,useDragOverlay:g,sortedRects:Ys(b,l),strategy:o}),[x,d,j.draggable,j.droppable,C,b,v,l,g,o]);return B.createElement(hr.Provider,{value:k},e)}const Js=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return dr(n,r,o).indexOf(e)},Qs=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:c,previousContainerId:l,transition:f}=t;return!f||!r||c!==s&&o===a?!1:n?!0:a!==o&&e===l},Zs={duration:200,easing:"ease"},pr="transform",ei=We.Transition.toString({property:pr,duration:0,easing:"linear"}),ti={roleDescription:"sortable"};function ni(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,a]=u.useState(null),c=u.useRef(n);return ve(()=>{if(!e&&n!==c.current&&r.current){const l=o.current;if(l){const f=ot(r.current,{ignoreTransform:!0}),h={x:l.left-f.left,y:l.top-f.top,scaleX:l.width/f.width,scaleY:l.height/f.height};(h.x||h.y)&&a(h)}}n!==c.current&&(c.current=n)},[e,n,r,o]),u.useEffect(()=>{s&&a(null)},[s]),s}function Yi(t){let{animateLayoutChanges:e=Qs,attributes:n,disabled:r,data:o,getNewIndex:s=Js,id:a,strategy:c,resizeObserverConfig:l,transition:f=Zs}=t;const{items:h,containerId:d,activeIndex:g,disabled:b,disableTransforms:N,sortedRects:x,overIndex:v,useDragOverlay:R,strategy:w}=u.useContext(hr),C=ri(r,b),j=h.indexOf(a),k=u.useMemo(()=>({sortable:{containerId:d,index:j,items:h},...o}),[d,o,j,h]),E=u.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:m,node:p,isOver:y,setNodeRef:T}=_s({id:a,data:k,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:I,activatorEvent:S,activeNodeRect:A,attributes:O,setNodeRef:U,listeners:$,isDragging:P,over:V,setActivatorNodeRef:re,transform:xe}=Es({id:a,data:k,attributes:{...ti,...n},disabled:C.draggable}),qe=bo(T,U),X=!!I,H=X&&!N&&jt(g)&&jt(v),he=!R&&P,Ae=he&&H?xe:null,Ue=H?Ae??(c??w)({rects:x,activeNodeRect:A,activeIndex:g,overIndex:v,index:j}):null,ee=jt(g)&&jt(v)?s({id:a,items:h,activeIndex:g,overIndex:v}):j,q=I?.id,M=u.useRef({activeId:q,items:h,newIndex:ee,containerId:d}),Ee=h!==M.current.items,G=e({active:I,containerId:d,isDragging:P,isSorting:X,id:a,index:j,items:h,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:f,wasDragging:M.current.activeId!=null}),pe=ni({disabled:!G,index:j,node:p,rect:m});return u.useEffect(()=>{X&&M.current.newIndex!==ee&&(M.current.newIndex=ee),d!==M.current.containerId&&(M.current.containerId=d),h!==M.current.items&&(M.current.items=h)},[X,ee,d,h]),u.useEffect(()=>{if(q===M.current.activeId)return;if(q!=null&&M.current.activeId==null){M.current.activeId=q;return}const ke=setTimeout(()=>{M.current.activeId=q},50);return()=>clearTimeout(ke)},[q]),{active:I,activeIndex:g,attributes:O,data:k,rect:m,index:j,newIndex:ee,items:h,isOver:y,isSorting:X,isDragging:P,listeners:$,node:p,overIndex:v,over:V,setNodeRef:qe,setActivatorNodeRef:re,setDroppableNodeRef:T,setDraggableNodeRef:U,transform:pe??Ue,transition:te()};function te(){if(pe||Ee&&M.current.newIndex===j)return ei;if(!(he&&!$t(S)||!f)&&(X||G))return We.Transition.toString({...f,property:pr})}}function ri(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Lt(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const oi=[_.Down,_.Right,_.Up,_.Left],Hi=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:c}}=e;if(oi.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(t.code){case _.Down:r.top<g.top&&l.push(d);break;case _.Up:r.top>g.top&&l.push(d);break;case _.Left:r.left>g.left&&l.push(d);break;case _.Right:r.left<g.left&&l.push(d);break}});const f=Oo({collisionRect:r,droppableRects:o,droppableContainers:l});let h=Un(f,"id");if(h===a?.id&&f.length>1&&(h=f[1].id),h!=null){const d=s.get(n.id),g=s.get(h),b=g?o.get(g.id):null,N=g?.node.current;if(N&&b&&d&&g){const v=Vt(N).some((E,m)=>c[m]!==E),R=gr(d,g),w=si(d,g),C=v||!R?{x:0,y:0}:{x:w?r.width-b.width:0,y:w?r.height-b.height:0},j={x:b.left,y:b.top};return C.x&&C.y?j:bt(j,C)}}}};function gr(t,e){return!Lt(t)||!Lt(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function si(t,e){return!Lt(t)||!Lt(e)||!gr(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}export{Mi as A,We as C,$i as D,nr as K,rr as P,Ui as S,zi as a,Fi as b,Bi as c,Yi as d,dr as e,Vi as f,Li as g,Es as h,Xi as i,Hi as s,Pi as u,Ki as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as C,c as d,bt as u,j as l}from"./index-
|
|
1
|
+
import{e as C,c as d,bt as u,j as l}from"./index-rZ1TPVyD.js";const m=u("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function h(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=d(m({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let a,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=l.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=i):(a=e[3],i=e[4]);let s;e[5]!==t?(s=l.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=l.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{h as S};
|