decocms 3.34.2 → 3.34.4
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-CQgcG-Ae.js → AlertCircle-CzdD0HiL.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D0znd3JO.js → ArrowUpRight-BA7_QQtv.js} +1 -1
- package/dist/client/assets/{Check-BUKt5vhH.js → Check-DCL7RDuY.js} +1 -1
- package/dist/client/assets/{CheckCircle-x4whH3Qn.js → CheckCircle-Cx2a6H3v.js} +1 -1
- package/dist/client/assets/{ChevronDown-C6ULHnU-.js → ChevronDown-D-NGqiSH.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Btt_21CS.js → ChevronLeft-D0v1a1VK.js} +1 -1
- package/dist/client/assets/{ChevronRight-glzdqN1s.js → ChevronRight-OSZ9UQBS.js} +1 -1
- package/dist/client/assets/{ChevronUp-C5QGzLz6.js → ChevronUp-fyspqP-W.js} +1 -1
- package/dist/client/assets/{Container-RGkdLpnR.js → Container-Tw3rOSi3.js} +1 -1
- package/dist/client/assets/{DotsVertical-BrpflBsP.js → DotsVertical-C4-w4Qkz.js} +1 -1
- package/dist/client/assets/{Eye-Bk7j3Cz0.js → Eye-BmvVeOF9.js} +1 -1
- package/dist/client/assets/{FilterLines-xOxNVJBa.js → FilterLines-DdCr16DJ.js} +1 -1
- package/dist/client/assets/{Globe01-C8CeCAhz.js → Globe01-DoJKg1_O.js} +1 -1
- package/dist/client/assets/{HardDrive-Czbw3MRd.js → HardDrive-vKdqjrK9.js} +1 -1
- package/dist/client/assets/{Key01-ChQ6WmeN.js → Key01-K6tD8Vdh.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3sIkDa-.js → LayoutLeft-takDYV-t.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DNf7UuUK.js → LinkExternal01-BCi_ShXX.js} +1 -1
- package/dist/client/assets/{Monitor01-BzTgEIFJ.js → Monitor01-DB396gYF.js} +1 -1
- package/dist/client/assets/{Palette-DwfZnoA5.js → Palette-COuqms6z.js} +1 -1
- package/dist/client/assets/{Play-BXW8gJMz.js → Play-CjvHnycm.js} +1 -1
- package/dist/client/assets/{Plus-CugY_4xX.js → Plus-CcEwOgtq.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DiPX3Tzc.js → RefreshCcw01-CCfli9l6.js} +1 -1
- package/dist/client/assets/{SearchMd-DltTVRsJ.js → SearchMd-F8Lgigzr.js} +1 -1
- package/dist/client/assets/{Settings02-sAiuI7qb.js → Settings02-BIGqwL7C.js} +1 -1
- package/dist/client/assets/{Shield01-C-4y3Jk3.js → Shield01-B9Q_1Xk7.js} +1 -1
- package/dist/client/assets/{Star01-D8Xy046a.js → Star01-Dq4t2HLY.js} +1 -1
- package/dist/client/assets/{Stars01-BPnYJgb7.js → Stars01-CiNgchIp.js} +1 -1
- package/dist/client/assets/{Stars02-CP1Go7Ud.js → Stars02-CQVglhpL.js} +1 -1
- package/dist/client/assets/{Sun-BsWLyXgw.js → Sun-Cr2yuAzo.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-MAz-yRbe.js → SwitchHorizontal01-bU2GcEKE.js} +1 -1
- package/dist/client/assets/{Tool01-Cjstio7H.js → Tool01-eIrbwcPJ.js} +1 -1
- package/dist/client/assets/{Trash01-BJ6_IzkG.js → Trash01-D44a84s5.js} +1 -1
- package/dist/client/assets/{Upload01-C2pjhIpk.js → Upload01-VXtvttgz.js} +1 -1
- package/dist/client/assets/{User01-D2zO49mC.js → User01-DTzTYshF.js} +1 -1
- package/dist/client/assets/{Users01-ubeIr2qn.js → Users01-CUSYtOwa.js} +1 -1
- package/dist/client/assets/{Users03-BqYE15gt.js → Users03-D-uCbKBY.js} +1 -1
- package/dist/client/assets/{X-BQX3Zy-X.js → X-BerS9SvA.js} +1 -1
- package/dist/client/assets/{XCircle-D9dvtOsK.js → XCircle-DKQ_LGK7.js} +1 -1
- package/dist/client/assets/{XClose-DaB-YREn.js → XClose-DLTON1f7.js} +1 -1
- package/dist/client/assets/{Zap-j4DAJVgz.js → Zap-312eTZCV.js} +1 -1
- package/dist/client/assets/{ZapSquare-cM9Cdjuc.js → ZapSquare-Ds8_u3m3.js} +1 -1
- package/dist/client/assets/{ZoomOut-DVfZ-43U.js → ZoomOut-DJZYHdrq.js} +1 -1
- package/dist/client/assets/{access-gate-DZ_2pDdY.js → access-gate-DDt7PCzj.js} +1 -1
- package/dist/client/assets/{accordion-BISd33DR.js → accordion-C7tZu5zr.js} +1 -1
- package/dist/client/assets/add-section-modal-CXTw4rr2.js +1 -0
- package/dist/client/assets/{agent-capabilities-CVYxQ4uK.js → agent-capabilities-DD75DzJc.js} +2 -2
- package/dist/client/assets/{agent-icon-BgD5mt7Y.js → agent-icon-BbtDyEhK.js} +1 -1
- package/dist/client/assets/{agent-icons-DmQcPkq-.js → agent-icons-DW_aJ48l.js} +2 -2
- package/dist/client/assets/agents-list-DKuLM9YR.js +1 -0
- package/dist/client/assets/ai-providers-szVBTcEx.js +1 -0
- package/dist/client/assets/{alert-C7cWRVuG.js → alert-Bo_PTvcZ.js} +1 -1
- package/dist/client/assets/{alert-dialog-qtdXP2aD.js → alert-dialog-B-uaEzoe.js} +1 -1
- package/dist/client/assets/app-editor-C91DwP-X.js +1 -0
- package/dist/client/assets/auth-D_7i1Nyj.js +1 -0
- package/dist/client/assets/{auth-catchall-CuT4FTL1.js → auth-catchall-D-qC5UN5.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BDEnOc9x.js → auth-split-layout-CLwX_trK.js} +1 -1
- package/dist/client/assets/{automation-list-row-BW5rM44g.js → automation-list-row-CFcpTyMb.js} +1 -1
- package/dist/client/assets/{automation-runs-BUOdfMri.js → automation-runs-GuZPPaYO.js} +1 -1
- package/dist/client/assets/automations-DERQUV6U.js +1 -0
- package/dist/client/assets/{avatar-DYsooxxy.js → avatar-CzRJu4-e.js} +1 -1
- package/dist/client/assets/{badge-CTK5gX_I.js → badge-BH87JKvD.js} +1 -1
- package/dist/client/assets/brand-context-DfIPHLDc.js +1 -0
- package/dist/client/assets/{buckets-BPPYI6Ll.js → buckets-Bx69Uuhs.js} +1 -1
- package/dist/client/assets/{calendar-DMziTV2J.js → calendar-D1EOyTY7.js} +1 -1
- package/dist/client/assets/{capability-load-error-BTLQ23rW.js → capability-load-error-Bg7D6wTq.js} +1 -1
- package/dist/client/assets/{card-DGQIgBVW.js → card-vyZC9bmn.js} +1 -1
- package/dist/client/assets/{chat-context-BwBc2M6a.js → chat-context-fcMg1upF.js} +6 -6
- package/dist/client/assets/{checkbox-B-MHp2m4.js → checkbox-D5U8M06N.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CPZJCSmX.js → cli-auth-success-Bf19uQP9.js} +1 -1
- package/dist/client/assets/collection-detail-CAOIohKi.js +1 -0
- package/dist/client/assets/{collection-display-button-Df3MeS7W.js → collection-display-button-B92ml-o1.js} +1 -1
- package/dist/client/assets/{collection-search-BiQg9L4B.js → collection-search-B-w-HeXx.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEwd3fgl.js → collection-table-wrapper-C9pQRlzR.js} +1 -1
- package/dist/client/assets/{collection-tabs-CcnS0Il2.js → collection-tabs-Cf826YQE.js} +1 -1
- package/dist/client/assets/{collections-BnzTAqxJ.js → collections-DHGMK7u4.js} +1 -1
- package/dist/client/assets/{command-DNZKPE8c.js → command-CbVJYcLx.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-Cu6gQanY.js → connect-desktop-dialog-DeNV0iLp.js} +1 -1
- package/dist/client/assets/{connection-card-CwL_Gtb4.js → connection-card-Cod1I3T4.js} +1 -1
- package/dist/client/assets/{connection-detail-DTp8ff1l.js → connection-detail-Byr9G74f.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bm0LSgZq.js → connection-form-helpers-D6w2eM0g.js} +1 -1
- package/dist/client/assets/{connections-j-HJQpSe.js → connections-CrrJ4Vi1.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-CGrdlep9.js +1 -0
- package/dist/client/assets/{dialog-BVuxcsVk.js → dialog-DhPYQxKL.js} +1 -1
- package/dist/client/assets/domain-settings-6SYR51ts.js +1 -0
- package/dist/client/assets/{drawer-DXb-AEyv.js → drawer-Daco3mLi.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B8jiZxwT.js → dropdown-menu-DyHOWhHD.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-BemEgHny.js +1 -0
- package/dist/client/assets/{empty-state-DIMjTOGF.js → empty-state-Bu9Ydz_D.js} +1 -1
- package/dist/client/assets/{empty-state-D5f29Xcz.js → empty-state-wKCfoaUn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BJtaRoQB.js → extract-connection-data-CXfLD91m.js} +1 -1
- package/dist/client/assets/features-D1v6KDMk.js +1 -0
- package/dist/client/assets/file-explorer-DClpTAL5.js +2 -0
- package/dist/client/assets/{file-type-icon-9GbQJJla.js → file-type-icon-CJ-zSSSF.js} +1 -1
- package/dist/client/assets/{files-BDf63K2h.js → files-CpnG1733.js} +1 -1
- package/dist/client/assets/{form-D5zHXlMU.js → form-Bvy6rgyq.js} +1 -1
- package/dist/client/assets/general-D5o_SLmt.js +1 -0
- package/dist/client/assets/generate-id-ChTWQ_R9.js +1 -0
- package/dist/client/assets/{github-repo-picker-D0jgVOhB.js → github-repo-picker-71D4tYUy.js} +2 -2
- package/dist/client/assets/{header-tab-button-B7JCdtgi.js → header-tab-button-0n75_bDq.js} +3 -3
- package/dist/client/assets/{hover-card-BAzXpmKd.js → hover-card-CWAzZxGp.js} +1 -1
- package/dist/client/assets/{image-field-Ysc9gjw_.js → image-field-93_1M6Cv.js} +1 -1
- package/dist/client/assets/{index-Cbngzld3.js → index-AYOhbOh-.js} +34 -34
- package/dist/client/assets/{index-Drq6TCfC.js → index-BTwzTipj.js} +1 -1
- package/dist/client/assets/{index-PadxIFkt.js → index-BaTRbm9d.js} +1 -1
- package/dist/client/assets/{index-kU5u3aEQ.js → index-C5isfxFM.js} +1 -1
- package/dist/client/assets/{index-Bb8K2DUU.js → index-CAdWwovr.js} +2 -2
- package/dist/client/assets/{index-BZGVDk3g.js → index-CJzhadxV.js} +1 -1
- package/dist/client/assets/index-CKlPSEz_.js +1 -0
- package/dist/client/assets/{index-C_RnYmCN.js → index-CZrxu3V-.js} +1 -1
- package/dist/client/assets/index-Chg_1h1Q.js +1 -0
- package/dist/client/assets/{index-DdEtGRBb.js → index-CmQW0pRd.js} +3 -3
- package/dist/client/assets/{index-BPCEqCH8.js → index-CyFYd9U1.js} +1 -1
- package/dist/client/assets/{index-DEkPGwPd.js → index-D9m-XNQG.js} +1 -1
- package/dist/client/assets/{index-DES0wLPI.js → index-GjxZu5D5.js} +13 -13
- package/dist/client/assets/{index-C5DGaDTE.js → index-I0Hfa1ue.js} +1 -1
- package/dist/client/assets/{index-redirect-BVfzEM-2.js → index-redirect-BOWIqnKA.js} +1 -1
- package/dist/client/assets/{index-BFPk_Xc8.js → index-vPgvQXD8.js} +1 -1
- package/dist/client/assets/{input-CxWmKS03.js → input-DErmZhFg.js} +1 -1
- package/dist/client/assets/{integration-icon-C8l8gk56.js → integration-icon-s9jj_05B.js} +1 -1
- package/dist/client/assets/{label-BUOqnJ7l.js → label-Dr2eF6if.js} +1 -1
- package/dist/client/assets/{layout-BXEq9Lt0.js → layout-B9jMdIeQ.js} +1 -1
- package/dist/client/assets/{login-79jBd8dT.js → login-wWsXDjg2.js} +1 -1
- package/dist/client/assets/mcp-oauth-BOnYmqmQ.js +1 -0
- package/dist/client/assets/{members-4ZcflmV4.js → members-BG-EYVVx.js} +2 -2
- package/dist/client/assets/{monaco-editor-CwH2NVur.js → monaco-editor-UIKiC3DB.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-_N9Geab-.js → monitoring-stats-row-62KT747u.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CcTTT6yu.js → oauth-callback-ai-provider-CySxin-u.js} +1 -1
- package/dist/client/assets/oauth-callback-ai4Tc2VZ.js +1 -0
- package/dist/client/assets/{onboarding-DM9L8yF1.js → onboarding-mGbMpy90.js} +1 -1
- package/dist/client/assets/{org-install-BKkCtJoj.js → org-install-DZIuKflZ.js} +1 -1
- package/dist/client/assets/{org-layout-CeAaKEeN.js → org-layout-DTZl85nm.js} +1 -1
- package/dist/client/assets/org-plugin-layout-DMoqZL8g.js +1 -0
- package/dist/client/assets/{page-seo-form-c-iWMPRU.js → page-seo-form-Br2QpcIh.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C7vZkIVX.js +1 -0
- package/dist/client/assets/{pair-DGfi0DYT.js → pair-BKA_cCJy.js} +6 -6
- package/dist/client/assets/{plugin-empty-state-DhzIqwYl.js → plugin-empty-state-BpXDhzPo.js} +1 -1
- package/dist/client/assets/{plugin-header-Nu37D2e7.js → plugin-header-DpAoB9Ca.js} +1 -1
- package/dist/client/assets/{plugin-layout-DS-45rI5.js → plugin-layout-BoMcJfNN.js} +1 -1
- package/dist/client/assets/{popover-DIhiGQZO.js → popover-qA5W_aO0.js} +1 -1
- package/dist/client/assets/{post-editor-BhTIGX9u.js → post-editor-B7EDLj8a.js} +2 -2
- package/dist/client/assets/{primitives-D3OiaA1o.js → primitives-BjZIjqQm.js} +1 -1
- package/dist/client/assets/profile-DefhUD1s.js +1 -0
- package/dist/client/assets/project-app-view-JCtxsXyA.js +1 -0
- package/dist/client/assets/record-editor-CYAiRWSG.js +1 -0
- package/dist/client/assets/registry-CGWdwDoa.js +2 -0
- package/dist/client/assets/{registry-layout-CkNttCUh.js → registry-layout-DVCtktv7.js} +4 -4
- package/dist/client/assets/{require-capability-Cm5KwYyo.js → require-capability-kzIBHw7I.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C2qJiXM7.js → required-auth-layout--gAqPx1o.js} +1 -1
- package/dist/client/assets/{reset-password-iw6TtkA7.js → reset-password-zPPgPZZ-.js} +1 -1
- package/dist/client/assets/{resizable-DOED-lqJ.js → resizable-C5LjJwjN.js} +1 -1
- package/dist/client/assets/roles-C-Aul5X9.js +1 -0
- package/dist/client/assets/save-referenced-block-Cqd_M5sH.js +1 -0
- package/dist/client/assets/{save-status-NiMLdA_E.js → save-status-BV3DYgWl.js} +1 -1
- package/dist/client/assets/{schema-form-BMMNRxMa.js → schema-form-SJrGXRlU.js} +1 -1
- package/dist/client/assets/{scroll-area-BCusTvyt.js → scroll-area-D-A0aCbX.js} +1 -1
- package/dist/client/assets/{search-input-BlmktcqH.js → search-input-BGHqVG2v.js} +1 -1
- package/dist/client/assets/{secrets-Kx-u37G9.js → secrets-DV4PS6bI.js} +1 -1
- package/dist/client/assets/{sections-editor-Btt2eICm.js → sections-editor-Zi700_G9.js} +2 -2
- package/dist/client/assets/{select-DJ-jQ95-.js → select-C-92em1q.js} +1 -1
- package/dist/client/assets/{select-model-CuVna3TI.js → select-model-Dih5vchT.js} +1 -1
- package/dist/client/assets/seo-editor-D29FTKLv.js +1 -0
- package/dist/client/assets/settings-layout-NEtrChfG.js +1 -0
- package/dist/client/assets/{settings-section-Bs7s9mU1.js → settings-section-CJGTSnIh.js} +1 -1
- package/dist/client/assets/{sheet-4VDYc-Lf.js → sheet-BzobqfQ2.js} +1 -1
- package/dist/client/assets/{shell-controls-D0MQ2JKg.js → shell-controls-P01RjHPJ.js} +1 -1
- package/dist/client/assets/{shell-layout-BtNaHUcu.js → shell-layout-C_RGI19w.js} +1 -1
- package/dist/client/assets/shell-route-loading-Vpy9ggBQ.js +1 -0
- package/dist/client/assets/{sidebar-DeB8mcen.js → sidebar-jPzKrErD.js} +1 -1
- package/dist/client/assets/{skeleton-Cuoq2c8E.js → skeleton-BkBCJzvx.js} +1 -1
- package/dist/client/assets/{sortable.esm-4pxxx_ZW.js → sortable.esm-BxJf-B3h.js} +2 -2
- package/dist/client/assets/{spinner-Dar3jTAz.js → spinner-fzT44PtT.js} +1 -1
- package/dist/client/assets/{sso-C0PJx8_v.js → sso-BjNFVlpu.js} +1 -1
- package/dist/client/assets/store-CqP-ICoJ.js +1 -0
- package/dist/client/assets/store-registry-DceSZztf.js +2 -0
- package/dist/client/assets/{studio-tools-B99HmIGq.js → studio-tools-D1zmoCWz.js} +1 -1
- package/dist/client/assets/{switch-jfclxkGe.js → switch-DTsn6qak.js} +1 -1
- package/dist/client/assets/{tab-id-C7uvN0td.js → tab-id-CqhjPWfe.js} +1 -1
- package/dist/client/assets/{table-DEsh_yYm.js → table-DHXpvgyf.js} +1 -1
- package/dist/client/assets/{tabs-tr2cYDEl.js → tabs-Bk42DpLr.js} +1 -1
- package/dist/client/assets/{task-status-Ds87FkqY.js → task-status-BJtFNCHO.js} +1 -1
- package/dist/client/assets/{textarea-uwm8kgXD.js → textarea-6a4-y1Su.js} +1 -1
- package/dist/client/assets/{toggle-group-BDjNDkJX.js → toggle-group-DMQKr8tB.js} +1 -1
- package/dist/client/assets/{toolbar-BIItBzPS.js → toolbar-nvslJ6se.js} +1 -1
- package/dist/client/assets/tools-list-BZ88ZOtB.js +1 -0
- package/dist/client/assets/{tooltip--aN5hOmO.js → tooltip-B_bAE461.js} +1 -1
- package/dist/client/assets/{types-BqoD-In5.js → types-yCFKjNKB.js} +3 -3
- package/dist/client/assets/{use-ai-providers-CdyP1ECQ.js → use-ai-providers-B0XGed9T.js} +1 -1
- package/dist/client/assets/{use-automations-CtzZDGfB.js → use-automations-BVmzaYqk.js} +1 -1
- package/dist/client/assets/{use-capability-KB17PgvY.js → use-capability-BZHRv6lH.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CbDuKmI6.js → use-clock-tick-Cs4ksDbV.js} +1 -1
- package/dist/client/assets/use-collections-CpH8UnUb.js +1 -0
- package/dist/client/assets/{use-connection-Zog2j0WA.js → use-connection-Dr4v30Rg.js} +1 -1
- package/dist/client/assets/{use-copy-CZHdrpQ2.js → use-copy-DxwnRzEa.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-aKZM7QuJ.js → use-create-virtual-mcp-DkNKlR70.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CLmefNH1.js → use-debounced-autosave-XMghK7cg.js} +1 -1
- package/dist/client/assets/use-delete-connection-BCuDZsFN.js +1 -0
- package/dist/client/assets/{use-file-configs-vUZ85Q5v.js → use-file-configs-CdUbNW-T.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-RcbuivWg.js → use-infinite-scroll-BEtIsVE7.js} +1 -1
- package/dist/client/assets/{use-list-state-D4jM3-Gj.js → use-list-state-DTPAi9kL.js} +1 -1
- package/dist/client/assets/use-mcp-client-CY4k0WSm.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-DXY1goeC.js → use-mcp-prompts-D5BNmvrR.js} +1 -1
- package/dist/client/assets/use-mcp-tools-D_HyfNkD.js +1 -0
- package/dist/client/assets/{use-members--qC59KQg.js → use-members-BLQ0hZRF.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-nRLYSeRD.js → use-navigate-to-agent-C3bIAWTD.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-vlAtiOoY.js → use-org-auth-client-DVEzJXpD.js} +1 -1
- package/dist/client/assets/{use-org-sso-D9s0K3D9.js → use-org-sso-D4Tlhwcs.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DfHQwz_9.js → use-organization-roles-C-fo78Yw.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BYRiagaB.js → use-organization-settings-B_Bobbu2.js} +1 -1
- package/dist/client/assets/use-registry-connections-SPQVCkw4.js +1 -0
- package/dist/client/assets/{use-secrets-CqzR66gk.js → use-secrets-DMcF1I87.js} +1 -1
- package/dist/client/assets/use-status-sounds-BGGoA40W.js +1 -0
- package/dist/client/assets/{use-view-mode-rJzWSnvR.js → use-view-mode-r7LIRuse.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CfnJ2csQ.js → use-virtual-mcp-XH9W6O_2.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BE7Sw7iZ.js +1 -0
- package/dist/client/assets/{useRouterState-somQ9b5z.js → useRouterState-DzqrXxOn.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery--BKwSeAU.js +1 -0
- package/dist/client/assets/{user-Bku5ElcW.js → user-CaBRgHEo.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DV5nhx4X.js → view-mode-toggle-DjFtVOvp.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CzyBkAGb.js → watch-sse-pool-BayTAOpL.js} +1 -1
- package/dist/client/assets/workflow-DIJr05qP.js +1 -0
- package/dist/client/assets/workflow-detail-BlQLBQHt.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/add-section-modal-DIOLC-ZF.js +0 -1
- package/dist/client/assets/agents-list-h30K61d9.js +0 -1
- package/dist/client/assets/ai-providers-CEnY5BL7.js +0 -1
- package/dist/client/assets/app-editor-B4mTx3Hz.js +0 -1
- package/dist/client/assets/automations-ClItqGDn.js +0 -1
- package/dist/client/assets/brand-context-CtcRGgwt.js +0 -1
- package/dist/client/assets/collection-detail-AQZQR51q.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-COADWaXW.js +0 -1
- package/dist/client/assets/domain-settings-DKOBo5cc.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-DYfQLQqA.js +0 -1
- package/dist/client/assets/features-Baf8n_se.js +0 -1
- package/dist/client/assets/file-explorer-BB5qrAiH.js +0 -2
- package/dist/client/assets/general-t5ylGzhM.js +0 -1
- package/dist/client/assets/generate-id-16rt0unc.js +0 -1
- package/dist/client/assets/index-CbN9kYHB.js +0 -1
- package/dist/client/assets/index-vM9scTJV.js +0 -1
- package/dist/client/assets/oauth-callback-UYq6rKIp.js +0 -1
- package/dist/client/assets/org-plugin-layout-B_8XF5xC.js +0 -1
- package/dist/client/assets/page-seo-sheet-DEsc0wUy.js +0 -1
- package/dist/client/assets/profile-BOnhq-U1.js +0 -1
- package/dist/client/assets/project-app-view-B6XESkOH.js +0 -1
- package/dist/client/assets/record-editor-DDxQqS5k.js +0 -1
- package/dist/client/assets/registry-AsFW8yYm.js +0 -2
- package/dist/client/assets/roles-DpYb1zXX.js +0 -1
- package/dist/client/assets/save-referenced-block-aVkQu985.js +0 -1
- package/dist/client/assets/seo-editor-CpGzaUnY.js +0 -1
- package/dist/client/assets/settings-layout-CUxOF-JB.js +0 -1
- package/dist/client/assets/shell-route-loading-Dy64K_ax.js +0 -1
- package/dist/client/assets/store-XNFzt3Sr.js +0 -1
- package/dist/client/assets/store-registry-D3KY8zoe.js +0 -2
- package/dist/client/assets/tools-list-BQc1il3V.js +0 -1
- package/dist/client/assets/use-collections-shQIB33q.js +0 -1
- package/dist/client/assets/use-delete-connection-DXPW2vzV.js +0 -1
- package/dist/client/assets/use-mcp-client-BNpG-Sq-.js +0 -10
- package/dist/client/assets/use-mcp-tools-BIWz7WmP.js +0 -1
- package/dist/client/assets/use-registry-connections-2J71KvqA.js +0 -1
- package/dist/client/assets/use-status-sounds-Ce0VEQki.js +0 -1
- package/dist/client/assets/useInfiniteQuery-g2cikAaR.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ZAutmGB6.js +0 -1
- package/dist/client/assets/workflow-BPCoD875.js +0 -1
- package/dist/client/assets/workflow-detail-DWZIWF6w.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as F,j as t,r as Q,B as je,l as Se}from"./index-Cbngzld3.js";import{i as be}from"./ChevronRight-glzdqN1s.js";import{F as fe}from"./agent-icon-BgD5mt7Y.js";import{S as ue}from"./scroll-area-BCusTvyt.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Fe,f as Te,P as Re,S as Ee}from"./page-seo-form-c-iWMPRU.js";import{n as ze}from"./index-DES0wLPI.js";import{a as ge}from"./Tool01-Cjstio7H.js";import{s as xe}from"./schema-form-BMMNRxMa.js";import"./AlertCircle-CQgcG-Ae.js";import"./SwitchHorizontal01-MAz-yRbe.js";import"./RefreshCcw01-DiPX3Tzc.js";import"./XCircle-D9dvtOsK.js";import"./ArrowUpRight-D0znd3JO.js";import"./ZapSquare-cM9Cdjuc.js";import"./Users03-BqYE15gt.js";import"./CheckCircle-x4whH3Qn.js";import"./Check-BUKt5vhH.js";import"./ChevronDown-C6ULHnU-.js";import"./ChevronLeft-Btt_21CS.js";import"./ChevronUp-C5QGzLz6.js";import"./DotsVertical-BrpflBsP.js";import"./Container-RGkdLpnR.js";import"./Eye-Bk7j3Cz0.js";import"./ZoomOut-DVfZ-43U.js";import"./Globe01-C8CeCAhz.js";import"./FilterLines-xOxNVJBa.js";import"./Star01-D8Xy046a.js";import"./Palette-DwfZnoA5.js";import"./HardDrive-Czbw3MRd.js";import"./Stars02-CP1Go7Ud.js";import"./Key01-ChQ6WmeN.js";import"./LayoutLeft-D3sIkDa-.js";import"./LinkExternal01-DNf7UuUK.js";import"./Monitor01-BzTgEIFJ.js";import"./Sun-BsWLyXgw.js";import"./Play-BXW8gJMz.js";import"./Plus-CugY_4xX.js";import"./SearchMd-DltTVRsJ.js";import"./Settings02-sAiuI7qb.js";import"./Shield01-C-4y3Jk3.js";import"./Stars01-BPnYJgb7.js";import"./Trash01-BJ6_IzkG.js";import"./Upload01-C2pjhIpk.js";import"./User01-D2zO49mC.js";import"./Users01-ubeIr2qn.js";import"./XClose-DaB-YREn.js";import"./X-BQX3Zy-X.js";import"./Zap-j4DAJVgz.js";import"./select-DJ-jQ95-.js";import"./tooltip--aN5hOmO.js";import"./label-BUOqnJ7l.js";import"./switch-jfclxkGe.js";import"./agent-capabilities-CVYxQ4uK.js";import"./chat-context-BwBc2M6a.js";import"./tab-id-C7uvN0td.js";import"./use-mcp-client-BNpG-Sq-.js";import"./watch-sse-pool-CzyBkAGb.js";import"./decopilot-sse-pool-COADWaXW.js";import"./studio-tools-B99HmIGq.js";import"./use-virtual-mcp-CfnJ2csQ.js";import"./use-collections-shQIB33q.js";import"./use-ai-providers-CdyP1ECQ.js";import"./use-organization-settings-BYRiagaB.js";import"./pair-DGfi0DYT.js";import"./use-clock-tick-CbDuKmI6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CZHdrpQ2.js";import"./file-type-icon-9GbQJJla.js";import"./dialog-BVuxcsVk.js";import"./content-blocks-o63cs2vh.js";import"./types-BqoD-In5.js";import"./shell-layout-BtNaHUcu.js";import"./avatar-DYsooxxy.js";import"./required-auth-layout-C2qJiXM7.js";import"./useRouterState-somQ9b5z.js";import"./use-org-sso-D9s0K3D9.js";import"./integration-icon-C8l8gk56.js";import"./use-navigate-to-agent-nRLYSeRD.js";import"./use-connection-Zog2j0WA.js";import"./use-mcp-prompts-DXY1goeC.js";import"./form-D5zHXlMU.js";import"./input-CxWmKS03.js";import"./spinner-Dar3jTAz.js";import"./drawer-DXb-AEyv.js";import"./collection-search-BiQg9L4B.js";import"./tabs-tr2cYDEl.js";import"./toggle-group-BDjNDkJX.js";import"./sortable.esm-4pxxx_ZW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CwL_Gtb4.js";import"./use-registry-connections-2J71KvqA.js";import"./useInfiniteQuery-g2cikAaR.js";import"./use-infinite-scroll-RcbuivWg.js";import"./extract-connection-data-BJtaRoQB.js";import"./generate-id-16rt0unc.js";import"./collections-BnzTAqxJ.js";import"./card-DGQIgBVW.js";import"./collection-tabs-CcnS0Il2.js";import"./badge-CTK5gX_I.js";import"./textarea-uwm8kgXD.js";import"./connection-form-helpers-Bm0LSgZq.js";import"./useSuspenseInfiniteQuery-ZAutmGB6.js";import"./connect-desktop-dialog-Cu6gQanY.js";import"./agent-icons-DmQcPkq-.js";import"./checkbox-B-MHp2m4.js";import"./skeleton-Cuoq2c8E.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Bs7s9mU1.js";import"./popover-DIhiGQZO.js";import"./command-DNZKPE8c.js";import"./index-C_RnYmCN.js";import"./index-PadxIFkt.js";import"./dropdown-menu-B8jiZxwT.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-Dy64K_ax.js";import"./sidebar-DeB8mcen.js";import"./sheet-4VDYc-Lf.js";import"./toolbar-BIItBzPS.js";import"./use-create-virtual-mcp-aKZM7QuJ.js";import"./github-repo-picker-D0jgVOhB.js";import"./use-mcp-tools-BIWz7WmP.js";import"./alert-dialog-qtdXP2aD.js";import"./index-kU5u3aEQ.js";import"./use-org-auth-client-vlAtiOoY.js";import"./hover-card-BAzXpmKd.js";import"./task-status-Ds87FkqY.js";import"./use-status-sounds-Ce0VEQki.js";import"./empty-state-D5f29Xcz.js";import"./resizable-DOED-lqJ.js";import"./use-capability-KB17PgvY.js";import"./header-tab-button-B7JCdtgi.js";import"./index-DEkPGwPd.js";import"./user-Bku5ElcW.js";import"./tools-list-BQc1il3V.js";import"./use-debounced-autosave-CLmefNH1.js";import"./index-BFPk_Xc8.js";import"./search-input-BlmktcqH.js";import"./use-secrets-CqzR66gk.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-BISd33DR.js";import"./view-mode-toggle-DV5nhx4X.js";import"./select-model-CuVna3TI.js";import"./use-automations-CtzZDGfB.js";import"./monaco-editor-CwH2NVur.js";import"./automation-runs-BUOdfMri.js";import"./table-DEsh_yYm.js";import"./use-members--qC59KQg.js";import"./automation-list-row-BW5rM44g.js";import"./calendar-DMziTV2J.js";import"./image-field-Ysc9gjw_.js";import"./use-file-configs-vUZ85Q5v.js";function U(a){return typeof a=="string"&&a.trim()?a:void 0}function he(a,e){if(a){if(e)try{const i=new URL(a,e).href;return xe(i)}catch{return}return xe(a)}}function Pe(a){if(!a)return{};const e=U(a.title),i=U(a.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(a.description),image:U(a.image),favicon:U(a.favicon)}}function Oe(a){if(!a)return"example.com";try{return new URL(a).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(a){const e=F.c(10),{src:i,className:r,iconSize:h}=a,n=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==n?(o=t.jsx(ge,{size:n}),e[5]=n,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(a){const e=F.c(27),{seo:i,host:r,path:h}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:"#fff",border:"1px solid #dadce0"},e[0]=n):n=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:n,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(a){const e=F.c(20),{seo:i,host:r}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let n;e[1]!==i.image?(n=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=n):n=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==n?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[n,x]}),e[17]=x,e[18]=n,e[19]=u):u=e[19],u}function Ie(a){const e=F.c(23),{seo:i,host:r,accent:h}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:"#f0f2f5"},e[0]=n):n=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:n,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(a){const e=F.c(33),{seo:i,host:r,accent:h,dark:n}=a,s=n?"#2b2d31":"#fff",o=n?"#00a8fc":"#1264a3",l=n?"#dbdee1":"#3b4045",m=n?"#949ba4":"#8a9099",p=n?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(a){const e=F.c(17),{platform:i,seo:r,host:h,path:n}=a;let s;e[0]!==h||e[1]!==n||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:n}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:n}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:n,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:n,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=n,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(a){const e=F.c(17),{seo:i,url:r,path:h}=a,n=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=n==="/"?"":n;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function $i(a){const e=F.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:n,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=a,c=Ne(n,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},T=c?we(w,c):null,z=T&&(!K||Ce(B))?ze(T,s):null;let M;e[0]!==s?(M=Fe(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==n||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Te(n,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=n,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ne=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ae=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ne||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ne,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ne,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==T||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ae||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:T,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&T&&t.jsx(Ee,{schema:z,resolveType:T,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ae,path:P})})})]}),e[38]=T,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ae,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(a){return a+1}function Me(a){return a+1}function Ge(a,e){try{return new URL(a,e).href}catch{return e}}function Ve(a,e){const i=e.__resolveType,r=a.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...a};for(const[n,s]of Object.entries(e))n!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[n]=s));return h}export{$i as SeoEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as S,g as T,j as s,q as W,b7 as X,c as w,F as Y,P as F,t as H,a2 as Q,b as D,l as Z,r as ee,O as se}from"./index-Cbngzld3.js";import{u as J}from"./useRouterState-somQ9b5z.js";import{S as te,a as le,b as re,e as I,f as A,g as L,c as B,d as R,i as ie,j as ne}from"./sidebar-DeB8mcen.js";import{a as oe}from"./index-BFPk_Xc8.js";import{n as ae,b as ce,a as me,c as fe,d as de,i as K}from"./ZapSquare-cM9Cdjuc.js";import{t as be,a as E}from"./Users03-BqYE15gt.js";import{i as xe}from"./HardDrive-Czbw3MRd.js";import{i as ue}from"./Key01-ChQ6WmeN.js";import{i as he}from"./Shield01-C-4y3Jk3.js";import{s as ge}from"./User01-D2zO49mC.js";import{i as G}from"./Zap-j4DAJVgz.js";import{a as pe}from"./use-capability-KB17PgvY.js";import{u as U}from"./tooltip--aN5hOmO.js";import{u as je}from"./use-status-sounds-Ce0VEQki.js";import{a as y}from"./toolbar-BIItBzPS.js";import{S as _e,M as ye}from"./shell-controls-D0MQ2JKg.js";import"./LayoutLeft-D3sIkDa-.js";import"./sheet-4VDYc-Lf.js";import"./X-BQX3Zy-X.js";import"./question-004-sINsf4GQ.js";import"./watch-sse-pool-CzyBkAGb.js";import"./decopilot-sse-pool-COADWaXW.js";import"./ChevronLeft-Btt_21CS.js";import"./ChevronRight-glzdqN1s.js";function V(){const e=S.c(26),t=W().project;let n;e[0]!==t.enabledPlugins?(n=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=n):n=e[1];const l=n,{capabilities:i,isPrivileged:r,loading:o,error:a}=pe();let c,d;if(e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r||e[6]!==o){d=Symbol.for("react.early_return_sentinel");e:{let m;e[9]!==l?(m=q=>l.includes(q.pluginId),e[9]=l,e[10]=m):m=e[10];const h=X.filter(m).map(ve);let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(be,{size:14}),e[11]=b):b=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ae,{size:14}),e[12]=f):f=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ce,{size:14}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ue,{size:14}),e[14]=g):g=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{size:14}),e[15]=p):p=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{size:14}),e[16]=u):u=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(E,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(G,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(fe,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(de,{size:14}),e[20]=N):N=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(E,{size:14}),e[21]=k):k=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(he,{size:14}),e[22]=$):$=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Y,{size:14}),e[23]=z):z=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(G,{size:14}),e[24]=C):C=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ge,{size:14}),e[25]=P):P=e[25];const O=[{label:"Organization",items:[{key:"general",label:"General",icon:b,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:x,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:g,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:p,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:u,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:_,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:j,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:v,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:N,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:k,to:"/$org/settings/members",requires:"members:manage"},{key:"roles",label:"Roles",icon:$,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:z,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Extensions",items:[{key:"features",label:"Plugins",icon:C,to:"/$org/settings/features",requires:"org:manage"},...h]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:P,to:"/$org/settings/profile"}]}];if(o||a){d=O;break e}c=O.map(q=>({...q,items:q.items.filter(M=>M.privilegedOnly?r:M.requires?r||i[M.requires]:!0)})).filter(Se)}e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=o,e[7]=c,e[8]=d}else c=e[7],d=e[8];return d!==Symbol.for("react.early_return_sentinel")?d:c}function Se(e){return e.items.length>0}function ve(e){const{key:t,label:n,icon:l,to:i}=e;return{key:t,label:n,icon:l,to:i}}function Ne(){const e=S.c(19),t=V();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:l}=T(n);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={select:$e},e[1]=i):i=e[1];const r=J(i);let o;e[2]!==l||e[3]!==r?(o=x=>{const g=x.replace("$org",l);return r.startsWith(g)},e[2]=l,e[3]=r,e[4]=o):o=e[4];const a=o;let c;if(e[5]!==t||e[6]!==a||e[7]!==l){let x;e[9]!==a||e[10]!==l?(x=(g,p)=>s.jsxs(I,{className:"pt-0 pr-0 pb-0 pl-0",children:[g.label&&s.jsx("p",{className:w("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",p>0&&"mt-3"),children:g.label}),s.jsx(A,{children:s.jsx(L,{className:"gap-0.5",children:g.items.map(u=>s.jsx(B,{children:s.jsx(R,{asChild:!0,isActive:a(u.to),children:s.jsxs(F,{to:u.to,params:{org:l},onClick:()=>H("settings_nav_clicked",{section_key:u.key,section_label:u.label,group_label:g.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:u.icon}),s.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},`${g.label}-${p}`),e[9]=a,e[10]=l,e[11]=x):x=e[11],c=t.map(x),e[5]=t,e[6]=a,e[7]=l,e[8]=c}else c=e[8];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=d):d=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(I,{className:"pt-0 pr-0 pb-0 pl-0",children:[d,s.jsx(A,{children:s.jsx(L,{className:"gap-0.5",children:s.jsx(B,{children:s.jsxs(R,{onClick:ke,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(K,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=m):m=e[13];let h;e[14]!==c?(h=s.jsxs(ie,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[c,m]}),e[14]=c,e[15]=h):h=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.34.2"]})}),e[16]=b):b=e[16];let f;return e[17]!==h?(f=s.jsxs(ne,{variant:"sidebar",children:[h,b]}),e[17]=h,e[18]=f):f=e[18],f}function ke(){H("signed_out",{source:"settings_sidebar"}),Q(),D.signOut()}function $e(e){return e.location.pathname}function ze(e){const t=S.c(21),{onClose:n}=e,l=V();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org"},t[0]=i):i=t[0];const{org:r}=T(i);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={select:Pe},t[1]=o):o=t[1];const a=J(o);let c;t[2]!==r||t[3]!==a?(c=p=>{const u=p.replace("$org",r);return a.startsWith(u)},t[2]=r,t[3]=a,t[4]=c):c=t[4];const d=c;let m;if(t[5]!==l||t[6]!==d||t[7]!==n||t[8]!==r){let p;t[10]!==d||t[11]!==n||t[12]!==r?(p=(u,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&s.jsx("p",{className:w("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:u.label}),u.items.map(j=>s.jsxs(F,{to:j.to,params:{org:r},onClick:n,className:w("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",d(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:j.icon}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${u.label}-${_}`),t[10]=d,t[11]=n,t[12]=r,t[13]=p):p=t[13],m=l.map(p),t[5]=l,t[6]=d,t[7]=n,t[8]=r,t[9]=m}else m=t[9];let h;t[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=h):h=t[14];let b;t[15]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[h,s.jsxs("button",{type:"button",onClick:Ce,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("span",{className:"shrink-0",children:s.jsx(K,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=b):b=t[15];let f;t[16]!==m?(f=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[m,b]}),t[16]=m,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.34.2"]})}),t[18]=x):x=t[18];let g;return t[19]!==f?(g=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[f,x]}),t[19]=f,t[20]=g):g=t[20],g}function Ce(){Q(),D.signOut()}function Pe(e){return e.location.pathname}function qe(){const e=S.c(4),t=U(),{org:n}=W();je(n.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Z,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ee.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(oe,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(se,{})})})})}),e[1]=i):i=e[1];const r=i;if(t){let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:r}),e[2]=a):a=e[2],a}let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:w("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:r})}),e[3]=o):o=e[3],o}function ts(){const e=S.c(22),t=U();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.LogoLink,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&s.jsx(_e,{}),e[1]=t,e[2]=l):l=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"hidden md:contents",children:s.jsx(y.Nav,{})}),e[3]=i):i=e[3];let r;e[4]!==l?(r=s.jsxs(y.LeftColumn,{children:[n,l,i]}),e[4]=l,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[6]=o):o=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[7]=a):a=e[7];let c;e[8]!==r?(c=s.jsxs(y.Header,{children:[r,o,a]}),e[8]=r,e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d={"--sidebar-width-icon":"3.5rem"},e[10]=d):d=e[10];let m;e[11]!==t?(m=!t&&s.jsx(Ne,{}),e[11]=t,e[12]=m):m=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(te,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(qe,{})}),e[13]=h):h=e[13];let b;e[14]!==m?(b=s.jsxs(le,{className:"flex-1 bg-sidebar min-h-0",style:d,children:[m,h]}),e[14]=m,e[15]=b):b=e[15];let f;e[16]!==t?(f=t&&s.jsx(ye,{renderSidebar:we}),e[16]=t,e[17]=f):f=e[17];let x;return e[18]!==b||e[19]!==f||e[20]!==c?(x=s.jsx(y.Provider,{children:s.jsx(re,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,b,f]})})}),e[18]=b,e[19]=f,e[20]=c,e[21]=x):x=e[21],x}function we(e){const{onClose:t}=e;return s.jsx(ze,{onClose:t})}export{Ne as SettingsSidebar,ze as SettingsSidebarMobile,ts as default};
|
|
@@ -1 +0,0 @@
|
|
|
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-Cbngzld3.js";import{u as gr}from"./useRouterState-somQ9b5z.js";import{c as br,i as jr,a as vr}from"./ZoomOut-DVfZ-43U.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-DeB8mcen.js";import{T as we}from"./toolbar-BIItBzPS.js";import{u as Ms,T as We,a as qe,b as Ve,c as ts}from"./tooltip--aN5hOmO.js";import{S as _e}from"./skeleton-Cuoq2c8E.js";import{P as Rt,a as ut,b as Dt}from"./popover-DIhiGQZO.js";import{b as As,a as $s,D as Os}from"./drawer-DXb-AEyv.js";import{i as Ts}from"./SearchMd-DltTVRsJ.js";import{s as _r}from"./Star01-D8Xy046a.js";import{s as Ne}from"./Plus-CugY_4xX.js";import{i as Nr,g as Cr}from"./use-mcp-client-BNpG-Sq-.js";import{a as zs,u as ht,b as wr}from"./use-virtual-mcp-CfnJ2csQ.js";import{u as kr}from"./use-create-virtual-mcp-aKZM7QuJ.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-D0jgVOhB.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Pr,_ as Rr,$ as Dr}from"./agent-icon-BgD5mt7Y.js";import{u as Rs,d as Er,k as Ds}from"./tab-id-C7uvN0td.js";import{r as Fr,a as Gr,R as Br,b as Lr,u as Es}from"./shell-layout-BtNaHUcu.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-nRLYSeRD.js";import{A as os}from"./avatar-DYsooxxy.js";import{i as Bs}from"./Check-BUKt5vhH.js";import{a as is}from"./Eye-Bk7j3Cz0.js";import{n as lo,i as ao}from"./Globe01-C8CeCAhz.js";import{i as co,a as Ls}from"./ZapSquare-cM9Cdjuc.js";import{i as uo}from"./Monitor01-BzTgEIFJ.js";import{n as mo,a as fo}from"./Sun-BsWLyXgw.js";import{a as pt}from"./Settings02-sAiuI7qb.js";import{i as xo}from"./Shield01-C-4y3Jk3.js";import{a as ho}from"./Users03-BqYE15gt.js";import{s as Hs}from"./XClose-DaB-YREn.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-qtdXP2aD.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-D5zHXlMU.js";import{I as Ao}from"./input-CxWmKS03.js";import{S as $o}from"./spinner-Dar3jTAz.js";import"./index-kU5u3aEQ.js";import{i as Oo,a as To}from"./RefreshCcw01-DiPX3Tzc.js";import{n as Yt}from"./Stars02-CP1Go7Ud.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-4pxxx_ZW.js";import{i as Xt}from"./ChevronRight-glzdqN1s.js";import{i as Ko}from"./FilterLines-xOxNVJBa.js";import{t as Wo}from"./Users01-ubeIr2qn.js";import{b as as,c as Ws,S as cs,a as ds,d as us}from"./select-DJ-jQ95-.js";import{b as qo,c as Vo,e as Yo,a as Xo,D as Qo}from"./dialog-BVuxcsVk.js";import{C as Zo,e as Jo,c as ei,d as ti,b as si}from"./command-DNZKPE8c.js";import{u as qs}from"./studio-tools-B99HmIGq.js";import{i as Vs}from"./Zap-j4DAJVgz.js";import{u as ni}from"./use-org-auth-client-vlAtiOoY.js";import{H as ri,a as oi,b as ii}from"./hover-card-BAzXpmKd.js";import{g as li,S as ai}from"./task-status-Ds87FkqY.js";import{u as ci,f as di}from"./use-clock-tick-CbDuKmI6.js";import{t as Ys}from"./ChevronDown-C6ULHnU-.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.2"]}),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.2"]}),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 +0,0 @@
|
|
|
1
|
-
import{e as D,j as s,E as le,r as K,q as ae,G as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,o as ie}from"./index-Cbngzld3.js";import{i as ue}from"./AlertCircle-CQgcG-Ae.js";import{i as pe}from"./ChevronRight-glzdqN1s.js";import{s as xe}from"./Plus-CugY_4xX.js";import{s as he}from"./Trash01-BJ6_IzkG.js";import{I as X}from"./input-CxWmKS03.js";import{S as oe}from"./switch-jfclxkGe.js";import{S as ye}from"./skeleton-Cuoq2c8E.js";import{A as ne}from"./avatar-DYsooxxy.js";import{P as je,a as Ce,b as Se}from"./popover-DIhiGQZO.js";import{b as re}from"./use-connection-Zog2j0WA.js";import{W as Z}from"./use-mcp-client-BNpG-Sq-.js";import{P as G}from"./index-BFPk_Xc8.js";import{u as ve}from"./use-registry-connections-2J71KvqA.js";import{g as _e,h as be}from"./use-organization-settings-BYRiagaB.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-Bs7s9mU1.js";import{R as Re}from"./require-capability-Cm5KwYyo.js";import"./User01-D2zO49mC.js";import"./use-collections-shQIB33q.js";import"./sidebar-DeB8mcen.js";import"./LayoutLeft-D3sIkDa-.js";import"./tooltip--aN5hOmO.js";import"./sheet-4VDYc-Lf.js";import"./X-BQX3Zy-X.js";import"./card-DGQIgBVW.js";import"./ArrowUpRight-D0znd3JO.js";import"./use-capability-KB17PgvY.js";import"./access-gate-DZ_2pDdY.js";import"./capability-load-error-BTLQ23rW.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let q;t[20]!==n||t[21]!==r?(q=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=q):q=t[22];const H=q,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let U;t[37]!==W||t[38]!==P||t[39]!==l?(U=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=U):U=t[40];const V=A.map(U);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:$e,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function $e(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function mt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{mt as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CkNttCUh.js","assets/index-Cbngzld3.js","assets/index-DfYyH4IW.css","assets/XCircle-D9dvtOsK.js","assets/CheckCircle-x4whH3Qn.js","assets/Container-RGkdLpnR.js","assets/Settings02-sAiuI7qb.js","assets/use-mcp-client-BNpG-Sq-.js","assets/useInfiniteQuery-g2cikAaR.js","assets/use-infinite-scroll-RcbuivWg.js","assets/studio-tools-B99HmIGq.js","assets/badge-CTK5gX_I.js","assets/input-CxWmKS03.js","assets/dropdown-menu-B8jiZxwT.js","assets/Check-BUKt5vhH.js","assets/ChevronRight-glzdqN1s.js","assets/DotsVertical-BrpflBsP.js","assets/table-DEsh_yYm.js","assets/toggle-group-BDjNDkJX.js","assets/use-view-mode-rJzWSnvR.js","assets/tooltip--aN5hOmO.js","assets/FilterLines-xOxNVJBa.js","assets/Globe01-C8CeCAhz.js","assets/SearchMd-DltTVRsJ.js","assets/dialog-BVuxcsVk.js","assets/X-BQX3Zy-X.js","assets/AlertCircle-CQgcG-Ae.js","assets/Upload01-C2pjhIpk.js","assets/alert-dialog-qtdXP2aD.js","assets/card-DGQIgBVW.js","assets/Trash01-BJ6_IzkG.js","assets/label-BUOqnJ7l.js","assets/select-DJ-jQ95-.js","assets/ChevronDown-C6ULHnU-.js","assets/ChevronUp-C5QGzLz6.js","assets/switch-jfclxkGe.js","assets/textarea-uwm8kgXD.js","assets/RefreshCcw01-DiPX3Tzc.js","assets/checkbox-B-MHp2m4.js","assets/Eye-Bk7j3Cz0.js","assets/LinkExternal01-DNf7UuUK.js","assets/use-copy-CZHdrpQ2.js","assets/Key01-ChQ6WmeN.js","assets/Plus-CugY_4xX.js","assets/Play-BXW8gJMz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as m,f as n,g as c,j as t,l as f,r as l,_ as p}from"./index-Cbngzld3.js";import{R as u}from"./require-capability-Cm5KwYyo.js";import"./use-capability-KB17PgvY.js";import"./access-gate-DZ_2pDdY.js";import"./capability-load-error-BTLQ23rW.js";const g=l.lazy(()=>p(()=>import("./registry-layout-CkNttCUh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as h,q as I,K as T,s as C,M as b,v as k,C as N,j as o}from"./index-Cbngzld3.js";import{B as x}from"./badge-CTK5gX_I.js";import{b as y,T as j,a as g,c as S}from"./tooltip--aN5hOmO.js";import{g as _}from"./types-BqoD-In5.js";import{s as $}from"./Eye-Bk7j3Cz0.js";import{s as A}from"./Star01-D8Xy046a.js";import{a8 as w}from"./agent-icon-BgD5mt7Y.js";function M(m){const e=h.c(11),{connectionId:a}=m,{org:r}=I();let i,t,l;e[0]!==a||e[1]!==r.slug?(i=new URL(`/api/${r.slug}/mcp/${a}`,window.location.origin),l=C,t=T.isMCPAuthenticated(i.href,null),e[0]=a,e[1]=r.slug,e[2]=i,e[3]=t,e[4]=l):(i=e[2],t=e[3],l=e[4]);let s;e[5]!==i||e[6]!==r.id?(s=()=>b({url:i.href,token:null,orgId:r.id}),e[5]=i,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==t||e[9]!==s?(n={queryKey:t,queryFn:s},e[8]=t,e[9]=s,e[10]=n):n=e[10];const{data:c}=l(n);return c}const H=[{key:"readOnlyHint",label:"Read-only",Icon:$,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:A,variant:"outline"}];function z(m){const e=h.c(18),{annotations:a,_meta:r}=m;let i;e[0]!==r?(i=_(r),e[0]=r,e[1]=i):i=e[1];const t=!!i;let l,s,n,c,u;if(e[2]!==a||e[3]!==t){u=Symbol.for("react.early_return_sentinel");e:{const f=a?H.filter(v=>a[v.key]===!0):[];if(f.length===0&&!t){u=null;break e}l=S,s="flex gap-1 flex-nowrap",e[9]!==t?(n=t&&o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(g,{children:"Interactive"})]}),e[9]=t,e[10]=n):n=e[10],c=f.map(P)}e[2]=a,e[3]=t,e[4]=l,e[5]=s,e[6]=n,e[7]=c,e[8]=u}else l=e[4],s=e[5],n=e[6],c=e[7],u=e[8];if(u!==Symbol.for("react.early_return_sentinel"))return u;let d;e[11]!==s||e[12]!==n||e[13]!==c?(d=o.jsxs("div",{className:s,children:[n,c]}),e[11]=s,e[12]=n,e[13]=c,e[14]=d):d=e[14];let p;return e[15]!==l||e[16]!==d?(p=o.jsx(l,{children:d}),e[15]=l,e[16]=d,e[17]=p):p=e[17],p}function P(m){const{label:e,Icon:a,variant:r}=m;return o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:r,className:"size-6 p-1",children:o.jsx(a,{})})}),o.jsx(g,{children:e})]},e)}export{z as T,M as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as v,G as b,a as F,s as x,aO as q,o as _}from"./index-Cbngzld3.js";function Q(e,s,n){const t=[];if(e?.trim()){const o=e.trim(),r=n.map(a=>({field:[String(a)],operator:"contains",value:o}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(s&&s.length>0)for(const o of s)t.push({field:[o.column],operator:"eq",value:o.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function k(e,s,n){const t=e??n,o=s??"desc";return[{field:[String(t)],direction:o}]}function w(e){if(!e||typeof e!="object")throw new Error("Invalid result");if("isError"in e&&e.isError)throw new Error("content"in e&&Array.isArray(e.content)&&e.content[0]?.type==="text"?e.content[0].text:"Unknown error");if("structuredContent"in e)return e.structuredContent;throw new Error("No structured content found")}function D(e,s,n,t){const o=s.toUpperCase(),r=`COLLECTION_${o}_GET`;return{queryKey:q.collectionItem(t,e,"",o,n??""),queryFn:async()=>{if(!n)return{item:null};const a=await t.callTool({name:r,arguments:{id:n}});return w(a)},staleTime:6e4}}function Y(e,s,n,t){const o=v.c(5);let r;o[0]!==t||o[1]!==s||o[2]!==n||o[3]!==e?(r=D(e,s,n,t),o[0]=t,o[1]=s,o[2]=n,o[3]=e,o[4]=r):r=o[4];const{data:a}=x(r);return a?.item??null}const K={structuredContent:{items:[]},isError:!1};function j(e,s,n,t={}){const{searchTerm:o,filters:r,sortKey:a,sortDirection:L,searchFields:S=["title","description"],defaultSortKey:h="updated_at",pageSize:g=100,additionalToolArgs:c}=t,l=s.toUpperCase(),f=`COLLECTION_${l}_LIST`,p=Q(o,r,S),T=k(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=q.collectionList(n,e,"",l,m),{data:O}=x({queryKey:C,queryFn:async()=>n?await n.callTool({name:f,arguments:u}):K,staleTime:3e4,retry:!1,select:d=>w(d??{})?.items??[]});return O}function z(e,s,n){const t=v.c(34),o=b();let r;t[0]!==s?(r=s.toUpperCase(),t[0]=s,t[1]=r):r=t[1];const a=r,L=`COLLECTION_${a}_CREATE`,S=`COLLECTION_${a}_UPDATE`,h=`COLLECTION_${a}_DELETE`;let g;t[2]!==o||t[3]!==e||t[4]!==a?(g=()=>{o.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=o,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==n||t[7]!==L?(l=async E=>{const i=await n.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return w(i).item},t[6]=n,t[7]=L,t[8]=l):l=t[8];let f;t[9]!==c?(f=()=>{c(),_.success("Item created successfully")},t[9]=c,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==f?(p={mutationFn:l,onSuccess:f,onError:B},t[11]=l,t[12]=f,t[13]=p):p=t[13];const T=F(p);let u;t[14]!==n||t[15]!==S?(u=async E=>{const{id:i,data:A}=E,U=await n.callTool({name:S,arguments:{id:i,data:A}});return w(U).item},t[14]=n,t[15]=S,t[16]=u):u=t[16];let m;t[17]!==c?(m=()=>{c(),_.success("Item updated successfully")},t[17]=c,t[18]=m):m=t[18];let C;t[19]!==u||t[20]!==m?(C={mutationFn:u,onSuccess:m,onError:R},t[19]=u,t[20]=m,t[21]=C):C=t[21];const O=F(C);let d;t[22]!==n||t[23]!==h?(d=async E=>{const i=await n.callTool({name:h,arguments:{id:E}});return w(i).item.id},t[22]=n,t[23]=h,t[24]=d):d=t[24];let y;t[25]!==c?(y=()=>{c(),_.success("Item deleted successfully")},t[25]=c,t[26]=y):y=t[26];let N;t[27]!==d||t[28]!==y?(N={mutationFn:d,onSuccess:y,onError:P},t[27]=d,t[28]=y,t[29]=N):N=t[29];const $=F(N);let I;return t[30]!==T||t[31]!==$||t[32]!==O?(I={create:T,update:O,delete:$},t[30]=T,t[31]=$,t[32]=O,t[33]=I):I=t[33],I}function P(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to delete item: ${s}`)}function R(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to update item: ${s}`)}function B(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to create item: ${s}`)}export{z as a,j as b,D as c,Y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as H,j as t,q as Q,G,r as J,o as F,bl as M,bm as P}from"./index-Cbngzld3.js";import{c as I,b as L,d as q,f as R,e as U,g as k,a as K,A as $}from"./alert-dialog-qtdXP2aD.js";import{u as Y}from"./studio-tools-B99HmIGq.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==i?(r=w=>{w||i()},e[0]=i,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(q,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(R,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==c?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==i?(d=w=>{w||i()},e[15]=i,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=O):O=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(q,{asChild:!0,children:t.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(R,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=G(),i=Y(),[c,l]=J.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{M(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===P&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:c,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const n=c.connection;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(c.mode!=="force-deleting")return;const n=c.connection.id;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{cH as le,cI as ue,cJ as de,c4 as he,cK as fe,bH as m,bI as w,cL as pe,cM as me,cN as _e,cO as A,cP as ge,cQ as j,cR as we,cS as q,cT as Te,cU as F,cV as ye,cW as ke,cX as ve,cY as z,bC as Se,cZ as Ce,c_ as be,b$ as ee,cc as Re,ci as Ie,cg as Ee,c$ as qe,d0 as Pe,d1 as $e,d2 as M,d3 as Ae,d4 as Me,ch as Oe,cd as He,ce as Ne,cf as xe,cb as De,d5 as Ue,d6 as je,d7 as Fe,c6 as Le,d8 as Ve,d9 as We,da as P,db as O,dc as Q,dd as ze,cj as x,e as te,s as se,aO as V}from"./index-Cbngzld3.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function J(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Je{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(w.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),A(o)||ge(o)?this._onresponse(o):j(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),A(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(A(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),A(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,F,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=J(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=J(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&j(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Ce();const Ye=Se(Be);function Ze(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function H(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&H(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&H(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&H(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Je{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(N(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,f)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=b(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{H(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,f)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Ve:We,T=b(y,p);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},De,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const St={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null},pinned:!1,connections:[]}}const ae=nt("decopilot_"),Ct=ae.is,ct=ae.get;function bt(a){return it({id:ct(a),organizationId:a,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const Rt={AGENT_MANAGER:a=>`studio-agent-manager_${a}`,AUTOMATION_MANAGER:a=>`studio-automation-manager_${a}`,CONNECTION_MANAGER:a=>`studio-connection-manager_${a}`,STORE_MANAGER:a=>`studio-store-manager_${a}`,BRAND_MANAGER:a=>`studio-brand-manager_${a}`,USAGE_MANAGER:a=>`studio-usage-manager_${a}`};function It(a){return a?a.startsWith("studio-agent-manager_")||a.startsWith("studio-automation-manager_")||a.startsWith("studio-connection-manager_")||a.startsWith("studio-store-manager_")||a.startsWith("studio-brand-manager_")||a.startsWith("studio-usage-manager_"):!1}const D=a=>[{type:"text",text:a}];function lt(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:D(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:D(h),isError:!0}}const l=await f.json().catch(()=>({}));return{content:D(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ut(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Y=10,dt=13,I=32;function U(a){}function ht(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=a,o=[];let n=!0,i,u="",f=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=p(d);v!==""&&o.push(v);return}if(d.indexOf(`
|
|
2
|
-
`)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=p(c);_!==""&&o.push(_)}function p(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
|
-
`,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=_+1,_=d.indexOf(`
|
|
4
|
-
`,c);continue}const v=d.charCodeAt(c);if(Z(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(f===0&&d.charCodeAt(_+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
|
|
5
|
-
`,c);continue}u=f===0?C:`${u}
|
|
6
|
-
${C}`,f++}else X(d,c,v)?l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0:g(d,c,_);c=_+1,_=d.indexOf(`
|
|
7
|
-
`,c)}return d.slice(c)}for(;c<d.length;){const _=d.indexOf("\r",c),v=d.indexOf(`
|
|
8
|
-
`,c);let S=-1;if(_!==-1&&v!==-1?S=_<v?_:v:_!==-1?_===d.length-1?S=-1:S=_:v!==-1&&(S=v),S===-1)break;g(d,c,S),c=S+1,d.charCodeAt(c-1)===dt&&d.charCodeAt(c)===Y&&c++}return d.slice(c)}function g(d,c,_){if(c===_){T();return}const v=d.charCodeAt(c);if(Z(d,c,v)){const E=d.charCodeAt(c+5)===I?c+6:c+5,W=d.slice(E,_);u=f===0?W:`${u}
|
|
9
|
-
${W}`,f++;return}if(X(d,c,v)){l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0;return}if(v===105&&d.charCodeAt(c+1)===100&&d.charCodeAt(c+2)===58){const E=d.slice(d.charCodeAt(c+3)===I?c+4:c+3,_);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=d.slice(c,_);r(E.slice(d.charCodeAt(c+1)===I?2:1))}return}const S=d.slice(c,_),C=S.indexOf(":");if(C===-1){y(S,"",S);return}const ne=S.slice(0,C),ie=S.charCodeAt(C+1)===I?2:1,ce=S.slice(C+ie);y(ne,ce,S)}function y(d,c,_){switch(d){case"event":l=c||void 0;break;case"data":u=f===0?c:`${u}
|
|
10
|
-
${c}`,f++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new B(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:_}));break;default:t(new B(`Unknown field "${d.length>20?`${d.slice(0,20)}…`:d}"`,{type:"unknown-field",field:d,value:c,line:_}));break}}function T(){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0}function k(d={}){if(d.consume&&o.length>0){const c=o.join("");g(c,0,c.length)}n=!0,i=void 0,u="",f=0,l=void 0,o.length=0}return{feed:h,reset:k}}function Z(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function X(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class ft extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=ht({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const pt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let mt=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=ut(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??pt}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=L(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new ft({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:y}=await l.read();if(y)break;if(g.id&&(n=g.id,i=!0,r?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const T=x.parse(JSON.parse(g.data));A(T)&&(u=!0,o!==void 0&&(T.id=o)),this.onmessage?.(T)}catch(T){this.onerror?.(T)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await O(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:j(e)?e.id:void 0}).catch(p=>this.onerror?.(p));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const p=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:g,scope:y}=Q(i);if(this._resourceMetadataUrl=g,this._scope=y,await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:g,scope:y,error:T}=Q(i);if(T==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(y&&(this._scope=y),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=k??void 0,await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),ze(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}const l=(Array.isArray(e)?e:[e]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,h=i.headers.get("content-type");if(l)if(h?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(h?.includes("application/json")){const p=await i.json(),g=Array.isArray(p)?p.map(y=>x.parse(y)):[x.parse(p)];for(const y of g)this.onmessage?.(y)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${h}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class _t extends mt{constructor(e,t){super(e,t)}send(e,t){const s=gt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function gt(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const wt={name:"mesh-sdk",version:"1.0.0"};function Tt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either meshUrl option or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function oe({connectionId:a,orgId:e,orgSlug:t,token:s,meshUrl:r}){const o=V.mcpClient(e,a??"self",s??"",r??"");if(!a||a===ot)return lt({orgSlug:t,token:s,meshUrl:r,toJSONString:`mcp-client:${o.join(":")}`});const n=Tt(a,t,r),i=new at(wt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),u=new _t(new URL(n),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await i.connect(u),i.toJSON=()=>`mcp-client:${o.join(":")}`,i}function yt(a){const{connectionId:e,token:t,meshUrl:s,orgId:r}=a;return{queryKey:V.mcpClient(r,e??"self",t??"",s??""),queryFn:()=>oe(a),staleTime:1/0,gcTime:6e4}}function qt(a){const e=te.c(2);let t;e[0]!==a?(t=yt(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=se(t);return s}function Pt(a){const e=te.c(14),{connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n}=a;let i;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==o?(i=t!==void 0?V.mcpClient(s,t??"self",o??"",n??""):["mcp","client","skip",s],e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=i):i=e[4];const u=i;let f;e[5]!==t||e[6]!==n||e[7]!==s||e[8]!==r||e[9]!==o?(f=async()=>t===void 0?null:oe({connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n}),e[5]=t,e[6]=n,e[7]=s,e[8]=r,e[9]=o,e[10]=f):f=e[10];let l;e[11]!==u||e[12]!==f?(l={queryKey:u,queryFn:f,staleTime:1/0,gcTime:6e4},e[11]=u,e[12]=f,e[13]=l):l=e[13];const{data:h}=se(l);return h??null}export{Ye as A,at as C,Je as P,Rt as S,St as W,ot as a,It as b,oe as c,ht as d,ut as e,mt as f,bt as g,ct as h,Ct as i,Pt as j,yt as m,L as n,qt as u};
|