decocms 4.91.18 → 4.92.0
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-CCfL1qKN.js → AlertCircle-BtNVN6lT.js} +1 -1
- package/dist/client/assets/{AreaChart-C-J00ov-.js → AreaChart-G7ca0KYF.js} +1 -1
- package/dist/client/assets/{ArrowUp-vXn8z885.js → ArrowUp-SfmKmvG1.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DAaWjFGI.js → ArrowUpRight-DPmhEMyl.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dh0kDPRF.js → CheckCircle-Dqg_7udX.js} +1 -1
- package/dist/client/assets/{ChevronDown-DpQsva5t.js → ChevronDown-CtpYRw0N.js} +1 -1
- package/dist/client/assets/{ChevronRight-BNfsjOjs.js → ChevronRight-DQFD5vOs.js} +1 -1
- package/dist/client/assets/{ChevronUp-CWA4ZtkN.js → ChevronUp-Bu3KYaYp.js} +1 -1
- package/dist/client/assets/{Copy01-tZo8YOJb.js → Copy01-B4AQ9voq.js} +1 -1
- package/dist/client/assets/{DotsVertical-DFto1Mmd.js → DotsVertical-4fMK5hdE.js} +1 -1
- package/dist/client/assets/{Eye-DuOjDWxB.js → Eye-7UpR5EsV.js} +1 -1
- package/dist/client/assets/{FilterLines-CJgTbUDc.js → FilterLines-jo0eHglf.js} +1 -1
- package/dist/client/assets/{Globe01-CMrlL_OR.js → Globe01-BEuNOgWE.js} +1 -1
- package/dist/client/assets/{Globe04-BgoivJUe.js → Globe04-ezZLp1FH.js} +1 -1
- package/dist/client/assets/{HardDrive-CD9T2TUm.js → HardDrive-Bx0yMIUr.js} +1 -1
- package/dist/client/assets/{Image01-rd9dBk2i.js → Image01-BemfbeRy.js} +1 -1
- package/dist/client/assets/{Key01-CbVyJDS8.js → Key01-wlopeCn8.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CljUQfjc.js → LayoutLeft-DgCOjEX2.js} +1 -1
- package/dist/client/assets/{LinkExternal01-cX6n6x_M.js → LinkExternal01-DjHN0DVc.js} +1 -1
- package/dist/client/assets/{Monitor01-BAHQeyaU.js → Monitor01-CvVGHJ2u.js} +1 -1
- package/dist/client/assets/{Package-DLIENmRh.js → Package-Dkg7P-qU.js} +1 -1
- package/dist/client/assets/{Palette-B2es_mjK.js → Palette-DnEGtR5r.js} +1 -1
- package/dist/client/assets/{Play-BHJ_cEUs.js → Play-pFWdRfmo.js} +1 -1
- package/dist/client/assets/{Plus-DWM1ZybX.js → Plus-BhgoGeba.js} +1 -1
- package/dist/client/assets/{SearchLg-DBpFZoGE.js → SearchLg-D7iDyCtR.js} +1 -1
- package/dist/client/assets/{SearchMd-DyLZ377v.js → SearchMd-DU7sZsGX.js} +1 -1
- package/dist/client/assets/{Settings02-fvX11akt.js → Settings02-Kn3GUgY3.js} +1 -1
- package/dist/client/assets/{Shield01-DgnheDyb.js → Shield01-BF7nZR91.js} +1 -1
- package/dist/client/assets/{Star01-DoA-w48J.js → Star01-UbWAuLRP.js} +1 -1
- package/dist/client/assets/{Stars01-DlYjW9GJ.js → Stars01-CKHcD24W.js} +1 -1
- package/dist/client/assets/{Stars02-DjmPVVIa.js → Stars02-ByALJtc-.js} +1 -1
- package/dist/client/assets/{Sun-CPcp6Isc.js → Sun-ERdj2Ruh.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-hrk8zlPf.js → SwitchHorizontal01-B2hcs1rw.js} +1 -1
- package/dist/client/assets/{Tool01-BhZeiRPA.js → Tool01-DoTp9Ymb.js} +1 -1
- package/dist/client/assets/{Tool02-C5OrsBmj.js → Tool02-f6hCEEx5.js} +1 -1
- package/dist/client/assets/{Trash01-D3XHZ0xP.js → Trash01-Dgm4FHaX.js} +1 -1
- package/dist/client/assets/{TrendUp01-0C8I_keT.js → TrendUp01-DdLolkHU.js} +1 -1
- package/dist/client/assets/{Upload01-BbNhy3n2.js → Upload01-DPgiWRF2.js} +1 -1
- package/dist/client/assets/{User01-bpaOLQrp.js → User01-4oxhkWpc.js} +1 -1
- package/dist/client/assets/{Users01-BN7Vwr6C.js → Users01-CbDWoQDz.js} +1 -1
- package/dist/client/assets/{Users03-BxmmyyfT.js → Users03-DQDFsIZA.js} +1 -1
- package/dist/client/assets/{X-CEVqbIno.js → X-BJznV24Z.js} +1 -1
- package/dist/client/assets/{XCircle-CgWAsKSa.js → XCircle-Mn7Ozb-Q.js} +1 -1
- package/dist/client/assets/{XClose-Bk2Pp8uS.js → XClose-BYGQndp2.js} +1 -1
- package/dist/client/assets/{Zap-BU23dtwz.js → Zap-SMAt3bB0.js} +1 -1
- package/dist/client/assets/{ZapSquare-rP8lyE6J.js → ZapSquare-Chem9D1s.js} +1 -1
- package/dist/client/assets/{ZoomOut-DLbDID-p.js → ZoomOut-znim4joS.js} +1 -1
- package/dist/client/assets/{access-gate-DBGswZmw.js → access-gate-CXUaT8Bg.js} +1 -1
- package/dist/client/assets/{add-section-modal-CdDDuLVQ.js → add-section-modal-Bu0jJfTp.js} +1 -1
- package/dist/client/assets/agent-icon-CMi9hXve.js +1 -0
- package/dist/client/assets/{agents-list-DezVTOHq.js → agents-list-CxMjWnYV.js} +1 -1
- package/dist/client/assets/ai-providers-V_ToPNx9.js +1 -0
- package/dist/client/assets/{alert-DaJxTKKZ.js → alert-DCHONWz2.js} +1 -1
- package/dist/client/assets/{alert-dialog-ArMY_5nt.js → alert-dialog-9jx8jzEO.js} +2 -2
- package/dist/client/assets/{app-editor-EknVrDW2.js → app-editor-B5Y1RFnh.js} +1 -1
- package/dist/client/assets/{auth-catchall-DSEkcMic.js → auth-catchall-gpLRqkDV.js} +1 -1
- package/dist/client/assets/{auth-entry-B9PpytHk.js → auth-entry-ByL0Zb6R.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DgCYaQvy.js → auth-split-layout-BoMjBMXD.js} +1 -1
- package/dist/client/assets/{auth-DLqJuRt0.js → auth-wA89jw5z.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Cp907-h_.js → authenticate-and-persist-oauth-CO2Dkq5Q.js} +1 -1
- package/dist/client/assets/{automation-list-row-qh2kN81a.js → automation-list-row-CZVotwYb.js} +1 -1
- package/dist/client/assets/{automation-runs-9SLdHQ_E.js → automation-runs-oeg4SZH2.js} +2 -2
- package/dist/client/assets/{automations-Dx1_m7Pf.js → automations-kL1ULwau.js} +1 -1
- package/dist/client/assets/{autosend-Ni0dYJhU.js → autosend-DFAdUSMh.js} +1 -1
- package/dist/client/assets/{avatar-C5JBkW2x.js → avatar-D2faXu9B.js} +1 -1
- package/dist/client/assets/{badge-BhB-BVYy.js → badge-C22fJvJ9.js} +1 -1
- package/dist/client/assets/{block-document-DSHbFfDB.js → block-document-F7Fz2w43.js} +1 -1
- package/dist/client/assets/{brand-context-DDKJN8kv.js → brand-context-CwktNs2n.js} +1 -1
- package/dist/client/assets/{buckets-C1QOLFYT.js → buckets-BqmVHHty.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DI_zzkNQ.js → bulk-category-panel-DEnhQv4x.js} +1 -1
- package/dist/client/assets/{calendar-CCar9dBO.js → calendar-C55pfZGp.js} +1 -1
- package/dist/client/assets/{capability-load-error-C1cWqi7M.js → capability-load-error-D-GHd7kt.js} +1 -1
- package/dist/client/assets/{card-D2jYQT8p.js → card-BZY4DqkC.js} +1 -1
- package/dist/client/assets/{category-editor-BF9KR_eL.js → category-editor-DZf03BWu.js} +1 -1
- package/dist/client/assets/{chat-context-CP8unnj6.js → chat-context-8zti4wkh.js} +7 -7
- package/dist/client/assets/{checkbox-DIw1p7SC.js → checkbox-DvRekaoI.js} +1 -1
- package/dist/client/assets/{cli-auth-success-COotmhlP.js → cli-auth-success-BwJqzavM.js} +1 -1
- package/dist/client/assets/{collection-detail-BvX1Uze6.js → collection-detail-BCNd0Ifz.js} +1 -1
- package/dist/client/assets/{collection-display-button-DW2vVENU.js → collection-display-button-Su2JKz2G.js} +1 -1
- package/dist/client/assets/{collection-search-DS2VslSR.js → collection-search-B4ji9AjC.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-hsmIXE50.js → collection-table-wrapper-DhT1Pcxz.js} +1 -1
- package/dist/client/assets/{collection-tabs-DlRsGBoL.js → collection-tabs-DTWzD8v3.js} +1 -1
- package/dist/client/assets/{command-C029goy8.js → command-BeMVvNyF.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Bb6Gc2B4.js → commerce-onboarding-wd060R0w.js} +1 -1
- package/dist/client/assets/{companions-core-Cio3LQDG.js → companions-core-D6ZCzGBn.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-cKK7cndw.js → connect-desktop-dialog-ekgjUng_.js} +1 -1
- package/dist/client/assets/{connection-card-DIxXFaHJ.js → connection-card-7Jlr5ou8.js} +1 -1
- package/dist/client/assets/{connection-detail-RYQwL6P8.js → connection-detail-CVc89tOZ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BuKfe4q4.js → connection-form-helpers-BT4sViBb.js} +1 -1
- package/dist/client/assets/{connections-C0BH-FJx.js → connections-U8gRLumN.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DLMn8S52.js → decopilot-sse-pool-us-M5mS8.js} +1 -1
- package/dist/client/assets/{dialog-DzbtpRzm.js → dialog-B_MtszrV.js} +1 -1
- package/dist/client/assets/{domain-settings-DMjFeoSy.js → domain-settings-C_FTyjE2.js} +1 -1
- package/dist/client/assets/{drawer-pBG78ZEg.js → drawer-BsQ2VY2t.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DjvpwBOQ.js → dropdown-menu-CCf9b-Ue.js} +1 -1
- package/dist/client/assets/{empty-state-CqshujR4.js → empty-state-uOmVY7AV.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CN4FYZ-8.js → extract-connection-data-B1PMDhhA.js} +1 -1
- package/dist/client/assets/{file-explorer-C4lMWCSZ.js → file-explorer-Cq-sGwnZ.js} +2 -2
- package/dist/client/assets/{file-type-icon-DUh7JGJJ.js → file-type-icon-DLDSmTyC.js} +1 -1
- package/dist/client/assets/{files-Dp9vFQrW.js → files-CCiFVnRx.js} +1 -1
- package/dist/client/assets/{form-XLaiLeTF.js → form-CBH5rcB6.js} +1 -1
- package/dist/client/assets/{general-CRdRnPnh.js → general-DnViTnDI.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DR0WZVuf.js → github-repo-picker-DWdab-4Y.js} +1 -1
- package/dist/client/assets/{hooks-PdgLMLG3.js → hooks-CQZHp8Dt.js} +1 -1
- package/dist/client/assets/{index-DD9SdiWt.js → index-B-kvMeNd.js} +1 -1
- package/dist/client/assets/{index-yihQLSU5.js → index-BfunopXO.js} +1 -1
- package/dist/client/assets/{index-D2VJNOMk.js → index-C1alCXBf.js} +1 -1
- package/dist/client/assets/index-CAK7n_FO.js +2 -0
- package/dist/client/assets/index-C_AuPrej.js +26 -0
- package/dist/client/assets/{index-CoOqTP5j.js → index-CmemNDJU.js} +1 -1
- package/dist/client/assets/index-CodlhltM.js +1 -0
- package/dist/client/assets/{index-XeUzDBJE.js → index-DWS4NoqH.js} +1 -1
- package/dist/client/assets/{index-BlOo0bH_.js → index-DWmvNX0u.js} +1 -1
- package/dist/client/assets/index-D_TDrkT8.js +519 -0
- package/dist/client/assets/{index-CQktGTXF.js → index-F-zmfSqw.js} +1 -1
- package/dist/client/assets/{index-B5h-IdV9.js → index-QeeIyPD-.js} +3 -3
- package/dist/client/assets/{index-2qh8Vkb7.js → index-d_66hXvz.js} +1 -1
- package/dist/client/assets/{index-DetOUvoD.js → index-hhU2F3WQ.js} +3 -3
- package/dist/client/assets/{index-redirect-CLKvvVrX.js → index-redirect-BRH-3ZCu.js} +1 -1
- package/dist/client/assets/{input-seNqBySl.js → input-ksjqlSwm.js} +1 -1
- package/dist/client/assets/{integration-icon-DC4d-8U_.js → integration-icon-nHJfLZDJ.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-C3YJMl7v.js → invite-member-dialog-C6cxYu7U.js} +1 -1
- package/dist/client/assets/{label-CELgj-fe.js → label-B8xrTNKP.js} +1 -1
- package/dist/client/assets/{layout-CxfGyarO.js → layout-BJDwPfq0.js} +1 -1
- package/dist/client/assets/{login-B8SUC-xC.js → login-DlJSNcQs.js} +1 -1
- package/dist/client/assets/{mcp-oauth-308NJTFZ.js → mcp-oauth-C_zNkYXB.js} +1 -1
- package/dist/client/assets/{members-DrWhx3UV.js → members-BM7Uqu1Q.js} +1 -1
- package/dist/client/assets/{monaco-editor-CFpGykEV.js → monaco-editor-CAwKA7tN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DlHaDX7O.js → monitoring-stats-row-CC7F0Phb.js} +3 -3
- package/dist/client/assets/{multi-select-B1C99BMx.js → multi-select-5dvonfKB.js} +1 -1
- package/dist/client/assets/{oauth-callback-GIQLS4fJ.js → oauth-callback-8qeP_w61.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CaPz7dlz.js → oauth-callback-ai-provider-BmIt9KYD.js} +1 -1
- package/dist/client/assets/{onboarding-BL9BbrVi.js → onboarding-Cg0DtUJd.js} +1 -1
- package/dist/client/assets/{org-install-BF3Q6x2p.js → org-install-CTi6z1kk.js} +1 -1
- package/dist/client/assets/{org-layout-CWiy_gWT.js → org-layout-tdajFZ6u.js} +1 -1
- package/dist/client/assets/{organization-choice-b5r_0Ban.js → organization-choice-GMUL1NeO.js} +1 -1
- package/dist/client/assets/{orgs-Cuwe-Uvs.js → orgs-6ZiXdiJ2.js} +1 -1
- package/dist/client/assets/{page-seo-form-BmQsPuwl.js → page-seo-form-CGZUz0ph.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DB06C8Zh.js +1 -0
- package/dist/client/assets/{popover-BmYhWp78.js → popover-3l0deoOx.js} +1 -1
- package/dist/client/assets/{post-editor-DqMmzyOr.js → post-editor-Cf2q6koS.js} +1 -1
- package/dist/client/assets/{primitives-BzEGyOn5.js → primitives-DGvfP5N2.js} +1 -1
- package/dist/client/assets/{profile-Bw15Jk6O.js → profile-BjX7gD7e.js} +1 -1
- package/dist/client/assets/project-app-view-CInCPGOf.js +1 -0
- package/dist/client/assets/record-editor-C1rBRosQ.js +1 -0
- package/dist/client/assets/redirect-editor-DH3saw4e.js +1 -0
- package/dist/client/assets/registry-BIMV2dS4.js +2 -0
- package/dist/client/assets/registry-layout-50Nc58LU.js +27 -0
- package/dist/client/assets/{reports-BEUb5Ylx.js → reports-CMuw_Eim.js} +1 -1
- package/dist/client/assets/{require-capability-DT9_wI2y.js → require-capability-BMCPfqFj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dae_J1y7.js → required-auth-layout-BON6U2A_.js} +1 -1
- package/dist/client/assets/{reset-password-DcZj7kV5.js → reset-password-CuQp3WxW.js} +1 -1
- package/dist/client/assets/{roles-DoLNs-bZ.js → roles-flCogJRV.js} +1 -1
- package/dist/client/assets/{search-input-B0OE4vgL.js → search-input-UOEApV9M.js} +1 -1
- package/dist/client/assets/{secrets-Bax8DPsE.js → secrets-CUe-abV1.js} +1 -1
- package/dist/client/assets/{sections-editor-I_EzrRHe.js → sections-editor-BCCsHWJ1.js} +2 -2
- package/dist/client/assets/{select-BmakF1Tl.js → select-BK6Fwx47.js} +1 -1
- package/dist/client/assets/{select-model-CY4706sI.js → select-model-FeZ2YvBx.js} +1 -1
- package/dist/client/assets/{self-tool-result-DDv8702r.js → self-tool-result-BblMArR-.js} +1 -1
- package/dist/client/assets/{seo-editor-Dw9u_-tC.js → seo-editor-D48-7A97.js} +1 -1
- package/dist/client/assets/{settings-layout-h98_bPb6.js → settings-layout-DEiZmbv4.js} +1 -1
- package/dist/client/assets/{settings-section-tvXKlJMU.js → settings-section--wnksRdd.js} +1 -1
- package/dist/client/assets/{shell-controls-ChcFF1wS.js → shell-controls-6ZpSpxU3.js} +1 -1
- package/dist/client/assets/{shell-layout-BNhUr6Ou.js → shell-layout-CGSn6NPr.js} +1 -1
- package/dist/client/assets/{sidebar-C-88N1Mg.js → sidebar-BjCGlNJL.js} +1 -1
- package/dist/client/assets/{skeleton-acvDUQx5.js → skeleton-4wAys1SB.js} +1 -1
- package/dist/client/assets/sso-C8y4ysn5.js +1 -0
- package/dist/client/assets/{store-_8OffVle.js → store-EbX-J8BD.js} +1 -1
- package/dist/client/assets/store-registry-C4UWjh6m.js +2 -0
- package/dist/client/assets/{studio-tools-DjlB0eAK.js → studio-tools-Dz5m3DDC.js} +1 -1
- package/dist/client/assets/{switch-CKxDCu5s.js → switch-BGTwAogo.js} +1 -1
- package/dist/client/assets/{table-9Qz9K-53.js → table-FWVzL2nm.js} +1 -1
- package/dist/client/assets/{tabs-BrvOI9Ue.js → tabs-BovIXRni.js} +1 -1
- package/dist/client/assets/{textarea-CY46VjUw.js → textarea-B0BnrQRd.js} +1 -1
- package/dist/client/assets/{toggle-group-CIxbIRjF.js → toggle-group-DvzPCkJs.js} +1 -1
- package/dist/client/assets/{toolbar-Cur8-ScN.js → toolbar-Dde3UP0K.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Df2Xqzpy.js → toolbar-icon-button-BGzii147.js} +1 -1
- package/dist/client/assets/{tooltip-B_-EFT9Z.js → tooltip-CfmdP-aL.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Ditq-ddZ.js → use-ai-providers-UWnZZKKY.js} +1 -1
- package/dist/client/assets/{use-automations-CcxL91Ul.js → use-automations-URCauyn7.js} +1 -1
- package/dist/client/assets/{use-autosave-COC2hq6X.js → use-autosave-BjhwOY2t.js} +1 -1
- package/dist/client/assets/{use-capability-D43mUAjB.js → use-capability-B2RpFGXs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DG2FD5NL.js → use-clock-tick-CI9n9Iqh.js} +1 -1
- package/dist/client/assets/{use-collections-DdVDR82x.js → use-collections-CI5XorIY.js} +1 -1
- package/dist/client/assets/{use-connection-Bjv9Gq6l.js → use-connection-BlWYloF8.js} +1 -1
- package/dist/client/assets/{use-copy-2QAKR_KL.js → use-copy-CCSClSvL.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-ChVdlBTA.js → use-create-virtual-mcp-D97QNssr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-TZXUF3mI.js → use-debounced-autosave-DbO1S1EK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-69g0cHSY.js → use-debounced-value-DuzsGBjb.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DtOIelJm.js → use-deco-credits-Bov6Ef1l.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CVQHtAzl.js → use-decopilot-events-CqSDZlRU.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Dqrmvw62.js → use-delete-connection-B_AyED2-.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C3s9SnZ_.js → use-deployment-admin-CSBPrawc.js} +1 -1
- package/dist/client/assets/{use-file-configs-OPcutIH3.js → use-file-configs-BsBJamST.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B9qYq4Ez.js → use-infinite-scroll-Cylb4hyl.js} +1 -1
- package/dist/client/assets/{use-join-requests-Bikmvfrt.js → use-join-requests-Cy4mJo9l.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DvxzxUWu.js → use-mcp-auth-status-D-mrOgSF.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B5W5GVHP.js → use-mcp-client-DXFWWHbs.js} +3 -3
- package/dist/client/assets/{use-mcp-tools-DPZFx5IX.js → use-mcp-tools-ePfAnuof.js} +1 -1
- package/dist/client/assets/use-members-C1OZBryu.js +1 -0
- package/dist/client/assets/{use-mobile-DN3BWrDG.js → use-mobile-CEVETdVq.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C6OBFfLh.js → use-navigate-to-agent-CflMFlHw.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BIi1YKoo.js → use-org-auth-client-BFFpNQiA.js} +1 -1
- package/dist/client/assets/{use-org-sso-DwoXhtku.js → use-org-sso-QrZAqFtN.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BmQsgYbm.js → use-organization-roles-CYJSylgX.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BkKIoTyk.js → use-organization-settings-BpxUnud5.js} +1 -1
- package/dist/client/assets/{use-registry-app-DuuG0LKl.js → use-registry-app-CkuNrX2M.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B_eVLJ9k.js → use-registry-connections-DWBXDDYI.js} +1 -1
- package/dist/client/assets/{use-secrets-B6rikSxQ.js → use-secrets-C8ssS7Ik.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C_L2BT3w.js → use-status-sounds-2UIUBUS4.js} +1 -1
- package/dist/client/assets/use-t-BKpqHjpb.js +1 -0
- package/dist/client/assets/{use-view-mode-C-QHt2uA.js → use-view-mode-BEQ3VoIc.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Db0RlvR3.js → use-virtual-mcp-D9jFTGjm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DvViU0Gq.js +1 -0
- package/dist/client/assets/{useRouterState-qyO8kCMm.js → useRouterState-d9mo2HNv.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-COT_NVJE.js +1 -0
- package/dist/client/assets/{users-EXup2xZD.js → users-B6WaBMxE.js} +1 -1
- package/dist/client/assets/{variant-calendar-Cyj9si28.js → variant-calendar-D4S-Oofs.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DY_3FzuQ.js → view-mode-toggle-CQ-IPomp.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +500 -476
- package/dist/server/server.js +322 -322
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-CBVfhc5J.js +0 -1
- package/dist/client/assets/ai-providers-BnMTPR_X.js +0 -1
- package/dist/client/assets/index-BbZVcusZ.js +0 -519
- package/dist/client/assets/index-CWPNQHBf.js +0 -26
- package/dist/client/assets/index-CwmAgars.js +0 -2
- package/dist/client/assets/index-DzWzKHqk.js +0 -1
- package/dist/client/assets/page-seo-sheet-H1zK7pzI.js +0 -1
- package/dist/client/assets/project-app-view-B_xShfwO.js +0 -1
- package/dist/client/assets/record-editor-mXAQrrV1.js +0 -1
- package/dist/client/assets/redirect-editor-DdjvqH6t.js +0 -1
- package/dist/client/assets/registry-B62-xNzf.js +0 -2
- package/dist/client/assets/registry-layout-CTzJL_br.js +0 -27
- package/dist/client/assets/sso-Csvr3i0V.js +0 -1
- package/dist/client/assets/store-registry-DLodXBCO.js +0 -2
- package/dist/client/assets/use-members-Zei4aDBh.js +0 -1
- package/dist/client/assets/use-t-Cplra4Bi.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DYJj03lC.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B58_wc7n.js +0 -1
package/dist/client/assets/{bulk-category-panel-DI_zzkNQ.js → bulk-category-panel-DEnhQv4x.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-
|
|
1
|
+
import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-QeeIyPD-.js";import{c as Z}from"./ZoomOut-znim4joS.js";import{i as ae}from"./X-BJznV24Z.js";import{L as O}from"./label-B8xrTNKP.js";import{I as ie,R as oe,a as re}from"./index-DWS4NoqH.js";import{a as ce}from"./DotsVertical-4fMK5hdE.js";import{S as ne,a as de,b as me,c as xe,d as pe}from"./select-BK6Fwx47.js";import{T as fe,a as ue,b as he}from"./tooltip-CfmdP-aL.js";import"./ChevronUp-Bu3KYaYp.js";import"./ChevronDown-CtpYRw0N.js";function ge(a){const e=Q.c(8);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("grid gap-3",i),e[3]=i,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=s.jsx(oe,{"data-slot":"radio-group",className:o,...t}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l}function X(a){const e=Q.c(9);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",i),e[3]=i,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==t||e[7]!==o?(c=s.jsx(ie,{"data-slot":"radio-group-item",className:o,...t,children:l}),e[6]=t,e[7]=o,e[8]=c):c=e[8],c}function ze(a){const e=Q.c(69),{posts:i,categories:t,initialSlug:o,isPending:l,onApply:c,onClose:m}=a,[n,ee]=W.useState(o&&t.some(d=>d.slug===o)?o:t[0]?.slug??""),[x,se]=W.useState("add");let T;if(e[0]!==t||e[1]!==n){let d;e[3]!==n?(d=te=>te.slug===n,e[3]=n,e[4]=d):d=e[4],T=t.find(d),e[0]=t,e[1]=n,e[2]=T}else T=e[2];const p=T,r=i.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=s.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ae,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==m?(u=s.jsx(fe,{asChild:!0,children:s.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:m,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=m,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=s.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==t||e[23]!==n?(b=s.jsxs("div",{className:"space-y-2",children:[B,t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):s.jsxs(ne,{value:n,onValueChange:ee,children:[s.jsx(de,{className:"w-full",children:s.jsx(me,{placeholder:"Select a category"})}),s.jsx(xe,{children:t.map(be)})]})]}),e[22]=t,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=d=>se(d),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==x?(y=s.jsxs(ge,{value:x,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=x,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==m?(N=s.jsx(J,{type:"button",variant:"outline",onClick:m,disabled:l,children:"Cancel"}),e[32]=l,e[33]=m,e[34]=N):N=e[34];const D=!p||l||r===0;let v;e[35]!==x||e[36]!==c||e[37]!==p?(v=()=>p&&c(x,{name:p.name,slug:p.slug}),e[35]=x,e[36]=c,e[37]=p,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=s.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=s.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=s.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,s.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==i?(R=r===0?s.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):s.jsx("ul",{className:"divide-y border-t bg-background",children:i.map(je)}),e[56]=r,e[57]=i,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=s.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=s.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(a){return s.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[s.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:a.title}),a.slug&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.slug})]})]},a.key)}function be(a){return s.jsx(pe,{value:a.slug,children:s.jsx("span",{className:"truncate",children:a.name})},a.slug)}export{ze as BulkCategoryPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as O,bN as cs,bO as Ll,j as b,at as jl,aM as lt,bP as Vl,c as us,l as et,bQ as Bi}from"./index-B5h-IdV9.js";import{w as Wl}from"./agent-icon-CBVfhc5J.js";import{i as $l}from"./ChevronRight-BNfsjOjs.js";function ql(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function nb(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function rb(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Y(n){this.content=n}Y.prototype={constructor:Y,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Y(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Y(t)},addToStart:function(n,e){return new Y([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Y(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Y(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Y.from(n),n.size?new Y(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Y.from(n),n.size?new Y(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Y.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Y.from=function(n){if(n instanceof Y)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Y(e)};function ds(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=ds(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function fs(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let c=fs(s.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}class v{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new v(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new v(r,i)}cutByIndex(e,t){return e==t?v.empty:e==0&&t==this.content.length?this:new v(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new v(i,o)}addToStart(e){return new v([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new v(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return ds(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return fs(this,e,t,r)}findIndex(e){if(e==0)return fn(0,e);if(e==this.size)return fn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?fn(t+1,o):fn(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return v.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return v.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new v(t||e,r)}static from(e){if(!e)return v.empty;if(e instanceof v)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new v([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}v.empty=new v([],0);const rr={index:0,offset:0};function fn(n,e){return rr.index=n,rr.offset=e,rr}function Mn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Mn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Mn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let j=class Er{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Mn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Er.none;if(e instanceof Er)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};j.none=[];class Cn extends Error{}class S{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ps(this.content,e+this.openStart,t);return r&&new S(r,this.openStart,this.openEnd)}removeBetween(e,t){return new S(hs(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return S.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(v.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new S(e,r,i)}}S.empty=new S(v.empty,0,0);function hs(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(hs(o.content,e-i-1,t-i-1)))}function ps(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=ps(s.content,e-o-1,t,s);return a&&n.replaceChild(i,s.copy(a))}function Hl(n,e,t){if(t.openStart>n.depth)throw new Cn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Cn("Inconsistent open depths");return ms(n,e,t,0)}function ms(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=ms(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return ot(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Jl(t,n);return ot(o,ys(n,s,a,e,r))}else return ot(o,Nn(n,e,r))}function gs(n,e){if(!e.type.compatibleContent(n.type))throw new Cn("Cannot join "+e.type.name+" onto "+n.type.name)}function Tr(n,e,t){let r=n.node(t);return gs(r,e.node(t)),r}function it(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wt(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(it(n.nodeAfter,r),o++));for(let a=o;a<s;a++)it(i.child(a),r);e&&e.depth==t&&e.textOffset&&it(e.nodeBefore,r)}function ot(n,e){return n.type.checkContent(e),n.copy(e)}function ys(n,e,t,r,i){let o=n.depth>i&&Tr(n,e,i+1),s=r.depth>i&&Tr(t,r,i+1),a=[];return Wt(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(gs(o,s),it(ot(o,ys(n,e,t,r,i+1)),a)):(o&&it(ot(o,Nn(n,e,i+1)),a),Wt(e,t,i,a),s&&it(ot(s,Nn(t,r,i+1)),a)),Wt(r,null,i,a),new v(a)}function Nn(n,e,t){let r=[];if(Wt(null,n,t,r),n.depth>t){let i=Tr(n,e,t+1);it(ot(i,Nn(n,e,t+1)),r)}return Wt(e,null,t,r),new v(r)}function Jl(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(v.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Yt{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return j.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Dn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Yt(t,r,o)}static resolveCached(e,t){let r=Fi.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else Fi.set(e,r=new Yl);let i=r.elts[r.i]=Yt.resolve(e,t);return r.i=(r.i+1)%Ul,i}}class Yl{constructor(){this.elts=[],this.i=0}}const Ul=12,Fi=new WeakMap;class Dn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Kl=Object.create(null);class ye{constructor(e,t,r,i=j.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||v.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Mn(this.attrs,t||e.defaultAttrs||Kl)&&j.sameSet(this.marks,r||j.none)}copy(e=null){return e==this.content?this:new ye(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ye(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return S.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new S(c,i.depth-s,o.depth-s)}replace(e,t,r){return Hl(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Yt.resolveCached(this,e)}resolveNoCache(e){return Yt.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),bs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=v.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=j.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!j.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=v.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}ye.prototype.text=void 0;class En extends ye{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new En(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new En(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function bs(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ct{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gl(e,t);if(r.next==null)return ct.empty;let i=xs(r);r.next&&r.err("Unexpected trailing text");let o=rc(nc(i));return ic(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return v.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
1
|
+
import{r as O,bM as cs,bN as Ll,j as b,at as jl,aM as lt,bO as Vl,c as us,l as et,bP as Bi}from"./index-QeeIyPD-.js";import{x as Wl}from"./agent-icon-CMi9hXve.js";import{i as $l}from"./ChevronRight-DQFD5vOs.js";function ql(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function nb(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function rb(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Y(n){this.content=n}Y.prototype={constructor:Y,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Y(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Y(t)},addToStart:function(n,e){return new Y([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Y(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Y(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Y.from(n),n.size?new Y(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Y.from(n),n.size?new Y(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Y.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Y.from=function(n){if(n instanceof Y)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Y(e)};function ds(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=ds(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function fs(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let c=fs(s.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}class v{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new v(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new v(r,i)}cutByIndex(e,t){return e==t?v.empty:e==0&&t==this.content.length?this:new v(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new v(i,o)}addToStart(e){return new v([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new v(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return ds(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return fs(this,e,t,r)}findIndex(e){if(e==0)return fn(0,e);if(e==this.size)return fn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?fn(t+1,o):fn(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return v.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return v.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new v(t||e,r)}static from(e){if(!e)return v.empty;if(e instanceof v)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new v([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}v.empty=new v([],0);const rr={index:0,offset:0};function fn(n,e){return rr.index=n,rr.offset=e,rr}function Mn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Mn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Mn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let j=class Er{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Mn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Er.none;if(e instanceof Er)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};j.none=[];class Cn extends Error{}class S{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ps(this.content,e+this.openStart,t);return r&&new S(r,this.openStart,this.openEnd)}removeBetween(e,t){return new S(hs(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return S.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(v.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new S(e,r,i)}}S.empty=new S(v.empty,0,0);function hs(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(hs(o.content,e-i-1,t-i-1)))}function ps(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=ps(s.content,e-o-1,t,s);return a&&n.replaceChild(i,s.copy(a))}function Hl(n,e,t){if(t.openStart>n.depth)throw new Cn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Cn("Inconsistent open depths");return ms(n,e,t,0)}function ms(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=ms(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return ot(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Jl(t,n);return ot(o,ys(n,s,a,e,r))}else return ot(o,Nn(n,e,r))}function gs(n,e){if(!e.type.compatibleContent(n.type))throw new Cn("Cannot join "+e.type.name+" onto "+n.type.name)}function Tr(n,e,t){let r=n.node(t);return gs(r,e.node(t)),r}function it(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wt(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(it(n.nodeAfter,r),o++));for(let a=o;a<s;a++)it(i.child(a),r);e&&e.depth==t&&e.textOffset&&it(e.nodeBefore,r)}function ot(n,e){return n.type.checkContent(e),n.copy(e)}function ys(n,e,t,r,i){let o=n.depth>i&&Tr(n,e,i+1),s=r.depth>i&&Tr(t,r,i+1),a=[];return Wt(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(gs(o,s),it(ot(o,ys(n,e,t,r,i+1)),a)):(o&&it(ot(o,Nn(n,e,i+1)),a),Wt(e,t,i,a),s&&it(ot(s,Nn(t,r,i+1)),a)),Wt(r,null,i,a),new v(a)}function Nn(n,e,t){let r=[];if(Wt(null,n,t,r),n.depth>t){let i=Tr(n,e,t+1);it(ot(i,Nn(n,e,t+1)),r)}return Wt(e,null,t,r),new v(r)}function Jl(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(v.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Yt{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return j.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Dn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Yt(t,r,o)}static resolveCached(e,t){let r=Fi.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else Fi.set(e,r=new Yl);let i=r.elts[r.i]=Yt.resolve(e,t);return r.i=(r.i+1)%Ul,i}}class Yl{constructor(){this.elts=[],this.i=0}}const Ul=12,Fi=new WeakMap;class Dn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Kl=Object.create(null);class ye{constructor(e,t,r,i=j.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||v.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Mn(this.attrs,t||e.defaultAttrs||Kl)&&j.sameSet(this.marks,r||j.none)}copy(e=null){return e==this.content?this:new ye(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ye(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return S.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new S(c,i.depth-s,o.depth-s)}replace(e,t,r){return Hl(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Yt.resolveCached(this,e)}resolveNoCache(e){return Yt.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),bs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=v.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=j.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!j.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=v.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}ye.prototype.text=void 0;class En extends ye{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new En(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new En(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function bs(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ct{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Gl(e,t);if(r.next==null)return ct.empty;let i=xs(r);r.next&&r.err("Unexpected trailing text");let o=rc(nc(i));return ic(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return v.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
2
2
|
`)}}ct.empty=new ct(!0);class Gl{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function xs(n){let e=[];do e.push(Xl(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Xl(n){let e=[];do e.push(Ql(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ql(n){let e=tc(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Zl(n,e);else break;return e}function zi(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Zl(n,e){let t=zi(n),r=t;return n.eat(",")&&(n.next!="}"?r=zi(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function ec(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function tc(n){if(n.eat("(")){let e=xs(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=ec(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function nc(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=t())}else if(s.type=="star"){let l=t();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=t();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=t();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=t();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function vs(n,e){return e-n}function Li(n,e){let t=[];return r(e),t.sort(vs);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&t.indexOf(l)==-1&&r(l)}}}function rc(n){let e=Object.create(null);return t(Li(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);Li(n,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new ct(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(vs);o.next.push({type:i[s][0],next:e[a.join(",")]||t(a)})}return o}}function ic(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ks(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ws(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Ss(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let o=n[i];o.validate&&o.validate(e[i])}}function Ms(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new sc(n,r,e[r]);return t}let ji=class Cs{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ms(e,r.attrs),this.defaultAttrs=ks(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ct.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ws(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ye(this,this.computeAttrs(e),v.from(t),j.setFrom(r))}createChecked(e=null,t,r){return t=v.from(t),this.checkContent(t),new ye(this,this.computeAttrs(e),t,j.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=v.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(v.empty,!0);return o?new ye(this,e,t.append(o),j.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ss(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:j.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Cs(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function oc(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class sc{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?oc(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jn{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Ms(e,i.attrs),this.excluded=null;let o=ks(this.attrs);this.instance=o?new j(this,o):null}create(e=null){return!e&&this.instance?this.instance:new j(this,ws(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new jn(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ss(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ns{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Y.from(e.nodes),t.marks=Y.from(e.marks||{}),this.nodes=ji.compile(this.spec.nodes,this),this.marks=jn.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=ct.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Vi(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Vi(this,s.split(" "))}this.nodeFromJSON=i=>ye.fromJSON(this,i),this.markFromJSON=i=>j.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ji){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new En(r,r.defaultAttrs,e,j.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Vi(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function ac(n){return n.tag!=null}function lc(n){return n.style!=null}class $e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(ac(i))this.tags.push(i);else if(lc(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new $i(this,t,!1);return r.addAll(e,j.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new $i(this,t,!0);return r.addAll(e,j.none,t.from,t.to),S.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(dc(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=qi(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=qi(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $e(e,$e.schemaRules(e)))}}const Ds={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},cc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Es={ol:!0,ul:!0},Ut=1,Or=2,$t=4;function Wi(n,e,t){return e!=null?(e?Ut:0)|(e==="full"?Or:0):n&&n.whitespace=="pre"?Ut|Or:t&~$t}class hn{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=j.none,this.match=o||(s&$t?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(v.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ut)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=v.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(v.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ds.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $i{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=Wi(null,t.preserveWhitespace,0)|(r?$t:0);i?o=new hn(i.type,i.attrs,j.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new hn(null,null,j.none,!0,null,s):o=new hn(e.schema.topNodeType,null,j.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&Or?"full":this.localPreserveWS||(i.options&Ut)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(s.text(a[l]),t,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Es.hasOwnProperty(s)&&this.parser.normalizeLists&&uc(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:cc.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Ds.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)t=this.enterInner(i[s],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=j.none;for(let a of i.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):Hi(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Wi(e,o,s.options);s.options&$t&&s.content.length==0&&(a|=$t);let l=j.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Hi(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new hn(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Ut)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function uc(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Es.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function dc(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function qi(n){let e={};for(let t in n)e[t]=n[t];return e}function Hi(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class pt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=ir(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,t);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=vn(ir(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&vn(ir(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return vn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ji(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Ji(e.marks)}}function Ji(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ir(n){return n.document||window.document}const Yi=new WeakMap;function fc(n){let e=Yi.get(n);return e===void 0&&Yi.set(n,e=hc(n)),e}function hc(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function vn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=fc(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=vn(n,h,t,r);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Ts=65535,Os=Math.pow(2,16);function pc(n,e){return n+e*Os}function Ui(n){return n&Ts}function mc(n){return(n-(n&Ts))/Os}const As=1,Ps=2,kn=4,Rs=8;class Ar{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Rs)>0}get deletedBefore(){return(this.delInfo&(As|kn))>0}get deletedAfter(){return(this.delInfo&(Ps|kn))>0}get deletedAcross(){return(this.delInfo&kn)>0}}class ae{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ae.empty)return ae.empty}recover(e){let t=0,r=Ui(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+mc(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:t:t,f=l+i+(h<0?0:u);if(r)return f;let p=e==(t<0?l:d)?null:pc(a/3,e-l),g=e==l?Ps:e==d?As:kn;return(t<0?e!=l:e!=d)&&(g|=Rs),new Ar(f,g,p)}i+=u-c}return r?e+i:new Ar(e+i,0,null)}touches(e,t){let r=0,i=Ui(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+t],u=this.ranges[i+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new ae(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ae.empty:new ae(e<0?[0,-e,0]:[0,0,e])}}ae.empty=new ae([]);class Tn{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Tn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Tn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Ar(e,i,null)}}const or=Object.create(null);class Z{getMap(){return ae.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=or[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in or)throw new RangeError("Duplicate use of step JSON ID "+e);return or[e]=t,t.prototype.jsonID=e,t}}class ${constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new $(e,null)}static fail(e){return new $(null,e)}static fromReplace(e,t,r,i){try{return $.ok(e.replace(t,r,i))}catch(o){if(o instanceof Cn)return $.fail(o.message);throw o}}}function Kr(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Kr(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return v.fromArray(r)}class je extends Z{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new S(Kr(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return $.fromReplace(e,this.from,this.to,o)}invert(){return new me(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new je(t.pos,r.pos,this.mark)}merge(e){return e instanceof je&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new je(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new je(t.from,t.to,e.markFromJSON(t.mark))}}Z.jsonID("addMark",je);class me extends Z{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new S(Kr(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return $.fromReplace(e,this.from,this.to,r)}invert(){return new je(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new me(t.pos,r.pos,this.mark)}merge(e){return e instanceof me&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new me(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new me(t.from,t.to,e.markFromJSON(t.mark))}}Z.jsonID("removeMark",me);class Ve extends Z{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return $.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return $.fromReplace(e,this.pos,this.pos+1,new S(v.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Ve(this.pos,t.marks[i]);return new Ve(this.pos,this.mark)}}return new ut(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ve(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ve(t.pos,e.markFromJSON(t.mark))}}Z.jsonID("addNodeMark",Ve);class ut extends Z{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return $.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return $.fromReplace(e,this.pos,this.pos+1,new S(v.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ve(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ut(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ut(t.pos,e.markFromJSON(t.mark))}}Z.jsonID("removeNodeMark",ut);class W extends Z{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Pr(e,this.from,this.to)?$.fail("Structure replace would overwrite content"):$.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ae([this.from,this.to-this.from,this.slice.size])}invert(e){return new W(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&W.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new W(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof W)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?S.empty:new S(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new W(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?S.empty:new S(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new W(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new W(t.from,t.to,S.fromJSON(e,t.slice),!!t.structure)}}W.MAP_BIAS=1;Z.jsonID("replace",W);class H extends Z{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Pr(e,this.from,this.gapFrom)||Pr(e,this.gapTo,this.to)))return $.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return $.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?$.fromReplace(e,this.from,this.to,r):$.fail("Content does not fit in gap")}getMap(){return new ae([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new H(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new H(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new H(t.from,t.to,t.gapFrom,t.gapTo,S.fromJSON(e,t.slice),t.insert,!!t.structure)}}Z.jsonID("replaceAround",H);function Pr(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function gc(n,e,t,r){let i=[],o=[],s,a;n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==h&&s.mark.eq(d[g])?s.to=f:i.push(s=new me(h,f,d[g])));a&&a.to==h?a.to=f:o.push(a=new je(h,f,r))}}),i.forEach(l=>n.step(l)),o.forEach(l=>n.step(l))}function yc(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof jn){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<i.length;f++){let p=i[f];p.step==o-1&&d.eq(i[f].style)&&(h=p)}h?(h.to=c,h.step=o):i.push({style:d,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>n.step(new me(s.from,s.to,s.style)))}function Gr(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new W(a,u,S.empty));else{r=d;for(let h=0;h<c.marks.length;h++)t.allowsMarkType(c.marks[h].type)||n.step(new me(a,u,c.marks[h]));if(i&&c.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new S(v.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),s.push(new W(a+h.index,a+h.index+h[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(v.empty,!0);n.replace(a,a,new S(l,0,0))}for(let l=s.length-1;l>=0;l--)n.step(s[l])}function bc(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Pt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,o=0;;--r){let s=n.$from.node(r),a=n.$from.index(r)+i,l=n.$to.indexAfter(r)-o;if(r<n.depth&&s.canReplace(a,l,t))return r;if(r==0||s.type.spec.isolating||!bc(s,a,l))break;a&&(i=1),l<s.childCount&&(o=1)}return null}function xc(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=v.empty,d=0;for(let p=o,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=v.from(r.node(p).copy(u)),d++):l--;let h=v.empty,f=0;for(let p=o,g=!1;p>t;p--)g||i.after(p+1)<i.end(p)?(g=!0,h=v.from(i.node(p).copy(h)),f++):c++;n.step(new H(l,c,s,a,new S(u.append(h),d,f),u.size-d,!0))}function Xr(n,e,t=null,r=n){let i=vc(n,e),o=i&&kc(r,e);return o?i.map(Ki).concat({type:e,attrs:t}).concat(o.map(Ki)):null}function Ki(n){return{type:n,attrs:null}}function vc(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function kc(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:s}function wc(n,e,t){let r=v.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=v.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new H(i,o,i,o,new S(r,0,0),t.length,!0))}function Sc(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&Mc(n.doc,n.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&_s(n,s,a,o),Gr(n,n.mapping.slice(o).map(a,1),r,void 0,c===null);let u=n.mapping.slice(o),d=u.map(a,1),h=u.map(a+s.nodeSize,1);return n.step(new H(d,h,d+1,h-1,new S(v.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Is(n,s,a,o),!1}})}function Is(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function _s(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(`
|
package/dist/client/assets/{capability-load-error-C1cWqi7M.js → capability-load-error-D-GHd7kt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,n as o,C as c,j as t,x as m,B as u,K as x}from"./index-
|
|
1
|
+
import{c as a,n as o,C as c,j as t,x as m,B as u,K as x}from"./index-QeeIyPD-.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,l as n,j as c}from"./index-
|
|
1
|
+
import{c as o,l as n,j as c}from"./index-QeeIyPD-.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as J,r as k,l as Q,j as t,B as U,i as V,t as T}from"./index-B5h-IdV9.js";import{i as X}from"./XCircle-CgWAsKSa.js";import{c as I}from"./ZoomOut-DLbDID-p.js";import{n as Y}from"./LinkExternal01-cX6n6x_M.js";import{aM as Z}from"./agent-icon-CBVfhc5J.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-ArMY_5nt.js";import{I as M}from"./input-seNqBySl.js";import{L}from"./label-CELgj-fe.js";import{v as at,w as mt,_ as nt,o as lt,y as R,B as pt,$ as ct,z as dt}from"./index-BbZVcusZ.js";import{c as ut,B as gt,a as xt}from"./block-document-DSHbFfDB.js";import{u as ft}from"./use-autosave-COC2hq6X.js";import{t as ht}from"./ChevronDown-DpQsva5t.js";import{p as yt,q as jt,o as vt}from"./automation-runs-9SLdHQ_E.js";import{s as v,E as bt}from"./primitives-BzEGyOn5.js";import"./AlertCircle-CCfL1qKN.js";import"./Tool01-BhZeiRPA.js";import"./ArrowUp-vXn8z885.js";import"./Settings02-fvX11akt.js";import"./Tool02-C5OrsBmj.js";import"./ArrowUpRight-DAaWjFGI.js";import"./TrendUp01-0C8I_keT.js";import"./ZapSquare-rP8lyE6J.js";import"./Users03-BxmmyyfT.js";import"./CheckCircle-Dh0kDPRF.js";import"./ChevronUp-CWA4ZtkN.js";import"./ChevronRight-BNfsjOjs.js";import"./DotsVertical-DFto1Mmd.js";import"./Stars02-DjmPVVIa.js";import"./Copy01-tZo8YOJb.js";import"./Globe01-CMrlL_OR.js";import"./Eye-DuOjDWxB.js";import"./FilterLines-CJgTbUDc.js";import"./Star01-DoA-w48J.js";import"./Globe04-BgoivJUe.js";import"./SwitchHorizontal01-hrk8zlPf.js";import"./HardDrive-CD9T2TUm.js";import"./Image01-rd9dBk2i.js";import"./Key01-CbVyJDS8.js";import"./LayoutLeft-CljUQfjc.js";import"./Monitor01-BAHQeyaU.js";import"./Sun-CPcp6Isc.js";import"./Package-DLIENmRh.js";import"./Palette-B2es_mjK.js";import"./Play-BHJ_cEUs.js";import"./Plus-DWM1ZybX.js";import"./SearchLg-DBpFZoGE.js";import"./SearchMd-DyLZ377v.js";import"./Shield01-DgnheDyb.js";import"./Stars01-DlYjW9GJ.js";import"./Trash01-D3XHZ0xP.js";import"./Upload01-BbNhy3n2.js";import"./User01-bpaOLQrp.js";import"./Users01-BN7Vwr6C.js";import"./XClose-Bk2Pp8uS.js";import"./X-CEVqbIno.js";import"./Zap-BU23dtwz.js";import"./chat-context-CP8unnj6.js";import"./autosend-Ni0dYJhU.js";import"./hooks-PdgLMLG3.js";import"./use-mcp-client-B5W5GVHP.js";import"./auth-DLqJuRt0.js";import"./decopilot-sse-pool-DLMn8S52.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-DjlB0eAK.js";import"./use-virtual-mcp-Db0RlvR3.js";import"./use-collections-DdVDR82x.js";import"./use-ai-providers-Ditq-ddZ.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CVQHtAzl.js";import"./use-organization-settings-BkKIoTyk.js";import"./tooltip-B_-EFT9Z.js";import"./dialog-DzbtpRzm.js";import"./drawer-pBG78ZEg.js";import"./collection-search-DS2VslSR.js";import"./use-mobile-DN3BWrDG.js";import"./AreaChart-C-J00ov-.js";import"./index-2qh8Vkb7.js";import"./calendar-CCar9dBO.js";import"./shell-layout-BNhUr6Ou.js";import"./avatar-C5JBkW2x.js";import"./use-t-Cplra4Bi.js";import"./required-auth-layout-Dae_J1y7.js";import"./use-org-sso-DwoXhtku.js";import"./index-CwmAgars.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-DuuG0LKl.js";import"./use-mcp-tools-DPZFx5IX.js";import"./use-connection-Bjv9Gq6l.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-Cp907-h_.js";import"./mcp-oauth-308NJTFZ.js";import"./extract-connection-data-CN4FYZ-8.js";import"./use-members-Zei4aDBh.js";import"./use-org-auth-client-BIi1YKoo.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dropdown-menu-DjvpwBOQ.js";import"./popover-BmYhWp78.js";import"./command-C029goy8.js";import"./index-BlOo0bH_.js";import"./use-copy-2QAKR_KL.js";import"./companions-core-Cio3LQDG.js";import"./form-XLaiLeTF.js";import"./select-BmakF1Tl.js";import"./tabs-BrvOI9Ue.js";import"./toggle-group-CIxbIRjF.js";import"./use-deco-credits-DtOIelJm.js";import"./connection-card-DIxXFaHJ.js";import"./use-registry-connections-B_eVLJ9k.js";import"./useInfiniteQuery-DYJj03lC.js";import"./use-infinite-scroll-B9qYq4Ez.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-D2jYQT8p.js";import"./integration-icon-DC4d-8U_.js";import"./textarea-CY46VjUw.js";import"./connection-form-helpers-BuKfe4q4.js";import"./collection-tabs-DlRsGBoL.js";import"./badge-BhB-BVYy.js";import"./useSuspenseInfiniteQuery-B58_wc7n.js";import"./connect-desktop-dialog-cKK7cndw.js";import"./select-model-CY4706sI.js";import"./checkbox-DIw1p7SC.js";import"./skeleton-acvDUQx5.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-tvXKlJMU.js";import"./index-D2VJNOMk.js";import"./file-type-icon-DUh7JGJJ.js";import"./toolbar-Cur8-ScN.js";import"./use-debounced-value-69g0cHSY.js";import"./index-DD9SdiWt.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C_L2BT3w.js";import"./empty-state-CqshujR4.js";import"./use-capability-D43mUAjB.js";import"./toolbar-icon-button-Df2Xqzpy.js";import"./use-debounced-autosave-TZXUF3mI.js";import"./index-CQktGTXF.js";import"./sidebar-C-88N1Mg.js";import"./search-input-B0OE4vgL.js";import"./use-mcp-auth-status-DvxzxUWu.js";import"./switch-CKxDCu5s.js";import"./github-repo-picker-DR0WZVuf.js";import"./use-navigate-to-agent-C6OBFfLh.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-B6rikSxQ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-CFpGykEV.js";import"./use-file-configs-OPcutIH3.js";import"./use-automations-CcxL91Ul.js";import"./automation-list-row-qh2kN81a.js";import"./table-9Qz9K-53.js";import"./use-clock-tick-DG2FD5NL.js";function Ct(b){const e=J.c(18),{icon:x,title:n,defaultOpen:C,children:d}=b,D=C===void 0?!1:C,[f,A]=k.useState(D);let l;e[0]!==x?(l=t.jsx(x,{size:15}),e[0]=x,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=f&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==f||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:f,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=f,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function yr({orgSlug:b,virtualMcpId:e,branch:x,blockKey:n,block:C,decofile:d,meta:D,onManagePosts:f,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:b,virtualMcpId:e,branch:x}),h=mt(C,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,S)=>p({...r,[o]:S}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=k.useState(a),[m,N]=k.useState(null),[w,$]=k.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=z.length,q=o=>s("slug",o),H=async(o,S)=>{const G=v(r.name);$(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:G,slug:S});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const P={...r,slug:S};await i.mutateAsync({blockKey:n,data:R(n,"categories",P)}),c(P),T.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),N(null)}catch(g){y(o),N(null),T.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){q(o);return}N({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:D,sandboxRef:{orgSlug:b,virtualMcpId:e,branch:x},emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(I,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>f(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(I,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||w||(y(a),N(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:w,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:w,children:w?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{yr as CategoryEditor};
|
|
1
|
+
import{c as J,r as k,l as Q,j as t,B as U,i as V,t as T}from"./index-QeeIyPD-.js";import{i as X}from"./XCircle-Mn7Ozb-Q.js";import{c as I}from"./ZoomOut-znim4joS.js";import{n as Y}from"./LinkExternal01-DjHN0DVc.js";import{aM as Z}from"./agent-icon-CMi9hXve.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-9jx8jzEO.js";import{I as M}from"./input-ksjqlSwm.js";import{L}from"./label-B8xrTNKP.js";import{v as at,w as mt,_ as nt,o as lt,y as R,B as pt,$ as ct,z as dt}from"./index-D_TDrkT8.js";import{c as ut,B as gt,a as xt}from"./block-document-F7Fz2w43.js";import{u as ft}from"./use-autosave-BjhwOY2t.js";import{t as ht}from"./ChevronDown-CtpYRw0N.js";import{p as yt,q as jt,o as vt}from"./automation-runs-oeg4SZH2.js";import{s as v,E as bt}from"./primitives-DGvfP5N2.js";import"./AlertCircle-BtNVN6lT.js";import"./Tool01-DoTp9Ymb.js";import"./ArrowUp-SfmKmvG1.js";import"./Settings02-Kn3GUgY3.js";import"./Tool02-f6hCEEx5.js";import"./ArrowUpRight-DPmhEMyl.js";import"./TrendUp01-DdLolkHU.js";import"./ZapSquare-Chem9D1s.js";import"./Users03-DQDFsIZA.js";import"./CheckCircle-Dqg_7udX.js";import"./ChevronUp-Bu3KYaYp.js";import"./ChevronRight-DQFD5vOs.js";import"./DotsVertical-4fMK5hdE.js";import"./Stars02-ByALJtc-.js";import"./Copy01-B4AQ9voq.js";import"./Globe01-BEuNOgWE.js";import"./Eye-7UpR5EsV.js";import"./FilterLines-jo0eHglf.js";import"./Star01-UbWAuLRP.js";import"./Globe04-ezZLp1FH.js";import"./SwitchHorizontal01-B2hcs1rw.js";import"./HardDrive-Bx0yMIUr.js";import"./Image01-BemfbeRy.js";import"./Key01-wlopeCn8.js";import"./LayoutLeft-DgCOjEX2.js";import"./Monitor01-CvVGHJ2u.js";import"./Sun-ERdj2Ruh.js";import"./Package-Dkg7P-qU.js";import"./Palette-DnEGtR5r.js";import"./Play-pFWdRfmo.js";import"./Plus-BhgoGeba.js";import"./SearchLg-D7iDyCtR.js";import"./SearchMd-DU7sZsGX.js";import"./Shield01-BF7nZR91.js";import"./Stars01-CKHcD24W.js";import"./Trash01-Dgm4FHaX.js";import"./Upload01-DPgiWRF2.js";import"./User01-4oxhkWpc.js";import"./Users01-CbDWoQDz.js";import"./XClose-BYGQndp2.js";import"./X-BJznV24Z.js";import"./Zap-SMAt3bB0.js";import"./chat-context-8zti4wkh.js";import"./autosend-DFAdUSMh.js";import"./hooks-CQZHp8Dt.js";import"./use-mcp-client-DXFWWHbs.js";import"./auth-wA89jw5z.js";import"./decopilot-sse-pool-us-M5mS8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Dz5m3DDC.js";import"./use-virtual-mcp-D9jFTGjm.js";import"./use-collections-CI5XorIY.js";import"./use-ai-providers-UWnZZKKY.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CqSDZlRU.js";import"./use-organization-settings-BpxUnud5.js";import"./tooltip-CfmdP-aL.js";import"./dialog-B_MtszrV.js";import"./drawer-BsQ2VY2t.js";import"./collection-search-B4ji9AjC.js";import"./use-mobile-CEVETdVq.js";import"./AreaChart-G7ca0KYF.js";import"./index-d_66hXvz.js";import"./calendar-C55pfZGp.js";import"./shell-layout-CGSn6NPr.js";import"./avatar-D2faXu9B.js";import"./use-t-BKpqHjpb.js";import"./required-auth-layout-BON6U2A_.js";import"./use-org-sso-QrZAqFtN.js";import"./index-CAK7n_FO.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-CkuNrX2M.js";import"./use-mcp-tools-ePfAnuof.js";import"./use-connection-BlWYloF8.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CO2Dkq5Q.js";import"./mcp-oauth-C_zNkYXB.js";import"./extract-connection-data-B1PMDhhA.js";import"./use-members-C1OZBryu.js";import"./use-org-auth-client-BFFpNQiA.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dropdown-menu-CCf9b-Ue.js";import"./popover-3l0deoOx.js";import"./command-BeMVvNyF.js";import"./index-DWmvNX0u.js";import"./use-copy-CCSClSvL.js";import"./companions-core-D6ZCzGBn.js";import"./form-CBH5rcB6.js";import"./select-BK6Fwx47.js";import"./tabs-BovIXRni.js";import"./toggle-group-DvzPCkJs.js";import"./use-deco-credits-Bov6Ef1l.js";import"./connection-card-7Jlr5ou8.js";import"./use-registry-connections-DWBXDDYI.js";import"./useInfiniteQuery-DvViU0Gq.js";import"./use-infinite-scroll-Cylb4hyl.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BZY4DqkC.js";import"./integration-icon-nHJfLZDJ.js";import"./textarea-B0BnrQRd.js";import"./connection-form-helpers-BT4sViBb.js";import"./collection-tabs-DTWzD8v3.js";import"./badge-C22fJvJ9.js";import"./useSuspenseInfiniteQuery-COT_NVJE.js";import"./connect-desktop-dialog-ekgjUng_.js";import"./select-model-FeZ2YvBx.js";import"./checkbox-DvRekaoI.js";import"./skeleton-4wAys1SB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section--wnksRdd.js";import"./index-C1alCXBf.js";import"./file-type-icon-DLDSmTyC.js";import"./toolbar-Dde3UP0K.js";import"./use-debounced-value-DuzsGBjb.js";import"./index-B-kvMeNd.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-2UIUBUS4.js";import"./empty-state-uOmVY7AV.js";import"./use-capability-B2RpFGXs.js";import"./toolbar-icon-button-BGzii147.js";import"./use-debounced-autosave-DbO1S1EK.js";import"./index-F-zmfSqw.js";import"./sidebar-BjCGlNJL.js";import"./search-input-UOEApV9M.js";import"./use-mcp-auth-status-D-mrOgSF.js";import"./switch-BGTwAogo.js";import"./github-repo-picker-DWdab-4Y.js";import"./use-navigate-to-agent-CflMFlHw.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-C8ssS7Ik.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-CAwKA7tN.js";import"./use-file-configs-BsBJamST.js";import"./use-automations-URCauyn7.js";import"./automation-list-row-CZVotwYb.js";import"./table-FWVzL2nm.js";import"./use-clock-tick-CI9n9Iqh.js";function Ct(b){const e=J.c(18),{icon:x,title:n,defaultOpen:C,children:d}=b,D=C===void 0?!1:C,[f,A]=k.useState(D);let l;e[0]!==x?(l=t.jsx(x,{size:15}),e[0]=x,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=f&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==f||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:f,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=f,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function yr({orgSlug:b,virtualMcpId:e,branch:x,blockKey:n,block:C,decofile:d,meta:D,onManagePosts:f,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:b,virtualMcpId:e,branch:x}),h=mt(C,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,S)=>p({...r,[o]:S}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=k.useState(a),[m,N]=k.useState(null),[w,$]=k.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=z.length,q=o=>s("slug",o),H=async(o,S)=>{const G=v(r.name);$(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:G,slug:S});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const P={...r,slug:S};await i.mutateAsync({blockKey:n,data:R(n,"categories",P)}),c(P),T.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),N(null)}catch(g){y(o),N(null),T.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){q(o);return}N({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:D,sandboxRef:{orgSlug:b,virtualMcpId:e,branch:x},emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(I,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>f(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(I,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||w||(y(a),N(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:w,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:w,children:w?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{yr as CategoryEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as oe,l as Xe,
|
|
1
|
+
import{c as oe,l as Xe,bB as Ze,j as K,C as Y,K as ue,m as Ye,cr as Je,R as Fe,u as Ee,n as qe,t as ae,G as le,D as de,b as je,e as et,r as x,p as tt,a as nt,U as st,ak as at}from"./index-QeeIyPD-.js";import{A as Ue,c as ot,a as rt,w as it}from"./autosend-DFAdUSMh.js";import{S as ct,b as lt,e as dt,u as ut}from"./hooks-CQZHp8Dt.js";import{u as pt}from"./studio-tools-Dz5m3DDC.js";import{a as ft,u as ht,S as mt}from"./use-mcp-client-DXFWWHbs.js";import{a as gt}from"./use-virtual-mcp-D9jFTGjm.js";import{u as yt,a as ge}from"./use-ai-providers-UWnZZKKY.js";import{o as xt,b as St}from"./location-BpLtHjTZ.js";import{d as bt,q as vt,n as It}from"./tab-id-BijBBRwE.js";import{u as kt}from"./use-decopilot-events-CqSDZlRU.js";import{e as Ct}from"./use-organization-settings-BpxUnud5.js";const Tt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},Mt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},wt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Et={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},At={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},_t={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Qe(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Rt(t){return Qe(t).includes("deepresearch")}const $t=["sonar","searchpreview","online"];function Ke(t){const e=Qe(t);return e.includes("deepresearch")?!1:$t.some(n=>e.includes(n))}function We(t){return t.asyncResearch!==!0&&Ke(t.modelId)}function Be(t){return t.asyncResearch===!0||Rt(t.modelId)||Ke(t.modelId)}function ie(t,e,n,s){for(const a of n){const o=t.find(r=>r.modelId===a);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const a of n){const o=t.find(r=>r.modelId.includes(a));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(s){const a=t.find(s);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}return null}function Pt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const a=e[s.id]??[],o=s.providerId;n.chat.fast||(n.chat.fast=ie(a,s.id,Tt[o]??[])),n.chat.smart||(n.chat.smart=ie(a,s.id,Mt[o]??[])),n.chat.thinking||(n.chat.thinking=ie(a,s.id,wt[o]??[])),n.image||(n.image=ie(a,s.id,Et[o]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(a,s.id,At[o]??[],We)),n.deepResearch||(n.deepResearch=ie(a,s.id,_t[o]??[],Be))}return n}const Dt=Ze("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function Cn(t){const e=oe.c(10),{variant:n,size:s}=t;let a;e[0]!==s||e[1]!==n?(a=Xe(Dt({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=K.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=K.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let c;e[5]!==a?(c=K.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=c):c=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=K.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let d;return e[8]!==c?(d=K.jsxs("div",{role:"status",children:[c,p]}),e[8]=c,e[9]=d):d=e[9],d}const Pe={online:!1,capabilities:[],ready:!1};function Ot(t){const e=oe.c(9),{org:n}=Y(),s=pt(),a=t?.fast??!1;let o;e[0]!==n.id?(o=ue.currentLink(n.id),e[0]=n.id,e[1]=o):o=e[1];let r;e[2]!==s?(r=async()=>{const b=await s.call("LINK_CURRENT_GET",{});return b?{...b,ready:!0}:{...Pe,ready:!0}},e[2]=s,e[3]=r):r=e[3];const c=a?1e3:1e4,p=a?2e3:15e3;let d;e[4]!==o||e[5]!==r||e[6]!==c||e[7]!==p?(d={queryKey:o,queryFn:r,staleTime:c,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=c,e[7]=p,e[8]=d):d=e[8];const{data:g}=Ye(d);return g??Pe}function Lt(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
|
|
2
2
|
`).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const ve={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Nt(t,e){if(!t)return null;const n=e?Je(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,a]of Object.entries(ve))if(a.harness===t&&a.sandbox===n)return s;return null}function Tn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function Ft(t,e){return e&&t&&ve[t].sandbox==="user-desktop"?"decopilot":t}function qt(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function jt(t){const e=oe.c(21);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Fe(n);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ee(a);let r;e[2]!==o.brand||e[3]!==o.main||e[4]!==o.preview||e[5]!==o.skill?(r=(typeof o.main=="string"?bt(o.main)?.path:void 0)??o.preview??o.skill??o.brand??null,e[2]=o.brand,e[3]=o.main,e[4]=o.preview,e[5]=o.skill,e[6]=r):r=e[6];const c=r;let p;if(e[7]!==s?.params.appSlug||e[8]!==s?.params.collectionName||e[9]!==s?.params.itemId||e[10]!==c||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
|
|
3
3
|
- ID: ${t}`),c){let g;e[13]!==c?(g=xt(c),e[13]=c,e[14]=g):g=e[14];const b=g;let A;e[15]!==c?(A=St(c),e[15]=c,e[16]=A):A=e[16],p.push(`### Currently Open File
|
|
4
4
|
The user has this file open in the Library and is most likely referring to it:
|
|
@@ -13,24 +13,24 @@ ${d.join(`
|
|
|
13
13
|
|
|
14
14
|
Help the user understand and work with this resource.`),e[7]=s?.params.appSlug,e[8]=s?.params.collectionName,e[9]=s?.params.itemId,e[10]=c,e[11]=t,e[12]=p}else p=e[12];return p.join(`
|
|
15
15
|
|
|
16
|
-
`)}function Ut(){const t=oe.c(5),e=qe(),{org:n}=Y();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const a=Fe(s);let o;return t[1]!==a?.params||t[2]!==n||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const d=p[1],g=a?.params.appSlug;if(!g)return;e.invalidateQueries({queryKey:ue.collection(n.slug,g,d)});const b=d.toLowerCase().replace(/_/g," ");ae.success(`${b} updated`)},t[1]=a?.params,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}function Qt(){const t=oe.c(4),{org:e,project:n}=Y(),s=`${e.id}/${n.id}`;let a;t[0]!==s?(a=de.taskLastViewed(s),t[0]=s,t[1]=a):a=t[1];const[,o]=le(a,Kt);let r;return t[2]!==o?(r={markTaskRead:p=>{o(d=>({...d,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Kt(t){return t??{}}function
|
|
16
|
+
`)}function Ut(){const t=oe.c(5),e=qe(),{org:n}=Y();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const a=Fe(s);let o;return t[1]!==a?.params||t[2]!==n||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const d=p[1],g=a?.params.appSlug;if(!g)return;e.invalidateQueries({queryKey:ue.collection(n.slug,g,d)});const b=d.toLowerCase().replace(/_/g," ");ae.success(`${b} updated`)},t[1]=a?.params,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}function Qt(){const t=oe.c(4),{org:e,project:n}=Y(),s=`${e.id}/${n.id}`;let a;t[0]!==s?(a=de.taskLastViewed(s),t[0]=s,t[1]=a):a=t[1];const[,o]=le(a,Kt);let r;return t[2]!==o?(r={markTaskRead:p=>{o(d=>({...d,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Kt(t){return t??{}}function Ve(){const t=je(),{org:e}=Y(),n=Ee({strict:!1}),s=et({strict:!1}),a=n.virtualmcpid??ft(e.id).id,o=(p,d)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:g=>{const b={},A=d?.virtualMcpId??g.virtualmcpid;A&&(b.virtualmcpid=A);const m=g.main;return m&&typeof m=="string"&&!vt(m)&&(b.main=m),(g.sidepanel==="chat"||g.sidepanel===0)&&(b.sidepanel=g.sidepanel),d?.autosend&&(b.autosend=Ue),b}})},r=x.useRef(crypto.randomUUID()),c=s.taskId??r.current;return{virtualMcpId:a,taskId:c,navigateToTask:o}}function Wt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
|
|
17
17
|
${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function De(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
|
|
18
|
-
${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function
|
|
18
|
+
${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Bt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const a=n.map(r=>`<skill-file path="${r.relPath}">
|
|
19
19
|
${r.content.trim()}
|
|
20
20
|
</skill-file>`).join(`
|
|
21
21
|
|
|
22
22
|
`),o=s.length>0?`
|
|
23
23
|
|
|
24
24
|
Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
|
|
25
|
-
${a}${o}`}]}function
|
|
25
|
+
${a}${o}`}]}function Vt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const a=Array.isArray(s.content)?s.content:[s.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
|
|
26
26
|
${r}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;n.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const r=o.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
|
|
27
27
|
${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function He(t){if(!t)return[];const e=[];let n="";const s=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")n+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(a.attrs.kind==="task"){const c=a.attrs.metadata,d=[c?.title??a.attrs.name??"",c?.description?.trim()].filter(Boolean).join(`
|
|
28
28
|
|
|
29
29
|
`);d&&e.push({type:"text",text:d});return}if(n+=r,o==="@"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&"agentId"in c?e.push({type:"text",text:`[DELEGATE TO AGENT: ${c.title??a.attrs.name} (agent_id: ${c.agentId})]
|
|
30
|
-
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...De(c,r))}else if(a.attrs.kind==="skill"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...
|
|
31
|
-
`);if(!k){he(i);return}new TextEncoder().encode(k).length>rn||fe(_=>Object.keys(_).length>=cn&&!(i in _)?_:{..._,[i]:k})},he=i=>{fe($=>{const{[i]:P,...k}=$;return k})},[re,Ce]=le(de.chatLastAgentOption(e),i=>i&&i in ve?i:null),te=pn(),Te=te?.isThreadLocked&&te.lockedHarness!=null?Nt(te.lockedHarness,te.lockedSandbox):null,Me=Ot(),be=Ft(re,Me.ready&&!Me.online),me=te?.isThreadLocked?Te:be,l=me?ve[me]:null,u=l?.harness??null,L=l?.sandbox??null,[E,h]=x.useState(void 0),S=x.useRef(E);S.current=E;const y={selectedModel:z,setModel:()=>{},credentialId:O,setCredentialId:g,allModelsConnections:C,isModelsLoading:j,selectedVirtualMcp:xe,imageModel:f,setImageModel:i=>{a(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:Q,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:X,setDeepResearchModel:i=>{p(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:b,setChatMode:A,appContexts:ke,setAppContext:Se,clearAppContext:he,tiptapDoc:E,setTiptapDoc:h,tiptapDocRef:S,resetInteraction:()=>{},simpleModeTier:N,setSimpleModeTier:i=>W(i),pendingAgentOption:me,setPendingAgentOption:Ce,pendingHarnessId:u,pendingSandboxProviderKind:L};return K.jsx($e.Provider,{value:y,children:t})}function _n(t){const e=oe.c(41),{virtualMcpId:n,task:s,children:a}=t,{locator:o}=Y(),{data:r}=nt.useSession(),c=r?.user??null,{taskId:p,virtualMcpId:d,navigateToTask:g}=
|
|
30
|
+
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...De(c,r))}else if(a.attrs.kind==="skill"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Bt(c,r))}else{const c=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(c)&&c.length>0&&"role"in c[0]?e.push(...Vt(c,r)):Array.isArray(c)&&e.push(...De(c,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;n+=r,e.push(...Wt(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)s(o)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function Mn(t){const e=He(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function wn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ht(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function En(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Gt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function zt(t,e){return t.filter(n=>n.messageId!==e)}const Oe=new Map,Ae=new Set;function Xt(t){Ae.add(t)}function Zt(t){return Ae.has(t)}function Yt(t){Ae.delete(t)}function ye(t){let e=Oe.get(t);return e||(e=new ct([]),Oe.set(t,e)),e}function Ge(t,e){ye(t).update(n=>Gt(n,e))}function we(t,e){ye(t).update(n=>zt(n,e))}function Jt(t,e){ye(t).set(e)}const Ie=new Map;function en(t,e){Ie.set(`${t}:${e.id}`,e)}function tn(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function Le(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Jt(e,s.items??[])}catch{}}function An(t){const e=oe.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return x.useSyncExternalStore(s.subscribe,s.get,s.get)}function nn(){const{org:t}=Y();return{enqueue:Ge,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;we(e,n);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return ae.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}function ne(t,e,n,s){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=n.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function sn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function an(t,e,n,s){if(!n||s.length===0)return null;const a=e.find(p=>p.id===n);if(!a)return null;const o=Pt([a],{[n]:s}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const c=s.find(p=>p.modelId===r.modelId);return c?{...c,keyId:n}:null}const Ne=new Set,se=new Set;function ce(t){return x.useSyncExternalStore(t.subscribe,t.get,t.get)}function on(t){return t.kind==="loading"?"ready":t.kind}const rn=1e4,cn=10,_e=x.createContext(null),Re=x.createContext(null),$e=x.createContext(null),ze=x.createContext(null);function ln({children:t}){const{locator:e}=Y(),{virtualMcpId:n}=Ve(),[s,a]=le(de.chatSelectedImageModel(e),null),[o,r]=le(de.chatSelectedWebSearchModel(e),null),[c,p]=le(de.chatSelectedDeepResearchModel(e),null),[d,g]=x.useState(null),[b,A]=x.useState("default"),m=Ct(),[D,W]=le(de.chatSimpleModeTier(e),null),N=sn(D),C=yt(),T=m.tiers[N],O=d&&C.some(i=>i.id===d)?d:T?.keyId??C[0]?.id??null,{models:v,isLoading:B}=ge(O??void 0),{models:G}=ge(T?.keyId),{models:J}=ge(m.tiers.image?.keyId),{models:w}=ge(m.tiers.web_search?.keyId),{models:V}=ge(m.tiers.deep_research?.keyId),z=ne(T,C,G,T?.title)??an(N,C,O,v),j=B,H=v.filter(i=>i.capabilities?.includes("image")),U=ne(s,C,H),f=ne(m.tiers.image,C,J,m.tiers.image?.title)??U??H[0]??null,R=v.filter(We),F=ne(o,C,R),ee=R.find(i=>i.modelId==="perplexity/sonar")??R[0]??null,Q=ne(m.tiers.web_search,C,w,m.tiers.web_search?.title)??F??ee,q=v.filter(Be),M=ne(c,C,q),I=q.find(i=>i.modelId==="perplexity/deep-research")??q.find(i=>i.asyncResearch===!0)??q[0]??null,X=ne(m.tiers.deep_research,C,V,m.tiers.deep_research?.title)??M??I,xe=gt(n)??{id:n,title:"",description:null,icon:null},[ke,fe]=x.useState({}),Se=(i,$)=>{const P=[];for(const _ of $.content??[])_.type==="text"&&_.text?.trim()&&P.push(_.text.trim());const k=P.join(`
|
|
31
|
+
`);if(!k){he(i);return}new TextEncoder().encode(k).length>rn||fe(_=>Object.keys(_).length>=cn&&!(i in _)?_:{..._,[i]:k})},he=i=>{fe($=>{const{[i]:P,...k}=$;return k})},[re,Ce]=le(de.chatLastAgentOption(e),i=>i&&i in ve?i:null),te=pn(),Te=te?.isThreadLocked&&te.lockedHarness!=null?Nt(te.lockedHarness,te.lockedSandbox):null,Me=Ot(),be=Ft(re,Me.ready&&!Me.online),me=te?.isThreadLocked?Te:be,l=me?ve[me]:null,u=l?.harness??null,L=l?.sandbox??null,[E,h]=x.useState(void 0),S=x.useRef(E);S.current=E;const y={selectedModel:z,setModel:()=>{},credentialId:O,setCredentialId:g,allModelsConnections:C,isModelsLoading:j,selectedVirtualMcp:xe,imageModel:f,setImageModel:i=>{a(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:Q,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:X,setDeepResearchModel:i=>{p(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:b,setChatMode:A,appContexts:ke,setAppContext:Se,clearAppContext:he,tiptapDoc:E,setTiptapDoc:h,tiptapDocRef:S,resetInteraction:()=>{},simpleModeTier:N,setSimpleModeTier:i=>W(i),pendingAgentOption:me,setPendingAgentOption:Ce,pendingHarnessId:u,pendingSandboxProviderKind:L};return K.jsx($e.Provider,{value:y,children:t})}function _n(t){const e=oe.c(41),{virtualMcpId:n,task:s,children:a}=t,{locator:o}=Y(),{data:r}=nt.useSession(),c=r?.user??null,{taskId:p,virtualMcpId:d,navigateToTask:g}=Ve(),[b]=st(),{markTaskRead:A}=Qt(),m=ut(),D=p,W=d,N=jt(W);let C;e[0]!==A||e[1]!==g?(C=(M,I)=>{A(M),g(M,{virtualMcpId:I?.virtualMcpId,autosend:I?.autosend})},e[0]=A,e[1]=g,e[2]=C):C=e[2];const T=C,O=D&&s?.id===D?s:null,v=O?.harness_id??null,B=O?.sandbox_provider_kind??null,G=O?.branch??null,J=v!=null,w=G;let V;e[3]!==w||e[4]!==T||e[5]!==m||e[6]!==n?(V=()=>{const M=crypto.randomUUID();return m.create({id:M,virtual_mcp_id:n,...w?{branch:w}:{}}).then(()=>T(M)).catch(()=>{T(M)}),M},e[3]=w,e[4]=T,e[5]=m,e[6]=n,e[7]=V):V=e[7];const z=V;let j;e[8]!==w||e[9]!==o||e[10]!==T||e[11]!==m||e[12]!==n?(j=M=>{const I=crypto.randomUUID(),X=M.virtualMcpId??n,pe=X===n?w:null;it(sessionStorage,o,I,M.message),m.create({id:I,virtual_mcp_id:X,...pe?{branch:pe}:{}}).then(()=>T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})).catch(()=>{T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})})},e[8]=w,e[9]=o,e[10]=T,e[11]=m,e[12]=n,e[13]=j):j=e[13];const H=j;let U;e[14]!==D||e[15]!==m?(U=M=>{D&&m.setBranch(D,M)},e[14]=D,e[15]=m,e[16]=U):U=e[16];let f;e[17]!==O||e[18]!==z||e[19]!==H||e[20]!==w||e[21]!==D||e[22]!==W||e[23]!==J||e[24]!==G||e[25]!==v||e[26]!==B||e[27]!==T||e[28]!==U?(f={virtualMcpId:W,taskId:D,openTask:T,createTask:z,createTaskWithMessage:H,activeTask:O,isThreadLocked:J,lockedHarness:v,lockedSandbox:B,lockedBranch:G,currentBranch:w,setCurrentTaskBranch:U},e[17]=O,e[18]=z,e[19]=H,e[20]=w,e[21]=D,e[22]=W,e[23]=J,e[24]=G,e[25]=v,e[26]=B,e[27]=T,e[28]=U,e[29]=f):f=e[29];const R=f;let F;e[30]!==N||e[31]!==b||e[32]!==g||e[33]!==c?(F={user:c,contextPrompt:N,preferences:b,rawNavigateToTask:g},e[30]=N,e[31]=b,e[32]=g,e[33]=c,e[34]=F):F=e[34];const ee=F;let Q;e[35]!==a||e[36]!==ee?(Q=K.jsx(ln,{children:K.jsx(ze.Provider,{value:ee,children:a})}),e[35]=a,e[36]=ee,e[37]=Q):Q=e[37];let q;return e[38]!==Q||e[39]!==R?(q=K.jsx(Re.Provider,{value:R,children:Q}),e[38]=Q,e[39]=R,e[40]=q):q=e[40],q}function Rn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:a}=dn();t&&!Ne.has(t)&&(Ne.add(t),tt("chat_opened",{thread_id:t}));const{imageModel:o,webSearchModel:r,deepResearchModel:c,chatMode:p,setChatMode:d,appContexts:g,setTiptapDoc:b,simpleModeTier:A,pendingSandboxProviderKind:m,pendingHarnessId:D}=un(),W=x.useContext(ze);if(!W)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:N,contextPrompt:C,preferences:T,rawNavigateToTask:O}=W,{org:v,locator:B}=Y(),G=nn(),[J,w]=x.useState(null),V=Ut(),z=qe(),j=lt(),H=je(),U=ht({connectionId:mt,orgId:v.id,orgSlug:v.slug}),f=dt(v.slug,t,{client:U});x.use(f.ready);const R=ce(f.messages),F=ce(f.status),ee=ce(f.finishReason),Q=ce(f.runStatusStage),q=ce(f.hasMoreOlder),M=ce(f.isFetchingOlder),I=x.useRef({onToolCall:V,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug});I.current={onToolCall:V,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug},kt({orgSlug:v.slug,taskId:t,onTaskStatus:l=>{const u=I.current,L=l.data.message_id;if(l.data.status==="in_progress"&&L){we(u.taskId,L);const E=tn(u.taskId,L);E&&f.applyLocalMessage(E),Z(u.orgSlug,u.taskId)}Zt(u.taskId)&&(async()=>(await Z(u.orgSlug,u.taskId),await f.reconcileFromServer()&&ye(u.taskId).get().length===0&&Yt(u.taskId)))()}}),x.useEffect(()=>{const l={onData:h=>{if(h.type==="data-thread-title"){const S=h.data;if(!S?.title)return;const y=I.current;if(!y.taskId)return;y.manager.patchThread({id:y.taskId,title:S.title,updated_at:new Date().toISOString()});return}if(h.type==="data-deck-updated"){const S=h.data;if(!S?.path)return;const y=S.path,i=I.current;i.queryClient.invalidateQueries({queryKey:ue.orgFsStat(i.orgId,"home",y)}),i.queryClient.invalidateQueries({queryKey:ue.orgFsRecent(i.orgId)}),i.navigate({to:".",search:$=>({...$,main:It(y)}),replace:!0});return}if(h.type==="data-open-preview"){const S=h.data,y=I.current,i=y.taskId;if(i){const $=y.manager.threads.get().find(P=>P.id===i);y.manager.patchThread({id:i,...S?.branch?{branch:S.branch}:{},...S?.sandboxProviderKind?{sandbox_provider_kind:S.sandboxProviderKind}:{},metadata:{...$?.metadata??{},...S?.githubRepo?{githubRepo:S.githubRepo}:{},...S?.sandboxMap?{sandboxMap:S.sandboxMap}:{}}})}y.navigate({to:".",search:$=>({...$,main:"preview"}),replace:!0});return}},onFinish:(h,S,y)=>{const i=I.current;i.taskId&&Z(i.orgSlug,i.taskId),i.taskId&&i.manager.patchThread({id:i.taskId,status:Lt(y,h.parts),updated_at:new Date().toISOString()});const $=h.parts?.some(k=>{const _=k;return(_.type==="tool-share_with_user"||_.type==="tool-bash"||_.type==="tool-write")&&_.state==="output-available"});if(i.taskId&&$){const k=ue.threadOutputs(i.taskId);for(const _ of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{i.queryClient.invalidateQueries({queryKey:k})},_)}i.queryClient.invalidateQueries({queryKey:ue.homeNextActions(i.orgSlug)});const P=h.metadata?.thread_id;P&&P!==i.taskId&&i.rawNavigateToTask(P)},onError:h=>{w(h),console.error("[chat] Error",h)},onToolCall:h=>I.current.onToolCall(h)};f.observer=l,Z(I.current.orgSlug,I.current.taskId);const u=h=>h==="submitted"||h==="streaming";let L=u(f.status.get().kind);const E=f.status.subscribe(()=>{const h=u(f.status.get().kind);if(h===L)return;L=h;const S=I.current;Z(S.orgSlug,S.taskId)});return()=>{f.observer===l&&(f.observer=null),E()}},[f]);const X=F.kind==="submitted"||F.kind==="streaming",pe=R.length===0,xe=R.at(-1),ke=!X&&xe?.role==="assistant"&&xe.parts.some(l=>"state"in l&&l.state==="approval-requested"),fe=s,Se=(fe?.status==="in_progress"||fe?.status==="expired")&&F.kind==="ready"&&R.length>0;async function he(l){const u=t,L=n,E=Object.entries(g),h=E.length>0?E.map(([P,k])=>`### App Context: ${P}
|
|
32
32
|
${k}`).join(`
|
|
33
33
|
|
|
34
34
|
`):"",S=[C,h].filter(Boolean).join(`
|
|
35
35
|
|
|
36
|
-
`);let y=p;y==="gen-image"&&!o&&(y="default"),y==="web-search"&&!r&&(y="default"),y==="deep-research"&&!c&&(y="default"),(y==="web-search"||y==="deep-research")&&d("default");const i=qt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:D??void 0,sandboxProviderKind:m??void 0,branch:a}});s?.harness_id||j.patchThread({id:u,harness_id:i.harnessId??"decopilot",sandbox_provider_kind:i.sandboxProviderKind??null,updated_at:new Date().toISOString()});const $={tier:A,mode:y,toolApprovalLevel:T.toolApprovalLevel??at(),system:S||void 0,agent:{id:L},thread_id:u,...i};try{if(X||Se){let P=!0;try{en(u,l),await f.enqueue(l,$),Ge(u,{workflowId:`thread-run:${u}:${l.id}`,messageId:l.id,text:Ht(l.parts),hasAttachments:l.parts.some(k=>k.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Xt(u)}catch(k){P=!1,Le(u,l.id),we(u,l.id),w(k instanceof Error?k:new Error(String(k))),ae.error(k instanceof Error?k.message:"Failed to queue message")}return Z(v.slug,u),P}return await f.submit({kind:"message",message:l},$),!0}finally{se.delete(u)}}async function re(l){const u=l.parts??He(l.tiptapDoc);if(u.length===0||se.has(t))return;se.add(t),w(null),b(void 0);const L={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}},E={id:crypto.randomUUID(),role:"user",parts:u,metadata:L};await he(E)}async function Ce(l,u){if(se.has(t))return ae.info("Still sending your previous message — try again in a moment"),!1;if(se.add(t),!await G.cancel(t,l))return se.delete(t),ae.error("Couldn't remove the original message"),!1;Le(t,l),f.removeLocalMessage(l);const E={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}}};try{return await he(E)}catch(h){return ae.error(h instanceof Error?h.message:"Failed to send edited message"),!1}}const te=async()=>{f.stop();try{const l=await fetch(`/api/${v.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.message??`Cancel failed: ${l.status}`)}}catch(l){const u=l instanceof Error?l.message:"Failed to cancel";ae.error(u),console.error("[chat] cancelRun",l)}},Te=l=>l&&typeof l=="object"&&"type"in l?re({tiptapDoc:l}):re(l),be=Ee({strict:!1}).autosend===Ue;x.useEffect(()=>{if(!be||R.length>0)return;const l=ot(sessionStorage,
|
|
36
|
+
`);let y=p;y==="gen-image"&&!o&&(y="default"),y==="web-search"&&!r&&(y="default"),y==="deep-research"&&!c&&(y="default"),(y==="web-search"||y==="deep-research")&&d("default");const i=qt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:D??void 0,sandboxProviderKind:m??void 0,branch:a}});s?.harness_id||j.patchThread({id:u,harness_id:i.harnessId??"decopilot",sandbox_provider_kind:i.sandboxProviderKind??null,updated_at:new Date().toISOString()});const $={tier:A,mode:y,toolApprovalLevel:T.toolApprovalLevel??at(),system:S||void 0,agent:{id:L},thread_id:u,...i};try{if(X||Se){let P=!0;try{en(u,l),await f.enqueue(l,$),Ge(u,{workflowId:`thread-run:${u}:${l.id}`,messageId:l.id,text:Ht(l.parts),hasAttachments:l.parts.some(k=>k.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Xt(u)}catch(k){P=!1,Le(u,l.id),we(u,l.id),w(k instanceof Error?k:new Error(String(k))),ae.error(k instanceof Error?k.message:"Failed to queue message")}return Z(v.slug,u),P}return await f.submit({kind:"message",message:l},$),!0}finally{se.delete(u)}}async function re(l){const u=l.parts??He(l.tiptapDoc);if(u.length===0||se.has(t))return;se.add(t),w(null),b(void 0);const L={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}},E={id:crypto.randomUUID(),role:"user",parts:u,metadata:L};await he(E)}async function Ce(l,u){if(se.has(t))return ae.info("Still sending your previous message — try again in a moment"),!1;if(se.add(t),!await G.cancel(t,l))return se.delete(t),ae.error("Couldn't remove the original message"),!1;Le(t,l),f.removeLocalMessage(l);const E={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}}};try{return await he(E)}catch(h){return ae.error(h instanceof Error?h.message:"Failed to send edited message"),!1}}const te=async()=>{f.stop();try{const l=await fetch(`/api/${v.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.message??`Cancel failed: ${l.status}`)}}catch(l){const u=l instanceof Error?l.message:"Failed to cancel";ae.error(u),console.error("[chat] cancelRun",l)}},Te=l=>l&&typeof l=="object"&&"type"in l?re({tiptapDoc:l}):re(l),be=Ee({strict:!1}).autosend===Ue;x.useEffect(()=>{if(!be||R.length>0)return;const l=ot(sessionStorage,B,t);l&&re(l.message).then(()=>{rt(sessionStorage,B,t)})},[be,R.length,B,t,re]);const me={messages:R,status:on(F),sendMessage:Te,editQueuedMessage:Ce,stop:()=>{te()},submit:(l,u)=>f.submit(l,u),removeLocalMessage:l=>f.removeLocalMessage(l),isSendInFlight:()=>se.has(t),error:J,clearError:()=>w(null),finishReason:ee,runStatusStage:Q,clearFinishReason:()=>f.finishReason.set(null),isStreaming:X,isChatEmpty:pe,isWaitingForApprovals:ke??!1,isRunInProgress:Se,hasMoreOlder:q,isFetchingOlder:M,fetchOlderMessages:f.fetchOlderMessages.bind(f)};return K.jsx(_e.Provider,{value:me,children:e})}function $n(){const t=x.useContext(_e);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function Pn(){return x.useContext(_e)}function dn(){const t=x.useContext(Re);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function un(){const t=x.useContext($e);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Dn(){return x.useContext($e)}function pn(){return x.useContext(Re)}export{Rn as A,ln as C,Cn as S,un as a,$n as b,pn as c,dn as d,An as e,nn as f,Le as g,Pn as h,_n as i,wn as j,He as k,Ve as l,Dn as m,We as n,Be as o,Tn as p,Pt as q,En as s,Mn as t,Ot as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as d,j as c,
|
|
1
|
+
import{c as n,l as d,j as c,bD as l,bE as b}from"./index-QeeIyPD-.js";import{i as m}from"./ChevronUp-Bu3KYaYp.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,a as c,r as m,j as o}from"./index-
|
|
1
|
+
import{c as a,a as c,r as m,j as o}from"./index-QeeIyPD-.js";import{A as u}from"./auth-split-layout-BoMjBMXD.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
|