dorkos 0.119.0 → 0.121.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/bin/cli.js +3332 -2835
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-DPEGtCwv.js → AboutPage-CtI8gbER.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-ENqFKw2l.js → ActivityErrorState-CHTXfBS7.js} +1 -1
- package/dist/client/assets/{ActivityPage-Bh3Fhkkr.js → ActivityPage-B8p4yYJL.js} +1 -1
- package/dist/client/assets/{ActivityRow-Mj9YGZo2.js → ActivityRow-CSuSz-92.js} +1 -1
- package/dist/client/assets/{AdapterIcon-BcejWkC-.js → AdapterIcon-Qnxn0cE5.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-CEnUjD84.js → AdapterSetupWizard-BG8H-Lld.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-DcKMOkUs.js → AgentOptionRow-BWFQFynn.js} +1 -1
- package/dist/client/assets/{AgentPicker-W6XeKjz9.js → AgentPicker-CL93SET3.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-C8xPf4Ij.js → AgentRequestCard-CamX7Tvr.js} +3 -3
- package/dist/client/assets/{AppearancePage-uoWRNL1C.js → AppearancePage-rN70_7ih.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-C5Nf8pjH.js → ApplyToOverridesDialog-DeWaXbgm.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-BI-uQ-ay.js → AttentionSignalRow-CKcSWExi.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cpi-0c7y.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BwYaLf2P.js} +1 -1
- package/dist/client/assets/{BindingDialog-B3vCYvfL.js → BindingDialog-DqPDLYbF.js} +1 -1
- package/dist/client/assets/BlintzCanvas-DoAZs5bz.js +1231 -0
- package/dist/client/assets/{BlintzCanvas-GgiCXV7C.css → BlintzCanvas-xZ3u3nk7.css} +1 -1
- package/dist/client/assets/{CanvasCsvContent-DtZuAo03.js → CanvasCsvContent-ViqRJuhW.js} +1 -1
- package/dist/client/assets/CanvasFileContent-ClcHZ_l-.js +2 -0
- package/dist/client/assets/{CanvasModel3dContent-BlYcTOLd.js → CanvasModel3dContent-Cm3msNdQ.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-B996C06C.js → ChatAppsOff-D0PbHYqF.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-UfNeO6Wa.js → CodeMirrorDiff-DFNSXeuV.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BMSnTJnS.js → CodeMirrorEditor-AgkgsSqN.js} +1 -1
- package/dist/client/assets/{CommitmentList-LBnn140g.js → CommitmentList-0V6QivXH.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-BNEP939u.js → CommitmentsPage-i3XoHwBj.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-C97PoLhs.js → ComputerResourceView-RPoBc-km.js} +1 -1
- package/dist/client/assets/{ComputerViewer-DVaP4S-x.js → ComputerViewer-2ugaCd0H.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-COotkMKW.js → ConnectionAccessLists-DaPP4U96.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-DMqldmCl.js → ConnectionsPage-BVqYvfk5.js} +2 -2
- package/dist/client/assets/{ConventionPage-DXcAUNjb.js → ConventionPage-BoqncrFd.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-Cx-zCEnS.js → ExtensionPageRoute-BrOEeNX3.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-U9QmMzNM.js → FloatingTanStackRouterDevtools-CqogiFob-DLwix3K7.js} +1 -1
- package/dist/client/assets/HandlePage-B_5GLHsp.js +1 -0
- package/dist/client/assets/{HeartbeatPage-lS53N7qR.js → HeartbeatPage-DgXhbaBJ.js} +1 -1
- package/dist/client/assets/KeyEntry-CRr32Ae5.js +1 -0
- package/dist/client/assets/{LexicalField-NpV0yrX5.js → LexicalField-DeAoA6yr.js} +1 -1
- package/dist/client/assets/{ManagesPage-Dvjt_Ql0.js → ManagesPage-ZBWYLTZx.js} +1 -1
- package/dist/client/assets/{Marketplace-BXrL6XrG.js → Marketplace-iL5p8Omt.js} +4 -4
- package/dist/client/assets/{MarketplaceSourcesView-Xm9UboIG.js → MarketplaceSourcesView-CsNLVOdP.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BOhSmDHb.js → McpAppFrame-B1WPswgk.js} +1 -1
- package/dist/client/assets/McpSigninBody-CJ28yu0o.js +1 -0
- package/dist/client/assets/{Model3dViewer-B0efG9VW.js → Model3dViewer-BIZWdK8g.js} +1 -1
- package/dist/client/assets/NamePage-0nr288eM.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-BOwmahin.js → NewDirectMessageMenu-DRx9e9kM.js} +1 -1
- package/dist/client/assets/{NotificationsPage-pQg9DtG3.js → NotificationsPage-cfqgSuVy.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-C5dCRdqs.js → OpenMeshSwitch-BIIuKDku.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-CgSvpX-s.js → OperatorIdentityForm-BKUSGrs6.js} +1 -1
- package/dist/client/assets/{PermissionHistory-ChEe8iYR.js → PermissionHistory-Ctdqhib6.js} +1 -1
- package/dist/client/assets/{PermissionsPage-C8gICIw9.js → PermissionsPage-CYA_zdrV.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DcuHjnIT.js → PersonalityPopover-BR4Cpr2C.js} +1 -1
- package/dist/client/assets/PhotoPage-C3Ir3wlA.js +1 -0
- package/dist/client/assets/{PresetPicker-C-HcfktA.js → PresetPicker-zGvDOqTf.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-CgJeWKad.js → PreviewRefusedNotice-D1Tl265t.js} +1 -1
- package/dist/client/assets/{ProfileFields-Bpe71duM.js → ProfileFields-T3vVbHRC.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-r2T2nLuy.js → ProfilePanelContainer-CParzTPA.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-B9as28eL.js → ProfileRolePicker-BU4eiMKn.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-BjyRYcZH.js → PromptSuggestionChips-CGNQc2Tf.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-Bs59IbmP.js → ReportsToPopover-Dj5U_Ppi.js} +1 -1
- package/dist/client/assets/{RoomSurface-CcxCucEt.js → RoomSurface-BIyjtxKD.js} +7 -7
- package/dist/client/assets/{RoomsPage-gAEppmDN.js → RoomsPage-Cvs3h6f0.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-BYqbPh-k.js → RunsOnPopover-BUlYwRW4.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-BmMBE_ki.js → RuntimeConnectFlow-ChrvjC84.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-DsDi5RBn.js → RuntimeSetupDialog-BK9yo7YF.js} +1 -1
- package/dist/client/assets/{SessionsPage-Cid8fhdk.js → SessionsPage-CWUwU3US.js} +1 -1
- package/dist/client/assets/SettingsDialog-BApzy0J8.js +12 -0
- package/dist/client/assets/{SkillsPage-YiAaBf5n.js → SkillsPage-z3XnApNX.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-BZ19n03x.js → TaskDialogWrapper-BEWUpAlk.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-RqhzTXZs.js → TasksEmptyState-CLwpLnIO.js} +2 -2
- package/dist/client/assets/{TasksPage-CkaqOq26.js → TasksPage-CyHjr9OZ.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-BFwHEcxT.js → TeamComputerEntry-BHHIofx3.js} +1 -1
- package/dist/client/assets/{ToolsPage-BnCLKQr8.js → ToolsPage-CckCco8x.js} +2 -2
- package/dist/client/assets/TopologyGraph-Dox7aWP3.js +30 -0
- package/dist/client/assets/{TourHost-D6Lclw6P.js → TourHost-CTBewD-a.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DqKrNRIZ.js → UnlinkDialog-CFRgExId.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-YpoGnbGt.js → WidgetErrorCard-Dx5oPMlF.js} +3 -3
- package/dist/client/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/dist/client/assets/_shell-BHUZq_8C.js +80 -0
- package/dist/client/assets/{_shell._home-BcVOIprN.js → _shell._home-DnBkgWs4.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-B-5keh6v.js → _shell._home.activity-CVCC-EEI.js} +1 -1
- package/dist/client/assets/{_shell._home.index-CeUO_fiS.js → _shell._home.index-Ck6jxwIx.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-DrghkSwu.js → _shell._home.tasks-B7QQAZnA.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-ClpXSXb7.js → _shell._home.workspaces-DlrRd9tv.js} +1 -1
- package/dist/client/assets/_shell.channels-CiWehoyl.js +10 -0
- package/dist/client/assets/{_shell.connections-BAyaKCu0.js → _shell.connections-CGP5hZHq.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-C_0Cb9ew.js → _shell.feedback-requests-BxxNvw6j.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BoAmyvPt.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BpqWjkGL.js +1 -0
- package/dist/client/assets/{_shell.session-DAOicD3_.js → _shell.session-KyPj3OxK.js} +17 -17
- package/dist/client/assets/{_shell.team-C9JBEYch.js → _shell.team-CsXH3NkS.js} +6 -6
- package/dist/client/assets/_shell.x._extensionId-CfiAgtoq.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-CfiAgtoq.js +1 -0
- package/dist/client/assets/abnfDiagram-WEYOIA3C-CMdkyiQ3.js +1 -0
- package/dist/client/assets/{access-copy-DBchOVu9.js → access-copy-CW-z1oMH.js} +1 -1
- package/dist/client/assets/arc-Bw7tftQk.js +1 -0
- package/dist/client/assets/architectureDiagram-ZHVYKT53-BhpXALtX.js +36 -0
- package/dist/client/assets/{banner-DyAc42ob.js → banner-EomQNDOH.js} +1 -1
- package/dist/client/assets/blockDiagram-RJAE7QA3-Bxk_BuZv.js +140 -0
- package/dist/client/assets/c4Diagram-XDPPPE54-CYN0FwR8.js +38 -0
- package/dist/client/assets/{card-B1UFbnvJ.js → card-ww4ebz8h.js} +1 -1
- package/dist/client/assets/channel-DZpRF3QJ.js +1 -0
- package/dist/client/assets/chunk-2E7WHVMD-IPDvYcPa.js +88 -0
- package/dist/client/assets/chunk-2Q5K7J3B-DZ5bU5Ax.js +1 -0
- package/dist/client/assets/chunk-4EMNKR2T-DrsWxa6Y.js +1 -0
- package/dist/client/assets/chunk-55XCU76K-CiBbKG0b.js +1 -0
- package/dist/client/assets/chunk-5VM5RSS4-B3K3MUav.js +15 -0
- package/dist/client/assets/chunk-JWPE2WC7-CjV5RcIh.js +1 -0
- package/dist/client/assets/chunk-VQ5W62QI-CWoRr0H2.js +1 -0
- package/dist/client/assets/chunk-XXDRQBXY-E0nvzXiG.js +1 -0
- package/dist/client/assets/chunk-ZCHMQSOR-DFop6Lvt.js +2 -0
- package/dist/client/assets/classDiagram-v2-4MYWR3UA-B7JJfc9z.js +217 -0
- package/dist/client/assets/{command-EveETx4P.js → command-D4fLpJxA.js} +1 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-BjNppl29.js +1 -0
- package/dist/client/assets/{cpu-6HIzSTBv.js → cpu-DCe0Yyml.js} +1 -1
- package/dist/client/assets/cynefin-EF2NZ3EQ-PmRntJwW.js +141 -0
- package/dist/client/assets/cynefinDiagram-WF24UDRP-Ctdbp_Vg.js +62 -0
- package/dist/client/assets/cytoscape.esm-BLAcgzS2.js +331 -0
- package/dist/client/assets/dagre-NK4GIZVX-5tvLY2ZW.js +4 -0
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/client/assets/diagram-CBK3MWTC-DZO-XBOO.js +24 -0
- package/dist/client/assets/diagram-I5XIIV2D-CWBbA1Pv.js +24 -0
- package/dist/client/assets/diagram-ODIL2UCW-hP5A1tGl.js +30 -0
- package/dist/client/assets/diagram-PFBEJUXE-EI_-RoN7.js +3 -0
- package/dist/client/assets/diagram-RJA3I4VV-TrYq9A4Z.js +41 -0
- package/dist/client/assets/diagram-TYUNFSNR-BAQq2OM5.js +200 -0
- package/dist/client/assets/ebnfDiagram-V4P3TTPT-cKbeW9dQ.js +1 -0
- package/dist/client/assets/elk-QONTBCTQ-wpfNPp0q.js +27 -0
- package/dist/client/assets/{empty-state-DK2Wg9m3.js → empty-state-DXWQsHMf.js} +1 -1
- package/dist/client/assets/erDiagram-KYQIGQAA-Dk0OrvjE.js +99 -0
- package/dist/client/assets/{execution-config-e5c_6oSg.js → execution-config-CAyT2Qoo.js} +1 -1
- package/dist/client/assets/{file-CxdN5JO4.js → file-Bf7D_47y.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-ID9vXo0l.js → file-exclamation-point-DZXE9_8o.js} +1 -1
- package/dist/client/assets/{file-text-DtcloCeg.js → file-text-C1ougnBY.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-BGZDFnjV.js → find-latest-widget-fence-B1_-pC-Z.js} +1 -1
- package/dist/client/assets/flowDiagram-IUGLLWBU-CdlOoRZV.js +213 -0
- package/dist/client/assets/{form-Bs1x_gSI.js → form-D7kF-U0d.js} +1 -1
- package/dist/client/assets/{format-cron-i_Bh2HP3.js → format-cron-ZtliseYi.js} +1 -1
- package/dist/client/assets/ganttDiagram-R7GPNTJY-x0MJLv5d.js +292 -0
- package/dist/client/assets/{git-branch-B3IXXOlG.js → git-branch-B2k77X3Q.js} +1 -1
- package/dist/client/assets/gitGraphDiagram-PDYL7XHY-CruCvk7w.js +106 -0
- package/dist/client/assets/graph-5PBe05F8.js +1 -0
- package/dist/client/assets/{heart-BKVGdKg5.js → heart-CmqGJPDc.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-2S9TnGZL.js → highlighted-body-KPVGNVTW-Bqu2cQDj.js} +1 -1
- package/dist/client/assets/{image-lightbox-D28E719A.js → image-lightbox-BBbz-ThL.js} +1 -1
- package/dist/client/assets/{image-off-BuNZtQ_w.js → image-off-BCtWIY4q.js} +1 -1
- package/dist/client/assets/{index-LPr-pCZr.js → index-1ShgR_xt.js} +1 -1
- package/dist/client/assets/{index-V5Rn9SxH.js → index-8IAr9b71.js} +1 -1
- package/dist/client/assets/{index-rROsmUvj.js → index-8TfzCkKR.js} +1 -1
- package/dist/client/assets/{index-CsUyZMaJ.js → index-B5rRtvWx.js} +1 -1
- package/dist/client/assets/index-B6dEbNhI.js +1 -0
- package/dist/client/assets/{index-7cQQSs20.js → index-BCk4wW-T.js} +1 -1
- package/dist/client/assets/{index-CfpVrvtk.js → index-BIIH5CXj.js} +1 -1
- package/dist/client/assets/{index-DP_WiQNC.js → index-BXMxoWrk.js} +1 -1
- package/dist/client/assets/index-BXZlDqvy.js +74 -0
- package/dist/client/assets/{index-5081rTdO.js → index-BfRW2WTx.js} +1 -1
- package/dist/client/assets/{index-DVpRV8UX.js → index-BpmmNapD.js} +1 -1
- package/dist/client/assets/{index-CQ_s1Luo.js → index-BrQGZ6iF.js} +1 -1
- package/dist/client/assets/{index-KONo3kU0.js → index-BuGQxHrf.js} +1 -1
- package/dist/client/assets/{index-BM9n-UZ_.js → index-BzPgsdPn.js} +1 -1
- package/dist/client/assets/{index-ByUBGmdN.js → index-C11Ssk2u.js} +3 -3
- package/dist/client/assets/{index-Ce9sdGIU.js → index-CJ5v2_Cz.js} +1 -1
- package/dist/client/assets/{index-CIxwv14l.js → index-CMNc_OrC.js} +1 -1
- package/dist/client/assets/{index-ClxqCDE6.js → index-CQ0VLZf-.js} +1 -1
- package/dist/client/assets/{index-CHZfO-eM.js → index-ChwNEkM8.js} +1 -1
- package/dist/client/assets/index-Cl8trmnL.js +1 -0
- package/dist/client/assets/{index-CDBp2azY.js → index-ClBIPuLA.js} +1 -1
- package/dist/client/assets/{index-CtRknSis.js → index-Cml5572f.js} +1 -1
- package/dist/client/assets/{index-DIpkbx_g.js → index-Cp3yShS8.js} +7 -7
- package/dist/client/assets/index-CrflCTqO.css +1 -0
- package/dist/client/assets/{index-CJllc1_e.js → index-CtycM8wY.js} +1 -1
- package/dist/client/assets/{index-DVUGIueq.js → index-Cv0GsC4n.js} +1 -1
- package/dist/client/assets/{index-CqcPXANi.js → index-DAdo_yIq.js} +1 -1
- package/dist/client/assets/{index-DwKOsAwH.js → index-DIxzqCwG.js} +1 -1
- package/dist/client/assets/index-DKDK-3KH.js +17 -0
- package/dist/client/assets/index-DPNBHwcQ.js +1 -0
- package/dist/client/assets/{index-B-wVtE7g.js → index-DbDI5BAA.js} +1 -1
- package/dist/client/assets/index-DcZPWi_I.js +1023 -0
- package/dist/client/assets/{index-Pcm0P4su.js → index-Dmn03xST.js} +1 -1
- package/dist/client/assets/{index-BUAYrK-t.js → index-Do6eeFps.js} +2 -2
- package/dist/client/assets/{index-CAB4SfyK.js → index-DrA03bMq.js} +1 -1
- package/dist/client/assets/{index-5BVp-usS.js → index-DsJWzmWw.js} +1 -1
- package/dist/client/assets/{index-Cc5UdmnD.js → index-EdJm7ZN-.js} +1 -1
- package/dist/client/assets/{index-CxYD3BRB.js → index-JxeBJIuE.js} +1 -1
- package/dist/client/assets/{index-Dr3MaxIU.js → index-mFOJXyAE.js} +3 -3
- package/dist/client/assets/{index-uukEE2As.js → index-rWZWP3Wh.js} +1 -1
- package/dist/client/assets/{index-CFo8WKHw.js → index-t4Ud6YTX.js} +1 -1
- package/dist/client/assets/{index-DaFf8fyv.js → index-xaMF1mrN.js} +1 -1
- package/dist/client/assets/{index-DrBU917j.js → index-xmk9Ohv9.js} +1 -1
- package/dist/client/assets/{index-OTmqX-Xu.js → index-yI1r4pSP.js} +1 -1
- package/dist/client/assets/{index.esm-C1I5Nd91.js → index.esm-CZZtbPRj.js} +1 -1
- package/dist/client/assets/infoDiagram-MVDRKAX5-Bj9DD77n.js +2 -0
- package/dist/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/client/assets/{inline-code-BxjIkZsu.js → inline-code-g9PVHZI2.js} +1 -1
- package/dist/client/assets/ishikawaDiagram-HPEHV2GE-DckI6dhS.js +70 -0
- package/dist/client/assets/journeyDiagram-BOSHW7O7-Ce1GAVa0.js +139 -0
- package/dist/client/assets/kanban-definition-FNSA4HC5-Kq5O9rZa.js +89 -0
- package/dist/client/assets/katex-DLorvT8M.js +257 -0
- package/dist/client/assets/{layers-CIuBDynf.js → layers-D3lEdRF0.js} +1 -1
- package/dist/client/assets/{lightbulb-C75cqB7d.js → lightbulb-BFE-KkFU.js} +1 -1
- package/dist/client/assets/linear-BT-xgETh.js +1 -0
- package/dist/client/assets/{link-2-g7crG37S.js → link-2-Dvb6g-2Q.js} +1 -1
- package/dist/client/assets/{list-runtime-types-GVPyyQUh.js → list-runtime-types-8YGEK3Al.js} +1 -1
- package/dist/client/assets/{markdown-content-siVxwwSU.js → markdown-content-Cqq_QMXA.js} +1 -1
- package/dist/client/assets/{mention-pill-CjxBxD6M.js → mention-pill-Bnzt4u2l.js} +1 -1
- package/dist/client/assets/mermaid.core-dpp59v7L.js +312 -0
- package/dist/client/assets/{message-square-off-BxuvD1QP.js → message-square-off-BX2XnEDx.js} +1 -1
- package/dist/client/assets/mindmap-definition-6OY57UG3-CFdfJO6g.js +98 -0
- package/dist/client/assets/{more-details-DN_gIeya.js → more-details-B4lBMpKi.js} +1 -1
- package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/client/assets/{owner-notice-DnYrX3mh.js → owner-notice-ByjrIRmX.js} +1 -1
- package/dist/client/assets/{package-b8MxCYZr.js → package-6Rbxg35g.js} +1 -1
- package/dist/client/assets/{page-container-bbfE5uTV.js → page-container-DoZzad36.js} +1 -1
- package/dist/client/assets/{paperclip-BNBU7WUb.js → paperclip-B-jDXtxw.js} +1 -1
- package/dist/client/assets/{path-input-BhzVuKWq.js → path-input-DpqUD8hN.js} +1 -1
- package/dist/client/assets/pegDiagram-ECIUJNBX-eVnSw2Ma.js +1 -0
- package/dist/client/assets/pieDiagram-GNMPY74T-BYG7LY5Q.js +39 -0
- package/dist/client/assets/plug-DnaAhcy4.js +11 -0
- package/dist/client/assets/{primer-trigger-DHPWwwZl.js → primer-trigger-Da5ECjY8.js} +2 -2
- package/dist/client/assets/{profile-errors-DDvyjpcQ.js → profile-errors-GbTNc2-M.js} +1 -1
- package/dist/client/assets/{progress-DUKHwOZJ.js → progress-DlIRjXIA.js} +1 -1
- package/dist/client/assets/quadrantDiagram-D57K4MC3-CRgNKuHR.js +7 -0
- package/dist/client/assets/{query-error-state-DOJRiizQ.js → query-error-state-DB-Jby7_.js} +1 -1
- package/dist/client/assets/{radio-kbMW2w1m.js → radio-CaaE60ws.js} +1 -1
- package/dist/client/assets/railroadDiagram-Y72NRBL7-DGL-Hqz9.js +1 -0
- package/dist/client/assets/registry-DS1Ghdft.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-3XV1_WMC.js → relay-trace-schemas-CcCqyOrA.js} +2 -2
- package/dist/client/assets/requirementDiagram-EQYSW5RA-DKsFpU3l.js +84 -0
- package/dist/client/assets/{room-files-source-CDA5V_Mw.js → room-files-source-CbbVpvSW.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-BGYqHuYK.js → rotate-ccw-clock-CeY00nlZ.js} +1 -1
- package/dist/client/assets/{rotate-cw-BdJrGLyp.js → rotate-cw-Djl5J_x9.js} +1 -1
- package/dist/client/assets/sankeyDiagram-SY24JHO5-BFRkDxic.js +40 -0
- package/dist/client/assets/{scroll-area-D-CWiQov.js → scroll-area-BOqrziJf.js} +1 -1
- package/dist/client/assets/{search-x-DNIPyXe6.js → search-x-B_mHjnlo.js} +1 -1
- package/dist/client/assets/sequenceDiagram-BLEHNHQU-fHea3KOI.js +169 -0
- package/dist/client/assets/{shield-check-zWzf9nt2.js → shield-check-Csnr5rFy.js} +1 -1
- package/dist/client/assets/{shield-x-Bu5-LOse.js → shield-x-Dhl4YvvW.js} +1 -1
- package/dist/client/assets/signed-in-BMqAss8c.js +1 -0
- package/dist/client/assets/sizeCapture-INFHLROL-CztsD3qF.js +1 -0
- package/dist/client/assets/{soul-file-CoSSajv6.js → soul-file-DOfamgB5.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-A6IESKWZ-CWyOqZ9S.js +291 -0
- package/dist/client/assets/swimlanes-B3ENRKFQ-0EfOxSAX.js +1 -0
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-C7fkUKrq.js +8 -0
- package/dist/client/assets/{table-Bt_aJtoi.js → table-L7FvN6Or.js} +1 -1
- package/dist/client/assets/{terminal-ub-ExeTA.js → terminal-C9M5a_PS.js} +1 -1
- package/dist/client/assets/timeline-definition-JXYKGLGB-sFyYvZ20.js +120 -0
- package/dist/client/assets/transform-BqqRT-Iy.js +1 -0
- package/dist/client/assets/{trust-posture-CWt3tUjL.js → trust-posture-dl6qwDtI.js} +1 -1
- package/dist/client/assets/{unplug-BCqRQfhH.js → unplug-CFUEVRbc.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CgvUEO5t.js → unverified-catalog-notice-CdYU3WEJ.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-ClW3m3Yz.js → use-adapter-catalog-YTofdqDJ.js} +1 -1
- package/dist/client/assets/{use-bindings-CFiTPDOx.js → use-bindings-CpyT6kNu.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-B70wbKdU.js → use-composer-prefs-CK_EK_QJ.js} +1 -1
- package/dist/client/assets/{use-connector-management-B_mb2h8I.js → use-connector-management-DwoK8kon.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DuJW3UA9.js → use-deep-link-scroll-CgRjt48R.js} +1 -1
- package/dist/client/assets/{use-delete-binding-DWXownno.js → use-delete-binding-CfsnMXrL.js} +1 -1
- package/dist/client/assets/{use-dev-links-UPIkbIjA.js → use-dev-links-B3I-ZK34.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-x7pDUqmo.js → use-external-adapter-catalog-aGlZNRrp.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-l9UhDUNU.js → use-full-activity-feed-B61Olhdw.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-Qwyg-mFb.js +1 -0
- package/dist/client/assets/use-is-hub-CSz6NDaP.js +1 -0
- package/dist/client/assets/{use-jump-back-in-CKA3z2by.js → use-jump-back-in-C39GOTHa.js} +3 -3
- package/dist/client/assets/{use-local-browser-DL5b5JIK.js → use-local-browser-DCwzB4D8.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BYGYArKq.js → use-mesh-topology-LRYxFuZp.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-D_xUn22L.js → use-mounted-ref-CZaegwTr.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-42ajom2z.js → use-notification-prefs-FtOiUS5H.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-CLIDc7_z.js → use-panel-tab-placements-Dv2OPvKh.js} +1 -1
- package/dist/client/assets/use-pending-read-DBOl1ee_.js +1 -0
- package/dist/client/assets/{use-personality-commit-D7jyGUrF.js → use-personality-commit-BB5aeh6p.js} +1 -1
- package/dist/client/assets/use-promo-activation-BW0u7n7m.js +11 -0
- package/dist/client/assets/{use-promo-dismissals-CsJELZ1_.js → use-promo-dismissals-BOXzW4kD.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-TqSBTrFT.js → use-pulse-freshness-ClW-MLMo.js} +1 -1
- package/dist/client/assets/{use-relay-config-CLeVWrpV.js → use-relay-config-hItHtkSr.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-C-zlw4nh.js → use-room-follow-claim-wotzxUWc.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-H2EzOl9b.js → use-roving-tab-list-DkbO6xSs.js} +1 -1
- package/dist/client/assets/use-session-canvas-C_fuAgW_.js +24 -0
- package/dist/client/assets/{use-session-diagnostics-CDmiMYHx.js → use-session-diagnostics-DmxvD-wy.js} +3 -3
- package/dist/client/assets/{use-unclaimed-chats-Bd93jy-J.js → use-unclaimed-chats-DKpexDm3.js} +1 -1
- package/dist/client/assets/use-update-config-CSYwg557.js +1 -0
- package/dist/client/assets/{useMutationState-BZZ5TO4d.js → useMutationState-Btf2Hp1a.js} +1 -1
- package/dist/client/assets/usecaseDiagram-WPOLBNNX-DRngjDUq.js +370 -0
- package/dist/client/assets/value-wA6veExk.js +1 -0
- package/dist/client/assets/vennDiagram-Q3Y3IDCW-iK-dlS1-.js +34 -0
- package/dist/client/assets/wardleyDiagram-IVAIDKWA-sOS67Cks.js +78 -0
- package/dist/client/assets/xychartDiagram-4URNHDU4-EgnLiIao.js +7 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261017113300_session_public_computer.sql +1 -0
- package/dist/drizzle/meta/20261017113300_snapshot.json +14020 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +24307 -20763
- package/dist/server/index.js.map +2 -2
- package/package.json +7 -7
- package/dist/client/assets/BlintzCanvas-D_HlpfZu.js +0 -1141
- package/dist/client/assets/CanvasFileContent-g5wQR7yt.js +0 -2
- package/dist/client/assets/HandlePage-DUFrvuVy.js +0 -1
- package/dist/client/assets/KeyEntry-tKXV9D24.js +0 -6
- package/dist/client/assets/McpSigninBody-CRj8tXsh.js +0 -1
- package/dist/client/assets/NamePage-fiIXQig_.js +0 -1
- package/dist/client/assets/PhotoPage-BnxmY5mq.js +0 -1
- package/dist/client/assets/SettingsDialog-BZkPlifY.js +0 -12
- package/dist/client/assets/TopologyGraph-CAkARLa1.js +0 -30
- package/dist/client/assets/_shell-BQ7hvFsP.js +0 -90
- package/dist/client/assets/_shell.channels-DYNK-rbr.js +0 -10
- package/dist/client/assets/_shell.marketplace-B1CT9Y3y.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DVHJ2s7a.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-B6Ccjrvp.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-B6Ccjrvp.js +0 -1
- package/dist/client/assets/index-BONR--d7.css +0 -1
- package/dist/client/assets/index-BULRe04c.js +0 -1018
- package/dist/client/assets/index-C8NfFfij.js +0 -17
- package/dist/client/assets/index-CRMbYKMh.js +0 -1
- package/dist/client/assets/index-CidWt_HE.js +0 -1
- package/dist/client/assets/index-CoMMwnLj.js +0 -74
- package/dist/client/assets/registry-BisJE2TH.js +0 -1
- package/dist/client/assets/use-is-below-desktop-ByiGZk3p.js +0 -1
- package/dist/client/assets/use-pending-read-Cy9OB3jX.js +0 -1
- package/dist/client/assets/use-promo-activation-Dw1KvykA.js +0 -11
- package/dist/client/assets/use-session-canvas-Bm_AzSm7.js +0 -24
- package/dist/client/assets/use-update-config-DjF61lwf.js +0 -1
|
@@ -0,0 +1,1231 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-dpp59v7L.js","assets/index-DcZPWi_I.js","assets/index-CrflCTqO.css","assets/transform-BqqRT-Iy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var E7=Object.defineProperty;var S1=r=>{throw TypeError(r)};var D7=(r,e,t)=>e in r?E7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ce=(r,e,t)=>D7(r,typeof e!="symbol"?e+"":e,t),nd=(r,e,t)=>e.has(r)||S1("Cannot "+t);var C=(r,e,t)=>(nd(r,e,"read from private field"),t?t.call(r):e.get(r)),_=(r,e,t)=>e.has(r)?S1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),F=(r,e,t,n)=>(nd(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Wi=(r,e,t)=>(nd(r,e,"access private method"),t);import{p2 as C1,p3 as O7,p4 as _2,p5 as gh,p6 as R7,p7 as I7,p8 as z7,r as R,R as j2,e3 as bc,p9 as yh,pa as vh,pb as $s,pc as M1,pd as V2,pe as L7,pf as ol,pg as al,ph as T1,pi as es,pj as B7,pk as P7,pl as F7,pm as f0,pn as W2,po as Ua,gF as $7,pp as q7,pq as ns,pr as Tr,ps as Ui,pt as Hc,pu as je,em as H7,pv as _7,pw as j7,px as Wr,py as tu,pz as Mi,pA as U2,pB as A1,j as L,gE as V7,G as W7,aX as U7}from"./index-DcZPWi_I.js";import{p as zf}from"./index-B6dEbNhI.js";import{aw as K7,ax as G7,ab as J7,ac as Y7,ad as X7,ae as Z7,af as Q7,ag as K2,ah as eb,q as p0,ai as tb,aj as G2,ar as rb,ak as nb,al as ib,am as sb,an as ob,ao as ab,ap as lb,aq as cb,Z as Lf,a4 as ub,a5 as J2,a6 as db,a7 as hb,a8 as fb,a9 as pb,aa as mb,m as gb,a as yb,ay as vb,E as Fa,as as bb,t as ht,n as wb,at as kb,C as N1,az as xb}from"./index-mFOJXyAE.js";const Sb={}.hasOwnProperty;function Y2(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)Y2(r,e.extensions[t]);for(n in e)if(Sb.call(e,n))switch(n){case"extensions":break;case"unsafe":{E1(r[n],e[n]);break}case"join":{E1(r[n],e[n]);break}case"handlers":{Cb(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function E1(r,e){e&&r.push(...e)}function Cb(r,e){e&&Object.assign(r,e)}const Mb=[Tb];function Tb(r,e,t,n){if(e.type==="code"&&C1(e,n)&&(r.type==="list"||r.type===e.type&&C1(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&O7(e,n))?void 0:t.spread?1:0}const Ki=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Ab=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
3
|
+
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ki},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
4
|
+
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
5
|
+
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
6
|
+
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
7
|
+
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
8
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ki},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ki},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,character:"~"}];function Nb(r){return r.label||!r.identifier?r.label||"":_2(r.identifier)}function Eb(r){if(!r._compiled){const e=(r.atBreak?"[\\r\\n][\\t ]*":"")+(r.before?"(?:"+r.before+")":"");r._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(r.character)?"\\":"")+r.character+(r.after?"(?:"+r.after+")":""),"g")}return r._compiled}function Db(r,e,t){const n=e.indexStack,i=r.children||[],s=[];let o=-1,a=t.before,l;n.push(-1);let c=e.createTracker(t);for(;++o<i.length;){const u=i[o];let d;if(n[n.length-1]=o,o+1<i.length){let m=e.handle.handlers[i[o+1].type];m&&m.peek&&(m=m.peek),d=m?m(i[o+1],r,e,{before:"",after:"",...c.current()}).charAt(0):""}else d=t.after;s.length>0&&(a==="\r"||a===`
|
|
9
|
+
`)&&u.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),a=" ",c=e.createTracker(t),c.move(s.join("")));let h=e.handle(u,r,e,{...c.current(),after:d,before:a});l&&l===h.slice(0,1)&&(h=gh(l.charCodeAt(0))+h.slice(1));const f=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(s.length>0&&f.before&&a===s[s.length-1].slice(-1)&&(s[s.length-1]=s[s.length-1].slice(0,-1)+gh(a.charCodeAt(0))),f.after&&(l=d)),c.move(h),s.push(h),a=h.slice(-1)}return n.pop(),s.join("")}function Ob(r,e,t){const n=e.indexStack,i=r.children||[],s=e.createTracker(t),o=[];let a=-1;for(n.push(-1);++a<i.length;){const l=i[a];n[n.length-1]=a,o.push(s.move(e.handle(l,r,e,{before:`
|
|
10
|
+
`,after:`
|
|
11
|
+
`,...s.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&o.push(s.move(Rb(l,i[a+1],r,e)))}return n.pop(),o.join("")}function Rb(r,e,t,n){let i=n.join.length;for(;i--;){const s=n.join[i](r,e,t,n);if(s===!0||s===1)break;if(typeof s=="number")return`
|
|
12
|
+
`.repeat(1+s);if(s===!1)return`
|
|
13
|
+
|
|
14
|
+
<!---->
|
|
15
|
+
|
|
16
|
+
`}return`
|
|
17
|
+
|
|
18
|
+
`}const Ib=/\r?\n|\r/g;function zb(r,e){const t=[];let n=0,i=0,s;for(;s=Ib.exec(r);)o(r.slice(n,s.index)),t.push(s[0]),n=s.index+s[0].length,i++;return o(r.slice(n)),t.join("");function o(a){t.push(e(a,i,!a))}}function Lb(r,e,t){const n=(t.before||"")+(e||"")+(t.after||""),i=[],s=[],o={};let a=-1;for(;++a<r.unsafe.length;){const u=r.unsafe[a];if(!R7(r.stack,u))continue;const d=r.compilePattern(u);let h;for(;h=d.exec(n);){const f="before"in u||!!u.atBreak,m="after"in u,y=h.index+(f?h[1].length:0);i.includes(y)?(o[y].before&&!f&&(o[y].before=!1),o[y].after&&!m&&(o[y].after=!1)):(i.push(y),o[y]={before:f,after:m})}}i.sort(Bb);let l=t.before?t.before.length:0;const c=n.length-(t.after?t.after.length:0);for(a=-1;++a<i.length;){const u=i[a];u<l||u>=c||u+1<c&&i[a+1]===u+1&&o[u].after&&!o[u+1].before&&!o[u+1].after||i[a-1]===u-1&&o[u].before&&!o[u-1].before&&!o[u-1].after||(l!==u&&s.push(D1(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!t.encode||!t.encode.includes(n.charAt(u)))?s.push("\\"):(s.push(gh(n.charCodeAt(u))),l++))}return s.push(D1(n.slice(l,c),t.after)),s.join("")}function Bb(r,e){return r-e}function D1(r,e){const t=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],s=r+e;let o=-1,a=0,l;for(;l=t.exec(s);)n.push(l.index);for(;++o<n.length;)a!==n[o]&&i.push(r.slice(a,n[o])),i.push("\\"),a=n[o];return i.push(r.slice(a)),i.join("")}function Pb(r){const e=r||{},t=e.now||{};let n=e.lineShift||0,i=t.line||1,s=t.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:i,column:s},lineShift:n}}function a(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return i+=d.length-1,s=d.length===1?s+h.length:1+h.length+n,u}}function Fb(r,e){const t=e||{},n={associationId:Nb,containerPhrasing:_b,containerFlow:jb,createTracker:Pb,compilePattern:Eb,enter:s,handlers:{...z7},handle:void 0,indentLines:zb,indexStack:[],join:[...Mb],options:{},safe:Vb,stack:[],unsafe:[...Ab]};Y2(n,t),n.options.tightDefinitions&&n.join.push(Hb),n.handle=I7("type",{invalid:$b,unknown:qb,handlers:n.handlers});let i=n.handle(r,void 0,n,{before:`
|
|
19
|
+
`,after:`
|
|
20
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
21
|
+
`),i;function s(o){return n.stack.push(o),a;function a(){n.stack.pop()}}}function $b(r){throw new Error("Cannot handle value `"+r+"`, expected node")}function qb(r){const e=r;throw new Error("Cannot handle unknown node `"+e.type+"`")}function Hb(r,e){if(r.type==="definition"&&r.type===e.type)return 0}function _b(r,e){return Db(r,this,e)}function jb(r,e){return Ob(r,this,e)}function Vb(r,e){return Lb(this,r,e)}var ru=R.createContext({});function Wb(){const{dom:r,editor:e,setLoading:t,editorFactory:n}=R.useContext(ru),i=R.useRef(null);return R.useEffect(()=>{const s=i.current;if(!n||!s)return;r.current=s;const o=n(s);if(o)return t(!0),o.create().then(a=>{e.current=a}).finally(()=>{t(!1)}).catch(console.error),()=>{o.destroy().catch(console.error)}},[r,e,n,t]),i}var Ub=()=>{const r=Wb();return j2.createElement("div",{"data-milkdown-root":!0,ref:r})},Kb=({children:r})=>{const e=R.useRef(void 0),[t,n]=R.useState(void 0),i=R.useRef(void 0),[s,o]=R.useState(!0),a=R.useMemo(()=>({loading:s,dom:e,editor:i,setLoading:o,editorFactory:t,setEditorFactory:n}),[s,t]);return j2.createElement(ru.Provider,{value:a},r)};function Gb(r,e=[]){const t=R.useContext(ru),n=R.useCallback(r,e);return R.useLayoutEffect(()=>{t.setEditorFactory(()=>n)},[t,n]),{loading:t.loading,get:()=>t.editor.current}}function Jb(){const r=R.useContext(ru),e=R.useCallback(()=>r.editor.current,[r.editor]);return[r.loading,e]}function Yb(r){return typeof r=="object"&&!!r}function Xb(r){return r.nodeType===1}function Zb(r){return Xb(r)&&r.namespaceURI==="http://www.w3.org/1999/xhtml"}function X2(r){return Yb(r)&&r.nodeType===1&&typeof r.nodeName=="string"}let _c=0,Qb=2**53-1;function e8(){return _c++,_c>=Qb&&(_c=1),_c}function nu(){return String(e8())}function Z2(r,e){if(r.type!=="childList")return!1;for(const t of r.removedNodes)if(t===e)return!0;return!1}var Dl,bh,D2,t8=(D2=class{constructor({mark:r,view:e,inline:t,options:n}){_(this,Dl);this.contentRef=i=>{i&&this.contentDOM&&X2(i)&&i.firstChild!==this.contentDOM&&i.appendChild(this.contentDOM)},this.shouldIgnoreMutation=i=>!this.dom||!this.contentDOM?!0:i.type==="selection"?!1:this.contentDOM===i.target&&i.type==="attributes"?!0:!(this.contentDOM.contains(i.target)||Z2(i,this.contentDOM)),this.ignoreMutation=i=>{if(!this.dom||!this.contentDOM)return!0;let s;const o=this.options.ignoreMutation;return o&&(s=o(i)),typeof s!="boolean"&&(s=this.shouldIgnoreMutation(i)),s},this.destroy=()=>{var i,s;(s=(i=this.options).destroy)==null||s.call(i),this.dom.remove(),this.contentDOM.remove()},this.key=nu(),this.mark=r,this.view=e,this.inline=t,this.options=n,this.dom=this.createDOM(n.as),this.contentDOM=this.createContentDOM(n.contentAs),this.dom.setAttribute("data-mark-view-root","true"),this.contentDOM.setAttribute("data-mark-view-content","true"),this.contentDOM.style.whiteSpace="inherit"}createDOM(r){return Wi(this,Dl,bh).call(this,r)}createContentDOM(r){return Wi(this,Dl,bh).call(this,r)}get component(){return this.options.component}},Dl=new WeakSet,bh=function(r){const{inline:e,mark:t}=this;return r?typeof r=="string"?document.createElement(r):typeof r=="function"?r(t):r:document.createElement(e?"span":"div")},D2),as,Ol,wh,O2,r8=(O2=class{constructor({node:r,view:e,getPos:t,decorations:n,innerDecorations:i,options:s}){_(this,Ol);_(this,as);F(this,as,!1),this.selected=!1,this.contentRef=o=>{o&&this.contentDOM&&X2(o)&&o.firstChild!==this.contentDOM&&o.appendChild(this.contentDOM)},this.selectNode=()=>{var o,a;this.selected=!0,(a=(o=this.options).selectNode)==null||a.call(o)},this.deselectNode=()=>{var o,a;this.selected=!1,(a=(o=this.options).deselectNode)==null||a.call(o)},this.shouldUpdate=o=>o.type===this.node.type,this.update=(o,a,l)=>{var u,d,h,f;const c=((d=(u=this.options).update)==null?void 0:d.call(u,o,a,l))??this.shouldUpdate(o);return this.node=o,this.decorations=a,this.innerDecorations=l,c&&((f=(h=this.options).onUpdate)==null||f.call(h)),c},this.shouldIgnoreMutation=o=>!this.dom||!this.contentDOM||(this.dom.contains(this.contentDOM)&&F(this,as,!1),this.node.isLeaf||this.node.isAtom)?!0:o.type==="selection"?!1:this.contentDOM===o.target&&o.type==="attributes"?!0:this.contentDOM.contains(o.target)?!1:Z2(o,this.contentDOM)?(F(this,as,!0),!1):!(C(this,as)&&this.dom.contains(o.target)),this.ignoreMutation=o=>{if(!this.dom||!this.contentDOM)return!0;let a;const l=this.options.ignoreMutation;return l&&(a=l(o)),typeof a!="boolean"&&(a=this.shouldIgnoreMutation(o)),a},this.destroy=()=>{var o,a,l;(a=(o=this.options).destroy)==null||a.call(o),this.dom.remove(),(l=this.contentDOM)==null||l.remove()},this.setAttrs=o=>{const a=this.getPos();if(typeof a=="number")return this.view.dispatch(this.view.state.tr.setNodeMarkup(a,void 0,{...this.node.attrs,...o}))},this.key=nu(),this.node=r,this.view=e,this.getPos=t,this.decorations=n,this.innerDecorations=i,this.options=s,this.dom=this.createDOM(s.as),this.contentDOM=r.isLeaf?null:this.createContentDOM(s.contentAs),this.dom.setAttribute("data-node-view-root","true"),this.contentDOM&&(this.contentDOM.setAttribute("data-node-view-content","true"),this.contentDOM.style.whiteSpace="inherit"),this.setSelection=s.setSelection,this.stopEvent=s.stopEvent}createDOM(r){return Wi(this,Ol,wh).call(this,r)}createContentDOM(r){return Wi(this,Ol,wh).call(this,r)}get component(){return this.options.component}},as=new WeakMap,Ol=new WeakSet,wh=function(r){const{node:e}=this;return r?typeof r=="string"?document.createElement(r):typeof r=="function"?r(e):r:document.createElement(e.isInline?"span":"div")},O2),n8=class{constructor(r){this.key=nu(),this.view=r.view,this.options=r.options}get component(){return this.options.component}get root(){var e,t;let r=(t=(e=this.options).root)==null?void 0:t.call(e,this.view.dom);return r||(r=this.view.dom.parentElement??document.body),r}update(r,e){var t,n;this.view=r,this.prevState=e,(n=(t=this.options).update)==null||n.call(t,r,e)}destroy(){var r,e;(e=(r=this.options).destroy)==null||e.call(r)}},Q0,Q2,R2,i8=(R2=class{constructor({pos:r,spec:e,options:t}){_(this,Q0);this.key=nu(),this.pos=r,this.options=t,this.spec=e,this.dom=Wi(this,Q0,Q2).call(this,t.as),this.dom.setAttribute("data-widget-view-root","true")}bind(r,e){this.view=r,this.getPos=e}get component(){return this.options.component}},Q0=new WeakSet,Q2=function(r){return typeof r=="string"?document.createElement(r):r},R2);function gt(r){this.content=r}gt.prototype={constructor:gt,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new gt(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new gt(t)},addToStart:function(r,e){return new gt([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new gt(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new gt(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=gt.from(r),r.size?new gt(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=gt.from(r),r.size?new gt(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=gt.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};gt.from=function(r){if(r instanceof gt)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new gt(e)};function ey(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&ny(o.charCodeAt(l-1))&&ry(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=ey(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function ty(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,h=u.length;for(;d>0&&h>0&&c[d-1]==u[h-1];)d--,h--,t--,n--;return d&&h&&d<c.length&&ny(c.charCodeAt(d-1))&&ry(c.charCodeAt(d))&&(t++,n++),{a:t,b:n}}if(o.content.size||a.content.size){let c=ty(o.content,a.content,t-1,n-1);if(c)return c}t-=l,n-=l}}function ry(r){return r>=56320&&r<57344}function ny(r){return r>=55296&&r<56320}class V{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),n,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new V(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),i+=a.nodeSize),o=l}return new V(n,i)}cutByIndex(e,t){return e==t?V.empty:e==0&&t==this.content.length?this:new V(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new V(i,s)}addToStart(e){return new V([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return ey(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ty(this,e,t,n)}findIndex(e){if(e==0)return jc(0,e);if(e==this.size)return jc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?jc(t+1,s):jc(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return V.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return V.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new V(t||e,n)}static from(e){if(!e)return V.empty;if(e instanceof V)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const id={index:0,offset:0};function jc(r,e){return id.index=r,id.offset=e,id}function O0(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!O0(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!O0(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}class ke{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&O0(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ke.none;if(e instanceof ke)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}}ke.none=[];class ll extends Error{}let re=class io{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=sy(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new io(n,this.openStart,this.openEnd)}removeBetween(e,t){return new io(iy(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return io.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new io(V.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new io(e,n,i)}};re.empty=new re(V.empty,0,0);function iy(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:a}=r.findIndex(t);if(i==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(iy(s.content,e-i-1,t-i-1)))}function sy(r,e,t,n,i,s){let{index:o,offset:a}=r.findIndex(e),l=r.maybeChild(o);if(a==e||l.isText)return s&&n<=0&&i<=0&&!s.canReplace(o,o,t)?null:r.cut(0,e).append(t).append(r.cut(e));let c=sy(l.content,e-a-1,t,o==0?n-1:0,o==r.childCount-1?i-1:0,l);return c&&r.replaceChild(o,l.copy(c))}function s8(r,e,t){if(t.openStart>r.depth)throw new ll("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new ll("Inconsistent open depths");return oy(r,e,t,0)}function oy(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=oy(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,a=o.content;return xs(o,a.cut(0,r.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=o8(t,r);return xs(s,ly(r,o,a,e,n))}else return xs(s,R0(r,e,n))}function ay(r,e){if(!e.type.compatibleContent(r.type))throw new ll("Cannot join "+e.type.name+" onto "+r.type.name)}function kh(r,e,t){let n=r.node(t);return ay(n,e.node(t)),n}function ks(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ka(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(ks(r.nodeAfter,n),s++));for(let a=s;a<o;a++)ks(i.child(a),n);e&&e.depth==t&&e.textOffset&&ks(e.nodeBefore,n)}function xs(r,e){if(!r.type.validContent(e))throw new ll("Invalid content for node "+r.type.name);return r.copy(e)}function ly(r,e,t,n,i){let s=r.depth>i&&kh(r,e,i+1),o=n.depth>i&&kh(t,n,i+1),a=[];return Ka(null,r,i,a),s&&o&&e.index(i)==t.index(i)?(ay(s,o),ks(xs(s,ly(r,e,t,n,i+1)),a)):(s&&ks(xs(s,R0(r,e,i+1)),a),Ka(e,t,i,a),o&&ks(xs(o,R0(t,n,i+1)),a)),Ka(n,null,i,a),new V(a)}function R0(r,e,t){let n=[];if(Ka(null,r,t,n),r.depth>t){let i=kh(r,e,t+1);ks(xs(i,R0(r,e,t+1)),n)}return Ka(e,null,t,n),new V(n)}function o8(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(V.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class cl{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return ke.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new cy(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(n.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new cl(t,n,s)}static resolveCached(e,t){let n=O1.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else O1.set(e,n=new a8);let i=n.elts[n.i]=cl.resolve(e,t);return n.i=(n.i+1)%l8,i}}class a8{constructor(){this.elts=[],this.i=0}}const l8=12,O1=new WeakMap;class cy{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const c8=Object.create(null);let $n=class xh{constructor(e,t,n,i=ke.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||V.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&O0(this.attrs,t||e.defaultAttrs||c8)&&ke.sameSet(this.marks,n||ke.none)}copy(e=null){return e==this.content?this:new xh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return re.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new re(c,i.depth-o,s.depth-o)}replace(e,t,n){return s8(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return cl.resolveCached(this,e)}resolveNoCache(e){return cl.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),uy(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=V.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ke.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ke.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=V.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};$n.prototype.text=void 0;let u8=class Sh extends $n{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Sh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Sh(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function uy(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Rs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new d8(e,t);if(n.next==null)return Rs.empty;let i=dy(n);n.next&&n.err("Unexpected trailing text");let s=v8(y8(i));return b8(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return V.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(u));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
|
|
22
|
+
`)}}Rs.empty=new Rs(!0);class d8{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function dy(r){let e=[];do e.push(h8(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function h8(r){let e=[];do e.push(f8(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function f8(r){let e=g8(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=p8(r,e);else break;return e}function R1(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function p8(r,e){let t=R1(r),n=t;return r.eat(",")&&(r.next!="}"?n=R1(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function m8(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function g8(r){if(r.eat("(")){let e=dy(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=m8(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function y8(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return n(a,l),i(s(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=t();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=t();n(l,u),i(s(o.expr,l),u),l=u}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function hy(r,e){return e-r}function I1(r,e){let t=[];return n(e),t.sort(hy);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&n(l)}}}function v8(r){let e=Object.create(null);return t(I1(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);I1(r,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[n.join(",")]=new Rs(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(hy);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function b8(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(c)==-1&&n.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fy(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function py(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function my(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${n}`);for(let i in r)r[i].validate&&r[i].validate(e[i])}function gy(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new k8(r,n,e[n]);return t}let I0=class yy{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=gy(e,n.attrs),this.defaultAttrs=fy(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Rs.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:py(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $n(this,this.computeAttrs(e),V.from(t),ke.setFrom(n))}createChecked(e=null,t,n){return t=V.from(t),this.checkContent(t),new $n(this,this.computeAttrs(e),t,ke.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=V.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(V.empty,!0);return s?new $n(this,e,t.append(s),ke.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){my(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:ke.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new yy(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function w8(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class k8{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?w8(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class iu{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=gy(e,i.attrs),this.excluded=null;let s=fy(this.attrs);this.instance=s?new ke(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,py(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new iu(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){my(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class x8{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=gt.from(e.nodes),t.marks=gt.from(e.marks||{}),this.nodes=I0.compile(this.spec.nodes,this),this.marks=iu.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=Rs.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?z1(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:z1(this,o.split(" "))}this.nodeFromJSON=i=>$n.fromJSON(this,i),this.markFromJSON=i=>ke.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof I0){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new u8(n,n.defaultAttrs,e,ke.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function z1(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let a in r.marks){let l=r.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function S8(r){return r.tag!=null}function C8(r){return r.style!=null}class Is{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(S8(i))this.tags.push(i);else if(C8(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new B1(this,t,!1);return n.addAll(e,ke.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new B1(this,t,!0);return n.addAll(e,ke.none,t.from,t.to),re.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(A8(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=P1(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=P1(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Is(e,Is.schemaRules(e)))}}const vy={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},M8={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},by={ol:!0,ul:!0},ul=1,Ch=2,Ga=4;function L1(r,e,t){return e!=null?(e?ul:0)|(e==="full"?Ch:0):r&&r.whitespace=="pre"?ul|Ch:t&~Ga}class Vc{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=ke.none,this.match=s||(o&Ga?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ul)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class B1{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=L1(null,t.preserveWhitespace,0)|(n?Ga:0);i?s=new Vc(i.type,i.attrs,ke.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new Vc(null,null,ke.none,!0,null,o):s=new Vc(e.schema.topNodeType,null,ke.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&Ch?"full":this.localPreserveWS||(i.options&ul)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
|
|
23
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;by.hasOwnProperty(o)&&this.parser.normalizeLists&&T8(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:M8.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(vy.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
24
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(n)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=ke.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):F1(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=L1(e,s,o.options);o.options&Ga&&o.content.length==0&&(a|=Ga);let l=ke.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):F1(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Vc(e,t,l,i,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ul)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function T8(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&by.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function A8(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function P1(r){let e={};for(let t in r)e[t]=r[t];return e}function F1(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class qs{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Wc(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,t);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){if(e.isText)return Wc(t).createTextNode(e.text);let{dom:n,contentDOM:i}=m0(Wc(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&m0(Wc(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:m0(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qs(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=$1(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return $1(e.marks)}}function $1(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Wc(r){return r.document||window.document}const q1=new WeakMap;function N8(r){let e=q1.get(r);return e===void 0&&q1.set(r,e=E8(r)),e}function E8(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function m0(r,e,t,n){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=N8(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?r.createElementNS(t,i):r.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof h=="string")l.appendChild(r.createTextNode(h));else{let{dom:f,contentDOM:m}=m0(r,h,t,n);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const wy=65535,ky=Math.pow(2,16);function D8(r,e){return r+e*ky}function H1(r){return r&wy}function O8(r){return(r-(r&wy))/ky}const xy=1,Sy=2,g0=4,Cy=8;class Mh{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Cy)>0}get deletedBefore(){return(this.delInfo&(xy|g0))>0}get deletedAfter(){return(this.delInfo&(Sy|g0))>0}get deletedAcross(){return(this.delInfo&g0)>0}}class lr{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&lr.empty)return lr.empty}recover(e){let t=0,n=H1(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+O8(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:t:t,f=l+i+(h<0?0:u);if(n)return f;let m=e==(t<0?l:d)?null:D8(a/3,e-l),y=e==l?Sy:e==d?xy:g0;return(t<0?e!=l:e!=d)&&(y|=Cy),new Mh(f,y,m)}i+=u-c}return n?e+i:new Mh(e+i,0,null)}touches(e,t){let n=0,i=H1(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;n+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+t],u=this.ranges[i+n];e(a,a+c,l,l+u),s+=u-c}}invert(){return new lr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?lr.empty:new lr(e<0?[0,-e,0]:[0,0,e])}}lr.empty=new lr([]);class dl{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new dl(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new dl;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new Mh(e,i,null)}}const sd=Object.create(null);class Dt{getMap(){return lr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=sd[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in sd)throw new RangeError("Duplicate use of step JSON ID "+e);return sd[e]=t,t.prototype.jsonID=e,t}}class nt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new nt(e,null)}static fail(e){return new nt(null,e)}static fromReplace(e,t,n,i){try{return nt.ok(e.replace(t,n,i))}catch(s){if(s instanceof ll)return nt.fail(s.message);throw s}}}function Bf(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Bf(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return V.fromArray(n)}class In extends Dt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new re(Bf(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return nt.fromReplace(e,this.from,this.to,s)}invert(){return new on(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new In(t.pos,n.pos,this.mark)}merge(e){return e instanceof In&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new In(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new In(t.from,t.to,e.markFromJSON(t.mark))}}Dt.jsonID("addMark",In);class on extends Dt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new re(Bf(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return nt.fromReplace(e,this.from,this.to,n)}invert(){return new In(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new on(t.pos,n.pos,this.mark)}merge(e){return e instanceof on&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new on(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new on(t.from,t.to,e.markFromJSON(t.mark))}}Dt.jsonID("removeMark",on);class yi extends Dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return nt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return nt.fromReplace(e,this.pos,this.pos+1,new re(V.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new yi(this.pos,t.marks[i]);return new yi(this.pos,this.mark)}}return new zs(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yi(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yi(t.pos,e.markFromJSON(t.mark))}}Dt.jsonID("addNodeMark",yi);class zs extends Dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return nt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return nt.fromReplace(e,this.pos,this.pos+1,new re(V.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new yi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zs(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new zs(t.pos,e.markFromJSON(t.mark))}}Dt.jsonID("removeNodeMark",zs);class rt extends Dt{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&Th(e,this.from,this.to)?nt.fail("Structure replace would overwrite content"):nt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new lr([this.from,this.to-this.from,this.slice.size])}invert(e){return new rt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&rt.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new rt(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof rt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?re.empty:new re(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?re.empty:new re(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new rt(t.from,t.to,re.fromJSON(e,t.slice),!!t.structure)}}rt.MAP_BIAS=1;Dt.jsonID("replace",rt);class At extends Dt{constructor(e,t,n,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Th(e,this.from,this.gapFrom)||Th(e,this.gapTo,this.to)))return nt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return nt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?nt.fromReplace(e,this.from,this.to,n):nt.fail("Content does not fit in gap")}getMap(){return new lr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new At(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new At(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new At(t.from,t.to,t.gapFrom,t.gapTo,re.fromJSON(e,t.slice),t.insert,!!t.structure)}}Dt.jsonID("replaceAround",At);function Th(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function R8(r,e,t,n){let i=[],s=[],o,a;r.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,t),m=n.addToSet(d);for(let y=0;y<d.length;y++)d[y].isInSet(m)||(o&&o.to==h&&o.mark.eq(d[y])?o.to=f:i.push(o=new on(h,f,d[y])));a&&a.to==h?a.to=f:s.push(a=new In(h,f,n))}}),i.forEach(l=>r.step(l)),s.forEach(l=>r.step(l))}function I8(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(n instanceof iu){let c=o.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<i.length;f++){let m=i[f];m.step==s-1&&d.eq(i[f].style)&&(h=m)}h?(h.to=c,h.step=s):i.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>r.step(new on(o.from,o.to,o.style)))}function Pf(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,d=n.matchType(c.type);if(!d)o.push(new rt(a,u,re.empty));else{n=d;for(let h=0;h<c.marks.length;h++)t.allowsMarkType(c.marks[h].type)||r.step(new on(a,u,c.marks[h]));if(i&&c.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,m;for(;h=f.exec(c.text);)m||(m=new re(V.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new rt(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!n.validEnd){let l=n.fillBefore(V.empty,!0);r.replace(a,a,new re(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function z8(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function su(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),a=r.$from.index(n)+i,l=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(a,l,t))return n;if(n==0||o.type.spec.isolating||!z8(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function L8(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),a=i.after(s+1),l=o,c=a,u=V.empty,d=0;for(let m=s,y=!1;m>t;m--)y||n.index(m)>0?(y=!0,u=V.from(n.node(m).copy(u)),d++):l--;let h=V.empty,f=0;for(let m=s,y=!1;m>t;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=V.from(i.node(m).copy(h)),f++):c++;r.step(new At(l,c,o,a,new re(u.append(h),d,f),u.size-d,!0))}function Ff(r,e,t=null,n=r){let i=B8(r,e),s=i&&P8(n,e);return s?i.map(_1).concat({type:e,attrs:t}).concat(s.map(_1)):null}function _1(r){return{type:r,attrs:null}}function B8(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function P8(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function F8(r,e,t){let n=V.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let a=t[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=V.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new At(i,s,i,s,new re(n,0,0),t.length,!0))}function $8(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&q8(r.doc,r.mapping.slice(s).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&Ty(r,o,a,s),Pf(r,r.mapping.slice(s).map(a,1),n,void 0,c===null);let u=r.mapping.slice(s),d=u.map(a,1),h=u.map(a+o.nodeSize,1);return r.step(new At(d,h,d+1,h-1,new re(V.from(n.create(l,null,o.marks)),0,0),1,!0)),c===!0&&My(r,o,a,s),!1}})}function My(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Ty(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
|
|
25
|
+
`))}})}function q8(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function H8(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new At(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new re(V.from(o),0,0),1,!0))}function Ja(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>s;c--,u--){let d=i.node(c),h=i.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),m=n&&n[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let y=n&&n[u]||d;if(!d.canReplace(h+1,d.childCount)||!y.type.validContent(f))return!1}let a=i.indexAfter(s),l=n&&n[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function _8(r,e,t=1,n){let i=r.doc.resolve(e),s=V.empty,o=V.empty;for(let a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){s=V.from(i.node(a).copy(s));let u=n&&n[c];o=V.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}r.step(new rt(e,e,new re(s.append(o),t,t),!0))}function wc(r,e){let t=r.resolve(e),n=t.index();return V8(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function j8(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function V8(r,e){return!!(r&&e&&!r.isLeaf&&j8(r,e))}function W8(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);u&&!d?n=!1:!u&&d&&(n=!0)}let a=r.steps.length;if(n===!1){let u=r.doc.resolve(e+t);Ty(r,u.node(),u.before(),a)}o.inlineContent&&Pf(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let l=r.mapping.slice(a),c=l.map(e-t);if(r.step(new rt(c,l.map(e+t,-1),re.empty,!0)),n===!0){let u=r.doc.resolve(c);My(r,u.node(),u.before(),r.steps.length)}return r}function U8(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function K8(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let a=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(a>0?1:0),c=n.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(o+1):n.after(o+1)}return null}function ou(r,e,t=e,n=re.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return Ay(i,s,n)?new rt(e,t,n):new G8(i,s,n).fit()}function Ay(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class G8{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=V.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new re(s,o,a);return e>-1?new At(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new rt(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=od(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(V.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:a,parent:s,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=od(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=od(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new re($a(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new re($a(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let y=0;y<s.length;y++)this.openFrontierNode(s[y]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,c=0,u=[],{match:d,type:h}=this.frontier[t];if(i){for(let y=0;y<i.childCount;y++)u.push(i.child(y));d=d.matchFragment(i)}let f=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let y=a.child(c),b=d.matchType(y.type);if(!b)break;c++,(c>1||l==0||y.content.size)&&(d=b,u.push(Ny(y.mark(h.allowedMarks(y.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=qa(this.placed,t,V.from(u)),this.frontier[t].match=d,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,b=a;y<f;y++){let v=b.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),b=v.content}this.unplaced=m?e==0?re.empty:new re($a(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new re($a(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ad(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ad(e,t,i,n,s);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=ad(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=qa(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=qa(this.placed,this.depth,V.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(V.empty,!0);t.childCount&&(this.placed=qa(this.placed,this.frontier.length,t))}}function $a(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy($a(r.firstChild.content,e-1,t)))}function qa(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(qa(r.lastChild.content,e-1,t)))}function od(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function Ny(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,Ny(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(V.empty,!0)))),r.copy(n)}function ad(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=n.fillBefore(s.content,!0,o);return a&&!J8(t,s.content,o)?a:null}function J8(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function Y8(r){return r.spec.defining||r.spec.definingForContent}function X8(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(Ay(i,s,n))return r.step(new rt(e,t,n));let o=Dy(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?a=h:i.before(h)==f&&o.splice(1,0,-h)}let l=o.indexOf(a),c=[],u=n.openStart;for(let h=n.content,f=0;;f++){let m=h.firstChild;if(c.push(m),f==n.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let f=c[h],m=Y8(f.type);if(m&&!f.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!f.type.isTextblock)break}for(let h=n.openStart;h>=0;h--){let f=(h+u+1)%(n.openStart+1),m=c[f];if(m)for(let y=0;y<o.length;y++){let b=o[(y+l)%o.length],v=!0;b<0&&(v=!1,b=-b);let k=i.node(b-1),M=i.index(b-1);if(k.canReplaceWith(M,M,m.type,m.marks))return r.replace(i.before(b),v?s.after(b):t,new re(Ey(n.content,0,n.openStart,f),f,n.openEnd))}}let d=r.steps.length;for(let h=o.length-1;h>=0&&(r.replace(e,t,n),!(r.steps.length>d));h--){let f=o[h];f<0||(e=i.before(f),t=s.after(f))}}function Ey(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(Ey(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(V.empty,!0))}return r}function Z8(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=U8(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new re(V.from(n),0,0))}function Q8(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let o=n.sharedDepth(t),a=!1;for(let l=n.depth;l>o;l--)n.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=n.depth;l>0&&e==n.start(l);l--)e=n.before(l);for(let l=i.depth;l>0&&t==i.start(l);l--)t=i.before(l);n=r.doc.resolve(e),i=r.doc.resolve(t)}}let s=Dy(n,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return r.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return r.delete(n.before(a),i.after(a))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function Dy(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class vo extends Dt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return nt.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return nt.fromReplace(e,this.pos,this.pos+1,new re(V.from(i),0,t.isLeaf?0:1))}getMap(){return lr.empty}invert(e){return new vo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new vo(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new vo(t.pos,t.attr,t.value)}}Dt.jsonID("attr",vo);class hl extends Dt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return nt.ok(n)}getMap(){return lr.empty}invert(e){return new hl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new hl(t.attr,t.value)}}Dt.jsonID("docAttr",hl);let oa=class extends Error{};oa=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};oa.prototype=Object.create(Error.prototype);oa.prototype.constructor=oa;oa.prototype.name="TransformError";class Oy{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new dl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new oa(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),t=Math.max(t,l)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=re.empty){let i=ou(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new re(V.from(n),0,0))}delete(e,t){return this.replace(e,t,re.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return X8(this,e,t,n),this}replaceRangeWith(e,t,n){return Z8(this,e,t,n),this}deleteRange(e,t){return Q8(this,e,t),this}lift(e,t){return L8(this,e,t),this}join(e,t=1){return W8(this,e,t),this}wrap(e,t){return F8(this,e,t),this}setBlockType(e,t=e,n,i=null){return $8(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return H8(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new vo(e,t,n)),this}setDocAttribute(e,t){return this.step(new hl(e,t)),this}addNodeMark(e,t){return this.step(new yi(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof ke)t.isInSet(n.marks)&&this.step(new zs(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new zs(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,t=1,n){return _8(this,e,t,n),this}addMark(e,t,n){return R8(this,e,t,n),this}removeMark(e,t,n){return I8(this,e,t,n),this}clearIncompatible(e,t,n){return Pf(this,e,t,n),this}}const ld=Object.create(null);class pe{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ry(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=re.empty){let n=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),a?re.empty:t),a==0&&W1(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(n),c=l.map(o.pos),u=l.map(a.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),W1(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new se(e):so(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?so(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):so(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Yt(e.node(0))}static atStart(e){return so(e,e,0,0,1)||new Yt(e)}static atEnd(e){return so(e,e,e.content.size,e.childCount,-1)||new Yt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=ld[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ld)throw new RangeError("Duplicate use of selection JSON ID "+e);return ld[e]=t,t.prototype.jsonID=e,t}getBookmark(){return se.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class Ry{constructor(e,t){this.$from=e,this.$to=t}}let j1=!1;function V1(r){!j1&&!r.parent.inlineContent&&(j1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class se extends pe{constructor(e,t=e){V1(e),V1(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return pe.near(n);let i=e.resolve(t.map(this.anchor));return new se(i.parent.inlineContent?i:n,n)}replace(e,t=re.empty){if(super.replace(e,t),t==re.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof se&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new au(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new se(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=pe.findFrom(t,n,!0)||pe.findFrom(t,-n,!0);if(s)t=s.$head;else return pe.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-n,!0)||pe.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new se(e,t)}}pe.jsonID("text",se);class au{constructor(e,t){this.anchor=e,this.head=t}map(e){return new au(e.map(this.anchor),e.map(this.head))}resolve(e){return se.between(e.resolve(this.anchor),e.resolve(this.head))}}class ae extends pe{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?pe.near(s):new ae(s)}content(){return new re(V.from(this.node),0,0)}eq(e){return e instanceof ae&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new $f(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ae(e.resolve(t.anchor))}static create(e,t){return new ae(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ae.prototype.visible=!1;pe.jsonID("node",ae);class $f{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new au(n,n):new $f(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ae.isSelectable(n)?new ae(t):pe.near(t)}}class Yt extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=re.empty){if(t==re.empty){e.delete(0,e.doc.content.size);let n=pe.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Yt(e)}map(e){return new Yt(e)}eq(e){return e instanceof Yt}getBookmark(){return ew}}pe.jsonID("all",Yt);const ew={map(){return this},resolve(r){return new Yt(r)}};function so(r,e,t,n,i,s=!1){if(e.inlineContent)return se.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ae.isSelectable(a))return ae.create(r,t-(i<0?a.nodeSize:0))}else{let l=so(r,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function W1(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof rt||i instanceof At))return;let s=r.mapping.maps[n],o;s.forEach((a,l,c,u)=>{o==null&&(o=u)}),r.setSelection(pe.near(r.doc.resolve(o),t))}const U1=1,Uc=2,K1=4;class tw extends Oy{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|U1)&~Uc,this.storedMarks=null,this}get selectionSet(){return(this.updated&U1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Uc,this}ensureMarks(e){return ke.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Uc)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Uc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||ke.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(pe.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=K1,this}get scrolledIntoView(){return(this.updated&K1)>0}}function G1(r,e){return!e||!r?r:r.bind(e)}class Ha{constructor(e,t,n){this.name=e,this.init=G1(t.init,n),this.apply=G1(t.apply,n)}}const rw=[new Ha("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Ha("selection",{init(r,e){return r.selection||pe.atStart(e.doc)},apply(r){return r.selection}}),new Ha("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Ha("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class cd{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rw.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ha(n.key,n.spec.state,n))})}}class mo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,u=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,c,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),s=!0}i&&(i[o]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new mo(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new tw(this)}static create(e){let t=new cd(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new mo(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new cd(this.schema,e.plugins),n=t.fields,i=new mo(t);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new cd(e.schema,e.plugins),s=new mo(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=$n.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=pe.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=c.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Iy(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=Iy(i,e,{})),t[n]=i}return t}class Ae{constructor(e){this.spec=e,this.props={},e.props&&Iy(e.props,this,this.props),this.key=e.key?e.key.key:zy("plugin")}getState(e){return e[this.key]}}const ud=Object.create(null);function zy(r){return r in ud?r+"$"+ ++ud[r]:(ud[r]=0,r+"$")}class De{constructor(e="key"){this.key=zy(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const yt=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},aa=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let Ah=null;const xn=function(r,e,t){let n=Ah||(Ah=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},nw=function(){Ah=null},Ls=function(r,e,t,n){return t&&(J1(r,e,t,n,-1)||J1(r,e,t,n,1))},iw=/^(img|br|input|textarea|hr)$/i;function J1(r,e,t,n,i){for(var s;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Cr(r))){let o=r.parentNode;if(!o||o.nodeType!=1||kc(r)||iw.test(r.nodeName)||r.contentEditable=="false")return!1;e=yt(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?Cr(r):0}else return!1}}function Cr(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function sw(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=Cr(r)}else if(r.parentNode&&!kc(r))e=yt(r),r=r.parentNode;else return null}}function ow(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!kc(r))e=yt(r)+1,r=r.parentNode;else return null}}function aw(r,e,t){for(let n=e==0,i=e==Cr(r);n||i;){if(r==t)return!0;let s=yt(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==Cr(r)}}function kc(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const lu=function(r){return r.focusNode&&Ls(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function ts(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function lw(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function cw(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(Cr(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(Cr(n.startContainer),n.startOffset)}}}const un=typeof navigator<"u"?navigator:null,Y1=typeof document<"u"?document:null,Ri=un&&un.userAgent||"",Nh=/Edge\/(\d+)/.exec(Ri),Ly=/MSIE \d/.exec(Ri),Eh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ri),Xt=!!(Ly||Eh||Nh),bi=Ly?document.documentMode:Eh?+Eh[1]:Nh?+Nh[1]:0,Nr=!Xt&&/gecko\/(\d+)/i.test(Ri);Nr&&+(/Firefox\/(\d+)/.exec(Ri)||[0,0])[1];const Dh=!Xt&&/Chrome\/(\d+)/.exec(Ri),vt=!!Dh,By=Dh?+Dh[1]:0,Et=!Xt&&!!un&&/Apple Computer/.test(un.vendor),la=Et&&(/Mobile\/\w+/.test(Ri)||!!un&&un.maxTouchPoints>2),Sr=la||(un?/Mac/.test(un.platform):!1),Py=un?/Win/.test(un.platform):!1,zn=/Android \d/.test(Ri),xc=!!Y1&&"webkitFontSmoothing"in Y1.documentElement.style,uw=xc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function dw(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function bn(r,e){return typeof r=="number"?r:r[e]}function hw(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function X1(r,e,t){if(!Oh(e)&&e.left==0)return;let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=aa(o);continue}let a=o,l=a==s.body,c=l?dw(s):hw(a),u=0,d=0;if(e.top<c.top+bn(n,"top")?d=-(c.top-e.top+bn(i,"top")):e.bottom>c.bottom-bn(n,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+bn(i,"top")-c.top:e.bottom-c.bottom+bn(i,"bottom")),e.left<c.left+bn(n,"left")?u=-(c.left-e.left+bn(i,"left")):e.right>c.right-bn(n,"right")&&(u=e.right-c.right+bn(i,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,m=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let y=a.scrollLeft-f,b=a.scrollTop-m;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}let h=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:aa(o)}}function fw(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=r.root.elementFromPoint(s,o);if(!a||a==r.dom||!r.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:Fy(r.dom)}}function Fy(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=aa(n));return e}function pw({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;$y(t,n==0?0:n-e)}function $y(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:s}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let to=null;function mw(r){if(r.setActive)return r.setActive();if(to)return r.focus(to);let e=Fy(r);r.focus(to==null?{get preventScroll(){return to={preventScroll:!0},!0}}:void 0),to||(to=!1,$y(e,0))}function qy(r,e){let t,n=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let u=r.firstChild,d=0;u;u=u.nextSibling,d++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=xn(u).getClientRects();else continue;for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<n){t=u,n=y,i=y&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&y&&(s=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=d+1)}}return!t&&l&&(t=l,i=c,n=0),t&&t.nodeType==3?gw(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:qy(t,i)}function gw(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let s=0;s<t;s++){n.setEnd(r,s+1),n.setStart(r,s);let o=ii(n,1);if(o.top!=o.bottom&&qf(e,o)){i={node:r,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function qf(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function yw(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function vw(r,e,t){let{node:n,offset:i}=qy(e,t),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function bw(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let a=r.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>n.left||l.top>n.top?i=a.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function Hy(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=r.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(qf(e,c))return Hy(o,e,c)}}if((s=(s+1)%n)==i)break}return r}function ww(r,e){let t=r.dom.ownerDocument,n,i=0,s=cw(t,e.left,e.top);s&&({node:n,offset:i}=s);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),a;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=r.dom.getBoundingClientRect();if(!qf(e,c)||(o=Hy(r.dom,e,c),!o))return null}if(Et)for(let c=o;n&&c;c=aa(c))c.draggable&&(n=void 0);if(o=yw(o,e),n){if(Nr&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u=n.childNodes[i],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let c;xc&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=bw(r,n,i,e))}a==null&&(a=vw(r,o,e));let l=r.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Oh(r){return r.top<r.bottom||r.left<r.right}function ii(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(Oh(n))return n}return Array.prototype.find.call(t,Oh)||r.getBoundingClientRect()}const kw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _y(r,e,t){let{node:n,offset:i,atom:s}=r.docView.domFromPos(e,t<0?-1:1),o=xc||Nr;if(n.nodeType==3)if(o&&(kw.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let l=ii(xn(n,i,i),t);if(Nr&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=ii(xn(n,i-1,i-1),-1);if(c.top==l.top){let u=ii(xn(n,i,i+1),-1);if(u.top!=l.top)return Ra(u,u.left<c.left)}}return l}else{let l=i,c=i,u=t<0?1:-1;return t<0&&!i?(c++,u=-1):t>=0&&i==n.nodeValue.length?(l--,u=1):t<0?l--:c++,Ra(ii(xn(n,l,c),u),u<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Cr(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return dd(l.getBoundingClientRect(),!1)}if(s==null&&i<Cr(n)){let l=n.childNodes[i];if(l.nodeType==1)return dd(l.getBoundingClientRect(),!0)}return dd(n.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==Cr(n))){let l=n.childNodes[i-1],c=l.nodeType==3?xn(l,Cr(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ra(ii(c,1),!1)}if(s==null&&i<Cr(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?xn(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Ra(ii(c,-1),!0)}return Ra(ii(n.nodeType==3?xn(n):n,-t),t>=0)}function Ra(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function dd(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function jy(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function xw(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return jy(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=r.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=_y(r,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=xn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Sw=/[\u0590-\u08ac]/;function Cw(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,a=r.domSelection();return a?!Sw.test(n.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:jy(r,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=r.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",t,"character");let f=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:m,focusOffset:y}=r.domSelectionRange(),b=m&&!f.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==y;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),b}):n.pos==n.start()||n.pos==n.end()}let Z1=null,Q1=null,eg=!1;function Mw(r,e,t){return Z1==e&&Q1==t?eg:(Z1=e,Q1=t,eg=t=="up"||t=="down"?xw(r,e,t):Cw(r,e,t))}const Er=0,tg=1,is=2,_r=3;class Sc{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=Er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>yt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.size;if(a>e||o instanceof Wy){i=e-s;break}s=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof Vy&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?yt(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?yt(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let u=o+l.border;if(e>=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,u);e=o;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=yt(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=yt(d.dom);break}t+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let f=0,m=0;f<this.children.length;f++){let y=this.children[f],b=m+y.size;if(s>m&&o<b)return y.setSelection(e-m-y.border,t-m-y.border,n,i);m=b}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),u=n.domSelectionRange(),d=!1;if((Nr||Et)&&e==t){let{node:f,offset:m}=a;if(f.nodeType==3){if(d=!!(m&&f.nodeValue[m-1]==`
|
|
26
|
+
`),d&&m==f.nodeValue.length)for(let y=f,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:yt(b)+1});break}let v=y.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let y=f.childNodes[m-1];d=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Nr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||d&&Et)&&Ls(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Ls(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||e==t)&&!(d&&Nr)){c.collapse(a.node,a.offset);try{e!=t&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>t){let m=a;a=l,l=m}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let a=n+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==n||t==o?is:tg,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=_r:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?is:_r}n=o}this.dirty=is}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?is:tg;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Vy extends Sc{constructor(e,t,n,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==Er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Tw extends Sc{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class wi extends Sc{constructor(e,t,n,i,s){super(e,[],n,i),this.mark=t,this.spec=s}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=qs.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new wi(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&_r||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=_r&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Er){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Er}}slice(e,t,n){let i=wi.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;t<o&&(s=Ih(s,t,o,n)),e>0&&(s=Ih(s,0,e,n));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ki extends Sc{constructor(e,t,n,i,s,o,a){super(e,[],s,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,t,n,i,s,o){let a=s.nodeViews[t.type.name],l,c=a&&a(t,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=qs.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Gy(u,n,t),c?l=new Aw(e,t,n,i,u,d||null,h,c):t.isText?new cu(e,t,n,i,u,h):new ki(e,t,n,i,u,d||null,h)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let i=this.children[n];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));n?t.contentElement=n:t.getContent=()=>V.empty}}return t}matchesNode(e,t,n){return this.dirty==Er&&e.eq(this.node)&&z0(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new Ew(this,o&&o.node,e);Rw(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e,u):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?ke.none:this.node.child(u).marks,n,e,u),l.placeWidget(c,e,i)},(c,u,d,h)=>{l.syncToMarks(c.marks,n,e,h);let f;l.findNodeMatch(c,u,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(f=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,h,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==is)&&(o&&this.protectLocalComposition(e,o),Uy(this.contentDOM,this.children,e),la&&Iw(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof se)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=zw(this.node.content,o,n-t,i-t);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Tw(this,s,t,i);e.input.compositionNodes.push(o),this.children=Ih(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==_r||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Er}updateOuterDeco(e){if(z0(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Ky(this.dom,this.nodeDOM,Rh(this.outerDeco,this.node,t),Rh(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function rg(r,e,t,n,i){Gy(n,e,r);let s=new ki(void 0,r,e,t,n,n,n);return s.contentDOM&&s.updateChildren(i,0),s}class cu extends ki{constructor(e,t,n,i,s,o){super(e,t,n,i,s,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==_r||this.dirty!=Er&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Er||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Er,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new cu(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=_r)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Wy extends Sc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Aw extends ki{constructor(e,t,n,i,s,o,a,l){super(e,t,n,i,s,o,a),this.spec=l}update(e,t,n,i){if(this.dirty==_r)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Uy(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==r){for(;a!=n;)n=ng(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(a,n);if(o instanceof wi){let l=n?n.previousSibling:r.lastChild;Uy(o.contentDOM,o.children,t),n=l?l.nextSibling:r.firstChild}}for(;n;)n=ng(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const Ya=function(r){r&&(this.nodeName=r)};Ya.prototype=Object.create(null);const ss=[new Ya];function Rh(r,e,t){if(r.length==0)return ss;let n=t?ss[0]:new Ya,i=[n];for(let s=0;s<r.length;s++){let o=r[s].type.attrs;if(o){o.nodeName&&i.push(n=new Ya(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&i.length==1&&i.push(n=new Ya(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function Ky(r,e,t,n){if(t==ss&&n==ss)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],a=t[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=r&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=ss[0]),i=l}Nw(i,a||ss[0],o)}return i}function Nw(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&r.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&r.classList.add(i[s]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function Gy(r,e,t){return Ky(r,r,ss,Rh(e,t,r.nodeType!=1))}function z0(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function ng(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Ew{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Dw(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let d=this.top.children[u];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=u;break}}if(l<0&&this.index<this.top.children.length){let u=this.top.children[this.index];u instanceof wi&&u.dirty!=_r&&u.mark.type==e[o].type&&u.spec.update&&!this.isLocked(u.dom)&&u.spec.update(e[o])&&(u.mark=e[o],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=wi.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,t,n)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,i,s){let o=this.top.children[i];return o.dirty==_r&&o.dom==o.contentDOM&&(o.dirty=is),o.update(e,t,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ki){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,d,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=_r&&z0(t,l.outerDeco));if(!h&&l.update(e,t,n,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,t,n,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=is,d.updateChildren(i,o+1),d.dirty=Er),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!z0(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=ki.create(this.top,t,n,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,n,i,s){let o=ki.create(this.top,e,t,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Vy(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wi;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof cu)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Et||vt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new Wy(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Dw(r,e){let t=e,n=t.children.length,i=r.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(n){let c=t.children[n-1];if(c instanceof wi)t=c,n=c.children.length;else{a=c,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=r.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function Ow(r,e){return r.type.side-e.type.side}function Rw(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let c=0;c<r.childCount;c++){let u=r.child(c);n(u,i,e.forChild(s,u),c),s+=u.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let u,d;for(;o<i.length&&i[o].to==s;){let b=i[o++];b.widget&&(u?(d||(d=[u])).push(b):u=b)}if(u)if(d){d.sort(Ow);for(let b=0;b<d.length;b++)t(d[b],c,!!l)}else t(u,c,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(c<r.childCount)f=c,h=r.child(c++);else break;for(let b=0;b<a.length;b++)a[b].to<=s&&a.splice(b--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+h.nodeSize;if(h.isText){let b=m;o<i.length&&i[o].from<b&&(b=i[o].from);for(let v=0;v<a.length;v++)a[v].to<b&&(b=a[v].to);b<m&&(l=h.cut(b-s),h=h.cut(0,b-s),m=b,f=-1)}else for(;o<i.length&&i[o].to<m;)o++;let y=h.isInline&&!h.isLeaf?a.filter(b=>!b.inline):a.slice();n(h,y,e.forChild(s,h),f),s=m}}function Iw(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function zw(r,e,t,n){for(let i=0,s=0;i<r.childCount&&s<=n;){let o=r.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<r.childCount;){let c=r.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=t){if(s>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=t)return a+c;if(t==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function Ih(r,e,t,n,i){let s=[];for(let o=0,a=0;o<r.length;o++){let l=r[o],c=a,u=a+=l.size;c>=t||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,n)),i&&(s.push(i),i=void 0),u>t&&s.push(l.slice(t-c,l.size,n)))}return s}function Hf(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=n.resolve(o),l,c;if(lu(t)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&ae.isSelectable(d)&&i.parent&&!(d.isInline&&aw(t.focusNode,t.focusOffset,i.dom))){let h=i.posBefore;c=new ae(o==h?a:n.resolve(h))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,h=o;for(let f=0;f<t.rangeCount;f++){let m=t.getRangeAt(f);d=Math.min(d,r.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,r.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[l,o]=h==r.state.selection.anchor?[h,d]:[d,h],a=n.resolve(o)}else l=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let u=n.resolve(l);if(!c){let d=e=="pointer"||r.state.selection.head<a.pos&&!s?1:-1;c=_f(r,u,a,d)}return c}function Jy(r){return r.editable?r.hasFocus():Xy(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function qn(r,e=!1){let t=r.state.selection;if(Yy(r,t),!Jy(r))return;let n=r.input.mouseDown;if(!e&&vt&&n){let i=r.domSelectionRange(),s=r.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Ls(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&n.delaySelUpdate()){r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)Bw(r);else{let{anchor:i,head:s}=t,o,a;ig&&!(t instanceof se)&&(t.$from.parent.inlineContent||(o=sg(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=sg(r,t.to))),r.docView.setSelection(i,s,r,e),ig&&(o&&og(o),a&&og(a)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Lw(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}const ig=Et||vt&&By<63;function sg(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,s=n?t.childNodes[n-1]:null;if(Et&&i&&i.contentEditable=="false")return hd(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return hd(i);if(s)return hd(s)}}function hd(r){return r.contentEditable="true",Et&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function og(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function Lw(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Jy(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Bw(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,yt(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&Xt&&bi<=11&&(t.disabled=!0,t.disabled=!1)}function Yy(r,e){if(e instanceof ae){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(ag(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else ag(r)}function ag(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function _f(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||se.between(e,t,n)}function lg(r){return r.editable&&!r.hasFocus()?!1:Xy(r)}function Xy(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Pw(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Ls(e.node,e.offset,t.anchorNode,t.anchorOffset)}function zh(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&pe.findFrom(s,e)}function si(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function cg(r,e,t){let n=r.state.selection;if(n instanceof se)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return si(r,new se(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=zh(r.state,e);return i&&i instanceof ae?si(r,i):!1}else if(!(Sr&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(a))&&!o.contentDOM?ae.isSelectable(s)?si(r,new ae(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):xc?si(r,new se(r.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ae&&n.node.isInline)return si(r,new se(e>0?n.$to:n.$from));{let i=zh(r.state,e);return i?si(r,i):!1}}}function L0(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Xa(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function ro(r,e){return e<0?Fw(r):$w(r)}function Fw(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(Nr&&t.nodeType==1&&n<L0(t)&&Xa(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let a=t.childNodes[n-1];if(Xa(a,-1))i=t,s=--n;else if(a.nodeType==3)t=a,n=t.nodeValue.length;else break}}else{if(Zy(t))break;{let a=t.previousSibling;for(;a&&Xa(a,-1);)i=t.parentNode,s=yt(a),a=a.previousSibling;if(a)t=a,n=L0(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?Lh(r,t,n):i&&Lh(r,i,s)}function $w(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=L0(t),s,o;for(;;)if(n<i){if(t.nodeType!=1)break;let a=t.childNodes[n];if(Xa(a,1))s=t,o=++n;else break}else{if(Zy(t))break;{let a=t.nextSibling;for(;a&&Xa(a,1);)s=a.parentNode,o=yt(a)+1,a=a.nextSibling;if(a)t=a,n=0,i=L0(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}s&&Lh(r,s,o)}function Zy(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function qw(r,e){for(;r&&e==r.childNodes.length&&!kc(r);)e=yt(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function Hw(r,e){for(;r&&!e&&!kc(r);)e=yt(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function Lh(r,e,t){if(e.nodeType!=3){let s,o;(o=qw(e,t))?(e=o,t=0):(s=Hw(e,t))&&(e=s,t=s.nodeValue.length)}let n=r.domSelection();if(!n)return;if(lu(n)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&qn(r)},50)}function ug(r,e){let t=r.state.doc.resolve(e);if(!(vt||Py)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=r.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function dg(r,e,t){let n=r.state.selection;if(n instanceof se&&!n.empty||t.indexOf("s")>-1||Sr&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=zh(r.state,e);if(o&&o instanceof ae)return si(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=n instanceof Yt?pe.near(o,e):pe.findFrom(o,e);return a?si(r,a):!1}return!1}function hg(r,e){if(!(r.state.selection instanceof se))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function fg(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function _w(r){if(!Et||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;fg(r,n,"true"),setTimeout(()=>fg(r,n,"false"),20)}return!1}function jw(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function Vw(r,e){let t=e.keyCode,n=jw(e);if(t==8||Sr&&t==72&&n=="c")return hg(r,-1)||ro(r,-1);if(t==46&&!e.shiftKey||Sr&&t==68&&n=="c")return hg(r,1)||ro(r,1);if(t==13||t==27)return!0;if(t==37||Sr&&t==66&&n=="c"){let i=t==37?ug(r,r.state.selection.from)=="ltr"?-1:1:-1;return cg(r,i,n)||ro(r,i)}else if(t==39||Sr&&t==70&&n=="c"){let i=t==39?ug(r,r.state.selection.from)=="ltr"?1:-1:1;return cg(r,i,n)||ro(r,i)}else{if(t==38||Sr&&t==80&&n=="c")return dg(r,-1,n)||ro(r,-1);if(t==40||Sr&&t==78&&n=="c")return _w(r)||dg(r,1,n)||ro(r,1);if(n==(Sr?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function jf(r,e){r.someProp("transformCopied",f=>{e=f(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let f=n.firstChild;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=r.someProp("clipboardSerializer")||qs.fromSchema(r.state.schema),a=i5(),l=a.createElement("div");l.appendChild(o.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=n5[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let m=a.createElement(u[f]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=r.someProp("clipboardTextSerializer",f=>f(e,r))||e.content.textBetween(0,e.content.size,`
|
|
27
|
+
|
|
28
|
+
`);return{dom:l,text:h,slice:e}}function Qy(r,e,t,n,i){let s=i.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=!!e&&(n||s||!t);if(l){if(r.someProp("transformPastedText",h=>{e=h(e,s||n,r)}),s)return a=new re(V.from(r.state.schema.text(e.replace(/\r\n?/g,`
|
|
29
|
+
`))),0,0),r.someProp("transformPasted",h=>{a=h(a,r,!0)}),a;let d=r.someProp("clipboardTextParser",h=>h(e,i,n,r));if(d)a=d;else{let h=i.marks(),{schema:f}=r.state,m=qs.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let b=o.appendChild(document.createElement("p"));y&&b.appendChild(m.serializeNode(f.text(y,h)))})}}else r.someProp("transformPastedHTML",d=>{t=d(t,r)}),o=Gw(t),xc&&Jw(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(r.someProp("clipboardParser")||r.someProp("domParser")||Is.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!Ww.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Yw(pg(a,+u[1],+u[2]),u[4]);else if(a=re.maxOpen(Uw(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=pg(a,d,h)}return r.someProp("transformPasted",d=>{a=d(a,r,l)}),a}const Ww=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Uw(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&t5(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=r5(o[o.length-1],s.length));let u=e5(a,l);o.push(u),i=i.matchType(u.type),s=l}}),o)return V.from(o)}return r}function e5(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,V.from(r));return r}function t5(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let s=t5(r,e,t,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append(V.from(e5(t,r,i+1))))}}function r5(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,r5(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(V.empty,!0);return r.copy(t.append(n))}function Bh(r,e,t,n,i,s){let o=e<0?r.firstChild:r.lastChild,a=o.content;return r.childCount>1&&(s=0),i<n-1&&(a=Bh(a,e,t,n,i+1,s)),i>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(V.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(a))}function pg(r,e,t){return e<r.openStart&&(r=new re(Bh(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new re(Bh(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const n5={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function i5(){return document.implementation.createHTMLDocument("title")}let Ia=null;function Kw(r){let e=window.trustedTypes;if(!e)return r;if(!Ia){if(Ia=e.defaultPolicy)try{return Ia.createHTML(r)}catch{}Ia=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})}return Ia.createHTML(r)}function Gw(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=i5(),n=t.body,i=/<([a-z][^>\s]+)/i.exec(r),s;if((s=i&&n5[i[1].toLowerCase()])&&(r=s.map(o=>"<"+o+">").join("")+r+s.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=Kw(r),s)for(let o=0;o<s.length;o++)n=n.querySelector(s[o])||n;for(let o=0;o<t.styleSheets.length;o++){let a=t.styleSheets[o];for(let l=0;l<a.rules.length;l++){let c=a.rules[l];if(c instanceof CSSStyleRule){let u=n.querySelectorAll(c.selectorText);for(let d=0;d<u.length;d++)u[d].style.cssText+=c.style.cssText}}}return n}function Jw(r){let e=r.querySelectorAll(vt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function Yw(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:s,openEnd:o}=r;for(let a=n.length-2;a>=0;a-=2){let l=t.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;try{l.checkAttrs(n[a+1])}catch{break}i=V.from(l.create(n[a+1],i)),s++,o++}return new re(i,s,o)}const qt={},Ht={},Xw={touchstart:!0,touchmove:!0};class Zw{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Qw(r){for(let e in qt){let t=qt[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{tk(r,n)&&!Vf(r,n)&&(r.editable||!(n.type in Ht))&&t(r,n)},Xw[e]?{passive:!0}:void 0)}Et&&r.dom.addEventListener("input",()=>null),Ph(r)}function Ln(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function ek(r){r.input.mouseDown&&r.input.mouseDown.done(),r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function Ph(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>Vf(r,n))})}function Vf(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function tk(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function rk(r,e){!Vf(r,e)&&qt[e.type]&&(r.editable||!(e.type in Ht))&&qt[e.type](r,e)}Ht.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!l5(r)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(zn&&vt&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),la&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,ts(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||Vw(r,t)?t.preventDefault():Ln(r,"key")};Ht.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};Ht.keypress=(r,e)=>{let t=e;if(l5(r)||!t.charCode||t.ctrlKey&&!t.altKey||Sr&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof se)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),s=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,s))&&r.dispatch(s()),t.preventDefault()}};function Cc(r){return{left:r.clientX,top:r.clientY}}function nk(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function Wf(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,a=>o>s.depth?a(r,t,s.nodeAfter,s.before(o),i,!0):a(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Mc(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function ik(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&ae.isSelectable(n)?(Mc(r,new ae(t)),!0):!1}function sk(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof ae&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ae.isSelectable(a)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Mc(r,ae.create(r.state.doc,i)),!0):!1}function ok(r,e,t,n,i){return Wf(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?sk(r,t):ik(r,t))}function ak(r,e,t,n){return Wf(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function lk(r,e,t,n){return Wf(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||ck(r,t,n)}function ck(r,e,t){if(t.button!=0)return!1;let n=s5(r,e,!0),i=r.state.doc;return n?(Mc(r,n),n instanceof se&&i.eq(r.state.doc)&&(r.input.mouseDown=new dk(r,n)),!0):!1}function s5(r,e,t){let n=r.state.doc;if(e==-1)return n.inlineContent?se.create(n,0,n.content.size):null;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)return se.create(n,a+1,a+1+o.content.size);if(t&&ae.isSelectable(o))return ae.create(n,a)}return null}function Uf(r){return B0(r)}const o5=Sr?"metaKey":"ctrlKey";qt.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=Uf(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&nk(t,r.input.lastClick)&&!t[o5]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button},r.input.mouseDown&&r.input.mouseDown.done();let o=r.posAtCoords(Cc(t));o&&(s=="singleClick"?r.input.mouseDown=new uk(r,o,t,!!n):(s=="doubleClick"?ak:lk)(r,o.pos,o.inside,t)?t.preventDefault():Ln(r,"pointer"))};class a5{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class uk extends a5{constructor(e,t,n,i){super(e),this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[o5],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof ae&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Nr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Ln(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||qn(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Cc(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ln(this.view,"pointer"):ok(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||vt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Mc(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Ln(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ln(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class dk extends a5{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Ln(this.view,"pointer");let t=this.view.posAtCoords(Cc(e)),n=t&&s5(this.view,t.inside,!1);if(!n)return;let{doc:i}=this.view.state,s=this.startSelection,[o,a]=n.from<s.from?[s.to,n.from]:[s.from,n.to];Mc(this.view,se.create(i,o,a))}}qt.touchstart=r=>{r.input.lastTouch=Date.now(),Uf(r),Ln(r,"pointer")};qt.touchmove=r=>{r.input.lastTouch=Date.now(),Ln(r,"pointer")};qt.contextmenu=r=>Uf(r);function l5(r,e){return r.composing?!0:Et&&Math.abs(Date.now()-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const hk=zn?5e3:-1;Ht.compositionstart=Ht.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof se&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||vt&&Py&&fk(r)))r.markCursor=r.state.storedMarks||t.marks(),B0(r,!0),r.markCursor=null;else if(B0(r,!e.selection.empty),Nr&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=r.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}c5(r,hk)};function fk(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}Ht.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now(),r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,c5(r,20))};function c5(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>B0(r),e))}function u5(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Date.now());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function pk(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=sw(e.focusNode,e.focusOffset),n=ow(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,s=r.domObserver.lastChangedTextNode;if(t==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function B0(r,e=!1){if(!(zn&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),u5(r),e||r.docView&&r.docView.dirty){let t=Hf(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function mk(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const fl=Xt&&bi<15||la&&uw<604;qt.copy=Ht.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=fl?null:t.clipboardData,o=n.content(),{dom:a,text:l}=jf(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):mk(r,a),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function gk(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function yk(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?pl(r,n.value,null,i,e):pl(r,n.textContent,n.innerHTML,i,e)},50)}function pl(r,e,t,n,i){let s=Qy(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,s||re.empty)))return!0;if(!s)return!1;let o=gk(s),a=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function d5(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ht.paste=(r,e)=>{let t=e;if(r.composing&&!zn)return;let n=fl?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&pl(r,d5(n),n.getData("text/html"),i,t)?t.preventDefault():yk(r,t)};class h5{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const vk=Sr?"altKey":"ctrlKey";function f5(r,e){let t;return r.someProp("dragCopies",n=>{t=t||n(e)}),t!=null?!t:!e[vk]}qt.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(Cc(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ae?i.to-1:i.to))){if(n&&n.mightDrag)o=ae.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=ae.create(r.state.doc,d.posBefore))}}let a=(o||r.state.selection).content(),{dom:l,text:c,slice:u}=jf(r,a);(!t.dataTransfer.files.length||!vt||By>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fl?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",fl||t.dataTransfer.setData("text/plain",c),r.dragging=new h5(u,f5(r,t),o)};qt.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};Ht.dragover=Ht.dragenter=(r,e)=>e.preventDefault();Ht.drop=(r,e)=>{try{bk(r,e,r.dragging)}finally{r.dragging=null}};function bk(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(Cc(e));if(!n)return;let i=r.state.doc.resolve(n.pos),s=t&&t.slice;s?r.someProp("transformPasted",f=>{s=f(s,r,!1)}):s=Qy(r,d5(e.dataTransfer),fl?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&f5(r,e));if(r.someProp("handleDrop",f=>f(r,e,s||re.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?K8(r.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=r.state.tr;if(o){let{node:f}=t;f?f.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(u?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(d))return;let h=l.doc.resolve(c);if(u&&ae.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ae(h));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,y,b,v)=>f=v),l.setSelection(_f(r,h,l.doc.resolve(f)))}r.focus(),r.dispatch(l.setMeta("uiEvent","drop"))}qt.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&qn(r)},20))};qt.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};qt.beforeinput=(r,e)=>{if(zn&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,ts(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Ht)qt[r]=Ht[r];function ml(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class P0{constructor(e,t){this.toDOM=e,this.spec=t||Ss,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Ze(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof P0&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ml(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xi{constructor(e,t){this.attrs=e,this.spec=t||Ss}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new Ze(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof xi&&ml(this.attrs,e.attrs)&&ml(this.spec,e.spec)}static is(e){return e.type instanceof xi}destroy(){}}class Kf{constructor(e,t){this.attrs=e,this.spec=t||Ss}map(e,t,n,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ze(s.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(n)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Kf&&ml(this.attrs,e.attrs)&&ml(this.spec,e.spec)}destroy(){}}class Ze{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Ze(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Ze(e,e,new P0(t,n))}static inline(e,t,n,i){return new Ze(e,t,new xi(n,i))}static node(e,t,n,i){return new Ze(e,t,new Kf(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof xi}get widget(){return this.type instanceof P0}}const oo=[],Ss={};class $e{constructor(e,t){this.local=e.length?e:oo,this.children=t.length?t:oo}static create(e,t){return t.length?F0(t,e,0,Ss):Mt}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!s||s(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,n,i+a,s)}}map(e,t,n){return this==Mt||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ss)}mapInner(e,t,n,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?wk(this.children,o||[],e,t,n,i,s):o?new $e(o.sort(Cs),oo):Mt}add(e,t){return t.length?this==Mt?$e.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,s=0;e.forEach((a,l)=>{let c=l+n,u;if(u=m5(t,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,u,c+1):i.splice(s,0,l,l+a.nodeSize,F0(u,a,c+1,Ss)),s+=3}});let o=p5(s?g5(t):t,-n);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new $e(o.length?this.local.concat(o).sort(Cs):this.local,i||this.children)}remove(e){return e.length==0||this==Mt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,a=n[s]+t,l=n[s+1]+t;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;n==this.children&&(n=this.children.slice());let c=n[s+2].removeInner(o,a+1);c!=Mt?n[s+2]=c:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new $e(i,n):Mt}forChild(e,t){if(this==Mt)return this;if(t.isLeaf)return $e.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof xi){let c=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new $e(i.sort(Cs),oo);return n?new li([a,n]):a}return n||Mt}eq(e){if(this==e)return!0;if(!(e instanceof $e)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Gf(this.localsInner(e))}localsInner(e){if(this==Mt)return oo;if(e.inlineContent||!this.local.some(xi.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof xi||t.push(this.local[n]);return t}forEachSet(e){e(this)}}$e.empty=new $e([],[]);$e.removeOverlap=Gf;const Mt=$e.empty;class li{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,Ss));return li.from(n)}forChild(e,t){if(t.isLeaf)return $e.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=Mt&&(s instanceof li?n=n.concat(s.members):n.push(s))}return li.from(n)}eq(e){if(!(e instanceof li)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{n&&(t=t.slice(),n=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?Gf(n?t:t.sort(Cs)):oo}static from(e){switch(e.length){case 0:return Mt;case 1:return e[0];default:return new li(e.every(t=>t instanceof $e)?e:e.reduce((t,n)=>t.concat(n instanceof $e?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function wk(r,e,t,n,i,s,o){let a=r.slice();for(let c=0,u=s;c<t.maps.length;c++){let d=0;t.maps[c].forEach((h,f,m,y)=>{let b=y-m-(f-h);for(let v=0;v<a.length;v+=3){let k=a[v+1];if(k<0||h>k+u-d)continue;let M=a[v]+u-d;f>=M?a[v+1]=h<=M?-2:-1:h>=u&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=t.map(r[c]+s),d=u-i;if(d<0||d>=n.content.size){l=!0;continue}let h=t.map(r[c+1]+s,-1),f=h-i,{index:m,offset:y}=n.content.findIndex(d),b=n.maybeChild(m);if(b&&y==d&&y+b.nodeSize==f){let v=a[c+2].mapInner(t,b,u+1,r[c]+s+1,o);v!=Mt?(a[c]=d,a[c+1]=f,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=kk(a,r,e,t,i,s,o),u=F0(c,n,0,o);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<u.children.length;d+=3){let f=u.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,u.children[d],u.children[d+1],u.children[d+2])}}return new $e(e.sort(Cs),a)}function p5(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new Ze(i.from+e,i.to+e,i.type))}return t}function kk(r,e,t,n,i,s,o){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(n,i,c);d?t.push(d):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<r.length;l+=3)r[l+1]==-1&&a(r[l+2],e[l]+s+1);return t}function m5(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let s=0,o;s<r.length;s++)(o=r[s])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[s]=null);return i}function g5(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function F0(r,e,t,n){let i=[],s=!1;e.forEach((a,l)=>{let c=m5(r,a,l+t);if(c){s=!0;let u=F0(c,a,t+l+1,n);u!=Mt&&i.push(l,l+a.nodeSize,u)}});let o=p5(s?g5(r):r,-t).sort(Cs);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(n.onRemove&&n.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new $e(o,i):Mt}function Cs(r,e){return r.from-e.from||r.to-e.to}function Gf(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==r&&(e=r.slice()),e[i]=s.copy(s.from,n.to),mg(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,s.from),mg(e,i,n.copy(s.from,n.to)));break}}}return e}function mg(r,e,t){for(;e<r.length&&Cs(t,r[e])>0;)e++;r.splice(e,0,t)}function fd(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=Mt&&e.push(n)}),r.cursorWrapper&&e.push($e.create(r.state.doc,[r.cursorWrapper.deco])),li.from(e)}const xk={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Sk=Xt&&bi<=11;class Ck{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Mk{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ck,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Xt&&bi<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Et&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Sk&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,xk)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(lg(this.view)){if(this.suppressingSelectionUpdates)return qn(this.view);if(Xt&&bi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ls(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=aa(s))t.add(s);for(let s=e.anchorNode;s;s=aa(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&lg(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u<t.length;u++){let d=this.registerMutation(t[u],l);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||vt&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(Nr&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,h]=u;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of u){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||Nk(e,d)!=f)&&h.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&lu(n)&&(c=Hf(e))&&c.eq(pe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,qn(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),Tk(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Ek(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||qn(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Xt&&bi<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:h}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let o=i&&i.parentNode==e.target?yt(i)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?yt(s):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let gg=new WeakMap,yg=!1;function Tk(r){if(!gg.has(r)&&(gg.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=Nr,yg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),yg=!0}}function vg(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return Ls(o.node,o.offset,i,s)&&([t,n,i,s]=[i,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}}function Ak(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return vg(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?vg(r,t):null}function Nk(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function Ek(r,e){var t;let{focusNode:n,focusOffset:i}=r.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),n==s&&r.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function Dk(r,e,t,n){let{node:i,fromOffset:s,toOffset:o,from:a,to:l}=r.docView.parseRange(e,t),c=r.domSelectionRange(),u,d=c.anchorNode;if(d&&r.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],lu(c)||u.push({node:c.focusNode,offset:c.focusOffset})),vt&&r.input.lastKeyCode===8)for(let v=o;v>s;v--){let k=i.childNodes[v-1],M=k.pmViewDesc;if(k.nodeName=="BR"&&!M){o=v;break}if(!M||M.size)break}let h=r.state.doc,f=r.someProp("domParser")||Is.fromSchema(r.state.schema),m=h.resolve(a),y=null,b=f.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Ok(n),context:m});if(u&&u[0].pos!=null){let v=u[0].pos,k=u[1]&&u[1].pos;k==null&&(k=v),y={anchor:v+a,head:k+a}}return{doc:b,sel:y,from:a,to:l}}const Ok=r=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(r);if(e.nodeName=="BR"&&e.parentNode){if(Et&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Et&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},Rk=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ik(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let T=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,B=Hf(r,T);if(B&&!r.state.selection.eq(B)){if(vt&&zn&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",q=>q(r,ts(13,"Enter"))))return;let N=r.state.tr.setSelection(B);T=="pointer"?N.setMeta("pointer",!0):T=="key"&&N.scrollIntoView(),s&&N.setMeta("composition",s),r.dispatch(N)}return}let o=r.state.doc.resolve(e),a=o.sharedDepth(t);e=o.before(a+1),t=r.state.doc.resolve(t).after(a+1);let l=r.state.selection,c=Dk(r,e,t,i),u=r.state.doc,d=u.slice(c.from,c.to),h,f;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(h=r.state.selection.to,f="end"):(h=r.state.selection.from,f="start"),r.input.lastKeyCode=null;let m=Bk(d.content,c.doc.content,c.from,h,f);if(m&&r.input.domChangeCount++,(la&&r.input.lastIOSEnter>Date.now()-225||zn)&&i.some(T=>T.nodeType==1&&!Rk.test(T.nodeName))&&(!m||m.endA>=m.endB)&&r.someProp("handleKeyDown",T=>T(r,ts(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!m)if(n&&l instanceof se&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let T=bg(r,r.state.doc,c.sel);if(T&&!T.eq(r.state.selection)){let B=r.state.tr.setSelection(T);s&&B.setMeta("composition",s),r.dispatch(B)}}return}r.state.selection.from<r.state.selection.to&&m.start==m.endB&&r.state.selection instanceof se&&(m.start>r.state.selection.from&&m.start<=r.state.selection.from+2&&r.state.selection.from>=c.from?m.start=r.state.selection.from:m.endA<r.state.selection.to&&m.endA>=r.state.selection.to-2&&r.state.selection.to<=c.to&&(m.endB+=r.state.selection.to-m.endA,m.endA=r.state.selection.to)),Xt&&bi<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let y=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),v=u.resolve(m.start),k=y.sameParent(b)&&y.parent.inlineContent&&v.end()>=m.endA;if((la&&r.input.lastIOSEnter>Date.now()-225&&(!k||i.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!k&&y.pos<c.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&y.pos<b.pos&&!/\S/.test(c.doc.textBetween(y.pos,b.pos,"","")))&&r.someProp("handleKeyDown",T=>T(r,ts(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>m.start&&Lk(u,m.start,m.endA,y,b)&&r.someProp("handleKeyDown",T=>T(r,ts(8,"Backspace")))){zn&&vt&&r.domObserver.suppressSelectionUpdates();return}vt&&m.endB==m.start&&(r.input.lastChromeDelete=Date.now()),zn&&!k&&y.start()!=b.start()&&b.parentOffset==0&&y.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{r.someProp("handleKeyDown",function(T){return T(r,ts(13,"Enter"))})},20));let M=m.start,D=m.endA,O=T=>{let B=T||r.state.tr.replace(M,D,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let N=bg(r,B.doc,c.sel);N&&!(vt&&r.composing&&N.empty&&(m.start!=m.endB||r.input.lastChromeDelete<Date.now()-100)&&(N.head==M||N.head==B.mapping.map(D)-1)||Xt&&N.empty&&N.head==M)&&B.setSelection(N)}return s&&B.setMeta("composition",s),B.scrollIntoView()},z;if(k)if(y.pos==b.pos){Xt&&bi<=11&&y.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>qn(r),20));let T=O(r.state.tr.delete(M,D)),B=u.resolve(m.start).marksAcross(u.resolve(m.endA));B&&T.ensureMarks(B),r.dispatch(T)}else if(m.endA==m.endB&&(z=zk(y.parent.content.cut(y.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start())))){let T=O(r.state.tr);z.type=="add"?T.addMark(M,D,z.mark):T.removeMark(M,D,z.mark),r.dispatch(T)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-(b.textOffset?0:1)){let T=y.parent.textBetween(y.parentOffset,b.parentOffset),B=()=>O(r.state.tr.insertText(T,M,D));r.someProp("handleTextInput",N=>N(r,M,D,T,B))||r.dispatch(B())}else r.dispatch(O());else r.dispatch(O())}function bg(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:_f(r,e.resolve(t.anchor),e.resolve(t.head))}function zk(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,a,l;for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);for(let u=0;u<t.length;u++)s=t[u].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(V.from(c).eq(r))return{mark:a,type:o}}function Lk(r,e,t,n,i){if(t-e<=i.pos-n.pos||pd(n,!0,!1)<i.pos)return!1;let s=r.resolve(e);if(!n.parent.isTextblock){let a=s.nodeAfter;return a!=null&&t==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=r.resolve(pd(s,!0,!0));return!o.parent.isTextblock||o.pos>t||pd(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function pd(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Bk(r,e,t,n,i){let s=r.findDiffStart(e,t),o=t+r.size,a=t+e.size;if(s==null)return null;let{a:l,b:c}=r.findDiffEnd(e,o,a);if(i=="end"){let u=Math.max(0,s-Math.min(l,c));n-=l+u-s}if(l<s&&o<a){let u=n<=s&&n>=l?s-n:0;s-=u,c=s+(c-l),l=s}else if(c<s){let u=n<=s&&n>=c?s-n:0;s-=u,l=s+(l-c),c=s}return{start:s,endA:l,endB:c}}class y5{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Zw,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Cg),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=xg(this),kg(this),this.nodeViews=Sg(this),this.docView=rg(this.state.doc,wg(this),fd(this),this.dom,this),this.domObserver=new Mk(this,(n,i,s,o)=>Ik(this,n,i,s,o)),this.domObserver.start(),Qw(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ph(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Cg),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(u5(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=Sg(this);Fk(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ph(this),this.editable=xg(this),kg(this);let l=fd(this),c=wg(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(o=!0);let h=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&fw(this);if(o){this.domObserver.stop();let f=d&&(Xt||vt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Pk(i.selection,e.selection);if(d){let y=vt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pk(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=rg(e.doc,c,l,this.dom,this)),y&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}let m=this.input.mouseDown;f||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Pw(this)&&m.delaySelUpdate())?qn(this,f):(Yy(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&pw(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof ae){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&X1(this,t.getBoundingClientRect(),e)}else X1(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new h5(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=t?t(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=t?t(a):a))return i}}hasFocus(){if(Xt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&mw(this.dom),qn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ww(this,e)}coordsAtPos(e,t=1){return _y(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Mw(this,t||this.state,e)}pasteHTML(e,t){return pl(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return pl(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return jf(this,e)}destroy(){this.docView&&(ek(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,nw())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return rk(this,e)}domSelectionRange(){let e=this.domSelection();return e?Et&&this.root.nodeType===11&&lw(this.dom.ownerDocument)==this.dom&&Ak(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}y5.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function wg(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[Ze.node(0,r.state.doc.content.size,e)]}function kg(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:Ze.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function xg(r){return!r.someProp("editable",e=>e(r.state)===!1)}function Pk(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function Sg(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function Fk(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function Cg(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const $k=R.createContext({contentRef:()=>{},view:null,mark:null}),qk=R.createContext(r=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")});var Hk=class extends t8{constructor(...r){super(...r),this.context={contentRef:this.contentRef,view:this.view,mark:this.mark},this.updateContext=()=>{Object.assign(this.context,{mark:this.mark})}}},_k=class extends Hk{constructor(...r){super(...r),this.render=()=>{const e=this.component;return bc.createPortal(R.createElement($k.Provider,{value:this.context},R.createElement(e,null)),this.dom,this.key)}}};function jk(r,e,t){return function(i){return function(o,a,l){const c=new t({mark:o,view:a,inline:l,options:{...i,destroy(){var u;(u=i.destroy)==null||u.call(i),e(c)}}});return r(c,!1),c}}}function Vk(r,e){return R.useMemo(()=>jk(r,e,_k),[r,e])}const v5=R.createContext({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null}),Ii=()=>R.useContext(v5),b5=R.createContext(r=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")}),Wk=()=>R.useContext(b5);var Uk=class extends r8{constructor(...r){super(...r),this.context={contentRef:this.contentRef,view:this.view,getPos:this.getPos,setAttrs:this.setAttrs,node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations},this.updateContext=()=>{Object.assign(this.context,{node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations})}}},Kk=class extends Uk{constructor(...r){super(...r),this.render=()=>{const e=this.component;return bc.createPortal(R.createElement(v5.Provider,{value:this.context},R.createElement(e,null)),this.dom,this.key)}}};function Gk(r,e,t){return function(i){return function(o,a,l,c,u){const d=new t({node:o,view:a,getPos:l,decorations:c,innerDecorations:u,options:{...i,onUpdate(){var h;(h=i.onUpdate)==null||h.call(i),r(d)},selectNode(){var h;(h=i.selectNode)==null||h.call(i),r(d)},deselectNode(){var h;(h=i.deselectNode)==null||h.call(i),r(d)},destroy(){var h;(h=i.destroy)==null||h.call(i),e(d)}}});return r(d,!1),d}}}function Jk(r,e){return R.useMemo(()=>Gk(r,e,Kk),[r,e])}const w5=R.createContext({view:null}),k5=()=>R.useContext(w5),x5=R.createContext(r=>{throw new Error("out of scope")}),Yk=()=>R.useContext(x5);var Xk=class extends n8{constructor(...r){super(...r),this.context={view:this.view,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{const e=this.component;return bc.createPortal(R.createElement(w5.Provider,{value:this.context},R.createElement(e,null)),this.root,this.key)}}};function Zk(r,e){return R.useCallback(t=>n=>{const i=new Xk({view:n,options:{...t,update:(s,o)=>{var a;(a=t.update)==null||a.call(t,s,o),r(i)},destroy:()=>{var s;(s=t.destroy)==null||s.call(t),e(i)}}});return r(i,!1),i},[e,r])}function Qk(r,e){const[t,n]=r,i=e.key,s=R.createElement(R.Fragment,{key:i},e.render()),o=t.indexOf(i);if(o===-1)return[[...t,i],[...n,s]];{const a=[...n];return a[o]=s,[t,a]}}function ex(r,e){const[t,n]=r,i=t.indexOf(e.key);if(i===-1)return r;const s=[...t],o=[...n];return s.splice(i,1),o.splice(i,1),[s,o]}function tx(){const[r,e]=R.useState([[],[]]),t=R.useRef(!1);R.useLayoutEffect(()=>(t.current=!0,()=>{t.current=!1}),[]);const n=R.useCallback(i=>{t.current?bc.flushSync(i):i()},[]);return{render:()=>r[1],renderReactRenderer:R.useCallback((i,s=!0)=>{n(()=>(s&&i.updateContext(),e(o=>Qk(o,i))))},[n]),removeReactRenderer:R.useCallback(i=>{n(()=>e(s=>ex(s,i)))},[n])}}const rx=R.createContext({view:null,getPos:()=>{}}),nx=R.createContext(r=>{throw new Error("out of scope")});var ix=class extends i8{constructor(...r){super(...r),this.context={view:this.view,getPos:this.getPos,spec:this.spec},this.updateContext=()=>{Object.assign(this.context,{view:this.view,getPos:this.getPos,spec:this.spec})},this.render=()=>{const e=this.component;return bc.createPortal(R.createElement(rx.Provider,{value:this.context},R.createElement(e,null)),this.dom,this.key)}}};function sx(r,e){return R.useCallback(t=>(n,i={})=>{const s=new ix({pos:n,options:t}),o={...i,destroy:a=>{var l;(l=i.destroy)==null||l.call(i,a),e(s)}};return s.spec=o,Ze.widget(n,(a,l)=>(s.bind(a,l),r(s),s.dom),o)},[e,r])}const ox=({children:r})=>{const{renderReactRenderer:e,removeReactRenderer:t,render:n}=tx(),i=Jk(e,t),s=Vk(e,t),o=Zk(e,t),a=sx(e,t);return R.createElement(b5.Provider,{value:i},R.createElement(qk.Provider,{value:s},R.createElement(x5.Provider,{value:o},R.createElement(nx.Provider,{value:a},R.createElement(R.Fragment,{key:1},r),R.createElement(R.Fragment,{key:2},n())))))};var fr=(function(r){return r.docTypeError="docTypeError",r.contextNotFound="contextNotFound",r.timerNotFound="timerNotFound",r.ctxCallOutOfScope="ctxCallOutOfScope",r.createNodeInParserFail="createNodeInParserFail",r.stackOverFlow="stackOverFlow",r.parserMatchError="parserMatchError",r.serializerMatchError="serializerMatchError",r.getAtomFromSchemaFail="getAtomFromSchemaFail",r.expectDomTypeError="expectDomTypeError",r.callCommandBeforeEditorView="callCommandBeforeEditorView",r.missingRootElement="missingRootElement",r.missingNodeInSchema="missingNodeInSchema",r.missingMarkInSchema="missingMarkInSchema",r.ctxNotBind="ctxNotBind",r.missingYjsDoc="missingYjsDoc",r.aiProviderError="aiProviderError",r.aiBuildContextError="aiBuildContextError",r})({}),pr=class extends Error{constructor(r,e,t){super(e,t),this.name="MilkdownError",this.code=r,(t==null?void 0:t.cause)!==void 0&&(this.cause=t.cause)}},ax=(r,e)=>typeof e=="function"?"[Function]":e,uu=r=>JSON.stringify(r,ax);function lx(r){return new pr(fr.docTypeError,`Doc type error, unsupported type: ${uu(r)}`)}function cx(r){return new pr(fr.contextNotFound,`Context "${r}" not found, do you forget to inject it?`)}function ux(r){return new pr(fr.timerNotFound,`Timer "${r}" not found, do you forget to record it?`)}function du(){return new pr(fr.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function dx(r,e,t){const n=`Cannot create node for ${"name"in r?r.name:r}`,i=o=>{if(o==null)return"null";if(Array.isArray(o))return`[${o.map(i).join(", ")}]`;if(typeof o=="object")return"toJSON"in o&&typeof o.toJSON=="function"?JSON.stringify(o.toJSON()):"spec"in o?JSON.stringify(o.spec):JSON.stringify(o);if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return JSON.stringify(o);if(typeof o=="function")return`[Function: ${o.name||"anonymous"}]`;try{return String(o)}catch{return"[Unserializable]"}},s=[["[Description]",n],["[Attributes]",e],["[Content]",(t??[]).map(o=>o?typeof o=="object"&&"type"in o?`${o}`:i(o):"null")]].reduce((o,[a,l])=>{const c=`${a}: ${i(l)}.`;return o.concat(c)},[]);return new pr(fr.createNodeInParserFail,s.join(`
|
|
30
|
+
`))}function S5(){return new pr(fr.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function hx(r){return new pr(fr.parserMatchError,`Cannot match target parser for node: ${uu(r)}.`)}function fx(r){return new pr(fr.serializerMatchError,`Cannot match target serializer for node: ${uu(r)}.`)}function px(r,e){return new pr(fr.getAtomFromSchemaFail,`Cannot get ${r}: ${e} from schema.`)}function dn(r){return new pr(fr.expectDomTypeError,`Expect to be a dom, but get: ${uu(r)}.`)}function md(){return new pr(fr.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function C5(r){return new pr(fr.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${r}" in schema.`)}function mx(r){return new pr(fr.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${r}" in schema.`)}var M5=class{constructor(){this.sliceMap=new Map,this.get=r=>{const e=typeof r=="string"?[...this.sliceMap.values()].find(t=>t.type.name===r):this.sliceMap.get(r.id);if(!e){const t=typeof r=="string"?r:r.name;throw cx(t)}return e},this.remove=r=>{const e=typeof r=="string"?[...this.sliceMap.values()].find(t=>t.type.name===r):this.sliceMap.get(r.id);e&&this.sliceMap.delete(e.type.id)},this.has=r=>typeof r=="string"?[...this.sliceMap.values()].some(e=>e.type.name===r):this.sliceMap.has(r.id)}},Br,Mn,So,I2,gx=(I2=class{constructor(r,e,t){_(this,Br);_(this,Mn);_(this,So);F(this,Br,[]),F(this,So,()=>{C(this,Br).forEach(n=>n(C(this,Mn)))}),this.set=n=>{F(this,Mn,n),C(this,So).call(this)},this.get=()=>C(this,Mn),this.update=n=>{F(this,Mn,n(C(this,Mn))),C(this,So).call(this)},this.type=t,F(this,Mn,e),r.set(t.id,this)}on(r){return C(this,Br).push(r),()=>{F(this,Br,C(this,Br).filter(e=>e!==r))}}once(r){const e=this.on(t=>{r(t),e()});return e}off(r){F(this,Br,C(this,Br).filter(e=>e!==r))}offAll(){F(this,Br,[])}},Br=new WeakMap,Mn=new WeakMap,So=new WeakMap,I2),yx=class{constructor(r,e){this.id=Symbol(`Context-${e}`),this.name=e,this._defaultValue=r,this._typeInfo=()=>{throw du()}}create(r,e=this._defaultValue){return new gx(r,e,this)}},Se=(r,e)=>new yx(r,e),Rl,Il,zl,ls,Co,ui,Mo,To,Ao,z2,vx=(z2=class{constructor(r,e,t){_(this,Rl);_(this,Il);_(this,zl);_(this,ls);_(this,Co);_(this,ui);_(this,Mo);_(this,To);_(this,Ao);F(this,ls,new Set),F(this,Co,new Set),F(this,ui,new Map),F(this,Mo,new Map),this.read=()=>({metadata:C(this,Rl),injectedSlices:[...C(this,ls)].map(n=>({name:typeof n=="string"?n:n.name,value:C(this,To).call(this,n)})),consumedSlices:[...C(this,Co)].map(n=>({name:typeof n=="string"?n:n.name,value:C(this,To).call(this,n)})),recordedTimers:[...C(this,ui)].map(([n,{duration:i}])=>({name:n.name,duration:i,status:C(this,Ao).call(this,n)})),waitTimers:[...C(this,Mo)].map(([n,{duration:i}])=>({name:n.name,duration:i,status:C(this,Ao).call(this,n)}))}),this.onRecord=n=>{C(this,ui).set(n,{start:Date.now(),duration:0})},this.onClear=n=>{C(this,ui).delete(n)},this.onDone=n=>{const i=C(this,ui).get(n);i&&(i.duration=Date.now()-i.start)},this.onWait=(n,i)=>{const s=Date.now();i.finally(()=>{C(this,Mo).set(n,{duration:Date.now()-s})}).catch(console.error)},this.onInject=n=>{C(this,ls).add(n)},this.onRemove=n=>{C(this,ls).delete(n)},this.onUse=n=>{C(this,Co).add(n)},F(this,To,n=>C(this,Il).get(n).get()),F(this,Ao,n=>C(this,zl).get(n).status),F(this,Il,r),F(this,zl,e),F(this,Rl,t)}},Rl=new WeakMap,Il=new WeakMap,zl=new WeakMap,ls=new WeakMap,Co=new WeakMap,ui=new WeakMap,Mo=new WeakMap,To=new WeakMap,Ao=new WeakMap,z2),Tn,An,Ll,kr,No,bx=(No=class{constructor(e,t,n){_(this,Tn);_(this,An);_(this,Ll);_(this,kr);this.produce=i=>i&&Object.keys(i).length?new No(C(this,Tn),C(this,An),{...i}):this,this.inject=(i,s)=>{var a;const o=i.create(C(this,Tn).sliceMap);return s!=null&&o.set(s),(a=C(this,kr))==null||a.onInject(i),this},this.remove=i=>{var s;return C(this,Tn).remove(i),(s=C(this,kr))==null||s.onRemove(i),this},this.record=i=>{var s;return i.create(C(this,An).store),(s=C(this,kr))==null||s.onRecord(i),this},this.clearTimer=i=>{var s;return C(this,An).remove(i),(s=C(this,kr))==null||s.onClear(i),this},this.isInjected=i=>C(this,Tn).has(i),this.isRecorded=i=>C(this,An).has(i),this.use=i=>{var s;return(s=C(this,kr))==null||s.onUse(i),C(this,Tn).get(i)},this.get=i=>this.use(i).get(),this.set=(i,s)=>this.use(i).set(s),this.update=(i,s)=>this.use(i).update(s),this.timer=i=>C(this,An).get(i),this.done=i=>{var s;this.timer(i).done(),(s=C(this,kr))==null||s.onDone(i)},this.wait=i=>{var o;const s=this.timer(i).start();return(o=C(this,kr))==null||o.onWait(i,s),s},this.waitTimers=async i=>{await Promise.all(this.get(i).map(s=>this.wait(s)))},F(this,Tn,e),F(this,An,t),F(this,Ll,n),n&&F(this,kr,new vx(e,t,n))}get meta(){return C(this,Ll)}get inspector(){return C(this,kr)}},Tn=new WeakMap,An=new WeakMap,Ll=new WeakMap,kr=new WeakMap,No),wx=class{constructor(){this.store=new Map,this.get=r=>{const e=this.store.get(r.id);if(!e)throw ux(r.name);return e},this.remove=r=>{this.store.delete(r.id)},this.has=r=>this.store.has(r.id)}},Eo,di,Do,Nn,Oo,Bl,L2,kx=(L2=class{constructor(r,e){_(this,Eo);_(this,di);_(this,Do);_(this,Nn);_(this,Oo);_(this,Bl);F(this,Eo,null),F(this,di,null),F(this,Nn,"pending"),this.start=()=>(C(this,Eo)??F(this,Eo,new Promise((t,n)=>{F(this,di,i=>{i instanceof CustomEvent&&i.detail.id===C(this,Do)&&(F(this,Nn,"resolved"),C(this,Oo).call(this),i.stopImmediatePropagation(),t())}),C(this,Bl).call(this,()=>{C(this,Nn)==="pending"&&F(this,Nn,"rejected"),C(this,Oo).call(this),n(new Error(`Timing ${this.type.name} timeout.`))}),F(this,Nn,"pending"),addEventListener(this.type.name,C(this,di))})),C(this,Eo)),this.done=()=>{const t=new CustomEvent(this.type.name,{detail:{id:C(this,Do)}});dispatchEvent(t)},F(this,Oo,()=>{C(this,di)&&removeEventListener(this.type.name,C(this,di))}),F(this,Bl,t=>{setTimeout(()=>{t()},this.type.timeout)}),F(this,Do,Symbol(e.name)),this.type=e,r.set(e.id,this)}get status(){return C(this,Nn)}},Eo=new WeakMap,di=new WeakMap,Do=new WeakMap,Nn=new WeakMap,Oo=new WeakMap,Bl=new WeakMap,L2),xx=class{constructor(r,e=3e3){this.create=t=>new kx(t,this),this.id=Symbol(`Timer-${r}`),this.name=r,this.timeout=e}},Ur=(r,e=3e3)=>new xx(r,e);function Fh(r){const e=this;e.compiler=t;function t(n){return Fb(n,{...e.data("settings"),...r,extensions:e.data("toMarkdownExtensions")||[]})}}const Jf=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function T5(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const A5=(r,e,t)=>{let n=T5(r,t);if(!n)return!1;let i=Yf(n);if(!i){let o=n.blockRange(),a=o&&su(o);return a==null?!1:(e&&e(r.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(O5(r,i,e,-1))return!0;if(n.parent.content.size==0&&(ca(s,"end")||ae.isSelectable(s)))for(let o=n.depth;;o--){let a=ou(r.doc,n.before(o),n.after(o),re.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=r.tr.step(a);l.setSelection(ca(s,"end")?pe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ae.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Sx=(r,e,t)=>{let n=T5(r,t);if(!n)return!1;let i=Yf(n);return i?Cx(r,i,e):!1};function Cx(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=ou(r.doc,s,l,re.empty);if(!c||c.from!=s||c instanceof rt&&c.slice.size>=l-s)return!1;if(t){let u=r.tr.step(c);u.setSelection(se.create(u.doc,s)),t(u.scrollIntoView())}return!0}function ca(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const N5=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=Yf(n)}let o=s&&s.nodeBefore;return!o||!ae.isSelectable(o)?!1:(e&&e(r.tr.setSelection(ae.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Yf(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function Mx(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const Tx=(r,e,t)=>{let n=Mx(r,t);if(!n)return!1;let i=E5(n);if(!i)return!1;let s=i.nodeAfter;if(O5(r,i,e,1))return!0;if(n.parent.content.size==0&&(ca(s,"start")||ae.isSelectable(s))){let o=ou(r.doc,n.before(),n.after(),re.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=r.tr.step(o);a.setSelection(ca(s,"start")?pe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ae.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},Ax=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=E5(n)}let o=s&&s.nodeAfter;return!o||!ae.isSelectable(o)?!1:(e&&e(r.tr.setSelection(ae.create(r.doc,s.pos)).scrollIntoView()),!0)};function E5(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const Nx=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
|
|
31
|
+
`).scrollIntoView()),!0)};function Xf(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const D5=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=Xf(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=r.tr.replaceWith(a,a,o.createAndFill());l.setSelection(pe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Ex=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof Yt||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=Xf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=r.tr.insert(o,s.createAndFill());a.setSelection(se.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},Dx=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Ja(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&su(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function Ox(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!n.parentOffset||!Ja(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let f=n.depth;;f--)if(n.node(f).isBlock){l=n.end(f)==n.pos+(n.depth-f),c=n.start(f)==n.pos-(n.depth-f),a=Xf(n.node(f-1).contentMatchAt(n.indexAfter(f-1))),s.unshift(l&&a?{type:a}:null),o=f;break}else{if(f==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof se||e.selection instanceof Yt)&&u.deleteSelection();let d=u.mapping.map(n.pos),h=Ja(u.doc,d,s.length,s);if(h||(s[0]=a?{type:a}:null,h=Ja(u.doc,d,s.length,s)),!h)return!1;if(u.split(d,s.length,s),!l&&c&&n.node(o).type!=a){let f=u.mapping.map(n.before(o)),m=u.doc.resolve(f);a&&n.node(o-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(n.before(o)),a)}return t&&t(u.scrollIntoView()),!0}}const Rx=Ox(),Ix=(r,e)=>(e&&e(r.tr.setSelection(new Yt(r.doc))),!0);function zx(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||wc(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function O5(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&zx(r,e,t))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(t){let f=e.pos+s.nodeSize,m=V.empty;for(let v=o.length-1;v>=0;v--)m=V.from(o[v].create(null,m));m=V.from(i.copy(m));let y=r.tr.step(new At(e.pos-1,f,e.pos,f,new re(m,1,0),o.length,!0)),b=y.doc.resolve(f+2*o.length);b.nodeAfter&&b.nodeAfter.type==i.type&&wc(y.doc,b.pos)&&y.join(b.pos),t(y.scrollIntoView())}return!0}let u=s.type.spec.isolating||n>0&&l?null:pe.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&su(d);if(h!=null&&h>=e.depth)return t&&t(r.tr.lift(d,h).scrollIntoView()),!0;if(c&&ca(s,"start",!0)&&ca(i,"end")){let f=i,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let y=s,b=1;for(;!y.isTextblock;y=y.firstChild)b++;if(f.canReplace(f.childCount,f.childCount,y.content)){if(t){let v=V.empty;for(let M=m.length-1;M>=0;M--)v=V.from(m[M].copy(v));let k=r.tr.step(new At(e.pos-m.length,e.pos+s.nodeSize,e.pos+b,e.pos+s.nodeSize-b,new re(v,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function R5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(se.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const Lx=R5(-1),Bx=R5(1);function Zf(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&Ff(o,r,e);return a?(n&&n(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function gl(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[s];t.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];s.setBlockType(a,l,r,e)}n(s.scrollIntoView())}return!0}}function Px(r,e,t,n){for(let i=0;i<e.length;i++){let{$from:s,$to:o}=e[i],a=s.depth==0?r.inlineContent&&r.type.allowsMarkType(t):!1;if(r.nodesBetween(s.pos,o.pos,(l,c)=>{if(a)return!1;a=l.inlineContent&&l.type.allowsMarkType(t)}),a)return!0}return!1}function hu(r,e=null,t){return function(n,i){let{empty:s,$cursor:o,ranges:a}=n.selection;if(s&&!o||!Px(n.doc,a,r))return!1;if(i)if(o)r.isInSet(n.storedMarks||o.marks())?i(n.tr.removeStoredMark(r)):i(n.tr.addStoredMark(r.create(e)));else{let l,c=n.tr;l=!a.some(u=>n.doc.rangeHasMark(u.$from.pos,u.$to.pos,r));for(let u=0;u<a.length;u++){let{$from:d,$to:h}=a[u];if(!l)c.removeMark(d.pos,h.pos,r);else{let f=d.pos,m=h.pos,y=d.nodeAfter,b=h.nodeBefore,v=y&&y.isText?/^\s*/.exec(y.text)[0].length:0,k=b&&b.isText?/\s*$/.exec(b.text)[0].length:0;f+v<m&&(f+=v,m-=k),c.addMark(f,m,r.create(e))}}i(c.scrollIntoView())}return!0}}function ga(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}let gd=ga(Jf,A5,N5),Mg=ga(Jf,Tx,Ax);const Sn={Enter:ga(Nx,Ex,Dx,Rx),"Mod-Enter":D5,Backspace:gd,"Mod-Backspace":gd,"Shift-Backspace":gd,Delete:Mg,"Mod-Delete":Mg,"Mod-a":Ix},I5={"Ctrl-h":Sn.Backspace,"Alt-Backspace":Sn["Mod-Backspace"],"Ctrl-d":Sn.Delete,"Ctrl-Alt-Backspace":Sn["Mod-Delete"],"Alt-Delete":Sn["Mod-Delete"],"Alt-d":Sn["Mod-Delete"],"Ctrl-a":Lx,"Ctrl-e":Bx};for(let r in Sn)I5[r]=Sn[r];const Fx=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,$x=Fx?I5:Sn;class _t{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t=="string"?qx(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}}function qx(r){return function(e,t,n,i){let s=r;if(t[1]){let o=t[0].lastIndexOf(t[1]);s+=t[0].slice(o+t[1].length),n+=o;let a=n-i;a>0&&(s=t[0].slice(o-a,o)+s,n=i)}return e.tr.insertText(s,n,i)}}const Hx=(r,e)=>{let t=r.plugins;for(let n=0;n<t.length;n++){let i=t[n],s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){let o=r.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l--)o.step(a.steps[l].invert(a.docs[l]));if(s.text){let l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,l))}else o.delete(s.from,s.to);e(o)}return!0}}return!1};new _t(/--$/,"—",{inCodeMark:!1});new _t(/\.\.\.$/,"…",{inCodeMark:!1});new _t(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1});new _t(/"$/,"”",{inCodeMark:!1});new _t(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1});new _t(/'$/,"’",{inCodeMark:!1});function Qf(r,e,t=null,n){return new _t(r,(i,s,o,a)=>{let l=t instanceof Function?t(s):t,c=i.tr.delete(o,a),u=c.doc.resolve(o),d=u.blockRange(),h=d&&Ff(d,e,l);if(!h)return null;c.wrap(d,h);let f=c.doc.resolve(o-1).nodeBefore;return f&&f.type==e&&wc(c.doc,o-1)&&(!n||n(s,f))&&c.join(o-1),c})}function ep(r,e,t=null){return new _t(r,(n,i,s,o)=>{let a=n.doc.resolve(s),l=t instanceof Function?t(i):t;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?n.tr.delete(s,o).setBlockType(s,s,e,l):null})}const Ti=typeof navigator<"u"?navigator:null,Tg=typeof document<"u"?document:null,zi=Ti&&Ti.userAgent||"",$h=/Edge\/(\d+)/.exec(zi),z5=/MSIE \d/.exec(zi),qh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zi),fu=!!(z5||qh||$h),_x=z5?document.documentMode:qh?+qh[1]:$h?+$h[1]:0,L5=!fu&&/gecko\/(\d+)/i.test(zi),jx=L5&&+(/Firefox\/(\d+)/.exec(zi)||[0,0])[1],Hh=!fu&&/Chrome\/(\d+)/.exec(zi),B5=!!Hh,Vx=Hh?+Hh[1]:0,P5=!fu&&!!Ti&&/Apple Computer/.test(Ti.vendor),F5=P5&&(/Mobile\/\w+/.test(zi)||!!Ti&&Ti.maxTouchPoints>2),Wx=F5||(Ti?/Mac/.test(Ti.platform):!1),$5=/Android \d/.test(zi),q5=!!Tg&&"webkitFontSmoothing"in Tg.documentElement.style,Ux=q5?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var Kc=Object.freeze({__proto__:null,android:$5,chrome:B5,chrome_version:Vx,gecko:L5,gecko_version:jx,ie:fu,ie_version:_x,ios:F5,mac:Wx,safari:P5,webkit:q5,webkit_version:Ux});function yd(r,e,t,n,i,s){if(r.composing)return!1;const o=r.state,a=o.doc.resolve(e);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+n;for(let c of i){const u=c,d=u.match.exec(l),h=d&&d[0]&&u.handler(o,d,e-(d[0].length-n.length),t);if(h)return u.undoable!==!1&&h.setMeta(s,{transform:h,from:e,to:t,text:n}),r.dispatch(h),!0}return!1}const Kx=new De("MILKDOWN_CUSTOM_INPUTRULES");function Gx({rules:r}){const e=new Ae({key:Kx,isInputRules:!0,state:{init(){return null},apply(t,n){const i=t.getMeta(this);return i||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput(t,n,i,s){return yd(t,n,i,s,r,e)},handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:n}=t.state.selection;n&&yd(t,n.pos,n.pos,"",r,e)}),!1),keydown:(t,n)=>!($5&&B5&&n.key==="Enter")||t.composing?!1:t.someProp("handleKeyDown",i=>i(t,n))?(n.preventDefault(),!0):!1},handleKeyDown(t,n){if(n.key!=="Enter")return!1;const{$cursor:i}=t.state.selection;return i?yd(t,i.pos,i.pos,`
|
|
32
|
+
`,r,e):!1}}});return e}function H5(r){return r.some(e=>e.type.spec.code)}function Ag(r,e,t){if(e>=t)return!1;let n=!1;return r.doc.nodesBetween(e,t,i=>(i.isInline&&H5(i.marks)&&(n=!0),!n)),n}function Jx(r,e){var t;return H5((t=r.storedMarks)!=null?t:r.doc.resolve(e).marks())}function Tc(r,e,t={}){return new _t(r,(n,i,s,o)=>{var a,l,c,u;const{tr:d}=n,h=i.length;let f=i[h-1],m=i[0],y=[],b;const v={group:f,fullMatch:m,start:s,end:o},k=(a=t.updateCaptured)==null?void 0:a.call(t,v);if(Object.assign(v,k),{group:f,fullMatch:m,start:s,end:o}=v,m===null||(f==null?void 0:f.trim())==="")return null;if(f){const M=m.search(/\S/),D=s+m.indexOf(f),O=D+f.length,z=Ag(n,s+M,D),T=O<o&&Ag(n,O,o);if(z||T||Jx(n,o))return null;y=(l=d.storedMarks)!=null?l:[],O<o&&d.delete(O,o),D>s&&d.delete(s+M,D),b=s+M+f.length;const B=(c=t.getAttr)==null?void 0:c.call(t,i);d.addMark(s,b,e.create(B)),d.setStoredMarks(y),(u=t.beforeDispatch)==null||u.call(t,{match:i,start:s,end:o,tr:d})}return d})}function Yx(r,e,t={}){return new _t(r,(n,i,s,o)=>{var a,l,c;const{tr:u}=n;let d=i[1],h=i[0];const f={group:d,fullMatch:h,start:s,end:o},m=(a=t.updateCaptured)==null?void 0:a.call(t,f);if(Object.assign(f,m),{group:d,fullMatch:h,start:s,end:o}=f,h===null||!d||d.trim()==="")return null;const y=(l=t.getAttr)==null?void 0:l.call(t,i),b=e.createAndFill(y);return b&&(u.replaceRangeWith(e.isBlock?u.doc.resolve(s).before():s,o,b),(c=t.beforeDispatch)==null||c.call(t,{match:[h,d],start:s,end:o,tr:u})),u})}var Xx=Object.defineProperty,Zx=Object.defineProperties,Qx=Object.getOwnPropertyDescriptors,Ng=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,Eg=(r,e,t)=>e in r?Xx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,r9=(r,e)=>{for(var t in e||(e={}))e9.call(e,t)&&Eg(r,t,e[t]);if(Ng)for(var t of Ng(e))t9.call(e,t)&&Eg(r,t,e[t]);return r},n9=(r,e)=>Zx(r,Qx(e));function Dg(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function pu(r,e,t){const i=r.state.doc.content.size,s=Dg(e,0,i),o=Dg(t,0,i),a=r.coordsAtPos(s),l=r.coordsAtPos(o,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,m=u-c,v={top:c,bottom:u,left:d,right:h,width:f,height:m,x:d,y:c};return n9(r9({},v),{toJSON:()=>v})}function _5(r){return Object.assign(Object.create(r),r).setTime(Date.now())}function i9(r,e){return Array.isArray(r)&&r.includes(e.type)||e.type===r}function s9(r){if(r.content.childCount===1){const e=r.content.firstChild;if((e==null?void 0:e.type.name)==="text"&&e.marks.length===0)return e;if((e==null?void 0:e.type.name)==="paragraph"&&e.childCount===1){const t=e.firstChild;if((t==null?void 0:t.type.name)==="text"&&t.marks.length===0)return t}}return!1}function ln(r){return e=>{for(let t=e.depth;t>0;t-=1){const n=e.node(t);if(r(n)){const i=e.before(t),s=e.after(t);return{from:i,to:s,node:n}}}}}function o9(r,e){return ln(t=>t.type===e)(r)}function a9(r,e){const t=e.nodes[r];if(!t)throw px("node",r);return t}function j5(r){return e=>{for(let t=e.depth;t>0;t--){const n=e.node(t);if(r(n))return{pos:e.before(t),start:e.start(t),depth:t,node:n}}}}function l9(r){return e=>j5(r)(e.$from)}function c9(r,e){if(!(r instanceof ae))return;const{node:t,$from:n}=r;if(i9(e,t))return{node:t,pos:n.pos,start:n.start(n.depth),depth:n.depth}}const V5=(r,e)=>{const{selection:t,doc:n}=r;if(t instanceof ae)return{hasNode:t.node.type===e,pos:t.from,target:t.node};const{from:i,to:s}=t;let o=!1,a=-1,l=null;return n.nodesBetween(i,s,(c,u)=>l?!1:c.type===e?(o=!0,a=u,l=c,!1):!0),{hasNode:o,pos:a,target:l}},u9=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),d9=typeof navigator<"u"&&/Win/.test(navigator.platform);function h9(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))u9?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function f9(r){let e=Object.create(null);for(let t in r)e[h9(t)]=r[t];return e}function vd(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function W5(r){return new Ae({props:{handleKeyDown:tp(r)}})}function tp(r){let e=f9(r);return function(t,n){let i=K7(n),s,o=e[vd(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[vd(i,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(d9&&n.ctrlKey&&n.altKey)&&(s=G7[n.keyCode])&&s!=i){let a=e[vd(s,n)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var U5=class{},K5=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=r=>{var e;(e=this.top())==null||e.push(r)},this.open=r=>{this.elements.push(r)},this.close=()=>{const r=this.elements.pop();if(!r)throw S5();return r}}},p9=class G5 extends U5{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(e,t,n){return new G5(e,t,n)}},Pr,Ro,Pl,Fl,$l,Io,zo,Es,J5=(Es=class extends K5{constructor(t){super();_(this,Pr);_(this,Ro);_(this,Pl);_(this,Fl);_(this,$l);_(this,Io);_(this,zo);F(this,Pr,ke.none),F(this,Ro,n=>n.isText),F(this,Pl,(n,i)=>{if(C(this,Ro).call(this,n)&&C(this,Ro).call(this,i)&&ke.sameSet(n.marks,i.marks))return this.schema.text(n.text+i.text,n.marks)}),F(this,Fl,n=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(s=>s.spec.parseMarkdown.match(n));if(!i)throw hx(n);return i}),F(this,$l,n=>{const i=C(this,Fl).call(this,n);i.spec.parseMarkdown.runner(this,n,i)}),this.injectRoot=(n,i,s)=>(this.openNode(i,s),this.next(n.children),this),this.openNode=(n,i)=>(this.open(p9.create(n,[],i)),this),F(this,Io,()=>{F(this,Pr,ke.none);const n=this.close();return C(this,zo).call(this,n.type,n.attrs,n.content)}),this.closeNode=()=>{try{C(this,Io).call(this)}catch(n){console.error(n)}return this},F(this,zo,(n,i,s)=>{const o=n.createAndFill(i,s,C(this,Pr));if(!o)throw dx(n,i,s);return this.push(o),o}),this.addNode=(n,i,s)=>{try{C(this,zo).call(this,n,i,s)}catch(o){console.error(o)}return this},this.openMark=(n,i)=>{const s=n.create(i);return F(this,Pr,s.addToSet(C(this,Pr))),this},this.closeMark=n=>(F(this,Pr,n.removeFromSet(C(this,Pr))),this),this.addText=n=>{try{const i=this.top();if(!i)throw S5();const s=i.pop(),o=this.schema.text(n,C(this,Pr));if(!s)return i.push(o),this;const a=C(this,Pl).call(this,s,o);return a?(i.push(a),this):(i.push(s,o),this)}catch(i){return console.error(i),this}},this.build=()=>{let n;do n=C(this,Io).call(this);while(this.size());return n},this.next=(n=[])=>([n].flat().forEach(i=>C(this,$l).call(this,i)),this),this.toDoc=()=>this.build(),this.run=(n,i)=>{const s=n.runSync(n.parse(i),i);return this.next(s),this},this.schema=t}},Pr=new WeakMap,Ro=new WeakMap,Pl=new WeakMap,Fl=new WeakMap,$l=new WeakMap,Io=new WeakMap,zo=new WeakMap,Es.create=(t,n)=>{const i=new Es(t);return s=>(i.run(n,s),i.toDoc())},Es),Ds,Og=(Ds=class extends U5{constructor(e,t,n,i={}){super(),this.type=e,this.children=t,this.value=n,this.props=i,this.push=(s,...o)=>{this.children||(this.children=[]),this.children.push(s,...o)},this.pop=()=>{var s;return(s=this.children)==null?void 0:s.pop()}}},Ds.create=(e,t,n,i={})=>new Ds(e,t,n,i),Ds),m9=r=>Object.prototype.hasOwnProperty.call(r,"size"),Lt,Lo,ql,Hl,_l,jl,Bo,Po,Vl,Wl,cs,hi,Ul,Fo,Os,g9=(Os=class extends K5{constructor(t){super();_(this,Lt);_(this,Lo);_(this,ql);_(this,Hl);_(this,_l);_(this,jl);_(this,Bo);_(this,Po);_(this,Vl);_(this,Wl);_(this,cs);_(this,hi);_(this,Ul);_(this,Fo);F(this,Lt,[]),F(this,Lo,n=>{const i=Object.values({...this.schema.nodes,...this.schema.marks}).find(s=>s.spec.toMarkdown.match(n));if(!i)throw fx(n.type);return i}),F(this,ql,n=>C(this,Lo).call(this,n).spec.toMarkdown.runner(this,n)),F(this,Hl,(n,i)=>C(this,Lo).call(this,n).spec.toMarkdown.runner(this,n,i)),F(this,_l,n=>{const i=a=>a.type.spec.priority??50,s=[...n].sort((a,l)=>i(a)-i(l)),o=[];return C(this,Lt).forEach(({mark:a})=>{const l=s.findIndex(c=>c.eq(a));l>=0&&o.push(...s.splice(l,1))}),o.concat(s)}),F(this,jl,n=>{const i=n==null?void 0:n.marks;let s=0;for(;s<C(this,Lt).length;){const{mark:o,spanning:a}=C(this,Lt)[s];if(a&&(i!=null&&i.some(l=>l.eq(o))))s++;else break}for(let o=C(this,Lt).length-1;o>=s;o--)C(this,Fo).call(this,C(this,Lt)[o].mark)}),F(this,Bo,(n,i)=>{C(this,_l).call(this,n.marks).every(s=>!C(this,Hl).call(this,s,n))&&C(this,ql).call(this,n),C(this,jl).call(this,i)}),F(this,Po,n=>{const{children:i}=n;return i&&(n.children=i.reduce((s,o,a)=>{if(a===0)return[o];const l=s.at(-1);if(l&&l.isMark&&o.isMark){const{children:c,...u}=o,{children:d,...h}=l;if(o.type===l.type&&c&&d&&JSON.stringify(u)===JSON.stringify(h)){const f={...h,children:[...d,...c]};return s.slice(0,-1).concat(C(this,Po).call(this,f))}}return s.concat(o)},[])),n}),F(this,Vl,n=>{const i={...n.props,type:n.type};return n.children&&(i.children=n.children),n.value&&(i.value=n.value),i}),this.openNode=(n,i,s)=>(this.open(Og.create(n,void 0,i,s)),this),F(this,Wl,(n,i)=>{let s="",o="";const a=n.children;if(a){const c=a[0],u=a.at(-1);if(u&&u.type==="text"&&u.value.endsWith(" ")){const d=u.value,h=d.trimEnd();o=d.slice(h.length),u.value=h}if(c&&c.type==="text"&&c.value.startsWith(" ")){const d=c.value,h=d.trimStart();s=d.slice(0,d.length-h.length),c.value=h}}s.length&&C(this,hi).call(this,"text",void 0,s);const l=i();return o.length&&C(this,hi).call(this,"text",void 0,o),l}),F(this,cs,(n=!1)=>{const i=this.close(),s=()=>C(this,hi).call(this,i.type,i.children,i.value,i.props);return n?C(this,Wl).call(this,i,s):s()}),this.closeNode=()=>(C(this,cs).call(this),this),F(this,hi,(n,i,s,o)=>{const a=Og.create(n,i,s,o),l=C(this,Po).call(this,C(this,Vl).call(this,a));return this.push(l),l}),this.addNode=(n,i,s,o)=>(C(this,hi).call(this,n,i,s,o),this),F(this,Ul,(n,i,s,o)=>C(this,Lt).some(a=>a.mark.eq(n))?this:(C(this,Lt).push({mark:n,spanning:s==null}),this.openNode(i,s,{...o,isMark:!0}))),F(this,Fo,n=>{let i=-1;for(let s=C(this,Lt).length-1;s>=0;s--)if(C(this,Lt)[s].mark.eq(n)){i=s;break}i<0||(C(this,Lt).splice(i,1),C(this,cs).call(this,!0))}),this.withMark=(n,i,s,o)=>(C(this,Ul).call(this,n,i,s,o),this),this.closeMark=n=>(C(this,Fo).call(this,n),this),this.build=()=>{let n=null;do n=C(this,cs).call(this);while(this.size());return n},this.next=n=>m9(n)?(n.forEach((i,s,o)=>{C(this,Bo).call(this,i,n.maybeChild(o+1)??void 0)}),this):(C(this,Bo).call(this,n),this),this.toString=n=>n.stringify(this.build()),this.run=n=>(F(this,Lt,[]),this.next(n),this),this.schema=t}},Lt=new WeakMap,Lo=new WeakMap,ql=new WeakMap,Hl=new WeakMap,_l=new WeakMap,jl=new WeakMap,Bo=new WeakMap,Po=new WeakMap,Vl=new WeakMap,Wl=new WeakMap,cs=new WeakMap,hi=new WeakMap,Ul=new WeakMap,Fo=new WeakMap,Os.create=(t,n)=>{const i=new Os(t);return s=>(i.run(s),i.toString(n))},Os);function Vn(r,e){return r.meta={package:"@milkdown/core",group:"System",...e},r}var Y5={text:(r,e,t,n)=>{const i=r.value;return/^[^*_\\]*\s+$/.test(i)?i:t.safe(i,{...n,encode:[]})},strong:(r,e,t,n)=>{const i=r.marker||t.options.strong||"*",s=t.enter("strong"),o=t.createTracker(n);let a=o.move(i+i);return a+=o.move(t.containerPhrasing(r,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a},emphasis:(r,e,t,n)=>{const i=r.marker||t.options.emphasis||"*",s=t.enter("emphasis"),o=t.createTracker(n);let a=o.move(i);return a+=o.move(t.containerPhrasing(r,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}},Me=Se({},"editorView"),_a=Se({},"editorState"),bd=Se([],"initTimer"),_h=Se({},"editor"),yl=Se([],"inputRules"),ur=Se([],"prosePlugins"),vl=Se([],"remarkPlugins"),bl=Se([],"nodeView"),wl=Se([],"markView"),Si=Se(yh().use(vh).use(Fh),"remark"),Za=Se({handlers:Y5,encode:[]},"remarkStringifyOptions"),y0=Ur("ConfigReady");function y9(r){const e=t=>(t.record(y0),async()=>(await r(t),t.done(y0),()=>{t.clearTimer(y0)}));return Vn(e,{displayName:"Config"}),e}var Ms=Ur("InitReady");function v9(r){const e=t=>(t.inject(_h,r).inject(ur,[]).inject(vl,[]).inject(yl,[]).inject(bl,[]).inject(wl,[]).inject(Za,{handlers:Y5,encode:[]}).inject(Si,yh().use(vh).use(Fh)).inject(bd,[y0]).record(Ms),async()=>{await t.waitTimers(bd);const n=t.get(Za);return t.set(Si,yh().use(vh).use(Fh,n)),t.done(Ms),()=>{t.remove(_h).remove(ur).remove(vl).remove(yl).remove(bl).remove(wl).remove(Za).remove(Si).remove(bd).clearTimer(Ms)}});return Vn(e,{displayName:"Init"}),e}var bt=Ur("SchemaReady"),wd=Se([],"schemaTimer"),Zt=Se({},"schema"),Ci=Se([],"nodes"),Qa=Se([],"marks");function Rg(r){var e;return{...r,parseDOM:(e=r.parseDOM)==null?void 0:e.map(t=>({priority:r.priority,...t}))}}var X5=r=>(r.inject(Zt,{}).inject(Ci,[]).inject(Qa,[]).inject(wd,[Ms]).record(bt),async()=>{await r.waitTimers(wd);const e=r.get(Si),t=r.get(vl).reduce((o,a)=>o.use(a.plugin,a.options),e);r.set(Si,t);const n=Object.fromEntries(r.get(Ci).map(([o,a])=>[o,Rg(a)])),i=Object.fromEntries(r.get(Qa).map(([o,a])=>[o,Rg(a)])),s=new x8({nodes:n,marks:i});return r.set(Zt,s),r.done(bt),()=>{r.remove(Zt).remove(Ci).remove(Qa).remove(wd).clearTimer(bt)}});Vn(X5,{displayName:"Schema"});var us,xr,B2,Z5=(B2=class{constructor(){_(this,us);_(this,xr);F(this,us,new M5),F(this,xr,null),this.setCtx=r=>{F(this,xr,r)},this.chain=()=>{if(C(this,xr)==null)throw md();const r=C(this,xr),e=[],t=this.get.bind(this),n={run:()=>{const s=ga(...e),o=r.get(Me);return s(o.state,o.dispatch,o)},inline:s=>(e.push(s),n),pipe:i.bind(this)};function i(s,o){const a=t(s);return e.push(a(o)),n}return n}}get ctx(){return C(this,xr)}create(r,e){const t=r.create(C(this,us).sliceMap);return t.set(e),t}get(r){return C(this,us).get(r).get()}remove(r){return C(this,us).remove(r)}call(r,e){if(C(this,xr)==null)throw md();const t=this.get(r)(e),n=C(this,xr).get(Me);return t(n.state,n.dispatch,n)}inline(r){if(C(this,xr)==null)throw md();const e=C(this,xr).get(Me);return r(e.state,e.dispatch,e)}},us=new WeakMap,xr=new WeakMap,B2);function b9(r="cmdKey"){return Se((()=>()=>!1),r)}var oe=Se(new Z5,"commands"),kd=Se([bt],"commandsTimer"),el=Ur("CommandsReady"),Q5=r=>{const e=new Z5;return e.setCtx(r),r.inject(oe,e).inject(kd,[bt]).record(el),async()=>(await r.waitTimers(kd),r.done(el),()=>{r.remove(oe).remove(kd).clearTimer(el)})};Vn(Q5,{displayName:"Commands"});function w9(r){return r.Backspace=ga(Hx,Jf,Sx,N5),r}var ds,Wt,P2,e3=(P2=class{constructor(){_(this,ds);_(this,Wt);F(this,ds,null),F(this,Wt,[]),this.setCtx=r=>{F(this,ds,r)},this.add=r=>(C(this,Wt).push(r),()=>{F(this,Wt,C(this,Wt).filter(e=>e!==r))}),this.addObjectKeymap=r=>{const e=[];return Object.entries(r).forEach(([t,n])=>{if(typeof n=="function"){const i={key:t,onRun:()=>n};C(this,Wt).push(i),e.push(()=>{F(this,Wt,C(this,Wt).filter(s=>s!==i))})}else C(this,Wt).push(n),e.push(()=>{F(this,Wt,C(this,Wt).filter(i=>i!==n))})}),()=>{e.forEach(t=>t())}},this.addBaseKeymap=()=>{const r=w9($x);return this.addObjectKeymap(r)},this.build=()=>{const r={};return C(this,Wt).forEach(e=>{r[e.key]=[...r[e.key]||[],e]}),Object.fromEntries(Object.entries(r).map(([e,t])=>{const n=t.sort((s,o)=>(o.priority??50)-(s.priority??50));return[e,(s,o,a)=>{const l=C(this,ds);if(l==null)throw du();const c=n.map(u=>u.onRun(l));return ga(...c)(s,o,a)}]}))}}get ctx(){return C(this,ds)}},ds=new WeakMap,Wt=new WeakMap,P2),$0=Se(new e3,"keymap"),xd=Se([bt],"keymapTimer"),tl=Ur("KeymapReady"),k9=r=>{const e=new e3;return e.setCtx(r),r.inject($0,e).inject(xd,[bt]).record(tl),async()=>(await r.waitTimers(xd),r.done(tl),()=>{r.remove($0).remove(xd).clearTimer(tl)})},rl=Ur("ParserReady"),t3=(()=>{throw du()}),Ts=Se(t3,"parser"),Sd=Se([],"parserTimer"),r3=r=>(r.inject(Ts,t3).inject(Sd,[bt]).record(rl),async()=>{await r.waitTimers(Sd);const e=r.get(Si),t=r.get(Zt);return r.set(Ts,J5.create(t,e)),r.done(rl),()=>{r.remove(Ts).remove(Sd).clearTimer(rl)}});Vn(r3,{displayName:"Parser"});var nl=Ur("SerializerReady"),Cd=Se([],"serializerTimer"),n3=(()=>{throw du()}),bo=Se(n3,"serializer"),i3=r=>(r.inject(bo,n3).inject(Cd,[bt]).record(nl),async()=>{await r.waitTimers(Cd);const e=r.get(Si),t=r.get(Zt);return r.set(bo,g9.create(t,e)),r.done(nl),()=>{r.remove(bo).remove(Cd).clearTimer(nl)}});Vn(i3,{displayName:"Serializer"});var v0=Se("","defaultValue"),Md=Se(r=>r,"stateOptions"),b0=Se([],"editorStateTimer"),w0=Ur("EditorStateReady");function x9(r,e,t){if(typeof r=="string")return e(r);if(r.type==="html")return Is.fromSchema(t).parse(r.dom);if(r.type==="json")return $n.fromJSON(t,r.value);throw lx(r)}var S9=new De("MILKDOWN_STATE_TRACKER"),s3=r=>(r.inject(v0,"").inject(_a,{}).inject(Md,e=>e).inject(b0,[rl,nl,el,tl]).record(w0),async()=>{await r.waitTimers(b0);const e=r.get(Zt),t=r.get(Ts),n=r.get(yl),i=r.get(Md),s=r.get(ur),o=x9(r.get(v0),t,e),a=r.get($0),l=a.addBaseKeymap(),c=[...s,new Ae({key:S9,state:{init:()=>{},apply:(h,f,m,y)=>{r.set(_a,y)}}}),Gx({rules:n}),W5(a.build())];r.set(ur,c);const u=i({schema:e,doc:o,plugins:c}),d=mo.create(u);return r.set(_a,d),r.done(w0),()=>{l(),r.remove(v0).remove(_a).remove(Md).remove(b0).clearTimer(w0)}});Vn(s3,{displayName:"EditorState"});var kl=Se([],"pasteRule"),Td=Se([bt],"pasteRuleTimer"),k0=Ur("PasteRuleReady"),o3=r=>(r.inject(kl,[]).inject(Td,[bt]).record(k0),async()=>(await r.waitTimers(Td),r.done(k0),()=>{r.remove(kl).remove(Td).clearTimer(k0)}));Vn(o3,{displayName:"PasteRule"});var x0=Ur("EditorViewReady"),Ad=Se([],"editorViewTimer"),il=Se({},"editorViewOptions"),S0=Se(null,"root"),jh=Se(null,"rootDOM"),Vh=Se({},"rootAttrs");function C9(r,e){const t=document.createElement("div");t.className="milkdown",r.appendChild(t),e.set(jh,t);const n=e.get(Vh);return Object.entries(n).forEach(([i,s])=>t.setAttribute(i,s)),t}function M9(r){r.classList.add("editor"),r.setAttribute("role","textbox")}var T9=new De("MILKDOWN_VIEW_CLEAR"),a3=r=>(r.inject(S0,document.body).inject(Me,{}).inject(il,{}).inject(jh,null).inject(Vh,{}).inject(Ad,[w0,k0]).record(x0),async()=>{await r.wait(Ms);const e=r.get(S0)||document.body,t=typeof e=="string"?document.querySelector(e):e;r.update(ur,l=>[new Ae({key:T9,view:c=>{const u=t?C9(t,r):void 0;return(()=>{if(u&&t){const h=c.dom;t.replaceChild(u,h),u.appendChild(h)}})(),{destroy:()=>{u!=null&&u.parentNode&&(u==null||u.parentNode.replaceChild(c.dom,u)),u==null||u.remove()}}}}),...l]),await r.waitTimers(Ad);const n=r.get(_a),i=r.get(il),s=Object.fromEntries(r.get(bl)),o=Object.fromEntries(r.get(wl)),a=new y5(t,{state:n,nodeViews:s,markViews:o,transformPasted:(l,c,u)=>(r.get(kl).sort((d,h)=>(h.priority??50)-(d.priority??50)).map(d=>d.run).forEach(d=>{l=d(l,c,u)}),l),...i});return M9(a.dom),r.set(Me,a),r.done(x0),()=>{a==null||a.destroy(),r.remove(S0).remove(Me).remove(il).remove(jh).remove(Vh).remove(Ad).clearTimer(x0)}});Vn(a3,{displayName:"EditorView"});var A9=(function(r){return r.Idle="Idle",r.OnCreate="OnCreate",r.Created="Created",r.OnDestroy="OnDestroy",r.Destroyed="Destroyed",r})({}),hs,ar,En,$o,Kl,Gl,Ut,Dn,fs,Jl,ps,qo,Yl,fi,Ho,_o,N9=(_o=class{constructor(){_(this,hs);_(this,ar);_(this,En);_(this,$o);_(this,Kl);_(this,Gl);_(this,Ut);_(this,Dn);_(this,fs);_(this,Jl);_(this,ps);_(this,qo);_(this,Yl);_(this,fi);_(this,Ho);F(this,hs,!1),F(this,ar,"Idle"),F(this,En,[]),F(this,$o,()=>{}),F(this,Kl,new M5),F(this,Gl,new wx),F(this,Ut,new Map),F(this,Dn,new Map),F(this,fs,new bx(C(this,Kl),C(this,Gl))),F(this,Jl,()=>{const e=y9(async n=>{await Promise.all(C(this,En).map(i=>Promise.resolve(i(n))))}),t=[X5,r3,i3,Q5,k9,o3,s3,a3,v9(this),e];C(this,ps).call(this,t,C(this,Dn))}),F(this,ps,(e,t)=>{e.forEach(n=>{const i=C(this,fs).produce(C(this,hs)?n.meta:void 0),s=n(i);t.set(n,{ctx:i,handler:s,cleanup:void 0})})}),F(this,qo,(e,t=!1)=>Promise.all([e].flat().map(async n=>{var s;const i=(s=C(this,Ut).get(n))==null?void 0:s.cleanup;return t?C(this,Ut).delete(n):C(this,Ut).set(n,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof i=="function"?i():i}))),F(this,Yl,async()=>{await Promise.all([...C(this,Dn).entries()].map(async([e,{cleanup:t}])=>typeof t=="function"?t():t)),C(this,Dn).clear()}),F(this,fi,e=>{F(this,ar,e),C(this,$o).call(this,e)}),F(this,Ho,e=>[...e.entries()].map(async([t,n])=>{const{ctx:i,handler:s}=n;if(!s)return;const o=await s();e.set(t,{ctx:i,handler:s,cleanup:o})})),this.enableInspector=(e=!0)=>(F(this,hs,e),this),this.onStatusChange=e=>(F(this,$o,e),this),this.config=e=>(C(this,En).push(e),this),this.removeConfig=e=>(F(this,En,C(this,En).filter(t=>t!==e)),this),this.use=e=>{const t=[e].flat();return t.flat().forEach(n=>{C(this,Ut).set(n,{ctx:void 0,handler:void 0,cleanup:void 0})}),C(this,ar)==="Created"&&C(this,ps).call(this,t,C(this,Ut)),this},this.remove=async e=>C(this,ar)==="OnCreate"?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await C(this,qo).call(this,[e].flat(),!0),this),this.create=async()=>C(this,ar)==="OnCreate"?this:(C(this,ar)==="Created"&&await this.destroy(),C(this,fi).call(this,"OnCreate"),C(this,Jl).call(this),C(this,ps).call(this,[...C(this,Ut).keys()],C(this,Ut)),await Promise.all([C(this,Ho).call(this,C(this,Dn)),C(this,Ho).call(this,C(this,Ut))].flat()),C(this,fi).call(this,"Created"),this),this.destroy=async(e=!1)=>C(this,ar)==="Destroyed"||C(this,ar)==="OnDestroy"?this:C(this,ar)==="OnCreate"?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&F(this,En,[]),C(this,fi).call(this,"OnDestroy"),await C(this,qo).call(this,[...C(this,Ut).keys()],e),await C(this,Yl).call(this),C(this,fi).call(this,"Destroyed"),this),this.action=e=>e(C(this,fs)),this.inspect=()=>C(this,hs)?[...C(this,Dn).values(),...C(this,Ut).values()].map(({ctx:e})=>{var t;return(t=e==null?void 0:e.inspector)==null?void 0:t.read()}).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new _o}get ctx(){return C(this,fs)}get status(){return C(this,ar)}},hs=new WeakMap,ar=new WeakMap,En=new WeakMap,$o=new WeakMap,Kl=new WeakMap,Gl=new WeakMap,Ut=new WeakMap,Dn=new WeakMap,fs=new WeakMap,Jl=new WeakMap,ps=new WeakMap,qo=new WeakMap,Yl=new WeakMap,fi=new WeakMap,Ho=new WeakMap,_o);function l3(r,e,t){const n=r.findIndex(([s])=>s===e);if(n===-1)return[...r,t];const i=r.slice();return i[n]=t,i}function fe(r,e){const t=b9(r),n=i=>async()=>{n.key=t,await i.wait(el);const s=e(i);return i.get(oe).create(t,s),n.run=o=>i.get(oe).call(r,o),()=>{i.get(oe).remove(t)}};return n}function wt(r){const e=t=>async()=>{await t.wait(bt);const n=r(t);return t.update(yl,i=>[...i,n]),e.inputRule=n,()=>{t.update(yl,i=>i.filter(s=>s!==n))}};return e}function E9(r){const e=t=>async()=>{await t.wait(bt);const n=r(t);return t.update(kl,i=>[...i,n]),e.pasteRule=n,()=>{t.update(kl,i=>i.filter(s=>s!==n))}};return e}function D9(r,e){const t=n=>async()=>{const i=e(n);return n.update(Qa,s=>l3(s,r,[r,i])),t.id=r,t.schema=i,()=>{n.update(Qa,s=>s.filter(([o])=>o!==r))}};return t.type=n=>{const i=n.get(Zt).marks[r];if(!i)throw mx(r);return i},t}function rp(r,e){const t=n=>async()=>{const i=e(n);return n.update(Ci,s=>l3(s,r,[r,i])),t.id=r,t.schema=i,()=>{n.update(Ci,s=>s.filter(([o])=>o!==r))}};return t.type=n=>{const i=n.get(Zt).nodes[r];if(!i)throw C5(r);return i},t}function qe(r){let e;const t=n=>async()=>(await n.wait(bt),e=r(n),n.update(ur,i=>[...i,e]),()=>{n.update(ur,i=>i.filter(s=>s!==e))});return t.plugin=()=>e,t.key=()=>e.spec.key,t}function c3(r){const e=t=>async()=>{await t.wait(tl);const n=t.get($0),i=r(t),s=n.addObjectKeymap(i);return e.keymap=i,()=>{s()}};return e}function Ai(r,e){const t=n=>async()=>{await n.wait(bt);const i=e(n);return r.type(n)instanceof I0?n.update(bl,s=>[...s,[r.id,i]]):n.update(wl,s=>[...s,[r.id,i]]),t.view=i,t.type=r,()=>{r.type(n)instanceof I0?n.update(bl,s=>s.filter(o=>o[0]!==r.id)):n.update(wl,s=>s.filter(o=>o[0]!==r.id))}};return t}function Ne(r,e){const t=Se(r,e),n=i=>(i.inject(t),()=>()=>{i.remove(t)});return n.key=t,n}function Ve(r,e){const t=Ne(e,r),n=rp(r,s=>s.get(t.key)(s)),i=[t,n];return i.id=n.id,i.node=n,i.type=s=>n.type(s),i.ctx=t,i.key=t.key,i.extendSchema=s=>Ve(r,s(e)),i}function ya(r,e){const t=Ne(e,r),n=D9(r,s=>s.get(t.key)(s)),i=[t,n];return i.id=n.id,i.mark=n,i.type=s=>n.type(s),i.ctx=t,i.key=t.key,i.extendSchema=s=>ya(r,s(e)),i}function Qt(r,e){const t=Ne(Object.fromEntries(Object.entries(e).map(([s,{shortcuts:o,priority:a}])=>[s,{shortcuts:o,priority:a}])),`${r}Keymap`),n=c3(s=>{const o=s.get(t.key),a=Object.entries(e).flatMap(([l,{command:c}])=>{const u=o[l],d=[u.shortcuts].flat(),h=u.priority;return d.map(f=>[f,{key:f,onRun:c,priority:h}])});return Object.fromEntries(a)}),i=[t,n];return i.ctx=t,i.shortcuts=n,i.key=t.key,i.keymap=n.keymap,i}var Kr=(r,e=()=>({}))=>Ne(e,`${r}Attr`),Ac=(r,e=()=>({}))=>Ne(e,`${r}Attr`);function er(r,e,t){const n=Ne(t??{},r),i=o=>async()=>{await o.wait(Ms);const a={plugin:e(o),options:o.get(n.key)};return o.update(vl,l=>[...l,a]),()=>{o.update(vl,l=>l.filter(c=>c!==a))}},s=[n,i];return s.id=r,s.plugin=i,s.options=n,s}let Wh,Uh;if(typeof WeakMap<"u"){let r=new WeakMap;Wh=e=>r.get(e),Uh=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;Wh=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},Uh=(n,i)=>(t==10&&(t=0),r[t++]=n,r[t++]=i)}var Be=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=r)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==t;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==t;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${r} found`)}colCount(r){for(let e=0;e<this.map.length;e++)if(this.map[e]==r)return e%this.width;throw new RangeError(`No cell with offset ${r} found`)}nextCell(r,e,t){const{left:n,right:i,top:s,bottom:o}=this.findCell(r);return e=="horiz"?(t<0?n==0:i==this.width)?null:this.map[s*this.width+(t<0?n-1:i)]:(t<0?s==0:o==this.height)?null:this.map[n+this.width*(t<0?s-1:o)]}rectBetween(r,e){const{left:t,right:n,top:i,bottom:s}=this.findCell(r),{left:o,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,c)}}cellsInRect(r){const e=[],t={};for(let n=r.top;n<r.bottom;n++)for(let i=r.left;i<r.right;i++){const s=n*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==r.left&&i&&this.map[s-1]==o||n==r.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(r,e,t){for(let n=0,i=0;;n++){const s=i+t.child(n).nodeSize;if(n==r){let o=e+r*this.width;const a=(r+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(r){return Wh(r)||Uh(r,O9(r))}};function O9(r){if(r.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+r.type.name);const e=R9(r),t=r.childCount,n=[];let i=0,s=null;const o=[];for(let c=0,u=e*t;c<u;c++)n[c]=0;for(let c=0,u=0;c<t;c++){const d=r.child(c);u++;for(let m=0;;m++){for(;i<n.length&&n[i]!=0;)i++;if(m==d.childCount)break;const y=d.child(m),{colspan:b,rowspan:v,colwidth:k}=y.attrs;for(let M=0;M<v;M++){if(M+c>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:v-M});break}const D=i+M*e;for(let O=0;O<b;O++){n[D+O]==0?n[D+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:b-O});const z=k&&k[O];if(z){const T=(D+O)%e*2,B=o[T];B==null||B!=z&&o[T+1]==1?(o[T]=z,o[T+1]=1):B==z&&o[T+1]++}}}i+=b,u+=y.nodeSize}const h=(c+1)*e;let f=0;for(;i<h;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new Be(e,t,n,s);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<t&&(l=!0);return l&&I9(a,o,r),a}function R9(r){let e=-1,t=!1;for(let n=0;n<r.childCount;n++){const i=r.child(n);let s=0;if(t)for(let o=0;o<n;o++){const a=r.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>n&&(s+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function I9(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i<r.map.length;i++){const s=r.map[i];if(n[s])continue;n[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const u=e[(i+c)%r.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=z9(l)))[c]=u)}a&&r.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function z9(r){if(r.colwidth)return r.colwidth.slice();const e=[];for(let t=0;t<r.colspan;t++)e.push(0);return e}function Ig(r,e){if(typeof r=="string")return{};const t=r.getAttribute("data-colwidth"),n=t&&/^\d+(,\d+)*$/.test(t)?t.split(",").map(o=>Number(o)):null,i=Number(r.getAttribute("colspan")||1),s={colspan:i,rowspan:Number(r.getAttribute("rowspan")||1),colwidth:n&&n.length==i?n:null};for(const o in e){const a=e[o].getFromDOM,l=a&&a(r);l!=null&&(s[o]=l)}return s}function zg(r,e){const t={};r.attrs.colspan!=1&&(t.colspan=r.attrs.colspan),r.attrs.rowspan!=1&&(t.rowspan=r.attrs.rowspan),r.attrs.colwidth&&(t["data-colwidth"]=r.attrs.colwidth.join(","));for(const n in e){const i=e[n].setDOMAttr;i&&i(r.attrs[n],t)}return t}function L9(r){if(r!==null){if(!Array.isArray(r))throw new TypeError("colwidth must be null or an array");for(const e of r)if(typeof e!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function B9(r){const e=r.cellAttributes||{},t={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:L9}};for(const n in e)t[n]={default:e[n].default,validate:e[n].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:r.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:r.cellContent,attrs:t,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:n=>Ig(n,e)}],toDOM(n){return["td",zg(n,e),0]}},table_header:{content:r.cellContent,attrs:t,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:n=>Ig(n,e)}],toDOM(n){return["th",zg(n,e),0]}}}}function Dr(r){let e=r.cached.tableNodeTypes;if(!e){e=r.cached.tableNodeTypes={};for(const t in r.nodes){const n=r.nodes[t],i=n.spec.tableRole;i&&(e[i]=n)}}return e}const ci=new De("selectingCells");function ua(r){for(let e=r.depth-1;e>0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function Ir(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function mu(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=ua(e.$head)||P9(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function P9(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function Kh(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function F9(r){return r.node(0).resolve(r.pos+r.nodeAfter.nodeSize)}function np(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function u3(r,e,t){const n=r.node(-1),i=Be.get(n),s=r.start(-1),o=i.nextCell(r.pos-s,e,t);return o==null?null:r.node(0).resolve(s+o)}function Bs(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function $9(r,e,t=1){const n={...r,colspan:r.colspan+t};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;i<t;i++)n.colwidth.splice(e,0,0)}return n}function q9(r,e,t){const n=Dr(e.type.schema).header_cell;for(let i=0;i<r.height;i++)if(e.nodeAt(r.map[t+i*r.width]).type!=n)return!1;return!0}var He=class kn extends pe{constructor(e,t=e){const n=e.node(-1),i=Be.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(u=>u!=t.pos-s);l.unshift(t.pos-s);const c=l.map(u=>{const d=n.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new Ry(a.resolve(h),a.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(Kh(n)&&Kh(i)&&np(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?kn.rowSelection(n,i):s&&this.isColSelection()?kn.colSelection(n,i):new kn(n,i)}return se.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=Be.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*t.width+i.left,d=i.left;d<i.right;d++,u++){const h=t.map[u];if(s[h])continue;s[h]=!0;const f=t.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const y=i.left-f.left,b=f.right-i.right;if(y>0||b>0){let v=m.attrs;if(y>0&&(v=Bs(v,0,y)),b>0&&(v=Bs(v,v.colspan-b,b)),f.left<i.left){if(m=m.type.createAndFill(v),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else m=m.type.create(v,m.content)}if(f.top<i.top||f.bottom>i.bottom){const v={...m.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?m=m.type.createAndFill(v):m=m.type.create(v,m.content)}c.push(m)}o.push(e.child(l).copy(V.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new re(V.from(a),1,1)}replace(e,t=re.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),o?re.empty:t)}const s=pe.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new re(V.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Be.get(t),i=this.$anchorCell.start(-1),s=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=Be.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(t=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(t=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new kn(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Be.get(e),n=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-n),s=t.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==t.width}eq(e){return e instanceof kn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=Be.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(t=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(t=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new kn(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new kn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new kn(e.resolve(t),e.resolve(n))}getBookmark(){return new H9(this.$anchorCell.pos,this.$headCell.pos)}};He.prototype.visible=!1;pe.jsonID("cell",He);var H9=class d3{constructor(e,t){this.anchor=e,this.head=t}map(e){return new d3(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&np(t,n)?new He(t,n):pe.near(n,1)}};function _9(r){if(!(r.selection instanceof He))return null;const e=[];return r.selection.forEachCell((t,n)=>{e.push(Ze.node(n,n+t.nodeSize,{class:"selectedCell"}))}),$e.create(r.doc,e)}function j9({$from:r,$to:e}){if(r.pos==e.pos||r.pos<e.pos-6)return!1;let t=r.pos,n=e.pos,i=r.depth;for(;i>=0&&!(r.after(i+1)<r.end(i));i--,t++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,n--);return t==n&&/row|table/.test(r.node(i).type.spec.tableRole)}function V9({$from:r,$to:e}){let t,n;for(let i=r.depth;i>0;i--){const s=r.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){t=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}return t!==n&&e.parentOffset===0}function W9(r,e,t){const n=(e||r).selection,i=(e||r).doc;let s,o;if(n instanceof ae&&(o=n.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=He.create(i,n.from);else if(o=="row"){const a=i.resolve(n.from+1);s=He.rowSelection(a,a)}else if(!t){const a=Be.get(n.node),l=n.from+1,c=l+a.map[a.width*a.height-1];s=He.create(i,l+1,c)}}else n instanceof se&&j9(n)?s=se.create(i,n.from):n instanceof se&&V9(n)&&(s=se.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=r.tr)).setSelection(s),e}const U9=new De("fix-tables");function h3(r,e,t,n){const i=r.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){const l=e.child(o);for(let c=a,u=Math.min(i,o+3);c<u;c++)if(r.child(c)==l){a=c+1,t+=l.nodeSize;continue e}n(l,t),a<i&&r.child(a).sameMarkup(l)?h3(r.child(a),l,t+1,n):l.nodesBetween(0,l.content.size,n,t+1),t+=l.nodeSize}}function K9(r,e){let t;const n=(i,s)=>{i.type.spec.tableRole=="table"&&(t=G9(r,i,s,t))};return e?e.doc!=r.doc&&h3(e.doc,r.doc,0,n):r.doc.descendants(n),t}function G9(r,e,t,n){const i=Be.get(e);if(!i.problems)return n;n||(n=r.tr);const s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,Bs(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;n.setNodeMarkup(n.mapping.map(t+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=n.mapping.map(t);n.delete(u,u+e.nodeSize)}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,c=t+1;l<i.height;l++){const u=e.child(l),d=c+u.nodeSize,h=s[l];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const m=[];for(let b=0;b<h;b++){const v=Dr(r.schema)[f].createAndFill();v&&m.push(v)}const y=(l==0||o==l-1)&&a==l?c+1:d-1;n.insert(n.mapping.map(y),m)}c=d}return n.setMeta(U9,{fixTables:!0})}function f3(r){const e=Be.get(r),t=[],n=e.height,i=e.width;for(let s=0;s<n;s++){const o=[];for(let a=0;a<i;a++){const l=s*i+a,c=e.map[l];if(s>0){const u=l-i;if(c===e.map[u]){o.push(null);continue}}if(a>0){const u=l-1;if(c===e.map[u]){o.push(null);continue}}o.push(r.nodeAt(c))}t.push(o)}return t}function p3(r,e){const t=[],n=Be.get(r),i=n.height,s=n.width;for(let o=0;o<i;o++){const a=r.child(o),l=[];for(let u=0;u<s;u++){const d=e[o][u];if(!d)continue;const h=n.map[o*n.width+u],f=r.nodeAt(h);if(!f)continue;const m=f.type.createChecked(d.attrs,d.content,d.marks);l.push(m)}const c=a.type.createChecked(a.attrs,l,a.marks);t.push(c)}return r.type.createChecked(r.attrs,t,r.marks)}function m3(r,e,t,n){const i=e[0]>t[0]?-1:1,s=r.splice(e[0],e.length),o=s.length%2===0?1:0;let a;return a=i===-1?t[0]:t[t.length-1]-o,r.splice(a,0,...s),r}function va(r){return J9(e=>e.type.spec.tableRole==="table",r)}function J9(r,e){for(let t=e.depth;t>=0;t-=1){const n=e.node(t);if(r(n))return{node:n,pos:t===0?0:e.before(t),start:e.start(t),depth:t}}return null}function ao(r,e){const t=va(e.$from);if(!t)return;const n=Be.get(t.node);if(!(r<0||r>n.width-1))return n.cellsInRect({left:r,right:r+1,top:0,bottom:n.height}).map(i=>{const s=t.node.nodeAt(i),o=i+t.start;return{pos:o,start:o+1,node:s,depth:t.depth+2}})}function lo(r,e){const t=va(e.$from);if(!t)return;const n=Be.get(t.node);if(!(r<0||r>n.height-1))return n.cellsInRect({left:0,right:n.width,top:r,bottom:r+1}).map(i=>{const s=t.node.nodeAt(i),o=i+t.start;return{pos:o,start:o+1,node:s,depth:t.depth+2}})}function Lg(r,e,t=e){let n=e,i=t;for(let u=e;u>=0;u--){const d=ao(u,r.selection);d&&d.forEach(h=>{const f=h.node.attrs.colspan+u-1;f>=n&&(n=u),f>i&&(i=f)})}for(let u=e;u<=i;u++){const d=ao(u,r.selection);d&&d.forEach(h=>{const f=h.node.attrs.colspan+u-1;h.node.attrs.colspan>1&&f>i&&(i=f)})}const s=[];for(let u=n;u<=i;u++){const d=ao(u,r.selection);d&&d.length>0&&s.push(u)}n=s[0],i=s[s.length-1];const o=ao(n,r.selection),a=lo(0,r.selection);if(!o||!a)return;const l=r.doc.resolve(o[o.length-1].pos);let c;for(let u=i;u>=n;u--){const d=ao(u,r.selection);if(d&&d.length>0){for(let h=a.length-1;h>=0;h--)if(a[h].pos===d[0].pos){c=d[0];break}if(c)break}}if(c)return{$anchor:l,$head:r.doc.resolve(c.pos),indexes:s}}function Bg(r,e,t=e){let n=e,i=t;for(let u=e;u>=0;u--){const d=lo(u,r.selection);d&&d.forEach(h=>{const f=h.node.attrs.rowspan+u-1;f>=n&&(n=u),f>i&&(i=f)})}for(let u=e;u<=i;u++){const d=lo(u,r.selection);d&&d.forEach(h=>{const f=h.node.attrs.rowspan+u-1;h.node.attrs.rowspan>1&&f>i&&(i=f)})}const s=[];for(let u=n;u<=i;u++){const d=lo(u,r.selection);d&&d.length>0&&s.push(u)}n=s[0],i=s[s.length-1];const o=lo(n,r.selection),a=ao(0,r.selection);if(!o||!a)return;const l=r.doc.resolve(o[o.length-1].pos);let c;for(let u=i;u>=n;u--){const d=lo(u,r.selection);if(d&&d.length>0){for(let h=a.length-1;h>=0;h--)if(a[h].pos===d[0].pos){c=d[0];break}if(c)break}}if(c)return{$anchor:l,$head:r.doc.resolve(c.pos),indexes:s}}function Pg(r){return r[0].map((e,t)=>r.map(n=>n[t]))}function Y9(r){var e,t;const{tr:n,originIndex:i,targetIndex:s,select:o,pos:a}=r,l=va(n.doc.resolve(a));if(!l)return!1;const c=(e=Lg(n,i))===null||e===void 0?void 0:e.indexes,u=(t=Lg(n,s))===null||t===void 0?void 0:t.indexes;if(!c||!u||c.includes(s))return!1;const d=X9(l.node,c,u);if(n.replaceWith(l.pos,l.pos+l.node.nodeSize,d),!o)return!0;const h=Be.get(d),f=l.start,m=s,y=h.positionAt(h.height-1,m,d),b=n.doc.resolve(f+y),v=h.positionAt(0,m,d),k=n.doc.resolve(f+v);return n.setSelection(He.colSelection(b,k)),!0}function X9(r,e,t,n){let i=Pg(f3(r));return i=m3(i,e,t),i=Pg(i),p3(r,i)}function Z9(r){var e,t;const{tr:n,originIndex:i,targetIndex:s,select:o,pos:a}=r,l=va(n.doc.resolve(a));if(!l)return!1;const c=(e=Bg(n,i))===null||e===void 0?void 0:e.indexes,u=(t=Bg(n,s))===null||t===void 0?void 0:t.indexes;if(!c||!u||c.includes(s))return!1;const d=Q9(l.node,c,u);if(n.replaceWith(l.pos,l.pos+l.node.nodeSize,d),!o)return!0;const h=Be.get(d),f=l.start,m=s,y=h.positionAt(m,h.width-1,d),b=n.doc.resolve(f+y),v=h.positionAt(m,0,d),k=n.doc.resolve(f+v);return n.setSelection(He.rowSelection(b,k)),!0}function Q9(r,e,t,n){let i=f3(r);return i=m3(i,e,t),p3(r,i)}function Li(r){const e=r.selection,t=mu(r),n=t.node(-1),i=t.start(-1),s=Be.get(n);return{...e instanceof He?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:n}}function g3(r,{map:e,tableStart:t,table:n},i){let s=i>0?-1:0;q9(e,n,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=n.nodeAt(l);r.setNodeMarkup(r.mapping.map(t+l),null,$9(c.attrs,i-e.colCount(l))),o+=c.attrs.rowspan-1}else{const l=s==null?Dr(n.type.schema).cell:n.nodeAt(e.map[a+s]).type,c=e.positionAt(o,i,n);r.insert(r.mapping.map(t+c),l.createAndFill())}}return r}function eS(r,e){if(!Ir(r))return!1;if(e){const t=Li(r);e(g3(r.tr,t,t.left))}return!0}function tS(r,e){if(!Ir(r))return!1;if(e){const t=Li(r);e(g3(r.tr,t,t.right))}return!0}function rS(r,{map:e,table:t,tableStart:n},i){const s=r.mapping.maps.length;for(let o=0;o<e.height;){const a=o*e.width+i,l=e.map[a],c=t.nodeAt(l),u=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)r.setNodeMarkup(r.mapping.slice(s).map(n+l),null,Bs(u,i-e.colCount(l)));else{const d=r.mapping.slice(s).map(n+l);r.delete(d,d+c.nodeSize)}o+=u.rowspan}}function nS(r,e){if(!Ir(r))return!1;if(e){const t=Li(r),n=r.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let i=t.right-1;rS(n,t,i),i!=t.left;i--){const s=t.tableStart?n.doc.nodeAt(t.tableStart-1):n.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Be.get(s)}e(n)}return!0}function iS(r,{map:e,table:t,tableStart:n},i){let s=0;for(let c=0;c<i;c++)s+=t.child(c).nodeSize;const o=s+t.child(i).nodeSize,a=r.mapping.maps.length;r.delete(s+n,o+n);const l=new Set;for(let c=0,u=i*e.width;c<e.width;c++,u++){const d=e.map[u];if(!l.has(d)){if(l.add(d),i>0&&d==e.map[u-e.width]){const h=t.nodeAt(d).attrs;r.setNodeMarkup(r.mapping.slice(a).map(d+n),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<e.height&&d==e.map[u+e.width]){const h=t.nodeAt(d),f=h.attrs,m=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),y=e.positionAt(i+1,c,t);r.insert(r.mapping.slice(a).map(n+y),m),c+=f.colspan-1}}}}function sS(r,e){if(!Ir(r))return!1;if(e){const t=Li(r),n=r.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let i=t.bottom-1;iS(n,t,i),i!=t.top;i--){const s=t.tableStart?n.doc.nodeAt(t.tableStart-1):n.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Be.get(t.table)}e(n)}return!0}function oS(r,e){return function(t,n){if(!Ir(t))return!1;const i=mu(t);if(i.nodeAfter.attrs[r]===e)return!1;if(n){const s=t.tr;t.selection instanceof He?t.selection.forEachCell((o,a)=>{o.attrs[r]!==e&&s.setNodeMarkup(a,null,{...o.attrs,[r]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[r]:e}),n(s)}return!0}}function aS(r){return function(e,t){if(!Ir(e))return!1;if(t){const n=Dr(e.schema),i=Li(e),s=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);t(s)}return!0}}function Fg(r,e,t){const n=e.map.cellsInRect({left:0,top:0,right:r=="row"?e.map.width:1,bottom:r=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function ip(r,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?aS(r):function(t,n){if(!Ir(t))return!1;if(n){const i=Dr(t.schema),s=Li(t),o=t.tr,a=Fg("row",s,i),l=Fg("column",s,i),c=(r==="column"?a:r==="row"&&l)?1:0,u=r=="column"?{left:0,top:c,right:1,bottom:s.map.height}:r=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=r=="column"?l?i.cell:i.header_cell:r=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,m=o.doc.nodeAt(f);m&&o.setNodeMarkup(f,d,m.attrs)}),n(o)}return!0}}ip("row",{useDeprecatedLogic:!0});ip("column",{useDeprecatedLogic:!0});ip("cell",{useDeprecatedLogic:!0});function lS(r,e){if(e<0){const t=r.nodeBefore;if(t)return r.pos-t.nodeSize;for(let n=r.index(-1)-1,i=r.before();n>=0;n--){const s=r.node(-1).child(n),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(r.index()<r.parent.childCount-1)return r.pos+r.nodeAfter.nodeSize;const t=r.node(-1);for(let n=r.indexAfter(-1),i=r.after();n<t.childCount;n++){const s=t.child(n);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function y3(r){return function(e,t){if(!Ir(e))return!1;const n=lS(mu(e),r);if(n==null)return!1;if(t){const i=e.doc.resolve(n);t(e.tr.setSelection(se.between(i,F9(i))).scrollIntoView())}return!0}}function cS(r,e){const t=r.selection.$anchor;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="table")return e&&e(r.tr.delete(t.before(n),t.after(n)).scrollIntoView()),!0;return!1}function Gc(r,e){const t=r.selection;if(!(t instanceof He))return!1;if(e){const n=r.tr,i=Dr(r.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new re(i,0,0))}),n.docChanged&&e(n)}return!0}function uS(r){return(e,t)=>{const{from:n,to:i,select:s=!0,pos:o=e.selection.from}=r,a=e.tr;return Z9({tr:a,originIndex:n,targetIndex:i,select:s,pos:o})?(t==null||t(a),!0):!1}}function dS(r){return(e,t)=>{const{from:n,to:i,select:s=!0,pos:o=e.selection.from}=r,a=e.tr;return Y9({tr:a,originIndex:n,targetIndex:i,select:s,pos:o})?(t==null||t(a),!0):!1}}function hS(r){if(r.size===0)return null;let{content:e,openStart:t,openEnd:n}=r;for(;e.childCount==1&&(t>0&&n>0||e.child(0).type.spec.tableRole=="table");)t--,n--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,t-1),d=l<e.childCount-1?0:Math.max(0,n-1);(u||d)&&(c=Gh(Dr(o).row,new re(c,u,d)).content),a.push(c)}else if(s=="cell"||s=="header_cell")a.push(t||n?Gh(Dr(o).row,new re(e,t,n)).content:e);else return null;return fS(o,a)}function fS(r,e){const t=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:a,colspan:l}=s.child(o).attrs;for(let c=i;c<i+a;c++)t[c]=(t[c]||0)+l}}let n=0;for(let i=0;i<t.length;i++)n=Math.max(n,t[i]);for(let i=0;i<t.length;i++)if(i>=e.length&&e.push(V.empty),t[i]<n){const s=Dr(r).cell.createAndFill(),o=[];for(let a=t[i];a<n;a++)o.push(s);e[i]=e[i].append(V.from(o))}return{height:e.length,width:n,rows:e}}function Gh(r,e){const t=r.createAndFill();return new Oy(t).replace(0,t.content.size,e).doc}function pS({width:r,height:e,rows:t},n,i){if(r!=n){const s=[],o=[];for(let a=0;a<t.length;a++){const l=t[a],c=[];for(let u=s[a]||0,d=0;u<n;d++){let h=l.child(d%l.childCount);u+h.attrs.colspan>n&&(h=h.type.createChecked(Bs(h.attrs,h.attrs.colspan,u+h.attrs.colspan-n),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[a+f]=(s[a+f]||0)+h.attrs.colspan}o.push(V.from(c))}t=o,r=n}if(e!=i){const s=[];for(let o=0,a=0;o<i;o++,a++){const l=[],c=t[a%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);o+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}s.push(V.from(l))}t=s,e=i}return{width:r,height:e,rows:t}}function mS(r,e,t,n,i,s,o){const a=r.doc.type.schema,l=Dr(a);let c,u;if(i>e.width)for(let d=0,h=0;d<e.height;d++){const f=t.child(d);h+=f.nodeSize;const m=[];let y;f.lastChild==null||f.lastChild.type==l.cell?y=c||(c=l.cell.createAndFill()):y=u||(u=l.header_cell.createAndFill());for(let b=e.width;b<i;b++)m.push(y);r.insert(r.mapping.slice(o).map(h-1+n),m)}if(s>e.height){const d=[];for(let m=0,y=(e.height-1)*e.width;m<Math.max(e.width,i);m++){const b=m>=e.width?!1:t.nodeAt(e.map[y+m]).type==l.header_cell;d.push(b?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const h=l.row.create(null,V.from(d)),f=[];for(let m=e.height;m<s;m++)f.push(h);r.insert(r.mapping.slice(o).map(n+t.nodeSize-2),f)}return!!(c||u)}function $g(r,e,t,n,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let c=i;c<s;c++){const u=o*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){l=!0;const h=t.nodeAt(d),{top:f,left:m}=e.findCell(d);r.setNodeMarkup(r.mapping.slice(a).map(d+n),null,{...h.attrs,rowspan:o-f}),r.insert(r.mapping.slice(a).map(e.positionAt(o,m,t)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-o})),c+=h.attrs.colspan-1}}return l}function qg(r,e,t,n,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let c=i;c<s;c++){const u=c*e.width+o,d=e.map[u];if(e.map[u-1]==d){l=!0;const h=t.nodeAt(d),f=e.colCount(d),m=r.mapping.slice(a).map(d+n);r.setNodeMarkup(m,null,Bs(h.attrs,o-f,h.attrs.colspan-(o-f))),r.insert(m+h.nodeSize,h.type.createAndFill(Bs(h.attrs,0,o-f))),c+=h.attrs.rowspan-1}}return l}function Hg(r,e,t,n,i){let s=t?r.doc.nodeAt(t-1):r.doc;if(!s)throw new Error("No table found");let o=Be.get(s);const{top:a,left:l}=n,c=l+i.width,u=a+i.height,d=r.tr;let h=0;function f(){if(s=t?d.doc.nodeAt(t-1):d.doc,!s)throw new Error("No table found");o=Be.get(s),h=d.mapping.maps.length}mS(d,o,s,t,c,u,h)&&f(),$g(d,o,s,t,l,c,a,h)&&f(),$g(d,o,s,t,l,c,u,h)&&f(),qg(d,o,s,t,a,u,l,h)&&f(),qg(d,o,s,t,a,u,c,h)&&f();for(let m=a;m<u;m++){const y=o.positionAt(m,l,s),b=o.positionAt(m,c,s);d.replace(d.mapping.slice(h).map(y+t),d.mapping.slice(h).map(b+t),new re(i.rows[m-a],0,0))}f(),d.setSelection(new He(d.doc.resolve(t+o.positionAt(a,l,s)),d.doc.resolve(t+o.positionAt(u-1,c-1,s)))),e(d)}const gS=tp({ArrowLeft:Jc("horiz",-1),ArrowRight:Jc("horiz",1),ArrowUp:Jc("vert",-1),ArrowDown:Jc("vert",1),"Shift-ArrowLeft":Yc("horiz",-1),"Shift-ArrowRight":Yc("horiz",1),"Shift-ArrowUp":Yc("vert",-1),"Shift-ArrowDown":Yc("vert",1),Backspace:Gc,"Mod-Backspace":Gc,Delete:Gc,"Mod-Delete":Gc});function C0(r,e,t){return t.eq(r.selection)?!1:(e&&e(r.tr.setSelection(t).scrollIntoView()),!0)}function Jc(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof He)return C0(t,n,pe.near(s.$headCell,e));if(r!="horiz"&&!s.empty)return!1;const o=v3(i,r,e);if(o==null)return!1;if(r=="horiz")return C0(t,n,pe.near(t.doc.resolve(s.head+e),e));{const a=t.doc.resolve(o),l=u3(a,r,e);let c;return l?c=pe.near(l,1):e<0?c=pe.near(t.doc.resolve(a.before(-1)),-1):c=pe.near(t.doc.resolve(a.after(-1)),1),C0(t,n,c)}}}function Yc(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof He)o=s;else{const l=v3(i,r,e);if(l==null)return!1;o=new He(t.doc.resolve(l))}const a=u3(o.$headCell,r,e);return a?C0(t,n,new He(o.$anchorCell,a)):!1}}function yS(r,e){const t=r.state.doc,n=ua(t.resolve(e));return n?(r.dispatch(r.state.tr.setSelection(new He(n))),!0):!1}function vS(r,e,t){if(!Ir(r.state))return!1;let n=hS(t);const i=r.state.selection;if(i instanceof He){n||(n={width:1,height:1,rows:[V.from(Gh(Dr(r.state.schema).cell,t))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=Be.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return n=pS(n,a.right-a.left,a.bottom-a.top),Hg(r.state,r.dispatch,o,a,n),!0}else if(n){const s=mu(r.state),o=s.start(-1);return Hg(r.state,r.dispatch,o,Be.get(s.node(-1)).findCell(s.pos-o),n),!0}else return!1}function bS(r,e){var t;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=_g(r,e.target);let i;if(e.shiftKey&&r.state.selection instanceof He)s(r.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=ua(r.state.selection.$anchor))!=null&&((t=Nd(r,e))===null||t===void 0?void 0:t.pos)!=i.pos)s(i,e),e.preventDefault();else if(!n)return;function s(l,c){let u=Nd(r,c);const d=ci.getState(r.state)==null;if(!u||!np(l,u))if(d)u=l;else return;const h=new He(l,u);if(d||!r.state.selection.eq(h)){const f=r.state.tr.setSelection(h);d&&f.setMeta(ci,l.pos),r.dispatch(f)}}function o(){r.root.removeEventListener("mouseup",o),r.root.removeEventListener("dragstart",o),r.root.removeEventListener("mousemove",a),ci.getState(r.state)!=null&&r.dispatch(r.state.tr.setMeta(ci,-1))}function a(l){const c=l,u=ci.getState(r.state);let d;if(u!=null)d=r.state.doc.resolve(u);else if(_g(r,c.target)!=n&&(d=Nd(r,e),!d))return o();d&&s(d,c)}r.root.addEventListener("mouseup",o),r.root.addEventListener("dragstart",o),r.root.addEventListener("mousemove",a)}function v3(r,e,t){if(!(r.state.selection instanceof se))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=n.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(a)?o:null}}return null}function _g(r,e){for(;e&&e!=r.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Nd(r,e){const t=r.posAtCoords({left:e.clientX,top:e.clientY});if(!t)return null;let{inside:n,pos:i}=t;return n>=0&&ua(r.state.doc.resolve(n))||ua(r.state.doc.resolve(i))}var wS=class{constructor(r,e){this.node=r,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Jh(r,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(r){return r.type!=this.node.type?!1:(this.node=r,Jh(r,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(r){return r.type=="attributes"&&(r.target==this.table||this.colgroup.contains(r.target))}};function Jh(r,e,t,n,i,s){let o=0,a=!0,l=e.firstChild;const c=r.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:m}=c.child(d).attrs;for(let y=0;y<f;y++,h++){const b=i==h?s:m&&m[y],v=b?b+"px":"";if(o+=b||n,b||(a=!1),l)l.style.width!=v&&(l.style.width=v),l=l.nextSibling;else{const k=document.createElement("col");k.style.width=v,e.appendChild(k)}}}for(;l;){var u;const d=l.nextSibling;(u=l.parentNode)===null||u===void 0||u.removeChild(l),l=d}a?(t.style.width=o+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=o+"px")}}const cr=new De("tableColumnResizing");function kS({handleWidth:r=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:n=wS,lastColumnResizable:i=!0}={}){const s=new Ae({key:cr,state:{init(o,a){var l;const c=(l=s.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,u=Dr(a.schema).table.name;return n&&c&&(c[u]=(d,h)=>new n(d,t,h)),new xS(-1,!1)},apply(o,a){return a.apply(o)}},props:{attributes:o=>{const a=cr.getState(o);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,a)=>{SS(o,a,r,i)},mouseleave:o=>{CS(o)},mousedown:(o,a)=>{MS(o,a,e,t)}},decorations:o=>{const a=cr.getState(o);if(a&&a.activeHandle>-1)return DS(o,a.activeHandle)},nodeViews:{}}});return s}var xS=class M0{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,n=e.getMeta(cr);if(n&&n.setHandle!=null)return new M0(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new M0(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let i=e.mapping.map(t.activeHandle,-1);return Kh(e.doc.resolve(i))||(i=-1),new M0(i,t.dragging)}return t}};function SS(r,e,t,n){if(!r.editable)return;const i=cr.getState(r.state);if(i&&!i.dragging){const s=AS(e.target);let o=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=t?o=jg(r,e,"left",t):l-e.clientX<=t&&(o=jg(r,e,"right",t))}if(o!=i.activeHandle){if(!n&&o!==-1){const a=r.state.doc.resolve(o),l=a.node(-1),c=Be.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}b3(r,o)}}}function CS(r){if(!r.editable)return;const e=cr.getState(r.state);e&&e.activeHandle>-1&&!e.dragging&&b3(r,-1)}function MS(r,e,t,n){var i;if(!r.editable)return!1;const s=(i=r.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,o=cr.getState(r.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const a=r.state.doc.nodeAt(o.activeHandle),l=TS(r,o.activeHandle,a.attrs);r.dispatch(r.state.tr.setMeta(cr,{setDragging:{startX:e.clientX,startWidth:l}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=cr.getState(r.state);h!=null&&h.dragging&&(NS(r,h.activeHandle,Vg(h.dragging,d,t)),r.dispatch(r.state.tr.setMeta(cr,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=cr.getState(r.state);if(h&&h.dragging){const f=Vg(h.dragging,d,t);Wg(r,h.activeHandle,f,n)}}return Wg(r,o.activeHandle,l,n),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),e.preventDefault(),!0}function TS(r,e,{colspan:t,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const s=r.domAtPos(e);let o=s.node.childNodes[s.offset].offsetWidth,a=t;if(n)for(let l=0;l<t;l++)n[l]&&(o-=n[l],a--);return o/a}function AS(r){for(;r&&r.nodeName!="TD"&&r.nodeName!="TH";)r=r.classList&&r.classList.contains("ProseMirror")?null:r.parentNode;return r}function jg(r,e,t,n){const i=t=="right"?-n:n,s=r.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,a=ua(r.state.doc.resolve(o));if(!a)return-1;if(t=="right")return a.pos;const l=Be.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function Vg(r,e,t){const n=e.clientX-r.startX;return Math.max(t,r.startWidth+n)}function b3(r,e){r.dispatch(r.state.tr.setMeta(cr,{setHandle:e}))}function NS(r,e,t){const n=r.state.doc.resolve(e),i=n.node(-1),s=Be.get(i),o=n.start(-1),a=s.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1,l=r.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+a;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:a-s.colCount(d);if(h.colwidth&&h.colwidth[f]==t)continue;const m=h.colwidth?h.colwidth.slice():ES(h.colspan);m[f]=t,l.setNodeMarkup(o+d,null,{...h,colwidth:m})}l.docChanged&&r.dispatch(l)}function Wg(r,e,t,n){const i=r.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=Be.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=r.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Jh(s,l.firstChild,l,n,a,t)}function ES(r){return Array(r).fill(0)}function DS(r,e){const t=[],n=r.doc.resolve(e),i=n.node(-1);if(!i)return $e.empty;const s=Be.get(i),o=n.start(-1),a=s.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=a+c*s.width;if((a==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var l;const d=s.map[u],h=o+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((l=cr.getState(r))===null||l===void 0)&&l.dragging&&t.push(Ze.node(o+d,o+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),t.push(Ze.widget(h,f))}}return $e.create(r.doc,t)}function OS({allowTableNodeSelection:r=!1}={}){return new Ae({key:ci,state:{init(){return null},apply(e,t){const n=e.getMeta(ci);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;const{deleted:i,pos:s}=e.mapping.mapResult(t);return i?null:s}},props:{decorations:_9,handleDOMEvents:{mousedown:bS},createSelectionBetween(e){return ci.getState(e.state)!=null?e.state.selection:null},handleTripleClick:yS,handleKeyDown:gS,handlePaste:vS},appendTransaction(e,t,n){return W9(n,K9(n,t),r)}})}function RS(r,e){return function(t,n){let{$from:i,$to:s,node:o}=t.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(s))return!1;let a=i.node(-1);if(a.type!=r)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=r||i.index(-2)!=i.node(-2).childCount-1)return!1;if(n){let d=V.empty,h=i.index(-1)?1:i.index(-2)?2:3;for(let v=i.depth-h;v>=i.depth-3;v--)d=V.from(i.node(v).copy(d));let f=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;d=d.append(V.from(r.createAndFill()));let m=i.before(i.depth-(h-1)),y=t.tr.replace(m,i.after(-f),new re(d,4-h,0)),b=-1;y.doc.nodesBetween(m,y.doc.content.size,(v,k)=>{if(b>-1)return!1;v.isTextblock&&v.content.size==0&&(b=k+1)}),b>-1&&y.setSelection(pe.near(y.doc.resolve(b))),n(y.scrollIntoView())}return!0}let l=s.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=t.tr.delete(i.pos,s.pos),u=l?[null,{type:l}]:void 0;return Ja(c.doc,i.pos,2,u)?(n&&n(c.split(i.pos,2,u).scrollIntoView()),!0):!1}}function IS(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?zS(e,t,r,s):LS(e,t,s):!0:!1}}function zS(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new At(s-1,o,s,o,new re(V.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new cy(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const a=su(n);if(a==null)return!1;i.lift(n,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return wc(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function LS(r,e,t){let n=r.tr,i=t.parent;for(let f=t.end,m=t.endIndex-1,y=t.startIndex;m>y;m--)f-=i.child(m).nodeSize,n.delete(f-1,f+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?V.empty:V.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return n.step(new At(d-(a?1:0),h+(l?1:0),d+1,h-1,new re((a?V.empty:V.from(i.copy(V.empty))).append(l?V.empty:V.from(i.copy(V.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function BS(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=r)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=V.from(c?r.create():null),d=new re(V.from(r.create(null,V.from(a.type.create(null,u)))),c?3:1,0),h=s.start,f=s.end;t(e.tr.step(new At(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}function PS(r){const e=new Map;if(!r||!r.type)throw new Error("mdast-util-definitions expected node");return $s(r,"definition",function(n){const i=Ug(n.identifier);i&&!e.get(i)&&e.set(i,n)}),t;function t(n){const i=Ug(n);return e.get(i)}}function Ug(r){return String(r||"").toUpperCase()}function FS(){return function(r){const e=PS(r);$s(r,function(t,n,i){if(t.type==="definition"&&i!==void 0&&typeof n=="number")return i.children.splice(n,1),[M1,n];if(t.type==="imageReference"||t.type==="linkReference"){const s=e(t.identifier);if(s&&i&&typeof n=="number")return i.children[n]=t.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:t.alt}:{type:"link",url:s.url,title:s.title,children:t.children},[M1,n]}})}}function w3(r,e){var n;if(!(e.childCount>=1&&((n=e.lastChild)==null?void 0:n.type.name)==="hardbreak")){r.next(e.content);return}const t=[];e.content.forEach((i,s,o)=>{o!==e.childCount-1&&t.push(i)}),r.next(V.fromArray(t))}function j(r,e){return Object.assign(r,{meta:{package:"@milkdown/preset-commonmark",...e}}),r}var sp=Ac("emphasis");j(sp,{displayName:"Attr<emphasis>",group:"Emphasis"});var Hs=ya("emphasis",r=>({attrs:{marker:{default:r.get(Za).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",r.get(sp.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));j(Hs.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});j(Hs.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var gu=fe("ToggleEmphasis",r=>()=>hu(Hs.type(r)));j(gu,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var k3=wt(r=>Tc(/(?:^|[^*])\*([^*]+)\*$/,Hs.type(r),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));j(k3,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var x3=wt(r=>Tc(/\b_(?![_\s])(.*?[^_\s])_$/,Hs.type(r),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));j(x3,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var op=Qt("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:r=>{const e=r.get(oe);return()=>e.call(gu.key)}}});j(op.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});j(op.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var ap=Ac("strong");j(ap,{displayName:"Attr<strong>",group:"Strong"});var ba=ya("strong",r=>({attrs:{marker:{default:r.get(Za).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",r.get(ap.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));j(ba.mark,{displayName:"MarkSchema<strong>",group:"Strong"});j(ba.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var yu=fe("ToggleStrong",r=>()=>hu(ba.type(r)));j(yu,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var S3=wt(r=>Tc(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),ba.type(r),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));j(S3,{displayName:"InputRule<strong>",group:"Strong"});var lp=Qt("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:r=>{const e=r.get(oe);return()=>e.call(yu.key)}}});j(lp.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});j(lp.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var cp=Ac("inlineCode");j(cp,{displayName:"Attr<inlineCode>",group:"InlineCode"});var Bn=ya("inlineCode",r=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:e=>["code",r.get(cp.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,t,n)=>(e.withMark(t,"inlineCode",n.text||""),!0)}}));j(Bn.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});j(Bn.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var vu=fe("ToggleInlineCode",r=>()=>(e,t)=>{const{selection:n,tr:i}=e;if(n.empty)return!1;const{from:s,to:o}=n;return e.doc.rangeHasMark(s,o,Bn.type(r))?(t==null||t(i.removeMark(s,o,Bn.type(r))),!0):(Object.keys(e.schema.marks).filter(a=>a!==Bn.type.name).map(a=>e.schema.marks[a]).forEach(a=>{i.removeMark(s,o,a)}),t==null||t(i.addMark(s,o,Bn.type(r).create())),!0)});j(vu,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var C3=wt(r=>Tc(/(?:`)([^`]+)(?:`)$/,Bn.type(r)));j(C3,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var up=Qt("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:r=>{const e=r.get(oe);return()=>e.call(vu.key)}}});j(up.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});j(up.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var $S=new Set(["http:","https:","mailto:","tel:","ftp:"]);function qS(r){return r<=32||r>=127&&r<=160||r>=8203&&r<=8205||r===8232||r===8233||r===65279}function HS(r){let e="";for(const t of r)qS(t.codePointAt(0)??0)||(e+=t);return e}function _S(r){var i;if(typeof r!="string")return"";const e=r.trim();if(!e)return"";const t=HS(e),n=(i=/^([a-z][a-z0-9+.-]*):/i.exec(t))==null?void 0:i[1];return!n||$S.has(`${n.toLowerCase()}:`)?e:""}var dp=Ac("link");j(dp,{displayName:"Attr<link>",group:"Link"});var jr=ya("link",r=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...r.get(dp.key)(e),...e.attrs,href:_S(e.attrs.href)}],parseMarkdown:{match:e=>e.type==="link",runner:(e,t,n)=>{const i=t.url,s=t.title;e.openMark(n,{href:i,title:s}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));j(jr.mark,{displayName:"MarkSchema<link>",group:"Link"});var M3=fe("ToggleLink",r=>(e={})=>hu(jr.type(r),e));j(M3,{displayName:"Command<toggleLinkCommand>",group:"Link"});var T3=fe("UpdateLink",r=>(e={})=>(t,n)=>{if(!n)return!1;let i,s=-1;const{selection:o}=t,{from:a,to:l}=o;if(t.doc.nodesBetween(a,a===l?l+1:l,(m,y)=>{if(jr.type(r).isInSet(m.marks))return i=m,s=y,!1}),!i)return!1;const c=i.marks.find(({type:m})=>m===jr.type(r));if(!c)return!1;const u=s,d=s+i.nodeSize,{tr:h}=t,f=jr.type(r).create({...c.attrs,...e});return f?(n(h.removeMark(u,d,c).addMark(u,d,f).setSelection(new se(h.selection.$anchor)).scrollIntoView()),!0):!1});j(T3,{displayName:"Command<updateLinkCommand>",group:"Link"});var A3=rp("doc",()=>({content:"block+",parseMarkdown:{match:({type:r})=>r==="root",runner:(r,e,t)=>{r.injectRoot(e,t)}},toMarkdown:{match:r=>r.type.name==="doc",runner:(r,e)=>{r.openNode("root"),r.next(e.content)}}}));j(A3,{displayName:"NodeSchema<doc>",group:"Doc"});function jS(r){return V2(r,e=>{var t;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((t=e.value)==null?void 0:t.trim())},(e,t)=>{if(!t.length)return;const n=t[t.length-1];if(!n)return;const i=n.children.indexOf(e);i!==-1&&n.children.splice(i,1)},!0)}var da=er("remark-preserve-empty-line",()=>()=>jS);j(da.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});j(da.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var hp=Kr("paragraph");j(hp,{displayName:"Attr<paragraph>",group:"Paragraph"});var Or=Ve("paragraph",r=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",r.get(hp.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,t)=>{var i;const n=(i=r.get(Me).state)==null?void 0:i.doc.lastChild;e.openNode("paragraph"),(!t.content||t.content.size===0)&&t!==n&&VS(r)?e.addNode("html",void 0,"<br />"):w3(e,t),e.closeNode()}}}));function VS(r){let e=!1;try{r.get(da.id),e=!0}catch{e=!1}return e}j(Or.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});j(Or.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var fp=fe("TurnIntoText",r=>()=>gl(Or.type(r)));j(fp,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var pp=Qt("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:r=>{const e=r.get(oe);return()=>e.call(fp.key)}}});j(pp.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});j(pp.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var WS=Array(6).fill(0).map((r,e)=>e+1);function US(r){return r.textContent.toLowerCase().trim().replace(/\s+/g,"-")}var Hn=Ne(US,"headingIdGenerator");j(Hn,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var mp=Kr("heading");j(mp,{displayName:"Attr<heading>",group:"Heading"});var Pt=Ve("heading",r=>{const e=r.get(Hn.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:WS.map(t=>({tag:`h${t}`,getAttrs:n=>{if(!(n instanceof HTMLElement))throw dn(n);return{level:t,id:n.id}}})),toDOM:t=>[`h${t.attrs.level}`,{...r.get(mp.key)(t),id:t.attrs.id||e(t)},0],parseMarkdown:{match:({type:t})=>t==="heading",runner:(t,n,i)=>{const s=n.depth;t.openNode(i,{level:s}),t.next(n.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="heading",runner:(t,n)=>{t.openNode("heading",void 0,{depth:n.attrs.level}),w3(t,n),t.closeNode()}}}});j(Pt.node,{displayName:"NodeSchema<heading>",group:"Heading"});j(Pt.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var N3=wt(r=>ep(/^(?<hashes>#+)\s$/,Pt.type(r),e=>{var s,o;const t=((o=(s=e.groups)==null?void 0:s.hashes)==null?void 0:o.length)||0,{$from:n}=r.get(Me).state.selection,i=n.node();if(i.type.name==="heading"){let a=Number(i.attrs.level)+Number(t);return a>6&&(a=6),{level:a}}return{level:t}}));j(N3,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var oi=fe("WrapInHeading",r=>e=>(e??(e=1),e<1?gl(Or.type(r)):gl(Pt.type(r),{level:e})));j(oi,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var gp=fe("DowngradeHeading",r=>()=>(e,t,n)=>{const{$from:i}=e.selection,s=i.node();if(s.type!==Pt.type(r)||!e.selection.empty||i.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(t==null||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):gl(Or.type(r))(e,t,n)});j(gp,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var yp=Qt("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:r=>{const e=r.get(oe);return()=>e.call(oi.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:r=>{const e=r.get(oe);return()=>e.call(gp.key)}}});j(yp.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});j(yp.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var vp=Kr("blockquote");j(vp,{displayName:"Attr<blockquote>",group:"Blockquote"});var wa=Ve("blockquote",r=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",r.get(vp.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));j(wa.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});j(wa.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var E3=wt(r=>Qf(/^\s*>\s$/,wa.type(r)));j(E3,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var bp=fe("WrapInBlockquote",r=>()=>Zf(wa.type(r)));j(bp,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var wp=Qt("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:r=>{const e=r.get(oe);return()=>e.call(bp.key)}}});j(wp.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});j(wp.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var kp=Kr("codeBlock",()=>({pre:{},code:{}}));j(kp,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var Vr=Ve("code_block",r=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{language:e.dataset.language}}}],toDOM:e=>{const t=r.get(kp.key)(e),n=e.attrs.language,i=n&&n.length>0?{"data-language":n}:void 0;return["pre",{...t.pre,...i},["code",t.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,t,n)=>{const i=t.lang??"",s=t.value;e.openNode(n,{language:i}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,t)=>{var n;e.addNode("code",void 0,((n=t.content.firstChild)==null?void 0:n.text)||"",{lang:t.attrs.language})}}}));j(Vr.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});j(Vr.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var D3=wt(r=>ep(/^```(?<language>[a-z]*)?[\s\n]$/,Vr.type(r),e=>{var t;return{language:((t=e.groups)==null?void 0:t.language)??""}}));j(D3,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var xp=fe("CreateCodeBlock",r=>(e="")=>gl(Vr.type(r),{language:e}));j(xp,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var KS=fe("UpdateCodeBlockLanguage",()=>({pos:r,language:e}={pos:-1,language:""})=>(t,n)=>r>=0?(n==null||n(t.tr.setNodeAttribute(r,"language",e)),!0):!1);j(KS,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Sp=Qt("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:r=>{const e=r.get(oe);return()=>e.call(xp.key)}}});j(Sp.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});j(Sp.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var Cp=Kr("image");j(Cp,{displayName:"Attr<image>",group:"Image"});var _s=Ve("image",r=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...r.get(Cp.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,t,n)=>{const i=t.url,s=t.alt,o=t.title;e.addNode(n,{src:i,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));j(_s.node,{displayName:"NodeSchema<image>",group:"Image"});j(_s.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var O3=fe("InsertImage",r=>(e={})=>(t,n)=>{if(!n)return!0;const{src:i="",alt:s="",title:o=""}=e,a=_s.type(r).create({src:i,alt:s,title:o});return a&&n(t.tr.replaceSelectionWith(a).scrollIntoView()),!0});j(O3,{displayName:"Command<insertImageCommand>",group:"Image"});var R3=fe("UpdateImage",r=>(e={})=>(t,n)=>{const i=c9(t.selection,_s.type(r));if(!i)return!1;const{node:s,pos:o}=i,a={...s.attrs},{src:l,alt:c,title:u}=e;return l!==void 0&&(a.src=l),c!==void 0&&(a.alt=c),u!==void 0&&(a.title=u),n==null||n(t.tr.setNodeMarkup(o,void 0,a).scrollIntoView()),!0});j(R3,{displayName:"Command<updateImageCommand>",group:"Image"});var GS=wt(r=>new _t(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,t,n,i)=>{const[s,o,a="",l]=t;return s?e.tr.replaceWith(n,i,_s.type(r).create({src:a,alt:o,title:l})):null}));j(GS,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var q0=Kr("hardbreak",r=>({"data-type":"hardbreak","data-is-inline":r.attrs.isInline}));j(q0,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var As=Ve("hardbreak",r=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",r.get(q0.key)(e)," "]:["br",r.get(q0.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,t,n)=>{var i;e.addNode(n,{isInline:!!((i=t.data)!=null&&i.isInline)})}},leafText:()=>`
|
|
33
|
+
`,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,`
|
|
34
|
+
`):e.addNode("break")}}}));j(As.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});j(As.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var Mp=fe("InsertHardbreak",r=>()=>(e,t)=>{var s;const{selection:n,tr:i}=e;if(!(n instanceof se))return!1;if(n.empty){const o=n.$from.node();if(o.childCount>0&&((s=o.lastChild)==null?void 0:s.type.name)==="hardbreak")return t==null||t(i.replaceRangeWith(n.to-1,n.to,e.schema.node("paragraph")).setSelection(pe.near(i.doc.resolve(n.to))).scrollIntoView()),!0}return t==null||t(i.setMeta("hardbreak",!0).replaceSelectionWith(As.type(r).create()).scrollIntoView()),!0});j(Mp,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var Tp=Qt("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:r=>{const e=r.get(oe);return()=>e.call(Mp.key)}}});j(Tp.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});j(Tp.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var Ap=Kr("hr");j(Ap,{displayName:"Attr<hr>",group:"Hr"});var ka=Ve("hr",r=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",r.get(Ap.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));j(ka.node,{displayName:"NodeSchema<hr>",group:"Hr"});j(ka.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var I3=wt(r=>new _t(/^(?:---|___\s|\*\*\*\s)$/,(e,t,n,i)=>{const{tr:s}=e;return t[0]&&s.replaceWith(n-1,i,ka.type(r).create()),s}));j(I3,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var z3=fe("InsertHr",r=>()=>(e,t)=>{if(!t)return!0;const n=Or.node.type(r).create(),{tr:i,selection:s}=e,{from:o}=s,a=ka.type(r).create();if(!a)return!0;const l=i.replaceSelectionWith(a).insert(o,n),c=pe.findFrom(l.doc.resolve(o),1,!0);return c&&t(l.setSelection(c).scrollIntoView()),!0});j(z3,{displayName:"Command<insertHrCommand>",group:"Hr"});var Np=Kr("bulletList");j(Np,{displayName:"Attr<bulletList>",group:"BulletList"});var js=Ve("bullet_list",r=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...r.get(Np.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!t,runner:(e,t,n)=>{const i=t.spread??!1;e.openNode(n,{spread:i}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));j(js.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});j(js.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var L3=wt(r=>Qf(/^\s*([-+*])\s$/,js.type(r)));j(L3,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var Ep=fe("WrapInBulletList",r=>()=>Zf(js.type(r)));j(Ep,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var Dp=Qt("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:r=>{const e=r.get(oe);return()=>e.call(Ep.key)}}});j(Dp.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});j(Dp.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var Op=Kr("orderedList");j(Op,{displayName:"Attr<orderedList>",group:"OrderedList"});var Bi=Ve("ordered_list",r=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{spread:e.dataset.spread==="true",order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...r.get(Op.key)(e),...e.attrs.order===1?{}:{start:e.attrs.order},"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!!t,runner:(e,t,n)=>{const i=t.spread??!0;e.openNode(n,{spread:i,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:t.attrs.order??1,spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));j(Bi.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});j(Bi.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var B3=wt(r=>Qf(/^\s*(\d+)\.\s$/,Bi.type(r),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));j(B3,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var Rp=fe("WrapInOrderedList",r=>()=>Zf(Bi.type(r)));j(Rp,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var Ip=Qt("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:r=>{const e=r.get(oe);return()=>e.call(Rp.key)}}});j(Ip.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});j(Ip.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var zp=Kr("listItem");j(zp,{displayName:"Attr<listItem>",group:"ListItem"});var zr=Ve("list_item",r=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw dn(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...r.get(zp.key)(e),"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e})=>e==="listItem",runner:(e,t,n)=>{const i=t.label!=null?`${t.label}.`:"•",s=t.label!=null?"ordered":"bullet",o=t.spread??!0;e.openNode(n,{label:i,listType:s,spread:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="list_item",runner:(e,t)=>{e.openNode("listItem",void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));j(zr.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});j(zr.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var Lp=fe("SinkListItem",r=>()=>BS(zr.type(r)));j(Lp,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var Bp=fe("LiftListItem",r=>()=>IS(zr.type(r)));j(Bp,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var Pp=fe("SplitListItem",r=>()=>RS(zr.type(r)));j(Pp,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function JS(r){return(e,t,n)=>{const{selection:i}=e;if(!(i instanceof se))return!1;const{empty:s,$from:o}=i;return!s||o.parentOffset!==0||o.node(-1).type!==zr.type(r)?!1:A5(e,t,n)}}var Fp=fe("LiftFirstListItem",r=>()=>JS(r));j(Fp,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var $p=Qt("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:r=>{const e=r.get(oe);return()=>e.call(Pp.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:r=>{const e=r.get(oe);return()=>e.call(Lp.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:r=>{const e=r.get(oe);return()=>e.call(Bp.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:r=>{const e=r.get(oe);return()=>e.call(Fp.key)}}});j($p.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});j($p.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var P3=rp("text",()=>({group:"inline",parseMarkdown:{match:({type:r})=>r==="text",runner:(r,e)=>{r.addText(e.value)}},toMarkdown:{match:r=>r.type.name==="text",runner:(r,e)=>{r.addNode("text",void 0,e.text)}}}));j(P3,{displayName:"NodeSchema<text>",group:"Text"});var qp=Kr("html");j(qp,{displayName:"Attr<html>",group:"Html"});var Hp=Ve("html",r=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{const t=document.createElement("span"),n={...r.get(qp.key)(e),"data-value":e.attrs.value,"data-type":"html"};return t.textContent=e.attrs.value,["span",n,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}}));j(Hp.node,{displayName:"NodeSchema<html>",group:"Html"});j(Hp.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var YS=[A3,hp,Or,Hn,mp,Pt,q0,As,vp,wa,kp,Vr,Ap,ka,Cp,_s,Np,js,Op,Bi,zp,zr,sp,Hs,ap,ba,cp,Bn,dp,jr,qp,Hp,P3].flat(),XS=[E3,L3,B3,D3,I3,N3].flat(),ZS=[k3,x3,C3,S3],co=fe("IsMarkSelected",()=>r=>e=>{if(!r)return!1;const{doc:t,selection:n}=e;return t.rangeHasMark(n.from,n.to,r)}),QS=fe("IsNoteSelected",()=>r=>e=>r?V5(e,r).hasNode:!1),Vt=fe("ClearTextInCurrentBlock",()=>()=>(r,e)=>{let t=r.tr;const{$from:n,$to:i}=t.selection,{pos:s}=n,{pos:o}=i,a=s-n.node().content.size;return a<0?!1:(t=t.deleteRange(a,o),e==null||e(t),!0)}),T0=fe("SetBlockType",()=>r=>(e,t)=>{const{nodeType:n,attrs:i=null}=r??{};if(!n)return!1;const s=e.tr,{from:o,to:a}=s.selection;try{s.setBlockType(o,a,n,i)}catch{return!1}return t==null||t(s),!0}),uo=fe("WrapInBlockType",()=>r=>(e,t)=>{const{nodeType:n,attrs:i=null}=r??{};if(!n)return!1;let s=e.tr;try{const{$from:o,$to:a}=s.selection,l=o.blockRange(a),c=l&&Ff(l,n,i);if(!c)return!1;s=s.wrap(l,c)}catch{return!1}return t==null||t(s),!0}),Xi=fe("AddBlockType",()=>r=>(e,t)=>{const{nodeType:n,attrs:i=null}=r??{};if(!n)return!1;const s=e.tr;try{const o=n instanceof $n?n:n.createAndFill(i);if(!o)return!1;s.replaceSelectionWith(o)}catch{return!1}return t==null||t(s),!0}),F3=fe("SelectTextNearPos",()=>r=>(e,t)=>{const{pos:n}=r??{};if(n==null)return!1;const i=(o,a,l)=>Math.min(Math.max(o,a),l),s=e.tr;try{const o=e.doc.resolve(i(n,0,e.doc.content.size));s.setSelection(se.near(o))}catch{return!1}return t==null||t(s.scrollIntoView()),!0}),eC=[fp,bp,oi,gp,xp,Mp,z3,O3,R3,Rp,Ep,Lp,Pp,Bp,Fp,gu,vu,yu,M3,T3,co,QS,Vt,T0,uo,Xi,F3],tC=[wp,Sp,Tp,yp,$p,Ip,Dp,pp,op,up,lp].flat(),_p=er("remarkAddOrderInList",()=>()=>r=>{$s(r,"list",e=>{if(e.ordered){const t=e.start??1;e.children.forEach((n,i)=>{n.label=i+t})}})});j(_p.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});j(_p.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var jp=er("remarkLineBreak",()=>()=>r=>{const e=/[\t ]*(?:\r?\n|\r)/g;$s(r,"text",(t,n,i)=>{if(!t.value||typeof t.value!="string")return;const s=[];let o=0;e.lastIndex=0;let a=e.exec(t.value);for(;a;){const l=a.index;o!==l&&s.push({type:"text",value:t.value.slice(o,l)}),s.push({type:"break",data:{isInline:!0}}),o=l+a[0].length,a=e.exec(t.value)}if(s.length>0&&i&&typeof n=="number")return o<t.value.length&&s.push({type:"text",value:t.value.slice(o)}),i.children.splice(n,1,...s),n+s.length})});j(jp.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});j(jp.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var Vp=er("remarkInlineLink",()=>FS);j(Vp.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});j(Vp.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var rC=r=>!!r.children,nC=r=>r.type==="html";function iC(r,e){return t(r,0,null)[0];function t(n,i,s){if(rC(n)){const o=[];for(let a=0,l=n.children.length;a<l;a++){const c=n.children[a];if(c){const u=t(c,a,n);if(u)for(let d=0,h=u.length;d<h;d++){const f=u[d];f&&o.push(f)}}}n.children=o}return e(n,i,s)}}var sC=["root","blockquote","listItem"],Wp=er("remarkHTMLTransformer",()=>()=>r=>{iC(r,(e,t,n)=>nC(e)?(n&&sC.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])});j(Wp.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});j(Wp.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var Up=er("remarkMarker",()=>()=>(r,e)=>{const t=n=>e.value.charAt(n.position.start.offset);$s(r,n=>["strong","emphasis"].includes(n.type),n=>{n.marker=t(n)})});j(Up.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});j(Up.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var $3=qe(()=>{let r=!1;const e=new De("MILKDOWN_INLINE_NODES_CURSOR"),t=new Ae({key:e,state:{init(){return!1},apply(n){if(!n.selection.empty)return!1;const i=n.selection.$from,s=i.nodeBefore,o=i.nodeAfter;return!!(s&&o&&s.isInline&&!s.isText&&o.isInline&&!o.isText)}},props:{handleDOMEvents:{compositionend:(n,i)=>r?(r=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){const s=n.state.selection.from;i.preventDefault(),n.dispatch(n.state.tr.insertText(i.data||"",s))}}),!0):!1,compositionstart:n=>(t.getState(n.state)&&(r=!0),!1),beforeinput:(n,i)=>{if(t.getState(n.state)&&i instanceof InputEvent&&i.data&&!r){const s=n.state.selection.from;return i.preventDefault(),n.dispatch(n.state.tr.insertText(i.data||"",s)),!0}return!1}},decorations(n){if(t.getState(n)){const i=n.selection.$from.pos,s=document.createElement("span"),o=Ze.widget(i,s,{side:-1}),a=document.createElement("span"),l=Ze.widget(i,a);return setTimeout(()=>{s.contentEditable="true",a.contentEditable="true"}),$e.create(n.doc,[o,l])}return $e.empty}}});return t});j($3,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var q3=qe(r=>new Ae({key:new De("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,n)=>{if(!e.length)return;const[i]=e;if(!i)return;const[s]=i.steps;if(i.getMeta("hardbreak")){if(!(s instanceof rt))return;const{from:o}=s;return n.tr.setNodeMarkup(o,As.type(r),void 0,[])}if(s instanceof In){let o=n.tr;const{from:a,to:l}=s;return n.doc.nodesBetween(a,l,(c,u)=>{c.type===As.type(r)&&(o=o.setNodeMarkup(u,As.type(r),void 0,[]))}),o}}}));j(q3,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var Kp=Ne(["table","code_block"],"hardbreakFilterNodes");j(Kp,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var H3=qe(r=>{const e=r.get(Kp.key);return new Ae({key:new De("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(t,n)=>{const i=t.getMeta("hardbreak"),[s]=t.steps;if(i&&s){const{from:o}=s,a=n.doc.resolve(o);let l=a.depth,c=!0;for(;l>0;)e.includes(a.node(l).type.name)&&(c=!1),l--;return c}return!0}})});j(H3,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var Gp=qe(r=>{const e=new De("MILKDOWN_HEADING_ID"),t=n=>{if(n.composing)return;const i=r.get(Hn.key),s=n.state.tr.setMeta("addToHistory",!1);let o=!1;const a={};n.state.doc.descendants((l,c)=>{if(l.type===Pt.type(r)){if(l.textContent.trim().length===0)return;const u=l.attrs;let d=i(l);a[d]?(a[d]+=1,d+=`-#${a[d]}`):a[d]=1,u.id!==d&&(o=!0,s.setMeta(e,!0).setNodeMarkup(c,void 0,{...u,id:d}))}}),o&&n.dispatch(s)};return new Ae({key:e,view:n=>(t(n),{update:(i,s)=>{i.state.doc.eq(s.doc)||t(i)}})})});j(Gp,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var _3=qe(r=>{const e=(t,n,i)=>{if(!i.selection||t.some(d=>d.getMeta("addToHistory")===!1||!d.isGeneric))return null;const s=Bi.type(r),o=js.type(r),a=zr.type(r),l=(d,h,f=1)=>{let m=!1;const y=`${h+f}.`;return d.label!==y&&(d.label=y,m=!0),m};let c=i.tr,u=!1;return i.doc.descendants((d,h,f,m)=>{if(d.type===o){const y=d.maybeChild(0);(y==null?void 0:y.type)===a&&y.attrs.listType==="ordered"&&(u=!0,c.setNodeMarkup(h,s,{spread:!0}),d.descendants((b,v,k,M)=>{if(b.type===a){const D={...b.attrs};l(D,M)&&(c=c.setNodeMarkup(v,void 0,D))}return!1}))}else if(d.type===a&&(f==null?void 0:f.type)===s){const y={...d.attrs};let b=!1;y.listType!=="ordered"&&(y.listType="ordered",b=!0),f!=null&&f.maybeChild(0)&&(b=l(y,m,(f==null?void 0:f.attrs.order)??1)),b&&(c=c.setNodeMarkup(h,void 0,y),u=!0)}}),u?c.setMeta("addToHistory",!1):null};return new Ae({key:new De("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});j(_3,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var oC=[q3,Kp,H3,$3,_p,Vp,jp,Wp,Up,da,Gp,_3].flat(),aC=[YS,XS,ZS,eC,tC,oC].flat(),H0=typeof navigator<"u"?navigator:null,Jp=H0&&H0.userAgent||"",lC=/Edge\/(\d+)/.exec(Jp),cC=/MSIE \d/.exec(Jp),uC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jp),dC=!!(cC||uC||lC),hC=!dC&&!!H0&&/Apple Computer/.test(H0.vendor),j3=new De("safari-ime-span"),Yh=!1,fC={key:j3,props:{decorations:pC,handleDOMEvents:{compositionstart:()=>{Yh=!0},compositionend:()=>{Yh=!1}}}};function pC(r){const{$from:e,$to:t,to:n}=r.selection;if(Yh&&e.sameParent(t)){const i=Ze.widget(n,mC,{ignoreSelection:!0,key:"safari-ime-span"});return $e.create(r.doc,[i])}}function mC(r){const e=r.dom.ownerDocument.createElement("span");return e.className="ProseMirror-safari-ime-span",e}var gC=new Ae(hC?fC:{key:j3});function de(r,e){return Object.assign(r,{meta:{package:"@milkdown/preset-gfm",...e}}),r}var Yp=Ac("strike_through");de(Yp,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var xa=ya("strike_through",r=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>e==="line-through"}],toDOM:e=>["del",r.get(Yp.key)(e)],parseMarkdown:{match:e=>e.type==="delete",runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="strike_through",runner:(e,t)=>{e.withMark(t,"delete")}}}));de(xa.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});de(xa.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var bu=fe("ToggleStrikeThrough",r=>()=>hu(xa.type(r)));de(bu,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var V3=wt(r=>Tc(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)$"),xa.type(r)));de(V3,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var Xp=Qt("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:r=>{const e=r.get(oe);return()=>e.call(bu.key)}}});de(Xp.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});de(Xp.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var Nc=B9({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:r=>r.style.textAlign||"left",setDOMAttr:(r,e)=>{e.style=`text-align: ${r||"left"}`}}}}),cn=Ve("table",()=>({...Nc.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:r=>r.type==="table",runner:(r,e,t)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n,isHeader:o===0}));r.openNode(t),r.next(i),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="table",runner:(r,e)=>{var i;const t=(i=e.content.firstChild)==null?void 0:i.content;if(!t)return;const n=[];t.forEach(s=>{n.push(s.attrs.alignment)}),r.openNode("table",void 0,{align:n}),r.next(e.content),r.closeNode()}}}));de(cn.node,{displayName:"NodeSchema<table>",group:"Table"});de(cn.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var Ec=Ve("table_header_row",()=>({...Nc.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:r=>r instanceof HTMLElement&&r.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:r=>!!(r.type==="tableRow"&&r.isHeader),runner:(r,e,t)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n[o],isHeader:e.isHeader}));r.openNode(t),r.next(i),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="table_header_row",runner:(r,e)=>{e.content.size!==0&&(r.openNode("tableRow",void 0,{isHeader:!0}),r.next(e.content),r.closeNode())}}}));de(Ec.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});de(Ec.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var Sa=Ve("table_row",()=>({...Nc.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:r=>r.type==="tableRow",runner:(r,e,t)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n[o]}));r.openNode(t),r.next(i),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="table_row",runner:(r,e)=>{e.content.size!==0&&(r.openNode("tableRow"),r.next(e.content),r.closeNode())}}}));de(Sa.node,{displayName:"NodeSchema<tableRow>",group:"Table"});de(Sa.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var Ca=Ve("table_cell",()=>({...Nc.table_cell,disableDropCursor:!0,parseMarkdown:{match:r=>r.type==="tableCell"&&!r.isHeader,runner:(r,e,t)=>{const n=e.align;r.openNode(t,{alignment:n}).openNode(r.schema.nodes.paragraph).next(e.children).closeNode().closeNode()}},toMarkdown:{match:r=>r.type.name==="table_cell",runner:(r,e)=>{r.openNode("tableCell").next(e.content).closeNode()}}}));de(Ca.node,{displayName:"NodeSchema<tableCell>",group:"Table"});de(Ca.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Ps=Ve("table_header",()=>({...Nc.table_header,disableDropCursor:!0,parseMarkdown:{match:r=>r.type==="tableCell"&&!!r.isHeader,runner:(r,e,t)=>{const n=e.align;r.openNode(t,{alignment:n}),r.openNode(r.schema.nodes.paragraph),r.next(e.children),r.closeNode(),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="table_header",runner:(r,e)=>{r.openNode("tableCell"),r.next(e.content),r.closeNode()}}}));de(Ps.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});de(Ps.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function Zp(r,e=3,t=3){const n=Array(t).fill(0).map(()=>Ca.type(r).createAndFill()),i=Array(t).fill(0).map(()=>Ps.type(r).createAndFill()),s=Array(e).fill(0).map((o,a)=>a===0?Ec.type(r).create(null,i):Sa.type(r).create(null,n));return cn.type(r).create(null,s)}function W3(r){return(e,t)=>n=>{t=t??n.selection.from;const i=n.doc.resolve(t),s=j5(l=>l.type.name==="table")(i),o=s?{node:s.node,from:s.start}:void 0,a=r==="row";if(o){const l=Be.get(o.node);if(e>=0&&e<(a?l.height:l.width)){const c=l.positionAt(a?e:l.height-1,a?l.width-1:e,o.node),u=n.doc.resolve(o.from+c),d=a?He.rowSelection:He.colSelection,h=l.positionAt(a?e:0,a?0:e,o.node),f=n.doc.resolve(o.from+h);return _5(n.setSelection(d(u,f)))}}return n}}var yC=W3("row"),vC=W3("col");function U3(r,e,{map:t,tableStart:n,table:i},s){const o=Array(s).fill(0).reduce((l,c,u)=>l+i.child(u).nodeSize,n),a=Array(t.width).fill(0).map((l,c)=>{const u=i.nodeAt(t.map[c]);return Ca.type(r).createAndFill({alignment:u==null?void 0:u.attrs.alignment})});return e.insert(o,Sa.type(r).create(null,a)),e}function bC(r){const e=va(r.$from);if(!e)return;const t=Be.get(e.node);return t.cellsInRect({left:0,right:t.width,top:0,bottom:t.height}).map(n=>{const i=e.node.nodeAt(n),s=n+e.start;return{pos:s,start:s+1,node:i}})}function wC(r){const e=bC(r.selection);if(e&&e[0]){const t=r.doc.resolve(e[0].pos),n=e[e.length-1];if(n){const i=r.doc.resolve(n.pos);return _5(r.setSelection(new He(i,t)))}}return r}var Qp=fe("GoToPrevTableCell",()=>()=>y3(-1));de(Qp,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var em=fe("GoToNextTableCell",()=>()=>y3(1));de(em,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var tm=fe("ExitTable",r=>()=>(e,t)=>{if(!Ir(e))return!1;const{$head:n}=e.selection,i=o9(n,cn.type(r));if(!i)return!1;const{to:s}=i,o=e.tr.replaceWith(s,s,Or.type(r).createAndFill());return o.setSelection(pe.near(o.doc.resolve(s),1)).scrollIntoView(),t==null||t(o),!0});de(tm,{displayName:"Command<breakTableCommand>",group:"Table"});var K3=fe("InsertTable",r=>({row:e,col:t}={})=>(n,i)=>{const{selection:s,tr:o}=n,{from:a}=s,l=Zp(r,e,t),c=o.replaceSelectionWith(l),u=pe.findFrom(c.doc.resolve(a),1,!0);return u&&c.setSelection(u),i==null||i(c),!0});de(K3,{displayName:"Command<insertTableCommand>",group:"Table"});var wu=fe("MoveRow",()=>({from:r,to:e,pos:t}={})=>uS({from:r??0,to:e??0,pos:t}));de(wu,{displayName:"Command<moveRowCommand>",group:"Table"});var ku=fe("MoveCol",()=>({from:r,to:e,pos:t}={})=>dS({from:r??0,to:e??0,pos:t}));de(ku,{displayName:"Command<moveColCommand>",group:"Table"});var Pn=fe("SelectRow",()=>(r={index:0})=>(e,t)=>{const{tr:n}=e;return!!(t==null?void 0:t(yC(r.index,r.pos)(n)))});de(Pn,{displayName:"Command<selectRowCommand>",group:"Table"});var Fn=fe("SelectCol",()=>(r={index:0})=>(e,t)=>{const{tr:n}=e;return!!(t==null?void 0:t(vC(r.index,r.pos)(n)))});de(Fn,{displayName:"Command<selectColCommand>",group:"Table"});var G3=fe("SelectTable",()=>()=>(r,e)=>{const{tr:t}=r;return!!(e==null?void 0:e(wC(t)))});de(G3,{displayName:"Command<selectTableCommand>",group:"Table"});var xl=fe("DeleteSelectedCells",()=>()=>(r,e)=>{const{selection:t}=r;if(!(t instanceof He))return!1;const n=t.isRowSelection(),i=t.isColSelection();return n&&i?cS(r,e):i?nS(r,e):sS(r,e)});de(xl,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var rm=fe("AddColBefore",()=>()=>eS);de(rm,{displayName:"Command<addColBeforeCommand>",group:"Table"});var xu=fe("AddColAfter",()=>()=>tS);de(xu,{displayName:"Command<addColAfterCommand>",group:"Table"});var nm=fe("AddRowBefore",r=>()=>(e,t)=>{if(!Ir(e))return!1;if(t){const n=Li(e);t(U3(r,e.tr,n,n.top))}return!0});de(nm,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var Su=fe("AddRowAfter",r=>()=>(e,t)=>{if(!Ir(e))return!1;if(t){const n=Li(e);t(U3(r,e.tr,n,n.bottom))}return!0});de(Su,{displayName:"Command<addRowAfterCommand>",group:"Table"});var im=fe("SetAlign",()=>(r="left")=>oS("alignment",r));de(im,{displayName:"Command<setAlignCommand>",group:"Table"});var J3=wt(r=>new _t(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(e,t,n,i)=>{var l,c;const s=e.doc.resolve(n);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),cn.type(r)))return null;const o=Zp(r,Math.max(Number(((l=t.groups)==null?void 0:l.row)??0),2),Number((c=t.groups)==null?void 0:c.col)),a=e.tr.replaceRangeWith(n,i,o);return a.setSelection(se.create(a.doc,n+3)).scrollIntoView()}));de(J3,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var Y3=E9(r=>({run:(e,t,n)=>{if(n)return e;function i(c){var b;const u=c.childCount,d=((b=c.lastChild)==null?void 0:b.childCount)??0;if(u===0||d===0)return Or.type(r).create();const h=c.firstChild;if(!(d>0&&h&&h.childCount===0))return c;if(u>=3){const v=c.child(1),k=[];for(let O=0;O<v.childCount;O++){const z=v.child(O);k.push(Ps.type(r).create(z.attrs,z.content,z.marks))}const M=h.type.create(h.attrs,k),D=[];for(let O=2;O<u;O++)D.push(c.child(O));return c.type.create(c.attrs,[M,...D])}const f=Array(d).fill(0).map(()=>Ps.type(r).createAndFill()),m=new re(V.from(f),0,0),y=h.replace(0,0,m);return c.replace(0,h.nodeSize,new re(V.from(y),0,0))}function s(c){const u=Sa.type(r),d=[];let h=[],f=!1;function m(){if(h.length===0)return;const y=Ec.type(r).createAndFill(),b=cn.type(r).create(null,[y,...h]);d.push(i(b)),h=[]}return c.forEach(y=>{y.type===u?(f=!0,h.push(y)):(m(),d.push(y))}),m(),f?V.from(d):c}function o(c){let u=s(c),d=u!==c;const h=[];return u.forEach(f=>{if(f.type===cn.type(r)){const m=i(f);m!==f&&(d=!0),h.push(m)}else if(f.childCount>0){const m=o(f.content);m!==f.content?(d=!0,h.push(f.copy(m))):h.push(f)}else h.push(f)}),d?V.from(h):c}function a(c){const u=[],d=[];c.forEach(h=>d.push(h));for(let h=0;h<d.length;h++){const f=d[h],m=d[h+1];f.type===Or.type(r)&&f.content.size===0&&m&&m.type===cn.type(r)||u.push(f)}return u.length<d.length?V.from(u):c}let l=o(e.content);return l=a(l),new re(V.from(l),e.openStart,e.openEnd)}}));de(Y3,{displayName:"PasteRule<table>",group:"Table"});var sm=Qt("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:r=>{const e=r.get(oe);return()=>e.call(em.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:r=>{const e=r.get(oe);return()=>e.call(Qp.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:r=>{const e=r.get(oe);return()=>e.call(tm.key)}}});de(sm.ctx,{displayName:"KeymapCtx<table>",group:"Table"});de(sm.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Ed="footnote_definition",Kg="footnoteDefinition",om=Ve("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Ed}"]`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw dn(r);return{label:r.dataset.label}},contentElement:"dd"}],toDOM:r=>{const e=r.attrs.label;return["dl",{"data-label":e,"data-type":Ed},["dt",e],["dd",0]]},parseMarkdown:{match:({type:r})=>r===Kg,runner:(r,e,t)=>{r.openNode(t,{label:e.label}).next(e.children).closeNode()}},toMarkdown:{match:r=>r.type.name===Ed,runner:(r,e)=>{r.openNode(Kg,void 0,{label:e.attrs.label,identifier:e.attrs.label}).next(e.content).closeNode()}}}));de(om.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});de(om.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var Dd="footnote_reference",am=Ve("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${Dd}"]`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw dn(r);return{label:r.dataset.label}}}],toDOM:r=>{const e=r.attrs.label;return["sup",{"data-label":e,"data-type":Dd},e]},parseMarkdown:{match:({type:r})=>r==="footnoteReference",runner:(r,e,t)=>{r.addNode(t,{label:e.label})}},toMarkdown:{match:r=>r.type.name===Dd,runner:(r,e)=>{r.addNode("footnoteReference",void 0,void 0,{label:e.attrs.label,identifier:e.attrs.label})}}}));de(am.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});de(am.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var lm=zr.extendSchema(r=>e=>{const t=r(e);return{...t,attrs:{...t.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:n=>{if(!(n instanceof HTMLElement))throw dn(n);return{label:n.dataset.label,listType:n.dataset.listType,spread:n.dataset.spread==="true",checked:n.dataset.checked?n.dataset.checked==="true":null}}},...(t==null?void 0:t.parseDOM)||[]],toDOM:n=>t.toDOM&&n.attrs.checked==null?t.toDOM(n):["li",{"data-item-type":"task","data-label":n.attrs.label,"data-list-type":n.attrs.listType,"data-spread":n.attrs.spread,"data-checked":n.attrs.checked},0],parseMarkdown:{match:({type:n})=>n==="listItem",runner:(n,i,s)=>{if(i.checked==null){t.parseMarkdown.runner(n,i,s);return}const o=i.label!=null?`${i.label}.`:"•",a=i.checked!=null?!!i.checked:null,l=i.label!=null?"ordered":"bullet",c=i.spread??!0;n.openNode(s,{label:o,listType:l,spread:c,checked:a}),n.next(i.children),n.closeNode()}},toMarkdown:{match:n=>n.type.name==="list_item",runner:(n,i)=>{if(i.attrs.checked==null){t.toMarkdown.runner(n,i);return}const s=i.attrs.label,o=i.attrs.listType,a=i.attrs.spread,l=i.attrs.checked;n.openNode("listItem",void 0,{label:s,listType:o,spread:a,checked:l}),n.next(i.content),n.closeNode()}}}});de(lm.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});de(lm.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var X3=wt(()=>new _t(/^\[(?<checked>\s|x)\]\s$/,(r,e,t,n)=>{var u;const i=r.doc.resolve(t);let s=0,o=i.node(s);for(;o&&o.type.name!=="list_item";)s--,o=i.node(s);if(!o||o.attrs.checked!=null)return null;const a=((u=e.groups)==null?void 0:u.checked)==="x",l=i.before(s),c=r.tr;return c.deleteRange(t,n).setNodeMarkup(l,void 0,{...o.attrs,checked:a}),c}));de(X3,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var kC=[Xp,sm].flat(),xC=[J3,X3],SC=[V3],CC=[Y3],Z3=qe(()=>gC);de(Z3,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var MC=qe(()=>kS({}));de(MC,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Q3=qe(()=>OS({allowTableNodeSelection:!0}));de(Q3,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var cm=er("remarkGFM",()=>L7);de(cm.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});de(cm.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var TC=new De("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function AC(r,e){let t=0;return e.forEach((n,i,s)=>{n===r&&(t=s)}),t}function NC(r,e){const t=r.content.findDiffStart(e.content);if(t==null)return null;const n=r.content.findDiffEnd(e.content);return n?{from:t,to:Math.max(n.b,t)}:null}var e6=qe(()=>new Ae({key:TC,appendTransaction:(r,e,t)=>{if(e.doc===t.doc)return;const n=NC(e.doc,t.doc);if(!n)return;let i;const s=(o,a)=>{if(o.type.name!=="table_cell")return;const l=t.doc.resolve(a),c=l.node(l.depth),u=l.node(l.depth-1).firstChild;if(!u)return;const d=AC(o,c),h=u.maybeChild(d);if(!h)return;const f=h.attrs.alignment;f!==o.attrs.alignment&&(i||(i=t.tr),i.setNodeMarkup(a,void 0,{...o.attrs,alignment:f}))};return t.doc.nodesBetween(n.from,n.to,(o,a)=>o.type.name!=="table"?!0:(t.doc.nodesBetween(a,a+o.nodeSize,s),!1)),i}}));de(e6,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var EC=[e6,Z3,cm,Q3].flat(),DC=[lm,cn,Ec,Sa,Ps,Ca,om,am,Yp,xa].flat(),OC=[em,Qp,tm,K3,wu,ku,Pn,Fn,G3,xl,nm,Su,rm,xu,im,bu],RC=[DC,xC,CC,SC,kC,OC,EC].flat();const IC=/["&'<>`]/g,zC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,LC=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,BC=/[|\\{}()[\]^$+*?.]/g,Gg=new WeakMap;function PC(r,e){if(r=r.replace(e.subset?FC(e.subset):IC,n),e.subset||e.escapeOnly)return r;return r.replace(zC,t).replace(LC,n);function t(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function n(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function FC(r){let e=Gg.get(r);return e||(e=$C(r),Gg.set(r,e)),e}function $C(r){const e=[];let t=-1;for(;++t<r.length;)e.push(r[t].replace(BC,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function qC(r){return"&#x"+r.toString(16).toUpperCase()+";"}function HC(r,e){return PC(r,Object.assign({format:qC},e))}const _C={}.hasOwnProperty,jC={},Jg=/^[^\t\n\r "#'.<=>`}]+$/,VC=/^[^\t\n\r "'<=>`}]+$/;function t6(){return{canContainEols:["textDirective"],enter:{directiveContainer:UC,directiveContainerAttributes:Rd,directiveContainerLabel:JC,directiveLeaf:KC,directiveLeafAttributes:Rd,directiveText:GC,directiveTextAttributes:Rd},exit:{directiveContainer:Fd,directiveContainerAttributeClassValue:zd,directiveContainerAttributeIdValue:Id,directiveContainerAttributeName:Bd,directiveContainerAttributeValue:Ld,directiveContainerAttributes:Pd,directiveContainerLabel:YC,directiveContainerName:Od,directiveLeaf:Fd,directiveLeafAttributeClassValue:zd,directiveLeafAttributeIdValue:Id,directiveLeafAttributeName:Bd,directiveLeafAttributeValue:Ld,directiveLeafAttributes:Pd,directiveLeafName:Od,directiveText:Fd,directiveTextAttributeClassValue:zd,directiveTextAttributeIdValue:Id,directiveTextAttributeName:Bd,directiveTextAttributeValue:Ld,directiveTextAttributes:Pd,directiveTextName:Od}}}function WC(r){const e=r||jC;if(e.quote!=='"'&&e.quote!=="'"&&e.quote!==null&&e.quote!==void 0)throw new Error("Invalid quote `"+e.quote+"`, expected `'` or `\"`");return t.peek=XC,{handlers:{containerDirective:t,leafDirective:t,textDirective:t},unsafe:[{character:"\r",inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{character:`
|
|
35
|
+
`,inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{after:"[^\\s\\p{P}\\p{S}]",before:"[^:]",character:":",inConstruct:["phrasing"],unicode:!0},{afterNode:"textDirective",character:":",inConstruct:["phrasing"]},{atBreak:!0,before:":+",character:":"}]};function t(s,o,a,l){const c=a.createTracker(l),u=ZC(s),d=a.enter(s.type);let h=c.move(u+(s.name||""));const f=n(s,a),m=l.after.charCodeAt(0);let y;if(s.type==="containerDirective"){const b=(s.children||[])[0];y=Yg(b)?b:void 0}else y=s;if(y&&y.children&&y.children.length>0){const b=a.enter("label"),v=`${s.type}Label`,k=a.enter(v);h+=c.move("["),h+=c.move(a.containerPhrasing(y,{...c.current(),before:h,after:"]"})),h+=c.move("]"),k(),b()}else!f&&(m===45||m===95||!(ol(m)||al(m)))&&(h+=c.move("[]"));if(h+=c.move(f||(m===123?"{}":"")),s.type==="containerDirective"){const b=(s.children||[])[0];let v=s;Yg(b)&&(v=Object.assign({},s,{children:s.children.slice(1)})),v&&v.children&&v.children.length>0&&(h+=c.move(`
|
|
36
|
+
`),h+=c.move(a.containerFlow(v,c.current()))),h+=c.move(`
|
|
37
|
+
`+u)}return d(),h}function n(s,o){const a=s.attributes||{},l=[];let c,u,d,h;for(h in a)if(_C.call(a,h)&&a[h]!==void 0&&a[h]!==null){const f=String(a[h]);if(h==="id")d=e.preferShortcut!==!1&&Jg.test(f)?"#"+f:i("id",f,s,o);else if(h==="class"){const m=f.split(/[\t\n\r ]+/),y=[],b=[];let v=-1;for(;++v<m.length;)(e.preferShortcut!==!1&&Jg.test(m[v])?b:y).push(m[v]);c=y.length>0?i("class",y.join(" "),s,o):"",u=b.length>0?"."+b.join("."):""}else l.push(i(h,f,s,o))}return c&&l.unshift(c),u&&l.unshift(u),d&&l.unshift(d),l.length>0?"{"+l.join(" ")+"}":""}function i(s,o,a,l){if(e.collapseEmptyAttributes!==!1&&!o)return s;if(e.preferUnquoted&&VC.test(o))return s+"="+o;const c=e.quote||l.options.quote||'"',u=c==='"'?"'":'"',d=e.quoteSmart&&T1(o,c)>T1(o,u)?u:c,h=a.type==="textDirective"?[d]:[d,`
|
|
38
|
+
`,"\r"];return s+"="+d+HC(o,{subset:h})+d}}function UC(r){um.call(this,"containerDirective",r)}function KC(r){um.call(this,"leafDirective",r)}function GC(r){um.call(this,"textDirective",r)}function um(r,e){this.enter({type:r,name:"",attributes:{},children:[]},e)}function Od(r){const e=this.stack[this.stack.length-1];es(e.type==="containerDirective"||e.type==="leafDirective"||e.type==="textDirective"),e.name=this.sliceSerialize(r)}function JC(r){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},r)}function YC(r){this.exit(r)}function Rd(){this.data.directiveAttributes=[],this.buffer()}function Id(r){this.data.directiveAttributes.push(["id",zf(this.sliceSerialize(r),{attribute:!0})])}function zd(r){this.data.directiveAttributes.push(["class",zf(this.sliceSerialize(r),{attribute:!0})])}function Ld(r){const e=this.data.directiveAttributes;e[e.length-1][1]=zf(this.sliceSerialize(r),{attribute:!0})}function Bd(r){this.data.directiveAttributes.push([this.sliceSerialize(r),""])}function Pd(){const r=this.data.directiveAttributes,e={};let t=-1;for(;++t<r.length;){const i=r[t];i[0]==="class"&&e.class?e.class+=" "+i[1]:e[i[0]]=i[1]}this.data.directiveAttributes=void 0,this.resume();const n=this.stack[this.stack.length-1];es(n.type==="containerDirective"||n.type==="leafDirective"||n.type==="textDirective"),n.attributes=e}function Fd(r){this.exit(r)}function XC(){return":"}function Yg(r){return!!(r&&r.type==="paragraph"&&r.data&&r.data.directiveLabel)}function ZC(r){let e=0;return r.type==="containerDirective"?(V2(r,function(t,n){if(t.type==="containerDirective"){let i=n.length,s=0;for(;i--;)n[i].type==="containerDirective"&&s++;s>e&&(e=s)}}),e+=3):r.type==="leafDirective"?e=2:e=1,":".repeat(e)}const r6={}.hasOwnProperty;function QC(r,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),eM(t)(B7(P7(t).document().write(F7()(r,e,!0))))}function eM(r){const e={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Xr),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(Pe),blockQuote:o(Fi),characterEscape:q,characterReference:q,codeFenced:o($i),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o($i,a),codeText:o(yn,a),codeTextData:q,data:q,codeFlowValue:q,definition:o(Re),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(qi),hardBreakEscape:o(Jn),hardBreakTrailing:o(Jn),htmlFlow:o(xt,a),htmlFlowData:q,htmlText:o(xt,a),htmlTextData:q,image:o(Yr),label:a,link:o(Xr),listItem:o(Js),listItemValue:f,listOrdered:o(rr,h),listUnordered:o(rr),paragraph:o(vn),reference:Oe,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Pe),strong:o(Hi),thematicBreak:o(vr)},exit:{atxHeading:c(),atxHeadingSequence:z,autolink:c(),autolinkEmail:Gs,autolinkProtocol:Jr,blockQuote:c(),characterEscapeValue:te,characterReferenceMarkerHexadecimal:Us,characterReferenceMarkerNumeric:Us,characterReferenceValue:Gr,characterReference:Ks,codeFenced:c(v),codeFencedFence:b,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:te,codeIndented:c(k),codeText:c(ve),codeTextData:te,data:te,definition:c(),definitionDestinationString:O,definitionLabelString:M,definitionTitleString:D,emphasis:c(),hardBreakEscape:c(me),hardBreakTrailing:c(me),htmlFlow:c(be),htmlFlowData:te,htmlText:c($),htmlTextData:te,image:c(kt),label:tr,labelText:mn,lineEnding:Z,link:c(Qe),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Ws,resourceDestinationString:yr,resourceTitleString:gn,resource:Ot,setextHeading:c(N),setextHeadingLineSequence:B,setextHeadingText:T,strong:c(),thematicBreak:c()}};n6(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(H){let G={type:"root",children:[],position:void 0};const ce={stack:[G],tokenStack:[],config:e,enter:l,exit:u,buffer:a,resume:d,data:t},ge=[],lt=[];let Fe=-1;for(;++Fe<H.length;)if(lt.push(H[Fe]),H[Fe][1].type==="listOrdered"||H[Fe][1].type==="listUnordered")if(H[Fe][0]==="enter")ge.push(lt.length-1);else{const et=ge.pop();s(lt,et)}for(H=lt,Fe=-1;++Fe<H.length;){const et=e[H[Fe][0]];H[Fe][0]==="enter"&&e.beforeEnter.length>0&&i(e.beforeEnter,{...ce,sliceSerialize:H[Fe][2].sliceSerialize},H[Fe][1]),r6.call(et,H[Fe][1].type)&&et[H[Fe][1].type].call({...ce,sliceSerialize:H[Fe][2].sliceSerialize},H[Fe][1]),H[Fe][0]==="exit"&&e.afterExit.length>0&&i(e.afterExit,{...ce,sliceSerialize:H[Fe][2].sliceSerialize},H[Fe][1])}if(ce.tokenStack.length>0){const et=ce.tokenStack[ce.tokenStack.length-1];(et[1]||Xg).call(ce,void 0,et[0])}for(G.position={start:Qn(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Qn(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<e.transforms.length;)G=e.transforms[Fe](G)||G;return G}function i(H,G,ce){let ge=-1;for(;++ge<H.length;)H[ge].call(G,ce)}function s(H,G){const ce=H.length-1;let ge=G-1,lt=-1,Fe=!1,et,Rt,Zr,Yn;const Xn=[];for(;++ge<=ce;){const mt=H[ge];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?lt++:lt--,Yn=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(et&&!Yn&&!lt&&!Zr&&(Zr=ge),Yn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yn=void 0}if(!lt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||lt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(et){let nr=ge;for(Rt=void 0;nr--;){const St=H[nr];if(St[1].type==="lineEnding"||St[1].type==="lineEndingBlank"){if(St[0]==="exit")continue;Rt&&(H[Rt][1].type="lineEndingBlank",Fe=!0),St[1].type="lineEnding",Rt=nr}else if(!(St[1].type==="linePrefix"||St[1].type==="blockQuotePrefix"||St[1].type==="blockQuotePrefixWhitespace"||St[1].type==="blockQuoteMarker"||St[1].type==="listItemIndent"))break}Zr&&(!Rt||Zr<Rt)&&(et._spread=!0),et.end=Object.assign({},Rt?H[Rt][1].start:mt[1].end),Xn.push({at:Rt||ge,event:["exit",et,mt[2]]})}if(mt[1].type==="listItemPrefix"){const nr={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};et=nr,Xn.push({at:ge,event:["enter",nr,mt[2]]}),Zr=void 0,Yn=!0}}}const Ea=H.splice(G);let ji=0;for(ge=-1;++ge<Ea.length;){for(;ji<Xn.length&&Xn[ji].at===G+ge;)H.push(Xn[ji++].event);H.push(Ea[ge])}H[G][1]._spread=Fe}function o(H,G){return ce;function ce(ge){l.call(this,H(ge),ge),G&&G.call(this,ge)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(H,G,ce){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([G,ce||void 0]),H.position={start:Qn(G.start),end:void 0}}function c(H){return G;function G(ce){H&&H.call(this,ce),u.call(this,ce)}}function u(H,G){const ce=this.stack.pop(),ge=this.tokenStack.pop();if(!ge)throw new Error("Cannot close `"+H.type+"` ("+f0({start:H.start,end:H.end})+"): it’s not open");ge[0].type!==H.type&&(G?G.call(this,H,ge[0]):(ge[1]||Xg).call(this,H,ge[0])),ce.position.end=Qn(H.end)}function d(){return W2(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(H){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function m(){const H=this.resume(),G=this.stack[this.stack.length-1];G.lang=H}function y(){const H=this.resume(),G=this.stack[this.stack.length-1];G.meta=H}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const H=this.resume(),G=this.stack[this.stack.length-1];G.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const H=this.resume(),G=this.stack[this.stack.length-1];G.value=H.replace(/(\r?\n|\r)$/g,"")}function M(H){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.label=G,ce.identifier=Ua(this.sliceSerialize(H)).toLowerCase()}function D(){const H=this.resume(),G=this.stack[this.stack.length-1];G.title=H}function O(){const H=this.resume(),G=this.stack[this.stack.length-1];G.url=H}function z(H){const G=this.stack[this.stack.length-1];if(!G.depth){const ce=this.sliceSerialize(H).length;G.depth=ce}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function B(H){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function q(H){const ce=this.stack[this.stack.length-1].children;let ge=ce[ce.length-1];(!ge||ge.type!=="text")&&(ge=_i(),ge.position={start:Qn(H.start),end:void 0},ce.push(ge)),this.stack.push(ge)}function te(H){const G=this.stack.pop();G.value+=this.sliceSerialize(H),G.position.end=Qn(H.end)}function Z(H){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ce=G.children[G.children.length-1];ce.position.end=Qn(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(G.type)&&(q.call(this,H),te.call(this,H))}function me(){this.data.atHardBreak=!0}function be(){const H=this.resume(),G=this.stack[this.stack.length-1];G.value=H}function $(){const H=this.resume(),G=this.stack[this.stack.length-1];G.value=H}function ve(){const H=this.resume(),G=this.stack[this.stack.length-1];G.value=H}function Qe(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=G,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function kt(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=G,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function mn(H){const G=this.sliceSerialize(H),ce=this.stack[this.stack.length-2];ce.label=_2(G),ce.identifier=Ua(G).toLowerCase()}function tr(){const H=this.stack[this.stack.length-1],G=this.resume(),ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,ce.type==="link"){const ge=H.children;ce.children=ge}else ce.alt=G}function yr(){const H=this.resume(),G=this.stack[this.stack.length-1];G.url=H}function gn(){const H=this.resume(),G=this.stack[this.stack.length-1];G.title=H}function Ot(){this.data.inReference=void 0}function Oe(){this.data.referenceType="collapsed"}function Ws(H){const G=this.resume(),ce=this.stack[this.stack.length-1];ce.label=G,ce.identifier=Ua(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function Us(H){this.data.characterReferenceType=H.type}function Gr(H){const G=this.sliceSerialize(H),ce=this.data.characterReferenceType;let ge;ce?(ge=q7(G,ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=$7(G);const lt=this.stack[this.stack.length-1];lt.value+=ge}function Ks(H){const G=this.stack.pop();G.position.end=Qn(H.end)}function Jr(H){te.call(this,H);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(H)}function Gs(H){te.call(this,H);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(H)}function Fi(){return{type:"blockquote",children:[],position:void 0}}function $i(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function yn(){return{type:"inlineCode",value:"",position:void 0}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function qi(){return{type:"emphasis",children:[],position:void 0}}function Pe(){return{type:"heading",depth:0,children:[],position:void 0}}function Jn(){return{type:"break",position:void 0}}function xt(){return{type:"html",value:"",position:void 0}}function Yr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Xr(){return{type:"link",title:null,url:"",children:[],position:void 0}}function rr(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[],position:void 0}}function Js(H){return{type:"listItem",spread:H._spread,checked:null,children:[],position:void 0}}function vn(){return{type:"paragraph",children:[],position:void 0}}function Hi(){return{type:"strong",children:[],position:void 0}}function _i(){return{type:"text",value:"",position:void 0}}function vr(){return{type:"thematicBreak",position:void 0}}}function Qn(r){return{line:r.line,column:r.column,offset:r.offset}}function n6(r,e){let t=-1;for(;++t<e.length;){const n=e[t];Array.isArray(n)?n6(r,n):tM(r,n)}}function tM(r,e){let t;for(t in e)if(r6.call(e,t))switch(t){case"canContainEols":{const n=e[t];n&&r[t].push(...n);break}case"transforms":{const n=e[t];n&&r[t].push(...n);break}case"afterExit":case"beforeEnter":{const n=e[t];n&&r[t].push(n);break}case"enter":case"exit":{const n=e[t];n&&Object.assign(r[t],n);break}}}function Xg(r,e){throw r?new Error("Cannot close `"+r.type+"` ("+f0({start:r.start,end:r.end})+"): a different token (`"+e.type+"`, "+f0({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+f0({start:e.start,end:e.end})+") is still open")}function rM(r,e,t,n){const i=t.enter("paragraph"),s=t.enter("phrasing"),o=t.containerPhrasing(r,n);return s(),i(),o}const nM={paragraph:rM};function dm(r,e,t,n,i,s,o,a,l,c,u,d,h,f,m){let y,b;return v;function v($){return r.enter(n),r.enter(i),r.consume($),r.exit(i),k}function k($){return $===35?(y=o,M($)):$===46?(y=a,M($)):m&&ns($)?Tr(r,k,"whitespace")($):!m&&Ui($)?Hc(r,k)($):$===null||je($)||al($)||ol($)&&$!==45&&$!==95?be($):(r.enter(s),r.enter(l),r.consume($),z)}function M($){const ve=y+"Marker";return r.enter(s),r.enter(y),r.enter(ve),r.consume($),r.exit(ve),D}function D($){if($===null||$===34||$===35||$===39||$===46||$===60||$===61||$===62||$===96||$===125||Ui($))return t($);const ve=y+"Value";return r.enter(ve),r.consume($),O}function O($){if($===null||$===34||$===39||$===60||$===61||$===62||$===96)return t($);if($===35||$===46||$===125||Ui($)){const ve=y+"Value";return r.exit(ve),r.exit(y),r.exit(s),k($)}return r.consume($),O}function z($){return $===null||je($)||al($)||ol($)&&$!==45&&$!==46&&$!==58&&$!==95?(r.exit(l),m&&ns($)?Tr(r,T,"whitespace")($):!m&&Ui($)?Hc(r,T)($):T($)):(r.consume($),z)}function T($){return $===61?(r.enter(c),r.consume($),r.exit(c),B):(r.exit(s),k($))}function B($){return $===null||$===60||$===61||$===62||$===96||$===125||m&&je($)?t($):$===34||$===39?(r.enter(u),r.enter(h),r.consume($),r.exit(h),b=$,q):m&&ns($)?Tr(r,B,"whitespace")($):!m&&Ui($)?Hc(r,B)($):(r.enter(d),r.enter(f),r.consume($),b=void 0,N)}function N($){return $===null||$===34||$===39||$===60||$===61||$===62||$===96?t($):$===125||Ui($)?(r.exit(f),r.exit(d),r.exit(s),k($)):(r.consume($),N)}function q($){return $===b?(r.enter(h),r.consume($),r.exit(h),r.exit(u),r.exit(s),me):(r.enter(d),te($))}function te($){return $===b?(r.exit(d),q($)):$===null?t($):je($)?m?t($):Hc(r,te)($):(r.enter(f),r.consume($),Z)}function Z($){return $===b||$===null||je($)?(r.exit(f),te($)):(r.consume($),Z)}function me($){return $===125||Ui($)?k($):be($)}function be($){return $===125?(r.enter(i),r.consume($),r.exit(i),r.exit(n),e):t($)}}function hm(r,e,t,n,i,s,o){let a=0,l=0,c;return u;function u(b){return r.enter(n),r.enter(i),r.consume(b),r.exit(i),d}function d(b){return b===93?(r.enter(i),r.consume(b),r.exit(i),r.exit(n),e):(r.enter(s),h(b))}function h(b){if(b===93&&!l)return y(b);const v=r.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:c});return c&&(c.next=v),c=v,f(b)}function f(b){return b===null||a>999||b===91&&++l>32?t(b):b===93&&!l--?(r.exit("chunkText"),y(b)):je(b)?o?t(b):(r.consume(b),r.exit("chunkText"),h):(r.consume(b),b===92?m:f)}function m(b){return b===91||b===92||b===93?(r.consume(b),a++,f):f(b)}function y(b){return r.exit(s),r.enter(i),r.consume(b),r.exit(i),r.exit(n),e}}function fm(r,e,t,n){const i=this;return s;function s(a){return a===null||je(a)||ol(a)||al(a)?t(a):(r.enter(n),r.consume(a),o)}function o(a){return a===null||je(a)||al(a)||ol(a)&&a!==45&&a!==95?(r.exit(n),i.previous===45||i.previous===95?t(a):e(a)):(r.consume(a),o)}}const iM={tokenize:aM,concrete:!0},sM={tokenize:lM,partial:!0},oM={tokenize:cM,partial:!0},Xc={tokenize:uM,partial:!0};function aM(r,e,t){const n=this,i=n.events[n.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0,a;return l;function l(N){return r.enter("directiveContainer"),r.enter("directiveContainerFence"),r.enter("directiveContainerSequence"),c(N)}function c(N){return N===58?(r.consume(N),o++,c):o<3?t(N):(r.exit("directiveContainerSequence"),fm.call(n,r,u,t,"directiveContainerName")(N))}function u(N){return N===91?r.attempt(sM,d,d)(N):d(N)}function d(N){return N===123?r.attempt(oM,h,h)(N):h(N)}function h(N){return Tr(r,f,"whitespace")(N)}function f(N){return r.exit("directiveContainerFence"),N===null?T(N):je(N)?n.interrupt?e(N):r.attempt(Xc,m,T)(N):t(N)}function m(N){return N===null?T(N):je(N)?r.check(Xc,M,T)(N):(r.enter("directiveContainerContent"),y(N))}function y(N){return r.attempt({tokenize:B,partial:!0},z,s?Tr(r,b,"linePrefix",s+1):b)(N)}function b(N){return N===null?z(N):je(N)?r.check(Xc,k,z)(N):k(N)}function v(N){if(N===null){const q=r.exit("chunkDocument");return n.parser.lazy[q.start.line]=!1,z(N)}return je(N)?r.check(Xc,D,O)(N):(r.consume(N),v)}function k(N){const q=r.enter("chunkDocument",{contentType:"document",previous:a});return a&&(a.next=q),a=q,v(N)}function M(N){return r.enter("directiveContainerContent"),y(N)}function D(N){r.consume(N);const q=r.exit("chunkDocument");return n.parser.lazy[q.start.line]=!1,y}function O(N){const q=r.exit("chunkDocument");return n.parser.lazy[q.start.line]=!1,z(N)}function z(N){return r.exit("directiveContainerContent"),T(N)}function T(N){return r.exit("directiveContainer"),e(N)}function B(N,q,te){let Z=0;return Tr(N,me,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function me(ve){return N.enter("directiveContainerFence"),N.enter("directiveContainerSequence"),be(ve)}function be(ve){return ve===58?(N.consume(ve),Z++,be):Z<o?te(ve):(N.exit("directiveContainerSequence"),Tr(N,$,"whitespace")(ve))}function $(ve){return ve===null||je(ve)?(N.exit("directiveContainerFence"),q(ve)):te(ve)}}}function lM(r,e,t){return hm(r,e,t,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function cM(r,e,t){return dm(r,e,t,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function uM(r,e,t){const n=this;return i;function i(o){return r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),s}function s(o){return n.parser.lazy[n.now().line]?t(o):e(o)}}const dM={tokenize:pM},hM={tokenize:mM,partial:!0},fM={tokenize:gM,partial:!0};function pM(r,e,t){const n=this;return i;function i(u){return r.enter("directiveLeaf"),r.enter("directiveLeafSequence"),r.consume(u),s}function s(u){return u===58?(r.consume(u),r.exit("directiveLeafSequence"),fm.call(n,r,o,t,"directiveLeafName")):t(u)}function o(u){return u===91?r.attempt(hM,a,a)(u):a(u)}function a(u){return u===123?r.attempt(fM,l,l)(u):l(u)}function l(u){return Tr(r,c,"whitespace")(u)}function c(u){return u===null||je(u)?(r.exit("directiveLeaf"),e(u)):t(u)}}function mM(r,e,t){return hm(r,e,t,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function gM(r,e,t){return dm(r,e,t,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const yM={tokenize:kM,previous:wM},vM={tokenize:xM,partial:!0},bM={tokenize:SM,partial:!0};function wM(r){return r!==58||this.events[this.events.length-1][1].type==="characterEscape"}function kM(r,e,t){const n=this;return i;function i(l){return r.enter("directiveText"),r.enter("directiveTextMarker"),r.consume(l),r.exit("directiveTextMarker"),fm.call(n,r,s,t,"directiveTextName")}function s(l){return l===58?t(l):l===91?r.attempt(vM,o,o)(l):o(l)}function o(l){return l===123?r.attempt(bM,a,a)(l):a(l)}function a(l){return r.exit("directiveText"),e(l)}}function xM(r,e,t){return hm(r,e,t,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function SM(r,e,t){return dm(r,e,t,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function CM(){return{text:{58:yM},flow:{58:[iM,dM]}}}function MM(){const r=this.data(),e=WC({preferShortcut:!1}),t=[...r.toMarkdownExtensions??[]].reverse().flatMap(n=>{var i;return"handlers"in n?[(i=n.handlers)==null?void 0:i.paragraph]:[]}).find(n=>typeof n=="function")??nM.paragraph;(r.micromarkExtensions??(r.micromarkExtensions=[])).push({flow:i6}),(r.fromMarkdownExtensions??(r.fromMarkdownExtensions=[])).push(t6()),(r.toMarkdownExtensions??(r.toMarkdownExtensions=[])).push({...e,handlers:{...e.handlers,paragraph:DM(t)},unsafe:(e.unsafe??[]).filter(n=>{var i;return!((i=n.inConstruct)!=null&&i.includes("phrasing"))&&!n.atBreak})})}const{flow:i6}=CM(),TM={extensions:[{flow:i6}],mdastExtensions:[t6()]};function Cu(r){return QC(r,TM).children}function s6(r){const e=new Map;return t=>{let n=e.get(t);return n===void 0&&(n=r(t),e.size>1e3&&e.clear(),e.set(t,n)),n}}const o6=s6(r=>{if(!r||/[\s[\]{}"'=:\\]/.test(r))return!1;const e=Cu(`::${r}`),t=e[0];return e.length===1&&(t==null?void 0:t.type)==="leafDirective"&&t.name===r&&t.children.length===0&&Object.keys(t.attributes??{}).length===0}),a6=s6(r=>{if(!r||/[\s"'={}\\]/.test(r))return!1;const e=Cu(`::a{${r}="v"}`),t=e[0];if(e.length!==1||(t==null?void 0:t.type)!=="leafDirective")return!1;const n=t.attributes??{},i=Object.keys(n);return i.length===1&&i[0]===r&&n[r]==="v"});function AM(r){if(!/^[ \t]*::/.test(r))return!1;const e=Cu(r)[0];return(e==null?void 0:e.type)==="leafDirective"||(e==null?void 0:e.type)==="containerDirective"}const NM=new Set(["tableCell"]),EM=/^[ \t]*::+[^\s:]/m;function DM(r){return(e,t,n,i)=>{var a;const s=r(e,t,n,i);if(t&&NM.has(t.type)||!EM.test(s))return s;const o=Cu(s);return o.length===1&&((a=o[0])==null?void 0:a.type)==="paragraph"?s:s.split(`
|
|
39
|
+
`).map(l=>AM(l)?l.replace(":","\\:"):l).join(`
|
|
40
|
+
`)}}var $d={exports:{}},Zg;function OM(){return Zg||(Zg=1,(function(r){(function(){var e;e=r.exports=i,e.format=i,e.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(e.printf=t);function t(){console.log(i.apply(null,arguments))}function n(s,o){return i.apply(null,[s].concat(o))}function i(s){for(var o=1,a=[].slice.call(arguments),l=0,c=s.length,u="",d,h=!1,f,m,y=!1,b,v=function(){return a[o++]},k=function(){for(var M="";/\d/.test(s[l]);)M+=s[l++],d=s[l];return M.length>0?parseInt(M):null};l<c;++l)if(d=s[l],h)switch(h=!1,d=="."?(y=!1,d=s[++l]):d=="0"&&s[l+1]=="."?(y=!0,l+=2,d=s[l]):y=!0,b=k(),d){case"b":u+=parseInt(v(),10).toString(2);break;case"c":f=v(),typeof f=="string"||f instanceof String?u+=f:u+=String.fromCharCode(parseInt(f,10));break;case"d":u+=parseInt(v(),10);break;case"f":m=String(parseFloat(v()).toFixed(b||6)),u+=y?m:m.replace(/^0/,"");break;case"j":u+=JSON.stringify(v());break;case"o":u+="0"+parseInt(v(),10).toString(8);break;case"s":u+=v();break;case"x":u+="0x"+parseInt(v(),10).toString(16);break;case"X":u+="0x"+parseInt(v(),10).toString(16).toUpperCase();break;default:u+=d;break}else d==="%"?h=!0:u+=d;return u}})()})($d)),$d.exports}var RM=OM();const IM=H7(RM),Zc=Object.assign(Gi(Error),{eval:Gi(EvalError),range:Gi(RangeError),reference:Gi(ReferenceError),syntax:Gi(SyntaxError),type:Gi(TypeError),uri:Gi(URIError)});function Gi(r){return e.displayName=r.displayName||r.name,e;function e(t,...n){const i=t&&IM(t,...n);return new r(i)}}const Qc={}.hasOwnProperty,Qg={yaml:"-",toml:"+"};function pm(r){const e=[];let t=-1;const n=Array.isArray(r)?r:r?[r]:["yaml"];for(;++t<n.length;)e[t]=zM(n[t]);return e}function zM(r){let e=r;if(typeof e=="string"){if(!Qc.call(Qg,e))throw Zc("Missing matter definition for `%s`",e);e={type:e,marker:Qg[e]}}else if(typeof e!="object")throw Zc("Expected matter to be an object, not `%j`",e);if(!Qc.call(e,"type"))throw Zc("Missing `type` in matter `%j`",e);if(!Qc.call(e,"fence")&&!Qc.call(e,"marker"))throw Zc("Missing `marker` or `fence` in matter `%j`",e);return e}function LM(r){const e=pm(r),t={};let n=-1;for(;++n<e.length;){const i=e[n],s=Xh(i,"open").charCodeAt(0),o=BM(i),a=t[s];Array.isArray(a)?a.push(o):t[s]=[o]}return{flow:t}}function BM(r){const e=r.anywhere,t=r.type,n=t+"Fence",i=n+"Sequence",s=t+"Value",o={tokenize:u,partial:!0};let a,l=0;return{tokenize:c,concrete:!0};function c(d,h,f){const m=this;return y;function y(T){const B=m.now();return B.column===1&&(B.line===1||e)&&(a=Xh(r,"open"),l=0,T===a.charCodeAt(l))?(d.enter(t),d.enter(n),d.enter(i),b(T)):f(T)}function b(T){return l===a.length?(d.exit(i),ns(T)?(d.enter("whitespace"),v(T)):k(T)):T===a.charCodeAt(l++)?(d.consume(T),b):f(T)}function v(T){return ns(T)?(d.consume(T),v):(d.exit("whitespace"),k(T))}function k(T){return je(T)?(d.exit(n),d.enter("lineEnding"),d.consume(T),d.exit("lineEnding"),a=Xh(r,"close"),l=0,d.attempt(o,z,M)):f(T)}function M(T){return T===null||je(T)?O(T):(d.enter(s),D(T))}function D(T){return T===null||je(T)?(d.exit(s),O(T)):(d.consume(T),D)}function O(T){return T===null?f(T):(d.enter("lineEnding"),d.consume(T),d.exit("lineEnding"),d.attempt(o,z,M))}function z(T){return d.exit(t),h(T)}}function u(d,h,f){let m=0;return y;function y(M){return M===a.charCodeAt(m)?(d.enter(n),d.enter(i),b(M)):f(M)}function b(M){return m===a.length?(d.exit(i),ns(M)?(d.enter("whitespace"),v(M)):k(M)):M===a.charCodeAt(m++)?(d.consume(M),b):f(M)}function v(M){return ns(M)?(d.consume(M),v):(d.exit("whitespace"),k(M))}function k(M){return M===null||je(M)?(d.exit(n),h(M)):f(M)}}}function Xh(r,e){return r.marker?e4(r.marker,e).repeat(3):e4(r.fence,e)}function e4(r,e){return typeof r=="string"?r:r[e]}function PM(r){const e=pm(r),t={},n={};let i=-1;for(;++i<e.length;){const s=e[i];t[s.type]=FM(s),n[s.type]=$M,n[s.type+"Value"]=qM}return{enter:t,exit:n}}function FM(r){return e;function e(t){this.enter({type:r.type,value:""},t),this.buffer()}}function $M(r){const e=this.resume(),t=this.stack[this.stack.length-1];this.exit(r),t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function qM(r){this.config.enter.data.call(this,r),this.config.exit.data.call(this,r)}function HM(r){const e=[],t={},n=pm(r);let i=-1;for(;++i<n.length;){const s=n[i];t[s.type]=_M(s);const o=Zh(s,"open");e.push({atBreak:!0,character:o.charAt(0),after:_7(o.charAt(1))})}return{unsafe:e,handlers:t}}function _M(r){const e=Zh(r,"open"),t=Zh(r,"close");return n;function n(i){return e+(i.value?`
|
|
41
|
+
`+i.value:"")+`
|
|
42
|
+
`+t}}function Zh(r,e){return r.marker?t4(r.marker,e).repeat(3):t4(r.fence,e)}function t4(r,e){return typeof r=="string"?r:r[e]}const jM="yaml";function VM(r){const e=this,t=r||jM,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(LM(t)),s.push(PM(t)),o.push(HM(t))}/**
|
|
43
|
+
* @license lucide-static v1.21.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const WM=`
|
|
48
|
+
<svg
|
|
49
|
+
class="lucide lucide-blocks"
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
width="24"
|
|
52
|
+
height="24"
|
|
53
|
+
viewBox="0 0 24 24"
|
|
54
|
+
fill="none"
|
|
55
|
+
stroke="currentColor"
|
|
56
|
+
stroke-width="2"
|
|
57
|
+
stroke-linecap="round"
|
|
58
|
+
stroke-linejoin="round"
|
|
59
|
+
>
|
|
60
|
+
<path d="M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2" />
|
|
61
|
+
<rect x="14" y="2" width="8" height="8" rx="1" />
|
|
62
|
+
</svg>
|
|
63
|
+
`;/**
|
|
64
|
+
* @license lucide-static v1.21.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const UM=`
|
|
69
|
+
<svg
|
|
70
|
+
class="lucide lucide-bold"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
width="24"
|
|
73
|
+
height="24"
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
stroke-width="2"
|
|
78
|
+
stroke-linecap="round"
|
|
79
|
+
stroke-linejoin="round"
|
|
80
|
+
>
|
|
81
|
+
<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" />
|
|
82
|
+
</svg>
|
|
83
|
+
`;/**
|
|
84
|
+
* @license lucide-static v1.21.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const KM=`
|
|
89
|
+
<svg
|
|
90
|
+
class="lucide lucide-captions"
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="24"
|
|
93
|
+
height="24"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
fill="none"
|
|
96
|
+
stroke="currentColor"
|
|
97
|
+
stroke-width="2"
|
|
98
|
+
stroke-linecap="round"
|
|
99
|
+
stroke-linejoin="round"
|
|
100
|
+
>
|
|
101
|
+
<rect width="18" height="14" x="3" y="5" rx="2" ry="2" />
|
|
102
|
+
<path d="M7 15h4M15 15h2M7 11h2M13 11h4" />
|
|
103
|
+
</svg>`;/**
|
|
104
|
+
* @license lucide-static v1.21.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const Mu=`
|
|
109
|
+
<svg
|
|
110
|
+
class="lucide lucide-check"
|
|
111
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
112
|
+
width="24"
|
|
113
|
+
height="24"
|
|
114
|
+
viewBox="0 0 24 24"
|
|
115
|
+
fill="none"
|
|
116
|
+
stroke="currentColor"
|
|
117
|
+
stroke-width="2"
|
|
118
|
+
stroke-linecap="round"
|
|
119
|
+
stroke-linejoin="round"
|
|
120
|
+
>
|
|
121
|
+
<path d="M20 6 9 17l-5-5" />
|
|
122
|
+
</svg>
|
|
123
|
+
`;/**
|
|
124
|
+
* @license lucide-static v1.21.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const GM=`
|
|
129
|
+
<svg
|
|
130
|
+
class="lucide lucide-chevron-down"
|
|
131
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
132
|
+
width="24"
|
|
133
|
+
height="24"
|
|
134
|
+
viewBox="0 0 24 24"
|
|
135
|
+
fill="none"
|
|
136
|
+
stroke="currentColor"
|
|
137
|
+
stroke-width="2"
|
|
138
|
+
stroke-linecap="round"
|
|
139
|
+
stroke-linejoin="round"
|
|
140
|
+
>
|
|
141
|
+
<path d="m6 9 6 6 6-6" />
|
|
142
|
+
</svg>
|
|
143
|
+
`;/**
|
|
144
|
+
* @license lucide-static v1.21.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const l6=`
|
|
149
|
+
<svg
|
|
150
|
+
class="lucide lucide-code"
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
width="24"
|
|
153
|
+
height="24"
|
|
154
|
+
viewBox="0 0 24 24"
|
|
155
|
+
fill="none"
|
|
156
|
+
stroke="currentColor"
|
|
157
|
+
stroke-width="2"
|
|
158
|
+
stroke-linecap="round"
|
|
159
|
+
stroke-linejoin="round"
|
|
160
|
+
>
|
|
161
|
+
<path d="m16 18 6-6-6-6" />
|
|
162
|
+
<path d="m8 6-6 6 6 6" />
|
|
163
|
+
</svg>
|
|
164
|
+
`;/**
|
|
165
|
+
* @license lucide-static v1.21.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const c6=`
|
|
170
|
+
<svg
|
|
171
|
+
class="lucide lucide-copy"
|
|
172
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
173
|
+
width="24"
|
|
174
|
+
height="24"
|
|
175
|
+
viewBox="0 0 24 24"
|
|
176
|
+
fill="none"
|
|
177
|
+
stroke="currentColor"
|
|
178
|
+
stroke-width="2"
|
|
179
|
+
stroke-linecap="round"
|
|
180
|
+
stroke-linejoin="round"
|
|
181
|
+
>
|
|
182
|
+
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
183
|
+
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
184
|
+
</svg>
|
|
185
|
+
`;/**
|
|
186
|
+
* @license lucide-static v1.21.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const JM=`
|
|
191
|
+
<svg
|
|
192
|
+
class="lucide lucide-ellipsis-vertical"
|
|
193
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
194
|
+
width="24"
|
|
195
|
+
height="24"
|
|
196
|
+
viewBox="0 0 24 24"
|
|
197
|
+
fill="none"
|
|
198
|
+
stroke="currentColor"
|
|
199
|
+
stroke-width="2"
|
|
200
|
+
stroke-linecap="round"
|
|
201
|
+
stroke-linejoin="round"
|
|
202
|
+
>
|
|
203
|
+
<circle cx="12" cy="12" r="1" />
|
|
204
|
+
<circle cx="12" cy="5" r="1" />
|
|
205
|
+
<circle cx="12" cy="19" r="1" />
|
|
206
|
+
</svg>
|
|
207
|
+
`;/**
|
|
208
|
+
* @license lucide-static v1.21.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const YM=`
|
|
213
|
+
<svg
|
|
214
|
+
class="lucide lucide-ellipsis"
|
|
215
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
216
|
+
width="24"
|
|
217
|
+
height="24"
|
|
218
|
+
viewBox="0 0 24 24"
|
|
219
|
+
fill="none"
|
|
220
|
+
stroke="currentColor"
|
|
221
|
+
stroke-width="2"
|
|
222
|
+
stroke-linecap="round"
|
|
223
|
+
stroke-linejoin="round"
|
|
224
|
+
>
|
|
225
|
+
<circle cx="12" cy="12" r="1" />
|
|
226
|
+
<circle cx="19" cy="12" r="1" />
|
|
227
|
+
<circle cx="5" cy="12" r="1" />
|
|
228
|
+
</svg>
|
|
229
|
+
`;/**
|
|
230
|
+
* @license lucide-static v1.21.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const XM=`
|
|
235
|
+
<svg
|
|
236
|
+
class="lucide lucide-eye-off"
|
|
237
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
238
|
+
width="24"
|
|
239
|
+
height="24"
|
|
240
|
+
viewBox="0 0 24 24"
|
|
241
|
+
fill="none"
|
|
242
|
+
stroke="currentColor"
|
|
243
|
+
stroke-width="2"
|
|
244
|
+
stroke-linecap="round"
|
|
245
|
+
stroke-linejoin="round"
|
|
246
|
+
>
|
|
247
|
+
<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" />
|
|
248
|
+
<path d="M14.084 14.158a3 3 0 0 1-4.242-4.242" />
|
|
249
|
+
<path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" />
|
|
250
|
+
<path d="m2 2 20 20" />
|
|
251
|
+
</svg>
|
|
252
|
+
`;/**
|
|
253
|
+
* @license lucide-static v1.21.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const ZM=`
|
|
258
|
+
<svg
|
|
259
|
+
class="lucide lucide-grip-vertical"
|
|
260
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
261
|
+
width="24"
|
|
262
|
+
height="24"
|
|
263
|
+
viewBox="0 0 24 24"
|
|
264
|
+
fill="none"
|
|
265
|
+
stroke="currentColor"
|
|
266
|
+
stroke-width="2"
|
|
267
|
+
stroke-linecap="round"
|
|
268
|
+
stroke-linejoin="round"
|
|
269
|
+
>
|
|
270
|
+
<circle cx="9" cy="12" r="1" />
|
|
271
|
+
<circle cx="9" cy="5" r="1" />
|
|
272
|
+
<circle cx="9" cy="19" r="1" />
|
|
273
|
+
<circle cx="15" cy="12" r="1" />
|
|
274
|
+
<circle cx="15" cy="5" r="1" />
|
|
275
|
+
<circle cx="15" cy="19" r="1" />
|
|
276
|
+
</svg>
|
|
277
|
+
`;/**
|
|
278
|
+
* @license lucide-static v1.21.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const QM=`
|
|
283
|
+
<svg
|
|
284
|
+
class="lucide lucide-heading-1"
|
|
285
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
286
|
+
width="24"
|
|
287
|
+
height="24"
|
|
288
|
+
viewBox="0 0 24 24"
|
|
289
|
+
fill="none"
|
|
290
|
+
stroke="currentColor"
|
|
291
|
+
stroke-width="2"
|
|
292
|
+
stroke-linecap="round"
|
|
293
|
+
stroke-linejoin="round"
|
|
294
|
+
>
|
|
295
|
+
<path d="M4 12h8" />
|
|
296
|
+
<path d="M4 18V6" />
|
|
297
|
+
<path d="M12 18V6" />
|
|
298
|
+
<path d="m17 12 3-2v8" />
|
|
299
|
+
</svg>
|
|
300
|
+
`;/**
|
|
301
|
+
* @license lucide-static v1.21.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const eT=`
|
|
306
|
+
<svg
|
|
307
|
+
class="lucide lucide-heading-3"
|
|
308
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
309
|
+
width="24"
|
|
310
|
+
height="24"
|
|
311
|
+
viewBox="0 0 24 24"
|
|
312
|
+
fill="none"
|
|
313
|
+
stroke="currentColor"
|
|
314
|
+
stroke-width="2"
|
|
315
|
+
stroke-linecap="round"
|
|
316
|
+
stroke-linejoin="round"
|
|
317
|
+
>
|
|
318
|
+
<path d="M4 12h8" />
|
|
319
|
+
<path d="M4 18V6" />
|
|
320
|
+
<path d="M12 18V6" />
|
|
321
|
+
<path d="M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" />
|
|
322
|
+
<path d="M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" />
|
|
323
|
+
</svg>
|
|
324
|
+
`;/**
|
|
325
|
+
* @license lucide-static v1.21.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const tT=`
|
|
330
|
+
<svg
|
|
331
|
+
class="lucide lucide-heading-4"
|
|
332
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
333
|
+
width="24"
|
|
334
|
+
height="24"
|
|
335
|
+
viewBox="0 0 24 24"
|
|
336
|
+
fill="none"
|
|
337
|
+
stroke="currentColor"
|
|
338
|
+
stroke-width="2"
|
|
339
|
+
stroke-linecap="round"
|
|
340
|
+
stroke-linejoin="round"
|
|
341
|
+
>
|
|
342
|
+
<path d="M12 18V6" />
|
|
343
|
+
<path d="M17 10v3a1 1 0 0 0 1 1h3" />
|
|
344
|
+
<path d="M21 10v8" />
|
|
345
|
+
<path d="M4 12h8" />
|
|
346
|
+
<path d="M4 18V6" />
|
|
347
|
+
</svg>
|
|
348
|
+
`;/**
|
|
349
|
+
* @license lucide-static v1.21.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const rT=`
|
|
354
|
+
<svg
|
|
355
|
+
class="lucide lucide-heading-2"
|
|
356
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
357
|
+
width="24"
|
|
358
|
+
height="24"
|
|
359
|
+
viewBox="0 0 24 24"
|
|
360
|
+
fill="none"
|
|
361
|
+
stroke="currentColor"
|
|
362
|
+
stroke-width="2"
|
|
363
|
+
stroke-linecap="round"
|
|
364
|
+
stroke-linejoin="round"
|
|
365
|
+
>
|
|
366
|
+
<path d="M4 12h8" />
|
|
367
|
+
<path d="M4 18V6" />
|
|
368
|
+
<path d="M12 18V6" />
|
|
369
|
+
<path d="M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" />
|
|
370
|
+
</svg>
|
|
371
|
+
`;/**
|
|
372
|
+
* @license lucide-static v1.21.0 - ISC
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the ISC license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/const nT=`
|
|
377
|
+
<svg
|
|
378
|
+
class="lucide lucide-heading-5"
|
|
379
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
380
|
+
width="24"
|
|
381
|
+
height="24"
|
|
382
|
+
viewBox="0 0 24 24"
|
|
383
|
+
fill="none"
|
|
384
|
+
stroke="currentColor"
|
|
385
|
+
stroke-width="2"
|
|
386
|
+
stroke-linecap="round"
|
|
387
|
+
stroke-linejoin="round"
|
|
388
|
+
>
|
|
389
|
+
<path d="M4 12h8" />
|
|
390
|
+
<path d="M4 18V6" />
|
|
391
|
+
<path d="M12 18V6" />
|
|
392
|
+
<path d="M17 13v-3h4" />
|
|
393
|
+
<path d="M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17" />
|
|
394
|
+
</svg>
|
|
395
|
+
`;/**
|
|
396
|
+
* @license lucide-static v1.21.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const iT=`
|
|
401
|
+
<svg
|
|
402
|
+
class="lucide lucide-heading-6"
|
|
403
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
404
|
+
width="24"
|
|
405
|
+
height="24"
|
|
406
|
+
viewBox="0 0 24 24"
|
|
407
|
+
fill="none"
|
|
408
|
+
stroke="currentColor"
|
|
409
|
+
stroke-width="2"
|
|
410
|
+
stroke-linecap="round"
|
|
411
|
+
stroke-linejoin="round"
|
|
412
|
+
>
|
|
413
|
+
<path d="M4 12h8" />
|
|
414
|
+
<path d="M4 18V6" />
|
|
415
|
+
<path d="M12 18V6" />
|
|
416
|
+
<circle cx="19" cy="16" r="2" />
|
|
417
|
+
<path d="M20 10c-2 2-3 3.5-3 6" />
|
|
418
|
+
</svg>
|
|
419
|
+
`;/**
|
|
420
|
+
* @license lucide-static v1.21.0 - ISC
|
|
421
|
+
*
|
|
422
|
+
* This source code is licensed under the ISC license.
|
|
423
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
+
*/const mm=`
|
|
425
|
+
<svg
|
|
426
|
+
class="lucide lucide-image"
|
|
427
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
428
|
+
width="24"
|
|
429
|
+
height="24"
|
|
430
|
+
viewBox="0 0 24 24"
|
|
431
|
+
fill="none"
|
|
432
|
+
stroke="currentColor"
|
|
433
|
+
stroke-width="2"
|
|
434
|
+
stroke-linecap="round"
|
|
435
|
+
stroke-linejoin="round"
|
|
436
|
+
>
|
|
437
|
+
<rect width="18" height="18" x="3" y="3" rx="2" ry="2" />
|
|
438
|
+
<circle cx="9" cy="9" r="2" />
|
|
439
|
+
<path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />
|
|
440
|
+
</svg>
|
|
441
|
+
`;/**
|
|
442
|
+
* @license lucide-static v1.21.0 - ISC
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the ISC license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/const sT=`
|
|
447
|
+
<svg
|
|
448
|
+
class="lucide lucide-italic"
|
|
449
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
450
|
+
width="24"
|
|
451
|
+
height="24"
|
|
452
|
+
viewBox="0 0 24 24"
|
|
453
|
+
fill="none"
|
|
454
|
+
stroke="currentColor"
|
|
455
|
+
stroke-width="2"
|
|
456
|
+
stroke-linecap="round"
|
|
457
|
+
stroke-linejoin="round"
|
|
458
|
+
>
|
|
459
|
+
<line x1="19" x2="10" y1="4" y2="4" />
|
|
460
|
+
<line x1="14" x2="5" y1="20" y2="20" />
|
|
461
|
+
<line x1="15" x2="9" y1="4" y2="20" />
|
|
462
|
+
</svg>
|
|
463
|
+
`;/**
|
|
464
|
+
* @license lucide-static v1.21.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const oT=`
|
|
469
|
+
<svg
|
|
470
|
+
class="lucide lucide-link"
|
|
471
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
472
|
+
width="24"
|
|
473
|
+
height="24"
|
|
474
|
+
viewBox="0 0 24 24"
|
|
475
|
+
fill="none"
|
|
476
|
+
stroke="currentColor"
|
|
477
|
+
stroke-width="2"
|
|
478
|
+
stroke-linecap="round"
|
|
479
|
+
stroke-linejoin="round"
|
|
480
|
+
>
|
|
481
|
+
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
482
|
+
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
483
|
+
</svg>
|
|
484
|
+
`;/**
|
|
485
|
+
* @license lucide-static v1.21.0 - ISC
|
|
486
|
+
*
|
|
487
|
+
* This source code is licensed under the ISC license.
|
|
488
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
+
*/const aT=`
|
|
490
|
+
<svg
|
|
491
|
+
class="lucide lucide-list-ordered"
|
|
492
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
493
|
+
width="24"
|
|
494
|
+
height="24"
|
|
495
|
+
viewBox="0 0 24 24"
|
|
496
|
+
fill="none"
|
|
497
|
+
stroke="currentColor"
|
|
498
|
+
stroke-width="2"
|
|
499
|
+
stroke-linecap="round"
|
|
500
|
+
stroke-linejoin="round"
|
|
501
|
+
>
|
|
502
|
+
<path d="M11 5h10" />
|
|
503
|
+
<path d="M11 12h10" />
|
|
504
|
+
<path d="M11 19h10" />
|
|
505
|
+
<path d="M4 4h1v5" />
|
|
506
|
+
<path d="M4 9h2" />
|
|
507
|
+
<path d="M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" />
|
|
508
|
+
</svg>
|
|
509
|
+
`;/**
|
|
510
|
+
* @license lucide-static v1.21.0 - ISC
|
|
511
|
+
*
|
|
512
|
+
* This source code is licensed under the ISC license.
|
|
513
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
+
*/const lT=`
|
|
515
|
+
<svg
|
|
516
|
+
class="lucide lucide-list-todo"
|
|
517
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
518
|
+
width="24"
|
|
519
|
+
height="24"
|
|
520
|
+
viewBox="0 0 24 24"
|
|
521
|
+
fill="none"
|
|
522
|
+
stroke="currentColor"
|
|
523
|
+
stroke-width="2"
|
|
524
|
+
stroke-linecap="round"
|
|
525
|
+
stroke-linejoin="round"
|
|
526
|
+
>
|
|
527
|
+
<path d="M13 5h8" />
|
|
528
|
+
<path d="M13 12h8" />
|
|
529
|
+
<path d="M13 19h8" />
|
|
530
|
+
<path d="m3 17 2 2 4-4" />
|
|
531
|
+
<rect x="3" y="4" width="6" height="6" rx="1" />
|
|
532
|
+
</svg>
|
|
533
|
+
`;/**
|
|
534
|
+
* @license lucide-static v1.21.0 - ISC
|
|
535
|
+
*
|
|
536
|
+
* This source code is licensed under the ISC license.
|
|
537
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
+
*/const cT=`
|
|
539
|
+
<svg
|
|
540
|
+
class="lucide lucide-list"
|
|
541
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
542
|
+
width="24"
|
|
543
|
+
height="24"
|
|
544
|
+
viewBox="0 0 24 24"
|
|
545
|
+
fill="none"
|
|
546
|
+
stroke="currentColor"
|
|
547
|
+
stroke-width="2"
|
|
548
|
+
stroke-linecap="round"
|
|
549
|
+
stroke-linejoin="round"
|
|
550
|
+
>
|
|
551
|
+
<path d="M3 5h.01" />
|
|
552
|
+
<path d="M3 12h.01" />
|
|
553
|
+
<path d="M3 19h.01" />
|
|
554
|
+
<path d="M8 5h13" />
|
|
555
|
+
<path d="M8 12h13" />
|
|
556
|
+
<path d="M8 19h13" />
|
|
557
|
+
</svg>
|
|
558
|
+
`;/**
|
|
559
|
+
* @license lucide-static v1.21.0 - ISC
|
|
560
|
+
*
|
|
561
|
+
* This source code is licensed under the ISC license.
|
|
562
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
563
|
+
*/const uT=`
|
|
564
|
+
<svg
|
|
565
|
+
class="lucide lucide-minus"
|
|
566
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
567
|
+
width="24"
|
|
568
|
+
height="24"
|
|
569
|
+
viewBox="0 0 24 24"
|
|
570
|
+
fill="none"
|
|
571
|
+
stroke="currentColor"
|
|
572
|
+
stroke-width="2"
|
|
573
|
+
stroke-linecap="round"
|
|
574
|
+
stroke-linejoin="round"
|
|
575
|
+
>
|
|
576
|
+
<path d="M5 12h14" />
|
|
577
|
+
</svg>
|
|
578
|
+
`;/**
|
|
579
|
+
* @license lucide-static v1.21.0 - ISC
|
|
580
|
+
*
|
|
581
|
+
* This source code is licensed under the ISC license.
|
|
582
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
583
|
+
*/const u6=`
|
|
584
|
+
<svg
|
|
585
|
+
class="lucide lucide-pencil"
|
|
586
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
587
|
+
width="24"
|
|
588
|
+
height="24"
|
|
589
|
+
viewBox="0 0 24 24"
|
|
590
|
+
fill="none"
|
|
591
|
+
stroke="currentColor"
|
|
592
|
+
stroke-width="2"
|
|
593
|
+
stroke-linecap="round"
|
|
594
|
+
stroke-linejoin="round"
|
|
595
|
+
>
|
|
596
|
+
<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />
|
|
597
|
+
<path d="m15 5 4 4" />
|
|
598
|
+
</svg>
|
|
599
|
+
`;/**
|
|
600
|
+
* @license lucide-static v1.21.0 - ISC
|
|
601
|
+
*
|
|
602
|
+
* This source code is licensed under the ISC license.
|
|
603
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
604
|
+
*/const Qh=`
|
|
605
|
+
<svg
|
|
606
|
+
class="lucide lucide-plus"
|
|
607
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
608
|
+
width="24"
|
|
609
|
+
height="24"
|
|
610
|
+
viewBox="0 0 24 24"
|
|
611
|
+
fill="none"
|
|
612
|
+
stroke="currentColor"
|
|
613
|
+
stroke-width="2"
|
|
614
|
+
stroke-linecap="round"
|
|
615
|
+
stroke-linejoin="round"
|
|
616
|
+
>
|
|
617
|
+
<path d="M5 12h14" />
|
|
618
|
+
<path d="M12 5v14" />
|
|
619
|
+
</svg>
|
|
620
|
+
`;/**
|
|
621
|
+
* @license lucide-static v1.21.0 - ISC
|
|
622
|
+
*
|
|
623
|
+
* This source code is licensed under the ISC license.
|
|
624
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
625
|
+
*/const dT=`
|
|
626
|
+
<svg
|
|
627
|
+
class="lucide lucide-quote"
|
|
628
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
629
|
+
width="24"
|
|
630
|
+
height="24"
|
|
631
|
+
viewBox="0 0 24 24"
|
|
632
|
+
fill="none"
|
|
633
|
+
stroke="currentColor"
|
|
634
|
+
stroke-width="2"
|
|
635
|
+
stroke-linecap="round"
|
|
636
|
+
stroke-linejoin="round"
|
|
637
|
+
>
|
|
638
|
+
<path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z" />
|
|
639
|
+
<path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z" />
|
|
640
|
+
</svg>
|
|
641
|
+
`;/**
|
|
642
|
+
* @license lucide-static v1.21.0 - ISC
|
|
643
|
+
*
|
|
644
|
+
* This source code is licensed under the ISC license.
|
|
645
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
646
|
+
*/const hT=`
|
|
647
|
+
<svg
|
|
648
|
+
class="lucide lucide-search"
|
|
649
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
650
|
+
width="24"
|
|
651
|
+
height="24"
|
|
652
|
+
viewBox="0 0 24 24"
|
|
653
|
+
fill="none"
|
|
654
|
+
stroke="currentColor"
|
|
655
|
+
stroke-width="2"
|
|
656
|
+
stroke-linecap="round"
|
|
657
|
+
stroke-linejoin="round"
|
|
658
|
+
>
|
|
659
|
+
<path d="m21 21-4.34-4.34" />
|
|
660
|
+
<circle cx="11" cy="11" r="8" />
|
|
661
|
+
</svg>
|
|
662
|
+
`;/**
|
|
663
|
+
* @license lucide-static v1.21.0 - ISC
|
|
664
|
+
*
|
|
665
|
+
* This source code is licensed under the ISC license.
|
|
666
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
667
|
+
*/const fT=`
|
|
668
|
+
<svg
|
|
669
|
+
class="lucide lucide-square-check"
|
|
670
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
671
|
+
width="24"
|
|
672
|
+
height="24"
|
|
673
|
+
viewBox="0 0 24 24"
|
|
674
|
+
fill="none"
|
|
675
|
+
stroke="currentColor"
|
|
676
|
+
stroke-width="2"
|
|
677
|
+
stroke-linecap="round"
|
|
678
|
+
stroke-linejoin="round"
|
|
679
|
+
>
|
|
680
|
+
<rect width="18" height="18" x="3" y="3" rx="2" />
|
|
681
|
+
<path d="m9 12 2 2 4-4" />
|
|
682
|
+
</svg>
|
|
683
|
+
`;/**
|
|
684
|
+
* @license lucide-static v1.21.0 - ISC
|
|
685
|
+
*
|
|
686
|
+
* This source code is licensed under the ISC license.
|
|
687
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
688
|
+
*/const pT=`
|
|
689
|
+
<svg
|
|
690
|
+
class="lucide lucide-square-function"
|
|
691
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
692
|
+
width="24"
|
|
693
|
+
height="24"
|
|
694
|
+
viewBox="0 0 24 24"
|
|
695
|
+
fill="none"
|
|
696
|
+
stroke="currentColor"
|
|
697
|
+
stroke-width="2"
|
|
698
|
+
stroke-linecap="round"
|
|
699
|
+
stroke-linejoin="round"
|
|
700
|
+
>
|
|
701
|
+
<rect width="18" height="18" x="3" y="3" rx="2" ry="2" />
|
|
702
|
+
<path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3" />
|
|
703
|
+
<path d="M9 11.2h5.7" />
|
|
704
|
+
</svg>
|
|
705
|
+
`;/**
|
|
706
|
+
* @license lucide-static v1.21.0 - ISC
|
|
707
|
+
*
|
|
708
|
+
* This source code is licensed under the ISC license.
|
|
709
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
710
|
+
*/const mT=`
|
|
711
|
+
<svg
|
|
712
|
+
class="lucide lucide-square"
|
|
713
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
714
|
+
width="24"
|
|
715
|
+
height="24"
|
|
716
|
+
viewBox="0 0 24 24"
|
|
717
|
+
fill="none"
|
|
718
|
+
stroke="currentColor"
|
|
719
|
+
stroke-width="2"
|
|
720
|
+
stroke-linecap="round"
|
|
721
|
+
stroke-linejoin="round"
|
|
722
|
+
>
|
|
723
|
+
<rect width="18" height="18" x="3" y="3" rx="2" />
|
|
724
|
+
</svg>
|
|
725
|
+
`;/**
|
|
726
|
+
* @license lucide-static v1.21.0 - ISC
|
|
727
|
+
*
|
|
728
|
+
* This source code is licensed under the ISC license.
|
|
729
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
730
|
+
*/const gT=`
|
|
731
|
+
<svg
|
|
732
|
+
class="lucide lucide-strikethrough"
|
|
733
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
734
|
+
width="24"
|
|
735
|
+
height="24"
|
|
736
|
+
viewBox="0 0 24 24"
|
|
737
|
+
fill="none"
|
|
738
|
+
stroke="currentColor"
|
|
739
|
+
stroke-width="2"
|
|
740
|
+
stroke-linecap="round"
|
|
741
|
+
stroke-linejoin="round"
|
|
742
|
+
>
|
|
743
|
+
<path d="M16 4H9a3 3 0 0 0-2.83 4" />
|
|
744
|
+
<path d="M14 12a4 4 0 0 1 0 8H6" />
|
|
745
|
+
<line x1="4" x2="20" y1="12" y2="12" />
|
|
746
|
+
</svg>
|
|
747
|
+
`;/**
|
|
748
|
+
* @license lucide-static v1.21.0 - ISC
|
|
749
|
+
*
|
|
750
|
+
* This source code is licensed under the ISC license.
|
|
751
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
752
|
+
*/const yT=`
|
|
753
|
+
<svg
|
|
754
|
+
class="lucide lucide-table"
|
|
755
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
756
|
+
width="24"
|
|
757
|
+
height="24"
|
|
758
|
+
viewBox="0 0 24 24"
|
|
759
|
+
fill="none"
|
|
760
|
+
stroke="currentColor"
|
|
761
|
+
stroke-width="2"
|
|
762
|
+
stroke-linecap="round"
|
|
763
|
+
stroke-linejoin="round"
|
|
764
|
+
>
|
|
765
|
+
<path d="M12 3v18" />
|
|
766
|
+
<rect width="18" height="18" x="3" y="3" rx="2" />
|
|
767
|
+
<path d="M3 9h18" />
|
|
768
|
+
<path d="M3 15h18" />
|
|
769
|
+
</svg>
|
|
770
|
+
`;/**
|
|
771
|
+
* @license lucide-static v1.21.0 - ISC
|
|
772
|
+
*
|
|
773
|
+
* This source code is licensed under the ISC license.
|
|
774
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
775
|
+
*/const vT=`
|
|
776
|
+
<svg
|
|
777
|
+
class="lucide lucide-text-align-center"
|
|
778
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
779
|
+
width="24"
|
|
780
|
+
height="24"
|
|
781
|
+
viewBox="0 0 24 24"
|
|
782
|
+
fill="none"
|
|
783
|
+
stroke="currentColor"
|
|
784
|
+
stroke-width="2"
|
|
785
|
+
stroke-linecap="round"
|
|
786
|
+
stroke-linejoin="round"
|
|
787
|
+
>
|
|
788
|
+
<path d="M21 5H3" />
|
|
789
|
+
<path d="M17 12H7" />
|
|
790
|
+
<path d="M19 19H5" />
|
|
791
|
+
</svg>
|
|
792
|
+
`;/**
|
|
793
|
+
* @license lucide-static v1.21.0 - ISC
|
|
794
|
+
*
|
|
795
|
+
* This source code is licensed under the ISC license.
|
|
796
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
797
|
+
*/const bT=`
|
|
798
|
+
<svg
|
|
799
|
+
class="lucide lucide-text-align-end"
|
|
800
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
801
|
+
width="24"
|
|
802
|
+
height="24"
|
|
803
|
+
viewBox="0 0 24 24"
|
|
804
|
+
fill="none"
|
|
805
|
+
stroke="currentColor"
|
|
806
|
+
stroke-width="2"
|
|
807
|
+
stroke-linecap="round"
|
|
808
|
+
stroke-linejoin="round"
|
|
809
|
+
>
|
|
810
|
+
<path d="M21 5H3" />
|
|
811
|
+
<path d="M21 12H9" />
|
|
812
|
+
<path d="M21 19H7" />
|
|
813
|
+
</svg>
|
|
814
|
+
`;/**
|
|
815
|
+
* @license lucide-static v1.21.0 - ISC
|
|
816
|
+
*
|
|
817
|
+
* This source code is licensed under the ISC license.
|
|
818
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
819
|
+
*/const wT=`
|
|
820
|
+
<svg
|
|
821
|
+
class="lucide lucide-text-align-start"
|
|
822
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
823
|
+
width="24"
|
|
824
|
+
height="24"
|
|
825
|
+
viewBox="0 0 24 24"
|
|
826
|
+
fill="none"
|
|
827
|
+
stroke="currentColor"
|
|
828
|
+
stroke-width="2"
|
|
829
|
+
stroke-linecap="round"
|
|
830
|
+
stroke-linejoin="round"
|
|
831
|
+
>
|
|
832
|
+
<path d="M21 5H3" />
|
|
833
|
+
<path d="M15 12H3" />
|
|
834
|
+
<path d="M17 19H3" />
|
|
835
|
+
</svg>
|
|
836
|
+
`;/**
|
|
837
|
+
* @license lucide-static v1.21.0 - ISC
|
|
838
|
+
*
|
|
839
|
+
* This source code is licensed under the ISC license.
|
|
840
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
841
|
+
*/const ef=`
|
|
842
|
+
<svg
|
|
843
|
+
class="lucide lucide-trash-2"
|
|
844
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
845
|
+
width="24"
|
|
846
|
+
height="24"
|
|
847
|
+
viewBox="0 0 24 24"
|
|
848
|
+
fill="none"
|
|
849
|
+
stroke="currentColor"
|
|
850
|
+
stroke-width="2"
|
|
851
|
+
stroke-linecap="round"
|
|
852
|
+
stroke-linejoin="round"
|
|
853
|
+
>
|
|
854
|
+
<path d="M10 11v6" />
|
|
855
|
+
<path d="M14 11v6" />
|
|
856
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
|
|
857
|
+
<path d="M3 6h18" />
|
|
858
|
+
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
859
|
+
</svg>
|
|
860
|
+
`;/**
|
|
861
|
+
* @license lucide-static v1.21.0 - ISC
|
|
862
|
+
*
|
|
863
|
+
* This source code is licensed under the ISC license.
|
|
864
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
865
|
+
*/const kT=`
|
|
866
|
+
<svg
|
|
867
|
+
class="lucide lucide-type"
|
|
868
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
869
|
+
width="24"
|
|
870
|
+
height="24"
|
|
871
|
+
viewBox="0 0 24 24"
|
|
872
|
+
fill="none"
|
|
873
|
+
stroke="currentColor"
|
|
874
|
+
stroke-width="2"
|
|
875
|
+
stroke-linecap="round"
|
|
876
|
+
stroke-linejoin="round"
|
|
877
|
+
>
|
|
878
|
+
<path d="M12 4v16" />
|
|
879
|
+
<path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" />
|
|
880
|
+
<path d="M9 20h6" />
|
|
881
|
+
</svg>
|
|
882
|
+
`;/**
|
|
883
|
+
* @license lucide-static v1.21.0 - ISC
|
|
884
|
+
*
|
|
885
|
+
* This source code is licensed under the ISC license.
|
|
886
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
887
|
+
*/const xT=`
|
|
888
|
+
<svg
|
|
889
|
+
class="lucide lucide-workflow"
|
|
890
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
891
|
+
width="24"
|
|
892
|
+
height="24"
|
|
893
|
+
viewBox="0 0 24 24"
|
|
894
|
+
fill="none"
|
|
895
|
+
stroke="currentColor"
|
|
896
|
+
stroke-width="2"
|
|
897
|
+
stroke-linecap="round"
|
|
898
|
+
stroke-linejoin="round"
|
|
899
|
+
>
|
|
900
|
+
<rect width="8" height="8" x="3" y="3" rx="2" />
|
|
901
|
+
<path d="M7 11v4a2 2 0 0 0 2 2h4" />
|
|
902
|
+
<rect width="8" height="8" x="13" y="13" rx="2" />
|
|
903
|
+
</svg>
|
|
904
|
+
`;/**
|
|
905
|
+
* @license lucide-static v1.21.0 - ISC
|
|
906
|
+
*
|
|
907
|
+
* This source code is licensed under the ISC license.
|
|
908
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
909
|
+
*/const ST=`
|
|
910
|
+
<svg
|
|
911
|
+
class="lucide lucide-x"
|
|
912
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
913
|
+
width="24"
|
|
914
|
+
height="24"
|
|
915
|
+
viewBox="0 0 24 24"
|
|
916
|
+
fill="none"
|
|
917
|
+
stroke="currentColor"
|
|
918
|
+
stroke-width="2"
|
|
919
|
+
stroke-linecap="round"
|
|
920
|
+
stroke-linejoin="round"
|
|
921
|
+
>
|
|
922
|
+
<path d="M18 6 6 18" />
|
|
923
|
+
<path d="m6 6 12 12" />
|
|
924
|
+
</svg>
|
|
925
|
+
`;function CT(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:t,mathFlowValue:a,mathText:o,mathTextData:a}};function r(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function e(){this.buffer()}function t(){const l=this.resume(),c=this.stack[this.stack.length-1];es(c.type==="math"),c.meta=l}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),u=this.stack[this.stack.length-1];es(u.type==="math"),this.exit(l),u.value=c;const d=u.data.hChildren[0];es(d.type==="element"),es(d.tagName==="code"),d.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function o(l){const c=this.resume(),u=this.stack[this.stack.length-1];es(u.type==="inlineMath"),this.exit(l),u.value=c,u.data.hChildren.push({type:"text",value:c})}function a(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function MT(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
926
|
+
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(s,o,a,l){const c=s.value||"",u=a.createTracker(l),d="$".repeat(Math.max(j7(c,"$")+1,2)),h=a.enter("mathFlow");let f=u.move(d);if(s.meta){const m=a.enter("mathFlowMeta");f+=u.move(a.safe(s.meta,{after:`
|
|
927
|
+
`,before:f,encode:["$"],...u.current()})),m()}return f+=u.move(`
|
|
928
|
+
`),c&&(f+=u.move(c+`
|
|
929
|
+
`)),f+=u.move(d),h(),f}function n(s,o,a){let l=s.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<a.unsafe.length;){const h=a.unsafe[d];if(!h.atBreak)continue;const f=a.compilePattern(h);let m;for(;m=f.exec(l);){let y=m.index;l.codePointAt(y)===10&&l.codePointAt(y-1)===13&&y--,l=l.slice(0,y)+" "+l.slice(m.index+1)}}return u+l+u}function i(){return"$"}}const TT={tokenize:AT,concrete:!0,name:"mathFlow"},r4={tokenize:NT,partial:!0};function AT(r,e,t){const n=this,i=n.events[n.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return a;function a(k){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(k)}function l(k){return k===36?(r.consume(k),o++,l):o<2?t(k):(r.exit("mathFlowFenceSequence"),Tr(r,c,"whitespace")(k))}function c(k){return k===null||je(k)?d(k):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),u(k))}function u(k){return k===null||je(k)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),d(k)):k===36?t(k):(r.consume(k),u)}function d(k){return r.exit("mathFlowFence"),n.interrupt?e(k):r.attempt(r4,h,b)(k)}function h(k){return r.attempt({tokenize:v,partial:!0},b,f)(k)}function f(k){return(s?Tr(r,m,"linePrefix",s+1):m)(k)}function m(k){return k===null?b(k):je(k)?r.attempt(r4,h,b)(k):(r.enter("mathFlowValue"),y(k))}function y(k){return k===null||je(k)?(r.exit("mathFlowValue"),m(k)):(r.consume(k),y)}function b(k){return r.exit("mathFlow"),e(k)}function v(k,M,D){let O=0;return Tr(k,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function z(N){return k.enter("mathFlowFence"),k.enter("mathFlowFenceSequence"),T(N)}function T(N){return N===36?(O++,k.consume(N),T):O<o?D(N):(k.exit("mathFlowFenceSequence"),Tr(k,B,"whitespace")(N))}function B(N){return N===null||je(N)?(k.exit("mathFlowFence"),M(N)):D(N)}}}function NT(r,e,t){const n=this;return i;function i(o){return o===null?e(o):(r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?t(o):e(o)}}function ET(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:DT,previous:OT,name:"mathText"};function n(i,s,o){let a=0,l,c;return u;function u(y){return i.enter("mathText"),i.enter("mathTextSequence"),d(y)}function d(y){return y===36?(i.consume(y),a++,d):a<2&&!t?o(y):(i.exit("mathTextSequence"),h(y))}function h(y){return y===null?o(y):y===36?(c=i.enter("mathTextSequence"),l=0,m(y)):y===32?(i.enter("space"),i.consume(y),i.exit("space"),h):je(y)?(i.enter("lineEnding"),i.consume(y),i.exit("lineEnding"),h):(i.enter("mathTextData"),f(y))}function f(y){return y===null||y===32||y===36||je(y)?(i.exit("mathTextData"),h(y)):(i.consume(y),f)}function m(y){return y===36?(i.consume(y),l++,m):l===a?(i.exit("mathTextSequence"),i.exit("mathText"),s(y)):(c.type="mathTextData",f(y))}}}function DT(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)i===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(i=n):(n===e||r[n][1].type==="lineEnding")&&(r[i][1].type="mathTextData",n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return r}function OT(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function RT(r){return{flow:{36:TT},text:{36:ET(r)}}}const IT={};function zT(r){const e=this,t=r||IT,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(RT(t)),s.push(CT()),o.push(MT(t))}class Y extends Error{constructor(e,t){var n="KaTeX parse error: "+e,i,s,o=t&&t.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g,"$&̲"),c;i>15?c="…"+a.slice(i-15,i):c=a.slice(0,i);var u;s+15<a.length?u=a.slice(s,s+15)+"…":u=a.slice(s),n+=c+l+u}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Y.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var LT=/([A-Z])/g,BT=r=>r.replace(LT,"-$1").toLowerCase(),PT={"&":"&",">":">","<":"<",'"':""","'":"'"},FT=/[&><"']/g,Nt=r=>String(r).replace(FT,e=>PT[e]),A0=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?A0(r.body[0]):r:r.type==="font"?A0(r.body):r,$T=new Set(["mathord","textord","atom"]),Wn=r=>$T.has(A0(r).type),qT=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},tf={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function HT(r){if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function _T(r){if(r.default!==void 0)return r.default;var e=Array.isArray(r.type)?r.type[0]:r.type;return HT(e)}function jT(r,e,t,n){var i=t[e];r[e]=i!==void 0?n.processor?n.processor(i):i:_T(n)}class gm{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t of Object.keys(tf)){var n=tf[t];n&&jT(this,t,e,n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Y("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=qT(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class ei{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return nn[VT[this.id]]}sub(){return nn[WT[this.id]]}fracNum(){return nn[UT[this.id]]}fracDen(){return nn[KT[this.id]]}cramp(){return nn[GT[this.id]]}text(){return nn[JT[this.id]]}isTight(){return this.size>=2}}var ym=0,_0=1,wo=2,_n=3,Sl=4,Ar=5,ha=6,Ft=7,nn=[new ei(ym,0,!1),new ei(_0,0,!0),new ei(wo,1,!1),new ei(_n,1,!0),new ei(Sl,2,!1),new ei(Ar,2,!0),new ei(ha,3,!1),new ei(Ft,3,!0)],VT=[Sl,Ar,Sl,Ar,ha,Ft,ha,Ft],WT=[Ar,Ar,Ar,Ar,Ft,Ft,Ft,Ft],UT=[wo,_n,Sl,Ar,ha,Ft,ha,Ft],KT=[_n,_n,Ar,Ar,Ft,Ft,Ft,Ft],GT=[_0,_0,_n,_n,Ar,Ar,Ft,Ft],JT=[ym,_0,wo,_n,wo,_n,wo,_n],ye={DISPLAY:nn[ym],TEXT:nn[wo],SCRIPT:nn[Sl],SCRIPTSCRIPT:nn[ha]},rf=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function YT(r){for(var e=0;e<rf.length;e++)for(var t=rf[e],n=0;n<t.blocks.length;n++){var i=t.blocks[n];if(r>=i[0]&&r<=i[1])return t.name}return null}var N0=[];rf.forEach(r=>r.blocks.forEach(e=>N0.push(...e)));function d6(r){for(var e=0;e<N0.length;e+=2)if(r>=N0[e]&&r<=N0[e+1])return!0;return!1}var ct=r=>r+" "+r,no=80,XT=function(e,t){return"M95,"+(622+e+t)+`
|
|
930
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
931
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
932
|
+
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
933
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
934
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
935
|
+
l`+e/2.075+" -"+e+`
|
|
936
|
+
c5.3,-9.3,12,-14,20,-14
|
|
937
|
+
H400000v`+(40+e)+`H845.2724
|
|
938
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
939
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
940
|
+
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ZT=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
941
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
942
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
943
|
+
l`+e/2.084+" -"+e+`
|
|
944
|
+
c4.7,-7.3,11,-11,19,-11
|
|
945
|
+
H40000v`+(40+e)+`H1012.3
|
|
946
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
947
|
+
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
948
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
949
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
950
|
+
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},QT=function(e,t){return"M983 "+(10+e+t)+`
|
|
951
|
+
l`+e/3.13+" -"+e+`
|
|
952
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
953
|
+
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
954
|
+
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
955
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
956
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
957
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
958
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
959
|
+
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},eA=function(e,t){return"M424,"+(2398+e+t)+`
|
|
960
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
961
|
+
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
962
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
963
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
964
|
+
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
965
|
+
v`+(40+e)+`H1014.6
|
|
966
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
967
|
+
c-2,6,-10,9,-24,9
|
|
968
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
|
|
969
|
+
h400000v`+(40+e)+"h-400000z"},tA=function(e,t){return"M473,"+(2713+e+t)+`
|
|
970
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|
971
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
972
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
973
|
+
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
974
|
+
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
975
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
976
|
+
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},rA=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},nA=function(e,t,n){var i=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
|
|
977
|
+
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
978
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
979
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
980
|
+
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},iA=function(e,t,n){t=1e3*t;var i="";switch(e){case"sqrtMain":i=XT(t,no);break;case"sqrtSize1":i=ZT(t,no);break;case"sqrtSize2":i=QT(t,no);break;case"sqrtSize3":i=eA(t,no);break;case"sqrtSize4":i=tA(t,no);break;case"sqrtTall":i=nA(t,no,n)}return i},sA=function(e,t){switch(e){case"⎜":return ct("M291 0 H417 V"+t+" H291z");case"∣":return ct("M145 0 H188 V"+t+" H145z");case"∥":return ct("M145 0 H188 V"+t+" H145z")+ct("M367 0 H410 V"+t+" H367z");case"⎟":return ct("M457 0 H583 V"+t+" H457z");case"⎢":return ct("M319 0 H403 V"+t+" H319z");case"⎥":return ct("M263 0 H347 V"+t+" H263z");case"⎪":return ct("M384 0 H504 V"+t+" H384z");case"⏐":return ct("M312 0 H355 V"+t+" H312z");case"‖":return ct("M257 0 H300 V"+t+" H257z")+ct("M478 0 H521 V"+t+" H478z");default:return""}},n4={doubleleftarrow:`M262 157
|
|
981
|
+
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
982
|
+
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
983
|
+
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
984
|
+
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
985
|
+
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
986
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
987
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
988
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
989
|
+
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
990
|
+
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
991
|
+
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
992
|
+
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
993
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
994
|
+
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
995
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
996
|
+
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
997
|
+
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
998
|
+
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
999
|
+
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
1000
|
+
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
1001
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
1002
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
1003
|
+
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
1004
|
+
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
1005
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
1006
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
1007
|
+
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
1008
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
1009
|
+
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
1010
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
1011
|
+
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
1012
|
+
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
1013
|
+
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
1014
|
+
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
1015
|
+
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
1016
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
1017
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
1018
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
1019
|
+
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
1020
|
+
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
1021
|
+
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
1022
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
1023
|
+
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
1024
|
+
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
1025
|
+
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
1026
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:ct("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:ct("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:ct("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:ct("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
1027
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
1028
|
+
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
1029
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:ct("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
1030
|
+
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
1031
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
1032
|
+
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
1033
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
1034
|
+
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
1035
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
1036
|
+
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
1037
|
+
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
1038
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
1039
|
+
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
1040
|
+
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
1041
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
1042
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
1043
|
+
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
1044
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
1045
|
+
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
1046
|
+
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
1047
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
1048
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
1049
|
+
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
1050
|
+
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
1051
|
+
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
1052
|
+
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
1053
|
+
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
1054
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
1055
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
1056
|
+
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
1057
|
+
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
1058
|
+
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
1059
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
1060
|
+
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
1061
|
+
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
1062
|
+
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
1063
|
+
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
1064
|
+
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
1065
|
+
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
1066
|
+
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
1067
|
+
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
1068
|
+
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
1069
|
+
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
1070
|
+
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
1071
|
+
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
1072
|
+
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
1073
|
+
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
1074
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
1075
|
+
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
1076
|
+
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
1077
|
+
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
1078
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:ct("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:ct("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:ct("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
1079
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
1080
|
+
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
1081
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
1082
|
+
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
1083
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
1084
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
1085
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
1086
|
+
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
1087
|
+
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
1088
|
+
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
1089
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
1090
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
1091
|
+
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
1092
|
+
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
1093
|
+
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
1094
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
1095
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
1096
|
+
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
1097
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
1098
|
+
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
1099
|
+
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
1100
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
1101
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
1102
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
1103
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
1104
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
1105
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
1106
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
1107
|
+
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
1108
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
1109
|
+
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
1110
|
+
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
1111
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
1112
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
1113
|
+
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
1114
|
+
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
1115
|
+
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
1116
|
+
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
1117
|
+
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
1118
|
+
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
1119
|
+
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
1120
|
+
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
1121
|
+
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
1122
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
1123
|
+
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
1124
|
+
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
1125
|
+
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
1126
|
+
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
1127
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
1128
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
1129
|
+
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
1130
|
+
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
1131
|
+
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
1132
|
+
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
1133
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
1134
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
1135
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
1136
|
+
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
1137
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
1138
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
1139
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
1140
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
1141
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
1142
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
1143
|
+
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
1144
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
1145
|
+
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
1146
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
1147
|
+
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
1148
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
1149
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
1150
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
1151
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},oA=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84
|
|
1152
|
+
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
|
|
1153
|
+
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
|
1154
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
1155
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
|
1156
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
1157
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
|
1158
|
+
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
1159
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
1160
|
+
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
|
|
1161
|
+
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
|
|
1162
|
+
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
|
|
1163
|
+
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
|
|
1164
|
+
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
1165
|
+
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
1166
|
+
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
1167
|
+
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
1168
|
+
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
1169
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
1170
|
+
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
1171
|
+
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
1172
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
1173
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
|
1174
|
+
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
1175
|
+
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
1176
|
+
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
1177
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
1178
|
+
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
1179
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function aA(r){return"toText"in r}class Ma{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(aA(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var nf={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},lA={ex:!0,em:!0,mu:!0},h6=function(e){return typeof e!="string"&&(e=e.unit),e in nf||e in lA||e==="ex"},Ge=function(e,t){var n;if(e.unit in nf)n=nf[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Y("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Q=function(e){return+e.toFixed(4)+"em"},Ni=function(e){return e.filter(t=>t).join(" ")},vm=function(e){var t="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(t+=BT(n)+":"+i+";")}return t},f6=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},p6=function(e){var t=document.createElement(e);t.className=Ni(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},cA=/[\s"'>/=\x00-\x1f]/,m6=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Nt(Ni(this.classes))+'"');var n=vm(this.style);n&&(t+=' style="'+Nt(n)+'"');for(var i of Object.keys(this.attributes)){if(cA.test(i))throw new Y("Invalid attribute name '"+i+"'");t+=" "+i+'="'+Nt(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class Ta{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,f6.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return p6.call(this,"span")}toMarkup(){return m6.call(this,"span")}}class Tu{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,f6.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return p6.call(this,"a")}toMarkup(){return m6.call(this,"a")}}class uA{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Nt(this.src)+'"'+(' alt="'+Nt(this.alt)+'"'),t=vm(this.style);return t&&(e+=' style="'+Nt(t)+'"'),e+="'/>",e}}var dA={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class hr{constructor(e,t,n,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var c=YT(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=dA[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement("span"),t.style.marginRight=Q(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Ni(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Nt(Ni(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+Q(this.italic)+";"),n+=vm(this.style),n&&(e=!0,t+=' style="'+Nt(n)+'"');var i=Nt(this.text);return e?(t+=">",t+=i,t+="</span>",t):i}}class jn{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Nt(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class Ei{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",n4[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+Nt(this.alternate)+'"/>':'<path d="'+Nt(n4[this.pathName])+'"/>'}}class sf{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Nt(this.attributes[t])+'"';return e+="/>",e}}function hA(r){if(r instanceof hr)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function fA(r){if(r instanceof Ta)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var pA=r=>r instanceof Ta||r instanceof Tu||r instanceof Ma,an={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},e0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},i4={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function mA(r,e){an[r]=e}function bm(r,e,t){if(!an[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=an[e][n];if(!i&&r[0]in i4&&(n=i4[r[0]].charCodeAt(0),i=an[e][n]),!i&&t==="text"&&d6(n)&&(i=an[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var qd={};function gA(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!qd[e]){var t=qd[e]={cssEmPerMu:e0.quad[e]/18};for(var n in e0)e0.hasOwnProperty(n)&&(t[n]=e0[n][e])}return qd[e]}var We={math:{},text:{}};function p(r,e,t,n,i,s){We[r][i]={font:e,group:t,replace:n},s&&n&&(We[r][n]=We[r][i])}var g="math",W="text",w="main",A="ams",Ue="accent-token",ie="bin",jt="close",Aa="inner",ue="mathord",at="op-token",mr="open",Dc="punct",E="rel",Un="spacing",I="textord";p(g,w,E,"≡","\\equiv",!0);p(g,w,E,"≺","\\prec",!0);p(g,w,E,"≻","\\succ",!0);p(g,w,E,"∼","\\sim",!0);p(g,w,E,"⊥","\\perp");p(g,w,E,"⪯","\\preceq",!0);p(g,w,E,"⪰","\\succeq",!0);p(g,w,E,"≃","\\simeq",!0);p(g,w,E,"∣","\\mid",!0);p(g,w,E,"≪","\\ll",!0);p(g,w,E,"≫","\\gg",!0);p(g,w,E,"≍","\\asymp",!0);p(g,w,E,"∥","\\parallel");p(g,w,E,"⋈","\\bowtie",!0);p(g,w,E,"⌣","\\smile",!0);p(g,w,E,"⊑","\\sqsubseteq",!0);p(g,w,E,"⊒","\\sqsupseteq",!0);p(g,w,E,"≐","\\doteq",!0);p(g,w,E,"⌢","\\frown",!0);p(g,w,E,"∋","\\ni",!0);p(g,w,E,"∝","\\propto",!0);p(g,w,E,"⊢","\\vdash",!0);p(g,w,E,"⊣","\\dashv",!0);p(g,w,E,"∋","\\owns");p(g,w,Dc,".","\\ldotp");p(g,w,Dc,"⋅","\\cdotp");p(g,w,Dc,"⋅","·");p(W,w,I,"⋅","·");p(g,w,I,"#","\\#");p(W,w,I,"#","\\#");p(g,w,I,"&","\\&");p(W,w,I,"&","\\&");p(g,w,I,"ℵ","\\aleph",!0);p(g,w,I,"∀","\\forall",!0);p(g,w,I,"ℏ","\\hbar",!0);p(g,w,I,"∃","\\exists",!0);p(g,w,I,"∇","\\nabla",!0);p(g,w,I,"♭","\\flat",!0);p(g,w,I,"ℓ","\\ell",!0);p(g,w,I,"♮","\\natural",!0);p(g,w,I,"♣","\\clubsuit",!0);p(g,w,I,"℘","\\wp",!0);p(g,w,I,"♯","\\sharp",!0);p(g,w,I,"♢","\\diamondsuit",!0);p(g,w,I,"ℜ","\\Re",!0);p(g,w,I,"♡","\\heartsuit",!0);p(g,w,I,"ℑ","\\Im",!0);p(g,w,I,"♠","\\spadesuit",!0);p(g,w,I,"§","\\S",!0);p(W,w,I,"§","\\S");p(g,w,I,"¶","\\P",!0);p(W,w,I,"¶","\\P");p(g,w,I,"†","\\dag");p(W,w,I,"†","\\dag");p(W,w,I,"†","\\textdagger");p(g,w,I,"‡","\\ddag");p(W,w,I,"‡","\\ddag");p(W,w,I,"‡","\\textdaggerdbl");p(g,w,jt,"⎱","\\rmoustache",!0);p(g,w,mr,"⎰","\\lmoustache",!0);p(g,w,jt,"⟯","\\rgroup",!0);p(g,w,mr,"⟮","\\lgroup",!0);p(g,w,ie,"∓","\\mp",!0);p(g,w,ie,"⊖","\\ominus",!0);p(g,w,ie,"⊎","\\uplus",!0);p(g,w,ie,"⊓","\\sqcap",!0);p(g,w,ie,"∗","\\ast");p(g,w,ie,"⊔","\\sqcup",!0);p(g,w,ie,"◯","\\bigcirc",!0);p(g,w,ie,"∙","\\bullet",!0);p(g,w,ie,"‡","\\ddagger");p(g,w,ie,"≀","\\wr",!0);p(g,w,ie,"⨿","\\amalg");p(g,w,ie,"&","\\And");p(g,w,E,"⟵","\\longleftarrow",!0);p(g,w,E,"⇐","\\Leftarrow",!0);p(g,w,E,"⟸","\\Longleftarrow",!0);p(g,w,E,"⟶","\\longrightarrow",!0);p(g,w,E,"⇒","\\Rightarrow",!0);p(g,w,E,"⟹","\\Longrightarrow",!0);p(g,w,E,"↔","\\leftrightarrow",!0);p(g,w,E,"⟷","\\longleftrightarrow",!0);p(g,w,E,"⇔","\\Leftrightarrow",!0);p(g,w,E,"⟺","\\Longleftrightarrow",!0);p(g,w,E,"↦","\\mapsto",!0);p(g,w,E,"⟼","\\longmapsto",!0);p(g,w,E,"↗","\\nearrow",!0);p(g,w,E,"↩","\\hookleftarrow",!0);p(g,w,E,"↪","\\hookrightarrow",!0);p(g,w,E,"↘","\\searrow",!0);p(g,w,E,"↼","\\leftharpoonup",!0);p(g,w,E,"⇀","\\rightharpoonup",!0);p(g,w,E,"↙","\\swarrow",!0);p(g,w,E,"↽","\\leftharpoondown",!0);p(g,w,E,"⇁","\\rightharpoondown",!0);p(g,w,E,"↖","\\nwarrow",!0);p(g,w,E,"⇌","\\rightleftharpoons",!0);p(g,A,E,"≮","\\nless",!0);p(g,A,E,"","\\@nleqslant");p(g,A,E,"","\\@nleqq");p(g,A,E,"⪇","\\lneq",!0);p(g,A,E,"≨","\\lneqq",!0);p(g,A,E,"","\\@lvertneqq");p(g,A,E,"⋦","\\lnsim",!0);p(g,A,E,"⪉","\\lnapprox",!0);p(g,A,E,"⊀","\\nprec",!0);p(g,A,E,"⋠","\\npreceq",!0);p(g,A,E,"⋨","\\precnsim",!0);p(g,A,E,"⪹","\\precnapprox",!0);p(g,A,E,"≁","\\nsim",!0);p(g,A,E,"","\\@nshortmid");p(g,A,E,"∤","\\nmid",!0);p(g,A,E,"⊬","\\nvdash",!0);p(g,A,E,"⊭","\\nvDash",!0);p(g,A,E,"⋪","\\ntriangleleft");p(g,A,E,"⋬","\\ntrianglelefteq",!0);p(g,A,E,"⊊","\\subsetneq",!0);p(g,A,E,"","\\@varsubsetneq");p(g,A,E,"⫋","\\subsetneqq",!0);p(g,A,E,"","\\@varsubsetneqq");p(g,A,E,"≯","\\ngtr",!0);p(g,A,E,"","\\@ngeqslant");p(g,A,E,"","\\@ngeqq");p(g,A,E,"⪈","\\gneq",!0);p(g,A,E,"≩","\\gneqq",!0);p(g,A,E,"","\\@gvertneqq");p(g,A,E,"⋧","\\gnsim",!0);p(g,A,E,"⪊","\\gnapprox",!0);p(g,A,E,"⊁","\\nsucc",!0);p(g,A,E,"⋡","\\nsucceq",!0);p(g,A,E,"⋩","\\succnsim",!0);p(g,A,E,"⪺","\\succnapprox",!0);p(g,A,E,"≆","\\ncong",!0);p(g,A,E,"","\\@nshortparallel");p(g,A,E,"∦","\\nparallel",!0);p(g,A,E,"⊯","\\nVDash",!0);p(g,A,E,"⋫","\\ntriangleright");p(g,A,E,"⋭","\\ntrianglerighteq",!0);p(g,A,E,"","\\@nsupseteqq");p(g,A,E,"⊋","\\supsetneq",!0);p(g,A,E,"","\\@varsupsetneq");p(g,A,E,"⫌","\\supsetneqq",!0);p(g,A,E,"","\\@varsupsetneqq");p(g,A,E,"⊮","\\nVdash",!0);p(g,A,E,"⪵","\\precneqq",!0);p(g,A,E,"⪶","\\succneqq",!0);p(g,A,E,"","\\@nsubseteqq");p(g,A,ie,"⊴","\\unlhd");p(g,A,ie,"⊵","\\unrhd");p(g,A,E,"↚","\\nleftarrow",!0);p(g,A,E,"↛","\\nrightarrow",!0);p(g,A,E,"⇍","\\nLeftarrow",!0);p(g,A,E,"⇏","\\nRightarrow",!0);p(g,A,E,"↮","\\nleftrightarrow",!0);p(g,A,E,"⇎","\\nLeftrightarrow",!0);p(g,A,E,"△","\\vartriangle");p(g,A,I,"ℏ","\\hslash");p(g,A,I,"▽","\\triangledown");p(g,A,I,"◊","\\lozenge");p(g,A,I,"Ⓢ","\\circledS");p(g,A,I,"®","\\circledR");p(W,A,I,"®","\\circledR");p(g,A,I,"∡","\\measuredangle",!0);p(g,A,I,"∄","\\nexists");p(g,A,I,"℧","\\mho");p(g,A,I,"Ⅎ","\\Finv",!0);p(g,A,I,"⅁","\\Game",!0);p(g,A,I,"‵","\\backprime");p(g,A,I,"▲","\\blacktriangle");p(g,A,I,"▼","\\blacktriangledown");p(g,A,I,"■","\\blacksquare");p(g,A,I,"⧫","\\blacklozenge");p(g,A,I,"★","\\bigstar");p(g,A,I,"∢","\\sphericalangle",!0);p(g,A,I,"∁","\\complement",!0);p(g,A,I,"ð","\\eth",!0);p(W,w,I,"ð","ð");p(g,A,I,"╱","\\diagup");p(g,A,I,"╲","\\diagdown");p(g,A,I,"□","\\square");p(g,A,I,"□","\\Box");p(g,A,I,"◊","\\Diamond");p(g,A,I,"¥","\\yen",!0);p(W,A,I,"¥","\\yen",!0);p(g,A,I,"✓","\\checkmark",!0);p(W,A,I,"✓","\\checkmark");p(g,A,I,"ℶ","\\beth",!0);p(g,A,I,"ℸ","\\daleth",!0);p(g,A,I,"ℷ","\\gimel",!0);p(g,A,I,"ϝ","\\digamma",!0);p(g,A,I,"ϰ","\\varkappa");p(g,A,mr,"┌","\\@ulcorner",!0);p(g,A,jt,"┐","\\@urcorner",!0);p(g,A,mr,"└","\\@llcorner",!0);p(g,A,jt,"┘","\\@lrcorner",!0);p(g,A,E,"≦","\\leqq",!0);p(g,A,E,"⩽","\\leqslant",!0);p(g,A,E,"⪕","\\eqslantless",!0);p(g,A,E,"≲","\\lesssim",!0);p(g,A,E,"⪅","\\lessapprox",!0);p(g,A,E,"≊","\\approxeq",!0);p(g,A,ie,"⋖","\\lessdot");p(g,A,E,"⋘","\\lll",!0);p(g,A,E,"≶","\\lessgtr",!0);p(g,A,E,"⋚","\\lesseqgtr",!0);p(g,A,E,"⪋","\\lesseqqgtr",!0);p(g,A,E,"≑","\\doteqdot");p(g,A,E,"≓","\\risingdotseq",!0);p(g,A,E,"≒","\\fallingdotseq",!0);p(g,A,E,"∽","\\backsim",!0);p(g,A,E,"⋍","\\backsimeq",!0);p(g,A,E,"⫅","\\subseteqq",!0);p(g,A,E,"⋐","\\Subset",!0);p(g,A,E,"⊏","\\sqsubset",!0);p(g,A,E,"≼","\\preccurlyeq",!0);p(g,A,E,"⋞","\\curlyeqprec",!0);p(g,A,E,"≾","\\precsim",!0);p(g,A,E,"⪷","\\precapprox",!0);p(g,A,E,"⊲","\\vartriangleleft");p(g,A,E,"⊴","\\trianglelefteq");p(g,A,E,"⊨","\\vDash",!0);p(g,A,E,"⊪","\\Vvdash",!0);p(g,A,E,"⌣","\\smallsmile");p(g,A,E,"⌢","\\smallfrown");p(g,A,E,"≏","\\bumpeq",!0);p(g,A,E,"≎","\\Bumpeq",!0);p(g,A,E,"≧","\\geqq",!0);p(g,A,E,"⩾","\\geqslant",!0);p(g,A,E,"⪖","\\eqslantgtr",!0);p(g,A,E,"≳","\\gtrsim",!0);p(g,A,E,"⪆","\\gtrapprox",!0);p(g,A,ie,"⋗","\\gtrdot");p(g,A,E,"⋙","\\ggg",!0);p(g,A,E,"≷","\\gtrless",!0);p(g,A,E,"⋛","\\gtreqless",!0);p(g,A,E,"⪌","\\gtreqqless",!0);p(g,A,E,"≖","\\eqcirc",!0);p(g,A,E,"≗","\\circeq",!0);p(g,A,E,"≜","\\triangleq",!0);p(g,A,E,"∼","\\thicksim");p(g,A,E,"≈","\\thickapprox");p(g,A,E,"⫆","\\supseteqq",!0);p(g,A,E,"⋑","\\Supset",!0);p(g,A,E,"⊐","\\sqsupset",!0);p(g,A,E,"≽","\\succcurlyeq",!0);p(g,A,E,"⋟","\\curlyeqsucc",!0);p(g,A,E,"≿","\\succsim",!0);p(g,A,E,"⪸","\\succapprox",!0);p(g,A,E,"⊳","\\vartriangleright");p(g,A,E,"⊵","\\trianglerighteq");p(g,A,E,"⊩","\\Vdash",!0);p(g,A,E,"∣","\\shortmid");p(g,A,E,"∥","\\shortparallel");p(g,A,E,"≬","\\between",!0);p(g,A,E,"⋔","\\pitchfork",!0);p(g,A,E,"∝","\\varpropto");p(g,A,E,"◀","\\blacktriangleleft");p(g,A,E,"∴","\\therefore",!0);p(g,A,E,"∍","\\backepsilon");p(g,A,E,"▶","\\blacktriangleright");p(g,A,E,"∵","\\because",!0);p(g,A,E,"⋘","\\llless");p(g,A,E,"⋙","\\gggtr");p(g,A,ie,"⊲","\\lhd");p(g,A,ie,"⊳","\\rhd");p(g,A,E,"≂","\\eqsim",!0);p(g,w,E,"⋈","\\Join");p(g,A,E,"≑","\\Doteq",!0);p(g,A,ie,"∔","\\dotplus",!0);p(g,A,ie,"∖","\\smallsetminus");p(g,A,ie,"⋒","\\Cap",!0);p(g,A,ie,"⋓","\\Cup",!0);p(g,A,ie,"⩞","\\doublebarwedge",!0);p(g,A,ie,"⊟","\\boxminus",!0);p(g,A,ie,"⊞","\\boxplus",!0);p(g,A,ie,"⋇","\\divideontimes",!0);p(g,A,ie,"⋉","\\ltimes",!0);p(g,A,ie,"⋊","\\rtimes",!0);p(g,A,ie,"⋋","\\leftthreetimes",!0);p(g,A,ie,"⋌","\\rightthreetimes",!0);p(g,A,ie,"⋏","\\curlywedge",!0);p(g,A,ie,"⋎","\\curlyvee",!0);p(g,A,ie,"⊝","\\circleddash",!0);p(g,A,ie,"⊛","\\circledast",!0);p(g,A,ie,"⋅","\\centerdot");p(g,A,ie,"⊺","\\intercal",!0);p(g,A,ie,"⋒","\\doublecap");p(g,A,ie,"⋓","\\doublecup");p(g,A,ie,"⊠","\\boxtimes",!0);p(g,A,E,"⇢","\\dashrightarrow",!0);p(g,A,E,"⇠","\\dashleftarrow",!0);p(g,A,E,"⇇","\\leftleftarrows",!0);p(g,A,E,"⇆","\\leftrightarrows",!0);p(g,A,E,"⇚","\\Lleftarrow",!0);p(g,A,E,"↞","\\twoheadleftarrow",!0);p(g,A,E,"↢","\\leftarrowtail",!0);p(g,A,E,"↫","\\looparrowleft",!0);p(g,A,E,"⇋","\\leftrightharpoons",!0);p(g,A,E,"↶","\\curvearrowleft",!0);p(g,A,E,"↺","\\circlearrowleft",!0);p(g,A,E,"↰","\\Lsh",!0);p(g,A,E,"⇈","\\upuparrows",!0);p(g,A,E,"↿","\\upharpoonleft",!0);p(g,A,E,"⇃","\\downharpoonleft",!0);p(g,w,E,"⊶","\\origof",!0);p(g,w,E,"⊷","\\imageof",!0);p(g,A,E,"⊸","\\multimap",!0);p(g,A,E,"↭","\\leftrightsquigarrow",!0);p(g,A,E,"⇉","\\rightrightarrows",!0);p(g,A,E,"⇄","\\rightleftarrows",!0);p(g,A,E,"↠","\\twoheadrightarrow",!0);p(g,A,E,"↣","\\rightarrowtail",!0);p(g,A,E,"↬","\\looparrowright",!0);p(g,A,E,"↷","\\curvearrowright",!0);p(g,A,E,"↻","\\circlearrowright",!0);p(g,A,E,"↱","\\Rsh",!0);p(g,A,E,"⇊","\\downdownarrows",!0);p(g,A,E,"↾","\\upharpoonright",!0);p(g,A,E,"⇂","\\downharpoonright",!0);p(g,A,E,"⇝","\\rightsquigarrow",!0);p(g,A,E,"⇝","\\leadsto");p(g,A,E,"⇛","\\Rrightarrow",!0);p(g,A,E,"↾","\\restriction");p(g,w,I,"‘","`");p(g,w,I,"$","\\$");p(W,w,I,"$","\\$");p(W,w,I,"$","\\textdollar");p(g,w,I,"%","\\%");p(W,w,I,"%","\\%");p(g,w,I,"_","\\_");p(W,w,I,"_","\\_");p(W,w,I,"_","\\textunderscore");p(g,w,I,"∠","\\angle",!0);p(g,w,I,"∞","\\infty",!0);p(g,w,I,"′","\\prime");p(g,w,I,"△","\\triangle");p(g,w,I,"Γ","\\Gamma",!0);p(g,w,I,"Δ","\\Delta",!0);p(g,w,I,"Θ","\\Theta",!0);p(g,w,I,"Λ","\\Lambda",!0);p(g,w,I,"Ξ","\\Xi",!0);p(g,w,I,"Π","\\Pi",!0);p(g,w,I,"Σ","\\Sigma",!0);p(g,w,I,"Υ","\\Upsilon",!0);p(g,w,I,"Φ","\\Phi",!0);p(g,w,I,"Ψ","\\Psi",!0);p(g,w,I,"Ω","\\Omega",!0);p(g,w,I,"A","Α");p(g,w,I,"B","Β");p(g,w,I,"E","Ε");p(g,w,I,"Z","Ζ");p(g,w,I,"H","Η");p(g,w,I,"I","Ι");p(g,w,I,"K","Κ");p(g,w,I,"M","Μ");p(g,w,I,"N","Ν");p(g,w,I,"O","Ο");p(g,w,I,"P","Ρ");p(g,w,I,"T","Τ");p(g,w,I,"X","Χ");p(g,w,I,"¬","\\neg",!0);p(g,w,I,"¬","\\lnot");p(g,w,I,"⊤","\\top");p(g,w,I,"⊥","\\bot");p(g,w,I,"∅","\\emptyset");p(g,A,I,"∅","\\varnothing");p(g,w,ue,"α","\\alpha",!0);p(g,w,ue,"β","\\beta",!0);p(g,w,ue,"γ","\\gamma",!0);p(g,w,ue,"δ","\\delta",!0);p(g,w,ue,"ϵ","\\epsilon",!0);p(g,w,ue,"ζ","\\zeta",!0);p(g,w,ue,"η","\\eta",!0);p(g,w,ue,"θ","\\theta",!0);p(g,w,ue,"ι","\\iota",!0);p(g,w,ue,"κ","\\kappa",!0);p(g,w,ue,"λ","\\lambda",!0);p(g,w,ue,"μ","\\mu",!0);p(g,w,ue,"ν","\\nu",!0);p(g,w,ue,"ξ","\\xi",!0);p(g,w,ue,"ο","\\omicron",!0);p(g,w,ue,"π","\\pi",!0);p(g,w,ue,"ρ","\\rho",!0);p(g,w,ue,"σ","\\sigma",!0);p(g,w,ue,"τ","\\tau",!0);p(g,w,ue,"υ","\\upsilon",!0);p(g,w,ue,"ϕ","\\phi",!0);p(g,w,ue,"χ","\\chi",!0);p(g,w,ue,"ψ","\\psi",!0);p(g,w,ue,"ω","\\omega",!0);p(g,w,ue,"ε","\\varepsilon",!0);p(g,w,ue,"ϑ","\\vartheta",!0);p(g,w,ue,"ϖ","\\varpi",!0);p(g,w,ue,"ϱ","\\varrho",!0);p(g,w,ue,"ς","\\varsigma",!0);p(g,w,ue,"φ","\\varphi",!0);p(g,w,ie,"∗","*",!0);p(g,w,ie,"+","+");p(g,w,ie,"−","-",!0);p(g,w,ie,"⋅","\\cdot",!0);p(g,w,ie,"∘","\\circ",!0);p(g,w,ie,"÷","\\div",!0);p(g,w,ie,"±","\\pm",!0);p(g,w,ie,"×","\\times",!0);p(g,w,ie,"∩","\\cap",!0);p(g,w,ie,"∪","\\cup",!0);p(g,w,ie,"∖","\\setminus",!0);p(g,w,ie,"∧","\\land");p(g,w,ie,"∨","\\lor");p(g,w,ie,"∧","\\wedge",!0);p(g,w,ie,"∨","\\vee",!0);p(g,w,I,"√","\\surd");p(g,w,mr,"⟨","\\langle",!0);p(g,w,mr,"∣","\\lvert");p(g,w,mr,"∥","\\lVert");p(g,w,jt,"?","?");p(g,w,jt,"!","!");p(g,w,jt,"⟩","\\rangle",!0);p(g,w,jt,"∣","\\rvert");p(g,w,jt,"∥","\\rVert");p(g,w,E,"=","=");p(g,w,E,":",":");p(g,w,E,"≈","\\approx",!0);p(g,w,E,"≅","\\cong",!0);p(g,w,E,"≥","\\ge");p(g,w,E,"≥","\\geq",!0);p(g,w,E,"←","\\gets");p(g,w,E,">","\\gt",!0);p(g,w,E,"∈","\\in",!0);p(g,w,E,"","\\@not");p(g,w,E,"⊂","\\subset",!0);p(g,w,E,"⊃","\\supset",!0);p(g,w,E,"⊆","\\subseteq",!0);p(g,w,E,"⊇","\\supseteq",!0);p(g,A,E,"⊈","\\nsubseteq",!0);p(g,A,E,"⊉","\\nsupseteq",!0);p(g,w,E,"⊨","\\models");p(g,w,E,"←","\\leftarrow",!0);p(g,w,E,"≤","\\le");p(g,w,E,"≤","\\leq",!0);p(g,w,E,"<","\\lt",!0);p(g,w,E,"→","\\rightarrow",!0);p(g,w,E,"→","\\to");p(g,A,E,"≱","\\ngeq",!0);p(g,A,E,"≰","\\nleq",!0);p(g,w,Un," ","\\ ");p(g,w,Un," ","\\space");p(g,w,Un," ","\\nobreakspace");p(W,w,Un," ","\\ ");p(W,w,Un," "," ");p(W,w,Un," ","\\space");p(W,w,Un," ","\\nobreakspace");p(g,w,Un,"","\\nobreak");p(g,w,Un,"","\\allowbreak");p(g,w,Dc,",",",");p(g,w,Dc,";",";");p(g,A,ie,"⊼","\\barwedge",!0);p(g,A,ie,"⊻","\\veebar",!0);p(g,w,ie,"⊙","\\odot",!0);p(g,w,ie,"⊕","\\oplus",!0);p(g,w,ie,"⊗","\\otimes",!0);p(g,w,I,"∂","\\partial",!0);p(g,w,ie,"⊘","\\oslash",!0);p(g,A,ie,"⊚","\\circledcirc",!0);p(g,A,ie,"⊡","\\boxdot",!0);p(g,w,ie,"△","\\bigtriangleup");p(g,w,ie,"▽","\\bigtriangledown");p(g,w,ie,"†","\\dagger");p(g,w,ie,"⋄","\\diamond");p(g,w,ie,"⋆","\\star");p(g,w,ie,"◃","\\triangleleft");p(g,w,ie,"▹","\\triangleright");p(g,w,mr,"{","\\{");p(W,w,I,"{","\\{");p(W,w,I,"{","\\textbraceleft");p(g,w,jt,"}","\\}");p(W,w,I,"}","\\}");p(W,w,I,"}","\\textbraceright");p(g,w,mr,"{","\\lbrace");p(g,w,jt,"}","\\rbrace");p(g,w,mr,"[","\\lbrack",!0);p(W,w,I,"[","\\lbrack",!0);p(g,w,jt,"]","\\rbrack",!0);p(W,w,I,"]","\\rbrack",!0);p(g,w,mr,"(","\\lparen",!0);p(g,w,jt,")","\\rparen",!0);p(W,w,I,"<","\\textless",!0);p(W,w,I,">","\\textgreater",!0);p(g,w,mr,"⌊","\\lfloor",!0);p(g,w,jt,"⌋","\\rfloor",!0);p(g,w,mr,"⌈","\\lceil",!0);p(g,w,jt,"⌉","\\rceil",!0);p(g,w,I,"\\","\\backslash");p(g,w,I,"∣","|");p(g,w,I,"∣","\\vert");p(W,w,I,"|","\\textbar",!0);p(g,w,I,"∥","\\|");p(g,w,I,"∥","\\Vert");p(W,w,I,"∥","\\textbardbl");p(W,w,I,"~","\\textasciitilde");p(W,w,I,"\\","\\textbackslash");p(W,w,I,"^","\\textasciicircum");p(g,w,E,"↑","\\uparrow",!0);p(g,w,E,"⇑","\\Uparrow",!0);p(g,w,E,"↓","\\downarrow",!0);p(g,w,E,"⇓","\\Downarrow",!0);p(g,w,E,"↕","\\updownarrow",!0);p(g,w,E,"⇕","\\Updownarrow",!0);p(g,w,at,"∐","\\coprod");p(g,w,at,"⋁","\\bigvee");p(g,w,at,"⋀","\\bigwedge");p(g,w,at,"⨄","\\biguplus");p(g,w,at,"⋂","\\bigcap");p(g,w,at,"⋃","\\bigcup");p(g,w,at,"∫","\\int");p(g,w,at,"∫","\\intop");p(g,w,at,"∬","\\iint");p(g,w,at,"∭","\\iiint");p(g,w,at,"∏","\\prod");p(g,w,at,"∑","\\sum");p(g,w,at,"⨂","\\bigotimes");p(g,w,at,"⨁","\\bigoplus");p(g,w,at,"⨀","\\bigodot");p(g,w,at,"∮","\\oint");p(g,w,at,"∯","\\oiint");p(g,w,at,"∰","\\oiiint");p(g,w,at,"⨆","\\bigsqcup");p(g,w,at,"∫","\\smallint");p(W,w,Aa,"…","\\textellipsis");p(g,w,Aa,"…","\\mathellipsis");p(W,w,Aa,"…","\\ldots",!0);p(g,w,Aa,"…","\\ldots",!0);p(g,w,Aa,"⋯","\\@cdots",!0);p(g,w,Aa,"⋱","\\ddots",!0);p(g,w,I,"⋮","\\varvdots");p(W,w,I,"⋮","\\varvdots");p(g,w,Ue,"ˊ","\\acute");p(g,w,Ue,"ˋ","\\grave");p(g,w,Ue,"¨","\\ddot");p(g,w,Ue,"~","\\tilde");p(g,w,Ue,"ˉ","\\bar");p(g,w,Ue,"˘","\\breve");p(g,w,Ue,"ˇ","\\check");p(g,w,Ue,"^","\\hat");p(g,w,Ue,"⃗","\\vec");p(g,w,Ue,"˙","\\dot");p(g,w,Ue,"˚","\\mathring");p(g,w,ue,"","\\@imath");p(g,w,ue,"","\\@jmath");p(g,w,I,"ı","ı");p(g,w,I,"ȷ","ȷ");p(W,w,I,"ı","\\i",!0);p(W,w,I,"ȷ","\\j",!0);p(W,w,I,"ß","\\ss",!0);p(W,w,I,"æ","\\ae",!0);p(W,w,I,"œ","\\oe",!0);p(W,w,I,"ø","\\o",!0);p(W,w,I,"Æ","\\AE",!0);p(W,w,I,"Œ","\\OE",!0);p(W,w,I,"Ø","\\O",!0);p(W,w,Ue,"ˊ","\\'");p(W,w,Ue,"ˋ","\\`");p(W,w,Ue,"ˆ","\\^");p(W,w,Ue,"˜","\\~");p(W,w,Ue,"ˉ","\\=");p(W,w,Ue,"˘","\\u");p(W,w,Ue,"˙","\\.");p(W,w,Ue,"¸","\\c");p(W,w,Ue,"˚","\\r");p(W,w,Ue,"ˇ","\\v");p(W,w,Ue,"¨",'\\"');p(W,w,Ue,"˝","\\H");p(W,w,Ue,"◯","\\textcircled");var g6={"--":!0,"---":!0,"``":!0,"''":!0};p(W,w,I,"–","--",!0);p(W,w,I,"–","\\textendash");p(W,w,I,"—","---",!0);p(W,w,I,"—","\\textemdash");p(W,w,I,"‘","`",!0);p(W,w,I,"‘","\\textquoteleft");p(W,w,I,"’","'",!0);p(W,w,I,"’","\\textquoteright");p(W,w,I,"“","``",!0);p(W,w,I,"“","\\textquotedblleft");p(W,w,I,"”","''",!0);p(W,w,I,"”","\\textquotedblright");p(g,w,I,"°","\\degree",!0);p(W,w,I,"°","\\degree");p(W,w,I,"°","\\textdegree",!0);p(g,w,I,"£","\\pounds");p(g,w,I,"£","\\mathsterling",!0);p(W,w,I,"£","\\pounds");p(W,w,I,"£","\\textsterling",!0);p(g,A,I,"✠","\\maltese");p(W,A,I,"✠","\\maltese");var s4='0123456789/@."';for(var Hd=0;Hd<s4.length;Hd++){var o4=s4.charAt(Hd);p(g,w,I,o4,o4)}var a4='0123456789!@*()-=+";:?/.,';for(var _d=0;_d<a4.length;_d++){var l4=a4.charAt(_d);p(W,w,I,l4,l4)}var j0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var jd=0;jd<j0.length;jd++){var t0=j0.charAt(jd);p(g,w,ue,t0,t0),p(W,w,I,t0,t0)}p(g,A,I,"C","ℂ");p(W,A,I,"C","ℂ");p(g,A,I,"H","ℍ");p(W,A,I,"H","ℍ");p(g,A,I,"N","ℕ");p(W,A,I,"N","ℕ");p(g,A,I,"P","ℙ");p(W,A,I,"P","ℙ");p(g,A,I,"Q","ℚ");p(W,A,I,"Q","ℚ");p(g,A,I,"R","ℝ");p(W,A,I,"R","ℝ");p(g,A,I,"Z","ℤ");p(W,A,I,"Z","ℤ");p(g,w,ue,"h","ℎ");p(W,w,ue,"h","ℎ");var he;for(var zt=0;zt<j0.length;zt++){var Ye=j0.charAt(zt);he=String.fromCharCode(55349,56320+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56372+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56424+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56580+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56684+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56736+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56788+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56840+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56944+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),zt<26&&(he=String.fromCharCode(55349,56632+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he),he=String.fromCharCode(55349,56476+zt),p(g,w,ue,Ye,he),p(W,w,I,Ye,he))}he="𝕜";p(g,w,ue,"k",he);p(W,w,I,"k",he);for(var Ji=0;Ji<10;Ji++){var ti=Ji.toString();he=String.fromCharCode(55349,57294+Ji),p(g,w,ue,ti,he),p(W,w,I,ti,he),he=String.fromCharCode(55349,57314+Ji),p(g,w,ue,ti,he),p(W,w,I,ti,he),he=String.fromCharCode(55349,57324+Ji),p(g,w,ue,ti,he),p(W,w,I,ti,he),he=String.fromCharCode(55349,57334+Ji),p(g,w,ue,ti,he),p(W,w,I,ti,he)}var of="ÐÞþ";for(var Vd=0;Vd<of.length;Vd++){var r0=of.charAt(Vd);p(g,w,ue,r0,r0),p(W,w,I,r0,r0)}var af={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},c4={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},u4={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},yA={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},rs={mathClass:"",textClass:"",font:""},d4={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},h4={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},f4={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},lf={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},cf={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},p4={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},uf={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},m4=[af,af,c4,c4,u4,u4,yA,rs,rs,rs,d4,d4,h4,h4,f4,f4,lf,lf,cf,cf,p4,p4,rs,rs,uf,uf],vA=[af,rs,lf,cf,uf],bA=r=>{var e=r.charCodeAt(0),t=r.charCodeAt(1),n=(e-55296)*1024+(t-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return m4[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return vA[s]}else{if(n===120485||n===120486)return m4[0];if(120486<n&&n<120782)return rs;throw new Y("Unsupported character: "+r)}},Au=function(e,t,n){if(We[n][e]){var i=We[n][e].replace;i&&(e=i)}return{value:e,metrics:bm(e,t,n)}},Bt=function(e,t,n,i,s){var o=Au(e,t,n),a=o.metrics;e=o.value;var l;if(a){var c=a.italic;(n==="text"||i&&i.font==="mathit")&&(c=0),l=new hr(e,a.height,a.depth,c,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new hr(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var u=i.getColor();u&&(l.style.color=u)}return l},wm=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&Au(e,"Main-Bold",t).metrics?Bt(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||We[t][e].font==="main"?Bt(e,"Main-Regular",t,n,i):Bt(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},wA=function(e,t,n){return n!=="textord"&&Au(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Nu=function(e,t){var n=e.type==="mathord"?"mathord":"textord",i=e.mode,s=e.text,o=["mord"],{font:a,fontFamily:l,fontWeight:c,fontShape:u}=t,d=i==="math"||i==="text"&&!!a,h=d?a:l,f="",m="";if(s.charCodeAt(0)===55349){var y=bA(s);f=y.font,m=y[i+"Class"]}if(f)return Bt(s,f,i,t,o.concat(m));if(h){var b,v;if(h==="boldsymbol"){var k=wA(s,i,n);b=k.fontName,v=[k.fontClass]}else d?(b=df[a].fontName,v=[a]):(b=n0(l,c,u),v=[l,c,u]);if(Au(s,b,i).metrics)return Bt(s,b,i,t,o.concat(v));if(g6.hasOwnProperty(s)&&b.slice(0,10)==="Typewriter"){for(var M=[],D=0;D<s.length;D++)M.push(Bt(s[D],b,i,t,o.concat(v)));return Kn(M)}}if(n==="mathord")return Bt(s,"Math-Italic",i,t,o.concat(["mathnormal"]));if(n==="textord"){var O=We[i][s]&&We[i][s].font;if(O==="ams"){var z=n0("amsrm",c,u);return Bt(s,z,i,t,o.concat("amsrm",c,u))}else if(O==="main"||!O){var T=n0("textrm",c,u);return Bt(s,T,i,t,o.concat(c,u))}else{var B=n0(O,c,u);return Bt(s,B,i,t,o.concat(B,c,u))}}else throw new Error("unexpected type: "+n+" in makeOrd")},kA=(r,e)=>{if(Ni(r.classes)!==Ni(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize||r.italic!==0&&r.hasClass("mathnormal"))return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n of Object.keys(r.style))if(r.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(r.style[i]!==e.style[i])return!1;return!0},y6=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof hr&&n instanceof hr&&kA(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},km=function(e){for(var t=0,n=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},K=function(e,t,n,i){var s=new Ta(e,t,n,i);return km(s),s},Di=(r,e,t,n)=>new Ta(r,e,t,n),fa=function(e,t,n){var i=K([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=Q(i.height),i.maxFontSize=1,i},xA=function(e,t,n,i){var s=new Tu(e,t,n,i);return km(s),s},Kn=function(e){var t=new Ma(e);return km(t),t},pa=function(e,t){return e instanceof Ma?K([],[e],t):e},SA=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o<t.length;o++){var a=-t[o].shift-s-t[o].elem.depth,l=a-(t[o-1].elem.height+t[o-1].elem.depth);s=s+a,n.push({type:"kern",size:l}),n.push(t[o])}return{children:n,depth:i}}var c;if(e.positionType==="top"){for(var u=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];u-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}c=u}else if(e.positionType==="bottom")c=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")c=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")c=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:c}},Ie=function(e,t){for(var{children:n,depth:i}=SA(e),s=0,o=0;o<n.length;o++){var a=n[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var c=K(["pstrut"],[]);c.style.height=Q(s);for(var u=[],d=i,h=i,f=i,m=0;m<n.length;m++){var y=n[m];if(y.type==="kern")f+=y.size;else{var b=y.elem,v=y.wrapperClasses||[],k=y.wrapperStyle||{},M=K(v,[c,b],void 0,k);M.style.top=Q(-s-f-b.depth),y.marginLeft&&(M.style.marginLeft=y.marginLeft),y.marginRight&&(M.style.marginRight=y.marginRight),u.push(M),f+=b.height+b.depth}d=Math.min(d,f),h=Math.max(h,f)}var D=K(["vlist"],u);D.style.height=Q(h);var O;if(d<0){var z=K([],[]),T=K(["vlist"],[z]);T.style.height=Q(-d);var B=K(["vlist-s"],[new hr("")]);O=[K(["vlist-r"],[D,B]),K(["vlist-r"],[T])]}else O=[K(["vlist-r"],[D])];var N=K(["vlist-t"],O);return O.length===2&&N.classes.push("vlist-t2"),N.height=h,N.depth=-d,N},v6=(r,e)=>{var t=K(["mspace"],[],e),n=Ge(r,e);return t.style.marginRight=Q(n),t},n0=(r,e,t)=>{var n,i;switch(r){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=r}return e==="textbf"&&t==="textit"?i="BoldItalic":e==="textbf"?i="Bold":t==="textit"?i="Italic":i="Regular",n+"-"+i},df={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},b6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},w6=function(e,t){var[n,i,s]=b6[e],o=new Ei(n),a=new jn([o],{width:Q(i),height:Q(s),style:"width:"+Q(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Di(["overlay"],[a],t);return l.height=s,l.style.height=Q(s),l.style.width=Q(i),l},Ke={number:3,unit:"mu"},Yi={number:4,unit:"mu"},wn={number:5,unit:"mu"},CA={mord:{mop:Ke,mbin:Yi,mrel:wn,minner:Ke},mop:{mord:Ke,mop:Ke,mrel:wn,minner:Ke},mbin:{mord:Yi,mop:Yi,mopen:Yi,minner:Yi},mrel:{mord:wn,mop:wn,mopen:wn,minner:wn},mopen:{},mclose:{mop:Ke,mbin:Yi,mrel:wn,minner:Ke},mpunct:{mord:Ke,mop:Ke,mrel:wn,mopen:Ke,mclose:Ke,mpunct:Ke,minner:Ke},minner:{mord:Ke,mop:Ke,mbin:Yi,mrel:wn,mopen:Ke,mpunct:Ke,minner:Ke}},MA={mord:{mop:Ke},mop:{mord:Ke,mop:Ke},mbin:{},mrel:{},mopen:{},mclose:{mop:Ke},mpunct:{},minner:{mop:Ke}},k6={},Cl={},Ml={};function ne(r){for(var{type:e,names:t,htmlBuilder:n,mathmlBuilder:i}=r,s=0;s<t.length;++s)k6[t[s]]=r;e&&(n&&(Cl[e]=n),i&&(Ml[e]=i))}function Vs(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;t&&(Cl[e]=t),n&&(Ml[e]=n)}var V0=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},it=function(e){return e.type==="ordgroup"?e.body:[e]},TA=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),AA=new Set(["rightmost","mrel","mclose","mpunct"]),NA={display:ye.DISPLAY,text:ye.TEXT,script:ye.SCRIPT,scriptscript:ye.SCRIPTSCRIPT},EA={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},dt=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=ze(e[o],t);if(a instanceof Ma){var l=a.children;s.push(...l)}else s.push(a)}if(y6(s),!n)return s;var c=t;if(e.length===1){var u=e[0];u.type==="sizing"?c=t.havingSize(u.size):u.type==="styling"&&(c=t.havingStyle(NA[u.style]))}var d=K([i[0]||"leftmost"],[],t),h=K([i[1]||"rightmost"],[],t),f=n==="root";return hf(s,(m,y)=>{var b=y.classes[0],v=m.classes[0];b==="mbin"&&AA.has(v)?y.classes[0]="mord":v==="mbin"&&TA.has(b)&&(m.classes[0]="mord")},{node:d},h,f),hf(s,(m,y)=>{var b,v,k=pf(y),M=pf(m),D=k&&M?m.hasClass("mtight")?(b=MA[k])==null?void 0:b[M]:(v=CA[k])==null?void 0:v[M]:null;if(D)return v6(D,c)},{node:d},h,f),s},hf=function(e,t,n,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=x6(a);if(l){hf(l.children,t,n,null,s);continue}var c=!a.hasClass("mspace");if(c){var u=t(a,n.node);u&&(n.insertAfter?n.insertAfter(u):(e.unshift(u),o++))}c?n.node=a:s&&a.hasClass("newline")&&(n.node=K(["leftmost"])),n.insertAfter=(d=>h=>{e.splice(d+1,0,h),o++})(o)}i&&e.pop()},x6=function(e){return e instanceof Ma||e instanceof Tu||e instanceof Ta&&e.hasClass("enclosing")?e:null},ff=function(e,t){var n=x6(e);if(n){var i=n.children;if(i.length){if(t==="right")return ff(i[i.length-1],"right");if(t==="left")return ff(i[0],"left")}}return e},pf=function(e,t){if(!e)return null;t&&(e=ff(e,t));var n=e.classes[0];return EA[n]||null},Tl=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return K(t.concat(n))},ze=function(e,t,n){if(!e)return K();if(Cl[e.type]){var i=Cl[e.type](e,t);if(n&&t.size!==n.size){i=K(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Y("Got group of unknown type: '"+e.type+"'")};function i0(r,e){var t=K(["base"],r,e),n=K(["strut"]);return n.style.height=Q(t.height+t.depth),t.depth&&(n.style.verticalAlign=Q(-t.depth)),t.children.unshift(n),t}function mf(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=dt(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],a=0;a<n.length;a++)if(o.push(n[a]),n[a].hasClass("mbin")||n[a].hasClass("mrel")||n[a].hasClass("allowbreak")){for(var l=!1;a<n.length-1&&n[a+1].hasClass("mspace")&&!n[a+1].hasClass("newline");)a++,o.push(n[a]),n[a].hasClass("nobreak")&&(l=!0);l||(s.push(i0(o,e)),o=[])}else n[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(i0(o,e)),o=[]),s.push(n[a]));o.length>0&&s.push(i0(o,e));var c;t?(c=i0(dt(t,e,!0),e),c.classes=["tag"],s.push(c)):i&&s.push(i);var u=K(["katex-html"],s);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=Q(u.height+u.depth),u.depth&&(d.style.verticalAlign=Q(-u.depth))}return u}function S6(r){return new Ma(r)}class X{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Ni(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof st&&this.children[n+1]instanceof st){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof st;)i+=this.children[++n].toText();e.appendChild(new st(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Nt(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Nt(Ni(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class st{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Nt(this.toText())}toText(){return this.text}}class C6{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Q(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Q(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var DA=new Set(["\\imath","\\jmath"]),OA=new Set(["mrow","mtable"]),Rr=function(e,t,n){return We[t][e]&&We[t][e].replace&&e.charCodeAt(0)!==55349&&!(g6.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=We[t][e].replace),new st(e)},xm=function(e){return e.length===1?e[0]:new X("mrow",e)},RA={mathit:"italic",boldsymbol:r=>r.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Sm=(r,e)=>{if(r.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var t=e.font;if(!t||t==="mathnormal")return null;var n=r.mode,i=RA[t];if(i)return typeof i=="function"?i(r):i;var s=r.text;if(DA.has(s))return null;if(We[n][s]){var o=We[n][s].replace;o&&(s=o)}var a=df[t].fontName;return bm(s,a,n)?df[t].variant:null};function Wd(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof st&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof st&&t.text===","}else return!1}var gr=function(e,t,n){if(e.length===1){var i=_e(e[0],t);return n&&i instanceof X&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=_e(e[a],t);if(l instanceof X&&o instanceof X){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(Wd(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&Wd(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||Wd(o))){var c=l.children[0];c instanceof X&&c.type==="mn"&&(c.children=[...o.children,...c.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var u=o.children[0];if(u instanceof st&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof st&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},Oi=function(e,t,n){return xm(gr(e,t,n))},_e=function(e,t){if(!e)return new X("mrow");if(Ml[e.type])return Ml[e.type](e,t);throw new Y("Got group of unknown type: '"+e.type+"'")};function g4(r,e,t,n,i){var s=gr(r,t),o;s.length===1&&s[0]instanceof X&&OA.has(s[0].type)?o=s[0]:o=new X("mrow",s);var a=new X("annotation",[new st(e)]);a.setAttribute("encoding","application/x-tex");var l=new X("semantics",[o,a]),c=new X("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return K([u],[c])}var IA=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],y4=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],v4=function(e,t){return t.size<2?e:IA[e-1][t.size-1]};class Cn{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Cn.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=y4[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new Cn(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:v4(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:y4[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=v4(Cn.BASESIZE,e);return this.size===t&&this.textSize===Cn.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Cn.BASESIZE?["sizing","reset-size"+this.size,"size"+Cn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=gA(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Cn.BASESIZE=6;var M6=function(e){return new Cn({style:e.displayMode?ye.DISPLAY:ye.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},T6=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=K(n,[e])}return e},zA=function(e,t,n){var i=M6(n),s;if(n.output==="mathml")return g4(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=mf(e,i);s=K(["katex"],[o])}else{var a=g4(e,t,i,n.displayMode,!1),l=mf(e,i);s=K(["katex"],[a,l])}return T6(s,n)},LA=function(e,t,n){var i=M6(n),s=mf(e,i),o=K(["katex"],[s]);return T6(o,n)},BA={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Eu=function(e){var t=new X("mo",[new st(BA[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},PA={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},FA=new Set(["widehat","widecheck","widetilde","utilde"]),Du=function(e,t){function n(){var a=4e5,l=e.label.slice(1);if(FA.has(l)&&"base"in e){var c=e.base.type==="ordgroup"?e.base.body.length:1,u,d,h;if(c>5)l==="widehat"||l==="widecheck"?(u=420,a=2364,h=.42,d=l+"4"):(u=312,a=2340,h=.34,d="tilde4");else{var f=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][f],u=[0,239,300,360,420][f],h=[0,.24,.3,.3,.36,.42][f],d=l+f):(a=[0,600,1033,2339,2340][f],u=[0,260,286,306,312][f],h=[0,.26,.286,.3,.306,.34][f],d="tilde"+f)}var m=new Ei(d),y=new jn([m],{width:"100%",height:Q(h),viewBox:"0 0 "+a+" "+u,preserveAspectRatio:"none"});return{span:Di([],[y],t),minWidth:0,height:h}}else{var b=[],v=PA[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[k,M,D]=v,O=D/1e3,z=k.length,T,B;if(z===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],B=[v[3]]}else if(z===2)T=["halfarrow-left","halfarrow-right"],B=["xMinYMin","xMaxYMin"];else if(z===3)T=["brace-left","brace-center","brace-right"],B=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
1180
|
+
`+z+" children.");for(var N=0;N<z;N++){var q=new Ei(k[N]),te=new jn([q],{width:"400em",height:Q(O),viewBox:"0 0 "+a+" "+D,preserveAspectRatio:B[N]+" slice"}),Z=Di([T[N]],[te],t);if(z===1)return{span:Z,minWidth:M,height:O};Z.style.height=Q(O),b.push(Z)}return{span:K(["stretchy"],b,t),minWidth:M,height:O}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=Q(o),s>0&&(i.style.minWidth=Q(s)),i},$A=function(e,t,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=K(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new sf({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new sf({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new jn(c,{width:"100%",height:Q(a)});o=Di([],[u],s)}return o.height=a,o.style.height=Q(a),o},qA={bin:1,close:1,inner:1,open:1,punct:1,rel:1},HA={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function _A(r){return r in qA}function we(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Ou(r){var e=Ru(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ru(r){return r&&(r.type==="atom"||HA.hasOwnProperty(r.type))?r:null}var A6=r=>{if(r instanceof hr)return r;if(pA(r)&&r.children.length===1)return A6(r.children[0])},N6=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=we(r.base,"accent"),t=n.base,r.base=t,i=fA(ze(r,e)),r.base=n):(n=we(r,"accent"),t=n.base);var s=ze(t,e.havingCrampedStyle()),o=n.isShifty&&Wn(t),a=0;if(o){var l,c;a=(l=(c=A6(s))==null?void 0:c.skew)!=null?l:0}var u=n.label==="\\c",d=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Du(n,e),h=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+Q(2*a)+")",marginLeft:Q(2*a)}:void 0}]});else{var f,m;n.label==="\\vec"?(f=w6("vec",e),m=b6.vec[1]):(f=Nu({type:"textord",mode:n.mode,text:n.label},e),f=hA(f),f.italic=0,m=f.width,u&&(d+=f.depth)),h=K(["accent-body"],[f]);var y=n.label==="\\textcircled";y&&(h.classes.push("accent-full"),d=s.height);var b=a;y||(b-=m/2),h.style.left=Q(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]})}var v=K(["mord","accent"],[h],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},jA=(r,e)=>{var t=r.isStretchy?Eu(r.label):new X("mo",[Rr(r.label,r.mode)]),n=new X("mover",[_e(r.base,e),t]);return n.setAttribute("accent","true"),n},VA=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ne({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(r,e)=>{var t=V0(e[0]),n=!VA.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:N6,mathmlBuilder:jA});ne({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}}});ne({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=ze(r.base,e),n=Du(r,e),i=r.label==="\\utilde"?.12:0,s=Ie({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return K(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=Eu(r.label),n=new X("munder",[_e(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var s0=r=>{var e=new X("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ne({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=pa(ze(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=pa(ze(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=Du(r,e),l=-e.fontMetrics().axisHeight+.5*a.height,c=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;u=Ie({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:d}]})}else u=Ie({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l,wrapperClasses:["svg-align"]}]});return K(["mrel","x-arrow"],[u],e)},mathmlBuilder(r,e){var t=Eu(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=s0(_e(r.body,e));if(r.below){var s=s0(_e(r.below,e));n=new X("munderover",[t,s,i])}else n=new X("mover",[t,i])}else if(r.below){var o=s0(_e(r.below,e));n=new X("munder",[t,o])}else n=s0(),n=new X("mover",[t,n]);return n}});function WA(r,e){var t=dt(r.body,e,!0);return K([r.mclass],t,e)}function UA(r,e){var t,n=gr(r.body,e);return r.mclass==="minner"?t=new X("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new X("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new X("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):(r.mclass==="mopen"||r.mclass==="mclose")&&(t.attributes.lspace="0em",t.attributes.rspace="0em")),t}ne({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:it(i),isCharacterBox:Wn(i)}},htmlBuilder:WA,mathmlBuilder:UA});var Iu=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ne({type:"mclass",names:["\\@binrel"],numArgs:2,handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Iu(e[0]),body:it(e[1]),isCharacterBox:Wn(e[1])}}});ne({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=Iu(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:it(i)},l=n==="\\underset"?{type:"supsub",mode:s.mode,base:a,sub:s}:{type:"supsub",mode:s.mode,base:a,sup:s};return{type:"mclass",mode:t.mode,mclass:o,body:[l],isCharacterBox:Wn(l)}}});ne({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Iu(e[0]),body:it(e[0])}},htmlBuilder(r,e){var t=dt(r.body,e,!0),n=K([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=gr(r.body,e),n=new X("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var KA={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},b4=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),w4=r=>r.type==="textord"&&r.text==="@",GA=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function JA(r,e,t){var n=KA[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),a=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function YA(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Y("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=b4(),l=0;l<o.length;l++)if(!w4(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var c=Ou(o[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(c))if("<>AV".includes(c))for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(GA(o[f],c)){h=!1,l=f;break}if(w4(o[f]))throw new Y("Missing a "+c+" character to complete a CD arrow.",o[f]);u[d].body.push(o[f])}if(h)throw new Y("Missing a "+c+" character to complete a CD arrow.",o[l])}else throw new Y('Expected one of "<>AV=|." after @',o[l]);var m=JA(c,u,r),y={type:"styling",body:[m],mode:"math",style:"display",resetFont:!0};n.push(y),a=b4()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var b=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:b,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ne({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=pa(ze(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=Q(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new X("mrow",[_e(r.label,e)]);return t=new X("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new X("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ne({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=pa(ze(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new X("mrow",[_e(r.fragment,e)])}});ne({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(r,e){for(var{parser:t}=r,n=we(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=we(i[o],"textord");s+=a.text}var l=parseInt(s),c;if(isNaN(l))throw new Y("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new Y("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var XA=(r,e)=>{var t=dt(r.body,e.withColor(r.color),!1);return Kn(t)},ZA=(r,e)=>{var t=gr(r.body,e.withColor(r.color)),n=new X("mstyle",t);return n.setAttribute("mathcolor",r.color),n};ne({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(r,e){var{parser:t}=r,n=we(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:it(i)}},htmlBuilder:XA,mathmlBuilder:ZA});ne({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=we(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}}});ne({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&we(i,"size").value}},htmlBuilder(r,e){var t=K(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=Q(Ge(r.size,e)))),t},mathmlBuilder(r,e){var t=new X("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",Q(Ge(r.size,e)))),t}});var gf={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},E6=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Y("Expected a control sequence",r);return e},QA=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},D6=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};ne({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(gf[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=gf[n.text]),we(e.parseFunction(),"internal");throw new Y("Invalid token after macro prefix",n)}});ne({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Y("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Y('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Y('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new Y("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},t===gf[t]),{type:"internal",mode:e.mode}}});ne({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(r){var{parser:e,funcName:t}=r,n=E6(e.gullet.popToken());e.gullet.consumeSpaces();var i=QA(e);return D6(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});ne({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(r){var{parser:e,funcName:t}=r,n=E6(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return D6(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ja=function(e,t,n){var i=We.math[e]&&We.math[e].replace,s=bm(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Cm=function(e,t,n,i){var s=n.havingBaseStyle(t),o=K(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},O6=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Q(s),e.height-=s,e.depth+=s},eN=function(e,t,n,i,s,o){var a=Bt(e,"Main-Regular",s,i),l=Cm(a,t,i,o);return O6(l,i,t),l},tN=function(e,t,n,i){return Bt(e,"Size"+t+"-Regular",n,i)},R6=function(e,t,n,i,s,o){var a=tN(e,t,s,i),l=Cm(K(["delimsizing","size"+t],[a],i),ye.TEXT,i,o);return n&&O6(l,i,ye.TEXT),l},Ud=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=K(["delimsizinginner",i],[K([],[Bt(e,t,n)])]);return{type:"elem",elem:s}},Kd=function(e,t,n){var i=an["Size4-Regular"][e.charCodeAt(0)]?an["Size4-Regular"][e.charCodeAt(0)][4]:an["Size1-Regular"][e.charCodeAt(0)][4],s=new Ei("inner",sA(e,Math.round(1e3*t))),o=new jn([s],{width:Q(i),height:Q(t),style:"width:"+Q(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Di([],[o],n);return a.height=t,a.style.height=Q(t),a.style.width=Q(i),{type:"elem",elem:a}},yf=.008,o0={type:"kern",size:-1*yf},rN=new Set(["|","\\lvert","\\rvert","\\vert"]),nN=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),I6=function(e,t,n,i,s,o){var a,l,c,u,d="",h=0;a=c=u=e,l=null;var f="Size1-Regular";e==="\\uparrow"?c=u="⏐":e==="\\Uparrow"?c=u="‖":e==="\\downarrow"?a=c="⏐":e==="\\Downarrow"?a=c="‖":e==="\\updownarrow"?(a="\\uparrow",c="⏐",u="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",c="‖",u="\\Downarrow"):rN.has(e)?(c="∣",d="vert",h=333):nN.has(e)?(c="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",c="⎢",u="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",c="⎥",u="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(c=a="⎢",u="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",c=u="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(c=a="⎥",u="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",c=u="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",c="⎜",u="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",c="⎟",u="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",u="⎩",c="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",u="⎩",c="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",u="⎭",c="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",u="⎩",c="⎪",f="Size4-Regular");var m=ja(a,f,s),y=m.height+m.depth,b=ja(c,f,s),v=b.height+b.depth,k=ja(u,f,s),M=k.height+k.depth,D=0,O=1;if(l!==null){var z=ja(l,f,s);D=z.height+z.depth,O=2}var T=y+M+D,B=Math.max(0,Math.ceil((t-T)/(O*v))),N=T+B*O*v,q=i.fontMetrics().axisHeight;n&&(q*=i.sizeMultiplier);var te=N/2-q,Z=[];if(d.length>0){var me=N-y-M,be=Math.round(N*1e3),$=oA(d,Math.round(me*1e3)),ve=new Ei(d,$),Qe=Q(h/1e3),kt=Q(be/1e3),mn=new jn([ve],{width:Qe,height:kt,viewBox:"0 0 "+h+" "+be}),tr=Di([],[mn],i);tr.height=be/1e3,tr.style.width=Qe,tr.style.height=kt,Z.push({type:"elem",elem:tr})}else{if(Z.push(Ud(u,f,s)),Z.push(o0),l===null){var yr=N-y-M+2*yf;Z.push(Kd(c,yr,i))}else{var gn=(N-y-M-D)/2+2*yf;Z.push(Kd(c,gn,i)),Z.push(o0),Z.push(Ud(l,f,s)),Z.push(o0),Z.push(Kd(c,gn,i))}Z.push(o0),Z.push(Ud(a,f,s))}var Ot=i.havingBaseStyle(ye.TEXT),Oe=Ie({positionType:"bottom",positionData:te,children:Z});return Cm(K(["delimsizing","mult"],[Oe],Ot),ye.TEXT,i,o)},Gd=80,Jd=.08,Yd=function(e,t,n,i,s){var o=iA(e,i,n),a=new Ei(e,o),l=new jn([a],{width:"400em",height:Q(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Di(["hide-tail"],[l],s)},iN=function(e,t){var n=t.havingBaseSizing(),i=F6("\\surd",e*n.sizeMultiplier,P6,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),a,l,c,u,d;return i.type==="small"?(u=1e3+1e3*o+Gd,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Jd)/s,c=(1+o)/s,a=Yd("sqrtMain",l,u,o,t),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(u=(1e3+Gd)*sl[i.size],c=(sl[i.size]+o)/s,l=(sl[i.size]+o+Jd)/s,a=Yd("sqrtSize"+i.size,l,u,o,t),a.style.minWidth="1.02em",d=1/s):(l=e+o+Jd,c=e+o,u=Math.floor(1e3*e+o)+Gd,a=Yd("sqrtTall",l,u,o,t),a.style.minWidth="0.742em",d=1.056),a.height=c,a.style.height=Q(l),{span:a,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},z6=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sN=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),L6=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),sl=[0,1.2,1.8,2.4,3],B6=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),z6.has(e)||L6.has(e))return R6(e,t,!1,n,i,s);if(sN.has(e))return I6(e,sl[t],!1,n,i,s);throw new Y("Illegal delimiter: '"+e+"'")},oN=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],aN=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"stack"}],P6=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lN=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},F6=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length;o++){var a=n[o];if(a.type==="stack")break;var l=ja(e,lN(a),"math"),c=l.height+l.depth;if(a.type==="small"){var u=i.havingBaseStyle(a.style);c*=u.sizeMultiplier}if(c>t)return a}return n[n.length-1]},vf=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;L6.has(e)?a=oN:z6.has(e)?a=P6:a=aN;var l=F6(e,t,a,i);return l.type==="small"?eN(e,l.style,n,i,s,o):l.type==="large"?R6(e,l.size,n,i,s,o):I6(e,t,n,i,s,o)},Xd=function(e,t,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(t-a,n+a),d=Math.max(u/500*l,2*u-c);return vf(e,d,!0,i,s,o)},k4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},cN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function x4(r){return"isMiddle"in r}function zu(r,e){var t=Ru(r);if(t&&cN.has(t.text))return t;throw t?new Y("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new Y("Invalid delimiter type '"+r.type+"'",r)}ne({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(r,e)=>{var t=zu(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:k4[r.funcName].size,mclass:k4[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?K([r.mclass]):B6(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(Rr(r.delim,r.mode));var t=new X("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=Q(sl[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function S4(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ne({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Y("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:zu(e[0],r).text,color:t}}});ne({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(r,e)=>{var t=zu(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=we(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{S4(r);for(var t=dt(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<t.length;o++){var a=t[o];x4(a)?s=!0:(n=Math.max(t[o].height,n),i=Math.max(t[o].depth,i))}n*=e.sizeMultiplier,i*=e.sizeMultiplier;var l;if(r.left==="."?l=Tl(e,["mopen"]):l=Xd(r.left,n,i,e,r.mode,["mopen"]),t.unshift(l),s)for(var c=1;c<t.length;c++){var u=t[c];if(x4(u)){var d=u.isMiddle;t[c]=Xd(d.delim,n,i,d.options,r.mode,[])}}var h;if(r.right===".")h=Tl(e,["mclose"]);else{var f=r.rightColor?e.withColor(r.rightColor):e;h=Xd(r.right,n,i,f,r.mode,["mclose"])}return t.push(h),K(["minner"],t,e)},mathmlBuilder:(r,e)=>{S4(r);var t=gr(r.body,e);if(r.left!=="."){var n=new X("mo",[Rr(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new X("mo",[Rr(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return xm(t)}});ne({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(r,e)=>{var t=zu(e[0],r);if(!r.parser.leftrightDepth)throw new Y("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;return r.delim==="."?t=Tl(e,[]):(t=B6(r.delim,1,e,r.mode,[]),t.isMiddle={delim:r.delim,options:e}),t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?Rr("|","text"):Rr(r.delim,r.mode),n=new X("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var uN=(r,e)=>{var t=pa(ze(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o,a=Wn(r.body);if(n==="sout")s=K(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Ge({number:.6,unit:"pt"},e),c=Ge({number:.35,unit:"ex"},e),u=e.havingBaseSizing();i=i/u.sizeMultiplier;var d=t.height+t.depth+l+c;t.style.paddingLeft=Q(d/2+l);var h=Math.floor(1e3*d*i),f=rA(h),m=new jn([new Ei("phase",f)],{width:"400em",height:Q(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=Di(["hide-tail"],[m],e),s.style.height=Q(d),o=t.depth+l+c}else{/cancel/.test(n)?a||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var y,b,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),b=y):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*v,b=Math.max(0,.25-t.depth)):(y=a?.2:0,b=y),s=$A(t,n,y,b,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Q(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Q(v),s.style.borderRightWidth=Q(v)),o=t.depth+b,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var k;if(r.backgroundColor)k=Ie({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]});else{var M=/cancel|phase/.test(n)?["svg-align"]:[];k=Ie({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:M}]})}return/cancel/.test(n)&&(k.height=t.height,k.depth=t.depth),/cancel/.test(n)&&!a?K(["mord","cancel-lap"],[k],e):K(["mord"],[k],e)},dN=(r,e)=>{var t,n=new X(r.label.includes("colorbox")?"mpadded":"menclose",[_e(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Q(i)+" solid "+r.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};ne({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(r,e,t){var{parser:n,funcName:i}=r,s=we(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:uN,mathmlBuilder:dN});ne({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(r,e,t){var{parser:n,funcName:i}=r,s=we(e[0],"color-token").color,o=we(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}}});ne({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});ne({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}}});ne({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(r,e){var{parser:t,funcName:n}=r;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}}});ne({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var $6={};function hn(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)$6[t[l]]=a;s&&(Cl[e]=s),o&&(Ml[e]=o)}var q6={};function x(r,e){q6[r]=e}class Jt{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Jt(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class dr{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new dr(t,Jt.range(this,e))}}function C4(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var Lu=r=>{var e=r.parser.settings;if(!e.displayMode)throw new Y("{"+r.envName+"} can be used only in display mode.")},hN=new Set(["gather","gather*"]);function Mm(r){if(!r.includes("ed"))return!r.includes("*")}function Pi(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:h}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new Y("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var m=[],y=[m],b=[],v=[],k=l!=null?[]:void 0;function M(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function D(){k&&(r.gullet.macros.get("\\df@tag")?(k.push(r.subparse([new dr("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):k.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(M(),v.push(C4(r));;){var O=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup();var z={type:"ordgroup",mode:r.mode,body:O};t&&(z={type:"styling",mode:r.mode,style:t,resetFont:!0,body:[z]}),m.push(z);var T=r.fetch().text;if(T==="&"){if(d&&m.length===d){if(c||a)throw new Y("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(T==="\\end"){D(),m.length===1&&z.type==="styling"&&z.body.length===1&&z.body[0].type==="ordgroup"&&z.body[0].body.length===0&&(y.length>1||!u)&&y.pop(),v.length<y.length+1&&v.push([]);break}else if(T==="\\\\"){r.consume();var B=void 0;r.gullet.future().text!==" "&&(B=r.parseSizeGroup(!0)),b.push(B?B.value:null),D(),v.push(C4(r)),m=[],y.push(m),M()}else throw new Y("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:o,body:y,cols:s,rowGaps:b,hskipBeforeAndAfter:n,hLinesBeforeRow:v,colSeparationType:a,tags:k,leqno:h}}function Tm(r){return r.slice(0,1)==="d"?"display":"text"}var fn=function(e,t){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),c=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(ye.SCRIPT).sizeMultiplier;h=.2778*(f/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?Ge({number:3,unit:"ex"},t):12*d,y=3*d,b=e.arraystretch*m,v=.7*b,k=.3*b,M=0;function D(G){for(var ce=0;ce<G.length;++ce)ce>0&&(M+=.25),c.push({pos:M,isDashed:G[ce]})}for(D(o[0]),n=0;n<e.body.length;++n){var O=e.body[n],z=v,T=k;a<O.length&&(a=O.length);var B={cells:new Array(O.length),height:0,depth:0,pos:0};for(i=0;i<O.length;++i){var N=ze(O[i],t);T<N.depth&&(T=N.depth),z<N.height&&(z=N.height),B.cells[i]=N}var q=e.rowGaps[n],te=0;q&&(te=Ge(q,t),te>0&&(te+=k,T<te&&(T=te),te=0)),e.addJot&&n<e.body.length-1&&(T+=y),B.height=z,B.depth=T,M+=z,B.pos=M,M+=T+te,l[n]=B,D(o[n+1])}var Z=M/2+t.fontMetrics().axisHeight,me=e.cols||[],be=[],$,ve,Qe=[];if(e.tags&&e.tags.some(G=>G))for(n=0;n<s;++n){var kt=l[n],mn=kt.pos-Z,tr=e.tags[n],yr=void 0;tr===!0?yr=K(["eqn-num"],[],t):tr===!1?yr=K([],[],t):yr=K([],dt(tr,t,!0),t),yr.depth=kt.depth,yr.height=kt.height,Qe.push({type:"elem",elem:yr,shift:mn})}for(i=0,ve=0;i<a||ve<me.length;++i,++ve){for(var gn,Ot=me[ve],Oe=!0;((Ws=Ot)==null?void 0:Ws.type)==="separator";){var Ws;if(Oe||($=K(["arraycolsep"],[]),$.style.width=Q(t.fontMetrics().doubleRuleSep),be.push($)),Ot.separator==="|"||Ot.separator===":"){var Us=Ot.separator==="|"?"solid":"dashed",Gr=K(["vertical-separator"],[],t);Gr.style.height=Q(M),Gr.style.borderRightWidth=Q(u),Gr.style.borderRightStyle=Us,Gr.style.margin="0 "+Q(-u/2);var Ks=M-Z;Ks&&(Gr.style.verticalAlign=Q(-Ks)),be.push(Gr)}else throw new Y("Invalid separator type: "+Ot.separator);ve++,Ot=me[ve],Oe=!1}if(!(i>=a)){var Jr=void 0;if(i>0||e.hskipBeforeAndAfter){var Gs,Fi;Jr=(Gs=(Fi=Ot)==null?void 0:Fi.pregap)!=null?Gs:h,Jr!==0&&($=K(["arraycolsep"],[]),$.style.width=Q(Jr),be.push($))}var $i=[];for(n=0;n<s;++n){var yn=l[n],Re=yn.cells[i];if(Re){var qi=yn.pos-Z;Re.depth=yn.depth,Re.height=yn.height,$i.push({type:"elem",elem:Re,shift:qi})}}var Pe=Ie({positionType:"individualShift",children:$i}),Jn=K(["col-align-"+(((gn=Ot)==null?void 0:gn.align)||"c")],[Pe]);if(be.push(Jn),i<a-1||e.hskipBeforeAndAfter){var xt,Yr;Jr=(xt=(Yr=Ot)==null?void 0:Yr.postgap)!=null?xt:h,Jr!==0&&($=K(["arraycolsep"],[]),$.style.width=Q(Jr),be.push($))}}}var Xr=K(["mtable"],be);if(c.length>0){for(var rr=fa("hline",t,u),Js=fa("hdashline",t,u),vn=[{type:"elem",elem:Xr,shift:0}];c.length>0;){var Hi=c.pop(),_i=Hi.pos-Z;Hi.isDashed?vn.push({type:"elem",elem:Js,shift:_i}):vn.push({type:"elem",elem:rr,shift:_i})}Xr=Ie({positionType:"individualShift",children:vn})}if(Qe.length===0)return K(["mord"],[Xr],t);var vr=Ie({positionType:"individualShift",children:Qe}),H=K(["tag"],[vr],t);return Kn([Xr,H])},fN={c:"center ",l:"left ",r:"right "},pn=function(e,t){for(var n=[],i=new X("mtd",[],["mtr-glue"]),s=new X("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],c=0;c<a.length;c++)l.push(new X("mtd",[_e(a[c],t)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new X("mtr",l))}var u=new X("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);u.setAttribute("rowspacing",Q(d));var h="",f="";if(e.cols&&e.cols.length>0){var m=e.cols,y="",b=!1,v=0,k=m.length;m[0].type==="separator"&&(h+="top ",v=1),m[m.length-1].type==="separator"&&(h+="bottom ",k-=1);for(var M=v;M<k;M++){var D=m[M];D.type==="align"?(f+=fN[D.align],b&&(y+="none "),b=!0):D.type==="separator"&&b&&(y+=D.separator==="|"?"solid ":"dashed ",b=!1)}u.setAttribute("columnalign",f.trim()),/[sd]/.test(y)&&u.setAttribute("columnlines",y.trim())}if(e.colSeparationType==="align"){for(var O=e.cols||[],z="",T=1;T<O.length;T++)z+=T%2?"0em ":"1em ";u.setAttribute("columnspacing",z.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var B="",N=e.hLinesBeforeRow;h+=N[0].length>0?"left ":"",h+=N[N.length-1].length>0?"right ":"";for(var q=1;q<N.length-1;q++)B+=N[q].length===0?"none ":N[q][0]?"dashed ":"solid ";return/[sd]/.test(B)&&u.setAttribute("rowlines",B.trim()),h!==""&&(u=new X("menclose",[u]),u.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(u=new X("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},H6=function(e,t){e.envName.includes("ed")||Lu(e);var n=[],i=e.envName==="split",s=Pi(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:Mm(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var c="",u=0;u<t[0].body.length;u++){var d=we(t[0].body[u],"textord");c+=d.text}o=Number(c),a=o*2}var h=!a;s.body.forEach(function(b){for(var v=1;v<b.length;v+=2){var k=we(b[v],"styling"),M=we(k.body[0],"ordgroup");M.body.unshift(l)}if(h)a<b.length&&(a=b.length);else{var D=b.length/2;if(o<D)throw new Y("Too many math in a row: "+("expected "+o+", but got "+D),b[0])}});for(var f=0;f<a;++f){var m="r",y=0;f%2===1?m="l":f>0&&h&&(y=1),n[f]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=h?"align":"alignat",s};hn({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Ru(e[0]),n=t?[e[0]]:we(e[0],"ordgroup").body,i=n.map(function(o){var a=Ou(o),l=a.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Y("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Pi(r.parser,s,Tm(r.envName))},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,!"lcr".includes(t))throw new Y("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=Pi(r.parser,n,Tm(r.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=Pi(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Ru(e[0]),n=t?[e[0]]:we(e[0],"ordgroup").body,i=n.map(function(a){var l=Ou(a),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new Y("Unknown column alignment: "+c,a)});if(i.length>1)throw new Y("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=Pi(r.parser,s,"script");if(o.body.length>0&&o.body[0].length>1)throw new Y("{subarray} can contain only one column");return o},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Pi(r.parser,e,Tm(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.includes("r")?".":"\\{",right:r.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:H6,htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){hN.has(r.envName)&&Lu(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Mm(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return Pi(r.parser,e,"display")},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:H6,htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Lu(r);var e={autoTag:Mm(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return Pi(r.parser,e,"display")},htmlBuilder:fn,mathmlBuilder:pn});hn({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Lu(r),YA(r.parser)},htmlBuilder:fn,mathmlBuilder:pn});x("\\nonumber","\\gdef\\@eqnsw{0}");x("\\notag","\\nonumber");ne({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(r,e){throw new Y(r.funcName+" valid only within array environment")}});var M4=$6;ne({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new Y("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=we(i.body[o],"textord").text;if(n==="\\begin"){if(!M4.hasOwnProperty(s))throw new Y("No such environment: "+s,i);var a=M4[s],{args:l,optArgs:c}=t.parseArguments("\\begin{"+s+"}",a),u={mode:t.mode,envName:s,parser:t},d=a.handler(u,l,c);t.expect("\\end",!1);var h=t.nextToken,f=we(t.parseFunction(),"environment");if(f.name!==s)throw new Y("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:t.mode,name:s,nameGroup:i}}});var pN=(r,e)=>{var t=r.font,n=e.withFont(t);return ze(r.body,n)},mN=(r,e)=>{var t=r.font,n=e.withFont(t);return _e(r.body,n)},T4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ne({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=V0(e[0]),s=n in T4?T4[n]:n;return{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:pN,mathmlBuilder:mN});ne({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:Iu(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:Wn(n)}}});ne({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:t.mode,body:o}}}});var gN=(r,e)=>{var t=e.style,n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=ze(r.numer,s,e);if(r.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var c=ze(r.denom,s,e),u,d,h;r.hasBarLine?(r.barSize?(d=Ge(r.barSize,e),u=fa("frac-line",e,d)):u=fa("frac-line",e),d=u.height,h=u.height):(u=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,m,y;t.size===ye.DISPLAY.size?(f=e.fontMetrics().num1,d>0?m=3*h:m=7*h,y=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,m=h):(f=e.fontMetrics().num3,m=3*h),y=e.fontMetrics().denom2);var b;if(u){var k=e.fontMetrics().axisHeight;f-o.depth-(k+.5*d)<m&&(f+=m-(f-o.depth-(k+.5*d))),k-.5*d-(c.height-y)<m&&(y+=m-(k-.5*d-(c.height-y)));var M=-(k-.5*d);b=Ie({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:u,shift:M},{type:"elem",elem:o,shift:-f}]})}else{var v=f-o.depth-(c.height-y);v<m&&(f+=.5*(m-v),y+=.5*(m-v)),b=Ie({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:o,shift:-f}]})}s=e.havingStyle(t),b.height*=s.sizeMultiplier/e.sizeMultiplier,b.depth*=s.sizeMultiplier/e.sizeMultiplier;var D;t.size===ye.DISPLAY.size?D=e.fontMetrics().delim1:t.size===ye.SCRIPTSCRIPT.size?D=e.havingStyle(ye.SCRIPT).fontMetrics().delim2:D=e.fontMetrics().delim2;var O,z;return r.leftDelim==null?O=Tl(e,["mopen"]):O=vf(r.leftDelim,D,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?z=K([]):r.rightDelim==null?z=Tl(e,["mclose"]):z=vf(r.rightDelim,D,!0,e.havingStyle(t),r.mode,["mclose"]),K(["mord"].concat(s.sizingClasses(e)),[O,K(["mfrac"],[b]),z],e)},yN=(r,e)=>{var t=new X("mfrac",[_e(r.numer,e),_e(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Ge(r.barSize,e);t.setAttribute("linethickness",Q(n))}if(r.leftDelim!=null||r.rightDelim!=null){var i=[];if(r.leftDelim!=null){var s=new X("mo",[new st(r.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(t),r.rightDelim!=null){var o=new X("mo",[new st(r.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return xm(i)}return t},_6=(r,e)=>{if(!e)return r;var t={type:"styling",mode:r.mode,style:e,body:[r]};return t};ne({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,a=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=n==="\\cfrac",u=null;return c||n.startsWith("\\d")?u="display":n.startsWith("\\t")&&(u="text"),_6({type:"genfrac",mode:t.mode,numer:i,denom:s,continued:c,hasBarLine:o,leftDelim:a,rightDelim:l,barSize:null},u)},htmlBuilder:gN,mathmlBuilder:yN});ne({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var A4=["display","text","script","scriptscript"],N4=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};ne({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=V0(e[0]),o=s.type==="atom"&&s.family==="open"?N4(s.text):null,a=V0(e[1]),l=a.type==="atom"&&a.family==="close"?N4(a.text):null,c=we(e[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var h=null,f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var m=we(f.body[0],"textord");h=A4[Number(m.text)]}}else f=we(f,"textord"),h=A4[Number(f.text)];return _6({type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:l},h)}});ne({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:we(e[0],"size").value,token:i}}});ne({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=we(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var o=e[2],a=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null}}});var j6=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?ze(r.sup,e.havingStyle(t.sup()),e):ze(r.sub,e.havingStyle(t.sub()),e),i=we(r.base,"horizBrace")):i=we(r,"horizBrace");var s=ze(i.base,e.havingBaseStyle(ye.DISPLAY)),o=Du(i,e),a;if(i.isOver?a=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):a=Ie({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){var l=K(["minner",i.isOver?"mover":"munder"],[a],e);i.isOver?a=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):a=Ie({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return K(["minner",i.isOver?"mover":"munder"],[a],e)},vN=(r,e)=>{var t=Eu(r.label);return new X(r.isOver?"mover":"munder",[_e(r.base,e),t])};ne({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:j6,mathmlBuilder:vN});ne({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(r,e)=>{var{parser:t}=r,n=e[1],i=we(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:it(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=dt(r.body,e,!1);return xA(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Oi(r.body,e);return t instanceof X||(t=new X("mrow",[t])),t.setAttribute("href",r.href),t}});ne({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(r,e)=>{var{parser:t}=r,n=we(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:it(a)}}});ne({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:it(e[0])}},htmlBuilder(r,e){var t=dt(r.body,e.withFont(""),!1);return Kn(t)},mathmlBuilder(r,e){return new X("mrow",gr(r.body,e.withFont("")))}});ne({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,s=we(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),u=0;u<c.length;u++){var d=c[u],h=d.indexOf("=");if(h<0)throw new Y("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),m=d.slice(h+1);l["data-"+f.trim()]=m}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(a)?{type:"html",mode:t.mode,attributes:l,body:it(o)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=dt(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=K(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Oi(r.body,e)});ne({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:it(e[0]),mathml:it(e[1])}},htmlBuilder:(r,e)=>{var t=dt(r.html,e,!1);return Kn(t)},mathmlBuilder:(r,e)=>Oi(r.mathml,e)});var Zd=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Y("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!h6(n))throw new Y("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ne({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(t[0])for(var l=we(t[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=Zd(h);break;case"height":s=Zd(h);break;case"totalheight":o=Zd(h);break;default:throw new Y("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=we(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=Ge(r.height,e),n=0;r.totalheight.number>0&&(n=Ge(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Ge(r.width,e));var s={height:Q(t+n)};i>0&&(s.width=Q(i)),n>0&&(s.verticalAlign=Q(-n));var o=new uA(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new X("mglyph",[]);t.setAttribute("alt",r.alt);var n=Ge(r.height,e),i=0;if(r.totalheight.number>0&&(i=Ge(r.totalheight,e)-n,t.setAttribute("valign",Q(-i))),t.setAttribute("height",Q(n+i)),r.width.number>0){var s=Ge(r.width,e);t.setAttribute("width",Q(s))}return t.setAttribute("src",r.src),t}});ne({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(r,e){var{parser:t,funcName:n}=r,i=we(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return v6(r.dimension,e)},mathmlBuilder(r,e){var t=Ge(r.dimension,e);return new C6(t)}});ne({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=K([],[ze(r.body,e)]),t=K(["inner"],[t],e)):t=K(["inner"],[ze(r.body,e)]);var n=K(["fix"],[]),i=K([r.alignment],[t,n],e),s=K(["strut"]);return s.style.height=Q(i.height+i.depth),i.depth&&(s.style.verticalAlign=Q(-i.depth)),i.children.unshift(s),i=K(["thinbox"],[i],e),K(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new X("mpadded",[_e(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});ne({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:o}}});ne({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(r,e){throw new Y("Mismatched "+r.funcName)}});var E4=(r,e)=>{switch(e.style.size){case ye.DISPLAY.size:return r.display;case ye.TEXT.size:return r.text;case ye.SCRIPT.size:return r.script;case ye.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};ne({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:it(e[0]),text:it(e[1]),script:it(e[2]),scriptscript:it(e[3])}},htmlBuilder:(r,e)=>{var t=E4(r,e),n=dt(t,e,!1);return Kn(n)},mathmlBuilder:(r,e)=>{var t=E4(r,e);return Oi(t,e)}});var V6=(r,e,t,n,i,s,o)=>{r=K([],[r]);var a=t&&Wn(t),l,c;if(e){var u=ze(e,n.havingStyle(i.sup()),n);c={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(t){var d=ze(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var h;if(c&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+o;h=Ie({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Q(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Q(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var m=r.height-o;h=Ie({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Q(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r}]})}else if(c){var y=r.depth+o;h=Ie({positionType:"bottom",positionData:y,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Q(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return r;var b=[h];if(l&&s!==0&&!a){var v=K(["mspace"],[],n);v.style.marginRight=Q(s),b.unshift(v)}return K(["mop","op-limits"],b,n)},W6=new Set(["\\smallint"]),U6=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=we(r.base,"op"),i=!0):s=we(r,"op");var o=e.style,a=!1;o.size===ye.DISPLAY.size&&s.symbol&&!W6.has(s.name)&&(a=!0);var l,c;if(s.symbol){var u=a?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=Bt(s.name,u,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),c=l.italic,d.length>0){var h=w6(d+"Size"+(a?"2":"1"),e);l=Ie({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=c}}else if(s.body){var f=dt(s.body,e,!0);f.length===1&&f[0]instanceof hr?(l=f[0],l.classes[0]="mop"):l=K(["mop"],f,e)}else{for(var m=[],y=1;y<s.name.length;y++)m.push(wm(s.name[y],s.mode,e));l=K(["mop"],m,e)}var b=0,v=0;if((l instanceof hr||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift){var k;b=(l.height-l.depth)/2-e.fontMetrics().axisHeight,v=(k=l.italic)!=null?k:0}return i?V6(l,t,n,e,o,v,b):(b&&(l.style.position="relative",l.style.top=Q(b)),l)},bN=(r,e)=>{var t;if(r.symbol)t=new X("mo",[Rr(r.name,r.mode)]),W6.has(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new X("mo",gr(r.body,e));else{t=new X("mi",[new st(r.name.slice(1))]);var n=new X("mo",[Rr("","text")]);r.parentIsSupSub?t=new X("mrow",[t,n]):t=S6([t,n])}return t},wN={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ne({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=wN[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:U6,mathmlBuilder:bN});ne({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:it(n)}}});var kN={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ne({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}}});ne({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}}});ne({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=kN[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var K6=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=we(r.base,"operatorname"),i=!0):s=we(r,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h="text"in d?d.text:void 0;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=dt(a,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof hr&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=K(["mop"],l,e)}else o=K(["mop"],[],e);return i?V6(o,t,n,e,e.style,0,0):o},xN=(r,e)=>{for(var t=gr(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var s=t[i];if(!(s instanceof C6))if(s instanceof X)switch(s.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof st?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=t.map(u=>u.toText()).join("");t=[new st(a)]}var l=new X("mi",t);l.setAttribute("mathvariant","normal");var c=new X("mo",[Rr("","text")]);return r.parentIsSupSub?new X("mrow",[l,c]):S6([l,c])};ne({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:it(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:K6,mathmlBuilder:xN});x("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Vs({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?Kn(dt(r.body,e,!1)):K(["mord"],dt(r.body,e,!0),e)},mathmlBuilder(r,e){return Oi(r.body,e,!0)}});ne({type:"overline",names:["\\overline"],numArgs:1,handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=ze(r.body,e.havingCrampedStyle()),n=fa("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return K(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new X("mo",[new st("‾")]);t.setAttribute("stretchy","true");var n=new X("mover",[_e(r.body,e),t]);return n.setAttribute("accent","true"),n}});ne({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:it(n)}},htmlBuilder:(r,e)=>{var t=dt(r.body,e.withPhantom(),!1);return Kn(t)},mathmlBuilder:(r,e)=>{var t=gr(r.body,e);return new X("mphantom",t)}});x("\\hphantom","\\smash{\\phantom{#1}}");ne({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=K(["inner"],[ze(r.body,e.withPhantom())]),n=K(["fix"],[]);return K(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=gr(it(r.body),e),n=new X("mphantom",t),i=new X("mpadded",[n]);return i.setAttribute("width","0px"),i}});ne({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(r,e){var{parser:t}=r,n=we(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=ze(r.body,e),n=Ge(r.dy,e);return Ie({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new X("mpadded",[_e(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});ne({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});ne({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(r,e,t){var{parser:n}=r,i=t[0],s=we(e[0],"size"),o=we(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&we(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=K(["mord","rule"],[],e),n=Ge(r.width,e),i=Ge(r.height,e),s=r.shift?Ge(r.shift,e):0;return t.style.borderRightWidth=Q(n),t.style.borderTopWidth=Q(i),t.style.bottom=Q(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Ge(r.width,e),n=Ge(r.height,e),i=r.shift?Ge(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new X("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Q(t)),o.setAttribute("height",Q(n));var a=new X("mpadded",[o]);return i>=0?a.setAttribute("height",Q(i)):(a.setAttribute("height",Q(i)),a.setAttribute("depth",Q(-i))),a.setAttribute("voffset",Q(i)),a}});function G6(r,e,t){for(var n=dt(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(t)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+t.size),n[s].height*=i,n[s].depth*=i}return Kn(n)}var D4=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],SN=(r,e)=>{var t=e.havingSize(r.size);return G6(r.body,t,e)};ne({type:"sizing",names:D4,numArgs:0,allowedInText:!0,handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:D4.indexOf(n)+1,body:s}},htmlBuilder:SN,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=gr(r.body,t),i=new X("mstyle",n);return i.setAttribute("mathsize",Q(t.sizeMultiplier)),i}});ne({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&we(t[0],"ordgroup");if(o)for(var a,l=0;l<o.body.length;++l){var c=o.body[l];if(a=Ou(c).text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var u=e[0];return{type:"smash",mode:n.mode,body:u,smashHeight:i,smashDepth:s}},htmlBuilder:(r,e)=>{var t=K([],[ze(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0),r.smashDepth&&(t.depth=0),r.smashHeight&&r.smashDepth)return K(["mord","smash"],[t],e);if(t.children)for(var n=0;n<t.children.length;n++)r.smashHeight&&(t.children[n].height=0),r.smashDepth&&(t.children[n].depth=0);var i=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:t}]});return K(["mord"],[i],e)},mathmlBuilder:(r,e)=>{var t=new X("mpadded",[_e(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});ne({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=ze(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=pa(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<ye.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=t.height+t.depth+o+i,{span:l,ruleWidth:c,advanceWidth:u}=iN(a,e),d=l.height-c;d>t.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var h=l.height-t.height-o-c;t.style.paddingLeft=Q(u);var f=Ie({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+h)},{type:"elem",elem:l},{type:"kern",size:c}]});if(r.index){var m=e.havingStyle(ye.SCRIPTSCRIPT),y=ze(r.index,m,e),b=.6*(f.height-f.depth),v=Ie({positionType:"shift",positionData:-b,children:[{type:"elem",elem:y}]}),k=K(["root"],[v]);return K(["mord","sqrt"],[k,f],e)}else return K(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new X("mroot",[_e(t,e),_e(n,e)]):new X("msqrt",[_e(t,e)])}});var bf={display:ye.DISPLAY,text:ye.TEXT,script:ye.SCRIPT,scriptscript:ye.SCRIPTSCRIPT};function CN(r){return r in bf}ne({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);if(!CN(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=bf[r.style],n=e.havingStyle(t);return r.resetFont&&(n=n.withFont("")),G6(r.body,n,e)},mathmlBuilder(r,e){var t=bf[r.style],n=e.havingStyle(t);r.resetFont&&(n=n.withFont(""));var i=gr(r.body,n),s=new X("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[r.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var MN=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===ye.DISPLAY.size||n.alwaysHandleSupSub);return i?U6:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===ye.DISPLAY.size||n.limits);return s?K6:null}else{if(n.type==="accent")return Wn(n.base)?N6:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?j6:null}else return null}else return null};Vs({type:"supsub",htmlBuilder(r,e){var t=MN(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=ze(n,e),a,l,c=e.fontMetrics(),u=0,d=0,h=n&&Wn(n);if(i){var f=e.havingStyle(e.style.sup());a=ze(i,f,e),h||(u=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var m=e.havingStyle(e.style.sub());l=ze(s,m,e),h||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var y;e.style===ye.DISPLAY?y=c.sup1:e.style.cramped?y=c.sup3:y=c.sup2;var b=e.sizeMultiplier,v=Q(.5/c.ptPerEm/b),k=null;if(l){var M=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");if(o instanceof hr||M){var D;k=Q(-((D=o.italic)!=null?D:0))}}var O;if(a&&l){u=Math.max(u,y,a.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var z=c.defaultRuleThickness,T=4*z;if(u-a.depth-(l.height-d)<T){d=T-(u-a.depth)+l.height;var B=.8*c.xHeight-(u-a.depth);B>0&&(u+=B,d-=B)}var N=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:k},{type:"elem",elem:a,shift:-u,marginRight:v}];O=Ie({positionType:"individualShift",children:N})}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var q=[{type:"elem",elem:l,marginLeft:k,marginRight:v}];O=Ie({positionType:"shift",positionData:d,children:q})}else if(a)u=Math.max(u,y,a.depth+.25*c.xHeight),O=Ie({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var te=pf(o,"right")||"mord";return K([te],[o,K(["msupsub"],[O])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[_e(r.base,e)];r.sub&&s.push(_e(r.sub,e)),r.sup&&s.push(_e(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===ye.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===ye.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===ye.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ye.DISPLAY)?o="munder":o="msub"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===ye.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===ye.DISPLAY)?o="mover":o="msup"}return new X(o,s)}});Vs({type:"atom",htmlBuilder(r,e){return wm(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new X("mo",[Rr(r.text,r.mode)]);if(r.family==="bin"){var n=Sm(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var J6={mi:"italic",mn:"normal",mtext:"normal"};Vs({type:"mathord",htmlBuilder(r,e){return Nu(r,e)},mathmlBuilder(r,e){var t=new X("mi",[Rr(r.text,r.mode,e)]),n=Sm(r,e)||"italic";return n!==J6[t.type]&&t.setAttribute("mathvariant",n),t}});Vs({type:"textord",htmlBuilder(r,e){return Nu(r,e)},mathmlBuilder(r,e){var t=Rr(r.text,r.mode,e),n=Sm(r,e)||"normal",i;return r.mode==="text"?i=new X("mtext",[t]):/[0-9]/.test(r.text)?i=new X("mn",[t]):r.text==="\\prime"?i=new X("mo",[t]):i=new X("mi",[t]),n!==J6[i.type]&&i.setAttribute("mathvariant",n),i}});var Qd={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},eh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Vs({type:"spacing",htmlBuilder(r,e){if(eh.hasOwnProperty(r.text)){var t=eh[r.text].className||"";if(r.mode==="text"){var n=Nu(r,e);return n.classes.push(t),n}else return K(["mspace",t],[wm(r.text,r.mode,e)],e)}else{if(Qd.hasOwnProperty(r.text))return K(["mspace",Qd[r.text]],[],e);throw new Y('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(eh.hasOwnProperty(r.text))t=new X("mtext",[new st(" ")]);else{if(Qd.hasOwnProperty(r.text))return new X("mspace");throw new Y('Unknown type of space "'+r.text+'"')}return t}});var O4=()=>{var r=new X("mtd",[]);return r.setAttribute("width","50%"),r};Vs({type:"tag",mathmlBuilder(r,e){var t=new X("mtable",[new X("mtr",[O4(),new X("mtd",[Oi(r.body,e)]),O4(),new X("mtd",[Oi(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var R4={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},I4={"\\textbf":"textbf","\\textmd":"textmd"},TN={"\\textit":"textit","\\textup":"textup"},z4=(r,e)=>{var t=r.font;if(t){if(R4[t])return e.withTextFontFamily(R4[t]);if(I4[t])return e.withTextFontWeight(I4[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(TN[t])};ne({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:it(i),font:n}},htmlBuilder(r,e){var t=z4(r,e),n=dt(r.body,t,!0);return K(["mord","text"],n,t)},mathmlBuilder(r,e){var t=z4(r,e);return Oi(r.body,t)}});ne({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ze(r.body,e),n=fa("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=Ie({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]});return K(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new X("mo",[new st("‾")]);t.setAttribute("stretchy","true");var n=new X("munder",[_e(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});ne({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ze(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return Ie({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new X("mpadded",[_e(r.body,e)],["vcenter"]);return new X("mrow",[t])}});ne({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(r,e,t){throw new Y("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=L4(r),n=[],i=e.havingStyle(e.style.text()),s=0;s<t.length;s++){var o=t[s];o==="~"&&(o="\\textasciitilde"),n.push(Bt(o,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return K(["mord","text"].concat(i.sizingClasses(e)),y6(n),i)},mathmlBuilder(r,e){var t=new st(L4(r)),n=new X("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var L4=r=>r.body.replace(/ /g,r.star?"␣":" "),vi=k6,Y6=`[ \r
|
|
1181
|
+
]`,AN="\\\\[a-zA-Z@]+",NN="\\\\[^\uD800-\uDFFF]",EN="("+AN+")"+Y6+"*",DN=`\\\\(
|
|
1182
|
+
|[ \r ]+
|
|
1183
|
+
?)[ \r ]*`,wf="[̀-ͯ]",ON=new RegExp(wf+"+$"),RN="("+Y6+"+)|"+(DN+"|")+"([!-\\[\\]-‧-豈-]"+(wf+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(wf+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+EN)+("|"+NN+")");class B4{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(RN,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new dr("EOF",new Jt(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new Y("Unexpected character: '"+e[t]+"'",new dr(e[t],new Jt(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
|
|
1184
|
+
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new dr(i,new Jt(this,t,this.tokenRegex.lastIndex))}}class IN{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Y("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var zN=q6;x("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});x("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});x("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});x("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});x("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});x("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");x("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var P4={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};x("\\char",function(r){var e=r.popToken(),t,n=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Y("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=P4[e.text],n==null||n>=t)throw new Y("Invalid base-"+t+" digit "+e.text);for(var i;(i=P4[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var Am=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new Y("\\newcommand's first argument must be a macro name");var s=i[0].text,o=r.isDefined(s);if(o&&!e)throw new Y("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!t)throw new Y("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Y("Invalid number of arguments: "+l);a=parseInt(l),i=r.consumeArg().tokens}return o&&n||r.macros.set(s,{tokens:i,numArgs:a}),""};x("\\newcommand",r=>Am(r,!1,!0,!1));x("\\renewcommand",r=>Am(r,!0,!1,!1));x("\\providecommand",r=>Am(r,!0,!0,!0));x("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});x("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});x("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),vi[t],We.math[t],We.text[t]),""});x("\\bgroup","{");x("\\egroup","}");x("~","\\nobreakspace");x("\\lq","`");x("\\rq","'");x("\\aa","\\r a");x("\\AA","\\r A");x("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");x("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");x("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");x("ℬ","\\mathscr{B}");x("ℰ","\\mathscr{E}");x("ℱ","\\mathscr{F}");x("ℋ","\\mathscr{H}");x("ℐ","\\mathscr{I}");x("ℒ","\\mathscr{L}");x("ℳ","\\mathscr{M}");x("ℛ","\\mathscr{R}");x("ℭ","\\mathfrak{C}");x("ℌ","\\mathfrak{H}");x("ℨ","\\mathfrak{Z}");x("\\Bbbk","\\Bbb{k}");x("\\llap","\\mathllap{\\textrm{#1}}");x("\\rlap","\\mathrlap{\\textrm{#1}}");x("\\clap","\\mathclap{\\textrm{#1}}");x("\\mathstrut","\\vphantom{(}");x("\\underbar","\\underline{\\text{#1}}");x("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');x("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");x("\\ne","\\neq");x("≠","\\neq");x("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");x("∉","\\notin");x("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");x("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");x("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");x("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");x("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");x("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");x("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");x("⟂","\\perp");x("‼","\\mathclose{!\\mkern-0.8mu!}");x("∌","\\notni");x("⌜","\\ulcorner");x("⌝","\\urcorner");x("⌞","\\llcorner");x("⌟","\\lrcorner");x("©","\\copyright");x("®","\\textregistered");x("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');x("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');x("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');x("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');x("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");x("⋮","\\vdots");x("\\varGamma","\\mathit{\\Gamma}");x("\\varDelta","\\mathit{\\Delta}");x("\\varTheta","\\mathit{\\Theta}");x("\\varLambda","\\mathit{\\Lambda}");x("\\varXi","\\mathit{\\Xi}");x("\\varPi","\\mathit{\\Pi}");x("\\varSigma","\\mathit{\\Sigma}");x("\\varUpsilon","\\mathit{\\Upsilon}");x("\\varPhi","\\mathit{\\Phi}");x("\\varPsi","\\mathit{\\Psi}");x("\\varOmega","\\mathit{\\Omega}");x("\\substack","\\begin{subarray}{c}#1\\end{subarray}");x("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");x("\\boxed","\\fbox{$\\displaystyle{#1}$}");x("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");x("\\implies","\\DOTSB\\;\\Longrightarrow\\;");x("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");x("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");x("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var F4={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},LN=new Set(["bin","rel"]);x("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in F4?e=F4[t]:(t.slice(0,4)==="\\not"||t in We.math&&LN.has(We.math[t].group))&&(e="\\dotsb"),e});var Nm={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};x("\\dotso",function(r){var e=r.future().text;return e in Nm?"\\ldots\\,":"\\ldots"});x("\\dotsc",function(r){var e=r.future().text;return e in Nm&&e!==","?"\\ldots\\,":"\\ldots"});x("\\cdots",function(r){var e=r.future().text;return e in Nm?"\\@cdots\\,":"\\@cdots"});x("\\dotsb","\\cdots");x("\\dotsm","\\cdots");x("\\dotsi","\\!\\cdots");x("\\dotsx","\\ldots\\,");x("\\DOTSI","\\relax");x("\\DOTSB","\\relax");x("\\DOTSX","\\relax");x("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");x("\\,","\\tmspace+{3mu}{.1667em}");x("\\thinspace","\\,");x("\\>","\\mskip{4mu}");x("\\:","\\tmspace+{4mu}{.2222em}");x("\\medspace","\\:");x("\\;","\\tmspace+{5mu}{.2777em}");x("\\thickspace","\\;");x("\\!","\\tmspace-{3mu}{.1667em}");x("\\negthinspace","\\!");x("\\negmedspace","\\tmspace-{4mu}{.2222em}");x("\\negthickspace","\\tmspace-{5mu}{.277em}");x("\\enspace","\\kern.5em ");x("\\enskip","\\hskip.5em\\relax");x("\\quad","\\hskip1em\\relax");x("\\qquad","\\hskip2em\\relax");x("\\tag","\\@ifstar\\tag@literal\\tag@paren");x("\\tag@paren","\\tag@literal{({#1})}");x("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new Y("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});x("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");x("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");x("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");x("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");x("\\newline","\\\\\\relax");x("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var X6=Q(an["Main-Regular"][84][1]-.7*an["Main-Regular"][65][1]);x("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+X6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");x("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+X6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");x("\\hspace","\\@ifstar\\@hspacer\\@hspace");x("\\@hspace","\\hskip #1\\relax");x("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");x("\\ordinarycolon",":");x("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");x("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');x("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');x("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');x("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');x("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');x("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');x("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');x("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');x("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');x("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');x("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');x("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');x("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');x("∷","\\dblcolon");x("∹","\\eqcolon");x("≔","\\coloneqq");x("≕","\\eqqcolon");x("⩴","\\Coloneqq");x("\\ratio","\\vcentcolon");x("\\coloncolon","\\dblcolon");x("\\colonequals","\\coloneqq");x("\\coloncolonequals","\\Coloneqq");x("\\equalscolon","\\eqqcolon");x("\\equalscoloncolon","\\Eqqcolon");x("\\colonminus","\\coloneq");x("\\coloncolonminus","\\Coloneq");x("\\minuscolon","\\eqcolon");x("\\minuscoloncolon","\\Eqcolon");x("\\coloncolonapprox","\\Colonapprox");x("\\coloncolonsim","\\Colonsim");x("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");x("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");x("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");x("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");x("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");x("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");x("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");x("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");x("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");x("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");x("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");x("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");x("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");x("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");x("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");x("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");x("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");x("\\nleqq","\\html@mathml{\\@nleqq}{≰}");x("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");x("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");x("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");x("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");x("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");x("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");x("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");x("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");x("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");x("\\imath","\\html@mathml{\\@imath}{ı}");x("\\jmath","\\html@mathml{\\@jmath}{ȷ}");x("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");x("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");x("⟦","\\llbracket");x("⟧","\\rrbracket");x("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");x("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");x("⦃","\\lBrace");x("⦄","\\rBrace");x("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");x("⦵","\\minuso");x("\\darr","\\downarrow");x("\\dArr","\\Downarrow");x("\\Darr","\\Downarrow");x("\\lang","\\langle");x("\\rang","\\rangle");x("\\uarr","\\uparrow");x("\\uArr","\\Uparrow");x("\\Uarr","\\Uparrow");x("\\N","\\mathbb{N}");x("\\R","\\mathbb{R}");x("\\Z","\\mathbb{Z}");x("\\alef","\\aleph");x("\\alefsym","\\aleph");x("\\Alpha","\\mathrm{A}");x("\\Beta","\\mathrm{B}");x("\\bull","\\bullet");x("\\Chi","\\mathrm{X}");x("\\clubs","\\clubsuit");x("\\cnums","\\mathbb{C}");x("\\Complex","\\mathbb{C}");x("\\Dagger","\\ddagger");x("\\diamonds","\\diamondsuit");x("\\empty","\\emptyset");x("\\Epsilon","\\mathrm{E}");x("\\Eta","\\mathrm{H}");x("\\exist","\\exists");x("\\harr","\\leftrightarrow");x("\\hArr","\\Leftrightarrow");x("\\Harr","\\Leftrightarrow");x("\\hearts","\\heartsuit");x("\\image","\\Im");x("\\infin","\\infty");x("\\Iota","\\mathrm{I}");x("\\isin","\\in");x("\\Kappa","\\mathrm{K}");x("\\larr","\\leftarrow");x("\\lArr","\\Leftarrow");x("\\Larr","\\Leftarrow");x("\\lrarr","\\leftrightarrow");x("\\lrArr","\\Leftrightarrow");x("\\Lrarr","\\Leftrightarrow");x("\\Mu","\\mathrm{M}");x("\\natnums","\\mathbb{N}");x("\\Nu","\\mathrm{N}");x("\\Omicron","\\mathrm{O}");x("\\plusmn","\\pm");x("\\rarr","\\rightarrow");x("\\rArr","\\Rightarrow");x("\\Rarr","\\Rightarrow");x("\\real","\\Re");x("\\reals","\\mathbb{R}");x("\\Reals","\\mathbb{R}");x("\\Rho","\\mathrm{P}");x("\\sdot","\\cdot");x("\\sect","\\S");x("\\spades","\\spadesuit");x("\\sub","\\subset");x("\\sube","\\subseteq");x("\\supe","\\supseteq");x("\\Tau","\\mathrm{T}");x("\\thetasym","\\vartheta");x("\\weierp","\\wp");x("\\Zeta","\\mathrm{Z}");x("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");x("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");x("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");x("\\bra","\\mathinner{\\langle{#1}|}");x("\\ket","\\mathinner{|{#1}\\rangle}");x("\\braket","\\mathinner{\\langle{#1}\\rangle}");x("\\Bra","\\left\\langle#1\\right|");x("\\Ket","\\left|#1\\right\\rangle");var Z6=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>h=>{r&&(h.macros.set("|",o),i.length&&h.macros.set("\\|",a));var f=d;if(!d&&i.length){var m=h.future();m.text==="|"&&(h.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,u=e.expandTokens([...s,...c,...t]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};x("\\bra@ket",Z6(!1));x("\\bra@set",Z6(!0));x("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");x("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");x("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");x("\\angln","{\\angl n}");x("\\blue","\\textcolor{##6495ed}{#1}");x("\\orange","\\textcolor{##ffa500}{#1}");x("\\pink","\\textcolor{##ff00af}{#1}");x("\\red","\\textcolor{##df0030}{#1}");x("\\green","\\textcolor{##28ae7b}{#1}");x("\\gray","\\textcolor{gray}{#1}");x("\\purple","\\textcolor{##9d38bd}{#1}");x("\\blueA","\\textcolor{##ccfaff}{#1}");x("\\blueB","\\textcolor{##80f6ff}{#1}");x("\\blueC","\\textcolor{##63d9ea}{#1}");x("\\blueD","\\textcolor{##11accd}{#1}");x("\\blueE","\\textcolor{##0c7f99}{#1}");x("\\tealA","\\textcolor{##94fff5}{#1}");x("\\tealB","\\textcolor{##26edd5}{#1}");x("\\tealC","\\textcolor{##01d1c1}{#1}");x("\\tealD","\\textcolor{##01a995}{#1}");x("\\tealE","\\textcolor{##208170}{#1}");x("\\greenA","\\textcolor{##b6ffb0}{#1}");x("\\greenB","\\textcolor{##8af281}{#1}");x("\\greenC","\\textcolor{##74cf70}{#1}");x("\\greenD","\\textcolor{##1fab54}{#1}");x("\\greenE","\\textcolor{##0d923f}{#1}");x("\\goldA","\\textcolor{##ffd0a9}{#1}");x("\\goldB","\\textcolor{##ffbb71}{#1}");x("\\goldC","\\textcolor{##ff9c39}{#1}");x("\\goldD","\\textcolor{##e07d10}{#1}");x("\\goldE","\\textcolor{##a75a05}{#1}");x("\\redA","\\textcolor{##fca9a9}{#1}");x("\\redB","\\textcolor{##ff8482}{#1}");x("\\redC","\\textcolor{##f9685d}{#1}");x("\\redD","\\textcolor{##e84d39}{#1}");x("\\redE","\\textcolor{##bc2612}{#1}");x("\\maroonA","\\textcolor{##ffbde0}{#1}");x("\\maroonB","\\textcolor{##ff92c6}{#1}");x("\\maroonC","\\textcolor{##ed5fa6}{#1}");x("\\maroonD","\\textcolor{##ca337c}{#1}");x("\\maroonE","\\textcolor{##9e034e}{#1}");x("\\purpleA","\\textcolor{##ddd7ff}{#1}");x("\\purpleB","\\textcolor{##c6b9fc}{#1}");x("\\purpleC","\\textcolor{##aa87ff}{#1}");x("\\purpleD","\\textcolor{##7854ab}{#1}");x("\\purpleE","\\textcolor{##543b78}{#1}");x("\\mintA","\\textcolor{##f5f9e8}{#1}");x("\\mintB","\\textcolor{##edf2df}{#1}");x("\\mintC","\\textcolor{##e0e5cc}{#1}");x("\\grayA","\\textcolor{##f6f7f7}{#1}");x("\\grayB","\\textcolor{##f0f1f2}{#1}");x("\\grayC","\\textcolor{##e3e5e6}{#1}");x("\\grayD","\\textcolor{##d6d8da}{#1}");x("\\grayE","\\textcolor{##babec2}{#1}");x("\\grayF","\\textcolor{##888d93}{#1}");x("\\grayG","\\textcolor{##626569}{#1}");x("\\grayH","\\textcolor{##3b3e40}{#1}");x("\\grayI","\\textcolor{##21242c}{#1}");x("\\kaBlue","\\textcolor{##314453}{#1}");x("\\kaGreen","\\textcolor{##71B307}{#1}");var Q6={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class BN{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new IN(zN,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new B4(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new dr("EOF",n.loc)),this.pushTokens(i),new dr("",Jt.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new Y("Extra }",s)}else if(s.text==="EOF")throw new Y("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Y("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var s=this.popToken();if(n[i]!==s.text)throw new Y("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(t&&t[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Y("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Y("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new Y("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new Y("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new dr(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(s+1));)++s;for(var a=new B4(i,this.settings),l=[],c=a.lex();c.text!=="EOF";)l.push(c),c=a.lex();l.reverse();var u={tokens:l,numArgs:s};return u}return i}isDefined(e){return this.macros.has(e)||vi.hasOwnProperty(e)||We.math.hasOwnProperty(e)||We.text.hasOwnProperty(e)||Q6.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:vi.hasOwnProperty(e)&&!vi[e].primitive}}var $4=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,a0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),th={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},q4={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Bu{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new BN(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new Y("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new dr("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Bu.endOfExpression.has(i.text)||t&&i.text===t||e&&vi[i.text]&&vi[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++){var s=e[i];if(s.type==="infix"){if(t!==-1)throw new Y("only one infix operator per group",s.token);t=i,n=s.replaceWith}}if(t!==-1&&n){var o,a,l=e.slice(0,t),c=e.slice(t+1);l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?a=c[0]:a={type:"ordgroup",mode:this.mode,body:c};var u;return n==="\\\\abovefrac"?u=this.callFunction(n,[o,e[t],a],[]):u=this.callFunction(n,[o,a],[]),[u]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new Y("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var t=this.parseGroup("atom",e);if((t==null?void 0:t.type)==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(t&&t.type==="op")t.limits=s.text==="\\limits",t.alwaysHandleSupSub=!0;else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=s.text==="\\limits");else throw new Y("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new Y("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new Y("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new Y("Double superscript",s);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();this.fetch().text==="'";)a.push(o),this.consume();this.fetch().text==="^"&&a.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:a}}else if(a0[s.text]){var l=$4.test(s.text),c=[];for(c.push(new dr(a0[s.text])),this.consume();;){var u=this.fetch().text;if(!a0[u]||$4.test(u)!==l)break;c.unshift(new dr(a0[u])),this.consume()}var d=this.subparse(c);l?i={type:"ordgroup",mode:"math",body:d}:n={type:"ordgroup",mode:"math",body:d}}else break}return n&&i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:n?{type:"supsub",mode:this.mode,base:t,sup:n}:i?{type:"supsub",mode:this.mode,base:t,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,s=vi[i];if(!s)return null;if(this.consume(),t&&t!=="atom"&&!s.allowedInArgument)throw new Y("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!s.allowedInText)throw new Y("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&s.allowedInMath===!1)throw new Y("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,n,e)}callFunction(e,t,n,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=vi[e];if(a&&a.handler)return a.handler(o,t,n);throw new Y("No function handler for "+e)}parseArguments(e,t){var n,i=(n=t.numOptionalArgs)!=null?n:0,s=t.numArgs+i;if(s===0)return{args:[],optArgs:[]};for(var o=[],a=[],l=0;l<s;l++){var c,u=(c=t.argTypes)==null?void 0:c[l],d=l<i;("primitive"in t&&t.primitive&&u==null||t.type==="sqrt"&&l===1&&a[0]==null)&&(u="primitive");var h=this.parseGroupOfType("argument to '"+e+"'",u,d);if(d)a.push(h);else if(h!=null)o.push(h);else throw new Y("Null argument, please report this as a bug")}return{args:o,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text",resetFont:!0}:null}case"raw":{var s=this.parseStringGroup(n);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(n)throw new Y("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new Y("Expected group as "+e,this.fetch());return o}case"original":case void 0:return this.parseArgumentGroup(n);default:throw new Y("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n="",i;(i=this.fetch()).text!=="EOF";)n+=i.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new Y("Invalid "+t+": '"+n.text+"'",n);return n.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Y("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new Y("Invalid size: '"+t.text+"'",t);var s={number:+(i[1]+i[2]),unit:i[3]};if(!h6(s))throw new Y("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};return t&&this.switchMode(i),o}parseGroup(e,t){var n=this.fetch(),i=n.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:Jt.range(n,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!Q6.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Y("Undefined control sequence: "+i,n);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n];if(i.type==="textord"){var s=i.text,o=e[n+1];if(!(!o||o.type!=="textord")){if(s==="-"&&o.text==="-"){var a=e[n+2];n+1<t&&a&&a.type==="textord"&&a.text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:Jt.range(i,a),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Jt.range(i,o),text:"--"}),t-=1)}(s==="'"||s==="`")&&o.text===s&&(e.splice(n,2,{type:"textord",mode:"text",loc:Jt.range(i,o),text:s+s}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Y(`\\verb assertion failed --
|
|
1185
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}q4.hasOwnProperty(t[0])&&!We[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=q4[t[0]]+t.slice(1));var s=ON.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var o;if(We[this.mode][t]){this.settings.strict&&this.mode==="math"&&of.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=We[this.mode][t].group,l=Jt.range(e),c;_A(a)?c={type:"atom",mode:this.mode,family:a,loc:l,text:t}:c={type:a,mode:this.mode,loc:l,text:t},o=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(d6(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:Jt.range(e),text:t};else return null;if(this.consume(),s)for(var u=0;u<s[0].length;u++){var d=s[0][u];if(!th[d])throw new Y("Unknown accent ' "+d+"'",e);var h=th[d][this.mode]||th[d].text;if(!h)throw new Y("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Jt.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}Bu.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Em=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Bu(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Y("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new dr("\\df@tag")])}]}return i},ev=function(e,t,n){t.textContent="";var i=Dm(e,n).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),ev=function(){throw new Y("KaTeX doesn't work in quirks mode.")});var PN=function(e,t){var n=Dm(e,t).toMarkup();return n},FN=function(e,t){var n=new gm(t);return Em(e,n)},tv=function(e,t,n){if(n.throwOnError||!(e instanceof Y))throw e;var i=K(["katex-error"],[new hr(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},Dm=function(e,t){var n=new gm(t);try{var i=Em(e,n);return zA(i,e,n)}catch(s){return tv(s,e,n)}},$N=function(e,t){var n=new gm(t);try{var i=Em(e,n);return LA(i,e,n)}catch(s){return tv(s,e,n)}},qN="0.17.0",HN={Span:Ta,Anchor:Tu,SymbolNode:hr,SvgNode:jn,PathNode:Ei,LineNode:sf},rv={version:qN,render:ev,renderToString:PN,ParseError:Y,SETTINGS_SCHEMA:tf,__parse:FN,__renderToDomTree:Dm,__renderToHTMLTree:$N,__setFontMetrics:mA,__defineSymbol:p,__defineFunction:ne,__defineMacro:x,__domTree:HN};const Om=1e3;function _N(r,e=!1){return Pu(r,e).link}function Pu(r,e=!1){const t=r.includes("\\|"),n=t?r.replace(/\\\|/g,"|"):r,i=n.indexOf("|"),s=i===-1?n:n.slice(0,i),o=s.indexOf("#");return{link:{target:o===-1?s:s.slice(0,o),heading:o===-1?null:s.slice(o+1),label:i===-1?null:n.slice(i+1),embed:e},escapedPipe:t}}function Rm(r,e=!1){const t=`${r.target}${r.heading===null?"":`#${r.heading}`}${r.label===null?"":`|${r.label}`}`,n=e?t.replace(/(\\*)\|/g,(i,s)=>`${s}${s.length%2?"\\":""}\\|`):t;return`${r.embed?"!":""}[[${n}]]`}function Im(r){const e=Rm(r).slice(r.embed?3:2,-2);if(e.length===0||e.length>Om||/[[\]\r\n\ufffc]/.test(e)||r.label!==null&&/\\$/.test(r.heading??r.target)||r.heading!==null&&/\\$/.test(r.target))return!1;const t=_N(e,r.embed);return t.target===r.target&&t.heading===r.heading&&t.label===r.label}const Tt={bang:33,leftParen:40,leftBracket:91,backslash:92,rightBracket:93,caret:94};function kf(r){return r!==null&&r<-2}function jN(r,e,t){const n=this.parser.defined;let i=0,s="";const o=d=>(r.enter("wikiLink"),d===Tt.bang?(r.enter("wikiLinkMarker"),r.consume(d),a):(r.enter("wikiLinkMarker"),a(d))),a=d=>d!==Tt.leftBracket?t(d):(r.consume(d),l),l=d=>d!==Tt.leftBracket?t(d):(r.consume(d),r.exit("wikiLinkMarker"),r.enter("wikiLinkData"),c),c=d=>d===null||kf(d)||d===Tt.leftBracket?t(d):d===Tt.rightBracket?i===0?t(d):(r.exit("wikiLinkData"),r.enter("wikiLinkMarker"),r.consume(d),u):++i>Om?t(d):(d===-2?s+=" ":d>=0&&(s+=String.fromCodePoint(d)),r.consume(d),c),u=d=>d!==Tt.rightBracket||(r.consume(d),r.exit("wikiLinkMarker"),r.exit("wikiLink"),n.includes(Ua(s)))?t(d):r.check(VN,t,e);return o}const VN={partial:!0,tokenize(r,e,t){const n=this.parser.defined;let i="",s=0;const o=u=>{r.enter("wikiLinkMarker"),r.consume(u),r.exit("wikiLinkMarker")},a=u=>u===Tt.caret||u===Tt.leftBracket?t(u):l(u),l=u=>u===null||u===Tt.leftBracket?t(u):kf(u)?(i+=`
|
|
1186
|
+
`,r.enter("lineEnding"),r.consume(u),r.exit("lineEnding"),l):u===Tt.backslash?(i+="\\",o(u),c):u===Tt.rightBracket?n.includes(Ua(i))?e(u):t(u):++s>Om?t(u):(u===-2?i+=" ":u>=0&&(i+=String.fromCodePoint(u)),o(u),l),c=u=>u===null||kf(u)?l(u):(u>=0&&(i+=String.fromCodePoint(u)),o(u),l);return u=>u===Tt.leftParen?e(u):u!==Tt.leftBracket?t(u):(o(u),d=>d===Tt.rightBracket?t(d):a(d))}},H4={name:"wikiLink",tokenize:jN,add:"before"};function WN(){return{text:{[Tt.leftBracket]:H4,[Tt.bang]:H4}}}function UN(){let r="";return{enter:{wikiLink(e){r="",this.enter({type:"wikiLink",value:"",target:"",heading:null,label:null,embed:!1},e)}},exit:{wikiLinkData(e){r=this.sliceSerialize(e)},wikiLink(e){const t=this.stack[this.stack.length-1],n=this.sliceSerialize(e),{link:i}=Pu(r,n.startsWith("!"));Object.assign(t,i,{value:n}),this.exit(e)}}}}const KN=(r,e,t)=>nv(r,t.stack.includes("tableCell"));function nv(r,e){const t=iv(r);return t!==null&&!(e&&GN.test(t))?t:Rm(r,e)}const GN=/(^|[^\\])(\\\\)*\|/;function iv(r){const e=r.value;if(typeof e!="string")return null;const t=/^(!?)\[\[([^]*)\]\]$/.exec(e);if(!t)return null;const{link:n}=Pu(t[2],t[1]==="!");return n.target===r.target&&n.heading===r.heading&&n.label===r.label&&n.embed===r.embed?e:null}function JN(){return{handlers:{wikiLink:KN}}}function YN(){const r=this.data();(r.micromarkExtensions??(r.micromarkExtensions=[])).push(WN()),(r.fromMarkdownExtensions??(r.fromMarkdownExtensions=[])).push(UN()),(r.toMarkdownExtensions??(r.toMarkdownExtensions=[])).push(JN())}const ho={extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:r=>r,renderPreview:()=>null,previewToggleButton:r=>r?"Edit":"Hide",previewLabel:"Preview",previewLoading:"Loading..."},Al=Ne(ho,"codeBlockConfigCtx"),_4=new De("blintz-remote-changes"),XN=200,ZN=new Set(["y-sync$"]);function QN(r){var e;for(const t of ZN)if(((e=r.getMeta(t))==null?void 0:e.isChangeOrigin)===!0)return!0;return!1}const eE=QN;function tE(r){return qe(e=>{let t,n=!1;return new Ae({key:_4,state:{init:()=>!1,apply:(i,s)=>i.docChanged&&eE(i)?!0:i.docChanged?!1:s},view:()=>({update:(i,s)=>{!_4.getState(i.state)||i.state.doc.eq(s.doc)||(n||(n=i.state.doc.textContent.length>0||i.state.doc.childCount>1),n&&(clearTimeout(t),t=setTimeout(()=>r(e),XN)))},destroy:()=>clearTimeout(t)})})})}const sv=r=>r.extendSchema(e=>t=>{var i;const n=e(t);return{...n,attrs:{...n.attrs,alignment:{...(i=n.attrs)==null?void 0:i.alignment,default:null}}}}),rE=sv(Ca),nE=sv(Ps);function iE(r){const e=[0];for(let n=0;n<r.length;n++){const i=r.charCodeAt(n);i===13?(r.charCodeAt(n+1)===10&&n++,e.push(n+1)):i===10&&e.push(n+1)}const t=n=>{const i=Math.trunc(n)||0,s=i<0?Math.max(0,r.length+i):Math.min(r.length,i);let o=0,a=e.length;for(;o+1<a;){const l=Math.floor((o+a)/2);e[l]<=s?o=l:a=l}return r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13?{line:o+2,column:1}:{line:o+1,column:s-e[o]+1}};return{range(n,i){const s=t(n),o=t(i);return{start:n,end:i,startLine:s.line,startColumn:s.column,endLine:o.line,endColumn:o.column}}}}const ov=new WeakMap;function sE(r,e){const t=ov.get(r);if(!t||r.doc.type.schema!==e.type.schema)return r;const n=(s,o)=>{if(s.type!==o.type)return s;const a=t.suffixes.get(s);if(s.isText){const h=t.textOrigins.get(s),f=h==null?void 0:h.at(-1),m=o.text;if(a===void 0||!s.sameMarkup(o)||typeof m!="string"||m!==s.text+" "||!h||!f||f.end!==a||r.text[a]!==" ")return s;const y=s.type.schema.text(m,s.marks);return t.textOrigins.set(y,[...h.slice(0,-1),{...f,length:f.length+1,end:a+1}]),y}if(o.childCount<s.childCount)return s;const l=[];let c=!1;for(let h=0;h<s.childCount;h++){const f=s.child(h),m=n(f,o.child(h));l.push(m),c||(c=m!==f)}if(!c)return s;const u=s.copy(V.fromArray(l)),d=t.origins.get(s);return d&&t.origins.set(u,d),u},i=n(r.doc,e);return i===r.doc?r:av(r.text,r.coordinates,i,t.origins,t.textOrigins)}function oE(r,e,t){const n=iE(t),i=new J5(r),s=new WeakMap,o=new WeakMap;let a;const l=[],c=new WeakMap,u=i.next;i.next=(k=[])=>{for(const M of[k].flat()){const D=a;a=M,D&&l.push(D);try{u(M)}finally{D&&l.pop(),a=D}}return i};const d=i.push;i.push=k=>{a&&s.set(k,a),d(k)};const h=t.startsWith("\uFEFF")?1:0,f=k=>{var O,z;const M=(O=k==null?void 0:k.position)==null?void 0:O.start.offset,D=(z=k==null?void 0:k.position)==null?void 0:z.end.offset;return typeof M=="number"&&typeof D=="number"?{start:M,end:D}:void 0},m=k=>{const M=f(a);if(M)return{length:k,rawStart:M.start+h,rawEnd:M.end+h};const D=l.at(-1),O=f(D),z=(D==null?void 0:D.children)??[],T=a?z.indexOf(a):-1;if(!O||T<0)return{length:k};let B=O.start,N=O.end;for(let q=T-1;q>=0;q--){const te=f(z[q]);if(te){B=te.end;break}}for(let q=T+1;q<z.length;q++){const te=f(z[q]);if(te){N=te.start;break}}return{length:k,rawStart:B+h,rawEnd:N+h}},y=i.addText;i.addText=k=>{var Z,me,be,$,ve,Qe;const M=(Z=i.top())==null?void 0:Z.content.at(-1),D=M&&o.get(M);y(k);const O=(me=i.top())==null?void 0:me.content.at(-1);if(!(O!=null&&O.isText))return i;const z=(be=a==null?void 0:a.position)==null?void 0:be.start.offset,T=($=a==null?void 0:a.position)==null?void 0:$.end.offset,B=(a==null?void 0:a.type)==="text"&&typeof z=="number"&&typeof T=="number"&&t.slice(z+h,T+h)===k,N=B?{length:k.length,start:z+h,end:T+h}:m(k.length);o.set(O,O.text===k?[N]:[...D??[{length:((M==null?void 0:M.text)??"").length}],N]);const q=l.at(-1),te=(ve=q==null?void 0:q.position)==null?void 0:ve.end.offset;return B&&(q==null?void 0:q.type)==="paragraph"&&((Qe=q.children)==null?void 0:Qe.at(-1))===a&&typeof te=="number"&&te===T+1&&t[T+h]===" "&&[void 0,`
|
|
1187
|
+
`,"\r"].includes(t[te+h])&&c.set(O,T+h),i},i.run(e,t);const b=i.toDoc(),v=av(t,n,b,s,o);return ov.set(v,{origins:s,textOrigins:o,suffixes:c}),v}function av(r,e,t,n,i){const s=r.startsWith("\uFEFF")?1:0,o=[],a=[],l=[],c=new Map;return t.descendants((u,d)=>{var O,z,T;if(u.isLeaf&&!u.isText){const B=(O=n.get(u))==null?void 0:O.position,N=B==null?void 0:B.start.offset,q=B==null?void 0:B.end.offset;typeof N=="number"&&typeof q=="number"&&a.push({from:d,to:d+u.nodeSize,rawFrom:N+s,rawTo:q+s})}if(u.isText){let B=0;for(const N of i.get(u)??[])N.start!==void 0&&N.end!==void 0?o.push({from:d+B,to:d+B+N.length,rawFrom:N.start,rawTo:N.end}):N.rawStart!==void 0&&N.rawEnd!==void 0&&l.push({from:d+B,to:d+B+N.length,rawFrom:N.rawStart,rawTo:N.rawEnd}),B+=N.length}const h=n.get(u);if(u.type.name!=="list_item"||typeof(h==null?void 0:h.checked)!="boolean")return;const f=(z=h.position)==null?void 0:z.start.offset,m=(T=h.position)==null?void 0:T.end.offset;if(typeof f!="number"||typeof m!="number")return;const y=f+s,b=m+s,v=/^(?:[*+-]|\d+[.)])[ \t]+(\[[ xX]\])(?=[ \t]|$)/.exec(r.slice(y,b));if(!v)return;const k=y+v[0].length-v[1].length,M=e.range(k,k+3),D=r[k+1].toLowerCase()==="x";D!==h.checked||D!==u.attrs.checked||c.set(d,{item:e.range(y,b),marker:M,line:M.startLine,checked:D})}),{text:r,coordinates:e,doc:t,texts:o,atoms:a,loose:l,tasks:c}}function aE(r,e,t,n,i=t===n){const s={from:t,to:n,empty:i},o=r.texts.filter(c=>c.to>=s.from&&c.from<=s.to).filter(c=>s.empty?s.from>=c.from&&s.from<=c.to:s.to>c.from&&s.from<c.to).map(c=>{const u=Math.max(s.from,c.from),d=Math.min(s.to,c.to);return r.coordinates.range(c.rawFrom+u-c.from,c.rawFrom+d-c.from)});let a=0,l=!1;return e.nodesBetween(s.from,s.to,(c,u)=>{c.isLeaf&&!c.isText&&(l=!0),c.isText&&(a+=Math.max(0,Math.min(s.to,u+c.nodeSize)-Math.max(s.from,u)))}),l||!o.length||o.length>100||o.reduce((c,u)=>c+u.end-u.start,0)!==a||s.empty&&new Set(o.map(c=>c.start)).size!==1?null:o}const lE=er("remarkBlockDirectives",()=>MM),l0="embed",go="embed_container",lv={name:{default:""},attributes:{default:{}},label:{default:null}};function Fu(r){const e={};if(!r||typeof r!="object"||Array.isArray(r))return e;for(const[t,n]of Object.entries(r))typeof n=="string"&&a6(t)&&(e[t]=n);return e}const cE=new Set(["text","emphasis","strong","delete","inlineCode","inlineMath","link","break"]);function zm(r,e=!1){if(!Array.isArray(r)||r.length===0)return null;const t=[];for(const n of r){const i=cv(n,e);if(!i)return null;t.push(i)}return t}function cv(r,e){if(!r||typeof r!="object"||Array.isArray(r))return null;const t=r;if(typeof t.type!="string"||e&&!cE.has(t.type))return null;const n={};for(const[i,s]of Object.entries(t))if(!(i==="position"||i==="data"))if(i==="children"){if(!Array.isArray(s))return null;const o=[];for(const a of s){const l=cv(a,e);if(!l)return null;o.push(l)}n.children=o}else{if(e&&s!==null&&typeof s!="string")return null;n[i]=s}return n}function j4(r){if(!r)return null;try{return JSON.parse(r)}catch{return null}}function uv(r,e){return{"data-type":r,"data-name":e.name,"data-attributes":JSON.stringify(e.attributes??{}),...e.label?{"data-label":JSON.stringify(e.label)}:{}}}function dv(r){const e=r.getAttribute("data-name")??"";return o6(e)?{name:e,attributes:Fu(j4(r.getAttribute("data-attributes"))),label:zm(j4(r.getAttribute("data-label")),!0)}:!1}const Lm=Ve(l0,()=>({group:"block",atom:!0,isolating:!0,selectable:!0,draggable:!0,marks:"",attrs:lv,parseDOM:[{tag:`div[data-type="${l0}"]`,getAttrs:r=>dv(r)}],toDOM:r=>["div",uv(l0,r.attrs)],parseMarkdown:{match:r=>r.type==="leafDirective",runner:(r,e,t)=>{r.addNode(t,{name:e.name,attributes:Fu(e.attributes),label:zm(e.children)})}},toMarkdown:{match:r=>r.type.name===l0,runner:(r,e)=>{r.addNode("leafDirective",e.attrs.label??void 0,void 0,{name:e.attrs.name,attributes:e.attrs.attributes})}}})),Bm=Ve(go,()=>({group:"block",content:"block+",defining:!0,draggable:!0,attrs:lv,parseDOM:[{tag:`div[data-type="${go}"]`,getAttrs:r=>dv(r),contentElement:"[data-embed-content]"}],toDOM:r=>["div",uv(go,r.attrs),["div",{"data-embed-content":""},0]],parseMarkdown:{match:r=>r.type==="containerDirective",runner:(r,e,t)=>{var o;const n=e.children??[],i=n[0],s=(i==null?void 0:i.type)==="paragraph"&&((o=i.data)==null?void 0:o.directiveLabel)===!0;r.openNode(t,{name:e.name,attributes:Fu(e.attributes),label:s?zm(i.children):null}),r.next(s?n.slice(1):n),r.closeNode()}},toMarkdown:{match:r=>r.type.name===go,runner:(r,e)=>{r.openNode("containerDirective",void 0,{name:e.attrs.name,attributes:e.attrs.attributes});const t=e.attrs.label;t!=null&&t.length&&r.addNode("paragraph",t,void 0,{data:{directiveLabel:!0}});const n=e.childCount===1?e.firstChild:null;(n==null?void 0:n.type.name)==="paragraph"&&n.content.size===0||r.next(e.content),r.closeNode()}}}));function uE(r){r.use(lE).use(Lm).use(Bm)}const dE=aC.filter(r=>r!==da.plugin&&r!==da.options),hE=new Set(["<br />","<br>","<br >","<br/>"]);function hv(r){if(!Array.isArray(r.children))return;const e=n=>n.type==="html"&&hE.has((n.value??"").trim()),t=["root","blockquote","listItem","list"].includes(r.type);r.children=r.children.filter(n=>{var i;return!(n.type==="paragraph"&&((i=n.children)!=null&&i.length)&&n.children.every(e))&&!(t&&e(n))}).map(n=>e(n)?{type:"break"}:n);for(const n of r.children)hv(n)}const fE=er("markdownEditorStripEmptyLineBreaks",()=>()=>r=>{hv(r)}),pE=er("remarkFrontmatter",()=>VM,"yaml"),c0="frontmatter",mE=Ve(c0,()=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,parseDOM:[{tag:`pre[data-type="${c0}"]`,preserveWhitespace:"full"}],toDOM:()=>["pre",{"data-type":c0,class:"milkdown-frontmatter"},["code",{spellcheck:"false"},0]],parseMarkdown:{match:r=>r.type==="yaml",runner:(r,e,t)=>{const n=e.value??"";r.openNode(t),n.length>0&&r.addText(n),r.closeNode()}},toMarkdown:{match:r=>r.type.name===c0,runner:(r,e)=>{r.addNode("yaml",void 0,e.textContent)}}}));function gE(r){r.use(pE).use(mE)}const yE={imageIcon:mm,captionIcon:KM,uploadButton:"Upload file",confirmButton:Mu,uploadPlaceholderText:"or paste link",captionPlaceholderText:"Write Image Caption",onUpload:r=>Promise.resolve(URL.createObjectURL(r))},xf=Ne(yE,"imageBlockConfigCtx"),vE={imageIcon:mm,uploadButton:"Upload",confirmButton:Mu,uploadPlaceholderText:"or paste link",onUpload:r=>Promise.resolve(URL.createObjectURL(r))},fv=Ne(vE,"inlineImageConfigCtx");function bE(r){return $s(r,"paragraph",(e,t,n)=>{var c,u;if(t==null||!n||((c=e.children)==null?void 0:c.length)!==1)return;const i=(u=e.children)==null?void 0:u[0];if(!i||i.type!=="image")return;const{url:s,alt:o,title:a}=i,l={type:"image-block",url:s,alt:o,title:a};n.children.splice(t,1,l)})}const wE=er("remark-image-block",()=>()=>bE),Sf="image-block";function kE(r){return new Error(`Expected an HTMLElement, got ${String(r)}`)}const Cf=Ve("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${Sf}"]`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw kE(r);return{src:r.getAttribute("src")||"",caption:r.getAttribute("caption")||"",ratio:Number(r.getAttribute("ratio")??1)}}}],toDOM:r=>["img",{"data-type":Sf,...r.attrs}],parseMarkdown:{match:({type:r})=>r==="image-block",runner:(r,e,t)=>{const n=e.url,i=e.title;let s=Number(e.alt||1);(Number.isNaN(s)||s===0)&&(s=1),r.addNode(t,{src:n,caption:i,ratio:s})}},toMarkdown:{match:r=>r.type.name==="image-block",runner:(r,e)=>{r.openNode("paragraph"),r.addNode("image",void 0,void 0,{title:e.attrs.caption,url:e.attrs.src,alt:`${Number.parseFloat(e.attrs.ratio).toFixed(2)}`}),r.closeNode()}}})),xE=er("remarkMath",()=>zT);function SE(r){return $s(r,"math",(e,t,n)=>{t==null||!n||n.children.splice(t,1,{type:"code",lang:"LaTeX",value:e.value??""})})}const CE=er("remarkMathBlock",()=>()=>SE),Va="math_inline",W0=Ve(Va,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${Va}"]`,getAttrs:r=>({value:r.dataset.value??""})}],toDOM:r=>{const e=r.attrs.value??"",t=document.createElement("span");return t.dataset.type=Va,t.dataset.value=e,rv.render(e,t,{throwOnError:!1}),t},parseMarkdown:{match:r=>r.type==="inlineMath",runner:(r,e,t)=>{r.addNode(t,{value:e.value})}},toMarkdown:{match:r=>r.type.name===Va,runner:(r,e)=>{r.addNode("inlineMath",void 0,e.attrs.value)}}})),ME=Vr.extendSchema(r=>e=>{const t=r(e);return{...t,toMarkdown:{match:t.toMarkdown.match,runner:(n,i)=>{var s;if((i.attrs.language??"").toLowerCase()==="latex")n.addNode("math",void 0,((s=i.content.firstChild)==null?void 0:s.text)||"");else return t.toMarkdown.runner(n,i)}}}}),Nl="wiki_link",TE=er("remarkWikiLinks",()=>YN);function yo(r){return{target:String(r.target??""),heading:typeof r.heading=="string"?r.heading:null,label:typeof r.label=="string"?r.label:null,embed:r.embed===!0}}function AE(r){const e=n=>r.getAttribute(`data-${n}`),t={target:e("target")??"",heading:e("heading"),label:e("label"),embed:e("embed")==="true"};return Im(t)?t:!1}const Pm=Ve(Nl,()=>({group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,marks:"",attrs:{target:{default:""},heading:{default:null},label:{default:null},embed:{default:!1},source:{default:null}},leafText:r=>iv({...yo(r.attrs),value:r.attrs.source??void 0})??Rm(yo(r.attrs)),parseDOM:[{tag:'a[data-type="wiki-link"]',getAttrs:r=>AE(r)}],toDOM:r=>{const e=yo(r.attrs);return["a",{"data-type":"wiki-link","data-target":e.target,...e.heading===null?{}:{"data-heading":e.heading},...e.label===null?{}:{"data-label":e.label},...e.embed?{"data-embed":"true"}:{}},pv(e)]},parseMarkdown:{match:r=>r.type==="wikiLink",runner:(r,e,t)=>{r.addNode(t,{target:e.target,heading:e.heading??null,label:e.label??null,embed:e.embed===!0,source:typeof e.value=="string"?e.value:null})}},toMarkdown:{match:r=>r.type.name===Nl,runner:(r,e)=>{const t=yo(e.attrs),n=typeof e.attrs.source=="string"?e.attrs.source:void 0;r.addNode("wikiLink",void 0,n,{...t})}}}));function pv(r){return r.label!==null&&r.label!==""?r.label:r.heading!==null?r.target?`${r.target} › ${r.heading}`:`#${r.heading}`:r.target}const NE=wt(r=>new _t(/(!?)\[\[([^[\]\r\n\ufffc]+)\]\]$/,(e,t,n,i)=>{const[,s,o]=t,{link:a}=Pu(o,s==="!");if(!Im(a)||e.doc.resolve(n).parent.type.spec.code)return null;const l=u=>e.doc.resolve(u).marks().some(d=>d.type.spec.code);if(l(n)||l(i))return null;const c=Pm.type(r).create({...a,source:t[0]});return e.tr.replaceWith(n,i,c)})),EE=qe(()=>new Ae({key:new De("blintz-wiki-link-code-guard"),appendTransaction(r,e,t){if(!r.some(i=>i.docChanged))return null;let n=null;return t.doc.descendants((i,s)=>{if(i.type.name===Nl)for(const o of i.marks)o.type.spec.code&&(n??(n=t.tr),n.removeMark(s,s+i.nodeSize,o.type))}),n}})),DE=new Set(["table_cell","table_header"]),OE=qe(()=>new Ae({key:new De("blintz-wiki-link-source"),appendTransaction(r,e,t){const n=RE(r);if(n.length===0)return null;const{doc:i}=t;let s=null;const o=new Set;for(const{from:a,to:l}of n){let c=-1;i.nodesBetween(Math.max(0,a),Math.min(i.content.size,l),(u,d)=>{if(DE.has(u.type.name)&&(c=d+u.nodeSize),u.type.name!==Nl||o.has(d))return;o.add(d);const h=yo(u.attrs),f=typeof u.attrs.source=="string"?u.attrs.source:void 0,m=nv({...h,value:f},d<c);u.attrs.source!==m&&(s??(s=t.tr),s.setNodeAttribute(d,"source",m))})}return(s==null?void 0:s.setMeta("addToHistory",!1))??null}}));function RE(r){const e=[];for(const t of r)if(t.docChanged){for(const n of e)n.from=t.mapping.map(n.from,-1),n.to=t.mapping.map(n.to,1);t.steps.forEach((n,i)=>{const s=t.mapping.slice(i+1),o=(l,c)=>e.push({from:s.map(l,-1),to:s.map(c,1)});t.mapping.maps[i].forEach((l,c,u,d)=>o(u,d));const a=n.pos;typeof a=="number"&&o(a,a+1)})}return e}function Mf(r){if(!r)return!1;if(Array.isArray(r))return r.length>1?!1:Mf(r[0]);const e=r.content;return e?Mf(e):r.type==="text"}function IE(r,e){return Object.assign(r,{meta:{package:"@milkdown/plugin-clipboard",...e}}),r}function V4(r,e){const t=s9(e);if(t)return r.dispatch(r.state.tr.replaceSelectionWith(t,!0)),!0;try{return r.dispatch(r.state.tr.replaceSelection(e)),!0}catch{return!1}}var mv=qe(r=>{const e=r.get(Zt);r.update(il,n=>({...n,editable:n.editable??(()=>!0),transformPastedHTML:(i,s)=>{const o=n.transformPastedHTML;return o&&(i=o(i,s)),i.includes("docs-internal-guid")&&(i=i.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1"),i=i.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),i}}));const t=new De("MILKDOWN_CLIPBOARD");return new Ae({key:t,props:{handlePaste:(n,i,s)=>{var m,y,b;const o=r.get(Ts),a=(y=(m=n.props).editable)==null?void 0:y.call(m,n.state),{clipboardData:l}=i;if(!a||!l||n.state.selection.$from.node().type.spec.code)return!1;const c=l.getData("text/plain"),u=l.getData("vscode-editor-data");if(u){const v=(b=JSON.parse(u))==null?void 0:b.mode;if(c&&v){const{tr:k}=n.state,M=a9("code_block",e);return k.replaceSelectionWith(M.create({language:v})).setSelection(se.near(k.doc.resolve(Math.max(0,k.selection.from-2)))).insertText(c.replace(/\r\n?/g,`
|
|
1188
|
+
`)),n.dispatch(k),!0}}const d=l.getData("text/html");if(d.length===0&&c.length===0)return!1;if(d.length>0&&s)return V4(n,s);const h=Is.fromSchema(e);let f;if(d.length===0){const v=o(c);if(!v||typeof v=="string")return!1;f=qs.fromSchema(e).serializeFragment(v.content)}else{const v=document.createElement("template");v.innerHTML=d,f=v.content.cloneNode(!0),v.remove()}return V4(n,h.parseSlice(f))},clipboardTextSerializer:n=>{const i=r.get(bo);if(Mf(n.content.toJSON()))return n.content.textBetween(0,n.content.size,`
|
|
1189
|
+
|
|
1190
|
+
`);const s=e.topNodeType.createAndFill(void 0,n.content);return s?i(s):""}}})});IE(mv,{displayName:"Prose<clipboard>"});var U0=200,ft=function(){};ft.prototype.append=function(e){return e.length?(e=ft.from(e),!this.length&&e||e.length<U0&&this.leafAppend(e)||this.length<U0&&e.leafPrepend(this)||this.appendInner(e)):this};ft.prototype.prepend=function(e){return e.length?ft.from(e).append(this):this};ft.prototype.appendInner=function(e){return new zE(this,e)};ft.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ft.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};ft.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ft.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};ft.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};ft.from=function(e){return e instanceof ft?e:e&&e.length?new gv(e):ft.empty};var gv=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=U0)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=U0)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ft);ft.empty=new gv([]);var zE=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(ft);const LE=500;class Hr{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new tn(d.map));let f=d.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new tn(m,void 0,void 0,c.length+u.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new Hr(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new tn(e.mapping.maps[u],d,t),f;(f=l&&l.merge(h))&&(h=f,u?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(o++,t=void 0),i||(l=h)}let c=o-n.depth;return c>PE&&(a=BE(a,c),o-=c),new Hr(a.append(s),o)}remapping(e,t){let n=new dl;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Hr(this.items.append(e.map(t=>new tn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let y=e.steps[f].invert(e.docs[f]),b=h.selection&&h.selection.map(s.slice(l+1,f));b&&a++,n.push(new tn(m,y,b))}else n.push(new tn(m))},i);let c=[];for(let h=t;h<o;h++)c.push(new tn(s.maps[h]));let u=this.items.slice(0,i).append(c).append(n),d=new Hr(u,a);return d.emptyItemCount()>LE&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let u=o.selection&&o.selection.map(t.slice(n));u&&s++;let d=new tn(c.invert(),l,u),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&n--},this.items.length,0),new Hr(ft.from(i.reverse()),s)}}Hr.empty=new Hr(ft.empty,0);function BE(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class tn{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new tn(t.getMap().invert(),t,this.selection)}}}class ai{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const PE=20;function FE(r,e,t,n){let i=t.getMeta(Ns),s;if(i)return i.historyState;t.getMeta(HE)&&(r=new ai(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(Ns))return o.getMeta(Ns).redo?new ai(r.done.addTransform(t,void 0,n,E0(e)),r.undone,W4(t.mapping.maps),r.prevTime,r.prevComposition):new ai(r.done,r.undone.addTransform(t,void 0,n,E0(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=a&&(r.prevTime<(t.time||0)-n.newGroupDelay||!$E(t,r.prevRanges)),c=o?rh(r.prevRanges,t.mapping):W4(t.mapping.maps);return new ai(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,E0(e)),Hr.empty,c,t.time,a??r.prevComposition)}else return(s=t.getMeta("rebased"))?new ai(r.done.rebased(t,s),r.undone.rebased(t,s),rh(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new ai(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),rh(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function $E(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function W4(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function rh(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function qE(r,e,t){let n=E0(e),i=Ns.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new ai(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Ns,{redo:t,historyState:l})}let nh=!1,U4=null;function E0(r){let e=r.plugins;if(U4!=e){nh=!1,U4=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){nh=!0;break}}return nh}const Ns=new De("history"),HE=new De("closeHistory");function _E(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Ae({key:Ns,state:{init(){return new ai(Hr.empty,Hr.empty,null,0,-1)},apply(e,t,n){return FE(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?Fm:n=="historyRedo"?K0:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function yv(r,e){return(t,n)=>{let i=Ns.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=qE(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const Fm=yv(!1,!0),K0=yv(!0,!0);function Na(r,e){return Object.assign(r,{meta:{package:"@milkdown/plugin-history",...e}}),r}var $m=fe("Undo",()=>()=>Fm);Na($m,{displayName:"Command<undo>"});var qm=fe("Redo",()=>()=>K0);Na(qm,{displayName:"Command<redo>"});var Hm=Ne({},"historyProviderConfig");Na(Hm,{displayName:"Ctx<historyProviderConfig>"});var vv=qe(r=>_E(r.get(Hm.key)));Na(vv,{displayName:"Ctx<historyProviderPlugin>"});var _m=Qt("historyKeymap",{Undo:{shortcuts:"Mod-z",command:r=>{const e=r.get(oe);return()=>e.call($m.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:r=>{const e=r.get(oe);return()=>e.call(qm.key)}}});Na(_m.ctx,{displayName:"KeymapCtx<history>"});Na(_m.shortcuts,{displayName:"Keymap<history>"});var jE=[Hm,vv,_m,$m,qm].flat();function VE(r,e){const{doc:t,selection:n}=r;if(!t||!n||!(n instanceof se||n instanceof Yt))return r;const{to:i}=n,s=e.type==="space"?Array(e.size).fill(" ").join(""):" ";return r.insertText(s,i)}var jm=Ne({type:"space",size:2},"indentConfig");jm.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var bv=c3(r=>({Tab:(e,t)=>{const n=r.get(jm.key),{tr:i}=e,s=VE(i,n);return s.docChanged?(t==null||t(s),!0):!1}}));bv.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var WE=[jm,bv],UE=typeof global=="object"&&global&&global.Object===Object&&global,KE=typeof self=="object"&&self&&self.Object===Object&&self,wv=UE||KE||Function("return this")(),G0=wv.Symbol,kv=Object.prototype,GE=kv.hasOwnProperty,JE=kv.toString,za=G0?G0.toStringTag:void 0;function YE(r){var e=GE.call(r,za),t=r[za];try{r[za]=void 0;var n=!0}catch{}var i=JE.call(r);return n&&(e?r[za]=t:delete r[za]),i}var XE=Object.prototype,ZE=XE.toString;function QE(r){return ZE.call(r)}var eD="[object Null]",tD="[object Undefined]",K4=G0?G0.toStringTag:void 0;function rD(r){return r==null?r===void 0?tD:eD:K4&&K4 in Object(r)?YE(r):QE(r)}function nD(r){return r!=null&&typeof r=="object"}var iD="[object Symbol]";function sD(r){return typeof r=="symbol"||nD(r)&&rD(r)==iD}var oD=/\s/;function aD(r){for(var e=r.length;e--&&oD.test(r.charAt(e)););return e}var lD=/^\s+/;function cD(r){return r&&r.slice(0,aD(r)+1).replace(lD,"")}function J0(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var G4=NaN,uD=/^[-+]0x[0-9a-f]+$/i,dD=/^0b[01]+$/i,hD=/^0o[0-7]+$/i,fD=parseInt;function J4(r){if(typeof r=="number")return r;if(sD(r))return G4;if(J0(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=J0(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=cD(r);var t=dD.test(r);return t||hD.test(r)?fD(r.slice(2),t?2:8):uD.test(r)?G4:+r}var ih=function(){return wv.Date.now()},pD="Expected a function",mD=Math.max,gD=Math.min;function Vm(r,e,t){var n,i,s,o,a,l,c=0,u=!1,d=!1,h=!0;if(typeof r!="function")throw new TypeError(pD);e=J4(e)||0,J0(t)&&(u=!!t.leading,d="maxWait"in t,s=d?mD(J4(t.maxWait)||0,e):s,h="trailing"in t?!!t.trailing:h);function f(z){var T=n,B=i;return n=i=void 0,c=z,o=r.apply(B,T),o}function m(z){return c=z,a=setTimeout(v,e),u?f(z):o}function y(z){var T=z-l,B=z-c,N=e-T;return d?gD(N,s-B):N}function b(z){var T=z-l,B=z-c;return l===void 0||T>=e||T<0||d&&B>=s}function v(){var z=ih();if(b(z))return k(z);a=setTimeout(v,y(z))}function k(z){return a=void 0,h&&n?f(z):(n=i=void 0,o)}function M(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function D(){return a===void 0?o:k(ih())}function O(){var z=ih(),T=b(z);if(n=arguments,i=this,l=z,T){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(v,e),f(l)}return a===void 0&&(a=setTimeout(v,e)),o}return O.cancel=M,O.flush=D,O}var yD="Expected a function";function xv(r,e,t){var n=!0,i=!0;if(typeof r!="function")throw new TypeError(yD);return J0(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),Vm(r,e,{leading:n,maxWait:e,trailing:i})}var Sv=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=r=>(this.beforeMountedListeners.push(r),this),this.mounted=r=>(this.mountedListeners.push(r),this),this.updated=r=>(this.updatedListeners.push(r),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(r){return this.markdownUpdatedListeners.push(r),this}blur(r){return this.blurListeners.push(r),this}focus(r){return this.focusListeners.push(r),this}destroy(r){return this.destroyListeners.push(r),this}selectionUpdated(r){return this.selectionUpdatedListeners.push(r),this}},Tf=Se(new Sv,"listener"),vD=new De("MILKDOWN_LISTENER"),Cv=r=>(r.inject(Tf,new Sv),async()=>{await r.wait(Ms);const{listeners:e}=r.get(Tf);e.beforeMount.forEach(c=>c(r)),await r.wait(nl);const t=r.get(bo);let n=null,i=null,s=null,o=null;const a=Vm(()=>{if(!o)return;const{doc:c}=o;if(e.updated.length>0&&n&&!n.eq(c)&&e.updated.forEach(u=>{u(r,c,n)}),e.markdownUpdated.length>0&&n&&!n.eq(c)){const u=t(c);e.markdownUpdated.forEach(d=>{d(r,u,i)}),i=u}n=c,o=null},200),l=new Ae({key:vD,view:()=>({destroy:()=>{a.cancel(),e.destroy.forEach(c=>c(r))}}),props:{handleDOMEvents:{focus:()=>(e.focus.forEach(c=>c(r)),!1),blur:()=>(e.blur.forEach(c=>c(r)),!1)}},state:{init:(c,u)=>{n=u.doc,i=t(u.doc)},apply:c=>{const u=c.selection;(!s&&u||s&&!u.eq(s))&&(e.selectionUpdated.forEach(d=>{d(r,u,s)}),s=u),!(!(c.docChanged||c.storedMarksSet)||c.getMeta("addToHistory")===!1)&&(o=c,a())}}});r.update(ur,c=>c.concat(l)),await r.wait(x0),e.mounted.forEach(c=>c(r))});Cv.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};function bD(r){return new Promise(e=>{const t=new FileReader;t.addEventListener("load",()=>{e({alt:r.name,src:t.result})},!1),t.readAsDataURL(r)})}var wD=async(r,e)=>{const t=[];for(let i=0;i<r.length;i++){const s=r.item(i);s&&s.type.includes("image")&&t.push(s)}const{image:n}=e.nodes;if(!n)throw C5("image");return(await Promise.all(t.map(i=>bD(i)))).map(({alt:i,src:s})=>n.createAndFill({src:s,alt:i}))},ko=Ne({uploader:wD,enableHtmlFileUploader:!1,uploadWidgetFactory:(r,e)=>{const t=document.createElement("span");return t.textContent="Upload in progress...",Ze.widget(r,t,e)}},"uploadConfig");ko.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var Mv=qe(r=>{const e=new De("MILKDOWN_UPLOAD"),t=(i,s)=>{var l;const o=e.getState(i);if(!o)return-1;const a=o.find(void 0,void 0,c=>c.id===s);return a.length?((l=a[0])==null?void 0:l.from)??-1:-1},n=(i,s,o)=>{var m;if(!o||o.length<=0)return!1;const a=Symbol("upload symbol"),l=r.get(Zt),{uploader:c,getInsertPos:u}=r.get(ko.key),{tr:d}=i.state,h=s instanceof DragEvent?((m=i.posAtCoords({left:s.clientX,top:s.clientY}))==null?void 0:m.pos)??d.selection.from:d.selection.from,f=typeof u=="function"?u(s,r,h):h;return i.dispatch(d.setMeta(e,{add:{id:a,pos:f}})),c(o,l,r,f).then(y=>{const b=t(i.state,a);b<0||i.dispatch(i.state.tr.replaceWith(b,b,y).setMeta(e,{remove:{id:a}}))}).catch(y=>{console.error(y)}),!0};return new Ae({key:e,state:{init(){return $e.empty},apply(i,s){const o=s.map(i.mapping,i.doc),a=i.getMeta(this);if(!a)return o;if(a.add){const{uploadWidgetFactory:l}=r.get(ko.key),c=l(a.add.pos,{id:a.add.id});return o.add(i.doc,[c])}if(a.remove){const l=o.find(void 0,void 0,c=>c.id===a.remove.id);return o.remove(l)}return o}},props:{decorations(i){return this.getState(i)},handlePaste:(i,s)=>{var a,l;const{enableHtmlFileUploader:o}=r.get(ko.key);return!(s instanceof ClipboardEvent)||!o&&((a=s.clipboardData)!=null&&a.getData("text/html"))?!1:n(i,s,(l=s.clipboardData)==null?void 0:l.files)},handleDrop:(i,s)=>{var o;return s instanceof DragEvent?n(i,s,(o=s.dataTransfer)==null?void 0:o.files):!1}}})});Mv.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var kD=[ko,Mv],Fs=Ne({shouldAppend:r=>!(!r||["heading","paragraph"].includes(r.type.name)),getNode:r=>r.schema.nodes.paragraph.create()},"trailingConfig");Fs.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var Tv=qe(r=>{const e=new De("MILKDOWN_TRAILING"),{shouldAppend:t,getNode:n}=r.get(Fs.key),i=new Ae({key:e,state:{init:(s,o)=>{const a=o.tr.doc.lastChild;return t(a,o)},apply:(s,o,a,l)=>{if(!s.docChanged)return o;const c=s.doc.lastChild;return t(c,l)}},appendTransaction:(s,o,a)=>{const{doc:l,tr:c}=a,u=n==null?void 0:n(a),d=i.getState(a),h=l.content.size;if(!(!d||!u))return c.insert(h,u)}});return i});Tv.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};function Oc(r,e){return Object.assign(r,{meta:{package:"@milkdown/plugin-block",...e}}),r}var xD=r=>!ln(e=>e.type.name==="table")(r),$u=Ne({filterNodes:xD},"blockConfig");Oc($u,{displayName:"Ctx<blockConfig>"});function SD(r,e,t){var n;if(!r.dom.parentElement)return null;try{const i=(n=r.posAtCoords({left:e.x,top:e.y}))==null?void 0:n.inside;if(i==null||i<0)return null;let s=r.state.doc.resolve(i),o=r.state.doc.nodeAt(i),a=r.nodeDOM(i);const l=c=>{const u=s.depth>=1&&s.index(s.depth)===0;if(!(c||u))return;const d=s.before(s.depth);o=r.state.doc.nodeAt(d),a=r.nodeDOM(d),s=r.state.doc.resolve(d),t(s,o)||l(!0)};return l(!t(s,o)),!a||!o?null:{node:o,$pos:s,el:a}}catch{return null}}var Y4=Kc.ie&&Kc.ie_version<15||Kc.ios&&Kc.webkit_version<604,X4=20,jo,Xl,pi,Fr,Vo,$r,sn,Av,fo,ms,gs,Zl,Wo,Uo,Ko,Go,Ql,mi,F2,CD=(F2=class{constructor(){_(this,sn);_(this,jo);_(this,Xl);_(this,pi);_(this,Fr);_(this,Vo);_(this,$r);_(this,ms);_(this,gs);_(this,Zl);_(this,Wo);_(this,Uo);_(this,Ko);_(this,Go);_(this,Ql);_(this,mi);F(this,Xl,()=>{if(!C(this,Fr))return null;const r=C(this,Fr),e=C(this,sn,fo);if(F(this,pi,null),e&&ae.isSelectable(r.node)){const t=ae.create(e.state.doc,r.$pos.pos);return e.dispatch(e.state.tr.setSelection(t)),e.focus(),F(this,pi,t),t}return null}),F(this,pi,null),F(this,Fr,null),F(this,Vo,void 0),F(this,$r,!1),F(this,gs,()=>{var r;(r=C(this,ms))==null||r.call(this,{type:"hide"}),F(this,Fr,null)}),F(this,Zl,r=>{var e;F(this,Fr,r),(e=C(this,ms))==null||e.call(this,{type:"show",active:r})}),this.bind=(r,e)=>{F(this,jo,r),F(this,ms,e)},this.addEvent=r=>{r.addEventListener("mousedown",C(this,Wo)),r.addEventListener("mouseup",C(this,Uo)),r.addEventListener("dragstart",C(this,Ko)),r.addEventListener("dragend",C(this,Go))},this.removeEvent=r=>{r.removeEventListener("mousedown",C(this,Wo)),r.removeEventListener("mouseup",C(this,Uo)),r.removeEventListener("dragstart",C(this,Ko)),r.removeEventListener("dragend",C(this,Go))},this.unBind=()=>{F(this,ms,void 0)},F(this,Wo,()=>{var r;F(this,Vo,(r=C(this,Fr))==null?void 0:r.el.getBoundingClientRect()),C(this,Xl).call(this)}),F(this,Uo,()=>{if(!C(this,$r)){requestAnimationFrame(()=>{var r;C(this,Vo)&&((r=C(this,sn,fo))==null||r.focus())});return}F(this,$r,!1),F(this,pi,null)}),F(this,Ko,r=>{var n;F(this,$r,!0);const e=C(this,sn,fo);if(!e)return;e.dom.dataset.dragging="true";const t=C(this,pi);if(r.dataTransfer&&t){const i=t.content();r.dataTransfer.effectAllowed="copyMove";const{dom:s,text:o}=e.serializeForClipboard(i);r.dataTransfer.clearData(),r.dataTransfer.setData(Y4?"Text":"text/html",s.innerHTML),Y4||r.dataTransfer.setData("text/plain",o);const a=(n=C(this,Fr))==null?void 0:n.el;a&&r.dataTransfer.setDragImage(a,0,0),e.dragging={slice:i,move:!0,node:t}}}),F(this,Go,()=>{const r=C(this,sn,fo);if(!r)return;C(this,mi).call(this,r);const e=r.dragging;window.setTimeout(()=>{r.dragging===e&&(r.dragging=null)},50)}),this.keydownCallback=r=>(C(this,gs).call(this),F(this,$r,!1),r.dom.dataset.dragging="false",!1),F(this,Ql,xv((r,e)=>{if(!r.editable)return;const t=r.dom.getBoundingClientRect(),n=t.left+t.width/2;if(!(r.root.elementFromPoint(n,e.clientY)instanceof Element)){C(this,gs).call(this);return}const i=C(this,sn,Av);if(!i)return;const s=SD(r,{x:n,y:e.clientY},i);if(!s){C(this,gs).call(this);return}C(this,Zl).call(this,s)},200)),this.mousemoveCallback=(r,e)=>(r.composing||!r.editable||C(this,Ql).call(this,r,e),!1),this.dragoverCallback=(r,e)=>{var t;if(C(this,$r)){const n=(t=C(this,sn,fo))==null?void 0:t.dom.parentElement;if(!n)return!1;const i=n.scrollHeight>n.clientHeight,s=n.getBoundingClientRect();if(i){if(n.scrollTop>0&&Math.abs(e.y-s.y)<X4)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;const o=Math.round(r.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+s.height)<o&&Math.abs(e.y-(s.height+s.y))<X4)return n.scrollTop=n.scrollTop+10,!1}}return!1},this.dragenterCallback=r=>{r.dragging&&(F(this,$r,!0),r.dom.dataset.dragging="true")},this.dragleaveCallback=(r,e)=>{const t=e.clientX,n=e.clientY;(t<0||n<0||t>window.innerWidth||n>window.innerHeight)&&(F(this,Fr,null),C(this,mi).call(this,r))},this.dropCallback=r=>(C(this,mi).call(this,r),!1),this.dragendCallback=r=>{C(this,mi).call(this,r)},F(this,mi,r=>{F(this,$r,!1),r.dom.dataset.dragging="false"})}},jo=new WeakMap,Xl=new WeakMap,pi=new WeakMap,Fr=new WeakMap,Vo=new WeakMap,$r=new WeakMap,sn=new WeakSet,Av=function(){var r;try{return(r=C(this,jo))==null?void 0:r.get($u.key).filterNodes}catch{return}},fo=function(){var r;return(r=C(this,jo))==null?void 0:r.get(Me)},ms=new WeakMap,gs=new WeakMap,Zl=new WeakMap,Wo=new WeakMap,Uo=new WeakMap,Ko=new WeakMap,Go=new WeakMap,Ql=new WeakMap,mi=new WeakMap,F2),Wm=Ne(()=>new CD,"blockService"),qu=Ne({},"blockServiceInstance");Oc(Wm,{displayName:"Ctx<blockService>"});Oc(qu,{displayName:"Ctx<blockServiceInstance>"});var Hu=Ne({},"blockSpec");Oc(Hu,{displayName:"Ctx<blockSpec>"});var Um=qe(r=>{const e=new De("MILKDOWN_BLOCK"),t=r.get(Wm.key)();r.set(qu.key,t);const n=r.get(Hu.key);return new Ae({key:e,...n,props:{...n.props,handleDOMEvents:{drop:i=>t.dropCallback(i),pointermove:(i,s)=>t.mousemoveCallback(i,s),keydown:i=>t.keydownCallback(i),dragover:(i,s)=>t.dragoverCallback(i,s),dragleave:(i,s)=>t.dragleaveCallback(i,s),dragenter:i=>t.dragenterCallback(i),dragend:i=>t.dragendCallback(i)}}})});Oc(Um,{displayName:"Prose<block>"});var Kt,On,ys,vs,ec,Jo,tc,rc,Yo,Xo,Zo,eu,Nv,$2,MD=($2=class{constructor(r){_(this,eu);_(this,Kt);_(this,On);_(this,ys);_(this,vs);_(this,ec);_(this,Jo);_(this,tc);_(this,rc);_(this,Yo);_(this,Xo);_(this,Zo);F(this,vs,null),F(this,Jo,!1),this.update=()=>{requestAnimationFrame(()=>{if(!C(this,Jo))try{Wi(this,eu,Nv).call(this),F(this,Jo,!0)}catch{}})},this.destroy=()=>{var e,t;(e=C(this,ys))==null||e.unBind(),(t=C(this,ys))==null||t.removeEvent(C(this,Kt)),C(this,Kt).remove()},this.show=e=>{const t=e.el,n=C(this,On).get(Me).dom,i={ctx:C(this,On),active:e,editorDom:n,blockDom:C(this,Kt)},s={contextElement:t,getBoundingClientRect:()=>C(this,Xo)?C(this,Xo).call(this,i):t.getBoundingClientRect()},o=[tu()];if(C(this,Yo)){const a=C(this,Yo).call(this,i),l=Mi(a);o.push(l)}Wr(s,C(this,Kt),{placement:C(this,Zo)?C(this,Zo).call(this,i):"left",middleware:[...o,...C(this,tc)],...C(this,rc)}).then(({x:a,y:l})=>{Object.assign(C(this,Kt).style,{left:`${a}px`,top:`${l}px`}),C(this,Kt).dataset.show="true"}).catch(console.error)},this.hide=()=>{C(this,Kt).dataset.show="false"},F(this,On,r.ctx),F(this,Kt,r.content),F(this,Yo,r.getOffset),F(this,Xo,r.getPosition),F(this,Zo,r.getPlacement),F(this,tc,r.middleware??[]),F(this,rc,r.floatingUIOptions??{}),F(this,ec,r.root),this.hide()}get active(){return C(this,vs)}},Kt=new WeakMap,On=new WeakMap,ys=new WeakMap,vs=new WeakMap,ec=new WeakMap,Jo=new WeakMap,tc=new WeakMap,rc=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,Zo=new WeakMap,eu=new WeakSet,Nv=function(){const r=C(this,On).get(Me);(C(this,ec)??r.dom.parentElement??document.body).appendChild(C(this,Kt));const e=C(this,On).get(qu.key);e.bind(C(this,On),t=>{t.type==="hide"?(this.hide(),F(this,vs,null)):t.type==="show"&&(this.show(t.active),F(this,vs,t.active))}),F(this,ys,e),C(this,ys).addEvent(C(this,Kt)),C(this,Kt).draggable=!0},$2),_u=[Hu,$u,Wm,qu,Um];_u.key=Hu.key;_u.pluginKey=Um.key;function TD(r){const e=Ne({},`${r}_SLASH_SPEC`),t=qe(i=>{const s=i.get(e.key);return new Ae({key:new De(`${r}_SLASH`),...s})}),n=[e,t];return n.key=e.key,n.pluginKey=t.key,e.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${r}`},t.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${r}`},n}var Qo,nc,ic,sc,oc,bs,ac,ea,lc,cc,uc,q2,AD=(q2=class{constructor(r){_(this,Qo);_(this,nc);_(this,ic);_(this,sc);_(this,oc);_(this,bs);_(this,ac);_(this,ea);_(this,lc);_(this,cc);_(this,uc);F(this,Qo,!1),this.onShow=()=>{},this.onHide=()=>{},F(this,cc,(e,t)=>{const{state:n,composing:i}=e,{selection:s,doc:o}=n,{ranges:a}=s,l=Math.min(...a.map(d=>d.$from.pos)),c=Math.max(...a.map(d=>d.$to.pos)),u=t&&t.doc.eq(o)&&t.selection.eq(s);if(C(this,Qo)||((C(this,sc)??e.dom.parentElement??document.body).appendChild(this.element),F(this,Qo,!0)),!(i||u)){if(!C(this,ac).call(this,e,t)){this.hide();return}Wr({getBoundingClientRect:()=>pu(e,l,c)},this.element,{placement:"bottom-start",middleware:[tu(),Mi(C(this,lc)),...C(this,nc)],...C(this,ic)}).then(({x:d,y:h})=>{Object.assign(this.element.style,{left:`${d}px`,top:`${h}px`})}).catch(console.error),this.show()}}),F(this,uc,e=>{const t=this.getContent(e);if(!t)return!1;const n=t.at(-1);return n?Array.isArray(C(this,bs))?C(this,bs).includes(n):C(this,bs)===n:!1}),this.update=(e,t)=>{C(this,ea).call(this,e,t)},this.getContent=(e,t=n=>n.type.name==="paragraph")=>{const{selection:n}=e.state,{empty:i,$from:s}=n,o=e.state.selection instanceof se;if(typeof document>"u")return;const a=this.element.contains(document.activeElement),l=!e.hasFocus()&&!a,c=!e.editable,u=!l9(t)(e.state.selection);if(!(l||c||!i||!o||u))return s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,"")},this.destroy=()=>{C(this,ea).cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=r.content,F(this,oc,r.debounce??200),F(this,ac,r.shouldShow??C(this,uc)),F(this,bs,r.trigger??"/"),F(this,lc,r.offset),F(this,nc,r.middleware??[]),F(this,ic,r.floatingUIOptions??{}),F(this,sc,r.root),F(this,ea,Vm(C(this,cc),C(this,oc)))}},Qo=new WeakMap,nc=new WeakMap,ic=new WeakMap,sc=new WeakMap,oc=new WeakMap,bs=new WeakMap,ac=new WeakMap,ea=new WeakMap,lc=new WeakMap,cc=new WeakMap,uc=new WeakMap,q2);/*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */function Z4(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function ND(r){if(Array.isArray(r))return r}function ED(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function DD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1191
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function OD(r,e){return ND(r)||ED(r,e)||RD(r,e)||DD()}function RD(r,e){if(r){if(typeof r=="string")return Z4(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Z4(r,e):void 0}}const Ev=Object.entries,Q4=Object.setPrototypeOf,ID=Object.isFrozen,zD=Object.getPrototypeOf,LD=Object.getOwnPropertyDescriptor;let ut=Object.freeze,pt=Object.seal,po=Object.create,Dv=typeof Reflect<"u"&&Reflect,Af=Dv.apply,Nf=Dv.construct;ut||(ut=function(e){return e});pt||(pt=function(e){return e});Af||(Af=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];return e.apply(t,i)});Nf||(Nf=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const Zi=ot(Array.prototype.forEach),BD=ot(Array.prototype.lastIndexOf),e2=ot(Array.prototype.pop),La=ot(Array.prototype.push),PD=ot(Array.prototype.splice),xo=Array.isArray,Wa=ot(String.prototype.toLowerCase),sh=ot(String.prototype.toString),t2=ot(String.prototype.match),Ba=ot(String.prototype.replace),r2=ot(String.prototype.indexOf),FD=ot(String.prototype.trim),$D=ot(Number.prototype.toString),qD=ot(Boolean.prototype.toString),n2=typeof BigInt>"u"?null:ot(BigInt.prototype.toString),i2=typeof Symbol>"u"?null:ot(Symbol.prototype.toString),Gt=ot(Object.prototype.hasOwnProperty),Pa=ot(Object.prototype.toString),Ct=ot(RegExp.prototype.test),ri=HD(TypeError);function ot(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Af(r,e,n)}}function HD(r){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Nf(r,t)}}function Ee(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wa;if(Q4&&Q4(r,null),!xo(e))return r;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const s=t(i);s!==i&&(ID(e)||(e[n]=s),i=s)}r[i]=!0}return r}function _D(r){for(let e=0;e<r.length;e++)Gt(r,e)||(r[e]=null);return r}function or(r){const e=po(null);for(const n of Ev(r)){var t=OD(n,2);const i=t[0],s=t[1];Gt(r,i)&&(xo(s)?e[i]=_D(s):s&&typeof s=="object"&&s.constructor===Object?e[i]=or(s):e[i]=s)}return e}function jD(r){switch(typeof r){case"string":return r;case"number":return $D(r);case"boolean":return qD(r);case"bigint":return n2?n2(r):"0";case"symbol":return i2?i2(r):"Symbol()";case"undefined":return Pa(r);case"function":case"object":{if(r===null)return Pa(r);const e=r,t=wr(e,"toString");if(typeof t=="function"){const n=t(e);return typeof n=="string"?n:Pa(n)}return Pa(r)}default:return Pa(r)}}function wr(r,e){for(;r!==null;){const n=LD(r,e);if(n){if(n.get)return ot(n.get);if(typeof n.value=="function")return ot(n.value)}r=zD(r)}function t(){return null}return t}function VD(r){try{return Ct(r,""),!0}catch{return!1}}const s2=ut(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),oh=ut(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ah=ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),WD=ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),lh=ut(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),UD=ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),o2=ut(["#text"]),a2=ut(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ch=ut(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),l2=ut(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),u0=ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),KD=pt(/{{[\w\W]*|^[\w\W]*}}/g),GD=pt(/<%[\w\W]*|^[\w\W]*%>/g),JD=pt(/\${[\w\W]*/g),YD=pt(/^data-[\-\w.\u00B7-\uFFFF]+$/),XD=pt(/^aria-[\-\w]+$/),c2=pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ZD=pt(/^(?:\w+script|data):/i),QD=pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eO=pt(/^html$/i),tO=pt(/^[a-z][.\w]*(-[.\w]+)+$/i),u2=pt(/<[/\w!]/g),d2=pt(/<[/\w]/g),rO=pt(/<\/no(script|embed|frames)/i),nO=pt(/\/>/i),sr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ov=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],iO=ut(Ee({},Ov)),sO=(function(){const r={};return Zi(Ov,e=>{r[e]=pt(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),ut(r)})(),oO=function(){return typeof window>"u"?null:window},aO=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},h2=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ni=function(e,t,n,i){return Gt(e,t)&&xo(e[t])?Ee(i.base?or(i.base):{},e[t],i.transform):n},uh=function(e,t,n){const i=Gt(e,t)?e[t]:void 0;return i&&typeof i=="object"?or(i):n()};function Rv(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oO();const e=J=>Rv(J);if(e.version="3.4.16",e.removed=[],!r||!r.document||r.document.nodeType!==sr.document||!r.Element)return e.isSupported=!1,e;let t=r.document;const n=t,i=n.currentScript;r.DocumentFragment;const s=r.HTMLTemplateElement,o=r.Node,a=r.Element,l=r.NodeFilter;r.NamedNodeMap===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;const c=r.DOMParser,u=r.trustedTypes,d=a.prototype,h=wr(d,"cloneNode"),f=wr(d,"remove"),m=wr(d,"removeAttributeNode"),y=wr(d,"nextSibling"),b=wr(d,"childNodes"),v=wr(d,"parentNode"),k=wr(d,"shadowRoot"),M=wr(d,"attributes"),D=o&&o.prototype?wr(o.prototype,"nodeType"):null,O=o&&o.prototype?wr(o.prototype,"nodeName"):null,z=o&&o.prototype?wr(o.prototype,"ownerDocument"):null,T=function(S){return D?D(S):S.nodeType},B=function(S){return O?O(S):S.nodeName};if(typeof s=="function"){const J=t.createElement("template");J.content&&J.content.ownerDocument&&(t=J.content.ownerDocument)}let N,q="",te,Z=!1,me=0;const be=function(){if(me>0)throw ri('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},$=function(S){be(),me++;try{return N.createHTML(S)}finally{me--}},ve=function(S){be(),me++;try{return N.createScriptURL(S)}finally{me--}},Qe=function(){return Z||(te=aO(u,i),Z=!0),te},kt=t,mn=kt.implementation,tr=kt.createNodeIterator,yr=kt.createDocumentFragment,gn=kt.getElementsByTagName,Ot=n.importNode;let Oe=h2();e.isSupported=typeof Ev=="function"&&typeof v=="function"&&mn&&mn.createHTMLDocument!==void 0;const Ws=KD,Us=GD,Gr=JD,Ks=YD,Jr=XD,Gs=ZD,Fi=QD,$i=tO;let yn=c2,Re=null;const qi=Ee({},[...s2,...oh,...ah,...lh,...o2]);let Pe=null;const Jn=Ee({},[...a2,...ch,...l2,...u0]);let xt=Object.seal(po(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Yr=null,Xr=null;const rr=Object.seal(po(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Js=!0,vn=!0,Hi=!1,_i=!0,vr=!1,H=!0,G=!1,ce=!1,ge=null,lt=null,Fe=!1,et=!1,Rt=!1,Zr=!1,Yn=!0,Xn=!1;const Ea="user-content-";let ji=!0,mt=!1,nr={},St=null;const n1=Ee({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let i1=null;const s1=Ee({},["audio","video","img","source","image","track"]);let o1=null;const a1=Ee({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ic="http://www.w3.org/1998/Math/MathML",zc="http://www.w3.org/2000/svg",Qr="http://www.w3.org/1999/xhtml";let Ys=Qr,Ju=!1,Yu=null;const f7=Ee({},[Ic,zc,Qr],sh),l1=ut(["mi","mo","mn","ms","mtext"]);let Xu=Ee({},l1);const c1=ut(["annotation-xml"]);let Zu=Ee({},c1);const p7=Ee({},["title","style","font","a","script"]);let Da=null;const m7=["application/xhtml+xml","text/html"],g7="text/html";let tt=null,Xs=null;const y7=t.createElement("form"),u1=function(S){return S instanceof RegExp||S instanceof Function},Qu=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Xs&&Xs===S)return;(!S||typeof S!="object")&&(S={}),S=or(S),Da=m7.indexOf(S.PARSER_MEDIA_TYPE)===-1?g7:S.PARSER_MEDIA_TYPE,tt=Da==="application/xhtml+xml"?sh:Wa,Re=ni(S,"ALLOWED_TAGS",qi,{transform:tt}),Pe=ni(S,"ALLOWED_ATTR",Jn,{transform:tt}),Yu=ni(S,"ALLOWED_NAMESPACES",f7,{transform:sh}),o1=ni(S,"ADD_URI_SAFE_ATTR",a1,{transform:tt,base:a1}),i1=ni(S,"ADD_DATA_URI_TAGS",s1,{transform:tt,base:s1}),St=ni(S,"FORBID_CONTENTS",n1,{transform:tt}),Yr=ni(S,"FORBID_TAGS",or({}),{transform:tt}),Xr=ni(S,"FORBID_ATTR",or({}),{transform:tt}),nr=Gt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?or(S.USE_PROFILES):S.USE_PROFILES:!1,Js=S.ALLOW_ARIA_ATTR!==!1,vn=S.ALLOW_DATA_ATTR!==!1,Hi=S.ALLOW_UNKNOWN_PROTOCOLS||!1,_i=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vr=S.SAFE_FOR_TEMPLATES||!1,H=S.SAFE_FOR_XML!==!1,G=S.WHOLE_DOCUMENT||!1,et=S.RETURN_DOM||!1,Rt=S.RETURN_DOM_FRAGMENT||!1,Zr=S.RETURN_TRUSTED_TYPE||!1,Fe=S.FORCE_BODY||!1,Yn=S.SANITIZE_DOM!==!1,Xn=S.SANITIZE_NAMED_PROPS||!1,ji=S.KEEP_CONTENT!==!1,mt=S.IN_PLACE||!1,yn=VD(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:c2,Ys=typeof S.NAMESPACE=="string"?S.NAMESPACE:Qr,Xu=uh(S,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ee({},l1)),Zu=uh(S,"HTML_INTEGRATION_POINTS",()=>Ee({},c1));const P=uh(S,"CUSTOM_ELEMENT_HANDLING",()=>po(null));if(xt=po(null),Gt(P,"tagNameCheck")&&u1(P.tagNameCheck)&&(xt.tagNameCheck=P.tagNameCheck),Gt(P,"attributeNameCheck")&&u1(P.attributeNameCheck)&&(xt.attributeNameCheck=P.attributeNameCheck),Gt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(xt.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),pt(xt),vr&&(vn=!1),Rt&&(et=!0),nr&&(Re=Ee({},o2),Pe=po(null),nr.html===!0&&(Ee(Re,s2),Ee(Pe,a2)),nr.svg===!0&&(Ee(Re,oh),Ee(Pe,ch),Ee(Pe,u0)),nr.svgFilters===!0&&(Ee(Re,ah),Ee(Pe,ch),Ee(Pe,u0)),nr.mathMl===!0&&(Ee(Re,lh),Ee(Pe,l2),Ee(Pe,u0))),rr.tagCheck=null,rr.attributeCheck=null,Gt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?rr.tagCheck=S.ADD_TAGS:xo(S.ADD_TAGS)&&(Re===qi&&(Re=or(Re)),Ee(Re,S.ADD_TAGS,tt))),Gt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?rr.attributeCheck=S.ADD_ATTR:xo(S.ADD_ATTR)&&(Pe===Jn&&(Pe=or(Pe)),Ee(Pe,S.ADD_ATTR,tt))),Gt(S,"ADD_FORBID_CONTENTS")&&xo(S.ADD_FORBID_CONTENTS)&&(St===n1&&(St=or(St)),Ee(St,S.ADD_FORBID_CONTENTS,tt)),ji&&(Re["#text"]=!0),G&&Ee(Re,["html","head","body"]),Re.table&&(Ee(Re,["tbody"]),delete Yr.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw ri('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ri('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=N;N=S.TRUSTED_TYPES_POLICY;try{q=$("")}catch(ee){throw N=U,ee}}else S.TRUSTED_TYPES_POLICY===null?(N=void 0,q=""):(N===void 0&&(N=Qe()),N&&typeof q=="string"&&(q=$("")));ut&&ut(S),Xs=S},d1=Ee({},[...oh,...ah,...WD]),h1=Ee({},[...lh,...UD]),v7=function(S,P,U){return P.namespaceURI===Qr?S==="svg":P.namespaceURI===Ic?S==="svg"&&(U==="annotation-xml"||Xu[U]):!!d1[S]},b7=function(S,P,U){return P.namespaceURI===Qr?S==="math":P.namespaceURI===zc?S==="math"&&Zu[U]:!!h1[S]},w7=function(S,P,U){return P.namespaceURI===zc&&!Zu[U]||P.namespaceURI===Ic&&!Xu[U]?!1:!h1[S]&&(p7[S]||!d1[S])},k7=function(S){let P=v(S);(!P||!P.tagName)&&(P={namespaceURI:Ys,tagName:"template"});const U=Wa(S.tagName),ee=Wa(P.tagName);return Yu[S.namespaceURI]?S.namespaceURI===zc?v7(U,P,ee):S.namespaceURI===Ic?b7(U,P,ee):S.namespaceURI===Qr?w7(U,P,ee):!!(Da==="application/xhtml+xml"&&Yu[S.namespaceURI]):!1},Zn=function(S){La(e.removed,{element:S});try{v(S).removeChild(S)}catch{if(f(S),!v(S))throw ri("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},f1=function(S,P,U){try{m(S,P)}catch{try{S.removeAttribute(U)}catch{}}},Lc=function(S){Bc(S);const P=b(S);if(P){const ee=[];Zi(P,le=>{La(ee,le)}),Zi(ee,le=>{try{f(le)}catch{}})}const U=M(S);if(U)for(let ee=U.length-1;ee>=0;--ee){const le=U[ee],xe=le&&le.name;typeof xe=="string"&&f1(S,le,xe)}},Vi=function(S,P,U){if(!U)try{U=P.getAttributeNode(S)}catch{U=null}La(e.removed,{attribute:U||null,from:P});try{U?m(P,U):P.removeAttribute(S)}catch{try{P.removeAttribute(S)}catch{}}if(S==="is")if(et||Rt)try{Zn(P)}catch{}else try{P.setAttribute(S,"")}catch{}},x7=function(S){const P=M(S);if(P)for(let U=P.length-1;U>=0;--U){const ee=P[U],le=ee&&ee.name;typeof le!="string"||Pe[tt(le)]||f1(S,ee,le)}},Bc=function(S){const P=[S];for(;P.length>0;){const U=P.pop();T(U)===sr.element&&x7(U);const ee=b(U);if(ee)for(let le=ee.length-1;le>=0;--le)P.push(ee[le])}},p1=function(S,P){return H?S==="patchsrc"?!0:S==="for"&&P!=="label"&&P!=="output":!1},S7=function(S){if(!H)return;const P=[S];for(;P.length>0;){const U=P.pop(),ee=T(U);if(ee===sr.processingInstruction||ee===sr.comment&&Ct(d2,U.data)){try{f(U)}catch{}continue}if(ee===sr.element){const xe=U,Te=tt(B(U));try{xe.hasAttribute&&xe.hasAttribute("patchsrc")&&xe.removeAttribute("patchsrc"),xe.hasAttribute&&xe.hasAttribute("for")&&p1("for",Te)&&xe.removeAttribute("for")}catch{}}const le=b(U);if(le)for(let xe=le.length-1;xe>=0;--xe)P.push(le[xe])}},m1=function(S){let P=null,U=null;if(Fe)S="<remove></remove>"+S;else{const xe=t2(S,/^[\r\n\t ]+/);U=xe&&xe[0]}Da==="application/xhtml+xml"&&Ys===Qr&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ee=N?$(S):S;if(Ys===Qr)try{P=new c().parseFromString(ee,Da)}catch{}if(!P||!P.documentElement){P=mn.createDocument(Ys,"template",null);try{P.documentElement.innerHTML=Ju?q:ee}catch{}}const le=P.body||P.documentElement;return S&&U&&le.insertBefore(t.createTextNode(U),le.childNodes[0]||null),Ys===Qr?gn.call(P,G?"html":"body")[0]:G?P.documentElement:le},g1=function(S){const P=z?z(S):S.ownerDocument;return tr.call(P||S,S,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Pc=function(S){return S=Ba(S,Ws," "),S=Ba(S,Us," "),S=Ba(S,Gr," "),S},ed=function(S){var P;S.normalize();const U=z?z(S):S.ownerDocument,ee=tr.call(U||S,S,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let le=ee.nextNode();for(;le;)le.data=Pc(le.data),le=ee.nextNode();const xe=(P=S.querySelectorAll)===null||P===void 0?void 0:P.call(S,"template");xe&&Zi(xe,Te=>{Zs(Te.content)&&ed(Te.content)})},Fc=function(S){const P=O?O(S):null;return typeof P!="string"||tt(P)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==M(S)||typeof S.removeAttribute!="function"||typeof S.removeAttributeNode!="function"||typeof S.getAttributeNode!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==D(S)||S.childNodes!==b(S)},Zs=function(S){if(!D||typeof S!="object"||S===null)return!1;try{return D(S)===sr.documentFragment}catch{return!1}},Oa=function(S){if(!D||typeof S!="object"||S===null)return!1;try{return typeof D(S)=="number"}catch{return!1}};function en(J,S,P){J.length!==0&&Zi(J,U=>{U.call(e,S,P,Xs)})}const C7=function(S,P){return!!(H&&S.hasChildNodes()&&!Oa(S.firstElementChild)&&Ct(u2,S.textContent)&&Ct(u2,S.innerHTML)||H&&S.namespaceURI===Qr&&iO[P]&&(Oa(S.firstElementChild)||typeof S.textContent=="string"&&Ct(sO[P],S.textContent))||S.nodeType===sr.processingInstruction||H&&S.nodeType===sr.comment&&Ct(d2,S.data))},$c=function(S,P){if(S instanceof RegExp)return Ct(S,P);if(S instanceof Function){for(var U=arguments.length,ee=new Array(U>2?U-2:0),le=2;le<U;le++)ee[le-2]=arguments[le];return!!S(P,...ee)}return!1},M7=function(S,P,U){if(!Yr[P]&&w1(P)&&$c(xt.tagNameCheck,P))return!1;if(ji&&!St[P]){const ee=v(S),le=b(S);if(le&&ee){const xe=le.length;for(let Te=xe-1;Te>=0;--Te){const Je=S===U?h(le[Te],!0):le[Te];ee.insertBefore(Je,y(S))}}}return Zn(S),!0},y1=function(S,P,U,ee){return S.length===0?P:P===U||P===ee?or(P):P},Qs=function(S,P){return S===P||v(S)!==null?!1:(mt&&Bc(S),!0)},v1=function(S,P){if(en(Oe.beforeSanitizeElements,S,null),Qs(S,P))return!0;if(Fc(S))return Zn(S),!0;const U=tt(B(S));if(Re=y1(Oe.uponSanitizeElement,Re,qi,ge),en(Oe.uponSanitizeElement,S,{tagName:U,allowedTags:Re}),Qs(S,P))return!0;if(C7(S,U))return Zn(S),!0;if(Yr[U]||!(rr.tagCheck instanceof Function&&rr.tagCheck(U))&&!Re[U]){const ee=M7(S,U,P);return ee===!1&&(en(Oe.afterSanitizeElements,S,null),Qs(S,P))?!0:ee}if(T(S)===sr.element&&!k7(S)||(U==="noscript"||U==="noembed"||U==="noframes")&&Ct(rO,S.innerHTML))return Zn(S),!0;if(vr&&S.nodeType===sr.text){const ee=Pc(S.textContent);S.textContent!==ee&&(La(e.removed,{element:S.cloneNode()}),S.textContent=ee)}return en(Oe.afterSanitizeElements,S,null),Qs(S,P)},b1=function(S,P,U){if(Xr[P]||p1(P,S)||Yn&&(P==="id"||P==="name")&&(U in t||U in y7))return!1;const ee=Pe[P]||rr.attributeCheck instanceof Function&&rr.attributeCheck(P,S);return vn&&Ct(Ks,P)||Js&&Ct(Jr,P)?!0:ee?o1[P]||Ct(yn,Ba(U,Fi,""))||(P==="src"||P==="xlink:href"||P==="href")&&S!=="script"&&r2(U,"data:")===0&&i1[S]||Hi&&!Ct(Gs,Ba(U,Fi,""))?!0:!U:w1(S)&&$c(xt.tagNameCheck,S)&&$c(xt.attributeNameCheck,P,S)||P==="is"&&xt.allowCustomizedBuiltInElements&&$c(xt.tagNameCheck,U)},T7=Ee({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),w1=function(S){return!T7[Wa(S)]&&Ct($i,S)},A7=function(S,P,U,ee){if(N&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!U)switch(u.getAttributeType(S,P)){case"TrustedHTML":return $(ee);case"TrustedScriptURL":return ve(ee)}return ee},N7=function(S,P,U,ee){try{return U?S.setAttributeNS(U,P,ee):S.setAttribute(P,ee),Fc(S)?(Zn(S),!1):!0}catch{return Vi(P,S),!1}},k1=function(S,P){if(en(Oe.beforeSanitizeAttributes,S,null),Qs(S,P))return;const U=S.attributes;if(!U||Fc(S))return;Pe=y1(Oe.uponSanitizeAttribute,Pe,Jn,lt);const ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let le=U.length;const xe=tt(S.nodeName);for(;le--;){const Te=U[le],Je=Te.name,br=Te.namespaceURI,ir=Te.value,eo=tt(Je),rd=ir;let It=Je==="value"?rd:FD(rd),x1=!1;if(ee.attrName=eo,ee.attrValue=It,ee.keepAttr=!0,ee.forceKeepAttr=void 0,en(Oe.uponSanitizeAttribute,S,ee),It=ee.attrValue,Xn&&(eo==="id"||eo==="name")&&r2(It,Ea)!==0&&(Vi(Je,S,Te),It=Ea+It,x1=!0),H&&Ct(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){Vi(Je,S,Te);continue}if(eo==="attributename"&&t2(It,"href")){Vi(Je,S,Te);continue}if(!ee.forceKeepAttr){if(!ee.keepAttr){Vi(Je,S,Te);continue}if(!_i&&Ct(nO,It)){Vi(Je,S,Te);continue}if(vr&&(It=Pc(It)),!b1(xe,eo,It)){Vi(Je,S,Te);continue}It=A7(xe,eo,br,It),It!==rd&&N7(S,Je,br,It)&&x1&&e2(e.removed)}}en(Oe.afterSanitizeAttributes,S,null),Qs(S,P)},qc=function(S){let P=null;const U=g1(S);for(en(Oe.beforeSanitizeShadowDOM,S,null);P=U.nextNode();)if(en(Oe.uponSanitizeShadowNode,P,null),v1(P,S),k1(P,S),Zs(P.content)&&qc(P.content),T(P)===sr.element){const ee=k(P);Zs(ee)&&(td(ee),qc(ee))}en(Oe.afterSanitizeShadowDOM,S,null)},td=function(S){const P=[{node:S,shadow:null}];for(;P.length>0;){const U=P.pop();if(U.shadow){qc(U.shadow);continue}const ee=U.node,le=T(ee)===sr.element,xe=b(ee);if(xe)for(let Te=xe.length-1;Te>=0;--Te)P.push({node:xe[Te],shadow:null});if(le){const Te=O?O(ee):null;if(typeof Te=="string"&&tt(Te)==="template"){const Je=ee.content;Zs(Je)&&P.push({node:Je,shadow:null})}}if(le){const Te=k(ee);Zs(Te)&&P.push({node:null,shadow:Te},{node:Te,shadow:null})}}};return e.sanitize=function(J){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,U=null,ee=null,le=null;if(Ju=!J,Ju&&(J="<!-->"),typeof J!="string"&&!Oa(J)&&(J=jD(J),typeof J!="string"))throw ri("dirty is not a string, aborting");if(!e.isSupported)return J;ce?(Re=ge,Pe=lt):Qu(S),(Oe.uponSanitizeElement.length>0||Oe.uponSanitizeAttribute.length>0)&&(Re=or(Re)),Oe.uponSanitizeAttribute.length>0&&(Pe=or(Pe)),e.removed=[];const xe=mt&&typeof J!="string"&&Oa(J);if(xe){S7(J);const br=B(J);if(typeof br=="string"){const ir=tt(br);if(!Re[ir]||Yr[ir])throw Lc(J),ri("root node is forbidden and cannot be sanitized in-place")}if(Fc(J))throw Lc(J),ri("root node is clobbered and cannot be sanitized in-place");try{td(J)}catch(ir){throw Lc(J),ir}}else if(Oa(J))P=m1("<!---->"),U=P.ownerDocument.importNode(J,!0),U.nodeType===sr.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?P=U:P.appendChild(U),td(P);else{if(!et&&!vr&&!G&&J.indexOf("<")===-1)return N&&Zr?$(J):J;if(P=m1(J),!P)return et?null:Zr?q:""}P&&Fe&&Zn(P.firstChild);const Te=xe?J:P;try{const br=g1(Te);for(;ee=br.nextNode();)v1(ee,Te),k1(ee,Te),Zs(ee.content)&&qc(ee.content)}catch(br){throw xe&&(Lc(J),Zi(e.removed,ir=>{ir.element&&Bc(ir.element)})),br}if(xe){let br=!1;if(Zi(e.removed,ir=>{ir.element&&(ir.element===J&&(br=!0),Bc(ir.element))}),br)throw ri("a node selected for removal could not be safely returned; refusing to sanitize in place");return vr&&ed(J),J}if(et){if(vr&&ed(P),Rt)for(le=yr.call(P.ownerDocument);P.firstChild;)le.appendChild(P.firstChild);else le=P;return(Pe.shadowroot||Pe.shadowrootmode)&&(le=Ot.call(n,le,!0)),le}let Je=G?P.outerHTML:P.innerHTML;return G&&Re["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Ct(eO,P.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
|
|
1192
|
+
`+Je),vr&&(Je=Pc(Je)),N&&Zr?$(Je):Je},e.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qu(J),ce=!0,ge=Re,lt=Pe},e.clearConfig=function(){Xs=null,ce=!1,ge=null,lt=null,N=te,q=""},e.isValidAttribute=function(J,S,P){Xs||Qu({});const U=tt(J),ee=tt(S);return b1(U,ee,P)},e.addHook=function(J,S){typeof S=="function"&&Gt(Oe,J)&&La(Oe[J],S)},e.removeHook=function(J,S){if(Gt(Oe,J)){if(S!==void 0){const P=BD(Oe[J],S);return P===-1?void 0:PD(Oe[J],P,1)[0]}return e2(Oe[J])}},e.removeHooks=function(J){Gt(Oe,J)&&(Oe[J]=[])},e.removeAllHooks=function(){Oe=h2()},e}var Iv=Rv();const lO=[J7(),Y7(),X7(),Z7(),Q7(),K2(),eb(),p0.allowMultipleSelections.of(!0),tb(),G2(rb,{fallback:!0}),nb(),ib(),sb(),ob(),ab(),lb(),cb(),Lf.of([...ub,...J2,...db,...hb,...fb,...pb,...mb])];function cO(r){const e=[[-1,r.state.doc]],t=[];for(;e.length>0;){const[n,i]=e.pop();if(n>=0){const s=r.nodeDOM(n);if(s&&Zb(s)){const{top:o,bottom:a,left:l,right:c}=s.getBoundingClientRect();t.push([n,[l,o,c,o]],[n+i.nodeSize,[l,a,c,a]])}}if(i.isBlock&&!i.isTextblock){let s=n+1;for(const o of i.children)e.push([s,o]),s+=o.nodeSize}}return t}function uO(r,e){let t=[],n,i;const s=()=>{const u=r.dom.getBoundingClientRect(),d=r.state.doc;return t&&n&&i&&u.width===i.width&&u.height===i.height&&u.x===i.x&&u.y===i.y&&n.eq(d)||(i=u,n=d,t=cO(r)),t},o=(u,d)=>{if(!r.editable||r.isDestroyed)return;const h=(y,b)=>{const[v,k]=y,[M,D]=b;return p2(u,k)-p2(u,D)||v-M};let f=s();f.sort(h),f=f.slice(0,8);const m=f.find(y=>(e==null?void 0:e({view:r,pos:y[0],event:d}))!==!1);if(!(m&&hO(r,m[0])))return m};let a,l;return(u,d)=>(a&&dO(a,u)||(a=u,l=o(u,d)),l)}function dO(r,e){return r[0]===e[0]&&r[1]===e[1]}function f2(r,e){return Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1])}function p2(r,e){return Math.min(f2(r,[e[0],e[1]]),f2(r,[e[2],e[3]]))}function hO(r,e){const t=r.dragging;if(!t)return;const{move:n}=t;if(!n)return;const i=r.state.selection;if(!(i instanceof ae))return;const{from:s,to:o}=i;return s<=e&&e<=o}function fO(r){let e;return new Ae({key:new De("prosemirror-drop-indicator"),view:t=>(e=uO(t,r.onDrag),mO(t,e,r)),props:{handleDrop(t,n,i,s){if(!e)return!1;const o=e([n.clientX,n.clientY],n);if(!o)return!1;n.preventDefault();const a=o[0],l=t.state.tr;if(s){const{node:f}=t.dragging||{};f?f.replace(l):l.deleteSelection()}const c=l.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(d))return!0;const h=l.doc.resolve(c);if(u&&ae.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new ae(h));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,y,b,v)=>f=v),l.setSelection(pO(t,h,l.doc.resolve(f)))}return t.focus(),t.dispatch(l.setMeta("uiEvent","drop")),!0}}})}function pO(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||se.between(e,t,n)}function mO(r,e,t){const n=r.dom;let i,s,o,a=!1;const l=()=>{i&&clearTimeout(i),a=!1,i=setTimeout(()=>{var d;a||(d=t.onHide)==null||d.call(t)},30)},c=d=>{var y;a=!0;const{clientX:h,clientY:f}=d;if(s===h&&o===f)return;s=h,o=f;const m=e([h,f],d);if(m){const[b,[v,k,M,D]]=m,O={p1:{x:v,y:k},p2:{x:M,y:D}};(y=t.onShow)==null||y.call(t,{view:r,pos:b,line:O})}else{l();return}};return n.addEventListener("dragover",c),n.addEventListener("dragend",l),n.addEventListener("drop",l),n.addEventListener("dragleave",l),{destroy:()=>{n.removeEventListener("dragover",c),n.removeEventListener("dragend",l),n.removeEventListener("drop",l),n.removeEventListener("dragleave",l)}}}class Xe extends pe{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Xe.valid(n)?new Xe(n):pe.near(n)}content(){return re.empty}eq(e){return e instanceof Xe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Xe(e.resolve(t.pos))}getBookmark(){return new Km(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!gO(e)||!yO(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Xe.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Xe.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ae.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(Xe.valid(a))return a}return null}}}Xe.prototype.visible=!1;Xe.findFrom=Xe.findGapCursorFrom;pe.jsonID("gapcursor",Xe);class Km{constructor(e){this.pos=e}map(e){return new Km(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Xe.valid(t)?new Xe(t):pe.near(t)}}function zv(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function gO(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||zv(i.type))return!0;if(i.inlineContent)return!1}}return!0}function yO(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||zv(i.type))return!0;if(i.inlineContent)return!1}}return!0}function vO(){return new Ae({props:{decorations:xO,createSelectionBetween(r,e,t){return e.pos==t.pos&&Xe.valid(t)?new Xe(t):null},handleClick:wO,handleKeyDown:bO,handleDOMEvents:{beforeinput:kO}}})}const bO=tp({ArrowLeft:d0("horiz",-1),ArrowRight:d0("horiz",1),ArrowUp:d0("vert",-1),ArrowDown:d0("vert",1)});function d0(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof se){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Xe.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Xe(c))),!0):!1}}function wO(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!Xe.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&ae.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new Xe(n))),!0)}function kO(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof Xe))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=V.empty;for(let o=n.length-1;o>=0;o--)i=V.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new re(i,0,0));return s.setSelection(se.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function xO(r){if(!(r.selection instanceof Xe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",$e.create(r.doc,[Ze.widget(r.selection.head,e,{key:"gapcursor"})])}function Rc(r,e){return Object.assign(r,{meta:{package:"@milkdown/plugin-cursor",...e}}),r}var El=Ne(null,"dropIndicatorState");Rc(El,{displayName:"Ctx<dropIndicatorState>"});var ju=Ne({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");Rc(ju,{displayName:"Ctx<dropIndicatorConfig>"});var SO=new De("MILKDOWN_DROP_INDICATOR_DOM"),Lv=qe(r=>new Ae({key:SO,view:e=>{var o;const t=r.get(ju.key),n=document.createElement("div");Object.assign(n.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:t.color,top:"0",left:"0"}),n.classList.add(t.class),n.classList.add("milkdown-drop-indicator"),(o=e.dom.parentNode)==null||o.appendChild(n);const i=r.use(El.key),s=a=>{CO(n,a,t)};return i.on(s),{destroy:()=>{i.off(s),n.remove()}}}}));Rc(Lv,{displayName:"Prose<dropIndicatorDOM>"});function CO(r,e,t){if(!e){Object.assign(r.style,{display:"none"});return}const{line:n}=e,{width:i}=t,{p1:{x:s,y:o},p2:{x:a,y:l}}=n,c=o===l;let u,d,h=o,f=s;c?(u=a-s,d=i,h-=i/2):(u=i,d=l-o,f-=i/2),h=Math.round(h),f=Math.round(f),Object.assign(r.style,{display:"block",width:`${u}px`,height:`${d}px`,transform:`translate(${f}px, ${h}px)`})}var Bv=qe(r=>fO({onShow:n=>{r.set(El.key,n)},onHide:()=>{r.set(El.key,null)},onDrag:()=>!0}));Rc(Bv,{displayName:"Prose<dropIndicator>"});var Pv=qe(()=>vO());Rc(Pv,{displayName:"Prose<gapCursor>"});var MO=[Pv,ju,El,Lv,Bv].flat();function TO(r){var e;const t=(e=void 0)!=null?e:!1;let n=typeof document>"u"?null:document.createElement("div");return new Ae({key:AO,view:i=>{t!==!0&&OO(i.state.schema,t||[]);const s=i.dom.ownerDocument;n=n||document.createElement("div");const o=n,a=()=>{EO(i,o)};let l;return window.ResizeObserver&&(l=new window.ResizeObserver(()=>a()),l.observe(i.dom)),s.addEventListener("selectionchange",a),{update:()=>{a()},destroy:()=>{s.removeEventListener("selectionchange",a),l&&l.unobserve(i.dom)}}},props:{handleKeyDown:(i,s)=>{var o;const{selection:a}=i.state;if(s.altKey||s.ctrlKey||s.metaKey||s.shiftKey||s.isComposing||!["ArrowLeft","ArrowRight"].includes(s.key)||!Ef(a)||!a.empty)return!1;const l=a.$head,[c,u]=Fv(l),d=i.state.storedMarks||l.marks();if(c&&u&&!ke.sameSet(c,u)){if(s.key==="ArrowLeft"&&!ke.sameSet(c,d))return i.dispatch(i.state.tr.setStoredMarks(c)),!0;if(s.key==="ArrowRight"&&!ke.sameSet(u,d))return i.dispatch(i.state.tr.setStoredMarks(u)),!0}return s.key==="ArrowLeft"&&l.textOffset===1?(i.dispatch(i.state.tr.setSelection(se.create(i.state.doc,l.pos-1)).setStoredMarks(l.marks())),!0):s.key==="ArrowRight"&&l.textOffset+1===((o=l.parent.maybeChild(l.index()))==null?void 0:o.nodeSize)?(i.dispatch(i.state.tr.setSelection(se.create(i.state.doc,l.pos+1)).setStoredMarks(l.marks())),!0):!1},decorations:i=>{if(!(!n||!Ef(i.selection)||!i.selection.empty))return $e.create(i.doc,[Ze.widget(0,n,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}var AO=new De("prosemirror-virtual-cursor");function NO(r,e){var t;const n=window.getSelection();if(!n||!n.rangeCount)return null;const i=(t=n==null?void 0:n.getRangeAt(0))==null?void 0:t.cloneRange();if(!i)return null;i.collapse(e);const s=i.getClientRects(),o=s!=null&&s.length?s[s.length-1]:null;return o!=null&&o.height?o:r.coordsAtPos(r.state.selection.head)}function Fv(r){const e=r.index(),t=r.parent.maybeChild(e);let n=r.textOffset?t:null;return!n&&e>0&&(n=r.parent.maybeChild(e-1)),[n==null?void 0:n.marks,t==null?void 0:t.marks]}function Ef(r){return r&&typeof r=="object"&&"$cursor"in r}function EO(r,e){if(!r||!r.dom||r.isDestroyed||!e)return;const{state:t,dom:n}=r,{selection:i}=t;if(!Ef(i))return;const s=NO(r,i.$head===i.$from);if(!s)return e;const o=n.getBoundingClientRect();let a="prosemirror-virtual-cursor";const l=t.selection.$head,[c,u]=Fv(l),d=t.storedMarks||l.marks();i.$cursor&&c&&u&&d&&!ke.sameSet(c,u)&&(ke.sameSet(c,d)?a+=" prosemirror-virtual-cursor-left":ke.sameSet(u,d)&&(a+=" prosemirror-virtual-cursor-right")),e.className=a,DO(e,"prosemirror-virtual-cursor-animation"),e.style.height=`${s.bottom-s.top}px`,e.style.left=`${s.left-o.left}px`,e.style.top=`${s.top-o.top}px`}function DO(r,e){r.classList.remove(e),r.offsetWidth,r.classList.add(e)}function OO(r,e){for(const[t,n]of Object.entries(r.marks))n.spec.inclusive===!1&&!e.includes(t)&&console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${t}" mark or adding it to the "skipWarning" option.`)}var dc,hc,fc,ta,ra,na,rn,pc,mc,ia,gi,sa,gc,yc,H2,Vu=(H2=class{constructor(r){_(this,dc);_(this,hc);_(this,fc);_(this,ta);_(this,ra);_(this,na);_(this,rn);_(this,pc);_(this,mc);_(this,ia);_(this,gi);_(this,sa);_(this,gc);_(this,yc);F(this,na,!1),this.onShow=()=>{},this.onHide=()=>{},F(this,gi,e=>{Wr(e,this.element,{placement:C(this,ta).placement??"top",middleware:[tu(),Mi(C(this,pc)),U2(C(this,mc)),...C(this,fc)],...C(this,ta)}).then(({x:t,y:n})=>{Object.assign(this.element.style,{left:`${t}px`,top:`${n}px`})}).catch(console.error)}),F(this,sa,e=>C(this,ra)!==e.dom.parentElement),F(this,gc,(e,t)=>{var h;const{state:n,composing:i}=e,{selection:s,doc:o}=n,{ranges:a}=s,l=Math.min(...a.map(f=>f.$from.pos)),c=Math.max(...a.map(f=>f.$to.pos)),u=t&&t.doc.eq(o)&&t.selection.eq(s);if(C(this,na)||((C(this,ra)??e.dom.parentElement??document.body).appendChild(this.element),F(this,na,!0)),i||u)return;if((h=C(this,rn))==null||h.call(this),F(this,rn,void 0),!C(this,hc).call(this,e,t)){this.hide();return}const d={getBoundingClientRect:()=>pu(e,l,c),contextElement:e.dom};C(this,sa).call(this,e)?F(this,rn,A1(d,this.element,()=>C(this,gi).call(this,d))):C(this,gi).call(this,d),this.show()}),this.update=(e,t)=>{C(this,ia).call(this,e,t)},F(this,yc,e=>{const{doc:t,selection:n}=e.state,{empty:i,from:s,to:o}=n,a=!t.textBetween(s,o).length&&e.state.selection instanceof se,l=this.element.contains(document.activeElement),c=!e.hasFocus()&&!l,u=!e.editable;return!(c||i||a||u)}),this.destroy=()=>{var e;(e=C(this,rn))==null||e.call(this),C(this,ia).cancel()},this.show=(e,t)=>{var n;if(this.element.dataset.show="true",e){(n=C(this,rn))==null||n.call(this),F(this,rn,void 0);const i={...e,contextElement:t==null?void 0:t.dom};t&&C(this,sa).call(this,t)?F(this,rn,A1(i,this.element,()=>C(this,gi).call(this,i))):C(this,gi).call(this,i)}this.onShow()},this.hide=()=>{this.element.dataset.show!=="false"&&(this.element.dataset.show="false",this.onHide())},this.element=r.content,F(this,dc,r.debounce??200),F(this,hc,r.shouldShow??C(this,yc)),F(this,pc,r.offset),F(this,mc,r.shift),F(this,fc,r.middleware??[]),F(this,ta,r.floatingUIOptions??{}),F(this,ra,r.root),this.element.dataset.show="false",F(this,ia,xv(C(this,gc),C(this,dc)))}},dc=new WeakMap,hc=new WeakMap,fc=new WeakMap,ta=new WeakMap,ra=new WeakMap,na=new WeakMap,rn=new WeakMap,pc=new WeakMap,mc=new WeakMap,ia=new WeakMap,gi=new WeakMap,sa=new WeakMap,gc=new WeakMap,yc=new WeakMap,H2);function Wu(r){const e=Ne({},`${r}_TOOLTIP_SPEC`),t=qe(i=>{const s=i.get(e.key);return new Ae({key:new De(`${r}_TOOLTIP`),...s})}),n=[e,t];return n.key=e.key,n.pluginKey=t.key,e.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${r}`},t.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${r}`},n}const $v=R.createContext(null),RO=$v.Provider;function Lr(){const r=R.useContext($v);if(!r)throw new Error("useEditorCtx must be used within <MarkdownEditor>");if(!r.current)throw new Error("Milkdown ctx is not ready yet");return r.current}function Gn(r){return R.useSyncExternalStore(e=>(r.dom.addEventListener("blintz:editable",e),()=>r.dom.removeEventListener("blintz:editable",e)),()=>r.editable,()=>r.editable)}const IO={},qv=R.createContext(IO),zO=qv.Provider;function Hv(){return R.useContext(qv)}function LO(r,e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}class _v{constructor(e){Ce(this,"entries",new Map);Ce(this,"listeners",new Set);Ce(this,"resolve");Ce(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));this.resolve=e}get enabled(){return typeof this.resolve=="function"}read(e){if(!this.resolve)return;const t=[e.embed?1:0,e.target,e.heading===null?"":e.heading].join("\0"),n=this.entries.get(t);if(n)return n;const i=s=>{this.entries.set(t,s),queueMicrotask(()=>this.listeners.forEach(o=>o()))};try{const s=this.resolve(e);if(s&&typeof s.then=="function"){const a={state:"pending"};return this.entries.set(t,a),Promise.resolve(s).then(l=>i({state:"resolved",resolution:l}),()=>i({state:"failed"})),a}const o={state:"resolved",resolution:s};return this.entries.set(t,o),o}catch{const s={state:"failed"};return this.entries.set(t,s),s}}}const jv={},Vv=R.createContext({options:jv,resolver:new _v(void 0)});function BO({options:r=jv,children:e}){const t=R.useMemo(()=>new _v(r.resolve),[r.resolve]),n=R.useMemo(()=>({options:r,resolver:t}),[r,t]);return L.jsx(Vv.Provider,{value:n,children:e})}function Wv(){return R.useContext(Vv)}const Uv=R.createContext(void 0),PO=Uv.Provider;function Kv(){return R.useContext(Uv)}const Gv=R.createContext("light"),FO=Gv.Provider;function $O(){return R.useContext(Gv)}function $t(...r){return r.filter(Boolean).join(" ")}const qO="blintz:document-reset";function h0(r){const e=new Map;for(const t of Reflect.ownKeys(r)){const n=Object.getOwnPropertyDescriptor(r,t);if(n.enumerable){if(!("value"in n))return;e.set(t,n.value)}}return e}function m2(r,e){return r.size===e.size&&[...r].every(([t,n])=>e.has(t)&&e.get(t)===n)}function Jv(r,e){const t=h0(r),n=h0(e);if(!t||!n)return!1;const i=t.get("parseDOM");t.delete("parseDOM");const s=n.get("parseDOM");if(!n.has("parseDOM")||(n.delete("parseDOM"),!m2(t,n)))return!1;if(i===void 0)return s===void 0;if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;const o=Object.getOwnPropertyDescriptor(r,"priority");if(o&&!("value"in o))return!1;for(let a=0;a<i.length;a++){const l=Object.getOwnPropertyDescriptor(i,String(a)),c=Object.getOwnPropertyDescriptor(s,String(a));if(!l||!("value"in l)||!c||!("value"in c)||!l.value||!c.value||typeof l.value!="object"||typeof c.value!="object")return!1;const u=h0(l.value),d=h0(c.value);if(!u||!d)return!1;const h=new Map([["priority",o==null?void 0:o.value]]);for(const[f,m]of u)h.set(f,m);if(!m2(h,d))return!1}return!0}function HO(r,e,t){if(r.type.schema!==e.type.schema||t.schema!==e.type.schema)return!1;const n={};let i=!0;const s=(o,a)=>{if(o.type!==a.type||!o.sameMarkup(a)&&o.type!==t||o.childCount!==a.childCount)return!1;if(o.type===t){const l={...o.attrs};if(o.textContent.trim().length){let c=o.textContent.toLowerCase().trim().replace(/\s+/g,"-");if(c in n&&!Object.prototype.hasOwnProperty.call(n,c))return i=!1,!1;n[c]?(n[c]=n[c]+1,c+=`-#${n[c]}`):n[c]=1,l.id=c}if(!t.create(l,o.content,o.marks).sameMarkup(a))return!1}if(o.isText&&o.text!==a.text)return!1;for(let l=0;l<o.childCount;l++)if(!s(o.child(l),a.child(l)))return!1;return!0};return s(r,e)&&i}const Mr=new WeakMap,_O=Fs.key._defaultValue.shouldAppend,jO=Fs.key._defaultValue.getNode;function Yv(r,e){var t;((t=Mr.get(r))==null?void 0:t.value)!==e||e.phase==="disposed"||!e.parserReady||!e.ctx||!e.schema||!e.registered||!e.plugin||!e.generator||!e.factory||(e.phase="ready",Mr.set(r,{phase:"ready",value:e,ctx:e.ctx,schema:e.schema,registered:e.registered,plugin:e.plugin,generator:e.generator,factory:e.factory,extensions:e.extensions}))}function VO(r,e){var n;const t=Mr.get(r);if(!t||t.phase!=="ready"||t.extensions||!t.ctx||!t.schema||!t.registered||!t.plugin)return!1;try{const i=t.schema.nodes.heading;return!!i&&e.schema===t.schema&&t.ctx.get(Zt)===t.schema&&t.ctx.get(Hn.key)===t.generator&&t.ctx.get(Pt.key)===t.factory&&((n=t.ctx.get(Ci).find(([s])=>s==="heading"))==null?void 0:n[1])===t.registered&&e.plugins.includes(t.plugin)&&Jv(t.registered,i.spec)}catch{return!1}}function Qi(r,e,t){var i,s;if(e.eq(t.doc))return!0;const n=Mr.get(r);if(!n||n.phase!=="ready"||n.extensions||!n.ctx||!n.schema||!n.registered||!n.plugin)return!1;try{const o=n.ctx,a=n.schema.nodes.heading;if(t.schema!==n.schema||o.get(Zt)!==n.schema||!a||o.get(Hn.key)!==n.generator||o.get(Pt.key)!==n.factory||((i=o.get(Ci).find(([u])=>u==="heading"))==null?void 0:i[1])!==n.registered||!t.plugins.includes(n.plugin)||!Jv(n.registered,a.spec))return!1;let l=t.doc;const c=n.value.trailing;return c!=null&&c.plugin&&t.plugins.includes(c.plugin)&&o.get(Fs.key)===c.config&&c.config.shouldAppend===c.shouldAppend&&c.config.getNode===c.getNode&&c.shouldAppend===_O&&c.getNode===jO&&e.childCount+1===l.childCount&&e.lastChild&&!["heading","paragraph"].includes(e.lastChild.type.name)&&((s=l.lastChild)!=null&&s.eq(t.schema.nodes.paragraph.create()))&&(l=l.copy(l.content.cut(0,l.content.size-l.lastChild.nodeSize))),HO(e,l,a)}catch{return!1}}function WO(r,e,t=!1){const n={phase:"pending",extensions:e.length!==0};Mr.set(r,{phase:"pending",value:n});const i=()=>{var h;n.phase="disposed",((h=Mr.get(r))==null?void 0:h.value)===n&&Mr.delete(r)},s=(h,f)=>m=>{try{const y=h(m);return n.ctx=m,f==="generator"?n.generator=m.get(Hn.key):n.factory=m.get(Pt.key),y}catch(y){throw i(),y}},o=h=>{let f;try{f=Pt.node(h)}catch(m){throw i(),m}return async()=>{var m;try{const y=f();n.registered=(m=h.get(Ci).find(([M])=>M==="heading"))==null?void 0:m[1];const b=await y;let v=!1;const k=()=>{if(!v&&(v=!0,typeof b=="function"))return b()};return n.nodeCleanup=k,n.phase==="disposed"&&await k(),()=>(i(),k())}catch(y){throw i(),y}}},a=h=>async()=>{var f;try{await h.wait(bt);const m=new De("MILKDOWN_HEADING_ID"),y=v=>{if(v.composing)return;const k=h.get(Hn.key),M=v.state.tr.setMeta("addToHistory",!1);let D=!1;const O={};v.state.doc.descendants((z,T)=>{if(z.type===Pt.type(h)){if(z.textContent.trim().length===0)return;const B=z.attrs;let N=k(z);O[N]?(O[N]=O[N]+1,N+=`-#${O[N]}`):O[N]=1,B.id!==N&&(D=!0,M.setMeta(m,!0).setNodeMarkup(T,void 0,{...B,id:N}))}}),D&&v.dispatch(M)},b=new Ae({key:m,view:v=>(y(v),{update:(k,M)=>{k.state.doc.eq(M.doc)||y(k)}})});return n.plugin=b,Yv(r,n),h.update(ur,v=>[...v,b]),()=>{i(),h.update(ur,v=>v.filter(k=>k!==b))}}catch(m){i();try{await((f=n.nodeCleanup)==null?void 0:f.call(n))}catch{}throw m}},l=dE.map(h=>h===Hn?s(h,"generator"):h===Pt.ctx?s(h,"factory"):h===Pt.node?o:h===Gp?a:h),c=UO(r),u=h=>{try{return c(h)}catch(f){throw i(),f}},d=t?[h=>{const f=Fs(h),m=h.get(Fs.key);return n.trailing={config:m,shouldAppend:m.shouldAppend,getNode:m.getNode},f},h=>{const f=Tv(h);return async()=>{const m=new Set(h.get(ur)),y=await f(),b=h.get(ur).filter(v=>{var D;if(m.has(v))return!1;const k=v.spec.key,M=k&&((D=Object.getOwnPropertyDescriptor(k,"key"))==null?void 0:D.value);return typeof M=="string"&&/^MILKDOWN_TRAILING\$\d*$/.test(M)});return n.trailing&&b.length===1&&(n.trailing.plugin=b[0]),()=>{if(typeof y=="function")return y()}}}]:[];return[...l,...d,u]}const D0=Se(null,"BlintzSourceController");function UO(r){return e=>{e.inject(D0,r);const t=Ur("BlintzSourceReady");e.record(t),e.update(b0,s=>[...s,t]);let n,i=!1;return e.update(ur,s=>[...s,new Ae({state:{init:(o,a)=>(n&&Qi(r,n.doc,a)&&(r.install(n),n=void 0),i=!0,null),apply:(o,a,l,c)=>(o.docChanged&&!r.applyConfirmedSource(o,l,c)&&!r.preserveSource(c)&&r.invalidate(),a)},view:o=>(r.attach(o),{update:(a,l)=>{r.finishConfirmedSource(a,l),(!a.state.selection.eq(l.selection)||!a.state.doc.eq(l.doc))&&r.selectionChanged()},destroy:()=>{r.dispose()}})})]),async()=>{var s,o,a;try{await e.wait(bt);const l=(s=Mr.get(r))==null?void 0:s.value;l&&l.phase==="pending"&&(l.schema=e.get(Zt)),await e.wait(rl),l&&l.phase==="pending"&&(l.parserReady=!0,Yv(r,l));const c=e.get(Zt),u=e.get(Si);return r.parse=(d,h)=>{const f=oE(c,u,d);return h&&VO(r,h)?sE(f,h.doc):f},e.set(Ts,d=>{const h=r.parse(d);return i||(n=h),h.doc}),e.done(t),()=>{var h;const d=(h=Mr.get(r))==null?void 0:h.value;d&&(d.phase="disposed",Mr.delete(r)),r.dispose(),e.clearTimer(t),e.remove(D0)}}catch(l){const c=(o=Mr.get(r))==null?void 0:o.value;if(c){c.phase="disposed",Mr.delete(r);try{await((a=c.nodeCleanup)==null?void 0:a.call(c))}catch{}}throw r.dispose(),e.clearTimer(t),e.remove(D0),l}}}}let KO=0;var Rn,qr;class GO{constructor(){Ce(this,"id",++KO);Ce(this,"revision",0);Ce(this,"controlRevision",0);Ce(this,"generation",`${this.id}:0`);Ce(this,"parsed");Ce(this,"view");Ce(this,"disposed",!1);_(this,Rn);_(this,qr);Ce(this,"parse");Ce(this,"callbacks",{});Ce(this,"port",{applyConfirmedTaskToggle:(e,t)=>this.applyConfirmedTaskToggle(e,t),generation:()=>this.generation,snapshot:()=>this.snapshot(),selection:e=>this.selection(e),range:(e,t,n)=>this.range(e,t,n),taskAt:(e,t)=>this.taskAt(e,t),bindSource:(e,t)=>{const n=this.refusal(t);if(n&&n.reason!=="unmapped")return n;const i=this.view,s=this.generation,o=this.parse;if(!o||!i)return{kind:"unavailable",reason:"unmapped"};const a=()=>{if(this.disposed)return{kind:"unavailable",reason:"disposed"};if(this.view!==i||this.parse!==o||this.generation!==s)return{kind:"unavailable",reason:"stale"}};let l;try{l=o.call(this,e,i.state)}catch{return a()??{kind:"unavailable",reason:"unmapped"}}const c=a();if(c)return c;const u=Qi(this,l.doc,i.state);return a()||(u?(this.install(l),this.selectionChanged(),this.snapshot()):{kind:"unavailable",reason:"model-mismatch"})}})}applyConfirmedTaskToggle(e,t){var M;const n=this.refusal(e.generation);if(n)return n;const i=this.view,s=this.parsed,o=this.parse;if(!i||!s||!o||C(this,qr))return{kind:"unavailable",reason:"unmapped"};const a=this.generation,l=i.state,c=(D,O)=>D.start===O.start&&D.end===O.end&&D.startLine===O.startLine&&D.endLine===O.endLine&&D.startColumn===O.startColumn&&D.endColumn===O.endColumn,u=[...s.tasks].find(([,D])=>D.line===e.task.line&&D.checked===e.task.checked&&c(D.marker,e.task.marker)&&c(D.item,e.task.item));if(!u)return{kind:"unavailable",reason:"unmapped"};const[d,h]=u,f=h.marker;if(f.end-f.start!==3||!/^\[[ xX]\]$/.test(s.text.slice(f.start,f.end))||typeof e.done!="boolean")return{kind:"unavailable",reason:"model-mismatch"};const m=e.done===h.checked?s.text:s.text.slice(0,f.start+1)+(e.done?"x":" ")+s.text.slice(f.start+2);if(t!==m)return{kind:"unavailable",reason:"model-mismatch"};let y;try{y=o.call(this,t,l)}catch{return{kind:"unavailable",reason:"unmapped"}}if(this.disposed||this.view!==i||this.parsed!==s||this.parse!==o||this.generation!==a||i.state!==l)return{kind:"unavailable",reason:"stale"};const b=l.doc.nodeAt(d);if(!b||b.type.name!=="list_item"||b.attrs.checked!==h.checked)return{kind:"unavailable",reason:"model-mismatch"};const v=l.tr.setNodeMarkup(d,void 0,{...b.attrs,checked:e.done}).setMeta("addToHistory",!1),k={transaction:v,previous:l,parsed:y,generation:a,applied:!1,committed:!1};F(this,qr,k);try{return i.dispatch(v),k.committed?this.disposed||this.view!==i||this.parsed!==y||((M=C(this,Rn))==null?void 0:M.generation)!==this.generation||i.state.doc!==C(this,Rn).doc?{kind:"unavailable",reason:"stale"}:this.snapshot():{kind:"unavailable",reason:"model-mismatch"}}finally{C(this,qr)===k&&F(this,qr,void 0),!k.committed&&(k.applied||i.state!==l)&&this.invalidate()}}applyConfirmedSource(e,t,n){const i=C(this,qr);return!i||i.applied||i.transaction!==e||i.previous!==t||i.generation!==this.generation||!n.doc.eq(e.doc)||!Qi(this,i.parsed.doc,n)?!1:(i.applied=!0,!0)}finishConfirmedSource(e,t){var i;const n=C(this,qr);if(!(!n||!n.applied||n.committed||this.view!==e||n.previous!==t||n.generation!==this.generation)){if(!Qi(this,n.parsed.doc,e.state)){this.invalidate();return}n.committed=!0,F(this,Rn,{doc:e.state.doc,text:n.parsed.text,generation:`${this.id}:${this.revision+1}`,controlled:((i=this.parsed)==null?void 0:i.text)!==n.parsed.text}),this.install(n.parsed)}}confirmedChangeText(e){var n;const t=C(this,qr);return t!=null&&t.applied&&t.generation===this.generation&&Qi(this,t.parsed.doc,e)?t.parsed.text:((n=C(this,Rn))==null?void 0:n.doc)===e.doc?C(this,Rn).text:void 0}consumeConfirmedValue(e){var n;const t=C(this,Rn);return!(t!=null&&t.controlled)||t.text!==e||t.generation!==this.generation||((n=this.view)==null?void 0:n.state.doc)!==t.doc?!1:(t.controlled=!1,!0)}attach(e){var t,n;this.disposed||(this.view=e,(n=(t=this.callbacks).onSourceReady)==null||n.call(t,this.port))}install(e){var t;this.parsed=e,this.generation=`${this.id}:${++this.revision}`,(t=this.view)==null||t.dom.dispatchEvent(new Event("blintz:source"))}preserveSource(e){const t=C(this,qr);return t!=null&&t.applied&&!t.committed?t.generation===this.generation&&Qi(this,t.parsed.doc,e):!!this.parsed&&Qi(this,this.parsed.doc,e)}invalidate(){var e;this.parsed=void 0,this.generation=`${this.id}:${++this.revision}`,(e=this.view)==null||e.dom.dispatchEvent(new Event("blintz:source"))}dispose(){this.disposed=!0,this.parsed=void 0,this.view=void 0,this.generation=`${this.id}:${++this.revision}`}get currentGeneration(){return this.generation}refusal(e){if(this.disposed)return{kind:"unavailable",reason:"disposed"};if(e!==void 0&&e!==this.generation)return{kind:"unavailable",reason:"stale"};if(!this.parsed)return{kind:"unavailable",reason:"unmapped"}}snapshot(){return this.refusal()??{kind:"mapped",generation:this.generation,value:{generation:this.generation,text:this.parsed.text}}}taskAt(e,t){const n=this.refusal(t);if(n)return n;const i=this.parsed.tasks.get(e);return i?{kind:"mapped",generation:this.generation,value:{...i,item:{...i.item},marker:{...i.marker}}}:{kind:"unavailable",reason:"unmapped"}}selection(e){const t=this.refusal(e);if(t)return t;if(!this.view)return{kind:"unavailable",reason:"unmapped"};const{from:n,to:i,empty:s,anchor:o,head:a}=this.view.state.selection;return this.mapRange(n,i,s,o<=a?"forward":"backward")}range(e,t,n){const i=this.refusal(n);if(i)return i;if(!this.view)return{kind:"unavailable",reason:"unmapped"};const s=this.view.state.doc.content.size;return!Number.isInteger(e)||!Number.isInteger(t)||e<0||t>s||e>t?{kind:"unavailable",reason:"unmapped"}:this.mapRange(e,t,e===t,"forward")}mapRange(e,t,n,i){const s=aE(this.parsed,this.view.state.doc,e,t,n);return s?{kind:"mapped",generation:this.generation,value:{ranges:s,direction:i}}:{kind:"unavailable",reason:"unmapped"}}setCallbacks(e){var n;const t=e.onSourceReady!==this.callbacks.onSourceReady;this.callbacks=e,this.controlRevision++,!this.disposed&&this.view&&t&&((n=e.onSourceReady)==null||n.call(e,this.port))}get controlSnapshot(){return`${this.generation}:${this.controlRevision}`}refreshControls(){var e;(e=this.view)==null||e.dom.dispatchEvent(new Event("blintz:source"))}selectionChanged(){var e,t;(t=(e=this.callbacks).onSourceSelection)==null||t.call(e,this.selection())}toggle(e,t){if(!this.callbacks.onTaskToggleRequest)return!1;const n=this.taskAt(e);return n.kind==="mapped"&&this.callbacks.onTaskToggleRequest({generation:n.generation,task:n.value,done:t}),!0}}Rn=new WeakMap,qr=new WeakMap;const JO=!0;function g2(r){return()=>r()}function Xv(r){return r.$from.parent.type.name==="code_block"}function Zv(r){var e,t;return((t=(e=r.$from.node(r.$from.depth-1))==null?void 0:e.type)==null?void 0:t.name)==="list_item"}function Uu(r){return Iv.sanitize(r)}function Le({icon:r,className:e,onPointerDown:t}){return L.jsx("span",{className:$t("milkdown-icon",e),onPointerDown:t,dangerouslySetInnerHTML:r?{__html:Uu(r.trim())}:void 0})}const Ku=Ne({show:()=>{},hide:()=>{}},"crepeMenuAPICtx"),Gm=Ne({onAdd:()=>{}},"crepeBlockHandleAPICtx"),Jm=Ne(null,"crepeSlashStoreCtx");function YO(){const r=Lr(),e=R.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx("div",{ref:e,className:"operation-item",onPointerDown:t=>{var n;t.preventDefault(),t.stopPropagation(),(n=e.current)==null||n.classList.add("active")},onPointerUp:t=>{var n;t.preventDefault(),t.stopPropagation(),(n=e.current)==null||n.classList.remove("active"),r.get(Gm.key).onAdd()},children:L.jsx(Le,{icon:Qh})}),L.jsx("div",{className:"operation-item",children:L.jsx(Le,{icon:ZM})})]})}const XO=gb.of({name:"mermaid",alias:["mermaid","mmd"],extensions:["mmd","mermaid"],load:async()=>new yb(vb.define({name:"mermaid",token(r){return r.skipToEnd(),null}}))}),ZO=`flowchart LR
|
|
1193
|
+
Idea --> Draft --> Review --> Done`;var ws,vc;class Qv{constructor(){_(this,ws,[]);Ce(this,"clear",()=>(F(this,ws,[]),this));_(this,vc,e=>{const t={group:e,addItem:(n,i)=>{const s={...i,key:n};return e.items.push(s),t},clear:()=>(e.items=[],t)};return t});Ce(this,"addGroup",(e,t)=>{const n={key:e,label:t,items:[]};return C(this,ws).push(n),C(this,vc).call(this,n)});Ce(this,"getGroup",e=>{const t=C(this,ws).find(n=>n.key===e);if(!t)throw new Error(`Group with key ${e} not found`);return C(this,vc).call(this,t)});Ce(this,"build",()=>C(this,ws))}}ws=new WeakMap,vc=new WeakMap;function y2(r,e={},{diagrams:t=!1}={}){const n=new Qv,i=n.addGroup("text","Text");i.addItem("text",{label:"Text",icon:kT,onRun:d=>{const h=d.get(oe),f=Or.type(d);h.call(Vt.key),h.call(T0.key,{nodeType:f})}});const s=[["h1",QM,1],["h2",rT,2],["h3",eT,3],["h4",tT,4],["h5",nT,5],["h6",iT,6]];for(const[d,h,f]of s)i.addItem(d,{label:`Heading ${f}`,icon:h,onRun:m=>{const y=m.get(oe),b=Pt.type(m);y.call(Vt.key),y.call(T0.key,{nodeType:b,attrs:{level:f}})}});i.addItem("quote",{label:"Quote",icon:dT,onRun:d=>{const h=d.get(oe),f=wa.type(d);h.call(Vt.key),h.call(uo.key,{nodeType:f})}}),i.addItem("divider",{label:"Divider",icon:uT,onRun:d=>{const h=d.get(oe),f=ka.type(d);h.call(Vt.key),h.call(Xi.key,{nodeType:f})}});const o=n.addGroup("list","List");o.addItem("bullet-list",{label:"Bullet List",icon:cT,onRun:d=>{const h=d.get(oe),f=js.type(d);h.call(Vt.key),h.call(uo.key,{nodeType:f})}}),o.addItem("ordered-list",{label:"Ordered List",icon:aT,onRun:d=>{const h=d.get(oe),f=Bi.type(d);h.call(Vt.key),h.call(uo.key,{nodeType:f})}}),o.addItem("task-list",{label:"Task List",icon:lT,onRun:d=>{const h=d.get(oe),f=zr.type(d);h.call(Vt.key),h.call(uo.key,{nodeType:f,attrs:{checked:!1}})}});const a=n.addGroup("advanced","Advanced");a.addItem("image",{label:"Image",icon:mm,onRun:d=>{const h=d.get(oe),f=Cf.type(d);h.call(Vt.key),h.call(Xi.key,{nodeType:f})}}),a.addItem("code",{label:"Code",icon:l6,onRun:d=>{const h=d.get(oe),f=Vr.type(d);h.call(Vt.key),h.call(T0.key,{nodeType:f})}}),a.addItem("table",{label:"Table",icon:yT,onRun:d=>{const h=d.get(oe),f=d.get(Me);h.call(Vt.key);const{from:m}=f.state.selection;h.call(Xi.key,{nodeType:Zp(d,3,3)}),h.call(F3.key,{pos:m})}}),a.addItem("math",{label:"Math",icon:pT,onRun:d=>{const h=d.get(oe),f=Vr.type(d);h.call(Vt.key),h.call(Xi.key,{nodeType:f,attrs:{language:"LaTeX"}})}}),t&&a.addItem("diagram",{label:"Diagram",icon:xT,onRun:d=>{const h=d.get(oe),f=Vr.type(d);h.call(Vt.key),h.call(Xi.key,{nodeType:f.create({language:"mermaid"},f.schema.text(ZO))})}});const l=Object.entries(e).filter(([d,h])=>!h.hideFromMenu&&o6(d));if(l.length>0){const d=n.addGroup("embed","Embeds");for(const[h,f]of l)d.addItem(`embed:${h}`,{label:f.title??h,icon:f.icon??WM,onRun:m=>{const y=m.get(oe),b={name:h,attributes:Fu(f.defaultAttributes),label:null};y.call(Vt.key),f.kind==="container"?y.call(uo.key,{nodeType:Bm.type(m),attrs:b}):y.call(Xi.key,{nodeType:Lm.type(m),attrs:b})}})}let c=n.build();if(r){const d=r.toLowerCase();c=c.map(h=>({...h,items:h.items.filter(f=>f.label.toLowerCase().includes(d))})).filter(h=>h.items.length>0)}const u=c.flatMap(d=>d.items);return u.forEach((d,h)=>{Object.assign(d,{index:h})}),c.reduce((d,h)=>{const f=d+h.items.length;return Object.assign(h,{range:[d,f]}),f},0),{groups:c,size:u.length}}const QO={show:!1,filter:""},eR={subscribe:()=>()=>{},getSnapshot:()=>QO,set:()=>{}};function tR(){const r=Lr(),e=r.get(Jm.key)??eR,{show:t,filter:n}=R.useSyncExternalStore(e.subscribe,e.getSnapshot),i=Hv(),s=Kv()!==void 0,o=R.useRef({embeds:i,diagrams:s});o.current={embeds:i,diagrams:s};const{groups:a,size:l}=R.useMemo(()=>y2(n,i,{diagrams:s}),[n,i,s]),[c,u]=R.useState(0),d=R.useRef(null),h=R.useRef({x:-999,y:-999}),f=R.useRef(c);f.current=c;const m=R.useRef(a);m.current=a;const y=R.useRef(l);y.current=l;const b=R.useCallback(()=>r.get(Ku.key).hide(),[r]),v=R.useCallback(T=>{const B=d.current,N=B==null?void 0:B.querySelector(`[data-index="${T}"]`),q=B==null?void 0:B.querySelector(".menu-groups");!N||!q||(q.scrollTop=N.offsetTop-q.offsetTop)},[]),k=R.useCallback((T,B)=>{const N=f.current,q=typeof T=="function"?T(N):T;B==null||B(q),u(q)},[]),M=R.useCallback(T=>{const B=e.getSnapshot().filter,N=y2(B,o.current.embeds,{diagrams:o.current.diagrams}).groups,q=B===n?T:0,te=N.flatMap(Z=>Z.items).at(q);te!=null&&te.onRun&&te.onRun(r),b()},[r,b,e,n]),D=R.useCallback(T=>{const B=y.current,N=m.current;if(T.key==="Escape"||T.key==="Enter"||T.key==="ArrowUp"||T.key==="ArrowDown"||T.key==="ArrowLeft"||T.key==="ArrowRight"){if(T.preventDefault(),T.stopPropagation(),T.key==="Escape"){b();return}if(T.key==="ArrowDown"){k(q=>q<B-1?q+1:q,v);return}if(T.key==="ArrowUp"){k(q=>q<=0?q:q-1,v);return}if(T.key==="ArrowLeft"){k(q=>{const te=N.find(me=>me.range[0]<=q&&me.range[1]>q);if(!te)return q;const Z=N[N.indexOf(te)-1];return Z?Z.range[1]-1:q},v);return}if(T.key==="ArrowRight"){k(q=>{const te=N.find(me=>me.range[0]<=q&&me.range[1]>q);if(!te)return q;const Z=N[N.indexOf(te)+1];return Z?Z.range[0]:q},v);return}T.key==="Enter"&&M(f.current)}},[b,k,M,v]);R.useEffect(()=>{if(t)return window.addEventListener("keydown",D,{capture:!0}),()=>window.removeEventListener("keydown",D,{capture:!0})},[t,D]),R.useEffect(()=>{l===0&&t?b():c>=l&&u(0)},[l,t,c,b]);const O=T=>{h.current={x:T.clientX,y:T.clientY}},z=T=>B=>{const N=h.current;B.clientX===N.x&&B.clientY===N.y||k(T)};return L.jsxs("div",{ref:d,onPointerDown:T=>T.preventDefault(),children:[L.jsx("nav",{className:"tab-group",children:L.jsx("ul",{children:a.map(T=>L.jsx("li",{onPointerDown:()=>k(T.range[0],v),className:c>=T.range[0]&&c<T.range[1]?"selected":"",children:T.label},T.key))})}),L.jsx("div",{className:"menu-groups",role:"listbox","aria-label":"Insert block",onPointerMove:O,children:a.map(T=>L.jsxs("div",{className:"menu-group",children:[L.jsx("h6",{children:T.label}),L.jsx("ul",{children:T.items.map(B=>L.jsxs("li",{"data-index":B.index,role:"option","aria-selected":c===B.index,"aria-label":B.label,className:c===B.index?"hover":"",onPointerEnter:z(B.index),onPointerDown:()=>{var N,q;(q=(N=d.current)==null?void 0:N.querySelector(`[data-index="${B.index}"]`))==null||q.classList.add("active")},onPointerUp:()=>{var N,q;(q=(N=d.current)==null?void 0:N.querySelector(`[data-index="${B.index}"]`))==null||q.classList.remove("active"),M(B.index)},children:[L.jsx(Le,{icon:B.icon}),L.jsx("span",{children:B.label})]},B.key))})]},T.key))})]})}const v2=new Set(["bullet_list","ordered_list"]),rR=qe(()=>new Ae({key:new De("MARKDOWN_EDITOR_ROBUST_BLOCK_DRAG"),view:r=>{const e=()=>{const t=r.dragging;if(!t||t.node)return;const{selection:n}=r.state;if(!(n instanceof ae))return;let i=t.slice;const s=n.node;if(s.type.name==="list_item"){const o=n.$from.parent;if(v2.has(o.type.name)){const a=o.type.create(o.attrs,V.from(s));i=new re(V.from(a),1,1)}}r.dragging={...t,slice:i,node:n}};return document.addEventListener("dragstart",e),{destroy:()=>document.removeEventListener("dragstart",e)}},appendTransaction:(r,e,t)=>{if(!r.some(s=>s.getMeta("uiEvent")==="drop"))return null;const n=t.tr;let i=!1;for(;;){let s=null;if(n.doc.descendants((o,a,l,c)=>{if(s!==null)return!1;if(!l||!v2.has(o.type.name))return!0;const u=c+1<l.childCount?l.child(c+1):null;if(u&&u.type===o.type){const d=a+o.nodeSize;if(wc(n.doc,d))return s=d,!1}return!0}),s===null)break;n.join(s),i=!0}return i?n:null}}));function nR(){let r={show:!1,filter:""};const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>r,set:t=>{const n={...r,...t};n.show===r.show&&n.filter===r.filter||(r=n,e.forEach(i=>i()))}}}const e7=TD("CREPE_MENU");function iR(r,e){let t,n;const i=()=>(n||(n=document.createElement("div"),n.className="milkdown-block-handle",n.dataset.show="false"),n),s=()=>{const a=r.get(Me);if(!a.editable)return;a.hasFocus()||a.focus();const l=t==null?void 0:t.active;if(!l)return;const{state:c,dispatch:u}=a,d=l.$pos.pos+l.node.nodeSize;let h=c.tr.insert(d,Or.type(r).create());h=h.setSelection(se.near(h.doc.resolve(d))),u(h.scrollIntoView()),t==null||t.hide(),r.get(Ku.key).show(h.selection.from)};r.set(Gm.key,{onAdd:s}),r.set($u.key,{filterNodes:a=>!ln(l=>["table","blockquote","math_inline"].includes(l.type.name))(a)});const o=e({component:YO,root:()=>i()});r.set(_u.key,{view:a=>{const l=o(a);return t=new MD({ctx:r,content:i(),getOffset:()=>16,getPlacement:({active:c,blockDom:u})=>{if(c.node.type.name==="heading")return"left";let d=0;c.node.descendants(D=>{d+=D.childCount});const h=c.el,f=h.getBoundingClientRect(),m=u.getBoundingClientRect(),y=window.getComputedStyle(h),b=Number.parseInt(y.paddingTop,10)||0,v=Number.parseInt(y.paddingBottom,10)||0,k=f.height-b-v,M=m.height;return d>2||M<k?"left-start":"left"}}),t.update(),{update:(c,u)=>{var d;(d=l.update)==null||d.call(l,c,u),t==null||t.update()},destroy:()=>{var c;(c=l.destroy)==null||c.call(l),t==null||t.destroy(),t=void 0,n=void 0}}}})}function sR(r,e){const t=nR();r.set(Jm.key,t);let n,i,s=null;const o=()=>(i||(i=document.createElement("div"),i.className="milkdown-slash-menu",i.dataset.show="false"),i),a=d=>{if(!d.editable||Xv(d.state.selection)||Zv(d.state.selection))return!1;const h=n==null?void 0:n.getContent(d,f=>["paragraph","heading"].includes(f.type.name));if(h==null||!oR(d.state.selection))return!1;if(t.set({filter:h.startsWith("/")?h.slice(1):h}),typeof s=="number"){const f=d.state.doc.nodeSize-2,m=Math.min(s,f);return d.state.doc.resolve(m).node()!==d.state.doc.resolve(d.state.selection.from).node()?(s=null,!1):!0}return!!h.startsWith("/")},l=()=>{s=null,n==null||n.hide()},c=d=>{s=d,t.set({filter:""}),n==null||n.show()};r.set(Ku.key,{show:c,hide:l});const u=e({component:tR,root:()=>o()});r.set(e7.key,{view:d=>{const h=u(d);return n=new AD({content:o(),debounce:20,shouldShow:a,offset:10}),n.onShow=()=>t.set({show:!0}),n.onHide=()=>t.set({show:!1}),n.update(d),{update:(f,m)=>{var b;const y=n==null?void 0:n.getContent(f,v=>["paragraph","heading"].includes(v.type.name));y!=null&&t.set({filter:y.startsWith("/")?y.slice(1):y}),(b=h.update)==null||b.call(h,f,m),n==null||n.update(f,m)},destroy:()=>{var f;(f=h.destroy)==null||f.call(h),n==null||n.destroy(),n=void 0,i=void 0,s=null}}}})}function oR(r){if(!(r instanceof se))return!1;const{$head:e}=r;return e.parentOffset===e.parent.content.size}function aR(r,e){r.config(t=>iR(t,e)).config(t=>sR(t,e)).use(Ku).use(Gm).use(Jm).use(_u).use(e7).use(rR)}const lR=[Fa.theme({"&":{color:"var(--crepe-color-on-surface)",backgroundColor:"var(--crepe-color-surface)"},".cm-content":{fontFamily:"var(--crepe-font-code)",caretColor:"var(--crepe-color-on-surface)"},".cm-scroller":{fontFamily:"var(--crepe-font-code)",lineHeight:"1.65",overflow:"auto"},".cm-gutters":{color:"var(--crepe-color-on-surface-variant)",backgroundColor:"var(--crepe-color-surface)",border:"none"},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:"var(--crepe-color-hover)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"var(--crepe-color-selected)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--crepe-color-on-surface)"},".cm-tooltip":{color:"var(--crepe-color-on-surface)",backgroundColor:"var(--crepe-color-surface-low)",borderColor:"var(--crepe-color-outline)"},".cm-searchMatch":{backgroundColor:"var(--crepe-color-secondary)",outline:"1px solid var(--crepe-color-primary)"}}),G2(bb.define([{tag:[ht.keyword,ht.modifier],color:"var(--blintz-syntax-keyword)"},{tag:[ht.string,ht.regexp],color:"var(--blintz-syntax-string)"},{tag:[ht.number,ht.bool,ht.null],color:"var(--blintz-syntax-number)"},{tag:ht.comment,color:"var(--blintz-syntax-comment)",fontStyle:"italic"},{tag:[ht.function(ht.variableName),ht.function(ht.propertyName)],color:"var(--blintz-syntax-function)"},{tag:[ht.typeName,ht.className,ht.tagName,ht.attributeName],color:"var(--blintz-syntax-type)"},{tag:[ht.operator,ht.punctuation],color:"var(--blintz-syntax-operator)"}]))];async function cR(r){try{return await navigator.clipboard.writeText(r)}catch{const e=document.createElement("textarea"),t=document.activeElement;e.value=r,e.setAttribute("readonly",""),e.style.contain="strict",e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt";const n=document.getSelection(),i=n?n.rangeCount>0&&n.getRangeAt(0):null;document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=r.length,document.execCommand("copy"),document.body.removeChild(e),i&&(n.removeAllRanges(),n.addRange(i)),t&&t.focus()}}function uR({copyText:r,copyIcon:e,onCopy:t,text:n}){return L.jsxs("button",{type:"button",className:"copy-button",onClick:()=>{cR(n).then(()=>t(n)).catch(console.error)},children:[L.jsx(Le,{icon:e}),r]})}function dR({language:r,config:e,setLanguage:t,getAllLanguages:n,getReadOnly:i}){const s=R.useRef(null),o=R.useRef(null),a=R.useRef(null),[l,c]=R.useState(!1),[u,d]=R.useState("");R.useEffect(()=>{if(!l)return;d("");const m=s.current,y=o.current;if(!m||!y)return;Wr(m,y,{placement:"bottom-start"}).then(({x:v,y:k})=>{Object.assign(y.style,{left:`${v}px`,top:`${k}px`})}).catch(console.error);const b=setTimeout(()=>{var v;return(v=a.current)==null?void 0:v.focus()},0);return()=>clearTimeout(b)},[l]),R.useEffect(()=>{if(!l)return;const m=y=>{var v,k;const b=y.target;(v=s.current)!=null&&v.contains(b)||(k=o.current)!=null&&k.contains(b)||c(!1)};return window.addEventListener("click",m),()=>window.removeEventListener("click",m)},[l]);const h=m=>{m.preventDefault(),m.stopPropagation(),!i()&&c(y=>!y)},f=R.useMemo(()=>{if(!l)return[];const m=n()??[],y=m.find(k=>k.name.toLowerCase()===r.toLowerCase()),b=u.toLowerCase(),v=m.filter(k=>(k.name.toLowerCase().includes(b)||k.alias.some(M=>M.toLowerCase().includes(b)))&&k!==y);return v.length===0?[]:y?[y,...v]:v},[l,u,r,n]);return L.jsxs(L.Fragment,{children:[L.jsxs("button",{type:"button",ref:s,className:"language-button","aria-label":"Code language","aria-expanded":l,disabled:i(),onClick:h,"data-expanded":String(l),children:[r||"Text",L.jsx("div",{className:"expand-icon",children:L.jsx(Le,{icon:e.expandIcon})})]}),L.jsx("div",{ref:o,className:"language-picker",children:l?L.jsxs("div",{className:"list-wrapper",children:[L.jsxs("div",{className:"search-box",children:[L.jsx("div",{className:"search-icon",children:L.jsx(Le,{icon:e.searchIcon})}),L.jsx("input",{ref:a,className:"search-input",placeholder:e.searchPlaceholder,"aria-label":e.searchPlaceholder,value:u,onChange:m=>d(m.target.value),onKeyDown:m=>{var y;m.key==="Escape"&&(c(!1),(y=s.current)==null||y.focus())}}),L.jsx("div",{className:$t("clear-icon",u.length===0&&"hidden"),onMouseDown:m=>{m.preventDefault(),d("")},children:L.jsx(Le,{icon:e.clearSearchIcon})})]}),L.jsx("ul",{className:"language-list",role:"listbox",onKeyDown:m=>{if(m.key==="Enter"){const y=document.activeElement;y instanceof HTMLElement&&y.dataset.language&&(t(y.dataset.language),c(!1))}},children:f.length?f.map(m=>{const y=m.name.toLowerCase()===r.toLowerCase();return L.jsx("li",{role:"option","aria-selected":y,tabIndex:0,className:"language-list-item","data-language":m.name,onClick:()=>{t(m.name),c(!1)},children:e.renderLanguage(m.name,y)},m.name)}):L.jsx("li",{className:"language-list-item no-result",children:e.noResultText})})]}):null})]})}const hR="http://www.w3.org/2000/svg";function fR(){const r=Iv(),e={ADD_TAGS:["foreignObject"],ADD_ATTR:["xmlns"],HTML_INTEGRATION_POINTS:{foreignobject:!0}};return r.addHook("afterSanitizeAttributes",t=>{var i;const n=t;((i=n.tagName)==null?void 0:i.toLowerCase())==="a"&&(!n.hasAttribute("href")&&!n.hasAttribute("xlink:href")||(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer")))}),r.addHook("uponSanitizeElement",(t,n)=>{var i;if(n.tagName==="foreignobject"){const s=t.parentElement;(!s||s.namespaceURI!==hR)&&((i=t.parentNode)==null||i.removeChild(t))}}),t=>r.sanitize(t,e)}let b2;function pR(r){return b2??(b2=fR()),b2(r)}function mR({config:r,previewOnlyMode:e,preview:t}){const n=R.useRef(null);return R.useEffect(()=>{const i=n.current;if(i){for(;i.firstChild;)i.removeChild(i.firstChild);(typeof t=="string"||t instanceof Element)&&(i.innerHTML=pR(t))}},[t]),t?L.jsxs("div",{className:"preview-panel",children:[!e&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"preview-divider"}),L.jsx("div",{className:"preview-label",children:r.previewLabel})]}),L.jsx("div",{ref:n,className:"preview"})]}):null}const Y0=new WeakMap;function gR(r,e){let t=Y0.get(r);t||(t=new Set,Y0.set(r,t)),t.add(e)}function yR(r,e){var t;(t=Y0.get(r))==null||t.delete(e)}function w2(r,e){const t=Y0.get(r);if(t)for(const n of t){const i=n.getPos();if(i==null)continue;const s=i+n.node.nodeSize;if(e>=i&&e<=s)return n}}class vR{constructor(e,t,n,i,s){Ce(this,"cm",null);Ce(this,"updating",!1);Ce(this,"languageName","");Ce(this,"languageConf",new N1);Ce(this,"readOnlyConf",new N1);Ce(this,"onTextChange",null);Ce(this,"node");Ce(this,"view");Ce(this,"getPos");Ce(this,"loader");Ce(this,"config");Ce(this,"forwardUpdate",e=>{if(!this.cm||this.updating||!this.cm.hasFocus)return;let t=(this.getPos()??0)+1;const{main:n}=e.state.selection,i=t+n.from,s=t+n.to,o=this.view.state.selection;if(e.docChanged||o.from!==i||o.to!==s){const a=this.view.state.tr;e.changes.iterChanges((l,c,u,d,h)=>{h.length?a.replaceWith(t+l,t+c,this.view.state.schema.text(h.toString())):a.delete(t+l,t+c),t+=d-u-(c-l)}),a.setSelection(se.create(a.doc,i,s)),this.view.dispatch(a)}});Ce(this,"codeMirrorKeymap",()=>{const e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!e.editable||!D5(e.state,e.dispatch)?!1:(e.focus(),!0)},{key:"Mod-z",run:()=>(e.editable&&(this.config.undo??Fm)(e.state,e.dispatch),!0)},{key:"Shift-Mod-z",run:()=>(e.editable&&(this.config.redo??K0)(e.state,e.dispatch),!0)},{key:"Mod-y",run:()=>(e.editable&&(this.config.redo??K0)(e.state,e.dispatch),!0)},{key:"Backspace",run:()=>{if(!this.cm||!e.editable)return!1;const t=this.cm.state.selection.ranges;if(t.length>1)return!1;const n=t[0];if(n&&(!n.empty||n.anchor>0)||this.cm.state.doc.lines>=2)return!1;const i=this.view.state,s=this.getPos()??0,o=i.tr.replaceWith(s,s+this.node.nodeSize,i.schema.nodes.paragraph.createChecked({},this.node.content));return o.setSelection(se.near(o.doc.resolve(s))),this.view.dispatch(o),this.view.focus(),!0}}]});Ce(this,"maybeEscape",(e,t)=>{if(!this.cm)return!1;const{state:n}=this.cm;let i=n.selection.main;if(!i.empty||(e==="line"&&(i=n.doc.lineAt(i.head)),t<0?i.from>0:i.to<n.doc.length))return!1;const s=(this.getPos()??0)+(t<0?0:this.node.nodeSize),o=se.near(this.view.state.doc.resolve(s),t),a=this.view.state.tr.setSelection(o).scrollIntoView();return this.view.dispatch(a),this.view.focus(),!0});this.node=e,this.view=t,this.getPos=n,this.loader=i,this.config=s,gR(t,this)}init(e){return this.cm?this.cm:(this.cm=new Fa({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of([p0.readOnly.of(!this.view.editable),Fa.editable.of(this.view.editable)]),K2(),Lf.of(this.codeMirrorKeymap()),this.languageConf.of([]),p0.changeFilter.of(()=>this.view.editable),...this.config.extensions,Fa.updateListener.of(this.forwardUpdate)]}),e.appendChild(this.cm.dom),this.updateLanguage(),this.cm)}forceInit(){return this.cm?this.cm:this.init(document.createElement("div"))}updateLanguage(){if(!this.cm)return;const e=this.node.attrs.language??"";e!==this.languageName&&this.loader.load(e).then(t=>{this.cm&&(t?this.cm.dispatch({effects:this.languageConf.reconfigure(t)}):this.cm.dispatch({effects:this.languageConf.reconfigure([])}),this.languageName=e)}).catch(console.error)}setSelection(e,t){const n=this.forceInit();n.dom.isConnected&&(n.focus(),this.updating=!0,n.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}selectNode(){this.forceInit().focus()}update(e){if(e.type!==this.node.type)return!1;if(this.updating||(this.node=e,!this.cm))return!0;this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure([p0.readOnly.of(!this.view.editable),Fa.editable.of(this.view.editable)])});const t=bR(this.cm.state.doc.toString(),e.textContent);return t&&(this.updating=!0,this.cm.dispatch({changes:{from:t.from,to:t.to,insert:t.text},scrollIntoView:!0,annotations:xb.addToHistory.of(!1)}),this.updating=!1),!0}destroy(){var e;yR(this.view,this),(e=this.cm)==null||e.destroy(),this.cm=null}}function bR(r,e){if(r===e)return null;let t=0,n=r.length,i=e.length;for(;t<n&&r.charCodeAt(t)===e.charCodeAt(t);)++t;for(;n>t&&i>t&&r.charCodeAt(n-1)===e.charCodeAt(i-1);)n--,i--;return{from:t,to:n,text:e.slice(t,i)}}class wR{constructor(e){Ce(this,"map");Ce(this,"languages");this.languages=e,this.map={},e.forEach(t=>{t.alias.forEach(n=>{this.map[n]=t})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){const t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}function kR(){const{node:r,view:e,getPos:t,setAttrs:n,selected:i}=Ii(),s=$O(),o=Kv(),a=R.useRef(!1),l=R.useRef(null),c=Lr(),u=Gn(e),d=c.get(Al.key),h=R.useRef(null),f=R.useRef(null),m=R.useMemo(()=>new wR(d.languages),[d.languages]),y=r.attrs.language??"",b=r.textContent,[v,k]=R.useState(null),[M,D]=R.useState(d.previewOnlyByDefault??!e.editable);return R.useEffect(()=>{const O=h.current;if(!O)return;const z=new vR(r,e,t,m,d);f.current=z;const T=z.init(O);return T.dom.parentElement!==O&&O.appendChild(T.dom),()=>{z.destroy(),f.current=null}},[]),R.useEffect(()=>{const O=f.current;O&&(O.view=e,O.getPos=t,O.config=d,O.loader=m,O.update(r))}),R.useEffect(()=>{var z;const O=(z=h.current)==null?void 0:z.parentElement;O&&O.classList.toggle("selected",i)},[i]),R.useEffect(()=>{let O=!0;const z=new AbortController,T=!a.current;a.current=!0;const B=d.renderPreview(y,b,N=>{O&&k(N)},{theme:s,signal:z.signal,immediate:T,mermaid:o});if(B)k(B);else if(B===void 0){const N=l.current!==null&&l.current!==y;k(q=>N?d.previewLoading:q||d.previewLoading)}else k(null);return l.current=y,()=>{O=!1,z.abort()}},[y,b,s,o]),L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"tools",contentEditable:!1,children:[L.jsx(dR,{language:y,config:d,setLanguage:O=>{n({language:O})},getAllLanguages:()=>m.getAll(),getReadOnly:()=>!u}),L.jsxs("div",{className:"tools-button-group",children:[L.jsx(uR,{copyIcon:d.copyIcon,copyText:d.copyText,onCopy:d.onCopy??(()=>{}),text:b}),v?L.jsx("button",{type:"button",className:"preview-toggle-button",onClick:()=>D(O=>!O),children:L.jsx(Le,{icon:d.previewToggleButton(M)})}):null]})]}),L.jsx("div",{ref:h,className:$t("codemirror-host",v&&M&&"hidden")}),L.jsx(mR,{config:d,previewOnlyMode:M,preview:v})]})}const xR=[...wb,XO];function SR(r,e){const t=Ai(Vr.node,()=>e({component:kR,as:()=>{const n=document.createElement("div");return n.className="milkdown-code-block",n.contentEditable="false",n},stopEvent:()=>!0,selectNode:()=>{var s;const n=r.ctx.get(Me),i=n.state.selection;(s=w2(n,i.from))==null||s.selectNode()},setSelection:(n,i)=>{var a;const s=r.ctx.get(Me),o=s.state.selection;(a=w2(s,o.from))==null||a.setSelection(n,i)}}));r.config(n=>{const i=[Lf.of(J2.concat(kb)),lO,lR];n.update(Al.key,()=>({extensions:i,languages:xR,expandIcon:GM,searchIcon:hT,clearSearchIcon:ST,searchPlaceholder:"Search language",copyText:"Copy",copyIcon:c6,onCopy:()=>{},noResultText:"No result",renderLanguage:ho.renderLanguage,renderPreview:ho.renderPreview,previewToggleButton:s=>[s?u6:XM,s?"Edit":"Hide"].map(o=>o.trim()).join(" "),previewLabel:ho.previewLabel,previewLoading:ho.previewLoading,previewOnlyByDefault:ho.previewOnlyByDefault}))}).use(Al).use(t)}function CR(){return L.jsx(t7,{container:!1})}function MR(){return L.jsx(t7,{container:!0})}function dh(r,e,t){const n=Object.entries(t).map(([i,s])=>`${i}="${s}"`);return`${r?":::":"::"}${e}${n.length?`{${n.join(" ")}}`:""}`}function t7({container:r}){const{node:e,view:t,getPos:n,selected:i,contentRef:s}=Ii(),{name:o,attributes:a,label:l}=e.attrs,c=Gn(t),u=LO(Hv(),o),d=TR(u==null?void 0:u.validate,a),h=R.useMemo(()=>l?W2({type:"paragraph",children:l}):"",[l]),[f]=R.useState(()=>{const D=document.createElement("div");return D.className="blintz-embed-content",D}),m=R.useRef(null);R.useLayoutEffect(()=>{r&&s(f)},[r,s,f]);const y=R.useMemo(()=>{function D(){const O=R.useRef(null);return R.useLayoutEffect(()=>{const z=O.current;return z.appendChild(f),()=>{var T;f.parentNode===z&&((T=m.current)==null||T.appendChild(f))}},[]),L.jsx("div",{className:"blintz-embed-slot",ref:O})}return D},[f]),b=R.useRef(null);R.useLayoutEffect(()=>{var D,O;r&&!((D=b.current)!=null&&D.contains(f))&&((O=m.current)==null||O.appendChild(f))});const v=!!u&&d!=="pending"&&d.length===0,k=R.useMemo(()=>{if(c)return D=>{const O=Object.keys(D).filter(B=>!a6(B));if(O.length>0)throw new Error(`[blintz] invalid embed attribute name: ${O.join(", ")}`);const z=Object.entries(D).filter(([,B])=>typeof B!="string");if(z.length>0)throw new Error(`[blintz] embed attribute values must be strings: ${z.map(([B])=>B).join(", ")}`);const T=n();T==null||!t.editable||t.dispatch(t.state.tr.setNodeAttribute(T,"attributes",{...D}))}},[c,n,t]);let M;if(!u)M=L.jsxs(Df,{tone:"neutral",title:dh(r,o,a),children:["No component is registered for “",o,"”. It stays in the document unchanged."]});else if(d==="pending")M=L.jsx("div",{className:"blintz-embed-pending","aria-busy":"true"});else if(d.length>0)M=L.jsx(Df,{tone:"error",title:dh(r,o,a),children:L.jsx("ul",{children:d.map((D,O)=>L.jsx("li",{children:AR(D)},O))})});else{const D=u.component;M=L.jsx(NR,{source:dh(r,o,a),resetKey:e,children:L.jsx(D,{name:o,attributes:a,label:h,editable:c,updateAttributes:k,children:r?L.jsx(y,{}):void 0})})}return L.jsxs("div",{ref:b,className:$t("blintz-embed",i&&"is-selected"),"data-embed-name":o,"data-embed-state":u?d==="pending"?"pending":v?"ready":"invalid":"unknown",contentEditable:r?void 0:!1,children:[M,r&&L.jsx("div",{className:"blintz-embed-fallback",ref:m})]})}function k2(r){var e;return(e=r==null?void 0:r.issues)!=null&&e.length?r.issues:[]}function TR(r,e){const t=JSON.stringify(e),n=R.useMemo(()=>{if(!r)return[];try{const o=JSON.parse(t),a=typeof r=="function"?r(o):r["~standard"].validate(o);return a&&typeof a.then=="function"?Promise.resolve(a).then(k2,l=>[{message:x2(l)}]):k2(a)}catch(o){return[{message:x2(o)}]}},[r,t]),[i,s]=R.useState(null);return R.useEffect(()=>{if(Array.isArray(n))return;let o=!0;return n.then(a=>{o&&s(a)}),()=>{o=!1}},[n]),Array.isArray(n)?n:i??"pending"}function x2(r){return r instanceof Error?r.message:String(r)}function AR(r){var t;const e=(t=r.path)==null?void 0:t.map(n=>String(typeof n=="object"?n.key:n)).join(".");return e?`${e}: ${r.message}`:r.message}function Df({tone:r,title:e,children:t}){return L.jsxs("div",{className:$t("blintz-embed-notice",r==="error"&&"is-error"),role:r==="error"?"alert":void 0,children:[L.jsx("code",{className:"blintz-embed-notice-source",children:e}),L.jsx("div",{className:"blintz-embed-notice-body",children:t})]})}class NR extends R.Component{constructor(){super(...arguments);Ce(this,"state",{error:null,resetKey:this.props.resetKey})}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return t.resetKey!==n.resetKey?{error:null,resetKey:t.resetKey}:null}componentDidCatch(t,n){console.error(`[blintz] embed ${this.props.source} failed to render`,t,n)}render(){return this.state.error?L.jsxs(Df,{tone:"error",title:this.props.source,children:["This embed failed to render: ",this.state.error.message]}):this.props.children}}const ER=qe(()=>W5({Backspace:DR,Delete:OR})),DR=(r,e)=>{const{$from:t,empty:n}=r.selection;if(!n||t.parent.type.name!=="paragraph"||t.parentOffset!==0)return!1;const i=t.depth-1;return i<1||t.index(i)!==0||t.node(i).type.name!==go?!1:(e==null||e(r.tr.setSelection(ae.create(r.doc,t.before(i)))),!0)},OR=(r,e)=>{const{$from:t,empty:n}=r.selection;if(!n||!t.parent.isTextblock||t.parentOffset!==t.parent.content.size)return!1;const i=RR(t);return(i==null?void 0:i.node.type.name)!==go?!1:(e==null||e(r.tr.setSelection(ae.create(r.doc,i.pos))),!0)};function RR(r){for(let e=r.depth;e>0;e--){const t=r.after(e),n=r.doc.resolve(t).nodeAfter;if(n)return{node:n,pos:t}}return null}const IR='input, textarea, select, button, a[href], [contenteditable="true"], [data-embed-interactive]';function zR(r,e){uE(r);const t=Ai(Lm.node,()=>e({component:CR,as:()=>{const i=document.createElement("div");return i.className="blintz-embed-host",i},stopEvent:i=>i.target instanceof Element&&i.target.closest(IR)!==null,ignoreMutation:()=>!0})),n=Ai(Bm.node,()=>e({component:MR,as:()=>{const i=document.createElement("div");return i.className="blintz-embed-host is-container",i},contentAs:"div"}));r.use(ER).use(t).use(n)}const X0=new De("blintz-wiki-link-menu"),LR=/(!?)\[\[([^[\]\r\n|#\ufffc]*)$/;function BR(r){const{selection:e}=r;if(!e.empty)return null;const t=e.$from;if(!t.parent.isTextblock||t.parent.type.spec.code||t.marks().some(s=>s.type.spec.code))return null;const n=t.parent.textBetween(Math.max(0,t.parentOffset-200),t.parentOffset,void 0,""),i=LR.exec(n);return i?{from:t.pos-i[0].length,to:t.pos,query:i[2],embed:i[1]==="!"}:null}function PR(r){return new Ae({key:X0,view:r,state:{init:()=>({query:null,dismissed:null}),apply(e,t,n,i){var l;const s=BR(i),o=(l=e.getMeta(X0))==null?void 0:l.dismiss;let a=t.dismissed===null?null:e.mapping.map(t.dismissed);return o?a=(s==null?void 0:s.from)??null:(!s||s.from!==a)&&(a=null),{query:s&&s.from!==a?s:null,dismissed:a}}}})}function S2(r){var e;return((e=X0.getState(r))==null?void 0:e.query)??null}function FR(){const{view:r}=k5(),e=Gn(r),t=$R(r),{options:n}=Wv(),i=n.search,s=e&&t&&i?S2(r.state):null,o=s?`${s.from}\0${s.query}`:null,[a,l]=R.useState(null),[c,u]=R.useState(0),d=R.useRef(null);R.useEffect(()=>{if(!s||!i||o===null)return;let b=!0;return Promise.resolve().then(()=>i(s.query)).then(v=>{b&&l({key:o,items:(v??[]).slice(0,50)})},()=>{b&&l({key:o,items:[]})}),()=>{b=!1}},[o,i]);const h=a&&s&&a.key===o?a.items:[],f=!!s&&h.length>0;R.useEffect(()=>u(0),[o]);const m=R.useCallback(b=>{const v=S2(r.state);if(!v)return;const k={target:b.target,heading:null,label:null,embed:v.embed};if(!Im(k))return;const M=r.state.schema.nodes[Nl];if(!M)return;const D=r.state.tr.replaceWith(v.from,v.to,M.create(k));r.dispatch(D.scrollIntoView()),r.focus()},[r]),y=R.useRef({items:h,active:c,query:s});return y.current={items:h,active:c,query:s},R.useEffect(()=>{if(!f)return;const b=v=>{const{items:k,active:M,query:D}=y.current;!D||!r.hasFocus()||!["ArrowDown","ArrowUp","Enter","Tab","Escape"].includes(v.key)||v.isComposing||(v.preventDefault(),v.stopPropagation(),v.key==="ArrowDown"?u((M+1)%k.length):v.key==="ArrowUp"?u((M-1+k.length)%k.length):v.key==="Escape"?r.dispatch(r.state.tr.setMeta(X0,{dismiss:!0})):m(k[M]))};return window.addEventListener("keydown",b,{capture:!0}),()=>window.removeEventListener("keydown",b,{capture:!0})},[f,m,r]),R.useLayoutEffect(()=>{const b=d.current;if(!f||!b||!s)return;let v;try{v=r.coordsAtPos(s.from)}catch{return}Wr({getBoundingClientRect:()=>new DOMRect(v.left,v.top,Math.max(1,v.right-v.left),v.bottom-v.top)},b,{placement:"bottom-start",strategy:"fixed",middleware:[Mi(6),tu(),U2({padding:8})]}).then(({x:k,y:M})=>{b.style.left=`${k}px`,b.style.top=`${M}px`})}),L.jsx("div",{ref:d,className:"blintz-wiki-link-menu","data-show":f?"true":"false",role:"listbox","aria-label":"Link to page",onMouseDown:b=>b.preventDefault(),children:f&&h.map((b,v)=>L.jsxs("div",{role:"option","aria-selected":v===c,className:$t("blintz-wiki-link-option",v===c&&"is-active"),onMouseEnter:()=>u(v),onClick:()=>m(b),children:[L.jsx("span",{className:"blintz-wiki-link-option-title",children:b.title??b.target}),b.description&&L.jsx("span",{className:"blintz-wiki-link-option-description",children:b.description})]},`${b.target}\0${v}`))})}function $R(r){return R.useSyncExternalStore(e=>(r.dom.addEventListener("focusin",e),r.dom.addEventListener("focusout",e),()=>{r.dom.removeEventListener("focusin",e),r.dom.removeEventListener("focusout",e)}),()=>r.hasFocus(),()=>!1)}function qR(){const{node:r,view:e,selected:t}=Ii(),n=R.useMemo(()=>yo(r.attrs),[r.attrs]),i=Gn(e),{options:s,resolver:o}=Wv(),a=R.useSyncExternalStore(o.subscribe,()=>o.read(n),()=>{}),l=(a==null?void 0:a.state)==="resolved"?a.resolution:void 0,c=HR(l==null?void 0:l.href),u=o.enabled?(a==null?void 0:a.state)==="pending"?"pending":l!=null&&l.exists?"resolved":"missing":"unresolved",d=h=>{if(!(!i||h.metaKey||h.ctrlKey)){h.preventDefault();return}if(s.onOpen){h.preventDefault(),s.onOpen(n,l);return}c||h.preventDefault()};return L.jsx("a",{className:$t("blintz-wiki-link",n.embed&&"is-embed",t&&"is-selected"),"data-state":u,href:c,title:(l==null?void 0:l.title)??(u==="missing"?`${n.target} (missing)`:void 0),onClick:d,draggable:!1,children:pv(n)})}function HR(r){if(!r)return;const e=r.replace(/^[\u0000-\u0020]+/,""),t=/^([a-z][a-z0-9+.-]*):/i.exec(e.replace(/[\t\n\r]/g,""));return t?["http","https","mailto"].includes(t[1].toLowerCase())?r:void 0:r}function _R(r){r.use(TE).use(Pm).use(OE)}function jR(r,e,t){_R(r);const n=Ai(Pm.node,()=>e({component:qR,as:()=>{const s=document.createElement("span");return s.className="blintz-wiki-link-host",s}})),i=qe(()=>PR(s=>{const o=document.createElement("div");o.className="blintz-wiki-link-menu-host",(s.dom.parentElement??document.body).appendChild(o);const a=t({component:FR,root:()=>o})(s);return{update:(l,c)=>{var u;return(u=a.update)==null?void 0:u.call(a,l,c)},destroy:()=>{var l;(l=a.destroy)==null||l.call(a),o.remove()}}}));r.use(NE).use(EE).use(n).use(i)}const VR=2e4,WR=1e4,UR=250,hh=new WeakMap;function r7(r,e,t){return new Promise((n,i)=>{const s=setTimeout(()=>i(new Error(`${t} took longer than ${e/1e3} s.`)),e);r.then(o=>{clearTimeout(s),n(o)},o=>{clearTimeout(s),i(o)})})}function KR(r){const e=r&&typeof r=="object"&&"default"in r&&r.default?r.default:r;if(!e||typeof e.initialize!="function"||typeof e.render!="function")throw new Error("The mermaid loader did not return the mermaid module.");return e}function GR(r){let e=hh.get(r);return e||(e=r7(Promise.resolve().then(r),VR,"Loading mermaid").then(KR),e.catch(()=>hh.delete(r)),hh.set(r,e)),e}let C2=Promise.resolve(),JR=0;function YR(r,e,t,n){const i=C2.then(async()=>{var l,c,u,d;if(n!=null&&n.aborted)throw M2();const s=await GR(r);if(n!=null&&n.aborted)throw M2();const o=(c=(l=s.mermaidAPI)==null?void 0:l.getSiteConfig)==null?void 0:c.call(l);s.initialize({...XR(o),startOnLoad:!1,securityLevel:"strict",theme:t==="dark"?"dark":"default"});const a=`blintz-mermaid-${++JR}`;try{const{svg:h}=await r7(s.render(a,e),WR,"Drawing this diagram");return h}finally{(u=document.getElementById(a))==null||u.remove(),(d=document.getElementById(`d${a}`))==null||d.remove(),o&&s.initialize(o)}});return C2=i.catch(()=>{}),i}function XR(r){if(!r)return{};const{themeVariables:e,...t}=r;return t}function M2(){const r=new Error("Superseded by a newer edit.");return r.name="AbortError",r}function ZR(r){return r.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`)}function QR(r){const e=r instanceof Error?r.message:String(r);return`<div class="blintz-diagram-error"><strong>This diagram can't be drawn.</strong> <span>${ZR(e.split(`
|
|
1194
|
+
`).slice(0,6).join(`
|
|
1195
|
+
`))}</span></div>`}function eI(r){r.config(e=>{e.update(Al.key,t=>({...t,renderPreview:(n,i,s,o)=>{if(n.toLowerCase()!=="mermaid")return t.renderPreview(n,i,s,o);const a=o==null?void 0:o.mermaid;if(!a||i.trim().length===0)return null;const l=o==null?void 0:o.signal,c=setTimeout(()=>{YR(a,i,(o==null?void 0:o.theme)??"light",l).then(u=>s(u),u=>{(u==null?void 0:u.name)!=="AbortError"&&s(QR(u))})},o!=null&&o.immediate?0:UR);l==null||l.addEventListener("abort",()=>clearTimeout(c),{once:!0})}}))})}function tI(r){r.config(e=>{e.update(ju.key,()=>({class:"crepe-drop-cursor",width:4,color:!1}))}).use(MO).use(qe(()=>TO()))}function n7({src:r,readonly:e,setLink:t,imageIcon:n,uploadButton:i,confirmButton:s,uploadPlaceholderText:o,className:a,onUpload:l,onImageLoadError:c}){const u=R.useId(),d=R.useRef(null),[h,f]=R.useState(!1),[m,y]=R.useState(r??""),[b,v]=R.useState(((r==null?void 0:r.length)??0)!==0),k=z=>{const T=z.target.value;v(T.length!==0),y(T)},M=z=>{var T;z.key==="Enter"&&t(((T=d.current)==null?void 0:T.value)??"")},D=()=>{var z;t(((z=d.current)==null?void 0:z.value)??"")},O=z=>{var B;const T=(B=z.target.files)==null?void 0:B[0];T&&l(T).then(N=>{N&&(t(N),v(!0))}).catch(N=>{console.error("An error occurred while uploading image"),console.error(N)})};return e?L.jsx("span",{className:"image-unavailable",children:"Image unavailable"}):L.jsxs("div",{className:$t("image-edit",a),children:[L.jsx(Le,{className:"image-icon",icon:n}),L.jsxs("div",{className:$t("link-importer",h&&"focus"),children:[L.jsx("input",{ref:d,"aria-label":"Image address",draggable:"true",onDragStart:z=>{z.preventDefault(),z.stopPropagation()},disabled:e,className:"link-input-area",value:m,onChange:k,onKeyDown:M,onFocus:()=>f(!0),onBlur:()=>f(!1)}),!b&&L.jsxs("div",{className:"placeholder",children:[L.jsx("input",{disabled:e,className:"hidden","aria-label":"Upload image",id:u,type:"file",accept:"image/*",onChange:O}),L.jsx("label",{className:"uploader",htmlFor:u,children:L.jsx(Le,{icon:i})}),L.jsx("span",{className:"text",onClick:()=>{var z;return(z=d.current)==null?void 0:z.focus()},children:o})]})]}),m&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"image-preview",children:L.jsx("img",{src:m,alt:"",onError:z=>Promise.resolve(c==null?void 0:c(z.nativeEvent)).catch(()=>{})})}),L.jsx("button",{type:"button","aria-label":"Insert image",className:"confirm",onClick:()=>D(),children:L.jsx(Le,{icon:s})})]})]})}function rI({src:r,caption:e,ratio:t,readonly:n,config:i,setAttr:s}){const o=R.useRef(null),a=R.useRef(0),[l,c]=R.useState(!!(e!=null&&e.length)),u=()=>{const v=o.current;if(!v)return;const k=v.closest(".milkdown-image-block");if(!k)return;let M=k.getBoundingClientRect().width;if(!M)return;i.maxWidth&&i.maxWidth<M&&(M=i.maxWidth);const D=v.naturalHeight,O=v.naturalWidth;let z=O<M?D:M*(D/O);i.maxHeight&&z>i.maxHeight&&(z=i.maxHeight);const T=(z*(t??1)).toFixed(2);v.dataset.origin=z.toFixed(2),v.dataset.height=T,v.style.height=`${T}px`,i.maxWidth&&(v.style.maxWidth=`${i.maxWidth}px`)},d=v=>{v.preventDefault(),v.stopPropagation(),!n&&c(k=>!k)},h=v=>{const k=v.target.value;a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{s("caption",k)},1e3)},f=v=>{const k=v.target.value;a.current&&(window.clearTimeout(a.current),a.current=0),s("caption",k)},m=R.useCallback(v=>{v.preventDefault();const k=o.current;if(!k)return;const M=k.getBoundingClientRect().top;let D=v.clientY-M;D<100&&(D=100),i.maxHeight&&D>i.maxHeight&&(D=i.maxHeight);const O=Number(D).toFixed(2);k.dataset.height=O,k.style.height=`${O}px`},[i.maxHeight]),y=R.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y);const v=o.current;if(!v)return;const k=Number(v.dataset.origin),M=Number(v.dataset.height),D=Number.parseFloat(Number(M/k).toFixed(2));Number.isNaN(D)||s("ratio",D)},[m,s]),b=v=>{n||(v.preventDefault(),v.stopPropagation(),window.addEventListener("pointermove",m),window.addEventListener("pointerup",y))};return R.useEffect(()=>()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y),a.current&&window.clearTimeout(a.current)},[m,y]),L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"image-wrapper",children:[!n&&L.jsx("div",{className:"operation",children:L.jsx("button",{type:"button","aria-label":"Toggle image caption","aria-pressed":l,className:"operation-item",onClick:d,children:L.jsx(Le,{icon:i.captionIcon})})}),L.jsx("img",{ref:o,"data-type":Sf,onLoad:u,src:r,alt:e,onError:v=>{var k;return Promise.resolve((k=i.onImageLoadError)==null?void 0:k.call(i,v.nativeEvent)).catch(()=>{})}}),!n&&L.jsx("div",{className:"image-resize-handle",onPointerDown:b})]}),n?e?L.jsx("div",{className:"caption-input",children:e}):null:l&&L.jsx("input",{"aria-label":"Image caption",draggable:"true",onDragStart:v=>{v.preventDefault(),v.stopPropagation()},className:"caption-input",placeholder:i==null?void 0:i.captionPlaceholderText,onChange:h,onBlur:f,defaultValue:e})]})}function nI(){const{node:r,view:e,setAttrs:t,selected:n}=Ii(),i=Lr().get(xf.key),{src:s,caption:o,ratio:a}=r.attrs,l=!Gn(e),[c,u]=R.useState(s);R.useEffect(()=>{const h=i.proxyDomURL;if(!h){u(s);return}const f=h(s);if(typeof f=="string"){u(f);return}let m=!1;return f.then(y=>{m||u(y)}).catch(console.error),()=>{m=!0}},[s,i.proxyDomURL]);const d=(h,f)=>{e.editable&&t({[h]:h==="src"?Uu(f):f})};return s!=null&&s.length?L.jsx(rI,{src:c,caption:o,ratio:a,readonly:l,config:i,setAttr:d}):L.jsx(n7,{src:s,readonly:l,setLink:h=>d("src",h),imageIcon:i.imageIcon,uploadButton:i.uploadButton,confirmButton:i.confirmButton,uploadPlaceholderText:i.uploadPlaceholderText,onUpload:i.onUpload,onImageLoadError:i.onImageLoadError,className:n?"selected":void 0})}function iI(){const{node:r,view:e,setAttrs:t}=Ii(),n=Lr().get(fv.key),{src:i,alt:s,title:o}=r.attrs,a=!Gn(e),[l,c]=R.useState(i);R.useEffect(()=>{const d=n.proxyDomURL;if(!d){c(i);return}const h=d(i);if(typeof h=="string"){c(h);return}let f=!1;return h.then(m=>{f||c(m)}).catch(console.error),()=>{f=!0}},[i,n.proxyDomURL]);const u=d=>{e.editable&&t({src:Uu(d)})};return i!=null&&i.length?L.jsx("img",{className:"image-inline",src:l,alt:s,title:o}):L.jsx(n7,{src:i,readonly:a,setLink:u,imageIcon:n.imageIcon,uploadButton:n.uploadButton,confirmButton:n.confirmButton,uploadPlaceholderText:n.uploadPlaceholderText,onUpload:n.onUpload,className:"empty-image-inline"})}function sI(r,e){const t=Ai(Cf.node,()=>e({component:nI,as:()=>{const i=document.createElement("div");return i.className="milkdown-image-block",i},stopEvent:i=>i.target instanceof HTMLInputElement})),n=Ai(_s.node,()=>e({component:iI,as:()=>{const i=document.createElement("span");return i.className="milkdown-image-inline",i},stopEvent:i=>i.target instanceof HTMLInputElement}));r.config(i=>{i.update(ko.key,s=>({...s,uploader:async(o,a)=>{const l=a.nodes["image-block"]??a.nodes.image;if(!l)return[];const c=a.nodes["image-block"]?i.get(xf.key).onUpload:void 0,u=[];for(let d=0;d<o.length;d++){const h=o.item(d);h&&h.type.includes("image")&&u.push(h)}return await Promise.all(u.map(async d=>{const h=c?await c(d):URL.createObjectURL(d);return l.createAndFill({src:h})}))}}))}).use(xf).use(fv).use(Cf).use(wE).use(t).use(n)}const Ym=Ne(null,"crepeLatexInlineEditStoreCtx"),oI={value:"",token:0,onConfirm:()=>{}},aI={subscribe:()=>()=>{},getSnapshot:()=>oI};function lI(){const r=Lr().get(Ym.key)??aI,{value:e,token:t,onConfirm:n}=R.useSyncExternalStore(r.subscribe,r.getSnapshot),[i,s]=R.useState(e);R.useEffect(()=>s(e),[t,e]);const o=()=>n(i);return L.jsxs("div",{className:"container",children:[L.jsx("input",{className:"latex-input","aria-label":"Math expression",placeholder:"Enter LaTeX...",value:i,onKeyDown:a=>{a.stopPropagation(),a.key==="Enter"&&(a.preventDefault(),o())},onChange:a=>s(a.target.value)}),L.jsx("button",{type:"button",className:"button","aria-label":"Apply math expression",onPointerDown:a=>{a.preventDefault()},onClick:o,children:L.jsx(Le,{icon:Mu})})]})}const cI=fe("ToggleLatex",r=>()=>(e,t)=>{const{hasNode:n,pos:i,target:s}=V5(e,W0.type(r)),{selection:o,doc:a,tr:l}=e;if(!n){const f=a.textBetween(o.from,o.to),m=l.replaceSelectionWith(W0.type(r).create({value:f}));return t&&t(m.setSelection(ae.create(m.doc,o.from))),!0}const{from:c,to:u}=o;if(!s||i<0)return!1;let d=l.delete(i,i+1);const h=s.attrs.value;return d=d.insertText(h,i),t&&t(d.setSelection(se.create(d.doc,c,u+h.length-1))),!0}),uI=wt(r=>Yx(/(?:\$)([^$]+)(?:\$)$/,W0.type(r),{getAttr:e=>({value:e[1]??""})})),dI=wt(r=>ep(/^\$\$[\s\n]$/,Vr.type(r),()=>({language:"LaTeX"})));function hI(r,e){return rv.renderToString(r,{...e,throwOnError:!1,displayMode:!0})}function fI(r){let e=r;const t=new Set;return{subscribe:n=>(t.add(n),()=>{t.delete(n)}),getSnapshot:()=>e,set:n=>{e=n,t.forEach(i=>i())}}}function pI(){return fI({value:"",token:0,onConfirm:()=>{}})}const T2=Wu("CREPE_INLINE_LATEX");function mI(r,e){const t=pI();r.set(Ym.key,t);let n,i,s=0,o=-1;const a=()=>(i||(i=document.createElement("div"),i.className="milkdown-latex-inline-edit",i.dataset.show="false"),i),l=u=>d=>{const h=r.get(Me);h.dispatch(h.state.tr.setNodeAttribute(u,"value",d)),requestAnimationFrame(()=>h.focus())},c=u=>{if(!u.editable)return o=-1,!1;const{selection:d}=u.state;if(!(d instanceof ae)||d.node.type.name!==Va)return o=-1,!1;const h=d.from;return h!==o&&(o=h,s+=1,t.set({value:d.node.attrs.value??"",token:s,onConfirm:l(h)})),!0};return e({component:lI,root:()=>a(),update:(u,d)=>{n||(n=new Vu({content:a(),debounce:0,offset:10,floatingUIOptions:{placement:"bottom"},shouldShow:c})),n.update(u,d)},destroy:()=>{n==null||n.destroy(),n=void 0,i=void 0,o=-1}})}function gI(r,e){r.config(t=>{t.update(Al.key,n=>({...n,renderPreview:(i,s,o,a)=>i.toLowerCase()==="latex"&&s.length>0?hI(s):n.renderPreview(i,s,o,a)})),t.set(T2.key,{view:mI(t,e)})}).use(xE).use(CE).use(W0).use(T2).use(uI).use(dI).use(ME).use(cI).use(Ym)}const Z0=Ne({mode:"preview"},"crepeLinkTooltipStateCtx"),ma=Ne({addLink:()=>{},editLink:()=>{},removeLink:()=>{}},"crepeLinkTooltipAPICtx"),Xm=Ne({linkIcon:c6,editButton:u6,removeButton:ef,confirmButton:Mu,inputPlaceholder:"Paste link...",onCopyLink:()=>{}},"crepeLinkTooltipConfigCtx"),Zm=Ne(null,"crepeLinkPreviewStoreCtx"),Qm=Ne(null,"crepeLinkEditStoreCtx"),yI={src:"",token:0,onConfirm:()=>{},onCancel:()=>{}},vI={subscribe:()=>()=>{},getSnapshot:()=>yI};function bI(){const r=Lr(),e=r.get(Qm.key)??vI,{src:t,token:n,onConfirm:i,onCancel:s}=R.useSyncExternalStore(e.subscribe,e.getSnapshot),o=r.get(Xm.key),[a,l]=R.useState(t);R.useEffect(()=>l(t),[n,t]);const c=()=>i(a),u=d=>{d.stopPropagation(),d.key==="Enter"&&(d.preventDefault(),c()),d.key==="Escape"&&(d.preventDefault(),s())};return L.jsxs("div",{className:"link-edit",children:[L.jsx("input",{className:"input-area","aria-label":"Link address",placeholder:o.inputPlaceholder,value:a,onKeyDown:u,onChange:d=>l(d.target.value)}),a?L.jsx("button",{type:"button",className:"button confirm","aria-label":"Apply link",onPointerDown:d=>d.preventDefault(),onClick:c,children:L.jsx(Le,{icon:o.confirmButton})}):null]})}const wI={href:"",onEdit:()=>{},onRemove:()=>{}},kI={subscribe:()=>()=>{},getSnapshot:()=>wI};function xI(){const r=Lr(),e=r.get(Zm.key)??kI,{href:t,onEdit:n,onRemove:i}=R.useSyncExternalStore(e.subscribe,e.getSnapshot),s=r.get(Xm.key),o=c=>{c.preventDefault(),navigator.clipboard&&t&&navigator.clipboard.writeText(t).then(()=>s.onCopyLink(t)).catch(u=>console.error(u))},a=c=>{c.preventDefault(),c.stopPropagation(),n()},l=c=>{c.preventDefault(),c.stopPropagation(),i()};return L.jsxs("div",{className:"link-preview",children:[L.jsx("button",{type:"button",className:"button link-icon","aria-label":"Copy link",onPointerDown:c=>c.preventDefault(),onClick:o,children:L.jsx(Le,{icon:s.linkIcon})}),L.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"link-display",children:t}),L.jsx("button",{type:"button",className:"button link-edit-button","aria-label":"Edit link",onPointerDown:c=>c.preventDefault(),onClick:a,children:L.jsx(Le,{icon:s.editButton})}),L.jsx("button",{type:"button",className:"button link-remove-button","aria-label":"Remove link",onPointerDown:c=>c.preventDefault(),onClick:l,children:L.jsx(Le,{icon:s.removeButton})})]})}const i7=fe("CrepeToggleLink",r=>()=>e=>{const{doc:t,selection:n}=e,i=jr.type(r);return t.rangeHasMark(n.from,n.to,i)?(r.get(ma.key).removeLink(n.from,n.to),!0):(r.get(ma.key).addLink(n.from,n.to),!0)});function s7(r){let e=r;const t=new Set;return{subscribe:n=>(t.add(n),()=>{t.delete(n)}),getSnapshot:()=>e,set:n=>{e=n,t.forEach(i=>i())}}}function SI(){return s7({href:"",onEdit:()=>{},onRemove:()=>{}})}function CI(){return s7({src:"",token:0,onConfirm:()=>{},onCancel:()=>{}})}const e1=Wu("CREPE_LINK_PREVIEW"),o7=Wu("CREPE_LINK_EDIT");function MI(r,e,t,n,i){let s={start:-1,end:-1};return t.nodesBetween(n,i,(o,a)=>{if(s.start>-1)return!1;s.start===-1&&r.isInSet(o.marks)&&e===o&&(s={start:a,end:a+Math.max(o.textContent.length,1)})}),s}function TI(r,e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return;const{pos:i}=n,s=e.state.doc.nodeAt(i);if(!s)return;const o=s.marks.find(a=>a.type===jr.mark.type(r));if(!(!o||!e1.pluginKey()))return{show:!0,pos:i,node:s,mark:o}}function AI(r,e){let t;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>r(...n),e)}}const A2=50;function NI(r,e){const t=SI();r.set(Zm.key,t);let n,i,s,o=!1;const a=()=>(i||(i=document.createElement("div"),i.className="milkdown-link-preview",i.dataset.show="false"),i),l=()=>{o=!0},c=()=>{o=!1},u=()=>{n==null||n.hide(),n==null||n.element.removeEventListener("mouseenter",l),n==null||n.element.removeEventListener("mouseleave",c)},d=()=>{o||u()},h=(v,k,M,D)=>{!n||!s||(t.set({href:v.attrs.href,onEdit:()=>r.get(ma.key).editLink(v,k,M),onRemove:()=>{r.get(ma.key).removeLink(k,M),u()}}),n.show({getBoundingClientRect:()=>D},s),n.element.addEventListener("mouseenter",l),n.element.addEventListener("mouseleave",c))},f=e({component:xI,root:()=>a()}),m=v=>{const k=f(v);return s=v,n=new Vu({content:a(),debounce:0,shouldShow:()=>!1}),n.update(v),{update:(M,D)=>{var O;s=M,(O=k.update)==null||O.call(k,M,D)},destroy:()=>{var M;u(),(M=k.destroy)==null||M.call(k),n==null||n.destroy(),n=void 0,i=void 0,s=void 0}}},y=AI((v,k)=>{if(!n||!v.hasFocus()||r.get(Z0.key).mode==="edit")return;const M=TI(r,v,k);if(M){const D=v.state.doc.resolve(M.pos),O=MI(M.mark,M.node,v.state.doc,D.before(),D.after()),z=O.start,T=O.end;h(M.mark,z,T,pu(v,z,T));return}d()},A2),b=()=>{setTimeout(()=>d(),A2)};return r.set(e1.key,{props:{handleDOMEvents:{mousemove:y,mouseleave:b}},view:m}),{hide:u}}function EI(r,e,t){const n=CI();r.set(Qm.key,n);let i,s,o=0,a={from:-1,to:-1,mark:null};const l=()=>(s||(s=document.createElement("div"),s.className="milkdown-link-edit",s.dataset.show="false"),s),c=v=>{const k=v.target;k&&(l().contains(k)||h())},u=()=>document.addEventListener("pointerdown",c,!0),d=()=>document.removeEventListener("pointerdown",c,!0);function h(){d(),i==null||i.hide(),r.update(Z0.key,v=>({...v,mode:"preview"})),a={from:-1,to:-1,mark:null}}const f=v=>{const k=r.get(Me),{from:M,to:D,mark:O}=a,z=jr.type(r),T=Uu(v);if(O&&O.attrs.href===T){h();return}const B=k.state.tr;if(O&&B.removeMark(M,D,O),M===D){if(!T){h();return}const N=z.create({href:T});B.insertText(T,M),B.addMark(M,M+T.length,N)}else B.addMark(M,D,z.create({href:T}));k.dispatch(B),h()},m=(v,k,M)=>{t(),o+=1,n.set({src:v,token:o,onConfirm:f,onCancel:h}),r.update(Z0.key,O=>({...O,mode:"edit"}));const D=r.get(Me);D.dispatch(D.state.tr.setSelection(se.create(D.state.doc,k,M))),i==null||i.show({getBoundingClientRect:()=>pu(D,k,M)},D),u(),requestAnimationFrame(()=>{var O;(O=l().querySelector("input"))==null||O.focus()})};r.update(ma.key,v=>({...v,addLink:(k,M)=>{a={from:k,to:M,mark:null},m("",k,M)},editLink:(k,M,D)=>{a={from:M,to:D,mark:k},m(k.attrs.href??"",M,D)},removeLink:(k,M)=>{const D=r.get(Me),O=D.state.tr;O.removeMark(k,M,jr.type(r)),D.dispatch(O),h()}}));const y=e({component:bI,root:()=>l()}),b=v=>{const k=y(v);return i=new Vu({content:l(),debounce:0,shouldShow:()=>!1}),i.onHide=()=>{requestAnimationFrame(()=>v.dom.focus({preventScroll:!0}))},i.update(v),{update:(M,D)=>{var B;if((B=k.update)==null||B.call(k,M,D),a.from===-1&&a.to===-1)return;const{selection:O}=M.state;if(!(O instanceof se))return;const{from:z,to:T}=O;z===a.from&&T===a.to||h()},destroy:()=>{var M;d(),(M=k.destroy)==null||M.call(k),i==null||i.destroy(),i=void 0,s=void 0}}};r.set(o7.key,{view:b})}function DI(r,e){r.config(t=>{const n=NI(t,e);EI(t,e,n.hide)}).use(Z0).use(ma).use(Xm).use(Zm).use(Qm).use(e1).use(o7).use(i7)}function fh({label:r,listType:e,checked:t}){return t==null?e==="bullet"?'<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><circle cx="8" cy="8" r="2.5" /></svg>':r:t?fT:mT}function OI(){const{node:r,view:e,getPos:t,selected:n,contentRef:i}=Ii(),{label:s,checked:o,listType:a}=r.attrs,l=!Gn(e),c=Lr().get(D0);R.useSyncExternalStore(m=>(e.dom.addEventListener("blintz:source",m),()=>e.dom.removeEventListener("blintz:source",m)),()=>(c==null?void 0:c.controlSnapshot)??"",()=>"");const u=t(),d=!!(c!=null&&c.callbacks.onTaskToggleRequest)&&(u==null||c.port.taskAt(u).kind!=="mapped"),h=()=>{if(!e.editable)return;const m=t();m!=null&&(c!=null&&c.toggle(m,!o)||e.dispatch(e.state.tr.setNodeAttribute(m,"checked",!o)))},f=o==null?a==="bullet"?"bullet":"ordered":o?"checked":"unchecked";return L.jsxs("div",{className:$t("milkdown-list-item-content",n&&"ProseMirror-selectednode"),children:[o==null?L.jsx("span",{className:"label-wrapper",contentEditable:!1,"aria-hidden":"true",children:L.jsx(Le,{className:$t("label",f),icon:fh({label:s,listType:a,checked:o})})}):l||d?L.jsx("span",{className:"label-wrapper",contentEditable:!1,"aria-label":o?"Completed task":"Incomplete task",children:L.jsx(Le,{className:$t("label",f),icon:fh({label:s,listType:a,checked:o})})}):L.jsx("button",{type:"button",role:"checkbox","aria-checked":o,"aria-label":r.textContent||"Task",disabled:l,className:"label-wrapper task-checkbox",contentEditable:!1,onPointerDown:m=>{m.preventDefault(),m.stopPropagation()},onClick:m=>{m.stopPropagation(),h()},children:L.jsx(Le,{className:$t("label",f),icon:fh({label:s,listType:a,checked:o})})}),L.jsx("div",{className:"children",ref:i})]})}const RI=qe(r=>new Ae({key:new De("MARKDOWN_EDITOR_ORDERED_LIST_LABEL_SYNC"),appendTransaction:(e,t,n)=>{if(t.doc.eq(n.doc))return null;const i=Bi.type(r),s=zr.type(r);let o=n.tr,a=!1;return n.doc.descendants((l,c)=>{if(l.type!==i)return;const u=l.attrs.order??1;l.forEach((d,h,f)=>{if(d.type!==s)return;const m=`${f+u}.`;d.attrs.label!==m&&(o=o.setNodeMarkup(c+1+h,void 0,{...d.attrs,label:m,listType:"ordered"}),a=!0)})}),a?o.setMeta("addToHistory",!1):null}}));function II(r,e){const t=Ai(zr.node,()=>e({component:OI,as:()=>{const n=document.createElement("li");return n.className="milkdown-list-item-block",n},contentAs:"div",stopEvent:()=>!1}));r.use(t).use(RI)}function zI(r){var e;return r.childCount<=1&&!((e=r.firstChild)!=null&&e.content.size)}function LI(r,e){const{selection:t}=r;if(!t.empty)return null;const n=t.$anchor,i=n.parent;if(i.content.size>0||ln(o=>o.type.name==="table")(n))return null;const s=n.before();return Ze.node(s,s+i.nodeSize,{class:"crepe-placeholder","data-placeholder":e})}const Of=Ne({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),BI=qe(r=>new Ae({key:new De("CREPE_PLACEHOLDER"),props:{decorations:e=>{let t=!0;try{t=r.get(Me).editable}catch{t=!0}if(!t)return null;const n=r.get(Of.key);if(n.mode==="doc"&&!zI(e.doc)||Xv(e.selection)||Zv(e.selection))return null;const i=LI(e,n.text??"Please enter...");return i?$e.create(e.doc,[i]):null}}}));function PI(r,e){r.config(t=>{e&&t.update(Of.key,n=>({...n,...e}))}).use(BI).use(Of)}function FI(){var b;const{node:r,view:e,getPos:t}=Ii(),n=Lr(),i=Gn(e),[s,o]=R.useState(!1),[a,l]=R.useState({row:0,col:0}),c=R.useRef(null),u=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{var k,M;if(!s)return;(M=(k=u.current)==null?void 0:k.querySelector("button:not(:disabled)"))==null||M.focus();const v=D=>{var O;D.target instanceof Node&&!((O=d.current)!=null&&O.contains(D.target))&&o(!1)};return document.addEventListener("pointerdown",v),()=>document.removeEventListener("pointerdown",v)},[s]),R.useEffect(()=>{i||o(!1)},[i]);const h=()=>{if(!e.editable)return;const{$from:v}=e.state.selection,k=t();let M=0,D=0;if(k!=null&&v.pos>k&&v.pos<k+r.nodeSize){for(let O=0;O<=v.depth;O++)if(v.node(O).type.name==="table"){M=v.index(O),D=O<v.depth?v.index(O+1):0;break}}l({row:M,col:D}),o(!s)},f=v=>{if(!e.editable)return;const k=t();if(k==null)return;const M=n.get(oe),D=k+1;v==="add-row"||v==="delete-row"?(M.call(Pn.key,{pos:D,index:a.row}),M.call(v==="add-row"?Su.key:xl.key)):v==="add-col"||v==="delete-col"?(M.call(Fn.key,{pos:D,index:a.col}),M.call(v==="add-col"?xu.key:xl.key)):v==="row-up"||v==="row-down"?(M.call(Pn.key,{pos:D,index:a.row}),M.call(wu.key,{pos:D,from:a.row,to:a.row+(v==="row-up"?-1:1)})):(M.call(Fn.key,{pos:D,index:a.col}),M.call(ku.key,{pos:D,from:a.col,to:a.col+(v==="col-left"?-1:1)})),o(!1),e.focus()};if(!i)return null;const m=r.childCount,y=((b=r.firstChild)==null?void 0:b.childCount)??0;return L.jsxs("div",{className:"milkdown-table-actions",contentEditable:!1,ref:d,children:[L.jsx("button",{type:"button",ref:c,"aria-label":"Table actions","aria-haspopup":"menu","aria-expanded":s,onPointerDown:v=>v.preventDefault(),onClick:h,children:"•••"}),s&&L.jsxs("div",{className:"milkdown-table-actions-menu",role:"menu","aria-label":"Table actions",ref:u,onKeyDown:v=>{var k,M,D;if(v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),o(!1),(k=c.current)==null||k.focus()),v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault(),v.stopPropagation();const O=Array.from(((M=u.current)==null?void 0:M.querySelectorAll("button:not(:disabled)"))??[]),z=O.indexOf(document.activeElement);(D=O[(z+(v.key==="ArrowDown"?1:O.length-1))%O.length])==null||D.focus()}},children:[L.jsxs("div",{className:"milkdown-table-actions-context",children:["Row ",a.row+1," · Column ",a.col+1]}),L.jsx("button",{role:"menuitem",type:"button",onClick:()=>f("add-row"),children:"Add row below"}),L.jsx("button",{role:"menuitem",type:"button",onClick:()=>f("add-col"),children:"Add column right"}),L.jsx("button",{role:"menuitem",type:"button",disabled:a.row<=1,onClick:()=>f("row-up"),children:"Move row up"}),L.jsx("button",{role:"menuitem",type:"button",disabled:a.row===0||a.row>=m-1,onClick:()=>f("row-down"),children:"Move row down"}),L.jsx("button",{role:"menuitem",type:"button",disabled:a.col===0,onClick:()=>f("col-left"),children:"Move column left"}),L.jsx("button",{role:"menuitem",type:"button",disabled:a.col>=y-1,onClick:()=>f("col-right"),children:"Move column right"}),L.jsx("button",{role:"menuitem",type:"button",disabled:a.row===0,onClick:()=>f("delete-row"),children:"Delete row"}),L.jsx("button",{role:"menuitem",type:"button",disabled:y<=1,onClick:()=>f("delete-col"),children:"Delete column"})]})]})}const $I={renderButton:r=>{switch(r){case"add_row":return"+";case"add_col":return"+";case"delete_row":return"-";case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":return"=";case"row_drag_handle":return"="}}},Rf=Ne({...$I},"tableBlockConfigCtx");function If(r,e){for(let t=0;t<r.childCount;t++)if(r.child(t)===e)return t;return-1}function qI(r,e){var t,n,i;if(e)try{const s=e.posAtCoords({left:r.clientX,top:r.clientY});if(!s)return;const o=s.inside;if(o==null||o<0)return;const a=e.state.doc.resolve(o),l=e.state.doc.nodeAt(o);if(!l)return;const c=["table_cell","table_header"],u=["table_row","table_header_row"],d=c.includes(l.type.name)?l:(t=ln(y=>c.includes(y.type.name))(a))==null?void 0:t.node,h=(n=ln(y=>u.includes(y.type.name))(a))==null?void 0:n.node,f=(i=ln(y=>y.type.name==="table")(a))==null?void 0:i.node;if(!d||!h||!f)return;const m=If(h,d);return[If(f,h),m]}catch{return}}function Gu(r,[e,t]){const n=r.current;if(!n)return;const i=n.querySelectorAll("tr"),s=i[e];if(!s)return;const o=i[0];if(!o)return;const a=o.children[t];if(!a)return;const l=s.children[t];if(l)return{row:s,col:l,headerCol:a}}function HI(r,e,t){if(!t||!e)return;const{selection:n}=e.state;if(!(n instanceof He))return;const{$from:i}=n,s=va(i);if(!(!s||s.node!==t)){if(n.isColSelection()){const{$head:o}=n,a=o.index(o.depth-1);t1({refs:r,index:[0,a],before:l=>{var c;(c=l.querySelector(".button-group"))==null||c.setAttribute("data-show","true")}});return}if(n.isRowSelection()){const{$head:o}=n,a=ln(c=>c.type.name==="table_row"||c.type.name==="table_header_row")(o);if(!a)return;const l=If(s.node,a.node);r1({refs:r,index:[l,0],before:c=>{var u;l>0&&((u=c.querySelector(".button-group"))==null||u.setAttribute("data-show","true"))}})}}}function t1({refs:r,index:e,before:t,after:n}){const{contentWrapperRef:i,colHandleRef:s,hoverIndex:o}=r,a=s.current;if(!a)return;o.current=e;const l=Gu(i,e);if(!l)return;const{headerCol:c}=l;a.dataset.show="true",t&&t(a),Wr(c,a,{placement:"top"}).then(({x:u,y:d})=>{Object.assign(a.style,{left:`${u}px`,top:`${d}px`}),n&&n(a)}).catch(console.error)}function r1({refs:r,index:e,before:t,after:n}){const{contentWrapperRef:i,rowHandleRef:s,hoverIndex:o}=r,a=s.current;if(!a)return;o.current=e;const l=Gu(i,e);if(!l)return;const{row:c}=l;a.dataset.show="true",t&&t(a),Wr(c,a,{placement:"left"}).then(({x:u,y:d})=>{Object.assign(a.style,{left:`${u}px`,top:`${d}px`}),n&&n(a)}).catch(console.error)}function _I(r,e){let t=0,n=null,i=null;const s=o=>{t=Date.now(),r(...o)};return(...o)=>{const a=Date.now(),l=e-(a-t);l<=0?(n&&(clearTimeout(n),n=null),s(o)):(i=o,n||(n=setTimeout(()=>{if(n=null,i){const c=i;i=null,s(c)}},l)))}}function a7(r){const{dragPreviewRef:e,tableWrapperRef:t,contentWrapperRef:n,yLineHandleRef:i,xLineHandleRef:s,colHandleRef:o,rowHandleRef:a}=r,l=e.current;if(!l)return;const c=t.current;if(!c)return;const u=n.current;if(!u)return;const d=u.querySelector("tbody");if(!d)return;const h=l.querySelector("tbody");if(!h)return;const f=i.current;if(!f)return;const m=s.current;if(!m)return;const y=o.current;if(!y)return;const b=a.current;if(b)return{preview:l,wrapper:c,content:u,contentRoot:d,previewRoot:h,yHandle:f,xHandle:m,colHandle:y,rowHandle:b}}function l7(r,e,t){const n=t==="x"?"left":"top",i=t==="x"?"right":"bottom",s=r.length-1,o=r.findIndex((l,c)=>{const u=l.getBoundingClientRect(),d=u[n],h=u[i];return d<=e&&e<=h||c===s&&e>h||c===0&&e<d}),a=r[o];return a?[a,o]:void 0}function jI(r,e){const t=r.querySelector("tr");if(!t)return;const n=Array.from(t.children);return l7(n,e,"x")}function VI(r,e){const t=Array.from(r.querySelectorAll("tr"));return l7(t,e,"y")}function c7(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function u7(r,e,t,n,i){const s=n.querySelector("tbody");if(!s)return;const{width:o,height:a}=s.getBoundingClientRect();if(r==="y"){const u=n.querySelectorAll("tr")[i];if(!u)return;t.appendChild(u.cloneNode(!0));const d=u.getBoundingClientRect().height;Object.assign(e.style,{width:`${o}px`,height:`${d}px`}),e.dataset.show="true";return}const l=n.querySelectorAll("tr");let c;Array.from(l).forEach(u=>{const d=u.children[i];if(!d)return;c===void 0&&(c=d.getBoundingClientRect().width);const h=d.parentElement;if(!h)return;const f=h.cloneNode(!1),m=d.cloneNode(!0);f.appendChild(m),t.appendChild(f)}),Object.assign(e.style,{width:`${c??0}px`,height:`${a}px`}),e.dataset.show="true"}function N2(r){var e;(e=r.querySelector(".button-group"))==null||e.setAttribute("data-show","false")}function d7(r,e,t,n){const{xHandle:i,yHandle:s,colHandle:o,rowHandle:a,preview:l}=t;i.dataset.displayType=r==="y"?"indicator":"none",s.dataset.displayType=r==="x"?"indicator":"none",r==="y"?(o.dataset.show="false",N2(a)):(a.dataset.show="false",N2(o));const{hoverIndex:c,dragInfo:u}=n,[d,h]=c.current;u.current={startCoords:[e.clientX,e.clientY],startIndex:r==="y"?d:h,endIndex:r==="y"?d:h,type:r==="y"?"row":"col"},l.dataset.direction=r==="y"?"vertical":"horizontal"}function h7(r,e,t,n){var s;if(!((s=t==null?void 0:t.get(Me))!=null&&s.editable))return;e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.effectAllowed="move");const i=a7(r);i&&requestAnimationFrame(()=>{n(i)})}function WI(r,e){return t=>{h7(r,t,e,n=>{d7("y",t,n,r);const{preview:i,content:s,previewRoot:o}=n;c7(o);const[a]=r.hoverIndex.current;u7("y",i,o,s,a)})}}function UI(r,e){return t=>{h7(r,t,e,n=>{d7("x",t,n,r);const{preview:i,content:s,previewRoot:o}=n,[,a]=r.hoverIndex.current;c7(o),u7("x",i,o,s,a)})}}function KI(r){return _I(e=>{const t=a7(r);if(!t)return;const{preview:n,content:i,contentRoot:s,xHandle:o,yHandle:a}=t,{dragInfo:l,hoverIndex:c}=r;if(n.dataset.show==="false")return;const u=Gu(r.contentWrapperRef,c.current);if(!u||!s.querySelector("tr"))return;const d=l.current;if(!d)return;const h=s.offsetParent;if(!h)return;const f=h.offsetTop,m=h.offsetLeft;if(d.type==="col"){const y=u.col.getBoundingClientRect().width,{left:b,width:v}=s.getBoundingClientRect(),k=m-b,M=e.clientX+k-y/2,[D]=d.startCoords,O=D<e.clientX?"right":"left";n.style.top=`${f}px`;const z=M<b+k-20?b+k-20:M>b+v+k-y+20?b+v+k-y+20:M;n.style.left=`${z}px`;const T=jI(s,e.clientX);if(T){const[B,N]=T,q=a.getBoundingClientRect().width,te=i.getBoundingClientRect();d.endIndex=N,Wr(B,a,{placement:O==="left"?"left":"right",middleware:[Mi(O==="left"?-1*q:0)]}).then(({x:Z})=>{a.dataset.show="true",Object.assign(a.style,{height:`${te.height}px`,left:`${Z}px`,top:`${f}px`})}).catch(console.error)}}else if(d.type==="row"){const y=u.row.getBoundingClientRect().height,{top:b,height:v}=s.getBoundingClientRect(),k=f-b,M=e.clientY+k-y/2,[,D]=d.startCoords,O=D<e.clientY?"down":"up",z=M<b+k-20?b+k-20:M>b+v+k-y+20?b+v+k-y+20:M;n.style.top=`${z}px`,n.style.left=`${m}px`;const T=VI(s,e.clientY);if(T){const[B,N]=T,q=o.getBoundingClientRect().height,te=i.getBoundingClientRect();d.endIndex=N,Wr(B,o,{placement:O==="up"?"top":"bottom",middleware:[Mi(O==="up"?-1*q:0)]}).then(({y:Z})=>{o.dataset.show="true",Object.assign(o.style,{width:`${te.width}px`,top:`${Z}px`})}).catch(console.error)}}},20)}function GI(r,e,t){const{dragPreviewRef:n,yLineHandleRef:i,xLineHandleRef:s,dragInfo:o}=r,a=WI(r,e),l=UI(r,e),c=KI(r);return{dragCol:l,dragRow:a,onDragOver:c,onDragEnd:()=>{const u=n.current;if(!u||u.dataset.show==="false")return;const d=u.querySelector("tbody");for(;d!=null&&d.firstChild;)d.removeChild(d.firstChild);u.dataset.show="false",o.current=void 0},onDrop:()=>{const u=n.current;if(!u)return;const d=i.current;if(!d)return;const h=s.current;if(!h)return;const f=o.current;if(!f||!e||u.dataset.show==="false"||!r.colHandleRef.current||!r.rowHandleRef.current)return;d.dataset.show="false",h.dataset.show="false";const m=u.querySelector("tbody");for(;m!=null&&m.firstChild;)m.removeChild(m.firstChild);if(u.dataset.show="false",o.current=void 0,f.startIndex===f.endIndex||f.type==="row"&&(f.startIndex===0||f.endIndex===0))return;const y=e.get(oe),b={from:f.startIndex,to:f.endIndex,pos:((t==null?void 0:t())??0)+1};if(f.type==="col"){y.call(Fn.key,{pos:b.pos,index:f.startIndex}),y.call(ku.key,b);const v=[0,f.endIndex];t1({refs:r,index:v})}else{y.call(Pn.key,{pos:b.pos,index:f.startIndex}),y.call(wu.key,b);const v=[f.endIndex,0];r1({refs:r,index:v})}requestAnimationFrame(()=>{e.get(Me).focus()})}}}function JI(r,e,t){const{xLineHandleRef:n,contentWrapperRef:i,colHandleRef:s,rowHandleRef:o,hoverIndex:a,lineHoverIndex:l}=r;return{onAddRow:()=>{var m;if(!e)return;const c=n.current;if(!c)return;const[u]=l.current;if(u<0||!e.get(Me).editable)return;const d=Array.from(((m=i.current)==null?void 0:m.querySelectorAll("tr"))??[]),h=e.get(oe),f=((t==null?void 0:t())??0)+1;d.length===u?(h.call(Pn.key,{pos:f,index:u-1}),h.call(Su.key)):(h.call(Pn.key,{pos:f,index:u}),h.call(nm.key)),h.call(Pn.key,{pos:f,index:u}),c.dataset.show="false"},onAddCol:()=>{var f,m;if(!e||!n.current)return;const[,c]=l.current;if(c<0||!e.get(Me).editable)return;const u=Array.from(((m=(f=i.current)==null?void 0:f.querySelector("tr"))==null?void 0:m.children)??[]),d=e.get(oe),h=((t==null?void 0:t())??0)+1;u.length===c?(d.call(Fn.key,{pos:h,index:c-1}),d.call(xu.key)):(d.call(Fn.key,{pos:h,index:c}),d.call(rm.key)),d.call(Fn.key,{pos:h,index:c})},selectCol:()=>{var f;if(!e)return;const[,c]=a.current,u=e.get(oe),d=((t==null?void 0:t())??0)+1;u.call(Fn.key,{pos:d,index:c});const h=(f=s.current)==null?void 0:f.querySelector(".button-group");h&&(h.dataset.show=h.dataset.show==="true"?"false":"true")},selectRow:()=>{var f;if(!e)return;const[c]=a.current,u=e.get(oe),d=((t==null?void 0:t())??0)+1;u.call(Pn.key,{pos:d,index:c});const h=(f=o.current)==null?void 0:f.querySelector(".button-group");h&&c>0&&(h.dataset.show=h.dataset.show==="true"?"false":"true")},deleteSelected:c=>{!e||!e.get(Me).editable||(c.preventDefault(),c.stopPropagation(),e.get(oe).call(xl.key),requestAnimationFrame(()=>{e.get(Me).focus()}))},onAlign:c=>u=>{!e||!e.get(Me).editable||(u.preventDefault(),u.stopPropagation(),e.get(oe).call(im.key,c),requestAnimationFrame(()=>{e.get(Me).focus()}))}}}function YI(r,e){let t=0,n=null,i=null;const s=o=>{t=Date.now(),r(...o)};return(...o)=>{const a=Date.now(),l=e-(a-t);l<=0?(n&&(clearTimeout(n),n=null),s(o)):(i=o,n||(n=setTimeout(()=>{if(n=null,i){const c=i;i=null,s(c)}},l)))}}function XI(r,e){return YI(t=>{if(!(e!=null&&e.editable))return;const{contentWrapperRef:n,yLineHandleRef:i,xLineHandleRef:s,colHandleRef:o,rowHandleRef:a,hoverIndex:l,lineHoverIndex:c}=r,u=i.current;if(!u)return;const d=s.current;if(!d)return;const h=n.current;if(!h)return;const f=a.current;if(!f)return;const m=o.current;if(!m)return;const y=qI(t,e);if(!y)return;const b=Gu(n,y);if(!b)return;const[v,k]=y,M=b.col.getBoundingClientRect(),D=Math.abs(t.clientX-M.left)<8,O=Math.abs(M.right-t.clientX)<8,z=Math.abs(t.clientY-M.top)<8,T=Math.abs(M.bottom-t.clientY)<8,B=D||O||z||T,N=f.querySelector(".button-group"),q=m.querySelector(".button-group");if(N&&(N.dataset.show="false"),q&&(q.dataset.show="false"),B){const te=h.getBoundingClientRect();f.dataset.show="false",m.dataset.show="false",d.dataset.displayType="tool",u.dataset.displayType="tool";const Z=u.getBoundingClientRect().width,me=d.getBoundingClientRect().height;D||O?(c.current[1]=D?k:k+1,Wr(b.col,u,{placement:D?"left":"right",middleware:[Mi(D?-1*Z:0)]}).then(({x:be})=>{u.dataset.show="true",Object.assign(u.style,{height:`${te.height}px`,left:`${be}px`})}).catch(console.error)):u.dataset.show="false",y[0]!==0&&(z||T)?(c.current[0]=z?v:v+1,Wr(b.row,d,{placement:z?"top":"bottom",middleware:[Mi(z?-1*me:0)]}).then(({y:be})=>{d.dataset.show="true",Object.assign(d.style,{width:`${te.width}px`,top:`${be}px`})}).catch(console.error)):d.dataset.show="false";return}c.current=[-1,-1],u.dataset.show="false",d.dataset.show="false",f.dataset.show="true",m.dataset.show="true",r1({refs:r,index:y}),t1({refs:r,index:y}),l.current=y},20)}function ZI(r){return()=>{const{rowHandleRef:e,colHandleRef:t,yLineHandleRef:n,xLineHandleRef:i}=r;setTimeout(()=>{const s=e.current;if(!s)return;const o=t.current;if(!o)return;const a=n.current;if(!a)return;const l=i.current;l&&(s.dataset.show="false",o.dataset.show="false",a.dataset.show="false",l.dataset.show="false")},200)}}function QI(r,e){return{pointerMove:XI(r,e),pointerLeave:ZI(r)}}function ez(){const{node:r,view:e,getPos:t,contentRef:n}=Ii(),i=Lr(),s=Gn(e),o=i.get(Rf.key),a=R.useRef(null),l=R.useRef(null),c=R.useRef(null),u=R.useRef(null),d=R.useRef(null),h=R.useRef(null),f=R.useRef(null),m=R.useRef([0,0]),y=R.useRef([-1,-1]),b=R.useRef(void 0),v={contentWrapperRef:a,tableWrapperRef:l,dragPreviewRef:c,yLineHandleRef:f,xLineHandleRef:h,colHandleRef:u,rowHandleRef:d,hoverIndex:m,lineHoverIndex:y,dragInfo:b},{onAddRow:k,onAddCol:M,selectCol:D,selectRow:O,deleteSelected:z,onAlign:T}=JI(v,i,t),B=Z=>{a.current=Z,n(Z)},N=R.useRef(null);R.useEffect(()=>{const Z=N.current;if(!Z)return;const{pointerMove:me,pointerLeave:be}=QI(v,e),$=Qe=>me(Qe),ve=()=>be();return Z.addEventListener("pointermove",$),Z.addEventListener("pointerleave",ve),()=>{Z.removeEventListener("pointermove",$),Z.removeEventListener("pointerleave",ve)}},[e]),R.useEffect(()=>{const Z=u.current,me=d.current;if(!Z||!me)return;const{dragCol:be,dragRow:$,onDragOver:ve,onDragEnd:Qe,onDrop:kt}=GI(v,i,t);return Z.addEventListener("dragstart",be),me.addEventListener("dragstart",$),window.addEventListener("dragover",ve),window.addEventListener("dragend",Qe),window.addEventListener("drop",kt),()=>{Z.removeEventListener("dragstart",be),me.removeEventListener("dragstart",$),window.removeEventListener("dragover",ve),window.removeEventListener("dragend",Qe),window.removeEventListener("drop",kt)}},[e]),R.useEffect(()=>{requestAnimationFrame(()=>{e.editable&&HI(v,e,r)})},[r,e]);const q=Z=>Z.stopPropagation(),te=Z=>Z.preventDefault();return L.jsxs("div",{ref:N,className:s?void 0:"readonly",onDragStart:te,onDragOver:te,onDragLeave:te,children:[L.jsx(FI,{}),L.jsxs("div",{"data-show":"false",contentEditable:!1,draggable:!0,"data-role":"col-drag-handle",className:"handle cell-handle",onClick:D,onPointerDown:q,onPointerMove:q,ref:u,children:[L.jsx(Le,{icon:o.renderButton("col_drag_handle")}),L.jsxs("div",{className:"button-group","data-show":"false",onPointerMove:q,children:[L.jsx("button",{type:"button","aria-label":"Align column left",onPointerDown:te,onClick:T("left"),children:L.jsx(Le,{icon:o.renderButton("align_col_left")})}),L.jsx("button",{type:"button","aria-label":"Align column center",onPointerDown:te,onClick:T("center"),children:L.jsx(Le,{icon:o.renderButton("align_col_center")})}),L.jsx("button",{type:"button","aria-label":"Align column right",onPointerDown:te,onClick:T("right"),children:L.jsx(Le,{icon:o.renderButton("align_col_right")})}),L.jsx("button",{type:"button","aria-label":"Delete selected column",onPointerDown:te,onClick:z,children:L.jsx(Le,{icon:o.renderButton("delete_col")})})]})]}),L.jsxs("div",{"data-show":"false",contentEditable:!1,draggable:!0,"data-role":"row-drag-handle",className:"handle cell-handle",onClick:O,onPointerDown:q,onPointerMove:q,ref:d,children:[L.jsx(Le,{icon:o.renderButton("row_drag_handle")}),L.jsx("div",{className:"button-group","data-show":"false",onPointerMove:q,children:L.jsx("button",{type:"button","aria-label":"Delete selected row",onPointerDown:te,onClick:z,children:L.jsx(Le,{icon:o.renderButton("delete_row")})})})]}),L.jsxs("div",{className:"table-wrapper",ref:l,children:[L.jsx("div",{"data-show":"false",className:"drag-preview","data-direction":"vertical",ref:c,children:L.jsx("table",{children:L.jsx("tbody",{})})}),L.jsx("div",{"data-show":"false",contentEditable:!1,"data-display-type":"tool","data-role":"x-line-drag-handle",className:"handle line-handle",onPointerMove:q,ref:h,children:L.jsx("button",{type:"button","aria-label":"Add row",onClick:k,className:"add-button",children:L.jsx(Le,{icon:o.renderButton("add_row")})})}),L.jsx("div",{"data-show":"false",contentEditable:!1,"data-display-type":"tool","data-role":"y-line-drag-handle",className:"handle line-handle",onPointerMove:q,ref:f,children:L.jsx("button",{type:"button","aria-label":"Add column",onClick:M,className:"add-button",children:L.jsx(Le,{icon:o.renderButton("add_col")})})}),L.jsx("table",{className:"children",ref:B})]})]})}function tz(r,e){const t=(i,s)=>{var f;if(!i.editable)return!1;const{state:o,dispatch:a}=i,l=i.posAtCoords({left:s.clientX,top:s.clientY});if(!l)return!1;const c=o.doc.resolve(l.inside),u=ln(m=>m.type.name==="table_cell"||m.type.name==="table_header")(c);if(!u||o.selection instanceof se&&((f=ln(m=>m.type.name==="table_cell"||m.type.name==="table_header")(o.selection.$from))==null?void 0:f.node)===u.node)return!1;const{from:d}=u,h=ae.create(o.doc,d+1);return o.selection.eq(h)?!1:(o.selection instanceof He?setTimeout(()=>{a(o.tr.setSelection(h).scrollIntoView())},20):requestAnimationFrame(()=>{a(o.tr.setSelection(h).scrollIntoView())}),!0)},n=Ai(cn.node,i=>e({component:ez,as:()=>{const s=document.createElement("div");return s.className="milkdown-table-block",s},contentAs:"tbody",stopEvent:s=>{if(s.target instanceof Element&&s.target.closest("button, input, .milkdown-table-actions")||s.type==="drop"||s.type.startsWith("drag"))return!0;if(s.type==="mousedown"||s.type==="pointerdown"){if(s.target instanceof Element&&s.target.closest("button"))return!0;const o=s.target;if(o instanceof HTMLElement&&(o.closest("th")||o.closest("td")))return t(i.get(Me),s)}return!1}}));r.config(i=>{i.update(Rf.key,s=>({...s,renderButton:o=>{switch(o){case"add_row":return Qh;case"add_col":return Qh;case"delete_row":return ef;case"delete_col":return ef;case"align_col_left":return wT;case"align_col_center":return vT;case"align_col_right":return bT;case"col_drag_handle":return YM;case"row_drag_handle":return JM}}}))}).use(Rf).use(n)}function ph(r){const e=r.dom.ownerDocument.getSelection();if(!r.editable||!e||e.isCollapsed)return;const{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}=e;if(!t||!i||!r.dom.contains(t)||!r.dom.contains(i))return;const o=r.posAtDOM(t,n),a=r.posAtDOM(i,s),l=se.between(r.state.doc.resolve(o),r.state.doc.resolve(a));l.eq(r.state.selection)||r.dispatch(r.state.tr.setSelection(l))}function rz(){const r=new Qv;return r.addGroup("formatting","Formatting").addItem("bold",{label:"Bold",icon:UM,active:e=>!!e.get(oe).call(co.key,ba.type(e)),onRun:e=>{e.get(oe).call(yu.key)}}).addItem("italic",{label:"Italic",icon:sT,active:e=>!!e.get(oe).call(co.key,Hs.type(e)),onRun:e=>{e.get(oe).call(gu.key)}}).addItem("strikethrough",{label:"Strikethrough",icon:gT,active:e=>!!e.get(oe).call(co.key,xa.type(e)),onRun:e=>{e.get(oe).call(bu.key)}}),r.addGroup("function","Function").addItem("code",{label:"Inline code",icon:l6,active:e=>!!e.get(oe).call(co.key,Bn.type(e)),onRun:e=>{e.get(oe).call(vu.key)}}).addItem("link",{label:"Link",icon:oT,active:e=>!!e.get(oe).call(co.key,jr.type(e)),onRun:e=>{e.get(oe).call(i7.key)}}),r.build()}function nz(){k5();const r=Lr(),e=R.useMemo(()=>rz(),[]);return r.get(_h).status!==A9.Created?null:L.jsx(L.Fragment,{children:e.map((t,n)=>L.jsxs(R.Fragment,{children:[n>0&&L.jsx("div",{className:"divider"}),t.items.map(i=>L.jsx("button",{type:"button","aria-label":i.label,title:i.label,"aria-pressed":i.active(r),className:$t("toolbar-item",i.active(r)&&"active"),onFocus:()=>ph(r.get(Me)),onPointerDown:s=>{s.preventDefault(),ph(r.get(Me))},onClick:()=>{var o;const s=r.get(Me);ph(s),(o=i.onRun)==null||o.call(i,r)},children:L.jsx(Le,{icon:i.icon})},i.key))]},t.key))})}const E2=Wu("CREPE_TOOLBAR");function iz(r,e){const{doc:t,selection:n}=r.state,{empty:i,from:s,to:o}=n,a=!t.textBetween(s,o).length&&n instanceof se,l=!(n instanceof se),c=r.dom.getRootNode(),u=e.contains(c.activeElement),d=!r.hasFocus()&&!u,h=!r.editable;return!(d||l||i||a||h)}function sz(r){let e,t;const n=()=>(t||(t=document.createElement("div"),t.className="milkdown-toolbar",t.dataset.show="false"),t);return r({component:nz,root:()=>n(),update:(i,s)=>{e||(e=new Vu({content:n(),debounce:20,offset:10,shouldShow:o=>iz(o,n())})),e.update(i,s)},destroy:()=>{e==null||e.destroy(),e=void 0,t=void 0}})}function oz(r,e){r.config(t=>{t.set(E2.key,{view:sz(e)})}).use(E2)}function az({value:r,editable:e=JO,onChange:t,placeholder:n,nodeViewFactory:i,pluginViewFactory:s,ctxHolder:o,plugins:a,sourceRevision:l,onSourceReady:c,onSourceSelection:u,onTaskToggleRequest:d}){const h=R.useRef(null),f=R.useRef({});R.useLayoutEffect(()=>{var T;f.current={onSourceReady:c,onSourceSelection:u,onTaskToggleRequest:d},(T=h.current)==null||T.setCallbacks(f.current)},[c,u,d]);const m=R.useRef(l),y=R.useRef(t);R.useLayoutEffect(()=>{y.current=t},[t]);const b=R.useRef(a),v=R.useRef(r),k=R.useRef({value:r,sourceRevision:l});R.useLayoutEffect(()=>{k.current={value:r,sourceRevision:l}},[r,l]);const M=R.useRef(n),D=R.useRef(e);Gb(T=>{var te;const B=k.current;v.current=B.value,m.current=B.sourceRevision;const N=new GO;N.callbacks=f.current,h.current=N;const q=N9.make().config(Z=>{Z.set(S0,T),Z.set(v0,B.value),o.current=Z,Z.update(il,me=>({...me,editable:g2(()=>D.current)})),Z.get(Tf).markdownUpdated((me,be,$)=>{var Qe;if(be===$||be===v.current)return;const ve=N.confirmedChangeText(me.get(Me).state);if(ve!==void 0){v.current=ve;return}v.current=be,(Qe=y.current)==null||Qe.call(y,be)})}).use(WO(N,(b.current??[]).filter(Z=>!Z.preservesSourceMapping),!0)).use(fE).use(RC).use(rE).use(nE).use((b.current??[]).some(Z=>Z.replacesHistory)?[]:jE).use(WE).use(mv).use(kD).use(Cv);return q.use(tE(Z=>{var be;const me=Z.get(bo)(Z.get(Me).state.doc);me!==v.current&&(v.current=me,(be=y.current)==null||be.call(y,me))})),gE(q),tI(q),PI(q,{text:M.current??"Type / for commands",mode:"block"}),II(q,i),sI(q,i),zR(q,i),jR(q,i,s),SR(q,i),tz(q,i),oz(q,s),aR(q,s),DI(q,s),gI(q,s),eI(q),(te=b.current)==null||te.forEach(Z=>{Z({editor:q,nodeViewFactory:i,pluginViewFactory:s})}),q});const[O,z]=Jb();R.useEffect(()=>{let T=!1;return queueMicrotask(()=>{var B;T||((B=h.current)==null||B.refreshControls())}),()=>{T=!0}},[d,O]),R.useEffect(()=>{if(O||(b.current??[]).some(N=>N.ownsDocument)||r===v.current&&l===m.current)return;if(m.current=l,h.current.consumeConfirmedValue(r)){v.current=r;return}if(r===v.current){const N=h.current;N.invalidate(),N.port.bindSource(r,N.currentGeneration);return}const T=z();if(!T)return;v.current=r;let B=!1;return queueMicrotask(()=>{if(B||v.current!==r)return;T.action(q=>{const te=q.get(Me),Z=q.get(Ts)(r);if(!Z)return;const{state:me}=te;te.dispatch(me.tr.replace(0,me.doc.content.size,new re(Z.content,0,0)).setMeta(qO,!0).setMeta("addToHistory",!1))});const N=h.current;N.port.bindSource(r,N.currentGeneration)}),()=>{B=!0}},[r,l,O,z]),R.useEffect(()=>{if(D.current=e,O)return;const T=z();if(!T)return;let B=!1;return queueMicrotask(()=>{B||T.action(N=>{const q=N.get(Me);q.setProps({editable:g2(()=>D.current)}),q.dom.dispatchEvent(new Event("blintz:editable"))})}),()=>{B=!0}},[e,O,z])}const lz={};function cz({value:r,editable:e,onChange:t,placeholder:n,className:i,theme:s="auto",plugins:o,embeds:a=lz,wikiLinks:l,mermaid:c,sourceRevision:u,onSourceReady:d,onSourceSelection:h,onTaskToggleRequest:f}){const m=R.useRef(null),y=R.useRef(null),[b,v]=R.useState("light");R.useEffect(()=>{var N;const z=(N=window.matchMedia)==null?void 0:N.call(window,"(prefers-color-scheme: dark)"),T=()=>{var te;if(s!=="auto"){v(s);return}let q=(te=y.current)==null?void 0:te.parentElement;for(;q;){const Z=q.getAttribute("data-theme");if(Z==="light"||Z==="dark"){v(Z);return}if(q.classList.contains("dark")){v("dark");return}if(q.classList.contains("light")){v("light");return}q=q.parentElement}v(z!=null&&z.matches?"dark":"light")};T();const B=new MutationObserver(T);return B.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["class","data-theme"]}),z==null||z.addEventListener("change",T),()=>{B.disconnect(),z==null||z.removeEventListener("change",T)}},[s]);const k=s==="auto"?b:s,M=R.useRef(c);R.useLayoutEffect(()=>{M.current=c},[c]);const D=R.useCallback(()=>M.current(),[]),O=c?D:void 0;return L.jsx("div",{ref:y,className:$t("milkdown-editor-host",i),"data-blintz-theme":k,children:L.jsx(RO,{value:m,children:L.jsx(FO,{value:k,children:L.jsx(zO,{value:a,children:L.jsx(BO,{options:l,children:L.jsx(PO,{value:O,children:L.jsx(Kb,{children:L.jsx(ox,{children:L.jsx(uz,{value:r,editable:e,onChange:t,placeholder:n,ctxHolder:m,plugins:o,sourceRevision:u,onSourceReady:d,onSourceSelection:h,onTaskToggleRequest:f})})})})})})})})})}function uz({value:r,editable:e,onChange:t,placeholder:n,ctxHolder:i,plugins:s,sourceRevision:o,onSourceReady:a,onSourceSelection:l,onTaskToggleRequest:c}){const u=Wk(),d=Yk();return az({value:r,editable:e,onChange:t,placeholder:n,nodeViewFactory:u,pluginViewFactory:d,ctxHolder:i,plugins:s,sourceRevision:o,onSourceReady:a,onSourceSelection:l,onTaskToggleRequest:c}),L.jsx(Ub,{})}const mh="color-mix(in srgb, hsl(var(--foreground)) 4%, hsl(var(--card)))",dz=`
|
|
1196
|
+
.node rect, .node circle, .node ellipse, .node polygon, .node path, .node .outer-path,
|
|
1197
|
+
.actor, .labelBox, .note, rect.task, .statediagram-state rect, .classGroup rect,
|
|
1198
|
+
.er.entityBox {
|
|
1199
|
+
fill: ${mh} !important;
|
|
1200
|
+
stroke: hsl(var(--border)) !important;
|
|
1201
|
+
stroke-width: 1px !important;
|
|
1202
|
+
filter: none !important;
|
|
1203
|
+
}
|
|
1204
|
+
.cluster rect, .cluster path {
|
|
1205
|
+
fill: hsl(var(--muted)) !important;
|
|
1206
|
+
stroke: hsl(var(--border)) !important;
|
|
1207
|
+
filter: none !important;
|
|
1208
|
+
}
|
|
1209
|
+
.label, .nodeLabel, .edgeLabel, .cluster-label, text, tspan, .nodeLabel p, .edgeLabel p {
|
|
1210
|
+
color: hsl(var(--foreground)) !important;
|
|
1211
|
+
fill: hsl(var(--foreground)) !important;
|
|
1212
|
+
}
|
|
1213
|
+
.edgeLabel, .edgeLabel rect, .edgeLabel p, .labelBkg {
|
|
1214
|
+
background-color: ${mh} !important;
|
|
1215
|
+
fill: ${mh} !important;
|
|
1216
|
+
}
|
|
1217
|
+
.flowchart-link, .edgePath .path, .messageLine0, .messageLine1, .relation, .transition,
|
|
1218
|
+
.actor-line, .neo-line path {
|
|
1219
|
+
stroke: hsl(var(--muted-foreground)) !important;
|
|
1220
|
+
}
|
|
1221
|
+
.nodeLabel p, .edgeLabel p, foreignObject p {
|
|
1222
|
+
margin: 0 !important;
|
|
1223
|
+
padding: 0 !important;
|
|
1224
|
+
font-size: inherit !important;
|
|
1225
|
+
line-height: 1.5 !important;
|
|
1226
|
+
}
|
|
1227
|
+
.marker, marker path, .arrowheadPath, .arrowMarkerPath {
|
|
1228
|
+
fill: hsl(var(--muted-foreground)) !important;
|
|
1229
|
+
stroke: hsl(var(--muted-foreground)) !important;
|
|
1230
|
+
}
|
|
1231
|
+
`,hz={look:"classic",fontFamily:"var(--font-sans)",themeCSS:dz},fz=()=>U7(()=>import("./mermaid.core-dpp59v7L.js").then(r=>r.bm),__vite__mapDeps([0,1,2,3])).then(r=>(r.default.initialize(hz),r));function pz({value:r,editable:e,onChange:t,className:n,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a}){const l=V7();return L.jsx("div",{"data-theme":l,className:"dorkos-markdown contents",children:L.jsx(cz,{value:r,theme:l,editable:e,onChange:t,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a,mermaid:fz,className:W7("desktop:select-text",n)})})}const bz=Object.freeze(Object.defineProperty({__proto__:null,BlintzCanvas:pz},Symbol.toStringTag,{value:"Module"}));export{bz as B,G0 as S,nD as a,rD as b,sD as c,UE as f,J0 as i,Iv as p,wv as r,J4 as t};
|