decocms 4.523.1 → 4.524.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/{ActiveShapeUtils-3iGXaBcM.js → ActiveShapeUtils-gwLrBsiR.js} +1 -1
- package/dist/client/assets/{AlertCircle-BoecRmSu.js → AlertCircle-COLuN3Qe.js} +1 -1
- package/dist/client/assets/{AreaChart-MrowY4g3.js → AreaChart-Dud7jvcC.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CqjWe78l.js → ArrowLeft-BYNlToA0.js} +1 -1
- package/dist/client/assets/{ArrowUp-YHdDe54G.js → ArrowUp-CRFAWnPc.js} +1 -1
- package/dist/client/assets/{BarChart-BouCSNlP.js → BarChart-JFNliGSV.js} +1 -1
- package/dist/client/assets/{Building02-jY0EsZ3c.js → Building02-DinMBe3_.js} +1 -1
- package/dist/client/assets/{CartesianChart-YzghzaT-.js → CartesianChart-Cjgu2ECY.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DSicPUkM.js → CategoricalChart-Bx8yFu23.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bjd4331B.js → CheckCircle-DCMOdEuL.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C8DO4Eax.js → ChevronSelectorVertical-Dwu4Nr-2.js} +1 -1
- package/dist/client/assets/{ChevronUp-D732cexR.js → ChevronUp-4EkxqYyz.js} +1 -1
- package/dist/client/assets/{Copy01-BNgQXLom.js → Copy01-Tog1jA1S.js} +1 -1
- package/dist/client/assets/{CreditCard01-BI7UbDnJ.js → CreditCard01-B7MC6SfH.js} +1 -1
- package/dist/client/assets/{DotsVertical-B4rKTO-K.js → DotsVertical-qUaZHjqd.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DusfmiIN.js → ErrorBarContext-C1p765z-.js} +1 -1
- package/dist/client/assets/{Globe04-BZtelxuk.js → Globe04-CGEgYyKw.js} +1 -1
- package/dist/client/assets/{Image01-3jSbcDWw.js → Image01-CW7Pcq-W.js} +1 -1
- package/dist/client/assets/{Key01-bgf7_Io3.js → Key01-D_nzK0xg.js} +1 -1
- package/dist/client/assets/{Link01-CwY3-TdS.js → Link01-CpcYQ7Qt.js} +1 -1
- package/dist/client/assets/{LinkBroken01-gZ_Womsg.js → LinkBroken01-Ctb4MZUK.js} +1 -1
- package/dist/client/assets/{Minus-Cg_Z4UVA.js → Minus-DoRDGpun.js} +1 -1
- package/dist/client/assets/{Monitor01-DfNea12c.js → Monitor01-L9jyZGZ2.js} +1 -1
- package/dist/client/assets/{Play-C58uA1z7.js → Play-Du5BNsRy.js} +1 -1
- package/dist/client/assets/{Plus-BjxA_ka5.js → Plus-BfnmJh1R.js} +1 -1
- package/dist/client/assets/{ReferenceLine-kghB-Ev4.js → ReferenceLine-DCCnHWMQ.js} +1 -1
- package/dist/client/assets/{SearchMd-BYu5iUPZ.js → SearchMd-JUAl7Zv6.js} +1 -1
- package/dist/client/assets/{Sector-B82IN8wU.js → Sector-DL6Ad47o.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-D6PcFAZ3.js → ShoppingBag01-usYkWunw.js} +1 -1
- package/dist/client/assets/{Sun-ryrPGG0o.js → Sun-B7TolJAG.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-OacdCVpa.js → SwitchHorizontal01-DcP8c_x_.js} +1 -1
- package/dist/client/assets/{Tool01-CcNuzAHc.js → Tool01-Bon-ixH5.js} +1 -1
- package/dist/client/assets/{Trash01-B_y6cnc0.js → Trash01-cH2tYIUn.js} +1 -1
- package/dist/client/assets/{Upload01-C8k7ObxF.js → Upload01-Bo60o4T6.js} +1 -1
- package/dist/client/assets/{UserSquare-DvQcif2z.js → UserSquare-DsAVH788.js} +1 -1
- package/dist/client/assets/{Users01-BuIADxiS.js → Users01-Bo_9DitT.js} +1 -1
- package/dist/client/assets/{XClose-CE-051ne.js → XClose-DhoOL-T1.js} +1 -1
- package/dist/client/assets/{ZoomOut-BBaDHidP.js → ZoomOut-B1U_CHeD.js} +1 -1
- package/dist/client/assets/access-gate-CGDwkzkf.js +1 -0
- package/dist/client/assets/{add-connection-dialog-CBWhQLk7.js → add-connection-dialog-8gQOdlVv.js} +1 -1
- package/dist/client/assets/agent-analytics-Bd5QSkcr.js +1 -0
- package/dist/client/assets/agent-app-DSGhLy_N.js +1 -0
- package/dist/client/assets/agent-assets-Q4lV98mF.js +1 -0
- package/dist/client/assets/agent-automation-Dsupi3DF.js +20 -0
- package/dist/client/assets/agent-automations-BonoDEyJ.js +1 -0
- package/dist/client/assets/agent-calendar-WpcQ_E3l.js +1 -0
- package/dist/client/assets/agent-connect-sources-C0oR1IIZ.js +1 -0
- package/dist/client/assets/agent-deck-Y0SX6UB9.js +1 -0
- package/dist/client/assets/agent-e2e-nbY2lllw.js +1 -0
- package/dist/client/assets/agent-experiments-XS7LGaQh.js +1 -0
- package/dist/client/assets/agent-file-DKmgj6b-.js +1 -0
- package/dist/client/assets/agent-hosting-BC5YnVoX.js +1 -0
- package/dist/client/assets/agent-icon-CVEMdYFU.js +1 -0
- package/dist/client/assets/agent-library-CYxkIVFl.js +1 -0
- package/dist/client/assets/agent-library-file-DPhxbUtG.js +1 -0
- package/dist/client/assets/agent-monitor-C01cwPL-.js +1 -0
- package/dist/client/assets/agent-overview-DU1IP4XS.js +1 -0
- package/dist/client/assets/agent-releases-BuXXsH8W.js +2 -0
- package/dist/client/assets/agent-settings-B7CchDfJ.js +1 -0
- package/dist/client/assets/{agent-site-editor-DrsYL7Qi.js → agent-site-editor-DSqJlDXx.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-uiPbclqT.js +2 -0
- package/dist/client/assets/agent-site-editor-content-B9B2SztQ.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CQGXtn5w.js +1 -0
- package/dist/client/assets/agent-view-BNK8YJ86.js +1 -0
- package/dist/client/assets/{agent-view-guard-Dw8f_Dem.js → agent-view-guard-Bvqt9A7d.js} +1 -1
- package/dist/client/assets/agents-list-BV-RY6eO.js +1 -0
- package/dist/client/assets/{ai-providers-DGU07bIw.js → ai-providers-D8opLVHp.js} +2 -2
- package/dist/client/assets/{alert-CXq7wXAP.js → alert-CYZdSIKq.js} +1 -1
- package/dist/client/assets/analytics-sections-BqhdlzKZ.js +1 -0
- package/dist/client/assets/analytics-tab-BWgFTW72.js +2 -0
- package/dist/client/assets/api-keys-Dj50tYQ9.js +1 -0
- package/dist/client/assets/api-keys-MofJBQfW.js +1 -0
- package/dist/client/assets/app-editor-BcJaA3eR.js +1 -0
- package/dist/client/assets/{asset-utils-CkfOjXdG.js → asset-utils-DcPLl2K6.js} +1 -1
- package/dist/client/assets/{auth-D_mwvS_K.js → auth-CEIITB7d.js} +1 -1
- package/dist/client/assets/{auth-catchall-ZO5v_1d8.js → auth-catchall-CEBn1SGS.js} +1 -1
- package/dist/client/assets/{auth-entry-B0W-KcwY.js → auth-entry-iXHgBQJV.js} +1 -1
- package/dist/client/assets/{auth-split-layout-EIGtHpJt.js → auth-split-layout-CsXqgaOS.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BNMqjh7K.js → authenticate-and-persist-oauth-CN-ocXe3.js} +1 -1
- package/dist/client/assets/automation-list-row-JOMePUFR.js +1 -0
- package/dist/client/assets/automation-runs-KPGkDZAM.js +1 -0
- package/dist/client/assets/automations-BTtfVGNa.js +1 -0
- package/dist/client/assets/{autosend-Rn3iicpQ.js → autosend-CbkP_bEt.js} +1 -1
- package/dist/client/assets/{badge-CDGhoWxi.js → badge-DeNt4-FX.js} +1 -1
- package/dist/client/assets/{block-document-CwibGNVI.js → block-document-BzAW7wGZ.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-D4YnI8VN.js → blocks-preview-workspace-context-aUwmyorT.js} +1 -1
- package/dist/client/assets/blocks-tab-states-PBqE8hLO.js +1 -0
- package/dist/client/assets/blog-schema-BYLQdC9S.js +1 -0
- package/dist/client/assets/buckets-CFL4z0d-.js +1 -0
- package/dist/client/assets/build-improve-prompt-doc-BpkVMxpg.js +2 -0
- package/dist/client/assets/{calendar-DlQTMw7m.js → calendar-GMyXKkbA.js} +1 -1
- package/dist/client/assets/campaigns-view-iaGM9YLd.js +1 -0
- package/dist/client/assets/{capability-load-error-DZqK06os.js → capability-load-error-juzFeQ-_.js} +1 -1
- package/dist/client/assets/category-editor-lTx7E71S.js +1 -0
- package/dist/client/assets/{cdn-tab-CtqgvIhC.js → cdn-tab-QH34WF_J.js} +1 -1
- package/dist/client/assets/{chart-Dh4qH5Sx.js → chart-D9k22T0E.js} +1 -1
- package/dist/client/assets/{chat-context-CEf_lJrx.js → chat-context-C56OVvQP.js} +7 -7
- package/dist/client/assets/{chat-draft-BWhaChdV.js → chat-draft-DNgi8tda.js} +1 -1
- package/dist/client/assets/{checkbox-B-X9akcX.js → checkbox-B6N4ay58.js} +1 -1
- package/dist/client/assets/choose-editor-CcEH03W4.js +1 -0
- package/dist/client/assets/{cli-auth-success-WALyW8uQ.js → cli-auth-success-CkyWspHU.js} +1 -1
- package/dist/client/assets/{client-icons-CrD_By3h.js → client-icons-DyjyTud6.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CjDcV3Uq.js +1 -0
- package/dist/client/assets/{collapsible-D5FtbLtM.js → collapsible-D3gNdr7N.js} +1 -1
- package/dist/client/assets/collection-detail-D66AIxA0.js +1 -0
- package/dist/client/assets/collection-display-button-C28fH98T.js +1 -0
- package/dist/client/assets/{collection-search-RQehoVFG.js → collection-search-BIuQ3VPN.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BHmn2oUB.js → collection-table-wrapper-7w5ciWB4.js} +1 -1
- package/dist/client/assets/{collection-tabs-BnX5iP1F.js → collection-tabs-m2567Q_Z.js} +1 -1
- package/dist/client/assets/{column-rules-B40MgWVZ.js → column-rules-DsLrWs5p.js} +2 -2
- package/dist/client/assets/{combobox-C3ljSkZg.js → combobox-BEVN0Tvl.js} +1 -1
- package/dist/client/assets/{command-CMb7suOV.js → command-N9BazZHl.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DR1Vwqzz.js → companion-mcps-section-BQyuFD3F.js} +1 -1
- package/dist/client/assets/{config-DqTkCyHb.js → config-BmN9tmsx.js} +1 -1
- package/dist/client/assets/{connect-DIta94zG.js → connect-CefgSXIv.js} +3 -3
- package/dist/client/assets/{connect-layout-0Ai7RfSp.js → connect-layout-CUTmKBkE.js} +1 -1
- package/dist/client/assets/connect-source-dialog-CBjVXCAe.js +1 -0
- package/dist/client/assets/{connection-DECdok_z.js → connection-CQKYiXol.js} +1 -1
- package/dist/client/assets/{connection-card-ygPiujfi.js → connection-card-CvmG6XsV.js} +1 -1
- package/dist/client/assets/connection-detail-BloLauxz.js +1 -0
- package/dist/client/assets/{connection-form-helpers-WwsXdB5F.js → connection-form-helpers-ytOA1Nl6.js} +1 -1
- package/dist/client/assets/connections-BxS3FS9g.js +1 -0
- package/dist/client/assets/content-tab-BwyJP-DI.js +22 -0
- package/dist/client/assets/context-BakNzIE5.js +1 -0
- package/dist/client/assets/{context-menu-DbcS2c7t.js → context-menu-C4h1P6Vl.js} +1 -1
- package/dist/client/assets/{context-shell-CIQyklqt.js → context-shell-BxB7W0br.js} +5 -5
- package/dist/client/assets/{core.esm-BtSOaBaE.js → core.esm-BYOMVmVh.js} +1 -1
- package/dist/client/assets/create-organization-dialog-DqU6G9od.js +1 -0
- package/dist/client/assets/{daily-pulse-CH8DO0J_.js → daily-pulse-BlxIy31E.js} +1 -1
- package/dist/client/assets/discover-DMRyKZWE.js +1 -0
- package/dist/client/assets/{domain-settings-CuqQkLLJ.js → domain-settings-Cj-cRa8T.js} +1 -1
- package/dist/client/assets/{drawer-CBUeIn2K.js → drawer-B7ajVnwC.js} +1 -1
- package/dist/client/assets/{editor-CxPe-Q-E.js → editor-B7sIq_vQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BSm-iwgQ.js → editor-classes-BinXFbFk.js} +1 -1
- package/dist/client/assets/{empty-state-BUdzXSg1.js → empty-state-Cc_qF1X6.js} +1 -1
- package/dist/client/assets/{empty-state-BzCZ0bf5.js → empty-state-RpLaBfip.js} +1 -1
- package/dist/client/assets/experiments-tab-BlgfPezU.js +1 -0
- package/dist/client/assets/experiments-tab-choice-DZqY092h.js +1 -0
- package/dist/client/assets/{extract-connection-data-DewBd7fP.js → extract-connection-data-ClMH8dL9.js} +1 -1
- package/dist/client/assets/{feature-gate-Dof2Z5sB.js → feature-gate-Wo8Dn-M0.js} +1 -1
- package/dist/client/assets/{feature-paywall-BQmjnHPQ.js → feature-paywall-C1_xpbwO.js} +1 -1
- package/dist/client/assets/file-explorer-DCgzwH3u.js +2 -0
- package/dist/client/assets/{file-preview-BnQW8KsX.js → file-preview-DFHvVsCR.js} +1 -1
- package/dist/client/assets/{file-share-button-zgq85Ppa.js → file-share-button-DMtXDXf3.js} +2 -2
- package/dist/client/assets/{file-type-icon-CnMrgPAl.js → file-type-icon-may_hs3N.js} +1 -1
- package/dist/client/assets/{folder-icon-3zXSNb7F.js → folder-icon-DREaQWIx.js} +2 -2
- package/dist/client/assets/{form-DWfSZ-uy.js → form-Gz8fbLdb.js} +1 -1
- package/dist/client/assets/general-DBULqBSQ.js +1 -0
- package/dist/client/assets/held-block-view-DTUWWRfL.js +20 -0
- package/dist/client/assets/home-DnXsGhyo.js +1 -0
- package/dist/client/assets/{icon-button-DBmNh0NJ.js → icon-button-TQkFyvqB.js} +1 -1
- package/dist/client/assets/{index-cD72qupV.js → index-B9NLvHLf.js} +1 -1
- package/dist/client/assets/index-BEX8cmtV.js +1 -0
- package/dist/client/assets/index-BGcfYf5c.js +4 -0
- package/dist/client/assets/index-BNmzMNlZ.js +253 -0
- package/dist/client/assets/{index-DipIYjGn.js → index-BNtuHmZB.js} +2 -2
- package/dist/client/assets/{index-x6QXFiYo.js → index-C6_m0mjP.js} +1 -1
- package/dist/client/assets/{index-BauMDA_C.js → index-CaH8ekvn.js} +1 -1
- package/dist/client/assets/{index-CH1yVrTT.js → index-CqFACk2B.js} +3 -3
- package/dist/client/assets/{index-DPQJRb2f.js → index-DENKa8lW.js} +6 -6
- package/dist/client/assets/{index-Bs2VsSFp.js → index-DNHxXhrW.js} +9 -9
- package/dist/client/assets/{index-C6RphnDz.js → index-DgWAoWIc.js} +1 -1
- package/dist/client/assets/{index-Nse4lEE5.js → index-DusHyRie.js} +1 -1
- package/dist/client/assets/{index-DFiVcvs1.js → index-bf-OLKAU.js} +1 -1
- package/dist/client/assets/{index-DdwTulXb.js → index-iynQP1if.js} +1 -1
- package/dist/client/assets/{index-CzAA1Ftq.js → index-kd3fyZ9a.js} +1 -1
- package/dist/client/assets/{index-redirect-Svh2E4vz.js → index-redirect-DAPRiYQw.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BxY60Pl8.js → infiniteQueryObserver-ClGIthQz.js} +1 -1
- package/dist/client/assets/{infra-billing-DEwuRVXP.js → infra-billing-Bn8rlKTp.js} +1 -1
- package/dist/client/assets/{input-Y4nlSnES.js → input-BS4EACP3.js} +7 -7
- package/dist/client/assets/{input-boV3L7bW.js → input-DZSiMfCa.js} +1 -1
- package/dist/client/assets/{integration-icon-oEHZLv8F.js → integration-icon-BrTM8z-s.js} +1 -1
- package/dist/client/assets/{jira-icon-BkogXsHX.js → jira-icon-CvveHm37.js} +1 -1
- package/dist/client/assets/{label-C6V9azY9.js → label-BCxqhVIq.js} +1 -1
- package/dist/client/assets/{layout-D4-0fnKG.js → layout-C_-T37yU.js} +1 -1
- package/dist/client/assets/legacy-agents-deep-HN0h-Vgf.js +1 -0
- package/dist/client/assets/{legacy-main-redirect-DPDO4jzz.js → legacy-main-redirect-HqwAGFUC.js} +1 -1
- package/dist/client/assets/library-D2Mrm5WM.js +1 -0
- package/dist/client/assets/{login-QwQdytNu.js → login-D25rkjo_.js} +1 -1
- package/dist/client/assets/{markdown-DVKH1IaR.js → markdown-P8cO0xLZ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DXX6eros.js → mcp-app-renderer-CKUvsXnq.js} +2 -2
- package/dist/client/assets/{mcp-oauth-BT1yV9Hn.js → mcp-oauth-C9hLQucs.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CP_tf4jd.js → mcp-oauth-DBMA8wIh.js} +1 -1
- package/dist/client/assets/members-C_tx9w5g.js +1 -0
- package/dist/client/assets/{memory-C50Pawnh.js → memory-CsXGZJq1.js} +2 -2
- package/dist/client/assets/{mini-report-page-CAjqwv4W.js → mini-report-page-DGZYey3l.js} +1 -1
- package/dist/client/assets/{mock-board-D3aM5LBD.js → mock-board-BWzTY2k-.js} +5 -5
- package/dist/client/assets/{monaco-editor-LiopisRR.js → monaco-editor-CBJkBgIU.js} +2 -2
- package/dist/client/assets/monitoring-BLnrFAQj.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-zg7N0blo.js → monitoring-stats-row-vWHUOUB3.js} +1 -1
- package/dist/client/assets/{multi-select-lVxVaMtl.js → multi-select-BNfLnIfI.js} +1 -1
- package/dist/client/assets/mustache-Crsi4VAX.js +4 -0
- package/dist/client/assets/{named-rule-uses-BeXmyiue.js → named-rule-uses-D5gjZwOp.js} +1 -1
- package/dist/client/assets/named-rule-view-BVCpec2I.js +1 -0
- package/dist/client/assets/{new-project-dialog-DmsgoraK.js → new-project-dialog-BzJmdXI6.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bs2w3d0I.js → oauth-callback-CwZ-b3nE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CUCvxuBI.js → oauth-callback-ai-provider-CujNNAU2.js} +1 -1
- package/dist/client/assets/onboarding-Csy3KW6h.js +1 -0
- package/dist/client/assets/openai-conversation-DJfgyA82.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-C7cacXI0.js → optimistic-project-sidebar-views-XzUayXF_.js} +1 -1
- package/dist/client/assets/{order-monitor-day-D34Jke5D.js → order-monitor-day-BUk1fjA6.js} +1 -1
- package/dist/client/assets/organization-choice-BG-EMl8L.js +1 -0
- package/dist/client/assets/orgs-BOi51Yxa.js +1 -0
- package/dist/client/assets/page-seo-form-D4gneorY.js +1 -0
- package/dist/client/assets/{pair-71Dh0mlf.js → pair-Dh_1oqHi.js} +8 -8
- package/dist/client/assets/parse-sections-B30A8ECY.js +1 -0
- package/dist/client/assets/plan-BXu8SQ3T.js +1 -0
- package/dist/client/assets/{plan-ladder-DMra4X10.js → plan-ladder-CN5p5ylK.js} +1 -1
- package/dist/client/assets/{popover-DClINcvR.js → popover-DauDBkON.js} +1 -1
- package/dist/client/assets/post-calendar-Ceopsk1u.js +1 -0
- package/dist/client/assets/post-editor-BChaRDNt.js +2 -0
- package/dist/client/assets/{preview-content-T_PMJBX-.js → preview-content-BvhoJjFR.js} +1 -1
- package/dist/client/assets/{preview-dialog-BZFfGFuX.js → preview-dialog-iRKqzeeN.js} +1 -1
- package/dist/client/assets/{preview-panel-DlTtP1Ms.js → preview-panel-DcbhbW1H.js} +1 -1
- package/dist/client/assets/preview-tab-ClK0lOMy.js +551 -0
- package/dist/client/assets/{product-picker-dialog-BpSOLmzl.js → product-picker-dialog-CsTqbwXT.js} +1 -1
- package/dist/client/assets/profile-DE1V4tEF.js +1 -0
- package/dist/client/assets/project-app-view-BpeI5cMf.js +1 -0
- package/dist/client/assets/{project-apps-Dm5IS3KO.js → project-apps-CNRV3DAE.js} +1 -1
- package/dist/client/assets/project-feed-BcaTqzKD.js +1 -0
- package/dist/client/assets/{project-icon-DuRHj8pv.js → project-icon-9kbQzXfH.js} +1 -1
- package/dist/client/assets/project-reports-DZCmLCmE.js +1 -0
- package/dist/client/assets/project-tasks-D6qNETK3.js +1 -0
- package/dist/client/assets/projects-Kz2HQD_e.js +1 -0
- package/dist/client/assets/{projects-empty-state-QJ0Cx8Z2.js → projects-empty-state-Df7eS0pA.js} +1 -1
- package/dist/client/assets/{prompts-C9l1TNag.js → prompts-B4KLkb4I.js} +1 -1
- package/dist/client/assets/record-editor-C5XOx_LV.js +1 -0
- package/dist/client/assets/redirect-editor-BxKT3ntE.js +1 -0
- package/dist/client/assets/releases-api-BDl7LEw1.js +1 -0
- package/dist/client/assets/{reports-BOvqWT5T.js → reports-Cp14zg57.js} +1 -1
- package/dist/client/assets/reports-DBFNTtm-.js +1 -0
- package/dist/client/assets/reports-onboarding-D2UqC4mS.js +1 -0
- package/dist/client/assets/reports-tab-C51R-6vi.js +2 -0
- package/dist/client/assets/repositories-C77B6dOt.js +1 -0
- package/dist/client/assets/repositories-CHKGn0VU.js +1 -0
- package/dist/client/assets/repository-binding-BZ7FmJ0X.js +1 -0
- package/dist/client/assets/{repository-import-picker-DmCy1J1K.js → repository-import-picker-Bjws7k2-.js} +1 -1
- package/dist/client/assets/repository-picker-DkvIZLAj.js +1 -0
- package/dist/client/assets/{require-capability-Bij86NMO.js → require-capability-Bm5pde_M.js} +1 -1
- package/dist/client/assets/{required-auth-layout-FVugTURm.js → required-auth-layout-Dn8nNstE.js} +1 -1
- package/dist/client/assets/{reset-password-DT6AfwVB.js → reset-password-CHMCFAp9.js} +1 -1
- package/dist/client/assets/{resizable-DgP86V61.js → resizable-BYZDi11K.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-D9iIIIDe.js → resolve-tab-icon-DLcHhSBW.js} +1 -1
- package/dist/client/assets/review-settings-DEFTQSp0.js +1 -0
- package/dist/client/assets/roles-BIj8m30-.js +1 -0
- package/dist/client/assets/route-CwIKlFpH.js +1 -0
- package/dist/client/assets/route-DQxiKHs8.js +1 -0
- package/dist/client/assets/route-L2EzRsks.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-q0eTvNvQ.js → sandbox-lifecycle-context-DMfngoi-.js} +1 -1
- package/dist/client/assets/{schema-CJ53G47b.js → schema-DEyBWI2y.js} +1 -1
- package/dist/client/assets/{schema-DNweLWtn.js → schema-DoiqvTL7.js} +1 -1
- package/dist/client/assets/{scroll-area-BHIKiLUM.js → scroll-area-Cfsm1vBV.js} +1 -1
- package/dist/client/assets/search-input-DBKkXR0y.js +1 -0
- package/dist/client/assets/{search-toggle-DzUrEZFD.js → search-toggle-CzYTwp_L.js} +1 -1
- package/dist/client/assets/secret-ciphertext-cTA7BSVY.js +1 -0
- package/dist/client/assets/secret-picker-CqxG24X7.js +1 -0
- package/dist/client/assets/secrets-CtByih4R.js +1 -0
- package/dist/client/assets/{sections-DHvRm7bA.js → sections-CCcpB_PT.js} +1 -1
- package/dist/client/assets/sections-editor-DpO_mTF7.js +1 -0
- package/dist/client/assets/{select-BvUL0HyR.js → select-CTAm_W2d.js} +1 -1
- package/dist/client/assets/{select-model-Szkl3757.js → select-model-Cvj2OnbU.js} +1 -1
- package/dist/client/assets/seo-editor-BPToAJRY.js +1 -0
- package/dist/client/assets/{separator-vlhb1Tzj.js → separator-BeYssz5V.js} +1 -1
- package/dist/client/assets/settings-tab-BRtykuoH.js +1 -0
- package/dist/client/assets/{sheet-D1CAQsjr.js → sheet-C52S-h6R.js} +1 -1
- package/dist/client/assets/shell-layout-DYY0I41_.js +1 -0
- package/dist/client/assets/site-draft-actions-DwqQ-cQC.js +12 -0
- package/dist/client/assets/site-draft-view-CiKU2Icp.js +2 -0
- package/dist/client/assets/site-editor-CuXmo07G.js +1 -0
- package/dist/client/assets/site-editor-toast-CT4NtD1f.js +1 -0
- package/dist/client/assets/skills-_WDetSCi.js +1 -0
- package/dist/client/assets/{slider-EpxmA7ZL.js → slider-rNbrBC-4.js} +1 -1
- package/dist/client/assets/{sortable.esm-CpdZxqSN.js → sortable.esm-Cw5kBwgn.js} +1 -1
- package/dist/client/assets/sso-DSG3YPMw.js +1 -0
- package/dist/client/assets/{suggestion-DqRsSpc-.js → suggestion-Dd_Uy5Bv.js} +2 -2
- package/dist/client/assets/{switch-BudKCJf7.js → switch-nUFQi60k.js} +1 -1
- package/dist/client/assets/{symbol-CYQiJJdu.js → symbol-C3kEOGZ_.js} +1 -1
- package/dist/client/assets/synced-repos-DBmibobg.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-BGGv8hr_.js → tab-icon-glyph-Bzpngl6a.js} +1 -1
- package/dist/client/assets/{table-Bo_p8Wa3.js → table-CxQHf5NT.js} +1 -1
- package/dist/client/assets/{tabs-BTB5YGW1.js → tabs-BwD6LFyC.js} +1 -1
- package/dist/client/assets/task-assignee-avatar-Bg9ijzoY.js +1 -0
- package/dist/client/assets/{task-board-Ds21WWvc.js → task-board-DreQgJBj.js} +1 -1
- package/dist/client/assets/{task-route-BUL4mDi5.js → task-route-B6QYswnx.js} +1 -1
- package/dist/client/assets/{task-status-CK5oSIgi.js → task-status-DcCdeelW.js} +1 -1
- package/dist/client/assets/taskboard-analytics-C_aUAX7S.js +1 -0
- package/dist/client/assets/tasks-CYY9XlJ3.js +4 -0
- package/dist/client/assets/tasks-CeouZ3tS.js +1 -0
- package/dist/client/assets/{textarea-BS7I3MZL.js → textarea-y7TWtoua.js} +1 -1
- package/dist/client/assets/thread-analytics-BD8n1a8E.js +1 -0
- package/dist/client/assets/{thread-intent-C0R8BtBw.js → thread-intent-cB2EtHpg.js} +6 -6
- package/dist/client/assets/thread-route-Cr5f3jw8.js +1 -0
- package/dist/client/assets/{thread-route-yHr3Xqpq.js → thread-route-D01w_vQB.js} +1 -1
- package/dist/client/assets/thread-sheet-body-C0IyWshl.js +1 -0
- package/dist/client/assets/{time-range-picker-C_RAU_JZ.js → time-range-picker-bp6BeGMC.js} +1 -1
- package/dist/client/assets/toggle-group-BIu6qfZV.js +1 -0
- package/dist/client/assets/{tool-namespace-B1sVq59x.js → tool-namespace-Crbzrqv8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D4YToeEY.js → toolbar-icon-button-ByMmG3VL.js} +1 -1
- package/dist/client/assets/{tooltip-CmTwSHYA.js → tooltip-DibJz0Jl.js} +1 -1
- package/dist/client/assets/{tooltipContext-C41VBtBA.js → tooltipContext-BzrsG1UN.js} +1 -1
- package/dist/client/assets/track-C-8tVJFa.js +1 -0
- package/dist/client/assets/{types-05YrcBTZ.js → types-BdOsWOEi.js} +9 -9
- package/dist/client/assets/{url-slug-BQQBxd5s.js → url-slug-CPCergXm.js} +1 -1
- package/dist/client/assets/{usage-stats-DTNxQXdY.js → usage-stats-DDafRqWC.js} +7 -7
- package/dist/client/assets/{use-ai-providers-BdMI1dJ8.js → use-ai-providers-Bsehd5pg.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-CeNTU7vM.js +1 -0
- package/dist/client/assets/{use-automations-7sML6axw.js → use-automations-BscjsX1o.js} +1 -1
- package/dist/client/assets/use-autosave-D0y0c0lt.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DuWKLw_d.js → use-chat-layout-state-DpOxQYv4.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Cqy994m5.js → use-clock-tick-jRUiEK1v.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B7-Rnq6I.js → use-connect-companion-BGtpVGmA.js} +1 -1
- package/dist/client/assets/use-connection-CAR6Cxbr.js +1 -0
- package/dist/client/assets/{use-content-sync-DxuiTsAP.js → use-content-sync-bYlxy6np.js} +1 -1
- package/dist/client/assets/{use-copy-ByMN8ZBl.js → use-copy-Dpm_jhm-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-UGWMFU-8.js → use-create-virtual-mcp-DcCX7uo7.js} +1 -1
- package/dist/client/assets/use-date-fns-locale-hUyExEVb.js +1 -0
- package/dist/client/assets/{use-debounced-autosave-DN6l6XR3.js → use-debounced-autosave-By6os5xD.js} +1 -1
- package/dist/client/assets/{use-debounced-value-3kPVK8wc.js → use-debounced-value-BtR2lyTj.js} +1 -1
- package/dist/client/assets/use-deco-credits-DRIA1g3T.js +1 -0
- package/dist/client/assets/{use-decopilot-events-DH9vtuqj.js → use-decopilot-events-C4OBhauN.js} +1 -1
- package/dist/client/assets/use-delete-connection-BM5PcuGQ.js +1 -0
- package/dist/client/assets/{use-deployment-admin-BlS14Krh.js → use-deployment-admin-BmDeutjQ.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-8Q6wI_7_.js → use-fast-preview-draft-url-BUDoPHon.js} +1 -1
- package/dist/client/assets/{use-file-configs-BJwH2-6c.js → use-file-configs-CuVchUT-.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BbsXPNFF.js → use-inbox-feed-Bi03vVLM.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D-NkL7pd.js → use-infinite-scroll-0YRynoMy.js} +1 -1
- package/dist/client/assets/use-join-requests-BhMSzUBO.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-QcdwwtJ8.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-SDpJIu0o.js → use-mcp-auth-status-Ddp-NElL.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CqNgp7C3.js → use-mcp-client-ClU7gdfw.js} +10 -10
- package/dist/client/assets/{use-mcp-prompts-_OL9f0kB.js → use-mcp-prompts-CFFfSPcj.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CzxPUwUO.js → use-mcp-tools-CsGOzrhW.js} +1 -1
- package/dist/client/assets/{use-mobile-DpTfSAm7.js → use-mobile-nW9hYb6L.js} +1 -1
- package/dist/client/assets/use-move-blocks-BKlQlSno.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-CblBUgFe.js → use-navigate-to-agent-CvuO-uuz.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-C8vpSsvJ.js → use-open-billing-url-6zduD8ZA.js} +1 -1
- package/dist/client/assets/{use-org-fs-BwLqCU_I.js → use-org-fs-BcT14y41.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-Cg7khzRw.js → use-org-repo-syncs-BdTpYW4-.js} +1 -1
- package/dist/client/assets/{use-org-sso-CXvlVlUi.js → use-org-sso-DdzTjSOo.js} +1 -1
- package/dist/client/assets/use-organization-roles-DQlsWqEE.js +1 -0
- package/dist/client/assets/{use-organization-settings-R35CeX0x.js → use-organization-settings-DeXdcCtZ.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DcAwEhOb.js → use-panel-navigate-BrjENNrA.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-B1h5Pugj.js → use-project-native-view-presence-OgGOYaV4.js} +1 -1
- package/dist/client/assets/{use-project-scope-COq2XQVT.js → use-project-scope-DryffHrf.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DQiepK1I.js → use-recent-apps-CMgGjBH4.js} +1 -1
- package/dist/client/assets/{use-releases-CXFA4FcN.js → use-releases-BQePeR_j.js} +1 -1
- package/dist/client/assets/use-reports-diagnostic-KZB3C_26.js +1 -0
- package/dist/client/assets/{use-sandbox-events-wT6wBZge.js → use-sandbox-events-ClbDdVRn.js} +2 -2
- package/dist/client/assets/{use-secrets-Dti2Zjt-.js → use-secrets-Cjihb12f.js} +1 -1
- package/dist/client/assets/use-section-preview-base-go9VMYa4.js +1 -0
- package/dist/client/assets/use-session-runtime-CQOTzbKn.js +1 -0
- package/dist/client/assets/{use-sidebar-collapsed-DCvF-wFz.js → use-sidebar-collapsed-CUSnfCt-.js} +1 -1
- package/dist/client/assets/{use-tags-Dkh7i4b9.js → use-tags-CMyUN8Qd.js} +1 -1
- package/dist/client/assets/use-task-board-analytics-BWzR51Kh.js +1 -0
- package/dist/client/assets/{use-task-board-events-BTnll7tY.js → use-task-board-events-DlFBtyOL.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DV52O8jk.js → use-task-board-item-prs-D9Aj6NRX.js} +1 -1
- package/dist/client/assets/{use-task-metadata-L677N_ml.js → use-task-metadata-DcdDwiSS.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BZBVj7t2.js → use-thread-analytics-cLhxQI8B.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DkwE9vVN.js → use-thread-outputs-D8Bvo55q.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DWVaUM2t.js +1 -0
- package/dist/client/assets/useQueries-B8DPRYfS.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-6Ovi3jRe.js +1 -0
- package/dist/client/assets/users-BIP3dsuH.js +1 -0
- package/dist/client/assets/{utils-JJWwAhjH.js → utils-DeFulDMz.js} +1 -1
- package/dist/client/assets/variant-calendar-C37bfPDk.js +1 -0
- package/dist/client/assets/variant-matcher-override-B4pYtxaz.js +1 -0
- package/dist/client/assets/{virtual-mcp-DhxG1LUt.js → virtual-mcp-D_aBBfQL.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-HmUSWdEg.js → watch-sse-pool-Bk0Yni6j.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +783 -783
- package/package.json +1 -1
- package/dist/client/assets/User01-B5NngWXw.js +0 -1
- package/dist/client/assets/access-gate-CXvtA9IQ.js +0 -1
- package/dist/client/assets/agent-analytics-BRVR9Nm7.js +0 -1
- package/dist/client/assets/agent-app-Wibq0OFa.js +0 -1
- package/dist/client/assets/agent-assets-Bj5Luz-W.js +0 -1
- package/dist/client/assets/agent-automation-Dr4Y6VGJ.js +0 -20
- package/dist/client/assets/agent-automations-FAc-0hCc.js +0 -1
- package/dist/client/assets/agent-calendar-D7DufZS_.js +0 -1
- package/dist/client/assets/agent-connect-sources-B2TBus9P.js +0 -1
- package/dist/client/assets/agent-deck-BQ7xD_0N.js +0 -1
- package/dist/client/assets/agent-e2e-Xz5_DbBd.js +0 -1
- package/dist/client/assets/agent-experiments-DMb-JH-W.js +0 -1
- package/dist/client/assets/agent-file-jmWEmVy9.js +0 -1
- package/dist/client/assets/agent-hosting-Jt1eRL4L.js +0 -1
- package/dist/client/assets/agent-icon-D9qv9iJQ.js +0 -1
- package/dist/client/assets/agent-library-CYOoJcrp.js +0 -1
- package/dist/client/assets/agent-library-file-CHPq6ELL.js +0 -1
- package/dist/client/assets/agent-monitor-Bxvs2XHa.js +0 -1
- package/dist/client/assets/agent-overview-BNrr8sDt.js +0 -1
- package/dist/client/assets/agent-releases-BusIaoNs.js +0 -2
- package/dist/client/assets/agent-settings-CCQqUf-q.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CX9PY1d_.js +0 -2
- package/dist/client/assets/agent-site-editor-content-qNC8jZls.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DhMNzXt9.js +0 -1
- package/dist/client/assets/agent-view-CI9h5gAx.js +0 -1
- package/dist/client/assets/agents-list-DYyNDxTw.js +0 -1
- package/dist/client/assets/alert-dialog-BBFgXAmX.js +0 -7
- package/dist/client/assets/analytics-sections-czReTaOZ.js +0 -1
- package/dist/client/assets/analytics-tab-C1nax7x3.js +0 -2
- package/dist/client/assets/api-keys-f3ViWnh0.js +0 -1
- package/dist/client/assets/api-keys-qNGMRqbx.js +0 -1
- package/dist/client/assets/app-editor-D1Zrm2TM.js +0 -1
- package/dist/client/assets/automation-list-row-CiF6h_o_.js +0 -1
- package/dist/client/assets/automation-runs-BqVYPzh9.js +0 -1
- package/dist/client/assets/automations-BHFkDeZ2.js +0 -1
- package/dist/client/assets/avatar-DsyxJdd5.js +0 -1
- package/dist/client/assets/blocks-tab-states-_rQb-3nf.js +0 -1
- package/dist/client/assets/blog-schema-hiJ1VvK3.js +0 -1
- package/dist/client/assets/buckets-Cgqz5f6M.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-Cx1NA6_T.js +0 -2
- package/dist/client/assets/campaigns-view-Bn067WyB.js +0 -1
- package/dist/client/assets/category-editor-Co3bRfpu.js +0 -1
- package/dist/client/assets/choose-editor-DZmSFlJ2.js +0 -1
- package/dist/client/assets/cms-settings-editor-B1PCbkSm.js +0 -1
- package/dist/client/assets/collection-detail-DtWJ8lB6.js +0 -1
- package/dist/client/assets/collection-display-button-BaC3Lby-.js +0 -1
- package/dist/client/assets/connect-source-dialog-DjtB0gt2.js +0 -1
- package/dist/client/assets/connection-detail-C9scWK5j.js +0 -1
- package/dist/client/assets/connections-BQjNaGS9.js +0 -1
- package/dist/client/assets/content-tab-CAW0Bhf6.js +0 -22
- package/dist/client/assets/context-ddLbYTQy.js +0 -1
- package/dist/client/assets/create-organization-dialog-B1J3dbRj.js +0 -1
- package/dist/client/assets/differenceInSeconds-C3x8sHUj.js +0 -1
- package/dist/client/assets/discover-DORJ6GMD.js +0 -1
- package/dist/client/assets/experiments-tab-WOPYssza.js +0 -1
- package/dist/client/assets/experiments-tab-choice-CI25uYfH.js +0 -1
- package/dist/client/assets/file-explorer-CtLkW4hH.js +0 -2
- package/dist/client/assets/format-time-Cq80KKvY.js +0 -1
- package/dist/client/assets/general-CANWkC13.js +0 -1
- package/dist/client/assets/home-BFodRKhb.js +0 -1
- package/dist/client/assets/index-5D9wIy3o.js +0 -1
- package/dist/client/assets/index-BAmB740B.js +0 -243
- package/dist/client/assets/index-CkPVfANw.js +0 -4
- package/dist/client/assets/legacy-agents-deep-oTGqQAve.js +0 -1
- package/dist/client/assets/library-BNLBVJPY.js +0 -1
- package/dist/client/assets/members-B1ZJujYN.js +0 -1
- package/dist/client/assets/monitoring-B7vBtbj0.js +0 -1
- package/dist/client/assets/mustache-D4PpoYZo.js +0 -4
- package/dist/client/assets/named-rule-view-BD9ako2G.js +0 -1
- package/dist/client/assets/onboarding-BUhC7Axs.js +0 -1
- package/dist/client/assets/openai-conversation-D40-j2aL.js +0 -3
- package/dist/client/assets/organization-choice-CZm6-Lsp.js +0 -1
- package/dist/client/assets/orgs-BzS4vgpT.js +0 -1
- package/dist/client/assets/page-seo-form-UBTBjVc2.js +0 -1
- package/dist/client/assets/parse-sections-C7SJnlZ7.js +0 -1
- package/dist/client/assets/plan-6YWkk0Z5.js +0 -1
- package/dist/client/assets/post-calendar-l09Ocu-Z.js +0 -1
- package/dist/client/assets/post-editor-B5DakPnS.js +0 -2
- package/dist/client/assets/preview-tab-DE5CyvZI.js +0 -551
- package/dist/client/assets/profile-l7YzIikv.js +0 -1
- package/dist/client/assets/project-app-view-CZ4ncHJw.js +0 -1
- package/dist/client/assets/project-feed-B429synm.js +0 -1
- package/dist/client/assets/project-reports-BqcstnBp.js +0 -1
- package/dist/client/assets/project-tasks-0lrWUpFL.js +0 -1
- package/dist/client/assets/projects-s6UXfr6V.js +0 -1
- package/dist/client/assets/record-editor-BBAM6dba.js +0 -1
- package/dist/client/assets/redirect-editor-Da8bdxGX.js +0 -1
- package/dist/client/assets/releases-api-BTCDyPHo.js +0 -1
- package/dist/client/assets/reports-CBo7lxtK.js +0 -1
- package/dist/client/assets/reports-onboarding-D9oUufsD.js +0 -1
- package/dist/client/assets/reports-tab-DT51kjgE.js +0 -2
- package/dist/client/assets/repositories-CM9WvII2.js +0 -1
- package/dist/client/assets/repositories-bGHlY3pM.js +0 -1
- package/dist/client/assets/repository-binding-BgJ8uAoU.js +0 -1
- package/dist/client/assets/repository-picker-BvSncDst.js +0 -1
- package/dist/client/assets/review-settings-DdYgJGVz.js +0 -1
- package/dist/client/assets/roles-CgVcsOdT.js +0 -1
- package/dist/client/assets/route-CkFix_vP.js +0 -1
- package/dist/client/assets/route-DODiDy-j.js +0 -1
- package/dist/client/assets/route-DVi1VWR6.js +0 -1
- package/dist/client/assets/runnable-block-editor-dRq9eTzq.js +0 -20
- package/dist/client/assets/search-input-BAISJ9LS.js +0 -1
- package/dist/client/assets/secret-ciphertext-BoA15qGd.js +0 -1
- package/dist/client/assets/secret-picker-Cdv3xW0U.js +0 -1
- package/dist/client/assets/secrets-C7hm_npZ.js +0 -1
- package/dist/client/assets/sections-editor-DgEGZXcq.js +0 -4
- package/dist/client/assets/seo-editor-BLHMI9qj.js +0 -1
- package/dist/client/assets/settings-tab-Dx6WgZsi.js +0 -1
- package/dist/client/assets/shell-layout-B5jnML3d.js +0 -1
- package/dist/client/assets/site-draft-actions-D1d2wytY.js +0 -12
- package/dist/client/assets/site-draft-view-DmMlvXzq.js +0 -2
- package/dist/client/assets/site-editor-eGFXfzA8.js +0 -1
- package/dist/client/assets/site-editor-toast-CGZS9BwD.js +0 -1
- package/dist/client/assets/skills-NSxr4Z0X.js +0 -1
- package/dist/client/assets/sso-BHFwYob2.js +0 -1
- package/dist/client/assets/synced-repos-D-U5QZg2.js +0 -1
- package/dist/client/assets/task-assignee-avatar-CAj5yPyc.js +0 -1
- package/dist/client/assets/taskboard-analytics-D6UWbvQC.js +0 -1
- package/dist/client/assets/tasks-CMUaHBkk.js +0 -4
- package/dist/client/assets/tasks-D5WIQI-o.js +0 -1
- package/dist/client/assets/thread-analytics-Cqdeb287.js +0 -1
- package/dist/client/assets/thread-route-DnoU0Lqn.js +0 -1
- package/dist/client/assets/thread-sheet-body-BBHV5kVE.js +0 -1
- package/dist/client/assets/toggle-group-BcfSAKQP.js +0 -1
- package/dist/client/assets/track-DZvu8ree.js +0 -1
- package/dist/client/assets/use-apply-named-rule-pRgVjxXf.js +0 -1
- package/dist/client/assets/use-autosave-DMApQf0t.js +0 -1
- package/dist/client/assets/use-connection-DQSt0eTw.js +0 -1
- package/dist/client/assets/use-date-fns-locale-C0oymQ59.js +0 -1
- package/dist/client/assets/use-deco-credits-CT72rZSv.js +0 -1
- package/dist/client/assets/use-delete-connection-D5mcm_l_.js +0 -1
- package/dist/client/assets/use-join-requests-C-xyNeji.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-DvsYVOuQ.js +0 -1
- package/dist/client/assets/use-members-CTltnPbx.js +0 -1
- package/dist/client/assets/use-move-blocks-YDfVWv8x.js +0 -1
- package/dist/client/assets/use-org-auth-client-Bi3e38-G.js +0 -1
- package/dist/client/assets/use-organization-roles-zn84F9HK.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-Dwax0vDS.js +0 -1
- package/dist/client/assets/use-section-preview-base-CFzMfuNP.js +0 -1
- package/dist/client/assets/use-session-runtime-Ba_EwQTc.js +0 -1
- package/dist/client/assets/use-task-board-analytics-Bqx8wPMm.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D-VWsr8W.js +0 -1
- package/dist/client/assets/useQueries-jXxHGDMF.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-mJC6qHan.js +0 -1
- package/dist/client/assets/users-T5camo9f.js +0 -1
- package/dist/client/assets/variant-calendar-BgT-KS6e.js +0 -1
- package/dist/client/assets/variant-matcher-override-CgViiiNQ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,b as j,r as E,j as b,l as q,af as vt,t as ue,aW as Xe,a2 as At,m as Mt,K as St,b3 as Ct,h as Je}from"./index-BAmB740B.js";import{a as Rt,n as Ye,E as ie,o as Et,x as $t,y as P,z as _t,A as Lt,B as et,C as N,G as Ee,H as It,I as zt,J as $e,K as Pt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as xe,U as Ht,V as jt,W as Nt,X as Ot,Y as Bt,s as Dt,Z as Ft,u as qt,b as Wt}from"./usage-stats-DTNxQXdY.js";import{T as _,n as Ut,i as Gt,E as Zt}from"./editor-classes-BSm-iwgQ.js";import{a as Vt,e as nt,s as Kt,S as Qt}from"./suggestion-DqRsSpc-.js";import{B as Xt,c as Jt,t as Yt,C as rt,f as en,g as _e,s as tn,m as Le,a as Ie,b as nn,d as ze,e as rn,h as sn,i as an,j as on,k as ln,l as cn,n as un}from"./index-DdwTulXb.js";import{ai as hn,aj as dn,al as pn,a0 as fn,be as gn,aW as mn}from"./agent-icon-D9qv9iJQ.js";import{i as kn}from"./SwitchHorizontal01-OacdCVpa.js";import{i as xn}from"./Link01-CwY3-TdS.js";import{s as bn}from"./Trash01-B_y6cnc0.js";import{i as wn,b as yn}from"./use-org-fs-BwLqCU_I.js";import{E as Pe,i as st,b as Tn,c as vn,d as it,A as An,e as Mn,m as Sn,f as Cn}from"./markdown-DVKH1IaR.js";import{A as Rn}from"./avatar-DsyxJdd5.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-CMb7suOV.js";import{u as zn}from"./use-org-auth-client-Bi3e38-G.js";import{I as Pn}from"./icon-button-DBmNh0NJ.js";function Hn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Ut(a);if(M===""){g();return}if(!Gt(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx(xn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=b.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let x;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(x=s&&b.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[b.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("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")}),b.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:b.jsx(vt,{size:14})}),h&&b.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:b.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=x):x=e[26];let v;return e[27]!==T||e[28]!==x?(v=b.jsxs("div",{className:"relative",children:[T,x]}),e[27]=T,e[28]=x,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=b.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},at=[1,2,3],jn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Nn(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:On},e[0]=n,e[1]=a):a=e[1];const l=Rt(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&b.jsxs(Xt,{editor:n,shouldShow:jn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[b.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:b.jsx(hn,{size:14})}),b.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:b.jsx(dn,{size:14})}),b.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:b.jsx(pn,{size:14})}),b.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:b.jsx(fn,{size:14})}),b.jsx(le,{}),at.map((g,m)=>b.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:b.jsx(He,{children:`H${g}`})},g)),b.jsx(le,{}),b.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:b.jsx(kn,{size:14})}),b.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:b.jsx(He,{children:"1."})}),b.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:b.jsx(gn,{size:14})}),b.jsx(le,{}),b.jsx(Hn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=b.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function On(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:at.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Bn=10,Dn=25,Fn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function qn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??Fn[t.type]??""}function Wn(){const t=$.c(4),e=j(),{upload:n}=wn(Pe),r=yn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Bn:Dn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?Tn:vn,c=`${crypto.randomUUID()}${qn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Un=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Et({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Zn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,x,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,x)=>{T===l&&(m=x+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=$t.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Kn(t=!0){const e=j(),{uploadFile:n}=Wn(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Zn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Vn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=be();function ot(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Qn=(()=>{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)}}>`)},Xn=/^(?:[ \t]*(?:\n|$))+/,Jn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yn=/^ {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+|$)/,er=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ct=A(lt).replace(/bull/g,we).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(),tr=A(lt).replace(/bull/g,we).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(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sr=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="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",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ir=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",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ut=A(ye).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",ae).getRegex(),ar=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ut).getRegex(),Ae={blockquote:ar,code:Jn,def:rr,fences:Yn,heading:er,hr:K,html:ir,lheading:ct,list:sr,newline:Xn,paragraph:ut,table:O,text:nr},je=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",ae).getRegex(),or={...Ae,lheading:tr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).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",ae).getRegex()},lr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).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:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{c as $,b as j,r as E,j as b,l as q,ai as vt,t as ue,b7 as Xe,a4 as At,gC as Mt,m as St,K as Ct,bP as Rt,h as Je,o as Et}from"./index-BNmzMNlZ.js";import{a as $t,n as Ye,E as ie,o as _t,x as Lt,y as P,z as It,A as zt,B as et,C as N,G as Ee,H as Pt,I as Ht,J as $e,K as jt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as xe,U as Nt,V as Ot,W as Bt,X as Dt,Y as Ft,s as qt,Z as Wt,u as Ut,b as Gt}from"./usage-stats-DDafRqWC.js";import{T as _,n as Zt,i as Vt,E as Kt}from"./editor-classes-BinXFbFk.js";import{a as Qt,e as nt,s as Xt,S as Jt}from"./suggestion-Dd_Uy5Bv.js";import{B as Yt,c as en,t as tn,C as rt,f as nn,g as _e,s as rn,m as Le,a as Ie,b as sn,d as ze,e as an,h as on,i as ln,j as cn,k as un,l as hn,n as dn}from"./index-iynQP1if.js";import{ai as pn,aj as fn,al as gn,a0 as mn,be as kn,aW as xn}from"./agent-icon-CVEMdYFU.js";import{i as bn}from"./SwitchHorizontal01-DcP8c_x_.js";import{i as wn}from"./Link01-CpcYQ7Qt.js";import{s as yn}from"./Trash01-cH2tYIUn.js";import{i as Tn,b as vn}from"./use-org-fs-BcT14y41.js";import{E as Pe,i as st,b as An,c as Mn,d as it,A as Sn,e as Cn,m as Rn,f as En}from"./markdown-P8cO0xLZ.js";import{d as $n,e as _n,c as Ln,C as In,b as zn}from"./command-N9BazZHl.js";import{I as Pn}from"./icon-button-TQkFyvqB.js";function Hn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Zt(a);if(M===""){g();return}if(!Vt(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx(wn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=b.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let x;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(x=s&&b.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[b.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("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")}),b.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:b.jsx(vt,{size:14})}),h&&b.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:b.jsx(yn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=x):x=e[26];let v;return e[27]!==T||e[28]!==x?(v=b.jsxs("div",{className:"relative",children:[T,x]}),e[27]=T,e[28]=x,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=b.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},at=[1,2,3],jn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Nn(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:On},e[0]=n,e[1]=a):a=e[1];const l=$t(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&b.jsxs(Yt,{editor:n,shouldShow:jn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[b.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:b.jsx(pn,{size:14})}),b.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:b.jsx(fn,{size:14})}),b.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:b.jsx(gn,{size:14})}),b.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:b.jsx(mn,{size:14})}),b.jsx(le,{}),at.map((g,m)=>b.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:b.jsx(He,{children:`H${g}`})},g)),b.jsx(le,{}),b.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:b.jsx(bn,{size:14})}),b.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:b.jsx(He,{children:"1."})}),b.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:b.jsx(kn,{size:14})}),b.jsx(le,{}),b.jsx(Hn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=b.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function On(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:at.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Bn=10,Dn=25,Fn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function qn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??Fn[t.type]??""}function Wn(){const t=$.c(4),e=j(),{upload:n}=Tn(Pe),r=vn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Bn:Dn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?An:Mn,c=`${crypto.randomUUID()}${qn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Un=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new _t({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Zn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,x,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,x)=>{T===l&&(m=x+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Lt.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Kn(t=!0){const e=j(),{uploadFile:n}=Wn(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Zn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Vn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=be();function ot(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Qn=(()=>{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)}}>`)},Xn=/^(?:[ \t]*(?:\n|$))+/,Jn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yn=/^ {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+|$)/,er=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ct=A(lt).replace(/bull/g,we).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(),tr=A(lt).replace(/bull/g,we).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(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sr=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="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",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ir=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",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ut=A(ye).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",ae).getRegex(),ar=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ut).getRegex(),Ae={blockquote:ar,code:Jn,def:rr,fences:Yn,heading:er,hr:K,html:ir,lheading:ct,list:sr,newline:Xn,paragraph:ut,table:O,text:nr},je=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",ae).getRegex(),or={...Ae,lheading:tr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).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",ae).getRegex()},lr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).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:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",ct).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ur=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ht=/^( {2,}|\\)\n(?!\s*$)/,hr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,dr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),dt=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,fr=/(?:[^\s\p{P}\p{S}]|~)/u,gr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mr=A(pt,"u").replace(/punct/g,W).getRegex(),kr=A(pt,"u").replace(/punct/g,dt).getRegex(),ft="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(ft,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),br=A(ft,"gu").replace(/notPunctSpace/g,fr).replace(/punctSpace/g,pr).replace(/punct/g,dt).getRegex(),wr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),yr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),Tr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",vr=A(Tr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Ar=A(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Mr=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(),Sr=A(ve).replace("(?:-->|$)","-->").getRegex(),Cr=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",Sr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Rr=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gt=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),mt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),Er=A("reflink|nolink(?!\\()","g").replace("reflink",gt).replace("nolink",mt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Ar,autolink:Mr,blockSkip:gr,br:ht,code:ur,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:mr,emStrongRDelimAst:xr,emStrongRDelimUnd:wr,escape:cr,link:Rr,nolink:mt,punctuation:dr,reflink:gt,reflinkSearch:Er,tag:Cr,text:hr,url:O},$r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:br,emStrongLDelim:kr,delLDelim:yr,delRDelim:vr,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).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",Ne).getRegex()},_r={...de,br:A(ht).replace("{2,}","*").getRegex(),text:A(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:or,pedantic:lr},U={normal:Se,gfm:de,breaks:_r,pedantic:$r},Lr={"&":"&","<":"<",">":">",'"':""","'":"'"},Oe=t=>Lr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function G(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function Ir(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function zr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Pr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
4
|
`)}var ne=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:G(n,`
|
|
@@ -58,12 +58,12 @@ ${t}</tr>
|
|
|
58
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 r=this.parser.parseInline(n),s=Be(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+z(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Be(t);if(s===null)return z(n);t=s;let i=`<img src="${t}" alt="${z(n)}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Ce=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}},I=class fe{options;renderer;textRenderer;constructor(e){this.options=e||F,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ce}static parse(e,n){return new fe(n).parse(e)}static parseInline(e,n){return new fe(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},Z=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?L.lex:L.lexInline}provideParser(t=this.block){return t?I.parse:I.parseInline}},Hr=class{defaults=be();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=re;TextRenderer=Ce;Lexer=L;Tokenizer=ne;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let a=s[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new re(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=n.renderer[a],o=s[a];s[a]=(...u)=>{let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new ne(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=n.tokenizer[a],o=s[a];s[a]=(...u)=>{let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Z;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=n.hooks[a],o=s[a];Z.passThroughHooks.has(i)?s[a]=u=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(s,u);return o.call(s,h)})();let c=l.call(s,u);return o.call(s,c)}:s[a]=(...u)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(s,u);return h===!1&&(h=await o.apply(s,u)),h})();let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return I.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?L.lex:L.lexInline)(a,s),o=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(o,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser(t):t?I.parse:I.parseInline)(o,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(t):t?L.lex:L.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?I.parse:I.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
59
59
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},B=new Hr;function S(t,e){return B.parse(t,e)}S.options=S.setOptions=function(t){return B.setOptions(t),S.defaults=B.defaults,ot(S.defaults),S};S.getDefaults=be;S.defaults=F;S.use=function(...t){return B.use(...t),S.defaults=B.defaults,ot(S.defaults),S};S.walkTokens=function(t,e){return B.walkTokens(t,e)};S.parseInline=B.parseInline;S.Parser=I;S.parser=I.parse;S.Renderer=re;S.TextRenderer=Ce;S.Lexer=L;S.lexer=L.lex;S.Tokenizer=ne;S.Hooks=Z;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;I.parse;L.lex;const jr=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function Nr(t){return t.flatMap((e,n)=>{var r;if(e.type==="space"||((r=t[n+1])===null||r===void 0?void 0:r.type)==="space")return[e];const s=(e.raw||"").match(jr);return s?[{...e,raw:(e.raw||"").slice(0,-s[0].length)},{type:"space",raw:s[0]}]:[e]})}function Or(t,e){const n=e.split(`
|
|
60
60
|
`).flatMap(r=>[r,""]).map(r=>`${t}${r}`).join(`
|
|
61
|
-
`);return n.slice(0,n.length-1)}function Br(t,e){const n=[];return Array.from(t.entries()).forEach(([r,s])=>{if(!e){n.push(r);return}(e.marks||[]).find(i=>i.type===r&&V(i.attrs,s.attrs))||n.push(r)}),n}function Dr(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{const i=t.get(r);(!i||!V(i.attrs,s.attrs))&&n.push({type:r,mark:s})}),n}function Fr(t,e,n,r){const s=!n,i=n&&(!n.marks||n.marks.length===0),a=n&&n.marks&&!r(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(s||i||a)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,u])=>{n.marks.find(c=>c.type===o&&V(c.attrs,u.attrs))||l.push(o)}):(s||i)&&l.push(...Array.from(t.keys()).reverse())),l}function qr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=e(r,t.get(r));s&&(n=s+n)}),t.clear(),n}function Wr(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const a=n(s,i);a&&(r+=a),e.set(s,i)}),r}function ce(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 Ur=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"]),Gr=/<\/?([a-zA-Z][\w-]*)/g;function Zr(t){const e=[];let n;for(;(n=Gr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function Vr(t){const e=t.toLowerCase();return e.includes("-")?!1:!Ur.has(e)}function Kr(t,e){return Zr(t).some(n=>Vr(n)?!e.has(n):!1)}var qe=class{constructor(t){var e,n,r,s,i;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:S,this.indentStyle=(n=t==null||(r=t.indentation)===null||r===void 0?void 0:r.style)!==null&&n!==void 0?n:"space",this.indentSize=(s=t==null||(i=t.indentation)===null||i===void 0?void 0:i.size)!==null&&s!==void 0?s: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,
|
|
61
|
+
`);return n.slice(0,n.length-1)}function Br(t,e){const n=[];return Array.from(t.entries()).forEach(([r,s])=>{if(!e){n.push(r);return}(e.marks||[]).find(i=>i.type===r&&V(i.attrs,s.attrs))||n.push(r)}),n}function Dr(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{const i=t.get(r);(!i||!V(i.attrs,s.attrs))&&n.push({type:r,mark:s})}),n}function Fr(t,e,n,r){const s=!n,i=n&&(!n.marks||n.marks.length===0),a=n&&n.marks&&!r(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(s||i||a)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,u])=>{n.marks.find(c=>c.type===o&&V(c.attrs,u.attrs))||l.push(o)}):(s||i)&&l.push(...Array.from(t.keys()).reverse())),l}function qr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=e(r,t.get(r));s&&(n=s+n)}),t.clear(),n}function Wr(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const a=n(s,i);a&&(r+=a),e.set(s,i)}),r}function ce(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 Ur=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"]),Gr=/<\/?([a-zA-Z][\w-]*)/g;function Zr(t){const e=[];let n;for(;(n=Gr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function Vr(t){const e=t.toLowerCase();return e.includes("-")?!1:!Ur.has(e)}function Kr(t,e){return Zr(t).some(n=>Vr(n)?!e.has(n):!1)}var qe=class{constructor(t){var e,n,r,s,i;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:S,this.indentStyle=(n=t==null||(r=t.indentation)===null||r===void 0?void 0:r.style)!==null&&n!==void 0?n:"space",this.indentSize=(s=t==null||(i=t.indentation)===null||i===void 0?void 0:i.size)!==null&&s!==void 0?s: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,It(zt(t.extensions)).forEach(a=>this.registerExtension(a)))}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 r=et(N(t,"code")),s=t.name;r&&this.codeTypes.add(s),this.extensionRanks.has(s)||this.extensionRanks.set(s,this.extensionRanks.size);const i=N(t,"markdownTokenName")||s,a=N(t,"parseMarkdown"),l=N(t,"renderMarkdown"),o=N(t,"markdownTokenizer"),u=(e=N(t,"markdownOptions"))!==null&&e!==void 0?e:null,c={tokenName:i,nodeName:s,parseMarkdown:a,renderMarkdown:l,isIndenting:(n=u?.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:u?.htmlReopen,tokenizer:o};if(i&&a){const h=this.registry.get(i)||[];h.push(c),this.registry.set(i,h)}if(l){const h=this.nodeTypeRegistry.get(s)||[];h.push(c),this.nodeTypeRegistry.set(s,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:r="inline",tokenize:s}=t,i=this.createTokenizerHelpers.bind(this),a=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:u=>u.indexOf(n):l=u=>{const c=s(u,[],this.createTokenizerHelpers(this.createLexer()));return c&&c.raw?u.indexOf(c.raw):-1};const o={name:e,level:r,start:l,tokenizer(u,c){const h=this.lexer?i(this.lexer):i(a()),d=s(u,c,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 r=n.lex(t);return{type:"doc",content:this.parseTokens(r,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const n=e?Nr(t):t,r=n.reduce((a,l,o)=>(l.type!=="space"&&a.push(o),a),[]);let s=-1,i=0;return n.flatMap((a,l)=>{for(;i<r.length&&r[i]<l;)s=r[i],i+=1;if(e&&a.type==="space"){var o;const c=(o=r[i])!==null&&o!==void 0?o:-1;return this.createImplicitEmptyParagraphsFromSpace(a,s,c)}const u=this.parseToken(a,e);return u===null?[]:Array.isArray(u)?u:[u]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const s=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:s},()=>({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),r=this.createParseHelpers();if(n.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,r),a=this.normalizeParseResult(i);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,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>ce(l).isTask),n=t.items.some(l=>!ce(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:u,checked:c,indentLevel:h}=ce(o);let d=o;if(u){const p=(o.raw||o.text||"").split(`
|
|
63
63
|
`),g=p[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),m=g?g[2]:"";let k=[];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)),x=w.map(v=>v.trim()?v.slice(T):"").join(`
|
|
65
65
|
`).trim();x&&(k=this.markedInstance.lexer(`${x}
|
|
66
|
-
`))}}d={type:"taskItem",raw:"",mainContent:m,indentLevel:h,checked:c??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=u?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[d],i=f):s.push(d)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],u={...t,type:o.type,items:o.items},c=this.parseToken(u);c&&(Array.isArray(c)?a.push(...c):a.push(c))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);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)}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 r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},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 a=0;a<t.length;a+=1){const l=t[a];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,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&c&&!/\/>$/.test(o)){const d=c[1],f=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const w=t[k],y=((s=(i=w.raw)!==null&&i!==void 0?i:w.text)!==null&&s!==void 0?s:"").toString();if(m.push(y),w.type==="html"&&p.test(y)){g=k;break}}if(g!==-1){const k=m.join(""),w={type:"html",raw:k,text:k,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}a=g;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 u=this.createParseHelpers(),c=o.parseMarkdown(l,u);if(this.isMarkResult(c)){const h=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...h)}else{const h=this.normalizeParseResult(c);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const u=l.marks||[],c=o.marks||[];It(u,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.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=zt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r: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 Kr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.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(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(Pt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,h)=>{const d=a.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,h||"",n,d):this.renderNodes(c,t,h||"",n,d)},renderChild:(c,h)=>{const d=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,h,d)},indent:c=>this.indentString+c,wrapInBlock:Or},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,u)=>{const c=u<t.length-1?t[u+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(x=>[x.type,x])),f=this.getMarksToOpenForSerialization(i,d,c),p=Br(d,c),g=p.filter(x=>i.has(x)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const x=h.match(/(\s+)$/);x&&(k=x[1],h=h.slice(0,-k.length))}m||p.slice().reverse().forEach(x=>{if(!i.has(x))return;const v=d.get(x),M=this.getMarkClosing(x,v,l.get(x));M&&(h+=M),i.has(x)&&(i.delete(x),l.delete(x))});let w="";if(f.length>0){const x=h.match(/^(\s+)/);x&&(w=x[1],h=h.slice(w.length))}f.forEach(({type:x,mark:v})=>{const M=a.has(x)?"html":"markdown",C=this.getMarkOpening(x,v,M);C&&(h=C+h),l.set(x,M),a.delete(x)}),m||f.slice().reverse().forEach(({type:x,mark:v})=>{i.set(x,v)}),h=w+h;let y;if(m){const x=new Set((c?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{x.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const v=Array.from(i.keys()),M=g.slice().sort((C,Tt)=>v.indexOf(Tt)-v.indexOf(C));y=[...f.map(C=>C.type),...M]}else y=Fr(i,d,c,this.markSetsEqual.bind(this));let T="";if(y.length>0){const x=h.match(/(\s+)$/);x&&(T=x[1],h=h.slice(0,-T.length))}y.forEach(x=>{var v;const M=(v=i.get(x))!==null&&v!==void 0?v:d.get(x),C=this.getMarkClosing(x,M,l.get(x));C&&(h+=C),i.delete(x),l.delete(x)}),h+=T,h+=k,s.push(h)}else{const h=new Set((o.marks||[]).map(k=>k.type)),d=new Map,f=new Map;i.forEach((k,w)=>{if(h.has(w)){var y;d.set(w,k),f.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=qr(i,(k,w)=>this.getMarkClosing(k,w,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,u,r),m=o.type==="hardBreak"?"":Wr(d,i,(k,w)=>{var y;const T=(y=f.get(k))!==null&&y!==void 0?y:"markdown";return l.set(k,T),this.getMarkOpening(k,w,T)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:c=>c,wrapInBlock:(c,h)=>c+h},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a);return u>=0?o.substring(0,u):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a),c=u+33;return u>=0?o.substring(c):""}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,r])=>{const s=e.get(n);return s&&V(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Dr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(u,c)=>s.some(h=>h.type===u&&V(h.attrs,c)),a=(u,c)=>{var h,d;const f=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return f!==p?p-f:u.type.localeCompare(c.type)},l=r.filter(u=>!i(u.type,u.mark.attrs)).sort(a),o=r.filter(u=>i(u.type,u.mark.attrs)).sort(a);return[...l,...o]}};const Qr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,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 se(t){return t==="left"||t==="right"||t==="center"?t:null}function Xr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Jr(t){return se(t?.align)}function kt(){return{default:null,parseHTML:t=>Xr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function Yr(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function xt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):Yr(t)}const es=/[ \t\r\n\f]+/g;function bt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(es,"")===""}function wt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ts=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:xt},align:kt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>wt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),ns=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:xt},align:kt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>wt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function We(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],w=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==w){const[y,T]=ge(r,k);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,x]=ge(r,k);y.style.setProperty(T,x),e.appendChild(y)}}}for(;o;){var c;const d=o.nextSibling;(c=o.parentNode)===null||c===void 0||c.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=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var ss=class{constructor(t,e,n,r={}){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[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),We(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,We(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function is(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let c=0,h=0;c<l.childCount;c+=1){const{colspan:d,colwidth:f}=l.child(c).attrs;for(let p=0;p<d;p+=1,h+=1){const g=n===h?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",u=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:u}}function Ue(t,e){return t.createAndFill()}function as(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function os(t,e,n,r,s){const i=as(t),a=[],l=[];for(let u=0;u<n;u+=1){const c=Ue(i.cell);if(c&&l.push(c),r){const h=Ue(i.header_cell);h&&a.push(h)}}const o=[];for(let u=0;u<e;u+=1)o.push(i.row.createChecked(null,r&&u===0?a:l));return i.table.createChecked(null,o)}function ls(t){return t instanceof rt}const J=({editor:t})=>{const{selection:e}=t.state;if(!ls(e))return!1;let n=0;const r=Y(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ge(t,e){const n=t.mapping.map(e),r=Y(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(tt.near(t.doc.resolve(i),-1))}function cs(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 r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function us(t){return t.split(`
|
|
66
|
+
`))}}d={type:"taskItem",raw:"",mainContent:m,indentLevel:h,checked:c??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=u?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[d],i=f):s.push(d)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],u={...t,type:o.type,items:o.items},c=this.parseToken(u);c&&(Array.isArray(c)?a.push(...c):a.push(c))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);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)}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 r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},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 a=0;a<t.length;a+=1){const l=t[a];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,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&c&&!/\/>$/.test(o)){const d=c[1],f=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const w=t[k],y=((s=(i=w.raw)!==null&&i!==void 0?i:w.text)!==null&&s!==void 0?s:"").toString();if(m.push(y),w.type==="html"&&p.test(y)){g=k;break}}if(g!==-1){const k=m.join(""),w={type:"html",raw:k,text:k,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}a=g;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 u=this.createParseHelpers(),c=o.parseMarkdown(l,u);if(this.isMarkResult(c)){const h=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...h)}else{const h=this.normalizeParseResult(c);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const u=l.marks||[],c=o.marks||[];Pt(u,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.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=Ht(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r: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 Kr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.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(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(jt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,h)=>{const d=a.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,h||"",n,d):this.renderNodes(c,t,h||"",n,d)},renderChild:(c,h)=>{const d=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,h,d)},indent:c=>this.indentString+c,wrapInBlock:Or},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,u)=>{const c=u<t.length-1?t[u+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(x=>[x.type,x])),f=this.getMarksToOpenForSerialization(i,d,c),p=Br(d,c),g=p.filter(x=>i.has(x)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const x=h.match(/(\s+)$/);x&&(k=x[1],h=h.slice(0,-k.length))}m||p.slice().reverse().forEach(x=>{if(!i.has(x))return;const v=d.get(x),M=this.getMarkClosing(x,v,l.get(x));M&&(h+=M),i.has(x)&&(i.delete(x),l.delete(x))});let w="";if(f.length>0){const x=h.match(/^(\s+)/);x&&(w=x[1],h=h.slice(w.length))}f.forEach(({type:x,mark:v})=>{const M=a.has(x)?"html":"markdown",C=this.getMarkOpening(x,v,M);C&&(h=C+h),l.set(x,M),a.delete(x)}),m||f.slice().reverse().forEach(({type:x,mark:v})=>{i.set(x,v)}),h=w+h;let y;if(m){const x=new Set((c?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{x.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const v=Array.from(i.keys()),M=g.slice().sort((C,Tt)=>v.indexOf(Tt)-v.indexOf(C));y=[...f.map(C=>C.type),...M]}else y=Fr(i,d,c,this.markSetsEqual.bind(this));let T="";if(y.length>0){const x=h.match(/(\s+)$/);x&&(T=x[1],h=h.slice(0,-T.length))}y.forEach(x=>{var v;const M=(v=i.get(x))!==null&&v!==void 0?v:d.get(x),C=this.getMarkClosing(x,M,l.get(x));C&&(h+=C),i.delete(x),l.delete(x)}),h+=T,h+=k,s.push(h)}else{const h=new Set((o.marks||[]).map(k=>k.type)),d=new Map,f=new Map;i.forEach((k,w)=>{if(h.has(w)){var y;d.set(w,k),f.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=qr(i,(k,w)=>this.getMarkClosing(k,w,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,u,r),m=o.type==="hardBreak"?"":Wr(d,i,(k,w)=>{var y;const T=(y=f.get(k))!==null&&y!==void 0?y:"markdown";return l.set(k,T),this.getMarkOpening(k,w,T)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:c=>c,wrapInBlock:(c,h)=>c+h},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a);return u>=0?o.substring(0,u):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a),c=u+33;return u>=0?o.substring(c):""}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,r])=>{const s=e.get(n);return s&&V(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Dr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(u,c)=>s.some(h=>h.type===u&&V(h.attrs,c)),a=(u,c)=>{var h,d;const f=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return f!==p?p-f:u.type.localeCompare(c.type)},l=r.filter(u=>!i(u.type,u.mark.attrs)).sort(a),o=r.filter(u=>i(u.type,u.mark.attrs)).sort(a);return[...l,...o]}};const Qr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,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 se(t){return t==="left"||t==="right"||t==="center"?t:null}function Xr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Jr(t){return se(t?.align)}function kt(){return{default:null,parseHTML:t=>Xr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function Yr(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function xt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):Yr(t)}const es=/[ \t\r\n\f]+/g;function bt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(es,"")===""}function wt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ts=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:xt},align:kt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>wt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),ns=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:xt},align:kt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>wt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function We(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],w=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==w){const[y,T]=ge(r,k);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,x]=ge(r,k);y.style.setProperty(T,x),e.appendChild(y)}}}for(;o;){var c;const d=o.nextSibling;(c=o.parentNode)===null||c===void 0||c.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=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var ss=class{constructor(t,e,n,r={}){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[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),We(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,We(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function is(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let c=0,h=0;c<l.childCount;c+=1){const{colspan:d,colwidth:f}=l.child(c).attrs;for(let p=0;p<d;p+=1,h+=1){const g=n===h?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",u=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:u}}function Ue(t,e){return t.createAndFill()}function as(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function os(t,e,n,r,s){const i=as(t),a=[],l=[];for(let u=0;u<n;u+=1){const c=Ue(i.cell);if(c&&l.push(c),r){const h=Ue(i.header_cell);h&&a.push(h)}}const o=[];for(let u=0;u<e;u+=1)o.push(i.row.createChecked(null,r&&u===0?a:l));return i.table.createChecked(null,o)}function ls(t){return t instanceof rt}const J=({editor:t})=>{const{selection:e}=t.state;if(!ls(e))return!1;let n=0;const r=Y(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ge(t,e){const n=t.mapping.map(e),r=Y(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(tt.near(t.doc.resolve(i),-1))}function cs(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 r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function us(t){return t.split(`
|
|
67
67
|
`).map(e=>!e.includes("|")||!e.includes("`")?e:cs(e)).join(`
|
|
68
68
|
`)}function hs(t){return(t||"").replace(/\s+/g," ").trim()}function ds(t,e,n={}){var r;const s=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";const i=[];t.content.forEach(p=>{const g=[];p.content&&p.content.forEach(m=>{let k="";m.content&&Array.isArray(m.content)&&m.content.length>1?k=m.content.map(x=>e.renderChildren(x)).join(s):k=m.content?e.renderChildren(m.content):"";const w=hs(k.split(s).join(`
|
|
69
69
|
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",T=Jr(m.attrs);g.push({text:w,isHeader:y,align:T})}),i.push(g)});const a=i.reduce((p,g)=>Math.max(p,g.length),0);if(a===0)return"";const l=Array.from({length:a}).fill(0);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;const k=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;k>l[m]&&(l[m]=k),l[m]<3&&(l[m]=3)}});const o=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),u=i[0],c=u.some(p=>p.isHeader),h=Array.from({length:a}).fill(null);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;!h[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(h[m]=p[m].align)}});let d=`
|
|
@@ -77,7 +77,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
77
77
|
`);if(i.length<2)return;const a=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const l=us(s);if(l===s)return;const o=n.blockTokens(l)[0];if(o?.type!=="table"||!o.raw)return;const u=o.raw.split(`
|
|
78
78
|
`).length,c=t.split(`
|
|
79
79
|
`).slice(0,u).join(`
|
|
80
|
-
`);return{...o,raw:c}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:s,editor:i})=>{const a=os(i.schema,t,e,n);if(s){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(tt.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>
|
|
81
|
-
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Rs(n.doc,s.from,s.text.length)===s.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"?(yt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[
|
|
80
|
+
`);return{...o,raw:c}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:s,editor:i})=>{const a=os(i.schema,t,e,n);if(s){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(tt.near(r.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,r=>r.type.name==="table");return un(t,e&&(r=>{n&&Ge(r,n.pos),e(r)}))},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,r=>r.type.name==="table");return on(t,e&&(r=>{n&&Ge(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>an(t,e),mergeCells:()=>({state:t,dispatch:e})=>Le(t,e),splitCell:()=>({state:t,dispatch:e})=>Ie(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ze("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ze("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>sn(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Le(t,e)?!0:Ie(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>rn(t,e)(n,r),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 r=rt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}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:r,HTMLAttributes:s})=>{const i=H(this.options.HTMLAttributes,s);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:et(N(t,"tableRole",e))}}}),fs=ie.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(ps.configure(this.options.table)),this.options.tableCell!==!1&&t.push(ts.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(ns.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(rs.configure(this.options.tableRow)),t}});function gs(t){const e=$.c(13),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==u?(c=q(Sn,"select-none",u),e[0]=u,e[1]=c):c=e[1];let h;e[2]!==i||e[3]!==s.isEditable||e[4]!==a?(h=s.isEditable&&b.jsx("button",{type:"button","aria-label":a("markdownEditor.removeFile"),onMouseDown:ms,onClick:i,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:b.jsx(Xe,{size:14})}),e[2]=i,e[3]=s.isEditable,e[4]=a,e[5]=h):h=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==h?(d=b.jsx(Cn,{href:l,name:o,children:h}),e[6]=l,e[7]=o,e[8]=h,e[9]=d):d=e[9];let f;return e[10]!==c||e[11]!==d?(f=b.jsx(xe,{as:"span",className:c,children:d}),e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function ms(t){return t.preventDefault()}function ks(t){return t.replace(/([[\]])/g,"\\$1")}const xs=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]",getAttrs:t=>it(t.getAttribute("href")??"")?null:!1}]},renderHTML({HTMLAttributes:t,node:e}){return["a",H(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`[${ks(n)}](${e})`},addNodeView(){return ke(gs)}});function bs(t){const e=$.c(5),{node:n,selected:r}=t,s=typeof n.attrs.name=="string"?n.attrs.name:"",i=r&&"ring-2 ring-ring";let a;e[0]!==i?(a=q("select-none rounded px-1 font-medium text-primary","bg-primary/10",i),e[0]=i,e[1]=a):a=e[1];let l;return e[2]!==s||e[3]!==a?(l=b.jsxs(xe,{as:"span","data-testid":"mention-chip",className:a,children:["@",s]}),e[2]=s,e[3]=a,e[4]=l):l=e[4],l}const ws=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",H(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?Rn(e,n):`@${n}`},addNodeView(){return ke(bs)}}),ys="studio.mention-members.",me=new Map;function Ze(t){const e=me.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const r=JSON.parse(n);if(!Array.isArray(r))return;const s=r.filter(i=>!!i&&typeof i.id=="string"&&typeof i.name=="string");return me.set(t,s),s}catch{return}}function Ts(t,e){me.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function vs(t,e){if(!t?.length)return e;const n=new Map(t.map(r=>[r.id,r]));return e.map(r=>{const s=n.get(r.id);return s&&s.name===r.name&&s.email===r.email&&s.image===r.image?s:r})}function As(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 Ms(t){const e=$.c(17),{locator:n}=At(),r=Mt(),s=`${ys}${n}`;let i;e[0]!==n?(i=Ct.mentionMembers(n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=()=>Ze(s),e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r||e[5]!==s?(l=async()=>{const f=await r.organization.listMembers(),p=vs(Ze(s),As(f?.data?.members??[]));return Ts(s,p),p},e[4]=r,e[5]=s,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==i||e[9]!==a||e[10]!==l?(o={queryKey:i,enabled:t,staleTime:0,placeholderData:a,queryFn:l},e[7]=t,e[8]=i,e[9]=a,e[10]=l,e[11]=o):o=e[11];const u=St(o);let c;e[12]!==u.data?(c=u.data??[],e[12]=u.data,e[13]=c):c=e[13];const h=u.isFetching&&!u.data;let d;return e[14]!==c||e[15]!==h?(d={members:c,loading:h},e[14]=c,e[15]=h,e[16]=d):d=e[16],d}const Ve={query:"",range:null,rect:null,editor:null};class Ss{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 Re=new Ye("markdownEditorMention");function Cs(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),nt(t.view,Re)}function Rs(t,e,n){const r=Math.min(e+n,t.content.size);return e>=r?"":t.textBetween(e,r,"","")}function yt(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,"")}),nt(t.view,Re)}function Es(t){return ie.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Re,allowedPrefixes:[" ",`
|
|
81
|
+
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Rs(n.doc,s.from,s.text.length)===s.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"?(yt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Qt(e)]}})}const Ke=256,$s=40,Qe=280,_s=140;function Ls(t){const e=$.c(4),{store:n}=t,r=E.useSyncExternalStore(n.subscribe,n.getSnapshot),s=r.range!==null;let i;return e[0]!==s||e[1]!==r||e[2]!==n?(i=s?b.jsx(Is,{store:n,state:r}):null,e[0]=s,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}function Is({store:t,state:e}){const n=j(),{members:r,loading:s}=Ms(!0),[i,a]=E.useState(e.query),[l,o]=E.useState(null),u=zs(e.editor),c=u.getBoundingClientRect(),h=u===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):c,d=e.rect?.()??new DOMRect(0,0,0,0),f=h.bottom-d.bottom,p=f<Qe&&d.top-h.top>f,g=(p?d.top-h.top:f)-8,m=Math.min(Qe,Math.max(g,_s))-$s,k={position:"absolute",width:Ke,left:Math.min(d.left,h.right-Ke-8)-c.left,...p?{bottom:c.bottom-d.top+6}:{top:d.bottom-c.top+6}},w=()=>{e.editor&&yt(e.editor,t),t.close()},y=x=>{const v=x.relatedTarget;if((!v||e.editor?.view.dom.contains(v)===!0)&&t.latched){l?.focus();return}w()},T=x=>{!e.editor||!e.range||(Cs(e.editor,e.range,x),t.close())};return Rt.createPortal(b.jsx("div",{style:k,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:b.jsxs($n,{onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),w(),e.editor?.commands.focus())},children:[b.jsx(_n,{ref:o,autoFocus:!0,onFocus:()=>{t.latched=!0},value:i,onValueChange:a,placeholder:n("markdownEditor.mentionSearch"),onBlur:y}),b.jsxs(Ln,{style:{maxHeight:m},children:[s?b.jsx("div",{className:"flex items-center justify-center py-6",children:b.jsx(Je,{size:"sm"})}):b.jsx(In,{children:n("markdownEditor.mentionEmpty")}),r.map(x=>b.jsxs(zn,{value:`${x.name} ${x.email}`,onSelect:()=>T(x),onMouseDown:v=>v.preventDefault(),className:"gap-2",children:[b.jsx(Et,{url:x.image??void 0,fallback:x.name??"?",shape:"circle",size:"xs"}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name})]},x.id))]})]})}),u)}function zs(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}const Ps=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Hs=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",H(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,a;const l=(e=(n=t.attrs)===null||n===void 0?void 0:n.src)!==null&&e!==void 0?e:"",o=(r=(s=t.attrs)===null||s===void 0?void 0:s.alt)!==null&&r!==void 0?r:"",u=(i=(a=t.attrs)===null||a===void 0?void 0:a.title)!==null&&i!==void 0?i:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,s=new Set(["src","width","height"]);return({node:i,getPos:a,HTMLAttributes:l,editor:o})=>{const u=document.createElement("img");u.draggable=!1;const c=H(this.options.HTMLAttributes,l);Object.entries(c).forEach(([k,w])=>{if(w!=null)switch(k){case"src":case"width":case"height":break;default:u.setAttribute(k,w)}}),c.src!==null&&(u.src=c.src);let h={...l};const d=k=>{if(typeof k=="string"&&k!==""){u.getAttribute("src")!==k&&(u.src=k);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};d(l.src);const f=k=>{if(k.type!==i.type)return!1;const w=o.extensionManager.attributes.filter(T=>T.type===k.type.name),y=Bt(k,w);return Object.keys(h).forEach(T=>{!s.has(T)&&!(T in y)&&u.removeAttribute(T)}),Object.entries(y).forEach(([T,x])=>{s.has(T)||(x!=null?u.setAttribute(T,x):u.removeAttribute(T))}),d(y.src),h=y,!0},p=new Ot({element:u,editor:o,node:i,getPos:a,onResize:(k,w)=>{u.style.width=`${k}px`,u.style.height=`${w}px`},onCommit:(k,w)=>{const y=a();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:k,height:w}).run()},onUpdate:f,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),g=p.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",u.complete&&u.naturalWidth>0?m():(u.onload=m,u.onerror=m),p}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Nt({find:Ps,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var js=Hs;function Ns(t){const e=$.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let u;e[0]!==o||e[1]!==a?(u=o||a("markdownEditor.imageAltFallback"),e[0]=o,e[1]=a,e[2]=u):u=e[2];const c=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==c?(h=q("max-h-[420px] max-w-full rounded-lg border border-border object-contain",c),e[3]=c,e[4]=h):h=e[4];let d;e[5]!==l||e[6]!==u||e[7]!==h?(d=b.jsx("img",{src:l,alt:u,draggable:!1,className:h}),e[5]=l,e[6]=u,e[7]=h,e[8]=d):d=e[8];let f;e[9]!==i||e[10]!==s.isEditable||e[11]!==a?(f=s.isEditable&&b.jsx("button",{type:"button","aria-label":a("markdownEditor.removeImage"),onMouseDown:Os,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg bg-card text-muted-foreground opacity-0 shadow-edge transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:b.jsx(Xe,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=a,e[12]=f):f=e[12];let p;return e[13]!==d||e[14]!==f?(p=b.jsxs(xe,{className:"group/image relative my-3 w-fit max-w-full",children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15],p}function Os(t){return t.preventDefault()}const Bs=js.extend({addNodeView(){return ke(Ns)}}).configure({inline:!1,allowBase64:!1}),Ds={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Fs=Dt.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(it(n))return e.createNode("attachment",{href:n,name:t.text??""});const r=En(n);return r?e.createNode("mention",{id:r,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function qs(t="",e){return[qt.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Fs.configure(Ds),Xt.configure({placeholder:t}),fs,Ft,Wt.configure({nested:!0}),Bs,xs,Un,ws,...e?[Es(e)]:[],Qr.configure({markedOptions:{breaks:!0}})]}const Ws=/^(\s*)([-*+]|\d+[.)])\s+\S/,Us=/^\s*(```|~~~)/,Gs=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Zs(t){const e=[];let n=!1,r=!1;for(const s of t.split(`
|
|
82
82
|
`)){if(Us.test(s)){n=!n,r=!1,e.push(s);continue}if(n){e.push(s);continue}if(Ws.test(s)){r=!0,e.push(s);continue}if(!s.trim()){r=!1,e.push(s);continue}if(r&&Gs.test(s)){e[e.length-1]=`${e[e.length-1]} ${s.trim()}`;continue}r=!1,e.push(s)}return e.join(`
|
|
83
|
-
`)}function Vs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=b.jsx(
|
|
83
|
+
`)}function Vs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=b.jsx(xn,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let u;e[4]!==r||e[5]!==a?(u=b.jsx(Pn,{type:"button",label:a,disabled:r,onClick:l,children:o}),e[4]=r,e[5]=a,e[6]=u):u=e[6];let c;e[7]!==n?(c=b.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:d=>{const f=Array.from(d.target.files??[]);d.target.value="",f.length>0&&n(f)}}),e[7]=n,e[8]=c):c=e[8];let h;return e[9]!==u||e[10]!==c?(h=b.jsxs(b.Fragment,{children:[u,c]}),e[9]=u,e[10]=c,e[11]=h):h=e[11],h}function Ks(t){const e=$.c(6),{pending:n}=t,r=j();if(n===0)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=b.jsx(Je,{className:"size-3"}),e[0]=s):s=e[0];let i;e[1]!==n||e[2]!==r?(i=n===1?r("markdownEditor.uploading"):r("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==i?(a=b.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[s,i]}),e[4]=i,e[5]=a):a=e[5],a}const Qs=["outline-none","[&>*: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-sm","[&_pre_code]:bg-transparent [&_pre_code]:p-0",Kt,"[&_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(" "),Xs=["[&_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 Js(t){const e=$.c(10),{editor:n,mentions:r}=t,s=r.items;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["markdown-editor-mentions"],e[0]=i):i=e[0];let a;e[1]!==s?(a=u=>{const{query:c}=u,h=c.trim().toLowerCase();return Promise.resolve(h?s.filter(d=>`${d.name} ${d.title??""}`.toLowerCase().includes(h)):s)},e[1]=s,e[2]=a):a=e[2];let l;e[3]!==n?(l=u=>{const{range:c,item:h}=u;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${h.name}`,marks:h.href?[{type:"link",attrs:{href:h.href}}]:void 0},{type:"text",text:" "}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==r.emptyLabel||e[7]!==a||e[8]!==l?(o=b.jsx(Jt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:i,queryFn:a,emptyLabel:r.emptyLabel,renderItem:Ys,onSelect:l}),e[5]=n,e[6]=r.emptyLabel,e[7]=a,e[8]=l,e[9]=o):o=e[9],o}function Ys(t){return b.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[b.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&b.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function pi({defaultValue:t,onChange:e,placeholder:n,editable:r=!0,attachments:s=!0,mentions:i,inline:a=!1}){const l=Kn(s),[o]=E.useState(()=>new Ss),u=E.useRef(e);u.current=e;const c=Ut({extensions:qs(n,i?void 0:o),content:Zs(t),contentType:"markdown",editable:r,autofocus:a?"end":!1,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:q(Qs,!a&&"min-h-[200px] sm:min-h-[320px]",Xs)},handlePaste:l.handlePaste,handleDrop:l.handleDrop},onUpdate:({editor:h,transaction:d})=>{d.docChanged&&u.current(h.getMarkdown())}});return c?b.jsxs("div",{className:"flex flex-col",children:[b.jsx(Nn,{editor:c}),!i&&b.jsx(Ls,{store:o}),b.jsx(Gt,{editor:c,className:q(a?"text-sm text-foreground":"text-base text-muted-foreground")}),r&&i&&b.jsx(Js,{editor:c,mentions:i}),b.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[r&&i?.hint&&b.jsx("span",{children:i.hint}),r&&s&&b.jsx(Vs,{onFiles:h=>l.uploadInto(c.view,h,c.state.selection.to)}),b.jsx(Ks,{pending:l.pending})]})]}):null}export{Vs as A,Ss as M,Un as U,ws as a,Qr as b,Bs as c,xs as d,Re as e,Ls as f,Ks as g,pi as h,Es as m,Kn as u};
|