decocms 4.414.0 → 4.415.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-DaJjYzK7.js → AlertCircle-CvaSOOO8.js} +1 -1
- package/dist/client/assets/AreaChart-C1zWMN3A.js +1 -0
- package/dist/client/assets/{ArrowLeft-CwZA6hhm.js → ArrowLeft-BsqlBCdi.js} +1 -1
- package/dist/client/assets/{ArrowRight-DlEEL0oL.js → ArrowRight-B6VZdTtP.js} +1 -1
- package/dist/client/assets/{ArrowUp-BVYCIIGM.js → ArrowUp-C1c3cSMN.js} +1 -1
- package/dist/client/assets/CartesianChart-DT33HVeq.js +6 -0
- package/dist/client/assets/{Check-OcoBiXmm.js → Check-ClKm876e.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dd90iqND.js → CheckCircle-B38I9lsp.js} +1 -1
- package/dist/client/assets/{ChevronUp-CD5mSK7Y.js → ChevronUp-BBBSFlle.js} +1 -1
- package/dist/client/assets/{Copy01-BJqw8z9b.js → Copy01-kb1901QR.js} +1 -1
- package/dist/client/assets/{CreditCard01-BWWARSB9.js → CreditCard01-DkYuXaNf.js} +1 -1
- package/dist/client/assets/{DotsVertical-Chnn0E-M.js → DotsVertical-OXZ2C8qE.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CWEL9dCO.js → ErrorBarContext-CSFQ9ttu.js} +1 -1
- package/dist/client/assets/Image01-xbxm22_Y.js +1 -0
- package/dist/client/assets/{Key01-CD0lgLSw.js → Key01-ZIYydTtn.js} +1 -1
- package/dist/client/assets/{Line-Bg6fTk0a.js → Line-C_txxRhK.js} +1 -1
- package/dist/client/assets/{Link01-CDLS3D8E.js → Link01-cXYRJQde.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ClZInLaB.js → LinkExternal01-UxTfoueY.js} +1 -1
- package/dist/client/assets/{Monitor01-BdQ0e4n3.js → Monitor01-CINH3FWT.js} +1 -1
- package/dist/client/assets/{Globe04-BrBw0Avb.js → Palette-C2svjF4J.js} +1 -1
- package/dist/client/assets/{Plus-Du1X0BSn.js → Plus-Bv10xzXZ.js} +1 -1
- package/dist/client/assets/{SearchMd-BhrVtQgO.js → SearchMd-DRAIsS0-.js} +1 -1
- package/dist/client/assets/{Sector-qDv_EV21.js → Sector-TihpQ2pX.js} +5 -5
- package/dist/client/assets/{ShoppingBag01-DTuXZ14Y.js → ShoppingBag01-DsBku-zP.js} +1 -1
- package/dist/client/assets/{Sun-BOBnFu4U.js → Sun-CJOAGa8i.js} +1 -1
- package/dist/client/assets/{Tool01-B1l7rMbN.js → Tool01-gY-gdMF4.js} +1 -1
- package/dist/client/assets/{Trash01-5dU05cxX.js → Trash01-DUhLvzYZ.js} +1 -1
- package/dist/client/assets/{Upload01-HggPmwVR.js → Upload01-BsdejHE0.js} +1 -1
- package/dist/client/assets/{User01-DCaSZH6y.js → User01-B4dCU7oy.js} +1 -1
- package/dist/client/assets/{UserSquare-oitDkmCz.js → UserSquare-BA1qsXhU.js} +1 -1
- package/dist/client/assets/{Users01-C5KisUmx.js → Users01-BLSNtVXz.js} +1 -1
- package/dist/client/assets/{X-C_n07v-r.js → X-BTpPaU7c.js} +1 -1
- package/dist/client/assets/XAxis-Cj_1oR4W.js +1 -0
- package/dist/client/assets/{XClose-CH7JGbnX.js → XClose-DnZUIdlK.js} +1 -1
- package/dist/client/assets/{ZoomOut-CE1oJlBX.js → ZoomOut-DvQpsf4w.js} +1 -1
- package/dist/client/assets/{access-gate-djSuo48h.js → access-gate-BYf0rE33.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-ks_Gm8LK.js → add-connection-dialog-BdXnmDrQ.js} +1 -1
- package/dist/client/assets/agent-analytics-DQZgiL7L.js +2 -0
- package/dist/client/assets/agent-app-C7k2151J.js +1 -0
- package/dist/client/assets/agent-assets-B-r7ioGn.js +1 -0
- package/dist/client/assets/agent-automation-BkxL2BIZ.js +20 -0
- package/dist/client/assets/agent-automations-pf_bDZZ5.js +1 -0
- package/dist/client/assets/agent-connect-sources-Do412j4U.js +1 -0
- package/dist/client/assets/agent-deck-CYuHMzf-.js +1 -0
- package/dist/client/assets/agent-e2e-Db1tY-Py.js +1 -0
- package/dist/client/assets/agent-experiments-a-194CZ0.js +1 -0
- package/dist/client/assets/agent-file-DcPThm01.js +1 -0
- package/dist/client/assets/{agent-git-BTa_DVHj.js → agent-git-I5DAbFxV.js} +2 -2
- package/dist/client/assets/agent-hosting-8wURqYK1.js +1 -0
- package/dist/client/assets/agent-icon-BvDKYGuI.js +1 -0
- package/dist/client/assets/agent-library-DP9jULfe.js +1 -0
- package/dist/client/assets/agent-library-file-C2CuO8zG.js +1 -0
- package/dist/client/assets/agent-monitor-DU5E9xAR.js +1 -0
- package/dist/client/assets/agent-overview-BBH7XkKk.js +1 -0
- package/dist/client/assets/agent-settings-DBkRHp58.js +1 -0
- package/dist/client/assets/{agent-site-editor-CHHHOnLg.js → agent-site-editor-DSbFppgh.js} +4 -4
- package/dist/client/assets/agent-site-editor-code-CGBlhTFD.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D7eFLsTa.js → agent-site-editor-content-C6CyUicz.js} +6 -6
- package/dist/client/assets/{agent-site-editor-preview-CU4mKdzV.js → agent-site-editor-preview-Bm6vi5GO.js} +3 -3
- package/dist/client/assets/{agent-view-guard-Dc-tIwiR.js → agent-view-guard-BHFZQ084.js} +1 -1
- package/dist/client/assets/agent-view-iS5vUDqd.js +1 -0
- package/dist/client/assets/agents-list-BmcrOH9K.js +1 -0
- package/dist/client/assets/{ai-providers-dlDhTyuB.js → ai-providers-D07lihCf.js} +2 -2
- package/dist/client/assets/{alert-CwBw9dro.js → alert-CbVRyYdn.js} +1 -1
- package/dist/client/assets/{alert-dialog-DIB7QD28.js → alert-dialog-D5AYweb7.js} +1 -1
- package/dist/client/assets/analytics-sections-C7kQuinp.js +1 -0
- package/dist/client/assets/{api-keys-3zmZWwRN.js → api-keys-CRcL5tuf.js} +1 -1
- package/dist/client/assets/api-keys-DrGX-MFg.js +1 -0
- package/dist/client/assets/app-editor-BH13ZfO_.js +1 -0
- package/dist/client/assets/{asset-utils-DwWjXWho.js → asset-utils-DxlUH6fM.js} +1 -1
- package/dist/client/assets/{auth-D5I2s61A.js → auth-DqmsEfIB.js} +1 -1
- package/dist/client/assets/{auth-catchall-WSWKM_Gq.js → auth-catchall-BMmDsnzK.js} +1 -1
- package/dist/client/assets/auth-entry-B26Aq39u.js +1 -0
- package/dist/client/assets/{auth-split-layout-DWTgZBat.js → auth-split-layout-D5nNb-G8.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-hhMpxZ3e.js → authenticate-and-persist-oauth-CtghXoSr.js} +1 -1
- package/dist/client/assets/{automation-list-row-DdEGsJ2i.js → automation-list-row-CkyFpQMb.js} +1 -1
- package/dist/client/assets/automation-runs-CoqjOPyS.js +1 -0
- package/dist/client/assets/automations-2UeJll3f.js +1 -0
- package/dist/client/assets/{autosend-Cxmy5f7O.js → autosend-D__v3v-c.js} +1 -1
- package/dist/client/assets/{avatar-foon9v7B.js → avatar-JoRElFKl.js} +1 -1
- package/dist/client/assets/badge-B0yp_bFb.js +1 -0
- package/dist/client/assets/{block-document-B8Nfg62J.js → block-document-iObAvspI.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BaVmSFTq.js → blocks-preview-workspace-context-CroMcTkl.js} +1 -1
- package/dist/client/assets/{buckets-CUx3pPZV.js → buckets-CdF9xMMp.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BygXIWi2.js → build-improve-prompt-doc-CXnpM7kh.js} +1 -1
- package/dist/client/assets/{calendar-G6mILgu2.js → calendar-_lAvk6Nt.js} +1 -1
- package/dist/client/assets/{capability-load-error-CO1VC4nF.js → capability-load-error-8qZRldzC.js} +1 -1
- package/dist/client/assets/category-editor-fWmRfYwN.js +1 -0
- package/dist/client/assets/{chart-oCBL-j7a.js → chart-B8A_E9YA.js} +5 -5
- package/dist/client/assets/{chat-context-Cugy5hDa.js → chat-context-DCpRbJmR.js} +5 -5
- package/dist/client/assets/{chat-draft-BdIaAbi7.js → chat-draft-BiPOqsxD.js} +1 -1
- package/dist/client/assets/{checkbox-Catn0jym.js → checkbox-DYn5BX_y.js} +1 -1
- package/dist/client/assets/choose-editor-9psJgCK3.js +1 -0
- package/dist/client/assets/{claim-phase-copy-BQxiL9ur.js → claim-phase-copy-CaNBNXR7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C8L7TKTw.js → cli-auth-success-B-HmvL0Z.js} +1 -1
- package/dist/client/assets/{client-icons-wx82VsS4.js → client-icons-DRAmgBv8.js} +1 -1
- package/dist/client/assets/{collapsible-BW-qIR3J.js → collapsible-Bg1MAa8S.js} +1 -1
- package/dist/client/assets/collection-detail-CzcE81KP.js +1 -0
- package/dist/client/assets/{collection-display-button-C7gBvlDS.js → collection-display-button-BbOo6z7N.js} +1 -1
- package/dist/client/assets/{collection-search-Bq1nxKvP.js → collection-search-EssCGlF9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DVdtt0cC.js → collection-table-wrapper-BktaVXNL.js} +1 -1
- package/dist/client/assets/{collection-tabs-C36RG4Vf.js → collection-tabs-C2dMZ-Yz.js} +1 -1
- package/dist/client/assets/{combobox-DCIUJ1uY.js → combobox-DnOhf0WD.js} +1 -1
- package/dist/client/assets/command-DljL6hzf.js +1 -0
- package/dist/client/assets/{companion-mcps-section-DWDTtMpt.js → companion-mcps-section-DHfjmvo2.js} +1 -1
- package/dist/client/assets/config-BRt8XM2Q.js +1 -0
- package/dist/client/assets/{connect-jOPX0XiI.js → connect-COAAkNAe.js} +2 -2
- package/dist/client/assets/{connect-layout-CyFIUESs.js → connect-layout-D_XB9JJD.js} +1 -1
- package/dist/client/assets/{connection-CPFeF6nm.js → connection-DZucsf0o.js} +1 -1
- package/dist/client/assets/{connection-card-CTMJB3fp.js → connection-card-DrvsNBSo.js} +1 -1
- package/dist/client/assets/connection-detail-DELb5RqN.js +1 -0
- package/dist/client/assets/{connection-form-helpers-C5t2ERoW.js → connection-form-helpers-BOYwqVWG.js} +1 -1
- package/dist/client/assets/connections-BTjmigpS.js +1 -0
- package/dist/client/assets/context-t3HzYqzN.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CZ1lcSy0.js → create-organization-dialog-BCIcZ5Ce.js} +1 -1
- package/dist/client/assets/{decopilot-BbmoQjBz.js → decopilot-BbS9GPYA.js} +2 -2
- package/dist/client/assets/{dialog-D5ye6U_D.js → dialog-CfIoHDlJ.js} +1 -1
- package/dist/client/assets/discover-C6NL6AwE.js +1 -0
- package/dist/client/assets/{domain-settings-BzTmzHwn.js → domain-settings-I8HFU1tc.js} +1 -1
- package/dist/client/assets/download-app-dialog-bvP5yIID.js +1 -0
- package/dist/client/assets/{drawer-CgCvwNdV.js → drawer-gbdrTv3r.js} +1 -1
- package/dist/client/assets/{editor-DCI3ZH5o.js → editor-CUtbeyZe.js} +1 -1
- package/dist/client/assets/{empty-state-DSA1rktW.js → empty-state-B7JCSTCX.js} +1 -1
- package/dist/client/assets/{empty-state-BpRvqX3b.js → empty-state-B_xAVz84.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DIQFM_Rl.js → extract-connection-data-CHpjURut.js} +1 -1
- package/dist/client/assets/feature-gate-CSCbG-02.js +1 -0
- package/dist/client/assets/feature-paywall-BK6fjPbO.js +1 -0
- package/dist/client/assets/file-explorer-BEA-kxcu.js +2 -0
- package/dist/client/assets/file-preview-Bk7_4BhT.js +1 -0
- package/dist/client/assets/file-share-button-CtEMEEnP.js +3 -0
- package/dist/client/assets/{file-type-icon-w64MSOpN.js → file-type-icon-C_2K-vjQ.js} +1 -1
- package/dist/client/assets/flat-project-Bp2uxu0m.js +1 -0
- package/dist/client/assets/folder-icon-D2srQ6r8.js +1 -0
- package/dist/client/assets/{form-F3knQ3ef.js → form-Bw-12Nua.js} +1 -1
- package/dist/client/assets/format-time-CjIPQhCN.js +1 -0
- package/dist/client/assets/{gateway-client-BkDoJc3i.js → gateway-client-DDRZPNgE.js} +1 -1
- package/dist/client/assets/{general-DRrG1HLu.js → general-DFurEwpf.js} +1 -1
- package/dist/client/assets/github-repo-22x8y8Tm.js +1 -0
- package/dist/client/assets/home-BEfet_Bo.js +1 -0
- package/dist/client/assets/{index-D9Qjyoct.js → index-B1gW_UZi.js} +12 -12
- package/dist/client/assets/index-BADnYX4j.css +1 -0
- package/dist/client/assets/{index-1xlnSxuL.js → index-BBClJhS5.js} +1 -1
- package/dist/client/assets/{index-B_6_b10B.js → index-BBn8QmOY.js} +1 -1
- package/dist/client/assets/{index-PWbqH2G3.js → index-BGw3HTPr.js} +1 -1
- package/dist/client/assets/index-C23QqnY4.js +1 -0
- package/dist/client/assets/{index-C1LXcrdL.js → index-CBJQH72Z.js} +1 -1
- package/dist/client/assets/{index-CQTi57zC.js → index-CP9MPNu2.js} +2 -2
- package/dist/client/assets/{index-DwGlegEL.js → index-Cc_Zqhkn.js} +1 -1
- package/dist/client/assets/{index-799YT1X7.js → index-Ccktnu9A.js} +1 -1
- package/dist/client/assets/index-CdYIy8eY.js +1 -0
- package/dist/client/assets/index-DRvgWruv.js +1 -0
- package/dist/client/assets/{index-BxbJS58j.js → index-DTVMnS9R.js} +1 -1
- package/dist/client/assets/{index-DXncJrGS.js → index-TvCpAFy_.js} +15 -15
- package/dist/client/assets/index-Ty5Jzwnf.js +10 -0
- package/dist/client/assets/{index-DUhG4tsR.js → index-oPco2Z7Q.js} +36 -36
- package/dist/client/assets/{index-redirect-W-CDsNw_.js → index-redirect-D8rObEfr.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CnSA8MF_.js → infiniteQueryObserver-BiKAGWol.js} +1 -1
- package/dist/client/assets/infra-billing-DM30eRIB.js +1 -0
- package/dist/client/assets/{input-DY62oxPZ.js → input-Dk8ExXFi.js} +1 -1
- package/dist/client/assets/{input-DaUsOzcS.js → input-MYwET4H0.js} +1 -1
- package/dist/client/assets/input-ZcuegaFq.js +1 -0
- package/dist/client/assets/{integration-icon-Didv4P2d.js → integration-icon-cSotbhTg.js} +1 -1
- package/dist/client/assets/{label-BypgdEhS.js → label-9S9F78nK.js} +1 -1
- package/dist/client/assets/{last-preview-page-BGLkyqI1.js → last-preview-page-BqZ-yKjx.js} +1 -1
- package/dist/client/assets/{layout-CPzExRWR.js → layout-XmYuHyUp.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-GQn_HHLF.js → legacy-agents-deep-Cos55l5T.js} +1 -1
- package/dist/client/assets/legacy-main-redirect-SvbBzQfx.js +1 -0
- package/dist/client/assets/library-DwuPF4v9.js +1 -0
- package/dist/client/assets/library-tab-jc2e6zcQ.js +168 -0
- package/dist/client/assets/location-DBePU4bz.js +1 -0
- package/dist/client/assets/{login-BRrTc0gG.js → login-Dk9tmaQV.js} +1 -1
- package/dist/client/assets/{markdown-Bc3TbOnL.js → markdown-D8NZ8Hcx.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-x41adwrD.js → mcp-app-renderer-CMM_xZGY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-jFxfSUra.js → mcp-oauth-Rwm2gO51.js} +1 -1
- package/dist/client/assets/members-C7CWAgRC.js +1 -0
- package/dist/client/assets/{message-templates-nlH50gJ2.js → message-templates-LZ9bQOkh.js} +1 -1
- package/dist/client/assets/{mini-report-page-CxePAPTE.js → mini-report-page-Djd5YLq-.js} +1 -1
- package/dist/client/assets/mock-board-wLpRW8bx.js +1 -0
- package/dist/client/assets/{monaco-editor-D8GdrnPh.js → monaco-editor-gMJT6cpK.js} +2 -2
- package/dist/client/assets/monitoring-stats-row-DGiOnVB-.js +1 -0
- package/dist/client/assets/{multi-select-DhVdXTHb.js → multi-select-CgJiEc6d.js} +1 -1
- package/dist/client/assets/{mustache-Da5_vbMS.js → mustache-C_QlIzWy.js} +1 -1
- package/dist/client/assets/new-project-dialog-BaZdnvse.js +1 -0
- package/dist/client/assets/{oauth-callback-DTAJ88cJ.js → oauth-callback-DKlgv_Gu.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-zQxL0ybs.js → oauth-callback-ai-provider-bpHWEFSR.js} +1 -1
- package/dist/client/assets/onboarding-BCfoU2BS.js +1 -0
- package/dist/client/assets/optimistic-project-sidebar-views-CmwJxzI1.js +1 -0
- package/dist/client/assets/{org-file-open-context-CRfULtcz.js → org-file-open-context-Bv73tl5K.js} +1 -1
- package/dist/client/assets/{organization-choice-DrNVkNJX.js → organization-choice-1eorpCYU.js} +1 -1
- package/dist/client/assets/{orgs-CRvqTOkY.js → orgs-zhbMCzP-.js} +1 -1
- package/dist/client/assets/{page-seo-form-VepXUh7G.js → page-seo-form-CshajZtl.js} +1 -1
- package/dist/client/assets/{pair-CIPjczyu.js → pair-C-k8zr2J.js} +7 -7
- package/dist/client/assets/plan-ladder-BlKhVXlg.js +1 -0
- package/dist/client/assets/{popover-CLlJmv-M.js → popover-BgkxtrX7.js} +1 -1
- package/dist/client/assets/post-calendar-B-WdFfky.js +1 -0
- package/dist/client/assets/post-editor-CsDksmyM.js +2 -0
- package/dist/client/assets/preview-content-C6mifSrd.js +1 -0
- package/dist/client/assets/{preview-dialog-oInIOpgo.js → preview-dialog-CIYvMHEx.js} +1 -1
- package/dist/client/assets/profile-C0w8Yfz5.js +1 -0
- package/dist/client/assets/project-app-view-Sevz3SK2.js +1 -0
- package/dist/client/assets/project-feed-BMtZcRjf.js +1 -0
- package/dist/client/assets/{project-icon-BzJ0b0Ay.js → project-icon-C29pLjaM.js} +1 -1
- package/dist/client/assets/project-profile-B8BUGXs3.js +1 -0
- package/dist/client/assets/project-reports-DLR8Px_E.js +1 -0
- package/dist/client/assets/project-tasks-BpKda9bF.js +1 -0
- package/dist/client/assets/projects-B_9wM2AG.js +1 -0
- package/dist/client/assets/projects-empty-state-D2roHEQS.js +1 -0
- package/dist/client/assets/{prompts-DDV76PD8.js → prompts-SqPXo2ej.js} +1 -1
- package/dist/client/assets/record-editor-DwoOuklP.js +1 -0
- package/dist/client/assets/redirect-editor-BROySec3.js +1 -0
- package/dist/client/assets/reports-7388ESEV.js +1 -0
- package/dist/client/assets/{reports-x7ZW7jY1.js → reports-BAoHRlcZ.js} +1 -1
- package/dist/client/assets/reports-onboarding-DuXWRm1J.js +1 -0
- package/dist/client/assets/reports-tab-BTG8fjPp.js +2 -0
- package/dist/client/assets/repositories-dyiTYnan.js +1 -0
- package/dist/client/assets/{repository-import-picker-DdC8LWMV.js → repository-import-picker-OR5DGZp9.js} +1 -1
- package/dist/client/assets/repository-picker-BSwi4b8i.js +1 -0
- package/dist/client/assets/require-capability-Bqc8OMTK.js +1 -0
- package/dist/client/assets/{required-auth-layout-BeA6YeYQ.js → required-auth-layout-Byop8Zzr.js} +1 -1
- package/dist/client/assets/{reset-password-CZB-h_dr.js → reset-password-BJ7ek2C_.js} +1 -1
- package/dist/client/assets/{resizable-ChG3qNIS.js → resizable-3VTCAPsm.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CmlW-pVX.js +1 -0
- package/dist/client/assets/{review-settings-1_C-_b80.js → review-settings-DV0Kgix-.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B4JFOCzI.js → rich-text-link-control-DHguSqou.js} +2 -2
- package/dist/client/assets/roles-BddVa5rc.js +1 -0
- package/dist/client/assets/route-BTyvu5tm.js +1 -0
- package/dist/client/assets/route-Dv07Kl62.js +1 -0
- package/dist/client/assets/route-wKh3eUlH.js +1 -0
- package/dist/client/assets/{runnable-block-editor-DZC0Baz4.js → runnable-block-editor-Do2tVSLe.js} +4 -4
- package/dist/client/assets/{sandbox-lifecycle-context-BonuevCJ.js → sandbox-lifecycle-context-DqykpNrC.js} +1 -1
- package/dist/client/assets/{schema-GqB2SNE_.js → schema-DN-s_HG6.js} +1 -1
- package/dist/client/assets/{scroll-area-9EhbhV4n.js → scroll-area--yTJQfnp.js} +1 -1
- package/dist/client/assets/{search-input-B84gMTxu.js → search-input-BNUWPEYj.js} +1 -1
- package/dist/client/assets/search-toggle-QxOnD3UE.js +1 -0
- package/dist/client/assets/{secret-picker-FZs_qkUu.js → secret-picker-B-IAzUKw.js} +1 -1
- package/dist/client/assets/{secrets-DQnlXKqx.js → secrets-BfsxO5FG.js} +1 -1
- package/dist/client/assets/sections-editor-BSMpRRaP.js +1 -0
- package/dist/client/assets/{select-CcGyx8ty.js → select-BSSRUEpK.js} +1 -1
- package/dist/client/assets/{select-model-BXKVjHOx.js → select-model-BpoA_wtD.js} +1 -1
- package/dist/client/assets/seo-editor-BLMg-jAb.js +1 -0
- package/dist/client/assets/{separator-CIgATGUR.js → separator-B-ZEExAQ.js} +1 -1
- package/dist/client/assets/settings-tab-Bjk0NW75.js +5 -0
- package/dist/client/assets/{sheet-HsqEW5k_.js → sheet--8zhfSHm.js} +1 -1
- package/dist/client/assets/shell-layout-DE5WStxe.js +1 -0
- package/dist/client/assets/skills-5oEukgyq.js +1 -0
- package/dist/client/assets/{sso-w-CGny8A.js → sso-p_1To1BG.js} +1 -1
- package/dist/client/assets/{suggestion-YJaAoX7G.js → suggestion-tikPUWB4.js} +1 -1
- package/dist/client/assets/{switch-BVaVIxoj.js → switch-XXcZ9CO9.js} +1 -1
- package/dist/client/assets/synced-repos-6N09TwCW.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-D7xp64UN.js → tab-icon-glyph-Cg30pNjq.js} +1 -1
- package/dist/client/assets/{table-C4wC7jcA.js → table-UDk1rGCz.js} +1 -1
- package/dist/client/assets/{tabs-CtBDwYTw.js → tabs-DddEqGpk.js} +1 -1
- package/dist/client/assets/{task-board-DTEg_hTj.js → task-board-BQC0qjBI.js} +1 -1
- package/dist/client/assets/task-route-BIVpLzI_.js +1 -0
- package/dist/client/assets/{task-status-yZrVtsEU.js → task-status-5qx4S30L.js} +1 -1
- package/dist/client/assets/taskboard-analytics-BUkhCXum.js +1 -0
- package/dist/client/assets/{tasks-Ay-mjiXF.js → tasks-B2IZJpCB.js} +2 -2
- package/dist/client/assets/tasks-JL_Q5QmF.js +1 -0
- package/dist/client/assets/{textarea-Bd9BZaa2.js → textarea-mkcrN5g-.js} +1 -1
- package/dist/client/assets/thread-analytics-BL_w94D4.js +1 -0
- package/dist/client/assets/thread-button-DwWAsFW7.js +1 -0
- package/dist/client/assets/{hooks-C-YaiNLT.js → thread-intent-1MB6k5b2.js} +6 -6
- package/dist/client/assets/thread-route-BCeXxLYH.js +1 -0
- package/dist/client/assets/{thread-route-BfqlgN7w.js → thread-route-CRhZ1osu.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C8gQ6cXL.js → thread-sheet-body-Bo7LPBv_.js} +1 -1
- package/dist/client/assets/{toggle-group-BgFCagKD.js → toggle-group-Cz7RSOBM.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CFttHyWN.js → toolbar-icon-button-CiJmHymh.js} +1 -1
- package/dist/client/assets/{tooltip-CGhrZMes.js → tooltip-CF6AcK-h.js} +1 -1
- package/dist/client/assets/{track-ZExbUuzl.js → track-OWWDrnQ-.js} +1 -1
- package/dist/client/assets/{types-pZX4k5UI.js → types-C-gwtfMH.js} +2 -2
- package/dist/client/assets/usage-stats-CBSbrOk_.js +1 -0
- package/dist/client/assets/{use-ai-providers-CFjUtZPr.js → use-ai-providers-B1JZFVlj.js} +1 -1
- package/dist/client/assets/{use-automations-C8WXPSJY.js → use-automations-D_9NQm3c.js} +1 -1
- package/dist/client/assets/{use-autosave-vgysQ9m_.js → use-autosave-DlgDe-Tc.js} +1 -1
- package/dist/client/assets/use-chat-layout-state-D4JUtDU_.js +1 -0
- package/dist/client/assets/use-connect-companion-DeEhFjbg.js +1 -0
- package/dist/client/assets/{use-connection-mxLfDMRW.js → use-connection-BSRKwy2j.js} +1 -1
- package/dist/client/assets/{use-copy-DUJ6ltm0.js → use-copy-BOgEqZMm.js} +1 -1
- package/dist/client/assets/use-create-virtual-mcp-zRgZOr46.js +1 -0
- package/dist/client/assets/{use-date-fns-locale-DyxqZQPj.js → use-date-fns-locale-DLQqaR-J.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DuPXl9wb.js → use-debounced-autosave-D_28bChm.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BUDe5Br2.js → use-debounced-value-DD9mnPT_.js} +1 -1
- package/dist/client/assets/{use-deco-credits-xeUqHdn1.js → use-deco-credits-BVTpTeQe.js} +1 -1
- package/dist/client/assets/use-decopilot-events-DrrVrYNR.js +1 -0
- package/dist/client/assets/{use-delete-connection-CATogPT_.js → use-delete-connection-XxANt-J1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BDkUFo0H.js → use-deployment-admin-2URfC53G.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DPJWXzMA.js → use-fast-preview-draft-url-DEazNknV.js} +1 -1
- package/dist/client/assets/{use-file-configs-CaiCm4YC.js → use-file-configs-CoaidzsY.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CaPw6C-5.js → use-infinite-scroll-BPqj-R_X.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dpz06WqH.js → use-join-requests-Drw7IeW0.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-qFkwsuao.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-CZ-0Pvu1.js +1 -0
- package/dist/client/assets/{use-mcp-client-Bax4L87A.js → use-mcp-client-DDH2Tr05.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DjwM3Aih.js → use-mcp-prompts-CogjK1bQ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CbB7jVMv.js → use-mcp-tools-B7MXLlq3.js} +1 -1
- package/dist/client/assets/{use-members-D9drExEq.js → use-members-BLvVhz4X.js} +1 -1
- package/dist/client/assets/{use-mobile-BkNVLn-e.js → use-mobile-BCSnRACa.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-DYNDpstL.js +1 -0
- package/dist/client/assets/use-new-blocks-editor-DGdBBbiW.js +1 -0
- package/dist/client/assets/{use-open-billing-url-YekIfrRD.js → use-open-billing-url-Dq7moyEm.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFMVTZYa.js → use-org-auth-client-BaoVl8Zl.js} +1 -1
- package/dist/client/assets/use-org-fs-gM-Wauv_.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-DFgGELdf.js +1 -0
- package/dist/client/assets/{use-org-sso-TEOX56yY.js → use-org-sso-GwZiS-qS.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C2hucAQ7.js → use-organization-roles-CqvDOd51.js} +1 -1
- package/dist/client/assets/{use-organization-settings-3QYUfCpW.js → use-organization-settings-mKOaKHuY.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-KvJ_j5rh.js → use-panel-navigate-CQHE_TAW.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-CjADt2wx.js +1 -0
- package/dist/client/assets/use-project-scope-UozAP0t-.js +1 -0
- package/dist/client/assets/use-releases-D-iqlxR6.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-B7R_a5Kv.js → use-reports-diagnostic-CknaDfb_.js} +1 -1
- package/dist/client/assets/{use-secrets-CNuvKS59.js → use-secrets-Bl8vA-cD.js} +1 -1
- package/dist/client/assets/use-section-preview-base-BqbdcWw1.js +1 -0
- package/dist/client/assets/use-session-runtime-B5XfJc8H.js +1 -0
- package/dist/client/assets/{use-tags-DSm1Zgi6.js → use-tags-C0g04rDb.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Bt0Ix7m9.js → use-task-board-analytics-DQMIr-R3.js} +1 -1
- package/dist/client/assets/use-task-metadata--2QUxhiK.js +1 -0
- package/dist/client/assets/use-thread-analytics-CVoZDp6i.js +1 -0
- package/dist/client/assets/{use-thread-outputs-C38ocjxH.js → use-thread-outputs-CYriWIIs.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-U12d5VJc.js +1 -0
- package/dist/client/assets/{useQueries-CLsJAj_M.js → useQueries-tUSXojRG.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B912YJiX.js +1 -0
- package/dist/client/assets/{users-Db27IK-5.js → users-DFvmfIoV.js} +1 -1
- package/dist/client/assets/{utils-CwpmExkA.js → utils-BaPwSBi2.js} +1 -1
- package/dist/client/assets/variant-calendar-sxqpD_Oi.js +1 -0
- package/dist/client/assets/{variant-matcher-override-szW3kzoV.js → variant-matcher-override-C-94qzoj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BBcGKlDx.js → view-mode-toggle-DrlZskFH.js} +1 -1
- package/dist/client/assets/{virtual-mcp-COzLXyrd.js → virtual-mcp-DBFF2brO.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AreaChart-C8Vo_8Ig.js +0 -1
- package/dist/client/assets/CartesianChart-l7Ajhkvs.js +0 -6
- package/dist/client/assets/Eye-DR1l_Pl4.js +0 -1
- package/dist/client/assets/Image01-DMj_7b2c.js +0 -1
- package/dist/client/assets/LayoutLeft-7YdGH3zt.js +0 -1
- package/dist/client/assets/Palette-CJ_H2Ji8.js +0 -1
- package/dist/client/assets/Share07-3t9nqqkD.js +0 -1
- package/dist/client/assets/Zap-D3wZltKp.js +0 -1
- package/dist/client/assets/agent-analytics-By50bpU5.js +0 -2
- package/dist/client/assets/agent-app-CcBru_Dc.js +0 -1
- package/dist/client/assets/agent-assets-CoBq8gk-.js +0 -1
- package/dist/client/assets/agent-automation-YwmQKN06.js +0 -20
- package/dist/client/assets/agent-automations-Cq5KP2f5.js +0 -1
- package/dist/client/assets/agent-connect-sources-DxRi8BCM.js +0 -1
- package/dist/client/assets/agent-deck-DVLEuDhA.js +0 -1
- package/dist/client/assets/agent-e2e-5IoZIrla.js +0 -1
- package/dist/client/assets/agent-experiments-Int37iX5.js +0 -1
- package/dist/client/assets/agent-file-Ch99Gr0p.js +0 -1
- package/dist/client/assets/agent-hosting-DELLHkBv.js +0 -1
- package/dist/client/assets/agent-icon-CJ1up34I.js +0 -1
- package/dist/client/assets/agent-library-file-CS1rjRRh.js +0 -1
- package/dist/client/assets/agent-monitor-Ciy1E_-Q.js +0 -1
- package/dist/client/assets/agent-overview-BC_RAnEB.js +0 -1
- package/dist/client/assets/agent-settings-DTx-4cAY.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DMrXO_8H.js +0 -2
- package/dist/client/assets/agent-view-CorDejXP.js +0 -1
- package/dist/client/assets/agents-list-CfDIHVDD.js +0 -1
- package/dist/client/assets/analytics-sections-C5_87xUx.js +0 -1
- package/dist/client/assets/api-keys-DmjbbAZ9.js +0 -1
- package/dist/client/assets/app-editor-Dk5jSXjv.js +0 -1
- package/dist/client/assets/auth-entry-BJ1WxKvH.js +0 -1
- package/dist/client/assets/automation-runs-CRr7g14c.js +0 -1
- package/dist/client/assets/automations-PMz-u3eU.js +0 -1
- package/dist/client/assets/badge-B8dizlCT.js +0 -1
- package/dist/client/assets/cards-ByVpaFgO.js +0 -8
- package/dist/client/assets/category-editor-BVzm0zUq.js +0 -1
- package/dist/client/assets/choose-editor-DwovNL0Y.js +0 -1
- package/dist/client/assets/collection-detail-Djse0DNa.js +0 -1
- package/dist/client/assets/command-DBqQ-b8W.js +0 -1
- package/dist/client/assets/config-9m7obEVv.js +0 -1
- package/dist/client/assets/connection-detail-CtFxBJog.js +0 -1
- package/dist/client/assets/connections-DYm-50T2.js +0 -1
- package/dist/client/assets/context-Cen00PJ2.js +0 -1
- package/dist/client/assets/discover-f-IlJYkY.js +0 -1
- package/dist/client/assets/download-app-dialog-CK-GvdAK.js +0 -1
- package/dist/client/assets/feature-gate-CEAThaDY.js +0 -1
- package/dist/client/assets/feature-paywall-DCqda5W4.js +0 -1
- package/dist/client/assets/file-explorer-IsG6Ynrb.js +0 -2
- package/dist/client/assets/file-preview-DkTtYjnK.js +0 -1
- package/dist/client/assets/file-share-button-BhqfoTyo.js +0 -3
- package/dist/client/assets/folder-icon-0KKPDvC_.js +0 -1
- package/dist/client/assets/format-time-BtXRrtv4.js +0 -1
- package/dist/client/assets/github-icon-BPkd3ouG.js +0 -1
- package/dist/client/assets/github-repo-B15wwZ1g.js +0 -1
- package/dist/client/assets/home-WT_7dde5.js +0 -1
- package/dist/client/assets/icon-button-C4M15Chh.js +0 -1
- package/dist/client/assets/index-B7QeXpyw.css +0 -1
- package/dist/client/assets/index-BlluJU8T.js +0 -1
- package/dist/client/assets/index-BvEM-dvH.js +0 -1
- package/dist/client/assets/index-CKALiP-j.js +0 -1
- package/dist/client/assets/infra-billing-IOD9NeWW.js +0 -1
- package/dist/client/assets/input-BM0pNmJR.js +0 -1
- package/dist/client/assets/legacy-main-redirect-Btysr0GK.js +0 -1
- package/dist/client/assets/library-BS4jnPds.js +0 -161
- package/dist/client/assets/location-oTTXFrSF.js +0 -1
- package/dist/client/assets/members-BkUMEbBZ.js +0 -1
- package/dist/client/assets/mock-board-CxZ6IfnT.js +0 -10
- package/dist/client/assets/monitoring-stats-row-B4HKQfEd.js +0 -1
- package/dist/client/assets/onboarding-C-Uu6LDz.js +0 -1
- package/dist/client/assets/optimistic-project-sidebar-views-QwaUX4Nu.js +0 -1
- package/dist/client/assets/plan-ladder-Io6vIIsL.js +0 -1
- package/dist/client/assets/post-calendar-DTivbJGd.js +0 -1
- package/dist/client/assets/post-editor-hRUF_q7o.js +0 -2
- package/dist/client/assets/preview-content-qYsw7P88.js +0 -1
- package/dist/client/assets/profile-DKiSx-md.js +0 -1
- package/dist/client/assets/project-app-view-BXbadkka.js +0 -1
- package/dist/client/assets/project-feed-CWlgSYJd.js +0 -1
- package/dist/client/assets/project-reports-D27FVZrO.js +0 -1
- package/dist/client/assets/project-tasks-BlwINbrD.js +0 -1
- package/dist/client/assets/record-editor-D0FEEilz.js +0 -1
- package/dist/client/assets/redirect-editor-8U0kYp-L.js +0 -1
- package/dist/client/assets/reports-SHBoIX6T.js +0 -1
- package/dist/client/assets/reports-onboarding-lz-YekBw.js +0 -1
- package/dist/client/assets/reports-tab-CQsFI9AI.js +0 -2
- package/dist/client/assets/repositories-B78A5I4U.js +0 -1
- package/dist/client/assets/repository-picker-DiXvXP64.js +0 -1
- package/dist/client/assets/require-capability-D3lYzq6i.js +0 -1
- package/dist/client/assets/resolve-tab-icon-H5U8-G1F.js +0 -1
- package/dist/client/assets/roles-BaCjCp-z.js +0 -1
- package/dist/client/assets/route-CkeTHcT5.js +0 -1
- package/dist/client/assets/route-D4LTJlBf.js +0 -1
- package/dist/client/assets/route-RUwqIRQf.js +0 -1
- package/dist/client/assets/route-page-header-BvgE0q5Z.js +0 -1
- package/dist/client/assets/search-toggle-Dllmt4oB.js +0 -1
- package/dist/client/assets/sections-editor-IVuj1qGO.js +0 -1
- package/dist/client/assets/seo-editor-DWMKmSd9.js +0 -1
- package/dist/client/assets/settings-tab-qIGPe64v.js +0 -5
- package/dist/client/assets/shell-layout-PsOcpnj-.js +0 -1
- package/dist/client/assets/skill-preview-DDuXNYxe.js +0 -1
- package/dist/client/assets/skills-C9zl4SYU.js +0 -1
- package/dist/client/assets/synced-repos-OeYTgI30.js +0 -1
- package/dist/client/assets/task-route-D8AxgdXG.js +0 -1
- package/dist/client/assets/taskboard-analytics-SldboJtr.js +0 -1
- package/dist/client/assets/tasks-B2JqGigR.js +0 -1
- package/dist/client/assets/thread-analytics-JrMutHmT.js +0 -1
- package/dist/client/assets/thread-button-CjEacYmJ.js +0 -1
- package/dist/client/assets/thread-intent-CNQdM8Ho.js +0 -1
- package/dist/client/assets/thread-route-CSSVlTLS.js +0 -1
- package/dist/client/assets/usage-stats-ClwItUaQ.js +0 -1
- package/dist/client/assets/use-chat-layout-state-Dr584zB8.js +0 -1
- package/dist/client/assets/use-connect-companion-Cgv0bZBV.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-ZvRac8CV.js +0 -1
- package/dist/client/assets/use-decopilot-events-Dy5N8Y9f.js +0 -1
- package/dist/client/assets/use-entitlements-CLVdcWhS.js +0 -1
- package/dist/client/assets/use-in-settings-Bi1UGPlh.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-D0Ib6HQf.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-DHVKLIQk.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-DWCyMlYN.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CCZwmfNr.js +0 -1
- package/dist/client/assets/use-org-fs-tnSIwx8e.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-CWXr40Pf.js +0 -1
- package/dist/client/assets/use-project-scope-DhGOPpT1.js +0 -1
- package/dist/client/assets/use-releases-DDoVPY5_.js +0 -1
- package/dist/client/assets/use-section-preview-base-VmECEpeP.js +0 -1
- package/dist/client/assets/use-session-runtime-CiLk98Je.js +0 -1
- package/dist/client/assets/use-task-metadata-DsWPSHLO.js +0 -1
- package/dist/client/assets/use-thread-analytics-CNx40-hY.js +0 -1
- package/dist/client/assets/use-virtual-mcp-C2m1pRHH.js +0 -1
- package/dist/client/assets/useInfiniteQuery-rQtGLM3y.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPJ-gshr.js +0 -1
- package/dist/client/assets/variant-calendar-ZscKzDf5.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as I,b as B,r as E,j as x,l as Z,X as Tt,m as vt,K as At,aN as Mt,h as Je,t as Re,B as Ct}from"./index-DUhG4tsR.js";import{a as St,E as fe,r as H,t as Rt,v as Et,w as Ye,x as j,y as Ee,z as $t,A as _t,B as $e,C as Lt,G as V,N as D,m as P,H as Y,T as et,R as ge,I as me,h as zt,J as It,K as Ht,L as Pt,O as jt,s as Nt,Q as Ot,S as Bt,u as Dt,b as qt,U as Ft}from"./index-B_6_b10B.js";import{a5 as Wt,a6 as Ut,a8 as Gt,C as Vt,a_ as Zt,aQ as Kt}from"./agent-icon-CJ1up34I.js";import{a as Qt,e as tt,s as Xt,S as Jt}from"./suggestion-YJaAoX7G.js";import{B as Yt,c as en,t as tn,C as nt,f as nn,g as _e,s as rn,m as Le,a as ze,b as sn,d as Ie,e as an,h as on,i as ln,j as cn,k as un,l as hn,n as dn}from"./index-DwGlegEL.js";import{i as pn}from"./XClose-CH7JGbnX.js";import{T as $,n as fn,i as gn}from"./rich-text-link-control-B4JFOCzI.js";import{i as mn}from"./Check-OcoBiXmm.js";import{i as kn}from"./Link01-CDLS3D8E.js";import{s as bn}from"./Trash01-5dU05cxX.js";import{n as xn}from"./Eye-DR1l_Pl4.js";import{i as wn}from"./ZoomOut-CE1oJlBX.js";import{i as rt}from"./X-C_n07v-r.js";import{m as yn,a as Tn}from"./markdown-Bc3TbOnL.js";import{A as vn}from"./avatar-foon9v7B.js";import{d as An,e as Mn,c as Cn,C as Sn,b as Rn}from"./command-DBqQ-b8W.js";import{g as En}from"./get-initials-D-f_fDFw.js";import{u as $n}from"./use-org-auth-client-BFMVTZYa.js";import{h as _n,b as Ln}from"./use-org-fs-tnSIwx8e.js";function zn(t){const e=I.c(30),{editor:n}=t,s=B(),[r,a]=E.useState(!1),[i,l]=E.useState(""),[o,c]=E.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const h=u;let d;e[2]!==n||e[3]!==r?(d=()=>{if(r){a(!1);return}const C=n.getAttributes("link").href;l(typeof C=="string"?C:""),c(!1),a(!0)},e[2]=n,e[3]=r,e[4]=d):d=e[4];const b=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=p):p=e[6];const k=p;let f;e[7]!==i||e[8]!==n||e[9]!==k?(f=()=>{const C=fn(i);if(C===""){k();return}if(!gn(C)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:C}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=k,e[10]=f):f=e[10];const g=f;let w;e[11]!==s?(w=s("markdownEditor.link"),e[11]=s,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==b?(T=x.jsx($,{active:h,label:w,onClick:b,children:y}),e[14]=h,e[15]=w,e[16]=b,e[17]=T):T=e[17];let m;e[18]!==h||e[19]!==g||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==k||e[25]!==s?(m=r&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||a(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:C=>{l(C.target.value),c(!1)},onKeyDown:C=>{C.key==="Enter"?(C.preventDefault(),g()):C.key==="Escape"&&(C.preventDefault(),a(!1),n.chain().focus().run())},className:Z("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx($,{active:!1,label:s("markdownEditor.linkApply"),onClick:g,children:x.jsx(mn,{size:14})}),h&&x.jsx($,{active:!1,label:s("markdownEditor.linkRemove"),onClick:k,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=g,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=k,e[25]=s,e[26]=m):m=e[26];let v;return e[27]!==T||e[28]!==m?(v=x.jsxs("div",{className:"relative",children:[T,m]}),e[27]=T,e[28]=m,e[29]=v):v=e[29],v}const ae=()=>{const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=I.c(2),{children:n}=t;let s;return e[0]!==n?(s=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},st=[1,2,3],In=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Hn(t){const e=I.c(20),{editor:n}=t,s=B(),[r,a]=E.useState(null);let i;e[0]!==n?(i={editor:n,selector:Pn},e[0]=n,e[1]=i):i=e[1];const l=St(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let c;e[4]!==s?(c=s("markdownEditor.heading2"),e[4]=s,e[5]=c):c=e[5];let u;e[6]!==s?(u=s("markdownEditor.heading3"),e[6]=s,e[7]=u):u=e[7];let h;e[8]!==o||e[9]!==c||e[10]!==u?(h={1:o,2:c,3:u},e[8]=o,e[9]=c,e[10]=u,e[11]=h):h=e[11];const d=h;let b;e[12]!==n||e[13]!==d||e[14]!==r||e[15]!==l||e[16]!==s?(b=r&&x.jsxs(Yt,{editor:n,shouldShow:In,appendTo:r,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[x.jsx($,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(Wt,{size:14})}),x.jsx($,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(Ut,{size:14})}),x.jsx($,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(Gt,{size:14})}),x.jsx($,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(Vt,{size:14})}),x.jsx(ae,{}),st.map((k,f)=>x.jsx($,{active:l.headings[f]??!1,label:d[k],onClick:()=>n.chain().focus().toggleHeading({level:k}).run(),children:x.jsx(He,{children:`H${k}`})},k)),x.jsx(ae,{}),x.jsx($,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(pn,{size:14})}),x.jsx($,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx($,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(Zt,{size:14})}),x.jsx(ae,{}),x.jsx(zn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=r,e[15]=l,e[16]=s,e[17]=b):b=e[17];let p;return e[18]!==b?(p=x.jsx("div",{ref:a,className:"relative z-20",children:b}),e[18]=b,e[19]=p):p=e[19],p}function Pn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:st.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=ke();function it(t){q=t}var N={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var jn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Nn=/^(?:[ \t]*(?:\n|$))+/,On=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,at=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ot=A(at).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qn=A(at).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fn=/^[^\n]+/,we=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wn=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",we).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Un=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,be).getRegex(),se="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ye=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gn=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ye).replace("tag",se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lt=A(xe).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex(),Vn=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lt).getRegex(),Te={blockquote:Vn,code:On,def:Wn,fences:Bn,heading:Dn,hr:K,html:Gn,lheading:ot,list:Un,newline:Nn,paragraph:lt,table:N,text:Fn},Pe=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex(),Zn={...Te,lheading:qn,table:Pe,paragraph:A(xe).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex()},Kn={...Te,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(xe).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",ot).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ct=/^( {2,}|\\)\n(?!\s*$)/,Jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
1
|
+
import{c as I,b as B,r as E,j as x,l as Z,X as Tt,m as vt,K as At,aO as Mt,h as Je,t as Re,B as St}from"./index-oPco2Z7Q.js";import{a as Ct,E as fe,r as H,t as Rt,v as Et,w as Ye,x as j,y as Ee,z as $t,A as _t,B as $e,C as Lt,G as V,N as D,m as P,H as Y,T as et,R as ge,I as me,h as zt,J as It,K as Ht,L as Pt,O as jt,s as Nt,Q as Ot,S as Bt,u as Dt,b as Ft,U as qt}from"./index-BBn8QmOY.js";import{a9 as Wt,aa as Ut,ac as Gt,F as Vt,b6 as Zt,aW as Kt}from"./agent-icon-BvDKYGuI.js";import{a as Qt,e as tt,s as Xt,S as Jt}from"./suggestion-tikPUWB4.js";import{B as Yt,c as en,t as tn,C as nt,f as nn,g as _e,s as rn,m as Le,a as ze,b as sn,d as Ie,e as an,h as on,i as ln,j as cn,k as un,l as hn,n as dn}from"./index-Cc_Zqhkn.js";import{i as pn}from"./XClose-DnZUIdlK.js";import{T as $,n as fn,i as gn}from"./rich-text-link-control-DHguSqou.js";import{i as mn}from"./Check-ClKm876e.js";import{i as kn}from"./Link01-cXYRJQde.js";import{s as bn}from"./Trash01-DUhLvzYZ.js";import{n as xn}from"./Image01-xbxm22_Y.js";import{b as wn}from"./ZoomOut-DvQpsf4w.js";import{i as rt}from"./X-BTpPaU7c.js";import{m as yn,a as Tn}from"./markdown-D8NZ8Hcx.js";import{A as vn}from"./avatar-JoRElFKl.js";import{f as An,C as Mn,c as Sn,a as Cn,b as Rn}from"./command-DljL6hzf.js";import{g as En}from"./get-initials-D-f_fDFw.js";import{u as $n}from"./use-org-auth-client-BaoVl8Zl.js";import{i as _n,b as Ln}from"./use-org-fs-gM-Wauv_.js";function zn(t){const e=I.c(30),{editor:n}=t,s=B(),[r,a]=E.useState(!1),[i,l]=E.useState(""),[o,c]=E.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const h=u;let d;e[2]!==n||e[3]!==r?(d=()=>{if(r){a(!1);return}const S=n.getAttributes("link").href;l(typeof S=="string"?S:""),c(!1),a(!0)},e[2]=n,e[3]=r,e[4]=d):d=e[4];const b=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=p):p=e[6];const k=p;let f;e[7]!==i||e[8]!==n||e[9]!==k?(f=()=>{const S=fn(i);if(S===""){k();return}if(!gn(S)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:S}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=k,e[10]=f):f=e[10];const g=f;let w;e[11]!==s?(w=s("markdownEditor.link"),e[11]=s,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==b?(T=x.jsx($,{active:h,label:w,onClick:b,children:y}),e[14]=h,e[15]=w,e[16]=b,e[17]=T):T=e[17];let m;e[18]!==h||e[19]!==g||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==k||e[25]!==s?(m=r&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:S=>{S.currentTarget.contains(S.relatedTarget)||a(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:S=>{l(S.target.value),c(!1)},onKeyDown:S=>{S.key==="Enter"?(S.preventDefault(),g()):S.key==="Escape"&&(S.preventDefault(),a(!1),n.chain().focus().run())},className:Z("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx($,{active:!1,label:s("markdownEditor.linkApply"),onClick:g,children:x.jsx(mn,{size:14})}),h&&x.jsx($,{active:!1,label:s("markdownEditor.linkRemove"),onClick:k,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=g,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=k,e[25]=s,e[26]=m):m=e[26];let v;return e[27]!==T||e[28]!==m?(v=x.jsxs("div",{className:"relative",children:[T,m]}),e[27]=T,e[28]=m,e[29]=v):v=e[29],v}const ae=()=>{const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=I.c(2),{children:n}=t;let s;return e[0]!==n?(s=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},st=[1,2,3],In=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Hn(t){const e=I.c(20),{editor:n}=t,s=B(),[r,a]=E.useState(null);let i;e[0]!==n?(i={editor:n,selector:Pn},e[0]=n,e[1]=i):i=e[1];const l=Ct(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let c;e[4]!==s?(c=s("markdownEditor.heading2"),e[4]=s,e[5]=c):c=e[5];let u;e[6]!==s?(u=s("markdownEditor.heading3"),e[6]=s,e[7]=u):u=e[7];let h;e[8]!==o||e[9]!==c||e[10]!==u?(h={1:o,2:c,3:u},e[8]=o,e[9]=c,e[10]=u,e[11]=h):h=e[11];const d=h;let b;e[12]!==n||e[13]!==d||e[14]!==r||e[15]!==l||e[16]!==s?(b=r&&x.jsxs(Yt,{editor:n,shouldShow:In,appendTo:r,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[x.jsx($,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(Wt,{size:14})}),x.jsx($,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(Ut,{size:14})}),x.jsx($,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(Gt,{size:14})}),x.jsx($,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(Vt,{size:14})}),x.jsx(ae,{}),st.map((k,f)=>x.jsx($,{active:l.headings[f]??!1,label:d[k],onClick:()=>n.chain().focus().toggleHeading({level:k}).run(),children:x.jsx(He,{children:`H${k}`})},k)),x.jsx(ae,{}),x.jsx($,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(pn,{size:14})}),x.jsx($,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx($,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(Zt,{size:14})}),x.jsx(ae,{}),x.jsx(zn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=r,e[15]=l,e[16]=s,e[17]=b):b=e[17];let p;return e[18]!==b?(p=x.jsx("div",{ref:a,className:"relative z-20",children:b}),e[18]=b,e[19]=p):p=e[19],p}function Pn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:st.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=ke();function it(t){F=t}var N={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var jn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Nn=/^(?:[ \t]*(?:\n|$))+/,On=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,at=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ot=A(at).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Fn=A(at).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qn=/^[^\n]+/,we=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wn=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",we).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Un=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,be).getRegex(),se="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ye=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gn=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ye).replace("tag",se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lt=A(xe).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex(),Vn=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lt).getRegex(),Te={blockquote:Vn,code:On,def:Wn,fences:Bn,heading:Dn,hr:K,html:Gn,lheading:ot,list:Un,newline:Nn,paragraph:lt,table:N,text:qn},Pe=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex(),Zn={...Te,lheading:Fn,table:Pe,paragraph:A(xe).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",se).getRegex()},Kn={...Te,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(xe).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",ot).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ct=/^( {2,}|\\)\n(?!\s*$)/,Jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q=/[\p{P}\p{S}]/u,ie=/[\s\p{P}\p{S}]/u,ve=/[^\s\p{P}\p{S}]/u,Yn=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ie).getRegex(),ut=/(?!~)[\p{P}\p{S}]/u,er=/(?!~)[\s\p{P}\p{S}]/u,tr=/(?:[^\s\p{P}\p{S}]|~)/u,nr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",jn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ht=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rr=A(ht,"u").replace(/punct/g,q).getRegex(),sr=A(ht,"u").replace(/punct/g,ut).getRegex(),dt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ir=A(dt,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ie).replace(/punct/g,q).getRegex(),ar=A(dt,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,er).replace(/punct/g,ut).getRegex(),or=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ie).replace(/punct/g,q).getRegex(),lr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,q).getRegex(),cr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ur=A(cr,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ie).replace(/punct/g,q).getRegex(),hr=A(/\\(punct)/,"gu").replace(/punct/g,q).getRegex(),dr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pr=A(ye).replace("(?:-->|$)","-->").getRegex(),fr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ee=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gr=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ee).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pt=A(/^!?\[(label)\]\[(ref)\]/).replace("label",ee).replace("ref",we).getRegex(),ft=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",we).getRegex(),mr=A("reflink|nolink(?!\\()","g").replace("reflink",pt).replace("nolink",ft).getRegex(),je=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ae={_backpedal:N,anyPunctuation:hr,autolink:dr,blockSkip:nr,br:ct,code:Xn,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:rr,emStrongRDelimAst:ir,emStrongRDelimUnd:or,escape:Qn,link:gr,nolink:ft,punctuation:Yn,reflink:pt,reflinkSearch:mr,tag:fr,text:Jn,url:N},kr={...Ae,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",ee).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee).getRegex()},le={...Ae,emStrongRDelimAst:ar,emStrongLDelim:sr,delLDelim:lr,delRDelim:ur,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",je).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",je).getRegex()},br={...le,br:A(ct).replace("{2,}","*").getRegex(),text:A(le.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Te,gfm:Zn,pedantic:Kn},W={normal:Ae,gfm:le,breaks:br,pedantic:kr},xr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ne=t=>xr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Ne)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Ne);return t}function Oe(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Be(t,e){let n=t.replace(R.findPipe,(a,i,l)=>{let o=!1,c=i;for(;--c>=0&&l[c]==="\\";)o=!o;return o?"|":" |"}),s=n.split(R.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(R.slashPipe,"|");return s}function U(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function wr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function yr(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=r,n++;return s}function De(t,e,n,s,r){let a=e.href,i=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function Tr(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
3
3
|
`).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=r.length?a.slice(r.length):a}).join(`
|
|
4
|
-
`)}var te=class{options;rules;lexer;constructor(t){this.options=t||
|
|
4
|
+
`)}var te=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
|
|
5
5
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Tr(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=U(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:U(e[0],`
|
|
6
6
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=U(e[0],`
|
|
7
7
|
`).split(`
|
|
@@ -23,7 +23,7 @@ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
23
23
|
`+d}b=!d.trim(),c+=m+`
|
|
24
24
|
`,t=t.substring(m.length+1),h=v.slice(p)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),r.raw+=c}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let o of r.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(o.raw);if(c){let u={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};o.checked=u.checked,r.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=u.raw+o.tokens[0].raw,o.tokens[0].text=u.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(u)):o.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):o.tokens.unshift(u)}}if(!r.loose){let c=o.tokens.filter(h=>h.type==="space"),u=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));r.loose=u}}if(r.loose)for(let o of r.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Be(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<n.length;i++)a.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:a.align[i]});for(let i of r)a.rows.push(Be(i,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=U(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=wr(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),De(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return De(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(s=c.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){l+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);let u=[...s[0]][0].length,h=t.slice(0,r+s.index+u+i);if(Math.min(r,i)%2){let b=h.slice(1,-1);return{type:"em",raw:h,text:b,tokens:this.lexer.inlineTokens(b)}}let d=h.slice(2,-2);return{type:"strong",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(s=o.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(i=[...a].length,i!==r))continue;if(s[3]||s[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let c=[...s[0]][0].length,u=t.slice(0,r+s.index+c+i),h=u.slice(r,-r);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},_=class ce{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=U(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=wr(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),De(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return De(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(s=c.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){l+=i;continue}else if((s[5]||s[6])&&r%3&&!((r+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);let u=[...s[0]][0].length,h=t.slice(0,r+s.index+u+i);if(Math.min(r,i)%2){let b=h.slice(1,-1);return{type:"em",raw:h,text:b,tokens:this.lexer.inlineTokens(b)}}let d=h.slice(2,-2);return{type:"strong",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,a,i,l=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(s=o.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(i=[...a].length,i!==r))continue;if(s[3]||s[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let c=[...s[0]][0].length,u=t.slice(0,r+s.index+c+i),h=u.slice(r,-r);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},_=class ce{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,this.options.tokenizer=this.options.tokenizer||new te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:R,block:Q.normal,inline:W.normal};this.options.pedantic?(n.block=Q.pedantic,n.inline=W.pedantic):this.options.gfm&&(n.block=Q.gfm,this.options.breaks?n.inline=W.breaks:n.inline=W.gfm),this.tokenizer.rules=n}static get rules(){return{block:Q,inline:W}}static lex(e,n){return new ce(n).lex(e)}static lexInline(e,n){return new ce(n).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(i=>(r=i.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let i=n.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
|
|
28
28
|
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
@@ -37,7 +37,7 @@ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
37
37
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let i=n.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+r.raw,i.text+=`
|
|
40
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=n.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(b=>{d=b.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),i=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):n.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},ne=class{options;parser;constructor(t){this.options=t||
|
|
40
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(r);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=n.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,s,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(b=>{d=b.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),i=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):n.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},ne=class{options;parser;constructor(t){this.options=t||F}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(R.notSpaceStart)?.[0],r=t.replace(R.endingNewline,"")+`
|
|
41
41
|
`;return s?'<pre><code class="language-'+z(s)+'">'+(n?r:z(r,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -55,15 +55,15 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
55
55
|
`}tablerow({text:t}){return`<tr>
|
|
56
56
|
${t}</tr>
|
|
57
57
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Oe(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+z(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Oe(t);if(r===null)return z(n);t=r;let a=`<img src="${t}" alt="${z(n)}"`;return e&&(a+=` title="${z(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Me=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},L=class ue{options;renderer;textRenderer;constructor(e){this.options=e||
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},O=new vr;function M(t,e){return O.parse(t,e)}M.options=M.setOptions=function(t){return O.setOptions(t),M.defaults=O.defaults,it(M.defaults),M};M.getDefaults=ke;M.defaults=
|
|
58
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Oe(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+z(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Oe(t);if(r===null)return z(n);t=r;let a=`<img src="${t}" alt="${z(n)}"`;return e&&(a+=` title="${z(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Me=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},L=class ue{options;renderer;textRenderer;constructor(e){this.options=e||F,this.options.renderer=this.options.renderer||new ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Me}static parse(e,n){return new ue(n).parse(e)}static parseInline(e,n){return new ue(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let i=r,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=l||"";continue}}let a=r;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=l||"";continue}}let i=a;switch(i.type){case"escape":{s+=n.text(i);break}case"html":{s+=n.html(i);break}case"link":{s+=n.link(i);break}case"image":{s+=n.image(i);break}case"checkbox":{s+=n.checkbox(i);break}case"strong":{s+=n.strong(i);break}case"em":{s+=n.em(i);break}case"codespan":{s+=n.codespan(i);break}case"br":{s+=n.br(i);break}case"del":{s+=n.del(i);break}case"text":{s+=n.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},G=class{options;block;constructor(t){this.options=t||F}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?_.lex:_.lexInline}provideParser(t=this.block){return t?L.parse:L.parseInline}},vr=class{defaults=ke();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=L;Renderer=ne;TextRenderer=Me;Lexer=_;Tokenizer=te;Hooks=G;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let i of a)n=n.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let i=r[a].flat(1/0);n=n.concat(this.walkTokens(i,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...i){let l=r.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new ne(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=n.renderer[i],o=r[i];r[i]=(...c)=>{let u=l.apply(r,c);return u===!1&&(u=o.apply(r,c)),u||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new te(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=n.tokenizer[i],o=r[i];r[i]=(...c)=>{let u=l.apply(r,c);return u===!1&&(u=o.apply(r,c)),u}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new G;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=n.hooks[i],o=r[i];G.passThroughHooks.has(a)?r[i]=c=>{if(this.defaults.async&&G.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await l.call(r,c);return o.call(r,h)})();let u=l.call(r,c);return o.call(r,u)}:r[i]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(r,c);return h===!1&&(h=await o.apply(r,c)),h})();let u=l.apply(r,c);return u===!1&&(u=o.apply(r,c)),u}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(i){let l=[];return l.push(a.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return _.lex(t,e??this.defaults)}parser(t,e){return L.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let i=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer(t):t?_.lex:_.lexInline)(i,r),o=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(t):t?L.parse:L.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let i=(r.hooks?r.hooks.provideLexer(t):t?_.lex:_.lexInline)(e,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(t):t?L.parse:L.parseInline)(i,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(i){return a(i)}}}onError(t,e){return n=>{if(n.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},O=new vr;function M(t,e){return O.parse(t,e)}M.options=M.setOptions=function(t){return O.setOptions(t),M.defaults=O.defaults,it(M.defaults),M};M.getDefaults=ke;M.defaults=F;M.use=function(...t){return O.use(...t),M.defaults=O.defaults,it(M.defaults),M};M.walkTokens=function(t,e){return O.walkTokens(t,e)};M.parseInline=O.parseInline;M.Parser=L;M.parser=L.parse;M.Renderer=ne;M.TextRenderer=Me;M.Lexer=_;M.lexer=_.lex;M.Tokenizer=te;M.Hooks=G;M.parse=M;M.options;M.setOptions;M.use;M.walkTokens;M.parseInline;L.parse;_.lex;const Ar=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function Mr(t){return t.flatMap((e,n)=>{var s;if(e.type==="space"||((s=t[n+1])===null||s===void 0?void 0:s.type)==="space")return[e];const r=(e.raw||"").match(Ar);return r?[{...e,raw:(e.raw||"").slice(0,-r[0].length)},{type:"space",raw:r[0]}]:[e]})}function Sr(t,e){const n=e.split(`
|
|
60
60
|
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
61
|
-
`);return n.slice(0,n.length-1)}function
|
|
61
|
+
`);return n.slice(0,n.length-1)}function Cr(t,e){const n=[];return Array.from(t.entries()).forEach(([s,r])=>{if(!e){n.push(s);return}(e.marks||[]).find(a=>a.type===s&&V(a.attrs,r.attrs))||n.push(s)}),n}function Rr(t,e){const n=[];return Array.from(e.entries()).forEach(([s,r])=>{const a=t.get(s);(!a||!V(a.attrs,r.attrs))&&n.push({type:s,mark:r})}),n}function Er(t,e,n,s){const r=!n,a=n&&(!n.marks||n.marks.length===0),i=n&&n.marks&&!s(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(r||a||i)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,c])=>{n.marks.find(u=>u.type===o&&V(u.attrs,c.attrs))||l.push(o)}):(r||a)&&l.push(...Array.from(t.keys()).reverse())),l}function $r(t,e){let n="";return Array.from(t.keys()).reverse().forEach(s=>{const r=e(s,t.get(s));r&&(n=r+n)}),t.clear(),n}function _r(t,e,n){let s="";return Array.from(t.entries()).forEach(([r,a])=>{const i=n(r,a);i&&(s+=i),e.set(r,a)}),s}function oe(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function X(t,e){return typeof t!="string"?"json":e}const Lr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),zr=/<\/?([a-zA-Z][\w-]*)/g;function Ir(t){const e=[];let n;for(;(n=zr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function Hr(t){const e=t.toLowerCase();return e.includes("-")?!1:!Lr.has(e)}function Pr(t,e){return Ir(t).some(n=>Hr(n)?!e.has(n):!1)}var Fe=class{constructor(t){var e,n,s,r,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t?.marked)!==null&&e!==void 0?e:M,this.indentStyle=(n=t==null||(s=t.indentation)===null||s===void 0?void 0:s.style)!==null&&n!==void 0?n:"space",this.indentSize=(r=t==null||(a=t.indentation)===null||a===void 0?void 0:a.size)!==null&&r!==void 0?r:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,Rt(Et(t.extensions)).forEach(i=>this.registerExtension(i)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,n;this.extensions.push(t);const s=Ye(j(t,"code")),r=t.name;s&&this.codeTypes.add(r),this.extensionRanks.has(r)||this.extensionRanks.set(r,this.extensionRanks.size);const a=j(t,"markdownTokenName")||r,i=j(t,"parseMarkdown"),l=j(t,"renderMarkdown"),o=j(t,"markdownTokenizer"),c=(e=j(t,"markdownOptions"))!==null&&e!==void 0?e:null,u={tokenName:a,nodeName:r,parseMarkdown:i,renderMarkdown:l,isIndenting:(n=c?.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:c?.htmlReopen,tokenizer:o};if(a&&i){const h=this.registry.get(a)||[];h.push(u),this.registry.set(a,h)}if(l){const h=this.nodeTypeRegistry.get(r)||[];h.push(u),this.nodeTypeRegistry.set(r,h)}o&&this.hasMarked()&&this.registerTokenizer(o)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:s="inline",tokenize:r}=t,a=this.createTokenizerHelpers.bind(this),i=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:c=>c.indexOf(n):l=c=>{const u=r(c,[],this.createTokenizerHelpers(this.createLexer()));return u&&u.raw?c.indexOf(u.raw):-1};const o={name:e,level:s,start:l,tokenizer(c,u){const h=this.lexer?a(this.lexer):a(i()),d=r(c,u,h);if(d&&d.type)return{...d,type:d.type||e,raw:d.raw||"",tokens:d.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[o]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const s=n.lex(t);return{type:"doc",content:this.parseTokens(s,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const n=e?Mr(t):t,s=n.reduce((i,l,o)=>(l.type!=="space"&&i.push(o),i),[]);let r=-1,a=0;return n.flatMap((i,l)=>{for(;a<s.length&&s[a]<l;)r=s[a],a+=1;if(e&&i.type==="space"){var o;const u=(o=s[a])!==null&&o!==void 0?o:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,u)}const c=this.parseToken(i,e);return c===null?[]:Array.isArray(c)?c:[c]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const s=this.countParagraphSeparators(t.raw||"");if(s===0)return[];const r=Math.max(s-(e===-1||n===-1?0:1),0);return Array.from({length:r},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
|
|
62
62
|
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),s=this.createParseHelpers();if(n.find(r=>{if(!r.parseMarkdown)return!1;const a=r.parseMarkdown(t,s),i=this.normalizeParseResult(a);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>oe(l).isTask),n=t.items.some(l=>!oe(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const s=[];let r=[],a=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:c,checked:u,indentLevel:h}=oe(o);let d=o;if(c){const p=(o.raw||o.text||"").split(`
|
|
63
63
|
`),k=p[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),f=k?k[2]:"";let g=[];if(p.length>1&&p.slice(1).join(`
|
|
64
64
|
`).trim()){const w=p.slice(1),y=w.filter(T=>T.trim());if(y.length>0){const T=Math.min(...y.map(v=>v.length-v.trimStart().length)),m=w.map(v=>v.trim()?v.slice(T):"").join(`
|
|
65
65
|
`).trim();m&&(g=this.markedInstance.lexer(`${m}
|
|
66
|
-
`))}}d={type:"taskItem",raw:"",mainContent:f,indentLevel:h,checked:u??!1,text:f,tokens:this.tokenizeInline(f),nestedTokens:g}}const b=c?"taskList":"list";a!==b?(r.length>0&&s.push({type:a,items:r}),r=[d],a=b):r.push(d)}r.length>0&&s.push({type:a,items:r});const i=[];for(let l=0;l<s.length;l+=1){const o=s[l],c={...t,type:o.type,items:o.items},u=this.parseToken(c);u&&(Array.isArray(u)?i.push(...u):i.push(u))}return i.length>0?i:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const r=s.parseMarkdown(t,n),a=this.normalizeParseResult(r);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const s={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete s.attrs,s},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let i=0;i<t.length;i+=1){const l=t[i];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,s;const o=((n=(s=l.raw)!==null&&s!==void 0?s:l.text)!==null&&n!==void 0?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(o),u=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(o)){const d=u[1],b=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${b}\\b`,"i");let k=-1;const f=[o];for(let g=i+1;g<t.length;g+=1){var r,a;const w=t[g],y=((r=(a=w.raw)!==null&&a!==void 0?a:w.text)!==null&&r!==void 0?r:"").toString();if(f.push(y),w.type==="html"&&p.test(y)){k=g;break}}if(k!==-1){const g=f.join(""),w={type:"html",raw:g,text:g,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}i=k;continue}}const h=this.parseHTMLToken(l);if(h){const d=this.normalizeParseResult(h);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const c=this.createParseHelpers(),u=o.parseMarkdown(l,c);if(this.isMarkResult(u)){const h=this.applyMarkToContent(u.mark,u.content,u.attrs);e.push(...h)}else{const h=this.normalizeParseResult(u);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let i=e.length-1;i>0;i-=1){const l=e[i],o=e[i-1];if(l.type==="text"&&o.type==="text"){const c=l.marks||[],u=o.marks||[];$t(c,u)&&(o.text=(o.text||"")+(l.text||""),e.splice(i,1))}}return e}applyMarkToContent(t,e,n){return e.map(s=>{if(s.type==="text"){const r=s.marks||[],a=n?{type:t,attrs:n}:{type:t};return{...s,marks:[...r,a]}}return{...s,content:s.content?this.applyMarkToContent(t,s.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=_t(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const s=this.toInlineContent(n.content);return s.length>0?s:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Pr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=s=>{const r=s?.parseDOM;Array.isArray(r)&&r.forEach(a=>{if(typeof a?.tag=="string"){const i=a.tag.match(/^[a-zA-Z][\w-]*/);i&&t.add(i[0].toLowerCase())}})};Object.values(e.nodes).forEach(s=>n(s.spec)),Object.values(e.marks).forEach(s=>n(s.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(s=>this.codeTypes.has(typeof s=="string"?s:s.type))?t:this.escapeMarkdownSyntax(Lt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,s=0,r={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const i=this.getHandlerForToken(t.type);if(!i)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(u,h)=>{const d=i.isIndenting?s+1:s;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,d):this.renderNodes(u,t,h||"",n,d)},renderChild:(u,h)=>{const d=i.isIndenting?s+1:s;return this.renderNodeToMarkdown(u,t,h,d)},indent:u=>this.indentString+u,wrapInBlock:Cr},c={index:n,level:s,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...r}};return((a=i.renderMarkdown)===null||a===void 0?void 0:a.call(i,t,o,c))||""}renderNodes(t,e,n="",s=0,r=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,r):t.type?this.renderNodeToMarkdown(t,e,s,r):""}renderNodesWithMarkBoundaries(t,e,n="",s=0){const r=[],a=new Map,i=new Set,l=new Map;return t.forEach((o,c)=>{const u=c<t.length-1?t[c+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(m=>[m.type,m])),b=this.getMarksToOpenForSerialization(a,d,u),p=Sr(d,u),k=p.filter(m=>a.has(m)),f=k.length>0&&b.length>0;let g="";if(p.length>0&&!f){const m=h.match(/(\s+)$/);m&&(g=m[1],h=h.slice(0,-g.length))}f||p.slice().reverse().forEach(m=>{if(!a.has(m))return;const v=d.get(m),C=this.getMarkClosing(m,v,l.get(m));C&&(h+=C),a.has(m)&&(a.delete(m),l.delete(m))});let w="";if(b.length>0){const m=h.match(/^(\s+)/);m&&(w=m[1],h=h.slice(w.length))}b.forEach(({type:m,mark:v})=>{const C=i.has(m)?"html":"markdown",S=this.getMarkOpening(m,v,C);S&&(h=S+h),l.set(m,C),i.delete(m)}),f||b.slice().reverse().forEach(({type:m,mark:v})=>{a.set(m,v)}),h=w+h;let y;if(f){const m=new Set((u?.marks||[]).map(S=>S.type));b.forEach(({type:S})=>{m.has(S)&&this.getHtmlReopenTags(S)&&i.add(S)});const v=Array.from(a.keys()),C=k.slice().sort((S,yt)=>v.indexOf(yt)-v.indexOf(S));y=[...b.map(S=>S.type),...C]}else y=Er(a,d,u,this.markSetsEqual.bind(this));let T="";if(y.length>0){const m=h.match(/(\s+)$/);m&&(T=m[1],h=h.slice(0,-T.length))}y.forEach(m=>{var v;const C=(v=a.get(m))!==null&&v!==void 0?v:d.get(m),S=this.getMarkClosing(m,C,l.get(m));S&&(h+=S),a.delete(m),l.delete(m)}),h+=T,h+=g,r.push(h)}else{const h=new Set((o.marks||[]).map(g=>g.type)),d=new Map,b=new Map;a.forEach((g,w)=>{if(h.has(w)){var y;d.set(w,g),b.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=$r(a,(g,w)=>this.getMarkClosing(g,w,l.get(g)));l.clear();const k=this.renderNodeToMarkdown(o,e,c,s),f=o.type==="hardBreak"?"":_r(d,a,(g,w)=>{var y;const T=(y=b.get(g))!==null&&y!==void 0?y:"markdown";return l.set(g,T),this.getMarkOpening(g,w,T)});r.push(p+k+f)}}),r.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.open)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:u=>u,wrapInBlock:(u,h)=>u+h},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(i);return c>=0?o.substring(0,c):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.close)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(i),u=c+33;return c>=0?o.substring(u):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,s])=>{const r=e.get(n);return r&&V(s.attrs,r.attrs)})}getMarksToOpenForSerialization(t,e,n){const s=Rr(t,e);if(s.length<=1)return s;const r=n?.marks||[],a=(c,u)=>r.some(h=>h.type===c&&V(h.attrs,u)),i=(c,u)=>{var h,d;const b=(h=this.extensionRanks.get(c.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return b!==p?p-b:c.type.localeCompare(u.type)},l=s.filter(c=>!a(c.type,c.mark.attrs)).sort(i),o=s.filter(c=>a(c.type,c.mark.attrs)).sort(i);return[...l,...o]}};const jr=fe.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return H.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return H.setContent(t,e);const n=this.editor.markdown.parse(t);return H.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return H.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return H.insertContent(t,e);const n=this.editor.markdown.parse(t);return H.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return H.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return H.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return H.insertContentAt(t,s,n)}}},addStorage(){return{manager:new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function re(t){return t==="left"||t==="right"||t==="center"?t:null}function Nr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return re(e||n)}function Or(t){return re(t?.align)}function gt(){return{default:null,parseHTML:t=>Nr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function Br(t){var e;const n=t.parentElement,s=t.closest("table");if(!n||!s)return null;const r=Array.from(n.children).indexOf(t),a=(e=s.querySelectorAll("colgroup > col")[r])===null||e===void 0?void 0:e.getAttribute("width");return a?[parseInt(a,10)]:null}function mt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):Br(t)}const Dr=/[ \t\r\n\f]+/g;function kt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(Dr,"")===""}function bt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const qr=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:mt},align:gt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>kt(t)?{}:!1,getContent:(t,e)=>bt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",P(this.options.HTMLAttributes,t),0]}}),Fr=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:mt},align:gt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>kt(t)?{}:!1,getContent:(t,e)=>bt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",P(this.options.HTMLAttributes,t),0]}}),Wr=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",P(this.options.HTMLAttributes,t),0]}});function he(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Fe(t,e,n,s,r,a){let i=0,l=!0,o=e.firstChild;const c=t.firstChild;if(c!==null)for(let d=0,b=0;d<c.childCount;d+=1){const{colspan:p,colwidth:k}=c.child(d).attrs;for(let f=0;f<p;f+=1,b+=1){const g=r===b?a:k&&k[f],w=g?`${g}px`:"";if(i+=g||s,g||(l=!1),o){if(o.style.width!==w){const[y,T]=he(s,g);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,m]=he(s,g);y.style.setProperty(T,m),e.appendChild(y)}}}for(;o;){var u;const d=o.nextSibling;(u=o.parentNode)===null||u===void 0||u.removeChild(o),o=d}const h=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!h?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}var Ur=class{constructor(t,e,n,s={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[r,a]of Object.entries(s))a!=null&&(r==="style"?this.table.style.cssText=String(a):this.table.setAttribute(r,String(a)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Fe(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,Fe(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),s=this.contentDOM.contains(e);return!!(n&&!s&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function Gr(t,e,n,s){let r=0,a=!0;const i=[],l=t.firstChild;if(!l)return{};for(let u=0,h=0;u<l.childCount;u+=1){const{colspan:d,colwidth:b}=l.child(u).attrs;for(let p=0;p<d;p+=1,h+=1){const k=n===h?s:b&&b[p];r+=k||e,k||(a=!1);const[f,g]=he(e,k);i.push(["col",{style:`${f}: ${g}`}])}}const o=a?`${r}px`:"",c=a?"":`${r}px`;return{colgroup:["colgroup",{},...i],tableWidth:o,tableMinWidth:c}}function We(t,e){return t.createAndFill()}function Vr(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const s=t.nodes[n];s.spec.tableRole&&(e[s.spec.tableRole]=s)}),t.cached.tableNodeTypes=e,e}function Zr(t,e,n,s,r){const a=Vr(t),i=[],l=[];for(let c=0;c<n;c+=1){const u=We(a.cell);if(u&&l.push(u),s){const h=We(a.header_cell);h&&i.push(h)}}const o=[];for(let c=0;c<e;c+=1)o.push(a.row.createChecked(null,s&&c===0?i:l));return a.table.createChecked(null,o)}function Kr(t){return t instanceof nt}const J=({editor:t})=>{const{selection:e}=t.state;if(!Kr(e))return!1;let n=0;const s=Y(e.ranges[0].$from,r=>r.type.name==="table");return s?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ue(t,e){const n=t.mapping.map(e),s=Y(t.selection.$from,i=>i.type.name==="table");if(s?.pos===n)return;const r=t.doc.nodeAt(n);if(!r)return;const a=n+r.nodeSize-1;t.setSelection(et.near(t.doc.resolve(a),-1))}function Qr(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let s=0;for(;n+s<t.length&&t[n+s]==="`";)s+=1;let r=n+s,a=!1;for(;r<t.length;){if(t[r]!=="`"){r+=1;continue}let i=0;for(;r+i<t.length&&t[r+i]==="`";)i+=1;if(i===s){const l=t.slice(n+s,r);e+=t.slice(n,n+s)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(r,r+s),n=r+s,a=!0;break}r+=i}a||(e+=t.slice(n,n+s),n+=s)}return e}function Xr(t){return t.split(`
|
|
66
|
+
`))}}d={type:"taskItem",raw:"",mainContent:f,indentLevel:h,checked:u??!1,text:f,tokens:this.tokenizeInline(f),nestedTokens:g}}const b=c?"taskList":"list";a!==b?(r.length>0&&s.push({type:a,items:r}),r=[d],a=b):r.push(d)}r.length>0&&s.push({type:a,items:r});const i=[];for(let l=0;l<s.length;l+=1){const o=s[l],c={...t,type:o.type,items:o.items},u=this.parseToken(c);u&&(Array.isArray(u)?i.push(...u):i.push(u))}return i.length>0?i:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const r=s.parseMarkdown(t,n),a=this.normalizeParseResult(r);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const s={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete s.attrs,s},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let i=0;i<t.length;i+=1){const l=t[i];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,s;const o=((n=(s=l.raw)!==null&&s!==void 0?s:l.text)!==null&&n!==void 0?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(o),u=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(o)){const d=u[1],b=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${b}\\b`,"i");let k=-1;const f=[o];for(let g=i+1;g<t.length;g+=1){var r,a;const w=t[g],y=((r=(a=w.raw)!==null&&a!==void 0?a:w.text)!==null&&r!==void 0?r:"").toString();if(f.push(y),w.type==="html"&&p.test(y)){k=g;break}}if(k!==-1){const g=f.join(""),w={type:"html",raw:g,text:g,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}i=k;continue}}const h=this.parseHTMLToken(l);if(h){const d=this.normalizeParseResult(h);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const c=this.createParseHelpers(),u=o.parseMarkdown(l,c);if(this.isMarkResult(u)){const h=this.applyMarkToContent(u.mark,u.content,u.attrs);e.push(...h)}else{const h=this.normalizeParseResult(u);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let i=e.length-1;i>0;i-=1){const l=e[i],o=e[i-1];if(l.type==="text"&&o.type==="text"){const c=l.marks||[],u=o.marks||[];$t(c,u)&&(o.text=(o.text||"")+(l.text||""),e.splice(i,1))}}return e}applyMarkToContent(t,e,n){return e.map(s=>{if(s.type==="text"){const r=s.marks||[],a=n?{type:t,attrs:n}:{type:t};return{...s,marks:[...r,a]}}return{...s,content:s.content?this.applyMarkToContent(t,s.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=_t(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const s=this.toInlineContent(n.content);return s.length>0?s:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Pr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=s=>{const r=s?.parseDOM;Array.isArray(r)&&r.forEach(a=>{if(typeof a?.tag=="string"){const i=a.tag.match(/^[a-zA-Z][\w-]*/);i&&t.add(i[0].toLowerCase())}})};Object.values(e.nodes).forEach(s=>n(s.spec)),Object.values(e.marks).forEach(s=>n(s.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(s=>this.codeTypes.has(typeof s=="string"?s:s.type))?t:this.escapeMarkdownSyntax(Lt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,s=0,r={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const i=this.getHandlerForToken(t.type);if(!i)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(u,h)=>{const d=i.isIndenting?s+1:s;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,d):this.renderNodes(u,t,h||"",n,d)},renderChild:(u,h)=>{const d=i.isIndenting?s+1:s;return this.renderNodeToMarkdown(u,t,h,d)},indent:u=>this.indentString+u,wrapInBlock:Sr},c={index:n,level:s,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...r}};return((a=i.renderMarkdown)===null||a===void 0?void 0:a.call(i,t,o,c))||""}renderNodes(t,e,n="",s=0,r=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,r):t.type?this.renderNodeToMarkdown(t,e,s,r):""}renderNodesWithMarkBoundaries(t,e,n="",s=0){const r=[],a=new Map,i=new Set,l=new Map;return t.forEach((o,c)=>{const u=c<t.length-1?t[c+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(m=>[m.type,m])),b=this.getMarksToOpenForSerialization(a,d,u),p=Cr(d,u),k=p.filter(m=>a.has(m)),f=k.length>0&&b.length>0;let g="";if(p.length>0&&!f){const m=h.match(/(\s+)$/);m&&(g=m[1],h=h.slice(0,-g.length))}f||p.slice().reverse().forEach(m=>{if(!a.has(m))return;const v=d.get(m),S=this.getMarkClosing(m,v,l.get(m));S&&(h+=S),a.has(m)&&(a.delete(m),l.delete(m))});let w="";if(b.length>0){const m=h.match(/^(\s+)/);m&&(w=m[1],h=h.slice(w.length))}b.forEach(({type:m,mark:v})=>{const S=i.has(m)?"html":"markdown",C=this.getMarkOpening(m,v,S);C&&(h=C+h),l.set(m,S),i.delete(m)}),f||b.slice().reverse().forEach(({type:m,mark:v})=>{a.set(m,v)}),h=w+h;let y;if(f){const m=new Set((u?.marks||[]).map(C=>C.type));b.forEach(({type:C})=>{m.has(C)&&this.getHtmlReopenTags(C)&&i.add(C)});const v=Array.from(a.keys()),S=k.slice().sort((C,yt)=>v.indexOf(yt)-v.indexOf(C));y=[...b.map(C=>C.type),...S]}else y=Er(a,d,u,this.markSetsEqual.bind(this));let T="";if(y.length>0){const m=h.match(/(\s+)$/);m&&(T=m[1],h=h.slice(0,-T.length))}y.forEach(m=>{var v;const S=(v=a.get(m))!==null&&v!==void 0?v:d.get(m),C=this.getMarkClosing(m,S,l.get(m));C&&(h+=C),a.delete(m),l.delete(m)}),h+=T,h+=g,r.push(h)}else{const h=new Set((o.marks||[]).map(g=>g.type)),d=new Map,b=new Map;a.forEach((g,w)=>{if(h.has(w)){var y;d.set(w,g),b.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=$r(a,(g,w)=>this.getMarkClosing(g,w,l.get(g)));l.clear();const k=this.renderNodeToMarkdown(o,e,c,s),f=o.type==="hardBreak"?"":_r(d,a,(g,w)=>{var y;const T=(y=b.get(g))!==null&&y!==void 0?y:"markdown";return l.set(g,T),this.getMarkOpening(g,w,T)});r.push(p+k+f)}}),r.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.open)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:u=>u,wrapInBlock:(u,h)=>u+h},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(i);return c>=0?o.substring(0,c):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.close)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(i),u=c+33;return c>=0?o.substring(u):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,s])=>{const r=e.get(n);return r&&V(s.attrs,r.attrs)})}getMarksToOpenForSerialization(t,e,n){const s=Rr(t,e);if(s.length<=1)return s;const r=n?.marks||[],a=(c,u)=>r.some(h=>h.type===c&&V(h.attrs,u)),i=(c,u)=>{var h,d;const b=(h=this.extensionRanks.get(c.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return b!==p?p-b:c.type.localeCompare(u.type)},l=s.filter(c=>!a(c.type,c.mark.attrs)).sort(i),o=s.filter(c=>a(c.type,c.mark.attrs)).sort(i);return[...l,...o]}};const jr=fe.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return H.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return H.setContent(t,e);const n=this.editor.markdown.parse(t);return H.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return H.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return H.insertContent(t,e);const n=this.editor.markdown.parse(t);return H.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return H.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return H.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return H.insertContentAt(t,s,n)}}},addStorage(){return{manager:new Fe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new Fe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function re(t){return t==="left"||t==="right"||t==="center"?t:null}function Nr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return re(e||n)}function Or(t){return re(t?.align)}function gt(){return{default:null,parseHTML:t=>Nr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function Br(t){var e;const n=t.parentElement,s=t.closest("table");if(!n||!s)return null;const r=Array.from(n.children).indexOf(t),a=(e=s.querySelectorAll("colgroup > col")[r])===null||e===void 0?void 0:e.getAttribute("width");return a?[parseInt(a,10)]:null}function mt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):Br(t)}const Dr=/[ \t\r\n\f]+/g;function kt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(Dr,"")===""}function bt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const Fr=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:mt},align:gt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>kt(t)?{}:!1,getContent:(t,e)=>bt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",P(this.options.HTMLAttributes,t),0]}}),qr=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:mt},align:gt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>kt(t)?{}:!1,getContent:(t,e)=>bt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",P(this.options.HTMLAttributes,t),0]}}),Wr=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",P(this.options.HTMLAttributes,t),0]}});function he(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function qe(t,e,n,s,r,a){let i=0,l=!0,o=e.firstChild;const c=t.firstChild;if(c!==null)for(let d=0,b=0;d<c.childCount;d+=1){const{colspan:p,colwidth:k}=c.child(d).attrs;for(let f=0;f<p;f+=1,b+=1){const g=r===b?a:k&&k[f],w=g?`${g}px`:"";if(i+=g||s,g||(l=!1),o){if(o.style.width!==w){const[y,T]=he(s,g);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,m]=he(s,g);y.style.setProperty(T,m),e.appendChild(y)}}}for(;o;){var u;const d=o.nextSibling;(u=o.parentNode)===null||u===void 0||u.removeChild(o),o=d}const h=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!h?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}var Ur=class{constructor(t,e,n,s={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[r,a]of Object.entries(s))a!=null&&(r==="style"?this.table.style.cssText=String(a):this.table.setAttribute(r,String(a)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qe(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,qe(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),s=this.contentDOM.contains(e);return!!(n&&!s&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function Gr(t,e,n,s){let r=0,a=!0;const i=[],l=t.firstChild;if(!l)return{};for(let u=0,h=0;u<l.childCount;u+=1){const{colspan:d,colwidth:b}=l.child(u).attrs;for(let p=0;p<d;p+=1,h+=1){const k=n===h?s:b&&b[p];r+=k||e,k||(a=!1);const[f,g]=he(e,k);i.push(["col",{style:`${f}: ${g}`}])}}const o=a?`${r}px`:"",c=a?"":`${r}px`;return{colgroup:["colgroup",{},...i],tableWidth:o,tableMinWidth:c}}function We(t,e){return t.createAndFill()}function Vr(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const s=t.nodes[n];s.spec.tableRole&&(e[s.spec.tableRole]=s)}),t.cached.tableNodeTypes=e,e}function Zr(t,e,n,s,r){const a=Vr(t),i=[],l=[];for(let c=0;c<n;c+=1){const u=We(a.cell);if(u&&l.push(u),s){const h=We(a.header_cell);h&&i.push(h)}}const o=[];for(let c=0;c<e;c+=1)o.push(a.row.createChecked(null,s&&c===0?i:l));return a.table.createChecked(null,o)}function Kr(t){return t instanceof nt}const J=({editor:t})=>{const{selection:e}=t.state;if(!Kr(e))return!1;let n=0;const s=Y(e.ranges[0].$from,r=>r.type.name==="table");return s?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ue(t,e){const n=t.mapping.map(e),s=Y(t.selection.$from,i=>i.type.name==="table");if(s?.pos===n)return;const r=t.doc.nodeAt(n);if(!r)return;const a=n+r.nodeSize-1;t.setSelection(et.near(t.doc.resolve(a),-1))}function Qr(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let s=0;for(;n+s<t.length&&t[n+s]==="`";)s+=1;let r=n+s,a=!1;for(;r<t.length;){if(t[r]!=="`"){r+=1;continue}let i=0;for(;r+i<t.length&&t[r+i]==="`";)i+=1;if(i===s){const l=t.slice(n+s,r);e+=t.slice(n,n+s)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(r,r+s),n=r+s,a=!0;break}r+=i}a||(e+=t.slice(n,n+s),n+=s)}return e}function Xr(t){return t.split(`
|
|
67
67
|
`).map(e=>!e.includes("|")||!e.includes("`")?e:Qr(e)).join(`
|
|
68
68
|
`)}function Jr(t){return(t||"").replace(/\s+/g," ").trim()}function Yr(t,e,n={}){var s;const r=(s=n.cellLineSeparator)!==null&&s!==void 0?s:"";if(!t||!t.content||t.content.length===0)return"";const a=[];t.content.forEach(p=>{const k=[];p.content&&p.content.forEach(f=>{let g="";f.content&&Array.isArray(f.content)&&f.content.length>1?g=f.content.map(m=>e.renderChildren(m)).join(r):g=f.content?e.renderChildren(f.content):"";const w=Jr(g.split(r).join(`
|
|
69
69
|
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=f.type==="tableHeader",T=Or(f.attrs);k.push({text:w,isHeader:y,align:T})}),a.push(k)});const i=a.reduce((p,k)=>Math.max(p,k.length),0);if(i===0)return"";const l=Array.from({length:i}).fill(0);a.forEach(p=>{for(let f=0;f<i;f+=1){var k;const g=(((k=p[f])===null||k===void 0?void 0:k.text)||"").length;g>l[f]&&(l[f]=g),l[f]<3&&(l[f]=3)}});const o=(p,k)=>p+" ".repeat(Math.max(0,k-p.length)),c=a[0],u=c.some(p=>p.isHeader),h=Array.from({length:i}).fill(null);a.forEach(p=>{for(let f=0;f<i;f+=1){var k;!h[f]&&(!((k=p[f])===null||k===void 0)&&k.align)&&(h[f]=p[f].align)}});let d=`
|
|
@@ -77,7 +77,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
77
77
|
`);if(a.length<2)return;const i=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(i)||!i.includes("|"))return;const l=Xr(r);if(l===r)return;const o=n.blockTokens(l)[0];if(o?.type!=="table"||!o.raw)return;const c=o.raw.split(`
|
|
78
78
|
`).length,u=t.split(`
|
|
79
79
|
`).slice(0,c).join(`
|
|
80
|
-
`);return{...o,raw:u}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:s,dispatch:r,editor:a})=>{const i=Zr(a.schema,t,e,n);if(r){const l=s.selection.from+1;s.replaceSelectionWith(i).scrollIntoView().setSelection(et.near(s.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>dn(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hn(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,s=>s.type.name==="table");return un(t,e&&(s=>{n&&Ue(s,n.pos),e(s)}))},addRowBefore:()=>({state:t,dispatch:e})=>cn(t,e),addRowAfter:()=>({state:t,dispatch:e})=>ln(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,s=>s.type.name==="table");return on(t,e&&(s=>{n&&Ue(s,n.pos),e(s)}))},deleteTable:()=>({state:t,dispatch:e})=>an(t,e),mergeCells:()=>({state:t,dispatch:e})=>Le(t,e),splitCell:()=>({state:t,dispatch:e})=>ze(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ie("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ie("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>sn(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Le(t,e)?!0:ze(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:s})=>rn(t,e)(n,s),goToNextCell:()=>({state:t,dispatch:e})=>_e(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>_e(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&nn(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const s=nt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(s)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:J,"Mod-Backspace":J,Delete:J,"Mod-Delete":J}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[en({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],tn({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:s,HTMLAttributes:r})=>{const a=P(this.options.HTMLAttributes,r);return new e(n,this.options.cellMinWidth,s,a)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Ye(j(t,"tableRole",e))}}}),ts=fe.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(es.configure(this.options.table)),this.options.tableCell!==!1&&t.push(
|
|
81
|
-
`],allow:({state:n,range:s})=>{const r=t.dismissal;return r?s.from===r.from&&ms(n.doc,r.from,r.text.length)===r.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(xt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Qt(e)]}})}const Ze=256,bs=40,Ke=280,xs=140;function ws(t){const e=I.c(4),{store:n}=t,s=E.useSyncExternalStore(n.subscribe,n.getSnapshot),r=s.range!==null;let a;return e[0]!==r||e[1]!==s||e[2]!==n?(a=r?x.jsx(ys,{store:n,state:s}):null,e[0]=r,e[1]=s,e[2]=n,e[3]=a):a=e[3],a}function ys({store:t,state:e}){const n=B(),{members:s,loading:r}=ps(!0),[a,i]=E.useState(e.query),[l,o]=E.useState(null),c=Ts(e.editor),u=c.getBoundingClientRect(),h=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):u,d=e.rect?.()??new DOMRect(0,0,0,0),b=h.bottom-d.bottom,p=b<Ke&&d.top-h.top>b,k=(p?d.top-h.top:b)-8,f=Math.min(Ke,Math.max(k,xs))-bs,g={position:"absolute",width:Ze,left:Math.min(d.left,h.right-Ze-8)-u.left,...p?{bottom:u.bottom-d.top+6}:{top:d.bottom-u.top+6}},w=()=>{e.editor&&xt(e.editor,t),t.close()},y=m=>{const v=m.relatedTarget;if((!v||e.editor?.view.dom.contains(v)===!0)&&t.latched){l?.focus();return}w()},T=m=>{!e.editor||!e.range||(gs(e.editor,e.range,m),t.close())};return Mt.createPortal(x.jsx("div",{style:g,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg border border-border bg-popover shadow-md",children:x.jsxs(An,{onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),w(),e.editor?.commands.focus())},children:[x.jsx(Mn,{ref:o,autoFocus:!0,onFocus:()=>{t.latched=!0},value:a,onValueChange:i,placeholder:n("markdownEditor.mentionSearch"),onBlur:y}),x.jsxs(
|
|
80
|
+
`);return{...o,raw:u}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:s,dispatch:r,editor:a})=>{const i=Zr(a.schema,t,e,n);if(r){const l=s.selection.from+1;s.replaceSelectionWith(i).scrollIntoView().setSelection(et.near(s.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>dn(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hn(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,s=>s.type.name==="table");return un(t,e&&(s=>{n&&Ue(s,n.pos),e(s)}))},addRowBefore:()=>({state:t,dispatch:e})=>cn(t,e),addRowAfter:()=>({state:t,dispatch:e})=>ln(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,s=>s.type.name==="table");return on(t,e&&(s=>{n&&Ue(s,n.pos),e(s)}))},deleteTable:()=>({state:t,dispatch:e})=>an(t,e),mergeCells:()=>({state:t,dispatch:e})=>Le(t,e),splitCell:()=>({state:t,dispatch:e})=>ze(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ie("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ie("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>sn(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Le(t,e)?!0:ze(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:s})=>rn(t,e)(n,s),goToNextCell:()=>({state:t,dispatch:e})=>_e(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>_e(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&nn(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const s=nt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(s)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:J,"Mod-Backspace":J,Delete:J,"Mod-Delete":J}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[en({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],tn({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:s,HTMLAttributes:r})=>{const a=P(this.options.HTMLAttributes,r);return new e(n,this.options.cellMinWidth,s,a)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Ye(j(t,"tableRole",e))}}}),ts=fe.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(es.configure(this.options.table)),this.options.tableCell!==!1&&t.push(Fr.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(qr.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Wr.configure(this.options.tableRow)),t}});function ns(t){const e=I.c(25),{node:n,selected:s,editor:r,deleteNode:a}=t,i=B(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"";let c;e[0]!==o||e[1]!==i?(c=o||i("markdownEditor.fileNameFallback"),e[0]=o,e[1]=i,e[2]=c):c=e[2];const u=c,h=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let d;e[3]!==h?(d=Z("mx-0.5 inline-flex max-w-full select-none items-center gap-1.5 rounded-lg border border-border bg-card px-2 py-1 align-middle text-sm text-foreground",h),e[3]=h,e[4]=d):d=e[4];let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=x.jsx(wn,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=b):b=e[5];let p;e[6]!==u?(p=x.jsx("span",{className:"min-w-0 truncate",children:u}),e[6]=u,e[7]=p):p=e[7];let k;e[8]!==u||e[9]!==i?(k=i("markdownEditor.downloadFile",{name:u}),e[8]=u,e[9]=i,e[10]=k):k=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=x.jsx(xn,{size:14}),e[11]=f):f=e[11];let g;e[12]!==l||e[13]!==u||e[14]!==k?(g=x.jsx("a",{href:l,download:u,"aria-label":k,onMouseDown:ss,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:f}),e[12]=l,e[13]=u,e[14]=k,e[15]=g):g=e[15];let w;e[16]!==a||e[17]!==r.isEditable||e[18]!==i?(w=r.isEditable&&x.jsx("button",{type:"button","aria-label":i("markdownEditor.removeFile"),onMouseDown:rs,onClick:a,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:x.jsx(rt,{size:14})}),e[16]=a,e[17]=r.isEditable,e[18]=i,e[19]=w):w=e[19];let y;return e[20]!==d||e[21]!==p||e[22]!==g||e[23]!==w?(y=x.jsxs(me,{as:"span",className:d,children:[b,p,g,w]}),e[20]=d,e[21]=p,e[22]=g,e[23]=w,e[24]=y):y=e[24],y}function rs(t){return t.preventDefault()}function ss(t){return t.preventDefault()}function is(t){return t.replace(/([[\]])/g,"\\$1")}const as=D.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]"}]},renderHTML({HTMLAttributes:t,node:e}){return["a",P(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${is(n)}](${e})`},addNodeView(){return ge(ns)}});function os(t){const e=I.c(5),{node:n,selected:s}=t,r=typeof n.attrs.name=="string"?n.attrs.name:"",a=s&&"ring-2 ring-ring";let i;e[0]!==a?(i=Z("select-none rounded px-1 font-medium text-primary","bg-primary/10",a),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==r||e[3]!==i?(l=x.jsxs(me,{as:"span","data-testid":"mention-chip",className:i,children:["@",r]}),e[2]=r,e[3]=i,e[4]=l):l=e[4],l}const ls=D.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",P(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?yn(e,n):`@${n}`},addNodeView(){return ge(os)}}),cs="studio.mention-members.",de=new Map;function Ge(t){const e=de.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const s=JSON.parse(n);if(!Array.isArray(s))return;const r=s.filter(a=>!!a&&typeof a.id=="string"&&typeof a.name=="string");return de.set(t,r),r}catch{return}}function us(t,e){de.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function hs(t,e){if(!t?.length)return e;const n=new Map(t.map(s=>[s.id,s]));return e.map(s=>{const r=n.get(s.id);return r&&r.name===s.name&&r.email===s.email&&r.image===s.image?r:s})}function ds(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function ps(t){const e=I.c(17),{locator:n}=Tt(),s=$n(),r=`${cs}${n}`;let a;e[0]!==n?(a=At.mentionMembers(n),e[0]=n,e[1]=a):a=e[1];let i;e[2]!==r?(i=()=>Ge(r),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s||e[5]!==r?(l=async()=>{const b=await s.organization.listMembers(),p=hs(Ge(r),ds(b?.data?.members??[]));return us(r,p),p},e[4]=s,e[5]=r,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==a||e[9]!==i||e[10]!==l?(o={queryKey:a,enabled:t,staleTime:0,placeholderData:i,queryFn:l},e[7]=t,e[8]=a,e[9]=i,e[10]=l,e[11]=o):o=e[11];const c=vt(o);let u;e[12]!==c.data?(u=c.data??[],e[12]=c.data,e[13]=u):u=e[13];const h=c.isFetching&&!c.data;let d;return e[14]!==u||e[15]!==h?(d={members:u,loading:h},e[14]=u,e[15]=h,e[16]=d):d=e[16],d}const Ve={query:"",range:null,rect:null,editor:null};class fs{state=Ve;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(Ve)}}const Se=new zt("markdownEditorMention");function gs(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),tt(t.view,Se)}function ms(t,e,n){const s=Math.min(e+n,t.content.size);return e>=s?"":t.textBetween(e,s,"","")}function xt(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),tt(t.view,Se)}function ks(t){return fe.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Se,allowedPrefixes:[" ",`
|
|
81
|
+
`],allow:({state:n,range:s})=>{const r=t.dismissal;return r?s.from===r.from&&ms(n.doc,r.from,r.text.length)===r.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(xt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Qt(e)]}})}const Ze=256,bs=40,Ke=280,xs=140;function ws(t){const e=I.c(4),{store:n}=t,s=E.useSyncExternalStore(n.subscribe,n.getSnapshot),r=s.range!==null;let a;return e[0]!==r||e[1]!==s||e[2]!==n?(a=r?x.jsx(ys,{store:n,state:s}):null,e[0]=r,e[1]=s,e[2]=n,e[3]=a):a=e[3],a}function ys({store:t,state:e}){const n=B(),{members:s,loading:r}=ps(!0),[a,i]=E.useState(e.query),[l,o]=E.useState(null),c=Ts(e.editor),u=c.getBoundingClientRect(),h=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):u,d=e.rect?.()??new DOMRect(0,0,0,0),b=h.bottom-d.bottom,p=b<Ke&&d.top-h.top>b,k=(p?d.top-h.top:b)-8,f=Math.min(Ke,Math.max(k,xs))-bs,g={position:"absolute",width:Ze,left:Math.min(d.left,h.right-Ze-8)-u.left,...p?{bottom:u.bottom-d.top+6}:{top:d.bottom-u.top+6}},w=()=>{e.editor&&xt(e.editor,t),t.close()},y=m=>{const v=m.relatedTarget;if((!v||e.editor?.view.dom.contains(v)===!0)&&t.latched){l?.focus();return}w()},T=m=>{!e.editor||!e.range||(gs(e.editor,e.range,m),t.close())};return Mt.createPortal(x.jsx("div",{style:g,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg border border-border bg-popover shadow-md",children:x.jsxs(An,{onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),w(),e.editor?.commands.focus())},children:[x.jsx(Mn,{ref:o,autoFocus:!0,onFocus:()=>{t.latched=!0},value:a,onValueChange:i,placeholder:n("markdownEditor.mentionSearch"),onBlur:y}),x.jsxs(Sn,{style:{maxHeight:f},children:[r?x.jsx("div",{className:"flex items-center justify-center py-6",children:x.jsx(Je,{size:"sm"})}):x.jsx(Cn,{children:n("markdownEditor.mentionEmpty")}),s.map(m=>x.jsxs(Rn,{value:`${m.name} ${m.email}`,onSelect:()=>T(m),onMouseDown:v=>v.preventDefault(),className:"gap-2",children:[x.jsx(vn,{url:m.image??void 0,fallback:En(m.name),shape:"circle",size:"xs"}),x.jsx("span",{className:"min-w-0 flex-1 truncate",children:m.name})]},m.id))]})]})}),c)}function Ts(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}const vs=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,As=D.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",P(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,s,r,a,i;const l=(e=(n=t.attrs)===null||n===void 0?void 0:n.src)!==null&&e!==void 0?e:"",o=(s=(r=t.attrs)===null||r===void 0?void 0:r.alt)!==null&&s!==void 0?s:"",c=(a=(i=t.attrs)===null||i===void 0?void 0:i.title)!==null&&a!==void 0?a:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:s}=this.options.resize,r=new Set(["src","width","height"]);return({node:a,getPos:i,HTMLAttributes:l,editor:o})=>{const c=document.createElement("img");c.draggable=!1;const u=P(this.options.HTMLAttributes,l);Object.entries(u).forEach(([g,w])=>{if(w!=null)switch(g){case"src":case"width":case"height":break;default:c.setAttribute(g,w)}}),u.src!==null&&(c.src=u.src);let h={...l};const d=g=>{if(typeof g=="string"&&g!==""){c.getAttribute("src")!==g&&(c.src=g);return}c.hasAttribute("src")&&c.removeAttribute("src"),c.src!==""&&(c.src="")};d(l.src);const b=g=>{if(g.type!==a.type)return!1;const w=o.extensionManager.attributes.filter(T=>T.type===g.type.name),y=Pt(g,w);return Object.keys(h).forEach(T=>{!r.has(T)&&!(T in y)&&c.removeAttribute(T)}),Object.entries(y).forEach(([T,m])=>{r.has(T)||(m!=null?c.setAttribute(T,m):c.removeAttribute(T))}),d(y.src),h=y,!0},p=new Ht({element:c,editor:o,node:a,getPos:i,onResize:(g,w)=>{c.style.width=`${g}px`,c.style.height=`${w}px`},onCommit:(g,w)=>{const y=i();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:g,height:w}).run()},onUpdate:b,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:s===!0}}),k=p.dom,f=()=>{k.style.visibility="",k.style.pointerEvents=""};return k.style.visibility="hidden",k.style.pointerEvents="none",c.complete&&c.naturalWidth>0?f():(c.onload=f,c.onerror=f),p}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[It({find:vs,type:this.type,getAttributes:t=>{const[,,e,n,s]=t;return{src:n,alt:e,title:s}}})]}});var Ms=As;function Ss(t){const e=I.c(16),{node:n,selected:s,editor:r,deleteNode:a}=t,i=B(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let c;e[0]!==o||e[1]!==i?(c=o||i("markdownEditor.imageAltFallback"),e[0]=o,e[1]=i,e[2]=c):c=e[2];const u=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==u?(h=Z("max-h-[420px] max-w-full rounded-lg border border-border object-contain",u),e[3]=u,e[4]=h):h=e[4];let d;e[5]!==l||e[6]!==c||e[7]!==h?(d=x.jsx("img",{src:l,alt:c,draggable:!1,className:h}),e[5]=l,e[6]=c,e[7]=h,e[8]=d):d=e[8];let b;e[9]!==a||e[10]!==r.isEditable||e[11]!==i?(b=r.isEditable&&x.jsx("button",{type:"button","aria-label":i("markdownEditor.removeImage"),onMouseDown:Cs,onClick:a,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:x.jsx(rt,{size:14})}),e[9]=a,e[10]=r.isEditable,e[11]=i,e[12]=b):b=e[12];let p;return e[13]!==d||e[14]!==b?(p=x.jsxs(me,{className:"group/image relative my-3 w-fit max-w-full",children:[d,b]}),e[13]=d,e[14]=b,e[15]=p):p=e[15],p}function Cs(t){return t.preventDefault()}const Rs=Ms.extend({addNodeView(){return ge(Ss)}}).configure({inline:!1,allowBase64:!1}),pe="uploads",Es="editor-images",wt="editor-files",$s=new RegExp(`^/api/[^/]+/fs/${pe}/read$`),Qe="http://relative.invalid";function _s(t){let e;try{e=new URL(t,Qe)}catch{return!1}return e.origin!==Qe||!$s.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${wt}/`)}const Ls={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},zs=Bt.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(_s(n))return e.createNode("attachment",{href:n,name:t.text??""});const s=Tn(n);return s?e.createNode("mention",{id:s,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Is(t="",e){return[Nt.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),zs.configure(Ls),Xt.configure({placeholder:t}),ts,jt,Ot.configure({nested:!0}),Rs,as,ls,...e?[ks(e)]:[],jr.configure({markedOptions:{breaks:!0}})]}const Hs=/^(\s*)([-*+]|\d+[.)])\s+\S/,Ps=/^\s*(```|~~~)/,js=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Ns(t){const e=[];let n=!1,s=!1;for(const r of t.split(`
|
|
82
82
|
`)){if(Ps.test(r)){n=!n,s=!1,e.push(r);continue}if(n){e.push(r);continue}if(Hs.test(r)){s=!0,e.push(r);continue}if(!r.trim()){s=!1,e.push(r);continue}if(s&&js.test(r)){e[e.length-1]=`${e[e.length-1]} ${r.trim()}`;continue}s=!1,e.push(r)}return e.join(`
|
|
83
|
-
`)}const Os=10,Bs=25,Ds={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function
|
|
83
|
+
`)}const Os=10,Bs=25,Ds={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Fs(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??Ds[t.type]??(Ce(t)?".png":"")}function Ce(t){return t.type.startsWith("image/")}function qs(){const t=B(),{upload:e}=_n(pe),n=Ln(pe),[s,r]=E.useState(0);return{uploadFile:async i=>{const l=Ce(i),o=l?Os:Bs;if(i.size>o*1024*1024)return Re.error(t("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const c=l?Es:wt,u=`${crypto.randomUUID()}${Fs(i)}`;r(h=>h+1);try{return await e.mutateAsync({dir:c,files:[new File([i],u,{type:i.type})]}),n(`${c}/${u}`)}catch{return Re.error(t("markdownEditor.uploadFailed",{name:i.name})),null}finally{r(h=>h-1)}},pending:s}}const Ws=["outline-none","min-h-[200px] sm:min-h-[320px]","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-[13px]","[&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2","[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),Us=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function Xe(t,e,n,s){const r=t.state.schema.nodes[n];if(!r)return e;const a=t.state.tr.replaceWith(e,e,r.create(s)),i=a.mapping.map(e,1);return a.setSelection(qt.near(a.doc.resolve(i))),t.dispatch(a),t.state.selection.to}function Gs(t){const e=I.c(10),{editor:n,mentions:s}=t,r=s.items;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["markdown-editor-mentions"],e[0]=a):a=e[0];let i;e[1]!==r?(i=c=>{const{query:u}=c,h=u.trim().toLowerCase();return Promise.resolve(h?r.filter(d=>`${d.name} ${d.title??""}`.toLowerCase().includes(h)):r)},e[1]=r,e[2]=i):i=e[2];let l;e[3]!==n?(l=c=>{const{range:u,item:h}=c;n.chain().focus().insertContentAt(u,[{type:"text",text:`@${h.name} `}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==s.emptyLabel||e[7]!==i||e[8]!==l?(o=x.jsx(Jt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:a,queryFn:i,emptyLabel:s.emptyLabel,renderItem:Vs,onSelect:l}),e[5]=n,e[6]=s.emptyLabel,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}function Vs(t){return x.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[x.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&x.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function pi({defaultValue:t,onChange:e,placeholder:n,editable:s=!0,attachments:r=!0,mentions:a}){const i=B(),{uploadFile:l,pending:o}=qs(),[c]=E.useState(()=>new fs),u=E.useRef(null),h=E.useRef(e),d=E.useRef(l);h.current=e,d.current=l;const b=(f,g,w)=>!r||g.length===0?!1:((async()=>{let y=w;for(const T of g){const m=await d.current(T);m&&(y=Ce(T)?Xe(f,y,"image",{src:m,alt:T.name}):Xe(f,y,"attachment",{href:m,name:T.name}))}})(),!0),p=Dt({extensions:Is(n,a?void 0:c),content:Ns(t),contentType:"markdown",editable:s,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:Z(Ws,Us)},handlePaste:(f,g)=>{const w=Array.from(g.clipboardData?.files??[]);return w.length===0?!1:(g.stopPropagation(),b(f,w,f.state.selection.to))},handleDrop:(f,g,w,y)=>{if(y)return!1;const T=Array.from(g.dataTransfer?.files??[]);if(T.length===0)return!1;const m=f.posAtCoords({left:g.clientX,top:g.clientY})?.pos;return m===void 0?!1:(g.stopPropagation(),b(f,T,m))}},onUpdate:({editor:f,transaction:g})=>{g.docChanged&&h.current(f.getMarkdown())}});if(!p)return null;const k=f=>{!f||f.length===0||b(p.view,Array.from(f),p.state.selection.to)};return x.jsxs("div",{className:"flex flex-col",children:[x.jsx(Hn,{editor:p}),!a&&x.jsx(ws,{store:c}),x.jsx(Ft,{editor:p,className:"text-[15px] text-muted-foreground"}),s&&a&&x.jsx(Gs,{editor:p,mentions:a}),x.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[s&&a?.hint&&x.jsx("span",{children:a.hint}),s&&r&&x.jsx(St,{type:"button",variant:"ghost",size:"icon-sm","aria-label":i("markdownEditor.attachFile"),onClick:()=>u.current?.click(),children:x.jsx(Kt,{size:14})}),o>0&&x.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[x.jsx(Je,{className:"size-3"}),o===1?i("markdownEditor.uploading"):i("markdownEditor.uploadingCount",{count:String(o)})]})]}),x.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:f=>{k(f.target.files),f.target.value=""}})]})}export{fs as M,ls as a,jr as b,Se as c,ws as d,pi as e,ks as m};
|