decocms 4.373.1 → 4.373.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-2L7lI8NL.js → AlertCircle-D0XfIdP3.js} +1 -1
- package/dist/client/assets/{AreaChart-BSJ08P7a.js → AreaChart-BahcMnDC.js} +1 -1
- package/dist/client/assets/{ArrowLeft-8rouBEwC.js → ArrowLeft-COesgQ7q.js} +1 -1
- package/dist/client/assets/{ArrowRight-DCA5zjxW.js → ArrowRight-CnMpegh6.js} +1 -1
- package/dist/client/assets/{ArrowUp-BtksDHBQ.js → ArrowUp-17ZWJBkC.js} +1 -1
- package/dist/client/assets/{CartesianChart-BbOaLmfq.js → CartesianChart-DqSaDs52.js} +1 -1
- package/dist/client/assets/{CheckCircle-BmVuh1xp.js → CheckCircle-GwUJIVVh.js} +1 -1
- package/dist/client/assets/{ChevronUp-fg9sod-H.js → ChevronUp-CodzCI7T.js} +1 -1
- package/dist/client/assets/{Copy01-BgwuTJFm.js → Copy01-CrFZhFXo.js} +1 -1
- package/dist/client/assets/{CreditCard01-CIt471eG.js → CreditCard01-DDojC3kk.js} +1 -1
- package/dist/client/assets/{DotsVertical-CE2o6L6N.js → DotsVertical-DMzYFBsd.js} +1 -1
- package/dist/client/assets/{Download01-DNhEQzg0.js → Download01-B93GUT2-.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DxNax47N.js → ErrorBarContext-BUk8y7Bj.js} +1 -1
- package/dist/client/assets/{Eye-Dq6Vw6FI.js → Eye-Bxxku7SE.js} +1 -1
- package/dist/client/assets/{Globe01-g_y8gAs1.js → Globe01-DjdW3vEO.js} +1 -1
- package/dist/client/assets/{Globe04-GFiRExL0.js → Globe04-1G-_QSZW.js} +1 -1
- package/dist/client/assets/{Image01-QB6twEDu.js → Image01-DPvj49a-.js} +1 -1
- package/dist/client/assets/{Key01-CO_i2QPb.js → Key01-O_Ykzy8v.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BfySK4h8.js → LayoutLeft-Cr5_A1QG.js} +1 -1
- package/dist/client/assets/{Line-Cr57fOtp.js → Line-aFR7lShe.js} +1 -1
- package/dist/client/assets/{Link01-BIFMl_M0.js → Link01-D8T6mRIR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DQD59o7F.js → LinkExternal01-CWPNoGQ_.js} +1 -1
- package/dist/client/assets/{Monitor01-Ddm2yOG6.js → Monitor01-CQaKbr3c.js} +1 -1
- package/dist/client/assets/{Package-CvzEol5_.js → Package-Cd3aVeK8.js} +1 -1
- package/dist/client/assets/{Palette-DT856bn6.js → Palette-HRmzWYeK.js} +1 -1
- package/dist/client/assets/{Play-wYDcJhBq.js → Play-CaxaoMwA.js} +1 -1
- package/dist/client/assets/{Plus-BSp00qOC.js → Plus-BjOenFFb.js} +1 -1
- package/dist/client/assets/{SearchLg-DFD1t2UL.js → SearchLg-CT-Vntfj.js} +1 -1
- package/dist/client/assets/{SearchMd-Bb5gjLcX.js → SearchMd-C6gkQ2l2.js} +1 -1
- package/dist/client/assets/{Sector-wViCnB96.js → Sector-B-fHBulW.js} +1 -1
- package/dist/client/assets/{Settings02-D9Qv7BDm.js → Settings02-DH86cX_B.js} +1 -1
- package/dist/client/assets/{Share07-CZ7JzYs9.js → Share07-Bw4Wicv2.js} +1 -1
- package/dist/client/assets/{Stars01-D-wYuyik.js → Stars01-B1kYoDFp.js} +1 -1
- package/dist/client/assets/{Sun-DLRcOzSd.js → Sun-kycCorOO.js} +1 -1
- package/dist/client/assets/{Tool01-Dwy1nlT9.js → Tool01-iak9ZtFE.js} +1 -1
- package/dist/client/assets/{Tool02-CvlAGFBM.js → Tool02-CFu103hl.js} +1 -1
- package/dist/client/assets/{Trash01-DtE0n00a.js → Trash01-CpN6r-a0.js} +1 -1
- package/dist/client/assets/{TrendUp01-BCriuXJd.js → TrendUp01-DlYmFZ7k.js} +1 -1
- package/dist/client/assets/{Upload01-Ba-RLxE1.js → Upload01-DkDsqCWe.js} +1 -1
- package/dist/client/assets/{User01-DHd46PZp.js → User01-CmNzW4kH.js} +1 -1
- package/dist/client/assets/{UserSquare-CcF49LHs.js → UserSquare-1_FC93GE.js} +1 -1
- package/dist/client/assets/{Users01-B8gdz27Y.js → Users01-CVhfgklM.js} +1 -1
- package/dist/client/assets/{X-BtMi8Qau.js → X-DTaqHNcB.js} +1 -1
- package/dist/client/assets/{XCircle-BLCHBIhx.js → XCircle-BR8ZZHlj.js} +1 -1
- package/dist/client/assets/{XClose-CvcHLHe2.js → XClose-VLid_ZSM.js} +1 -1
- package/dist/client/assets/{Zap-DZAIluO6.js → Zap-D3d1wpzw.js} +1 -1
- package/dist/client/assets/{ZoomOut-DUFJq3-K.js → ZoomOut-B3S7N50e.js} +1 -1
- package/dist/client/assets/{access-gate-C9Dl5e5c.js → access-gate-DAO7tJ5A.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DA05asFs.js → add-connection-dialog-CaHZ3eeK.js} +1 -1
- package/dist/client/assets/{agent-analytics-CDo5Hugr.js → agent-analytics-CzbWclRj.js} +1 -1
- package/dist/client/assets/agent-app-DqzssWfL.js +1 -0
- package/dist/client/assets/{agent-assets-6UK-ev9d.js → agent-assets-Dfpjbzyj.js} +1 -1
- package/dist/client/assets/{agent-automation-BC-cMvrG.js → agent-automation-C8r5_lAR.js} +1 -1
- package/dist/client/assets/{agent-automations-CnHTcvU7.js → agent-automations-BSaV8k3Y.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CJ8artss.js → agent-connect-sources-AkHuiIU0.js} +1 -1
- package/dist/client/assets/agent-deck-BQOqb5JA.js +1 -0
- package/dist/client/assets/{agent-e2e-Cj1Q_JS0.js → agent-e2e-CjCqLXH1.js} +1 -1
- package/dist/client/assets/{agent-experiments-DJ13yAp9.js → agent-experiments-4inK9Pvj.js} +1 -1
- package/dist/client/assets/agent-file-CN4CJx4b.js +1 -0
- package/dist/client/assets/{agent-git-B8LMQ2zl.js → agent-git-BZmL1C91.js} +1 -1
- package/dist/client/assets/{agent-hosting-Bm-WxahY.js → agent-hosting-CP9gImki.js} +1 -1
- package/dist/client/assets/{agent-icon-CTsmTxHg.js → agent-icon-D5Ih-I28.js} +1 -1
- package/dist/client/assets/agent-library-file-CMtJlgeS.js +1 -0
- package/dist/client/assets/{agent-monitor-DgVt0zbx.js → agent-monitor-D7bE1AUL.js} +1 -1
- package/dist/client/assets/{agent-overview-pOglhwpN.js → agent-overview-C5zU0xJO.js} +1 -1
- package/dist/client/assets/agent-settings-G7qQl7Yj.js +1 -0
- package/dist/client/assets/{agent-site-editor-DVT-M9T0.js → agent-site-editor-BRzwUORk.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BV4iQvoi.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-eM0WchN0.js → agent-site-editor-content-Da0JfE-w.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-3VO_kTqr.js → agent-site-editor-preview-DqMQfEJz.js} +3 -3
- package/dist/client/assets/agent-view-BinIwia6.js +1 -0
- package/dist/client/assets/{agent-view-guard-BNYKK-x9.js → agent-view-guard-CmXIeKCe.js} +1 -1
- package/dist/client/assets/{agents-list-BXPjUzIN.js → agents-list-wHHXJTl8.js} +1 -1
- package/dist/client/assets/{ai-providers-BAmCFPvS.js → ai-providers-COexxMGY.js} +1 -1
- package/dist/client/assets/{alert-C8o4-kn8.js → alert-C_EPjsLF.js} +1 -1
- package/dist/client/assets/{alert-dialog-9n2p5SCQ.js → alert-dialog-D6rlFoy0.js} +1 -1
- package/dist/client/assets/api-keys-CN-jy2XH.js +1 -0
- package/dist/client/assets/{api-keys-Cu1KdEtK.js → api-keys-o45lgGkw.js} +1 -1
- package/dist/client/assets/app-editor-BPKOcfIg.js +1 -0
- package/dist/client/assets/{asset-utils-CK3Em4fb.js → asset-utils-BG24FUsq.js} +1 -1
- package/dist/client/assets/{auth-BBW3DF0r.js → auth-B_QE3yd2.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bva2z4Gj.js → auth-catchall-BM8U6OhG.js} +1 -1
- package/dist/client/assets/{auth-entry-BuHqwUIr.js → auth-entry-CdieewWf.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DMgxvbll.js → auth-split-layout-rKTEf0Lh.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Pk9b2m8R.js → authenticate-and-persist-oauth-Cm242zr2.js} +1 -1
- package/dist/client/assets/{automation-list-row-D-zBLXA-.js → automation-list-row-DDeJYMHS.js} +1 -1
- package/dist/client/assets/{automation-runs-C8Wbje-n.js → automation-runs-BGXJk3-4.js} +1 -1
- package/dist/client/assets/{automations-D69ikqKh.js → automations-BhhOtnrs.js} +1 -1
- package/dist/client/assets/{autosend-CVNOmzPu.js → autosend-DtYV6o0l.js} +1 -1
- package/dist/client/assets/{avatar-BzRNaDEk.js → avatar-Dwn9Bjsb.js} +1 -1
- package/dist/client/assets/{badge-C5M6nZd4.js → badge-BSirYRuD.js} +1 -1
- package/dist/client/assets/{block-document-UPtnFOJG.js → block-document-DjxI0Nln.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DAFMxzU6.js → blocks-preview-workspace-context-BwjlsTrq.js} +1 -1
- package/dist/client/assets/{breadcrumb-0yy48vm9.js → breadcrumb-BpbnoaV3.js} +1 -1
- package/dist/client/assets/{buckets-CktpbsrB.js → buckets-DdptE4Pj.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C-SX02eL.js → build-improve-prompt-doc-CIkgt5Ml.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-MrIv4eD2.js → bulk-category-panel-BUvAK76e.js} +1 -1
- package/dist/client/assets/{calendar-QcX36iLy.js → calendar-Bhg3W8Dv.js} +1 -1
- package/dist/client/assets/{capability-load-error-BVb3VEU2.js → capability-load-error-l-yxDu1W.js} +1 -1
- package/dist/client/assets/category-editor-Crlp5xLx.js +1 -0
- package/dist/client/assets/{chart-BVjaATZw.js → chart-B7hxFGKr.js} +1 -1
- package/dist/client/assets/{chat-context-ELO8A2Ar.js → chat-context-CVZ1rNGo.js} +1 -1
- package/dist/client/assets/{chat-draft-tDfZTlxU.js → chat-draft-UIE-uNFd.js} +1 -1
- package/dist/client/assets/{checkbox-iGlb02v9.js → checkbox-VSstjUSb.js} +1 -1
- package/dist/client/assets/{choose-editor-CWLAiGtz.js → choose-editor-DD3-fBUp.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DyNW_Pmq.js → cli-auth-success-LIJhoLzG.js} +1 -1
- package/dist/client/assets/{client-icons-BuRYGGKe.js → client-icons-D8SzN11F.js} +1 -1
- package/dist/client/assets/{collapsible-PyJ2NOzW.js → collapsible-BX137q_-.js} +1 -1
- package/dist/client/assets/{collection-detail-DXmBNKMr.js → collection-detail-Brbyx-hM.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cz5AkuIg.js → collection-display-button-LAyYKy93.js} +1 -1
- package/dist/client/assets/{collection-search-DM8MkJfo.js → collection-search-Dvf73igt.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-_ZnQA9Nx.js +1 -0
- package/dist/client/assets/{collection-tabs-aKKPIP9M.js → collection-tabs-BW0egx-_.js} +1 -1
- package/dist/client/assets/{combobox-CQBdlQef.js → combobox-D6GclaQ-.js} +1 -1
- package/dist/client/assets/{command-CZcxzTcw.js → command-Dsz0XoYc.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B7qgbnOZ.js → companion-mcps-section-D7ntAaGF.js} +1 -1
- package/dist/client/assets/{connect-D6Wz7x6C.js → connect-ChX83wmI.js} +1 -1
- package/dist/client/assets/{connect-layout-DzSDvFP2.js → connect-layout-SP9zSVi3.js} +1 -1
- package/dist/client/assets/{connection-DStV2sLP.js → connection-2MR1zroe.js} +1 -1
- package/dist/client/assets/{connection-card-CpIJKLp3.js → connection-card-B5yTdNvS.js} +1 -1
- package/dist/client/assets/{connection-detail-junbbrHX.js → connection-detail-DKOxQWbq.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DM_wSOEJ.js → connection-form-helpers-PrMbwr2L.js} +1 -1
- package/dist/client/assets/{connections-DvjnCZJT.js → connections-lQVX-uGO.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CvXOAbwA.js → create-organization-dialog-Ccojws8S.js} +1 -1
- package/dist/client/assets/{decofile-api-zRlIvvNL.js → decofile-api-DygXY02K.js} +1 -1
- package/dist/client/assets/{decopilot-BI8eOOPY.js → decopilot-rj_BJ_Z1.js} +1 -1
- package/dist/client/assets/{dialog-AoC07APJ.js → dialog-BKhaq-Xf.js} +1 -1
- package/dist/client/assets/{discover-zo2iAYFW.js → discover-C_imFiZx.js} +1 -1
- package/dist/client/assets/{domain-settings-C6kSznIr.js → domain-settings-CUKpZjNV.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CsiIuf7j.js → download-app-dialog-wNu8nmu1.js} +1 -1
- package/dist/client/assets/{drawer-DGzquxJ8.js → drawer-CCmZWflK.js} +1 -1
- package/dist/client/assets/{editor-oL1B7LVJ.js → editor-DMij_Pa1.js} +1 -1
- package/dist/client/assets/{empty-state-DxJQDjCw.js → empty-state-BDpfsfUL.js} +1 -1
- package/dist/client/assets/{empty-state-Y08kvU5o.js → empty-state-DiRnF-wA.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C7Wh9xkI.js → extract-connection-data-Bdk8iF2q.js} +1 -1
- package/dist/client/assets/{feature-gate-C1d068b1.js → feature-gate-KPNWzkBp.js} +1 -1
- package/dist/client/assets/{feature-paywall-BoABVlUQ.js → feature-paywall-B3_no1lb.js} +1 -1
- package/dist/client/assets/{file-explorer-DG5Gvb-w.js → file-explorer-oIhs2jyB.js} +1 -1
- package/dist/client/assets/{file-preview-iaqpqUYi.js → file-preview-BFDgPeRr.js} +1 -1
- package/dist/client/assets/{file-share-button-D0lT5ixf.js → file-share-button-7xy_ju8b.js} +1 -1
- package/dist/client/assets/{file-type-icon-lZW2ows7.js → file-type-icon-Co9lETmZ.js} +1 -1
- package/dist/client/assets/{folder-icon-DVG7PK8X.js → folder-icon-CPH1Bszw.js} +1 -1
- package/dist/client/assets/{form-CYsJTpNM.js → form-CxKBX2E3.js} +1 -1
- package/dist/client/assets/{gateway-client-CnYYocwu.js → gateway-client-B8HHtBA6.js} +1 -1
- package/dist/client/assets/{general-BiYLEv2o.js → general-BXQ_6idC.js} +1 -1
- package/dist/client/assets/{github-icon-swNUSpAU.js → github-icon-DSeg1rga.js} +1 -1
- package/dist/client/assets/{home-BbjS-573.js → home-FAOklPf6.js} +1 -1
- package/dist/client/assets/{hooks-D0dDgrIf.js → hooks-BFlZlUD7.js} +1 -1
- package/dist/client/assets/{hooks-BlE0QZwR.js → hooks-CFjlhRX0.js} +1 -1
- package/dist/client/assets/{icon-button-7c--Wy5B.js → icon-button-_3vMPXZp.js} +1 -1
- package/dist/client/assets/{index-DItj2r3e.js → index-B3clFfYi.js} +1 -1
- package/dist/client/assets/{index-DyCAAYSx.js → index-BcfYNZk_.js} +1 -1
- package/dist/client/assets/{index-C97O3ClY.js → index-BrLZxE6-.js} +1 -1
- package/dist/client/assets/{index-0-s9o3tr.js → index-BwwpOrcS.js} +1 -1
- package/dist/client/assets/{index-EcuFIS2a.js → index-CC7J7MsT.js} +2 -2
- package/dist/client/assets/{index-CutV0Ygc.js → index-CV2G6XgT.js} +1 -1
- package/dist/client/assets/{index-BUfoj27y.js → index-Ci8CqfCi.js} +1 -1
- package/dist/client/assets/{index-DKXWNSdB.js → index-Coo4IGyG.js} +1 -1
- package/dist/client/assets/{index-BDYXeKzz.js → index-CxsDd08k.js} +1 -1
- package/dist/client/assets/{index-Exw_Yjch.js → index-D2HOssRq.js} +1 -1
- package/dist/client/assets/{index-DllcfiZL.js → index-DZmKVVGY.js} +1 -1
- package/dist/client/assets/{index-DGY2nhhI.js → index-DoCuIH7r.js} +1 -1
- package/dist/client/assets/{index-fN6RkMSD.js → index-WfTG300W.js} +1 -1
- package/dist/client/assets/{index-redirect-Bm4zqVUy.js → index-redirect-BV59ZcWQ.js} +1 -1
- package/dist/client/assets/{index-BchRuDAc.js → index-zFkCX32V.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-3RxH1tr-.js → infiniteQueryObserver-CKT-6XMq.js} +1 -1
- package/dist/client/assets/{infra-billing-CmY2herT.js → infra-billing-RcXbwjta.js} +1 -1
- package/dist/client/assets/{input-Buz_7xoG.js → input-DSV_9cOM.js} +1 -1
- package/dist/client/assets/{input-C5klQNJJ.js → input-QKe7l082.js} +1 -1
- package/dist/client/assets/{input-BrPa4I3Z.js → input-X38P96BY.js} +1 -1
- package/dist/client/assets/{integration-icon-D3FHJbYu.js → integration-icon-BARnXRTY.js} +1 -1
- package/dist/client/assets/{label-BX1BwzZ4.js → label-YKssz_GS.js} +1 -1
- package/dist/client/assets/{last-preview-page-BSVfE6AT.js → last-preview-page-D5EFEwR4.js} +1 -1
- package/dist/client/assets/{layout-030aDjqi.js → layout-UcqeKFE9.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BblX_qPq.js → legacy-agents-deep-BYo-BuCs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BDaODIKZ.js → legacy-main-redirect-NyVTUirL.js} +1 -1
- package/dist/client/assets/{library-CmkU9fCT.js → library-FX2TKWir.js} +1 -1
- package/dist/client/assets/{login-BpUdj6Fq.js → login-gigmbDXu.js} +1 -1
- package/dist/client/assets/{markdown-VKlC4_bJ.js → markdown-tOSThun8.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-wS7imsel.js → mcp-app-renderer-c3JU3ROq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B7YJNr4N.js → mcp-oauth-Cr_ZflCp.js} +1 -1
- package/dist/client/assets/{members-2ZkimP3H.js → members-Cd4baVfz.js} +1 -1
- package/dist/client/assets/{message-templates-DyGM313y.js → message-templates-Pr7m4Pgn.js} +1 -1
- package/dist/client/assets/{mini-report-page-CYdef8vQ.js → mini-report-page-0G8UQBMn.js} +1 -1
- package/dist/client/assets/{mock-board-Dk2mRFCa.js → mock-board-Dw3AKqte.js} +3 -3
- package/dist/client/assets/{monaco-editor-ChRh_qus.js → monaco-editor-BhkNNN8A.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DirMMFq2.js → monitoring-stats-row-D3wuHD5K.js} +1 -1
- package/dist/client/assets/{multi-select-CYKeAXVo.js → multi-select-Bw9uE0vh.js} +1 -1
- package/dist/client/assets/{mustache-BpzqsH6c.js → mustache-BMe4E-3i.js} +1 -1
- package/dist/client/assets/{oauth-callback-CLQttSb2.js → oauth-callback-Ckn9o5ws.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C5AqSldx.js → oauth-callback-ai-provider-B7dYzzRe.js} +1 -1
- package/dist/client/assets/{onboarding-BYeSkDcE.js → onboarding-BtLLloCy.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-hB0JGrCs.js → optimistic-project-sidebar-views-8yO8-q3h.js} +1 -1
- package/dist/client/assets/{org-file-open-context-D26BTBiX.js → org-file-open-context-k2zY7W2A.js} +1 -1
- package/dist/client/assets/{organization-choice-sm9k2ko4.js → organization-choice-oi5kPDHh.js} +1 -1
- package/dist/client/assets/{orgs-BT6gh3Sc.js → orgs-C8VfgzyW.js} +1 -1
- package/dist/client/assets/{page-seo-form-Bhk-2qvu.js → page-seo-form-D-yemID7.js} +1 -1
- package/dist/client/assets/{pair-Bh73YYpe.js → pair-CbUh0olY.js} +1 -1
- package/dist/client/assets/{plan-ladder-B-hb17ya.js → plan-ladder-DR8Snnfh.js} +1 -1
- package/dist/client/assets/{popover-Bff85VlI.js → popover-tYq49O5I.js} +1 -1
- package/dist/client/assets/{post-calendar-BUJnl75O.js → post-calendar-n3g3NXQN.js} +1 -1
- package/dist/client/assets/{post-editor-B8ClYTJb.js → post-editor-BCki1XwL.js} +1 -1
- package/dist/client/assets/{preview-content-C4FuOpTi.js → preview-content-BEe_g5h_.js} +1 -1
- package/dist/client/assets/{preview-dialog-DY1kQ4y_.js → preview-dialog-B88KWjD7.js} +1 -1
- package/dist/client/assets/{primitives-BCCkMTJb.js → primitives-DvNXO9ko.js} +1 -1
- package/dist/client/assets/{profile-T7ySaz_t.js → profile-Dn8W-1_J.js} +1 -1
- package/dist/client/assets/{project-app-view-D4HCSkue.js → project-app-view-CHIgEuQJ.js} +1 -1
- package/dist/client/assets/{project-feed-CRHprIgj.js → project-feed-BeVLcst-.js} +1 -1
- package/dist/client/assets/{project-icon-D_oHwik9.js → project-icon-BuTPt9Ec.js} +1 -1
- package/dist/client/assets/project-reports-EFWj1j4Z.js +1 -0
- package/dist/client/assets/project-tasks-DGYfz1Ev.js +1 -0
- package/dist/client/assets/{prompts-BuPAnA4R.js → prompts-BrLG0HnD.js} +1 -1
- package/dist/client/assets/record-editor-AST5wQoO.js +1 -0
- package/dist/client/assets/{redirect-editor-BrEMZWAU.js → redirect-editor-DQh1NXo4.js} +1 -1
- package/dist/client/assets/registry-FGkay0Wa.js +2 -0
- package/dist/client/assets/{registry-layout-o90YrVKa.js → registry-layout-tLc7-FpU.js} +1 -1
- package/dist/client/assets/{reports-DEVutxJq.js → reports-Bgxd82xF.js} +1 -1
- package/dist/client/assets/reports-CqtPOzss.js +1 -0
- package/dist/client/assets/{reports-onboarding-Dt5mvf07.js → reports-onboarding-BORIliYh.js} +1 -1
- package/dist/client/assets/{reports-tab-C6PZg0b6.js → reports-tab-3yvhtU-e.js} +2 -2
- package/dist/client/assets/{repositories-DBFrDUwl.js → repositories-DnQQ93Vy.js} +1 -1
- package/dist/client/assets/{repository-import-picker-ftg0FRzY.js → repository-import-picker-B1zE1wEx.js} +1 -1
- package/dist/client/assets/repository-picker-DMUsWfjy.js +1 -0
- package/dist/client/assets/{require-capability-gpVnF6U4.js → require-capability-B9l2cjC7.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BhdxJMdb.js → required-auth-layout-qQ6V67AS.js} +1 -1
- package/dist/client/assets/{reset-password-DD2ixVIR.js → reset-password-CzGwWM54.js} +1 -1
- package/dist/client/assets/{resizable-wU1MiASn.js → resizable-c-JEmBrU.js} +1 -1
- package/dist/client/assets/{review-settings-3uLiRV1J.js → review-settings-CBDmCs9f.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-Bn-QsIS6.js → rich-text-link-control-B4QybUls.js} +1 -1
- package/dist/client/assets/{roles-DX_ap2B0.js → roles-9Q5Zr1_l.js} +1 -1
- package/dist/client/assets/{route-Bdqr734y.js → route-Cyp-PzpR.js} +1 -1
- package/dist/client/assets/{route-DGhKwFXa.js → route-D9feMXoH.js} +1 -1
- package/dist/client/assets/{route-Cg6AOuOY.js → route-DrZOVBG5.js} +1 -1
- package/dist/client/assets/{route-page-header-DKm5kHtX.js → route-page-header-BzWw0nja.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-9i5DpxOA.js → runnable-block-editor-nQ69L6jb.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BHn9YFEW.js → sandbox-lifecycle-context-DLKr6QBG.js} +1 -1
- package/dist/client/assets/{schema-FDf70VFI.js → schema-CStbpjQf.js} +1 -1
- package/dist/client/assets/{scroll-area-DMmJ7JtI.js → scroll-area-BLDUQh9N.js} +1 -1
- package/dist/client/assets/{search-input-BHVk6m6A.js → search-input-MlNEh696.js} +1 -1
- package/dist/client/assets/{search-toggle-CCC7TvwN.js → search-toggle-SUy-5Oe0.js} +1 -1
- package/dist/client/assets/{secrets-BNtrMaDs.js → secrets-CEw0kB_t.js} +1 -1
- package/dist/client/assets/{sections-editor-HtflyYMM.js → sections-editor-l8Cc724N.js} +1 -1
- package/dist/client/assets/{select-DBfOOW9i.js → select-C_C7jdl-.js} +1 -1
- package/dist/client/assets/{select-model-2C5Fdpra.js → select-model-FW_XGeEU.js} +1 -1
- package/dist/client/assets/{seo-editor-CFULobkJ.js → seo-editor-BhZJvD6-.js} +1 -1
- package/dist/client/assets/{separator-8fswVHAH.js → separator-D-DaNCb-.js} +1 -1
- package/dist/client/assets/{settings-tab-s3d5MtS-.js → settings-tab-DhuuexRq.js} +1 -1
- package/dist/client/assets/{sheet-DWSThpSZ.js → sheet-B5ncClVO.js} +1 -1
- package/dist/client/assets/shell-layout-p-WJ7uxl.js +1 -0
- package/dist/client/assets/{sidebar-CoC2_Nad.js → sidebar-BlfpAzXY.js} +1 -1
- package/dist/client/assets/{skill-preview-QgrtYNqp.js → skill-preview-CeIBKDR2.js} +1 -1
- package/dist/client/assets/{skills-BVINvlqv.js → skills-Cpf0zAbB.js} +1 -1
- package/dist/client/assets/{sso-CSqM_F3b.js → sso-CYe8kGWS.js} +1 -1
- package/dist/client/assets/{store-DBNpNTVQ.js → store-DDl3lPqK.js} +1 -1
- package/dist/client/assets/store-registry-DUH5xq3l.js +2 -0
- package/dist/client/assets/{switch-BIfmgDHS.js → switch-C_FmZ5Us.js} +1 -1
- package/dist/client/assets/{synced-repos-CG_pm_Ch.js → synced-repos-DHbM7OOb.js} +1 -1
- package/dist/client/assets/{table-CEVOOGGz.js → table-mH2G1tkg.js} +1 -1
- package/dist/client/assets/{tabs-Dd0IWElc.js → tabs-jjUOgDeE.js} +1 -1
- package/dist/client/assets/{task-board-Dip4Wu9j.js → task-board-BtEMyO1f.js} +1 -1
- package/dist/client/assets/{task-route-SKFoAFiU.js → task-route-BaALoopn.js} +1 -1
- package/dist/client/assets/{task-status-k7EGfTLN.js → task-status-CCMsckzm.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-C3lk9wb7.js → taskboard-analytics-CzQSxt8I.js} +1 -1
- package/dist/client/assets/tasks-CI20rxb_.js +1 -0
- package/dist/client/assets/{tasks-ebQIYdwz.js → tasks-K4e2STZ0.js} +1 -1
- package/dist/client/assets/{textarea-D5v3ol7T.js → textarea-B7wqTmSc.js} +1 -1
- package/dist/client/assets/{thread-button-C3YUAV-G.js → thread-button-B9U3gqvP.js} +1 -1
- package/dist/client/assets/{thread-intent-CTSjhfEo.js → thread-intent-DZx7N_NL.js} +1 -1
- package/dist/client/assets/{thread-route-B57JfaL5.js → thread-route-B3hhxYHj.js} +1 -1
- package/dist/client/assets/{thread-route-CHwqHPf_.js → thread-route-DnE31jZ2.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Hqh1hVbj.js → thread-sheet-body-D_py0jIP.js} +1 -1
- package/dist/client/assets/{toggle-group-CwAn2mKr.js → toggle-group-C-J6fFSZ.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-ChZE-2zp.js → toolbar-icon-button-DQAUOhdv.js} +1 -1
- package/dist/client/assets/{tooltip-nr5oS_bm.js → tooltip-DSCGYdw1.js} +1 -1
- package/dist/client/assets/{track-BDYWN4z3.js → track-BWEjISsx.js} +1 -1
- package/dist/client/assets/{types-7UQ7SDxU.js → types-BQYrCHfb.js} +1 -1
- package/dist/client/assets/{usage-stats-YafP0g9G.js → usage-stats-CH100JwP.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D-abiIwe.js → use-ai-providers-DPIPADTm.js} +1 -1
- package/dist/client/assets/{use-automations-D_y1YNke.js → use-automations-Cm_whz3Q.js} +1 -1
- package/dist/client/assets/{use-autosave-z8cIzzdm.js → use-autosave-C09DCahC.js} +1 -1
- package/dist/client/assets/{use-connect-companion-jQzCS0Na.js → use-connect-companion-D45RJA2C.js} +1 -1
- package/dist/client/assets/{use-connection-BKZRi94S.js → use-connection-DAR6kA6F.js} +1 -1
- package/dist/client/assets/{use-copy-Cp_DyXH6.js → use-copy-CLZ5Gmjm.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-nvoTomrD.js → use-create-virtual-mcp-DlDbTDWh.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CNoKSvxx.js → use-date-fns-locale-4a1GuGUG.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B0HBbqeX.js → use-debounced-autosave-s6ooboiq.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BgYHDTDk.js → use-debounced-value-C7PP6GCc.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CqbkXgA9.js → use-deco-credits-C78gqYYg.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-qaEKsixC.js → use-decopilot-events-DDN9tgML.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CqvqqWgS.js → use-delete-connection-DT4K_5dd.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DzkF6L4b.js → use-deployment-admin-mukdSbJI.js} +1 -1
- package/dist/client/assets/{use-entitlements-kPr6KRf9.js → use-entitlements-CsT7-WMV.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BBBDyhsD.js → use-fast-preview-draft-url-BofBOVEy.js} +1 -1
- package/dist/client/assets/{use-file-configs-6ygOocDG.js → use-file-configs-DT6Slpub.js} +1 -1
- package/dist/client/assets/{use-in-settings-BCDqA2EC.js → use-in-settings-BuwNY17C.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D0T36z_V.js → use-infinite-scroll-BEJH1fno.js} +1 -1
- package/dist/client/assets/{use-join-requests-BBovhUnp.js → use-join-requests-CRlXrVsN.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BghanH6r.js → use-main-panel-tabs-CHXW72tt.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-h4sAecTI.js → use-mcp-auth-status-BUHt6LYh.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B_gcvvCy.js → use-mcp-client-jmamuSRM.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DfSKL4Gu.js → use-mcp-prompts-Cb12ACl6.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DC47roTz.js → use-mcp-tools-U5kwqIN7.js} +1 -1
- package/dist/client/assets/{use-members-C6brpkJ1.js → use-members-CZk_logh.js} +1 -1
- package/dist/client/assets/{use-mobile-BZ15DgEB.js → use-mobile-X_9uHXB5.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B8SXI0oO.js → use-navigate-to-agent-XZHI0vTx.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BAg3ZeFq.js → use-open-billing-url-BygdFnSn.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-8fDIgHEZ.js → use-org-auth-client-6spdYft8.js} +1 -1
- package/dist/client/assets/{use-org-fs-Bf6n51Xm.js → use-org-fs-C4AEj3YR.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CnBqiATM.js → use-org-repo-syncs-D5-YS2q1.js} +1 -1
- package/dist/client/assets/{use-org-sso-QeqdMaIa.js → use-org-sso-CbtWg6df.js} +1 -1
- package/dist/client/assets/{use-organization-roles-tuKknI1K.js → use-organization-roles-B2NYy6qP.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DvtBymY3.js → use-organization-settings-DiOLzOn-.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-IItrbgmN.js → use-panel-navigate-YnjVvVnu.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-WwnxvZuP.js → use-project-native-view-presence-S2GuqygD.js} +1 -1
- package/dist/client/assets/{use-project-scope-CCxyXvEU.js → use-project-scope-azWGklpf.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bd4wJHbx.js → use-registry-connections-Dr6Tl0jy.js} +1 -1
- package/dist/client/assets/{use-releases-DZvNer89.js → use-releases-sRilJRv7.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BeTEI2FZ.js → use-reports-diagnostic-b56ze7yP.js} +1 -1
- package/dist/client/assets/{use-route-default-main-BhbKsXCz.js → use-route-default-main-DAXdKSA3.js} +1 -1
- package/dist/client/assets/{use-secrets-Bq9yyXHE.js → use-secrets-BD25jCAi.js} +1 -1
- package/dist/client/assets/{use-section-preview-base--XbKHK2U.js → use-section-preview-base-CfKeOl7s.js} +1 -1
- package/dist/client/assets/{use-session-runtime-B5wMaHtP.js → use-session-runtime-D8PgcjtK.js} +1 -1
- package/dist/client/assets/{use-tags-Do2tDPSO.js → use-tags-DMzy8m-k.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-MK_Z2cUq.js → use-task-board-analytics-BXM0SDto.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CQjLXps1.js → use-task-metadata-IzJB5PVG.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DYukUH5N.js → use-thread-outputs-BhhE_Gkc.js} +1 -1
- package/dist/client/assets/{use-view-mode-BEPkb8x0.js → use-view-mode-CUHkIbeG.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Ji9vcgUj.js → use-virtual-mcp-Bt7oX0ej.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-zZoTJbYm.js +1 -0
- package/dist/client/assets/{useQueries-D0xhxw7a.js → useQueries-D7ondynP.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BvOl5Id0.js +1 -0
- package/dist/client/assets/{users-DzwkCv2F.js → users-CP4Dfulp.js} +1 -1
- package/dist/client/assets/{utils-y2q6u6PK.js → utils-CcX7wgow.js} +1 -1
- package/dist/client/assets/{variant-calendar-D1R9xk7D.js → variant-calendar-BYxVe-PM.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-qHzE4baz.js → variant-matcher-override-CgX58Kkx.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Ca0bFull.js → view-mode-toggle-CRnJAx40.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Dji-1ojO.js → virtual-mcp-BWl8nlWy.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +648 -648
- package/dist/server/migrate.js +170 -170
- package/dist/server/server.js +415 -415
- package/package.json +1 -1
- package/dist/client/assets/agent-app-lfl4wDqj.js +0 -1
- package/dist/client/assets/agent-deck-BCZ0G4O2.js +0 -1
- package/dist/client/assets/agent-file-DbKP1r-4.js +0 -1
- package/dist/client/assets/agent-library-file-DvybgEEZ.js +0 -1
- package/dist/client/assets/agent-settings-Bx-Ya3hQ.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DpPWdLwT.js +0 -2
- package/dist/client/assets/agent-view-v-h5B6vN.js +0 -1
- package/dist/client/assets/api-keys-DCurVLgh.js +0 -1
- package/dist/client/assets/app-editor-C3QSidsO.js +0 -1
- package/dist/client/assets/category-editor-DZThBJlF.js +0 -1
- package/dist/client/assets/collection-table-wrapper-cBr_X4Jo.js +0 -1
- package/dist/client/assets/project-reports-CzVFjEoR.js +0 -1
- package/dist/client/assets/project-tasks-c_cBe8VF.js +0 -1
- package/dist/client/assets/record-editor-CHfqyrFA.js +0 -1
- package/dist/client/assets/registry-4kJYrulU.js +0 -2
- package/dist/client/assets/reports-COffkxyo.js +0 -1
- package/dist/client/assets/repository-picker-BKj90hIS.js +0 -1
- package/dist/client/assets/shell-layout-BQnbNNla.js +0 -1
- package/dist/client/assets/store-registry-DLmFNBij.js +0 -2
- package/dist/client/assets/tasks-Sl_c9zFF.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CzQJkRT9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D9iG0Y5m.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,a0 as A,au as re,l as L,j as l,E as ne,r as O,b as $,t as z,h as H,d as U,q as G,B as V}from"./index-EcuFIS2a.js";import{n as ae}from"./ArrowUp-BtksDHBQ.js";import{c as oe,a as Q,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-ELO8A2Ar.js";import{s as he,g as W,d as ge}from"./gateway-client-CnYYocwu.js";import{b as F,T as be,a as je,c as ye}from"./tooltip-nr5oS_bm.js";import{c as X,d as Y,b as Z,D as J,h as ve}from"./dialog-AoC07APJ.js";import{d as we,b as Ne,a as Ce,D as Se}from"./drawer-DGzquxJ8.js";import{C as Te}from"./collection-search-DM8MkJfo.js";import{u as Pe}from"./use-mobile-BZ15DgEB.js";import{u as ke}from"./use-mcp-client-B_gcvvCy.js";import{u as Ee,g as De}from"./use-mcp-prompts-DfSKL4Gu.js";import{c as _e,P as Ie}from"./index-DyCAAYSx.js";import{T as Me,a as Be,C as Oe,u as Le,H as Re}from"./input-BrPa4I3Z.js";import{a as $e,b as Ae,S as Fe,M as q}from"./pair-Bh73YYpe.js";import{a as ze}from"./use-panel-navigate-IItrbgmN.js";import{u as He}from"./hooks-D0dDgrIf.js";import{N as Ge}from"./decopilot-BI8eOOPY.js";import{i as qe}from"./ArrowRight-DCA5zjxW.js";import{c as ee}from"./agent-icon-CTsmTxHg.js";import{d as Ke}from"./use-entitlements-kPr6KRf9.js";import{u as Ue}from"./use-deco-credits-CqbkXgA9.js";import{F as Ve}from"./feature-paywall-BoABVlUQ.js";import{i as Qe}from"./AlertCircle-2L7lI8NL.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",We="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:r,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=r;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=W(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(We,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=l.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&l.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&l.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=l.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,j=s&&"bg-muted/50",y=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==y?(x=L(te,"hover:bg-muted/70 hover:text-foreground",j,y),e[28]=j,e[29]=y,e[30]=x):x=e[30];let b;e[31]!==c?(b=l.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&l.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=l.jsx(be,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=l.jsx(je,{side:"top",className:"max-w-xs",children:l.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=l.jsxs(ye,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function Xe(t){const e=B.c(61),{items:r,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==r||e[1]!==i?(u=i.trim()?r.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):r,e[0]=r,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let j;e[3]!==f.length||e[4]!==i||e[5]!==o?(j=f.length===0&&l.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=j):j=e[6];let y;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>l.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],y=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=y}else y=e[12];let x;e[18]!==j||e[19]!==y?(x=l.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,y]})}),e[18]=j,e[19]=y,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=l.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=l.jsx(we,{className:"sr-only",children:l.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=l.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=l.jsx(F,{delayDuration:400,children:l.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=l.jsx(X,{className:"sr-only",children:l.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=l.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=l.jsx(F,{delayDuration:400,children:l.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:r,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(r.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==d){const b=r.slice(0,K),g=r.slice(K),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>l.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&l.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let j;e[16]!==c||e[17]!==u||e[18]!==f?(j=l.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=j):j=e[19];let y;e[20]!==r||e[21]!==s||e[22]!==o||e[23]!==n?(y=l.jsx(Xe,{items:r,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=o,e[23]=n,e[24]=y):y=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==j||e[28]!==y?(x=l.jsxs(m,{delayDuration:w,children:[j,y]}),e[25]=m,e[26]=w,e[27]=j,e[28]=y,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:r}=t,n=$(),{sendMessage:s}=Q(),{org:a}=A();let d;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[y,x]=O.useReducer(Je,j),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,W(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=y.stage==="loading"?y.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=l.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=l.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=l.jsxs(l.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:r}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=re(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==r?(i=L("w-full @container",r),e[2]=r,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=l.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=l.jsx(ne,{fallback:null,children:l.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=l.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function lt(t){let e=0;for(const r of t)for(const n of r.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function rt(){const t=B.c(8),{openPanel:e}=ze(),r=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=lt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==r||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,r?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,r],t[2]=d,t[3]=r,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function le(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(le(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:r}=A(),n=Ke("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==r.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:r.id}),o(!1);try{localStorage.setItem(le(r.id),"1")}catch{}},t[0]=r.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==r.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:r.id})},u=[d,r.id],t[2]=d,t[3]=r.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=l.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(ee,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let y;t[17]!==e?(y=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=y):y=t[18];let x;t[19]!==y?(x=l.jsx(Y,{className:"text-lg font-semibold",children:y}),t[19]=y,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=l.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,l.jsxs(X,{className:"relative gap-3",children:[j,l.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==r.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),m()},t[31]=m,t[32]=s,t[33]=r.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=l.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=l.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=l.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:r}=t;let n;e[0]!==r?(n=r.toFixed(2),e[0]=r,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=l.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=l.jsxs("div",{className:a,children:[d,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),r=U();let n;t[0]!==r||t[1]!==e.slug?(n=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 classic:rounded-full compact:rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=l.jsx(Qe,{size:13,className:"text-warning"}),d=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=l.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:r,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==n?(o=()=>{const m=n.current,c=r.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const j=c.scrollHeight,y=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=y+(x-j)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[r,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=r,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:r,children:n}=t;let s;e[0]!==r?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=l.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:r}=t;let n;return e[0]!==r?(n=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:r,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=Q(),{taskId:d}=fe();rt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,j=O.useRef(null),y=O.useRef(null);ct({scrollRef:j,sentinelRef:y,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{j.current=g,x.scrollRef(g)};return l.jsx(Fe,{messages:e,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:l.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:y,"aria-hidden":!0,className:"h-px"}),s&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>l.jsx(q,{pair:g,isLastPair:!1,status:N===c.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&l.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:l.jsx(q,{pair:u,isLastPair:!0,status:r},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&l.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 classic:rounded-full shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:l.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
|
|
1
|
+
import{c as B,a0 as A,au as re,l as L,j as l,E as ne,r as O,b as $,t as z,h as H,d as U,q as G,B as V}from"./index-CC7J7MsT.js";import{n as ae}from"./ArrowUp-17ZWJBkC.js";import{c as oe,a as Q,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-CVZ1rNGo.js";import{s as he,g as W,d as ge}from"./gateway-client-B8HHtBA6.js";import{b as F,T as be,a as je,c as ye}from"./tooltip-DSCGYdw1.js";import{c as X,d as Y,b as Z,D as J,h as ve}from"./dialog-BKhaq-Xf.js";import{d as we,b as Ne,a as Ce,D as Se}from"./drawer-CCmZWflK.js";import{C as Te}from"./collection-search-Dvf73igt.js";import{u as Pe}from"./use-mobile-X_9uHXB5.js";import{u as ke}from"./use-mcp-client-jmamuSRM.js";import{u as Ee,g as De}from"./use-mcp-prompts-Cb12ACl6.js";import{c as _e,P as Ie}from"./index-BcfYNZk_.js";import{T as Me,a as Be,C as Oe,u as Le,H as Re}from"./input-X38P96BY.js";import{a as $e,b as Ae,S as Fe,M as q}from"./pair-CbUh0olY.js";import{a as ze}from"./use-panel-navigate-YnjVvVnu.js";import{u as He}from"./hooks-BFlZlUD7.js";import{N as Ge}from"./decopilot-rj_BJ_Z1.js";import{i as qe}from"./ArrowRight-CnMpegh6.js";import{c as ee}from"./agent-icon-D5Ih-I28.js";import{d as Ke}from"./use-entitlements-CsT7-WMV.js";import{u as Ue}from"./use-deco-credits-C78gqYYg.js";import{F as Ve}from"./feature-paywall-B3_no1lb.js";import{i as Qe}from"./AlertCircle-D0XfIdP3.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",We="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:r,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=r;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=W(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(We,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=l.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&l.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&l.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=l.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,j=s&&"bg-muted/50",y=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==y?(x=L(te,"hover:bg-muted/70 hover:text-foreground",j,y),e[28]=j,e[29]=y,e[30]=x):x=e[30];let b;e[31]!==c?(b=l.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&l.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=l.jsx(be,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=l.jsx(je,{side:"top",className:"max-w-xs",children:l.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=l.jsxs(ye,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function Xe(t){const e=B.c(61),{items:r,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==r||e[1]!==i?(u=i.trim()?r.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):r,e[0]=r,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let j;e[3]!==f.length||e[4]!==i||e[5]!==o?(j=f.length===0&&l.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=j):j=e[6];let y;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>l.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],y=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=y}else y=e[12];let x;e[18]!==j||e[19]!==y?(x=l.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,y]})}),e[18]=j,e[19]=y,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=l.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=l.jsx(we,{className:"sr-only",children:l.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=l.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=l.jsx(F,{delayDuration:400,children:l.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=l.jsx(X,{className:"sr-only",children:l.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=l.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=l.jsx(F,{delayDuration:400,children:l.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:r,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(r.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==d){const b=r.slice(0,K),g=r.slice(K),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>l.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&l.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let j;e[16]!==c||e[17]!==u||e[18]!==f?(j=l.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=j):j=e[19];let y;e[20]!==r||e[21]!==s||e[22]!==o||e[23]!==n?(y=l.jsx(Xe,{items:r,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=o,e[23]=n,e[24]=y):y=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==j||e[28]!==y?(x=l.jsxs(m,{delayDuration:w,children:[j,y]}),e[25]=m,e[26]=w,e[27]=j,e[28]=y,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:r}=t,n=$(),{sendMessage:s}=Q(),{org:a}=A();let d;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[y,x]=O.useReducer(Je,j),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,W(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=y.stage==="loading"?y.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=l.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=l.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=l.jsxs(l.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:r}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=re(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==r?(i=L("w-full @container",r),e[2]=r,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=l.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=l.jsx(ne,{fallback:null,children:l.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=l.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function lt(t){let e=0;for(const r of t)for(const n of r.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function rt(){const t=B.c(8),{openPanel:e}=ze(),r=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=lt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==r||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,r?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,r],t[2]=d,t[3]=r,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function le(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(le(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:r}=A(),n=Ke("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==r.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:r.id}),o(!1);try{localStorage.setItem(le(r.id),"1")}catch{}},t[0]=r.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==r.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:r.id})},u=[d,r.id],t[2]=d,t[3]=r.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=l.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(ee,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let y;t[17]!==e?(y=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=y):y=t[18];let x;t[19]!==y?(x=l.jsx(Y,{className:"text-lg font-semibold",children:y}),t[19]=y,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=l.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,l.jsxs(X,{className:"relative gap-3",children:[j,l.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==r.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),m()},t[31]=m,t[32]=s,t[33]=r.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=l.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=l.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=l.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:r}=t;let n;e[0]!==r?(n=r.toFixed(2),e[0]=r,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=l.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=l.jsxs("div",{className:a,children:[d,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),r=U();let n;t[0]!==r||t[1]!==e.slug?(n=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 classic:rounded-full compact:rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=l.jsx(Qe,{size:13,className:"text-warning"}),d=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=l.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:r,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==n?(o=()=>{const m=n.current,c=r.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const j=c.scrollHeight,y=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=y+(x-j)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[r,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=r,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:r,children:n}=t;let s;e[0]!==r?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=l.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:r}=t;let n;return e[0]!==r?(n=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:r,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=Q(),{taskId:d}=fe();rt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,j=O.useRef(null),y=O.useRef(null);ct({scrollRef:j,sentinelRef:y,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{j.current=g,x.scrollRef(g)};return l.jsx(Fe,{messages:e,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:l.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:y,"aria-hidden":!0,className:"h-px"}),s&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>l.jsx(q,{pair:g,isLastPair:!1,status:N===c.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&l.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:l.jsx(q,{pair:u,isLastPair:!0,status:r},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&l.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 classic:rounded-full shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:l.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,bu as ce,j as p,bp as _,bo as T,bm as C,bw as le,bt as de,bJ as ue,bF as fe,bE as me}from"./index-
|
|
1
|
+
import{r as l,bu as ce,j as p,bp as _,bo as T,bm as C,bw as le,bt as de,bJ as ue,bF as fe,bE as me}from"./index-CC7J7MsT.js";import{e as Y}from"./select-C_C7jdl-.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),J=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);I(x,y)}function se(x){I(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function I(x,y,{commit:k}={commit:!1}){const F=_e(c),z=Ce(Math.round((x-n)/c)*c+n,F),A=Y(z,[n,s]);K((D=[])=>{const P=xe(D,A,y);if(De(P,u*c)){f.current=P.indexOf(A);const U=String(P)!==String(D);return U&&k&&d(P),U?P:D}else return D})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const z=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,D=S[A],P=c*z*y;I(D+P,A,{commit:!0})}}})})})})});J.displayName=M;var[q,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function E(w){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(q,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=E(w.clientX);r?.(S)},onSlideMove:w=>{const S=E(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const K=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(q,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,E=>b(E)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function Ee(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function De(e,t){if(t>0){const o=Ee(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=J,Ae=te,Te=ne,Ve=oe;export{Ie as R,Ae as T,Te as a,Ve as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,b as I,l as D,j as n,q as F,_ as H,$ as q,Z as E,d as W,r as w,P as g,at as G,E as U,aK as V,B as Y}from"./index-
|
|
1
|
+
import{c as C,b as I,l as D,j as n,q as F,_ as H,$ as q,Z as E,d as W,r as w,P as g,at as G,E as U,aK as V,B as Y}from"./index-CC7J7MsT.js";import{u as Z}from"./use-mobile-X_9uHXB5.js";import{c as J,r as Q,b as X,m as ee}from"./thread-button-B9U3gqvP.js";import{a as K,R as te,b as ne}from"./resizable-c-JEmBrU.js";import{R as oe}from"./route-page-header-BzWw0nja.js";import{y as ae,ar as se}from"./agent-icon-D5Ih-I28.js";import{T as le,a as ie,c as re}from"./tooltip-DSCGYdw1.js";import{p as ce,T as de}from"./toolbar-icon-button-DQAUOhdv.js";function A(u){const e=C.c(25),{side:o,open:a,disabled:s,onToggle:t}=u,r=I();let c;e[0]!==a||e[1]!==o||e[2]!==r?(c=r(a?o==="left"?"agentShellLayout.toggleButtons.hideChat":"agentShellLayout.toggleButtons.hidePanel":o==="left"?"agentShellLayout.toggleButtons.showChat":"agentShellLayout.toggleButtons.showPanel"),e[0]=a,e[1]=o,e[2]=r,e[3]=c):c=e[3];const l=c;let d;e[4]!==t||e[5]!==a||e[6]!==o?(d=()=>{F("agent_toolbar_toggled",{button:o==="left"?"chat":"main",next_state:a?"closed":"open"}),t()},e[4]=t,e[5]=a,e[6]=o,e[7]=d):d=e[7];const i=d;if(o==="left"){let x,j;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=D("flex h-10 md:h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm disabled:opacity-40",ce()),j=n.jsx(ae,{size:16}),e[8]=x,e[9]=j):(x=e[8],j=e[9]);let y;return e[10]!==s||e[11]!==l||e[12]!==i||e[13]!==x?(y=n.jsxs("button",{type:"button",disabled:s,onClick:i,className:x,children:[j,l]}),e[10]=s,e[11]=l,e[12]=i,e[13]=x,e[14]=y):y=e[14],y}let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(se,{size:16}),e[15]=h):h=e[15];let f;e[16]!==s||e[17]!==l||e[18]!==i?(f=n.jsx(le,{asChild:!0,children:n.jsx(de,{"aria-label":l,disabled:s,onClick:i,className:"size-7 rounded-md disabled:opacity-40",children:h})}),e[16]=s,e[17]=l,e[18]=i,e[19]=f):f=e[19];let m;e[20]!==l?(m=n.jsx(ie,{side:"bottom",children:l}),e[20]=l,e[21]=m):m=e[21];let p;return e[22]!==f||e[23]!==m?(p=n.jsxs(re,{children:[f,m]}),e[22]=f,e[23]=m,e[24]=p):p=e[24],p}function $(u,e){const o=typeof u=="number"?u:Number(u);return!Number.isFinite(o)||o<=0||o>=100?e:o}function ue(u,e){const o=C.c(8);let a;o[0]!==e?(a=l=>$(l,e),o[0]=e,o[1]=a):a=o[1];const[s,t]=H(u,a);let r;o[2]!==e||o[3]!==s?(r=$(s,e),o[2]=e,o[3]=s,o[4]=r):r=o[4];let c;return o[5]!==t||o[6]!==r?(c=[r,t],o[5]=t,o[6]=r,o[7]=c):c=o[7],c}const he=33;function fe(){const u=C.c(1);let e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(e=q.sidePanelWidth(),u[0]=e):e=u[0],ue(e,he)}const P="chat-layout-thread",O="chat-layout-content",k=w.createContext(null);function me(){return M()}function M(){const u=w.use(k);if(!u)throw new Error("ChatLayout regions require a ChatLayout");return u}function pe(u){const e=C.c(24),{children:o,...a}=u,s=E(),t=Z(),r=W(),c=w.useRef(null),[l,d]=fe(),{threadOpen:i,contentOpen:h}=a,f=J(a),m=i&&h?l:f.side,p=100-m,x=b=>{const T=b.getLayout(),z=T[P],L=T[O];typeof z!="number"||typeof L!="number"||Math.abs(z-m)<.001&&Math.abs(L-p)<.001||b.setLayout({[P]:m,[O]:p})},j=Q({visibility:a,threadVisibilityExplicit:a.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==a||e[2]!==j?(y={...a,isMobile:t,mobileSurface:j},e[0]=t,e[1]=a,e[2]=j,e[3]=y):y=e[3];const S=y;let N;e[4]!==s||e[5]!==t||e[6]!==a||e[7]!==r||e[8]!==i||e[9]!==S?(N=s&&n.jsx(X,{open:t?S.mobileSurface==="chat":i,onToggle:()=>{t?r({to:".",search:b=>({...b,...ee(S.mobileSurface==="chat"?"main":"chat")}),replace:!0}):a.toggleThread()}}),e[4]=s,e[5]=t,e[6]=a,e[7]=r,e[8]=i,e[9]=S,e[10]=N):N=e[10];let v;e[11]!==o||e[12]!==h||e[13]!==p||e[14]!==t||e[15]!==d||e[16]!==x||e[17]!==i||e[18]!==m?(v=t?n.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:o}):n.jsx(te,{ref:b=>{if(c.current=b,!b)return;let T=!0;return queueMicrotask(()=>{T&&x(b)}),()=>{T=!1,c.current===b&&(c.current=null)}},defaultLayout:{[P]:m,[O]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(b,T)=>{const{isUserInteraction:z}=T;if(!z){const R=c.current;R&&x(R);return}const L=b[P];i&&h&&typeof L=="number"&&L>0&&L<100&&d(L)},children:o}),e[11]=o,e[12]=h,e[13]=p,e[14]=t,e[15]=d,e[16]=x,e[17]=i,e[18]=m,e[19]=v):v=e[19];let _;return e[20]!==N||e[21]!==v||e[22]!==S?(_=n.jsxs(k,{value:S,children:[N,v]}),e[20]=N,e[21]=v,e[22]=S,e[23]=_):_=e[23],_}function ge(u){const e=C.c(17),{children:o,topbar:a}=u,s=M(),t=E();if(s.isMobile){let f;return e[0]!==o||e[1]!==t||e[2]!==s.mobileSurface||e[3]!==a?(f=s.mobileSurface==="chat"?n.jsxs(g,{variant:"plain","data-slot":"chat-layout-thread",children:[t&&a,n.jsx(g.Content,{"data-testid":"chat-panel",children:o})]}):null,e[0]=o,e[1]=t,e[2]=s.mobileSurface,e[3]=a,e[4]=f):f=e[4],f}const r=s.threadOpen?"":void 0;let c;e[5]!==o||e[6]!==s.threadOpen||e[7]!==a?(c=s.threadOpen&&n.jsxs(n.Fragment,{children:[a,n.jsx(g.Content,{"data-testid":"chat-panel",children:o})]}),e[5]=o,e[6]=s.threadOpen,e[7]=a,e[8]=c):c=e[8];let l;e[9]!==c?(l=n.jsx("div",{className:"h-full min-h-0 p-0.5",children:n.jsx(g,{"data-testid":"side-panel",children:c})}),e[9]=c,e[10]=l):l=e[10];let d;e[11]!==r||e[12]!==l?(d=n.jsx(K,{id:P,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":r,className:"min-w-0 overflow-hidden bg-sidebar",children:l}),e[11]=r,e[12]=l,e[13]=d):d=e[13];let i;e[14]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ne,{className:"bg-sidebar"}),e[14]=i):i=e[14];let h;return e[15]!==d?(h=n.jsxs(n.Fragment,{children:[d,i]}),e[15]=d,e[16]=h):h=e[16],h}function xe({children:u,routeId:e}){return u}function B(u){const e=C.c(27),{children:o,actions:a,drawer:s}=u,t=M(),r=E();if(t.isMobile&&t.mobileSurface!=="main")return null;const c=t.isMobile?"plain":"card";let l;e[0]!==a||e[1]!==r||e[2]!==t.contentActions||e[3]!==t.contentNavigation||e[4]!==t.contentOpen||e[5]!==t.isMobile||e[6]!==t.threadOpen||e[7]!==t.toggleContent||e[8]!==t.toggleThread?(l=r?n.jsx(oe,{navigation:t.contentNavigation,actions:n.jsxs(n.Fragment,{children:[t.contentActions,a]})}):n.jsx(n.Fragment,{children:!t.isMobile&&t.contentOpen&&n.jsxs(g.Topbar,{children:[n.jsxs(g.Topbar.Left,{className:"gap-0.5",children:[n.jsx(A,{side:"left",open:t.threadOpen,onToggle:t.toggleThread}),t.contentNavigation,n.jsx(g.Topbar.Left.Target,{})]}),n.jsx(g.Topbar.Center,{children:n.jsx("div",{className:"flex min-w-0 items-center @max-sm/panel-header:hidden",children:n.jsx(g.Topbar.Center.Target,{})})}),n.jsxs(g.Topbar.Right,{children:[n.jsx(g.Topbar.Right.Target,{}),t.contentActions,a,n.jsx(A,{side:"right",open:t.contentOpen,onToggle:t.toggleContent})]})]})}),e[0]=a,e[1]=r,e[2]=t.contentActions,e[3]=t.contentNavigation,e[4]=t.contentOpen,e[5]=t.isMobile,e[6]=t.threadOpen,e[7]=t.toggleContent,e[8]=t.toggleThread,e[9]=l):l=e[9];let d;e[10]!==o||e[11]!==t.contentKey?(d=n.jsx(G,{children:n.jsx(xe,{routeId:t.contentKey,children:o})}),e[10]=o,e[11]=t.contentKey,e[12]=d):d=e[12];let i;e[13]!==t.contentKey||e[14]!==d?(i=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n.jsx(U,{children:d},t.contentKey)}),e[13]=t.contentKey,e[14]=d,e[15]=i):i=e[15];let h;e[16]!==s||e[17]!==i?(h=n.jsxs(g.Content,{children:[i,s]}),e[16]=s,e[17]=i,e[18]=h):h=e[18];let f;e[19]!==c||e[20]!==l||e[21]!==h?(f=n.jsxs(g,{"data-testid":"main-panel",variant:c,children:[l,h]}),e[19]=c,e[20]=l,e[21]=h,e[22]=f):f=e[22];const m=f;let p;return e[23]!==t.contentOpen||e[24]!==t.isMobile||e[25]!==m?(p=t.isMobile?m:n.jsx(K,{id:O,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:n.jsx("div",{className:"h-full min-h-0 p-0.5",children:m})}),e[23]=t.contentOpen,e[24]=t.isMobile,e[25]=m,e[26]=p):p=e[26],p}function be(){const u=C.c(1);let e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(B,{children:n.jsx(V,{})}),u[0]=e):e=u[0],e}function ye(u){const e=C.c(18),{error:o,reset:a}=u,s=I();let t;e[0]!==s?(t=s("common.errorBoundary.somethingWentWrong"),e[0]=s,e[1]=t):t=e[1];let r;e[2]!==t?(r=n.jsx("h2",{className:"text-lg font-medium",children:t}),e[2]=t,e[3]=r):r=e[3];let c;e[4]!==o.message||e[5]!==s?(c=o.message||s("common.errorBoundary.unexpectedError"),e[4]=o.message,e[5]=s,e[6]=c):c=e[6];let l;e[7]!==c?(l=n.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:c}),e[7]=c,e[8]=l):l=e[8];let d;e[9]!==s?(d=s("common.errorBoundary.tryAgain"),e[9]=s,e[10]=d):d=e[10];let i;e[11]!==a||e[12]!==d?(i=n.jsx(Y,{variant:"outline",onClick:a,children:d}),e[11]=a,e[12]=d,e[13]=i):i=e[13];let h;return e[14]!==r||e[15]!==l||e[16]!==i?(h=n.jsx(B,{children:n.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[r,l,i]})}),e[14]=r,e[15]=l,e[16]=i,e[17]=h):h=e[17],h}const je=Object.assign(pe,{Thread:ge,Content:B}),ze=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:je,ChatLayoutError:ye,ChatLayoutPending:be,useChatLayout:me},Symbol.toStringTag,{value:"Module"}));export{je as C,A as P,ze as i,me as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,a0 as j,dN as v,j as p,N as f,aa as d,X as x}from"./index-
|
|
1
|
+
import{c as h,a0 as j,dN as v,j as p,N as f,aa as d,X as x}from"./index-CC7J7MsT.js";import{L as N}from"./legacy-main-redirect-NyVTUirL.js";import"./thread-route-DnE31jZ2.js";const E=x("/shell/$org/org-shell/");function O(){const e=h.c(24),{org:r}=j(),a=E.useSearch(),{main:n,virtualmcpid:o}=a;if(n!==void 0){let t;e[0]!==n||e[1]!==r.slug||e[2]!==a||e[3]!==o?(t=v({org:r.slug,agentId:o,main:n,search:a}),e[0]=n,e[1]=r.slug,e[2]=a,e[3]=o,e[4]=t):t=e[4];const s=t;if(s?.kind==="canonical"){let l;return e[5]!==s?(l=p.jsx(N,{target:s}),e[5]=s,e[6]=l):l=e[6],l}}let u;e[7]!==o?(u=o?.trim()||null,e[7]=o,e[8]=u):u=e[8];const g=u;if(g){let t;e[9]!==r.slug||e[10]!==g?(t={org:r.slug,agentId:g},e[9]=r.slug,e[10]=g,e[11]=t):t=e[11];let s;e[12]!==a?(s={...a,virtualmcpid:void 0},e[12]=a,e[13]=s):s=e[13];let l;return e[14]!==t||e[15]!==s?(l=p.jsx(f,{to:d.projects,params:t,search:s,hash:!0,replace:!0}),e[14]=t,e[15]=s,e[16]=l):l=e[16],l}let i;e[17]!==r.slug?(i={org:r.slug},e[17]=r.slug,e[18]=i):i=e[18];let c;e[19]!==a?(c={...a,virtualmcpid:void 0},e[19]=a,e[20]=c):c=e[20];let m;return e[21]!==i||e[22]!==c?(m=p.jsx(f,{to:d.home,params:i,search:c,hash:!0,replace:!0}),e[21]=i,e[22]=c,e[23]=m):m=e[23],m}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as t,bo as o}from"./index-
|
|
1
|
+
import{r as i,j as t,bo as o}from"./index-CC7J7MsT.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as r}from"./index-
|
|
1
|
+
import{c as s,j as r}from"./index-CC7J7MsT.js";import{D as n,b as c}from"./decopilot-rj_BJ_Z1.js";function d(l){const e=s.c(2),{onClose:o}=l;let t;return e[0]!==o?(t=r.jsx(c,{onClose:o}),e[0]=o,e[1]=t):t=e[1],t}function p(l){const e=s.c(4);let o;e[0]!==l?({...o}=l,e[0]=l,e[1]=o):o=e[1];let t;return e[2]!==o?(t=r.jsx(n,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{p as M,d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as $,U as D,V as We,T as H,W as je,X as A,Y as U,j as W,Z as J,_ as Z,$ as me,a0 as qe,a1 as we,a2 as Xe,E as be,a3 as Ye,a4 as Je,d as ve}from"./index-DyCAAYSx.js";import{eJ as ye,eU as Ce,eI as Se,eV as Re,eW as Ee,eX as Te,eY as Oe,eZ as Ie,eK as Ae,e7 as Me,r as C,aO as ze}from"./index-EcuFIS2a.js";let G,Q;if(typeof WeakMap<"u"){let e=new WeakMap;G=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;G=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return G(e)||Q(e,Ze(e))}};function Ze(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),J.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return J.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(Z.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(h,f))}}return J.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Je(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Jt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Zt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Gt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Gt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Zt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Jt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
1
|
+
import{h as $,U as D,V as We,T as H,W as je,X as A,Y as U,j as W,Z as J,_ as Z,$ as me,a0 as qe,a1 as we,a2 as Xe,E as be,a3 as Ye,a4 as Je,d as ve}from"./index-BcfYNZk_.js";import{eJ as ye,eU as Ce,eI as Se,eV as Re,eW as Ee,eX as Te,eY as Oe,eZ as Ie,eK as Ae,e7 as Me,r as C,aO as ze}from"./index-CC7J7MsT.js";let G,Q;if(typeof WeakMap<"u"){let e=new WeakMap;G=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;G=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return G(e)||Q(e,Ze(e))}};function Ze(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),J.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return J.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(Z.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(h,f))}}return J.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Je(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Jt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Zt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Gt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Gt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Zt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Jt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,bt as L,bu as q,j as d,es as B,bo as x,bm as E,eq as K,bp as C,er as _,dj as T,bF as w,bE as U,bJ as V}from"./index-
|
|
1
|
+
import{r as s,bt as L,bu as q,j as d,es as B,bo as x,bm as E,eq as K,bp as C,er as _,dj as T,bF as w,bE as U,bJ as V}from"./index-CC7J7MsT.js";var I="Radio",[z,P]=w(I),[H,J]=z(I),k=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:a,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":j(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=J(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var W="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=W;function j(t){return t?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=w(y,[_,P]),A=_(),N=P(),[Q,Z]=Y(y),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=A(o),u=L(R),[b,h]=q({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Q,{scope:o,name:n,required:a,disabled:l,value:b,onValueChange:h,children:d.jsx(B,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Z(M,o),a=r.disabled||n,l=A(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});F.displayName=M;var $="RadioGroupIndicator",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(G,{...e,...n,ref:c})});O.displayName=$;var oe=D,re=F,te=O;export{re as I,oe as R,te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,f as p,ah as u,j as s,aK as x,N as a}from"./index-
|
|
1
|
+
import{c,f as p,ah as u,j as s,aK as x,N as a}from"./index-CC7J7MsT.js";import{C as j}from"./capability-load-error-l-yxDu1W.js";function d(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:f}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{d as default};
|