reactive-md 0.9.2 → 0.10.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/CHANGELOG-ch.md +397 -333
- package/CHANGELOG.md +398 -334
- package/CONTRIBUTING-ch.md +22 -22
- package/CONTRIBUTING.md +22 -22
- package/README-ch.md +431 -431
- package/README-en.md +431 -431
- package/README.md +429 -429
- package/SECURITY-ch.md +83 -83
- package/SECURITY.md +83 -83
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +263 -263
- package/cli/assets.mjs +395 -395
- package/cli/build.mjs +445 -445
- package/cli/check.mjs +444 -444
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +325 -323
- package/cli/init.mjs +1577 -1577
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +65 -65
- package/cli/migrate.mjs +368 -368
- package/cli/package-loader.mjs +41 -41
- package/cli/package.mjs +211 -211
- package/dist-library/LocalDocumentView-CP2QG86k.js +114 -0
- package/dist-library/{LocalDocumentViewCore-DXE0I0Qc.js → LocalDocumentViewCore-Cd6yMEkg.js} +379 -9445
- package/dist-library/LocalReactiveDocumentCore-VuYpZqdn.js +283 -0
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/chart-B1TUtzm-.js +3 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/color-values-r8Wf7ALn.js +6 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/compile-cache-key-D21X2Obx.js +28 -0
- package/dist-library/compiler-DBwLawMZ.js +98 -0
- package/dist-library/{compiler-core-DDDdvuLy.js → compiler-core-kkDiQ1RK.js} +4202 -3496
- package/dist-library/component-kernel-CsJSabHX.js +372 -0
- package/dist-library/{component-state-BRwvTV0d.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/component-utils-ZM3jUJNy.js +339 -0
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/config-validation-DbmsWAEV.js +469 -0
- package/dist-library/controls-DRy5rzzN.js +5970 -0
- package/dist-library/controls-DWlx-AQl.js +3 -0
- package/dist-library/{coordinate-B1VFK9fd.js → coordinate-c54pHfgf.js} +89 -89
- package/dist-library/data-BtFlkJzp.js +3 -0
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/data-visuals-rZQUeQM0.js +384 -0
- package/dist-library/{default-components-s21NevON.js → default-components-B-39etG9.js} +518 -355
- package/dist-library/{config-DXLvctiZ.js → default-config-CCa8rm2k.js} +265 -230
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{registry-D6OGkOcX.js → default-registry-DXJy66xj.js} +4 -4
- package/dist-library/default-schema-CeYiEW1K.js +33 -0
- package/dist-library/diagram-BLepzI8l.js +3 -0
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/dist-Cueh1Psp.js +4761 -0
- package/dist-library/{document-theme-C8J6UyNO.js → document-theme-CJvN-nC1.js} +246 -4
- package/dist-library/{export-CIAIPBov.js → export-BSV4E0jv.js} +135 -135
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/gallery-BC6FYTqw.js +3 -0
- package/dist-library/{gallery-Dv1rOvL0.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-Cr4CBwAH.js → html-CY9mC3Sr.js} +49 -48
- package/dist-library/{incremental-9nx92u9c.js → incremental-B-wW4H3F.js} +537 -384
- package/dist-library/{display-B_uutKkN.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/layout-CaDWsDof.js +3 -0
- package/dist-library/limits-CFERRrlC.js +10 -0
- package/dist-library/localization-COdJ6lw2.js +6 -0
- package/dist-library/mafs-CnzDC5CR.js +3 -0
- package/dist-library/math-view-CyGTS6kv.js +20 -0
- package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
- package/dist-library/mount-preset-DtrCX4G8.js +24 -0
- package/dist-library/numeric-sliders-BmJ1LCLx.js +542 -0
- package/dist-library/{observability-4KqXhIEU.js → observability-BVQ16ByQ.js} +125 -43
- package/dist-library/package-core-Cu_r_qs7.js +128 -0
- package/dist-library/parser-BHl9Lxbw.js +8 -0
- package/dist-library/parser-standard-DDAKv_DZ.js +4872 -0
- package/dist-library/plugin-packs-CkI0floL.js +19 -0
- package/dist-library/preset-core-BKPbH_Nv.js +1371 -0
- package/dist-library/props-0iDqxlTk.js +174 -0
- package/dist-library/react-74jdGBmu.js +32 -0
- package/dist-library/reactive-md-authoring.js +315 -296
- package/dist-library/reactive-md-build.js +334 -43
- package/dist-library/reactive-md-compiler-session.js +4 -0
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +6 -0
- package/dist-library/reactive-md-default-packs.js +32 -15
- package/dist-library/reactive-md-default-preset.js +7 -7
- package/dist-library/reactive-md-export.js +6 -5
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +26 -23
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +125 -3
- package/dist-library/reactive-md-pack-style-manifest.js +805 -0
- package/dist-library/reactive-md-plugin-chart.js +14 -9
- package/dist-library/reactive-md-plugin-data.js +8 -8
- package/dist-library/reactive-md-plugin-diagram.js +7 -6
- package/dist-library/reactive-md-plugin-forms.js +14 -13
- package/dist-library/reactive-md-plugin-gallery.js +6 -5
- package/dist-library/reactive-md-plugin-navigation.js +8 -8
- package/dist-library/reactive-md-plugin-network.js +13 -13
- package/dist-library/reactive-md-plugin-plot.js +7 -6
- package/dist-library/reactive-md-print.css +304 -304
- package/dist-library/reactive-md-react-component-accordion.js +10 -0
- package/dist-library/reactive-md-react-component-alert.js +10 -0
- package/dist-library/reactive-md-react-component-anchor.js +10 -0
- package/dist-library/reactive-md-react-component-badge.js +10 -0
- package/dist-library/reactive-md-react-component-card.js +10 -0
- package/dist-library/reactive-md-react-component-chart.js +22 -0
- package/dist-library/reactive-md-react-component-checkbox.js +10 -0
- package/dist-library/reactive-md-react-component-checklist.js +10 -0
- package/dist-library/reactive-md-react-component-choices.js +10 -0
- package/dist-library/reactive-md-react-component-column.js +6 -0
- package/dist-library/reactive-md-react-component-coordinate.js +21 -0
- package/dist-library/reactive-md-react-component-counter.js +10 -0
- package/dist-library/reactive-md-react-component-data-table.js +14 -0
- package/dist-library/reactive-md-react-component-date.js +10 -0
- package/dist-library/reactive-md-react-component-diagram.js +22 -0
- package/dist-library/reactive-md-react-component-disclosure.js +10 -0
- package/dist-library/reactive-md-react-component-edge.js +22 -0
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
- package/dist-library/reactive-md-react-component-gallery.js +10 -0
- package/dist-library/reactive-md-react-component-grid.js +10 -0
- package/dist-library/reactive-md-react-component-if.js +10 -0
- package/dist-library/reactive-md-react-component-input.js +10 -0
- package/dist-library/reactive-md-react-component-jump.js +10 -0
- package/dist-library/reactive-md-react-component-multi-select.js +10 -0
- package/dist-library/reactive-md-react-component-node.js +22 -0
- package/dist-library/reactive-md-react-component-number.js +10 -0
- package/dist-library/reactive-md-react-component-option.js +10 -0
- package/dist-library/reactive-md-react-component-panel.js +10 -0
- package/dist-library/reactive-md-react-component-plot.js +26 -0
- package/dist-library/reactive-md-react-component-progress.js +10 -0
- package/dist-library/reactive-md-react-component-quiz.js +10 -0
- package/dist-library/reactive-md-react-component-radio-group.js +10 -0
- package/dist-library/reactive-md-react-component-range-slider.js +10 -0
- package/dist-library/reactive-md-react-component-section.js +10 -0
- package/dist-library/reactive-md-react-component-select.js +10 -0
- package/dist-library/reactive-md-react-component-slider.js +10 -0
- package/dist-library/reactive-md-react-component-step.js +10 -0
- package/dist-library/reactive-md-react-component-steps.js +10 -0
- package/dist-library/reactive-md-react-component-tab.js +10 -0
- package/dist-library/reactive-md-react-component-table.js +14 -0
- package/dist-library/reactive-md-react-component-tabs.js +10 -0
- package/dist-library/reactive-md-react-component-text.js +10 -0
- package/dist-library/reactive-md-react-component-textarea.js +10 -0
- package/dist-library/reactive-md-react-component-timeline.js +14 -0
- package/dist-library/reactive-md-react-component-timer.js +10 -0
- package/dist-library/reactive-md-react-component-toggle.js +10 -0
- package/dist-library/reactive-md-react-component-tooltip.js +10 -0
- package/dist-library/reactive-md-react-component-validation.js +10 -0
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +44 -0
- package/dist-library/reactive-md-react-pack-data.js +21 -0
- package/dist-library/reactive-md-react-pack-layout.js +37 -0
- package/dist-library/reactive-md-react-pack-visuals.js +43 -0
- package/dist-library/reactive-md-react-packed.js +50 -0
- package/dist-library/reactive-md-react-server.js +29 -27
- package/dist-library/reactive-md-react-static-server.js +24 -0
- package/dist-library/reactive-md-react-static.js +1 -0
- package/dist-library/reactive-md-react-unstyled.js +15 -12
- package/dist-library/reactive-md-react.js +15 -12
- package/dist-library/reactive-md-scan.js +1 -0
- package/dist-library/reactive-md-sdk.js +23 -9
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +32 -32
- package/dist-library/reactive-md-testing.js +12 -12
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +401 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +97 -1554
- package/dist-library/registry-core-DxEaxhJ6.js +126 -0
- package/dist-library/render-nodes-B6j6Ip5I.js +9404 -0
- package/dist-library/requirements-C56sFIEs.js +157 -0
- package/dist-library/resources-6VaNgk-h.js +74 -0
- package/dist-library/rmd-pack-controls.css +1032 -0
- package/dist-library/rmd-pack-data.css +724 -0
- package/dist-library/rmd-pack-layout.css +1834 -0
- package/dist-library/rmd-pack-resource-chart.css +300 -0
- package/dist-library/rmd-pack-resource-controls.css +781 -0
- package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
- package/dist-library/rmd-pack-resource-diagram.css +106 -0
- package/dist-library/rmd-pack-resource-gallery.css +346 -0
- package/dist-library/rmd-pack-resource-graphics.css +516 -0
- package/dist-library/rmd-pack-resource-layout.css +1489 -0
- package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
- package/dist-library/rmd-pack-resource-mafs.css +129 -0
- package/dist-library/rmd-pack-resource-visual-base.css +224 -0
- package/dist-library/rmd-pack-visuals.css +1394 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/runtime-requirement-DzPO8raU.js +772 -0
- package/dist-library/schema-core-CDXfxdID.js +155 -0
- package/dist-library/sdk-core-CnE-n0Z7.js +1295 -0
- package/dist-library/{session-core-dxQCJBNa.js → session-core-C071yQwV.js} +147 -133
- package/dist-library/sha256-utf16-Bmandi_H.js +937 -0
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/shared-bTzN-F4g.js +3 -0
- package/dist-library/structural-views-30-YD_TJ.js +11 -0
- package/dist-library/table-surface-CfZn_tk-.js +13 -0
- package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
- package/dist-library/types/assemblies/default-config.d.ts +35 -0
- package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
- package/dist-library/types/assemblies/default-registry.d.ts +18 -0
- package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
- package/dist-library/types/authoring/catalog.d.ts +14 -2
- package/dist-library/types/authoring/extensions.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +4 -4
- package/dist-library/types/authoring/templates.d.ts +1 -1
- package/dist-library/types/compiler/index.d.ts +1 -0
- package/dist-library/types/compiler/session.d.ts +19 -0
- package/dist-library/types/compiler/standard.d.ts +1 -0
- package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -0
- package/dist-library/types/components/entries/accordion.d.ts +3 -0
- package/dist-library/types/components/entries/alert.d.ts +3 -0
- package/dist-library/types/components/entries/anchor.d.ts +3 -0
- package/dist-library/types/components/entries/badge.d.ts +3 -0
- package/dist-library/types/components/entries/card.d.ts +3 -0
- package/dist-library/types/components/entries/chart.d.ts +3 -0
- package/dist-library/types/components/entries/checkbox.d.ts +3 -0
- package/dist-library/types/components/entries/checklist.d.ts +3 -0
- package/dist-library/types/components/entries/choices.d.ts +3 -0
- package/dist-library/types/components/entries/column.d.ts +3 -0
- package/dist-library/types/components/entries/coordinate.d.ts +3 -0
- package/dist-library/types/components/entries/counter.d.ts +3 -0
- package/dist-library/types/components/entries/data-table.d.ts +3 -0
- package/dist-library/types/components/entries/date.d.ts +3 -0
- package/dist-library/types/components/entries/diagram.d.ts +3 -0
- package/dist-library/types/components/entries/disclosure.d.ts +3 -0
- package/dist-library/types/components/entries/edge.d.ts +3 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
- package/dist-library/types/components/entries/gallery.d.ts +3 -0
- package/dist-library/types/components/entries/grid.d.ts +3 -0
- package/dist-library/types/components/entries/if.d.ts +3 -0
- package/dist-library/types/components/entries/input.d.ts +3 -0
- package/dist-library/types/components/entries/jump.d.ts +3 -0
- package/dist-library/types/components/entries/multi-select.d.ts +3 -0
- package/dist-library/types/components/entries/node.d.ts +3 -0
- package/dist-library/types/components/entries/number.d.ts +3 -0
- package/dist-library/types/components/entries/option.d.ts +3 -0
- package/dist-library/types/components/entries/panel.d.ts +3 -0
- package/dist-library/types/components/entries/plot.d.ts +3 -0
- package/dist-library/types/components/entries/progress.d.ts +3 -0
- package/dist-library/types/components/entries/quiz.d.ts +3 -0
- package/dist-library/types/components/entries/radio-group.d.ts +3 -0
- package/dist-library/types/components/entries/range-slider.d.ts +3 -0
- package/dist-library/types/components/entries/section.d.ts +3 -0
- package/dist-library/types/components/entries/select.d.ts +3 -0
- package/dist-library/types/components/entries/slider.d.ts +3 -0
- package/dist-library/types/components/entries/step.d.ts +3 -0
- package/dist-library/types/components/entries/steps.d.ts +3 -0
- package/dist-library/types/components/entries/tab.d.ts +3 -0
- package/dist-library/types/components/entries/table.d.ts +3 -0
- package/dist-library/types/components/entries/tabs.d.ts +3 -0
- package/dist-library/types/components/entries/text.d.ts +3 -0
- package/dist-library/types/components/entries/textarea.d.ts +3 -0
- package/dist-library/types/components/entries/timeline.d.ts +3 -0
- package/dist-library/types/components/entries/timer.d.ts +3 -0
- package/dist-library/types/components/entries/toggle.d.ts +3 -0
- package/dist-library/types/components/entries/tooltip.d.ts +3 -0
- package/dist-library/types/components/entries/validation.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +6 -3
- package/dist-library/types/components/layout/structural-views.d.ts +3 -0
- package/dist-library/types/components/mount-preset.d.ts +2 -0
- package/dist-library/types/components/packs/controls.d.ts +2 -0
- package/dist-library/types/components/packs/data.d.ts +2 -0
- package/dist-library/types/components/packs/layout.d.ts +2 -0
- package/dist-library/types/components/packs/visuals.d.ts +2 -0
- package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
- package/dist-library/types/components/shared/table-surface.d.ts +10 -0
- package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -3
- package/dist-library/types/components/table/data-table-model.d.ts +141 -0
- package/dist-library/types/components/table/data-table.d.ts +3 -50
- package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +9 -2
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/index.d.ts +8 -0
- package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
- package/dist-library/types/contracts/localization.d.ts +6 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/runtime-types.d.ts +19 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- package/dist-library/types/local/compilation/cache-version.d.ts +1 -0
- package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
- package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +17 -5
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +9 -3
- package/dist-library/types/local/compilation/compiler-tables.d.ts +4 -2
- package/dist-library/types/local/compilation/compiler-validation.d.ts +14 -7
- package/dist-library/types/local/compilation/compiler-values.d.ts +2 -3
- package/dist-library/types/local/compilation/compiler.d.ts +1 -1
- package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
- package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
- package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
- package/dist-library/types/local/compilation/streaming.d.ts +1 -1
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +228 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/configuration/embedding.d.ts +4 -0
- package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
- package/dist-library/types/local/configuration/options-core.d.ts +8 -2
- package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +10 -4
- package/dist-library/types/local/observability-core.d.ts +20 -1
- package/dist-library/types/local/observability.d.ts +2 -0
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
- package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
- package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/performance-report.d.ts +70 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -0
- package/dist-library/types/local/transport/worker-handler.d.ts +3 -0
- package/dist-library/types/local/transport/worker-job.d.ts +12 -2
- package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
- package/dist-library/types/local/transport/worker.d.ts +14 -0
- package/dist-library/types/local/types.d.ts +70 -27
- package/dist-library/types/observability.d.ts +1 -0
- package/dist-library/types/presets/default-semantics.d.ts +1 -1
- package/dist-library/types/presets/identity.d.ts +1 -8
- package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
- package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
- package/dist-library/types/react/component-api.d.ts +24 -4
- package/dist-library/types/react/component-loader.d.ts +61 -0
- package/dist-library/types/react/component-primitives.d.ts +5 -5
- package/dist-library/types/react/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- package/dist-library/types/react/index.d.ts +9 -5
- package/dist-library/types/react/localization.d.ts +5 -6
- package/dist-library/types/react/minimal.d.ts +2 -2
- package/dist-library/types/react/package-core.d.ts +6 -0
- package/dist-library/types/react/packed.d.ts +17 -0
- package/dist-library/types/react/render-lifecycle.d.ts +9 -0
- package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
- package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
- package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
- package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
- package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
- package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
- package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
- package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
- package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
- package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
- package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +3 -3
- package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
- package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +5 -14
- package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
- package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
- package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
- package/dist-library/types/react/sdk-core.d.ts +15 -4
- package/dist-library/types/react/sdk.d.ts +2 -1
- package/dist-library/types/react/server.d.ts +3 -10
- package/dist-library/types/react/static-server.d.ts +12 -0
- package/dist-library/types/scan/index.d.ts +15 -0
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/config.d.ts +2 -35
- package/dist-library/types/sdk/default-identity.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +2 -1
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +8 -3
- package/dist-library/types/sdk/registry-core.d.ts +2 -2
- package/dist-library/types/sdk/registry.d.ts +2 -18
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +8 -2
- package/dist-library/types/sdk/version.d.ts +2 -0
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +5 -2
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Ib5kSScP.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-DAxuGOG2.js → version-4wzhbvDG.js} +24 -33
- package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
- package/dist-library/visual-helpers-UU6xiL8g.js +75 -0
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/visuals-CdHezgh5.js +3 -0
- package/dist-library/worker-3ldRjOEG.js +1632 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +127 -366
- package/docs/README-ch.md +104 -101
- package/docs/README.md +104 -101
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +146 -146
- package/docs/compatibility/compatibility-en.md +146 -146
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +170 -162
- package/docs/compatibility/source-versioning-en.md +171 -162
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +66 -66
- package/docs/development/component-development-en.md +66 -66
- package/docs/development/component-development-reference-ch.md +269 -253
- package/docs/development/component-development-reference-en.md +254 -238
- package/docs/development/component-protocol-ch.md +768 -748
- package/docs/development/component-protocol-en.md +770 -750
- package/docs/development/extension-tutorial-ch.md +308 -308
- package/docs/development/extension-tutorial-en.md +308 -308
- package/docs/development/performance-overview-ch.md +422 -422
- package/docs/development/performance-overview-en.md +422 -422
- package/docs/guides/local-guide-ch.md +621 -532
- package/docs/guides/local-guide-en.md +621 -532
- package/docs/integration/author-tools-ch.md +66 -64
- package/docs/integration/author-tools-en.md +66 -64
- package/docs/integration/compiler-ch.md +90 -49
- package/docs/integration/compiler-en.md +77 -36
- package/docs/integration/directory-discovery-en.md +1 -1
- package/docs/integration/editor-ch.md +295 -295
- package/docs/integration/editor-en.md +303 -303
- package/docs/integration/extension-sdk-ch.md +424 -394
- package/docs/integration/extension-sdk-en.md +409 -379
- package/docs/integration/local-integration-ch.md +648 -646
- package/docs/integration/local-integration-en.md +664 -662
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +299 -307
- package/docs/integration/shareable-export-en.md +301 -309
- package/docs/reference/diagnostics-counting-ch.md +127 -104
- package/docs/reference/diagnostics-counting-en.md +127 -104
- package/docs/reference/html-compatibility-ch.md +93 -93
- package/docs/reference/html-compatibility-en.md +95 -95
- package/docs/reference/local-interaction-syntax-ch.md +913 -724
- package/docs/reference/local-interaction-syntax-en.md +911 -722
- package/docs/reference/public-api-ch.md +134 -21
- package/docs/reference/public-api-en.md +134 -21
- package/docs/reference/theme-protocol-ch.md +198 -198
- package/docs/reference/theme-protocol-en.md +217 -217
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/docs/releases/release-0.4.0-ch.md +91 -91
- package/docs/releases/release-0.4.0-en.md +91 -91
- package/docs/releases/release-0.4.1-ch.md +25 -25
- package/docs/releases/release-0.4.1-en.md +25 -25
- package/docs/releases/release-0.5.0-ch.md +43 -43
- package/docs/releases/release-0.5.0-en.md +43 -43
- package/docs/releases/release-0.5.1-ch.md +41 -41
- package/docs/releases/release-0.5.1-en.md +41 -41
- package/docs/releases/release-0.5.2-ch.md +37 -37
- package/docs/releases/release-0.5.2-en.md +37 -37
- package/docs/releases/release-0.5.3-ch.md +26 -26
- package/docs/releases/release-0.5.3-en.md +26 -26
- package/docs/releases/release-0.6.0-ch.md +59 -59
- package/docs/releases/release-0.6.0-en.md +59 -59
- package/docs/releases/release-0.6.1-ch.md +29 -29
- package/docs/releases/release-0.6.1-en.md +29 -29
- package/docs/releases/release-0.7.0-ch.md +86 -86
- package/docs/releases/release-0.7.0-en.md +86 -86
- package/docs/releases/release-0.9.3-ch.md +45 -0
- package/docs/releases/release-0.9.3-en.md +45 -0
- package/examples/component-package/README-ch.md +101 -101
- package/examples/component-package/README.md +133 -133
- package/examples/conformance/README-ch.md +55 -55
- package/examples/conformance/README.md +55 -55
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/game-2048-package/LICENSE +21 -21
- package/examples/game-2048-package/NOTICES.md +11 -11
- package/examples/game-2048-package/README-ch.md +91 -91
- package/examples/game-2048-package/README.md +98 -98
- package/examples/game-2048-package/package.json +35 -35
- package/examples/game-2048-package/sample/document.reactive.md +17 -17
- package/examples/game-2048-package/scripts/build-export.mjs +44 -44
- package/examples/game-2048-package/scripts/build.mjs +130 -130
- package/examples/game-2048-package/scripts/verify.mjs +180 -180
- package/examples/game-2048-package/src/component.css +161 -161
- package/examples/game-2048-package/src/components.tsx +326 -326
- package/examples/game-2048-package/src/game-engine.ts +228 -228
- package/examples/game-2048-package/src/harness.tsx +34 -34
- package/examples/game-2048-package/src/manifest.ts +85 -85
- package/examples/game-2048-package/src/node-entry.ts +30 -30
- package/examples/game-2048-package/src/sample.ts +4 -4
- package/examples/game-2048-package/tsconfig.json +15 -15
- package/examples/integration/README-ch.md +114 -82
- package/examples/integration/README.md +114 -82
- package/examples/integration/chat-session/index.mjs +91 -0
- package/examples/integration/chat-session/package.json +10 -0
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/extension-sdk/README-ch.md +24 -24
- package/examples/integration/extension-sdk/README.md +24 -24
- package/examples/integration/static-embed/embed.mjs +44 -0
- package/examples/integration/static-embed/index.html +12 -0
- package/examples/integration/static-embed/main.mjs +24 -0
- package/examples/integration/static-embed/references.mjs +5 -0
- package/examples/integration/static-embed/render.mjs +10 -0
- package/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README-ch.md +76 -76
- package/examples/local/README.md +76 -76
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README-ch.md +22 -22
- package/examples/local/showcase/README.md +31 -31
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/examples/minimal-extension/README-ch.md +78 -78
- package/examples/minimal-extension/README.md +78 -78
- package/examples/minimal-extension/index.html +15 -15
- package/examples/minimal-extension/package.json +26 -26
- package/examples/minimal-extension/sample/document.reactive.md +10 -10
- package/examples/minimal-extension/scripts/build.mjs +32 -32
- package/examples/minimal-extension/scripts/export.mjs +72 -72
- package/examples/minimal-extension/scripts/test-node.mjs +75 -75
- package/examples/minimal-extension/src/extension.tsx +90 -90
- package/examples/minimal-extension/src/preview.tsx +12 -12
- package/examples/minimal-extension/src/source.ts +4 -4
- package/examples/minimal-extension/tsconfig.json +14 -14
- package/examples/sci-fi-theme/README-ch.md +133 -133
- package/examples/sci-fi-theme/README.md +148 -148
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
- package/examples/sci-fi-theme/demo/demo.css +638 -638
- package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
- package/examples/sci-fi-theme/demo/index.html +13 -13
- package/examples/sci-fi-theme/demo/main.tsx +215 -215
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
- package/examples/sci-fi-theme/docs/design-system.md +474 -474
- package/examples/sci-fi-theme/package.json +28 -28
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
- package/examples/sci-fi-theme/src/components.css +2370 -2370
- package/examples/sci-fi-theme/src/index.ts +6 -6
- package/examples/sci-fi-theme/src/notch.css +142 -142
- package/examples/sci-fi-theme/src/sci-fi.css +7 -7
- package/examples/sci-fi-theme/src/theme.ts +39 -39
- package/examples/sci-fi-theme/tsconfig.json +20 -20
- package/examples/sci-fi-theme/vite.config.ts +24 -24
- package/examples/tetris-package/LICENSE +21 -21
- package/examples/tetris-package/NOTICES.md +11 -11
- package/examples/tetris-package/README-ch.md +91 -91
- package/examples/tetris-package/README.md +95 -95
- package/examples/tetris-package/package.json +35 -35
- package/examples/tetris-package/sample/document.reactive.md +16 -16
- package/examples/tetris-package/scripts/build-export.mjs +44 -44
- package/examples/tetris-package/scripts/build.mjs +130 -130
- package/examples/tetris-package/scripts/verify.mjs +173 -173
- package/examples/tetris-package/src/component.css +145 -145
- package/examples/tetris-package/src/components.tsx +334 -334
- package/examples/tetris-package/src/harness.tsx +34 -34
- package/examples/tetris-package/src/manifests.ts +93 -93
- package/examples/tetris-package/src/node-entry.ts +16 -16
- package/examples/tetris-package/src/sample.ts +4 -4
- package/examples/tetris-package/src/tetris-engine.ts +325 -325
- package/examples/tetris-package/tsconfig.json +15 -15
- package/package.json +66 -2
- package/dist-library/LocalDocumentView-BuqgJZEY.js +0 -109
- package/dist-library/LocalReactiveDocumentCore-CWBe4Mm5.js +0 -275
- package/dist-library/authoring-Ci_KzJ0q.js +0 -892
- package/dist-library/compile-Dx6Uw3D9.js +0 -1249
- package/dist-library/compiler-dxLPB9Ym.js +0 -86
- package/dist-library/config-validation-D3D7Dy2J.js +0 -586
- package/dist-library/controls-DoZyLCrV.js +0 -6740
- package/dist-library/data-table-8-3F15Jf.js +0 -296
- package/dist-library/layout-BBB2VF0S.js +0 -562
- package/dist-library/mount-preset-DMZ5wd3t.js +0 -13
- package/dist-library/options-BBp9IcHm.js +0 -121
- package/dist-library/package-core-K5xesGqy.js +0 -117
- package/dist-library/parser-standard-CBA1-hdG.js +0 -9630
- package/dist-library/plugin-packs-Bh1HhLym.js +0 -19
- package/dist-library/preset-core-DeZPA8IE.js +0 -1298
- package/dist-library/props-sJ8vk0cr.js +0 -183
- package/dist-library/react-0DCh-Mar.js +0 -7
- package/dist-library/registry-core-C9xOunaw.js +0 -479
- package/dist-library/resources-B0x_w3s9.js +0 -229
- package/dist-library/runtime-BpQdZmFI.js +0 -1288
- package/dist-library/schema-BryM_VRW.js +0 -40
- package/dist-library/sdk-core-ChslheKs.js +0 -1167
- package/dist-library/shareable-B8xMoGEa.js +0 -814
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
- package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/validation-B3RI0xOk.js +0 -1123
- package/dist-library/visual-frame-_rcd5HUv.js +0 -48
- package/dist-library/visuals-DkDhNdEZ.js +0 -72572
- /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
- /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
- /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
|
@@ -0,0 +1,4872 @@
|
|
|
1
|
+
import { S as e } from "./validation-DRuW0Wl9.js";
|
|
2
|
+
import { A as t, I as n, L as r, M as i, N as a, O as o, P as s, S as c, _ as l, c as u, d, f, g as p, h as m, j as h, k as g, m as _, p as v, u as y, v as b, w as x, x as S, y as C } from "./sha256-utf16-Bmandi_H.js";
|
|
3
|
+
import { a as w, r as T } from "./schema-core-CDXfxdID.js";
|
|
4
|
+
import { a as E, n as D, o as O, s as k } from "./dist-Cueh1Psp.js";
|
|
5
|
+
// src/local/html/html-table.ts
|
|
6
|
+
var ee = {
|
|
7
|
+
table: [
|
|
8
|
+
"caption",
|
|
9
|
+
"colgroup",
|
|
10
|
+
"thead",
|
|
11
|
+
"tbody",
|
|
12
|
+
"tfoot"
|
|
13
|
+
],
|
|
14
|
+
colgroup: ["col"],
|
|
15
|
+
thead: ["tr"],
|
|
16
|
+
tbody: ["tr"],
|
|
17
|
+
tfoot: ["tr"],
|
|
18
|
+
tr: ["th", "td"],
|
|
19
|
+
col: []
|
|
20
|
+
};
|
|
21
|
+
function te(e, t, n) {
|
|
22
|
+
let r = /^<(\/?)([A-Za-z][A-Za-z0-9_-]*)(?=[\s/>])/.exec(e.slice(t, t + 80));
|
|
23
|
+
if (!r) return null;
|
|
24
|
+
let i = "";
|
|
25
|
+
for (let a = t + r[0].length; a < n; a++) {
|
|
26
|
+
let t = e[a];
|
|
27
|
+
if (i) t === i && (i = "");
|
|
28
|
+
else if (t === "\"" || t === "'") i = t;
|
|
29
|
+
else if (t === ">") return {
|
|
30
|
+
name: r[2].toLowerCase(),
|
|
31
|
+
closing: !!r[1],
|
|
32
|
+
end: a + 1
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function ne(e, t, n) {
|
|
38
|
+
let r = "", i = "";
|
|
39
|
+
if (e.startsWith("\\(", t) ? (r = "\\(", i = "\\)") : e.startsWith("\\[", t) ? (r = "\\[", i = "\\]") : e[t] === "$" && (r = e[t + 1] === "$" ? "$$" : "$", i = r), !r) return null;
|
|
40
|
+
for (let a = t + r.length; a < n; a++) {
|
|
41
|
+
if (e.startsWith(i, a)) return r === "$" && (/^\s|\s$/.test(e.slice(t + 1, a)) || /\d/.test(e[a + 1] ?? "")) ? null : a + i.length;
|
|
42
|
+
if (e[a] === "\\" && a++, r === "$" && e[a] === "\n") return null;
|
|
43
|
+
}
|
|
44
|
+
return r === "$" ? null : n;
|
|
45
|
+
}
|
|
46
|
+
function re(t, n, r, i) {
|
|
47
|
+
let a = te(t, n, r);
|
|
48
|
+
if (!a || a.closing || a.name !== "table") return null;
|
|
49
|
+
let o = 0, s = 0, c = r, l = !1, u = !1, d = [];
|
|
50
|
+
for (let a = n; a < r;) {
|
|
51
|
+
let n = ne(t, a, r);
|
|
52
|
+
if (n !== null) {
|
|
53
|
+
a = n;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
let f = i.shield(a, r);
|
|
57
|
+
if (f !== null) {
|
|
58
|
+
a = f;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (t.startsWith("<!--", a)) {
|
|
62
|
+
let e = t.indexOf("-->", a + 4);
|
|
63
|
+
a = e < 0 ? r : Math.min(r, e + 3);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (t[a] !== "<") {
|
|
67
|
+
a++;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
let p = te(t, a, r);
|
|
71
|
+
if (!p) a++;
|
|
72
|
+
else if (!p.closing && [
|
|
73
|
+
"pre",
|
|
74
|
+
"code",
|
|
75
|
+
"script",
|
|
76
|
+
"style"
|
|
77
|
+
].includes(p.name)) {
|
|
78
|
+
let e = RegExp(`</${p.name}\\s*>`, "gi");
|
|
79
|
+
e.lastIndex = p.end;
|
|
80
|
+
let n = e.exec(t);
|
|
81
|
+
a = n && n.index < r ? n.index + n[0].length : r;
|
|
82
|
+
} else {
|
|
83
|
+
if (e.has(p.name) && (d.push({
|
|
84
|
+
start: a,
|
|
85
|
+
end: p.end
|
|
86
|
+
}), s++, p.name !== "table" && (u = !0), u && i.budget(a, s), p.name === "table" && (o += p.closing ? -1 : 1, o === 0))) {
|
|
87
|
+
c = p.end, l = !0;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
a = p.end;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (!u) return null;
|
|
94
|
+
l || i.problem("unclosed", n, c, "table");
|
|
95
|
+
let f = t.slice(n, c).replace(/[^\r\n]/g, " ").split("");
|
|
96
|
+
for (let e of d) for (let r = e.start; r < e.end; r++) f[r - n] = t[r];
|
|
97
|
+
let p = D(f.join(""), { sourceCodeLocationInfo: !0 }).childNodes.find((e) => e.tagName === "table");
|
|
98
|
+
if (!p) return i.problem("structure", n, c), {
|
|
99
|
+
node: i.node("htmlTable", n, c, { children: [] }),
|
|
100
|
+
end: c
|
|
101
|
+
};
|
|
102
|
+
let m = (e) => {
|
|
103
|
+
let t = e.sourceCodeLocation;
|
|
104
|
+
if (t) return {
|
|
105
|
+
start: n + t.startOffset,
|
|
106
|
+
end: n + t.endOffset
|
|
107
|
+
};
|
|
108
|
+
let r = (e.childNodes ?? []).filter((e) => e.tagName);
|
|
109
|
+
return r.length ? {
|
|
110
|
+
start: m(r[0]).start,
|
|
111
|
+
end: m(r.at(-1)).end
|
|
112
|
+
} : {
|
|
113
|
+
start: n,
|
|
114
|
+
end: n
|
|
115
|
+
};
|
|
116
|
+
}, h = (e, n) => !t.slice(e, n).replace(/<!--[\s\S]*?-->/g, "").trim(), g = (e, t) => {
|
|
117
|
+
let r = e.tagName, a = e.sourceCodeLocation, o = m(e);
|
|
118
|
+
if (t > 120) return i.problem("structure", o.start, o.end, r), i.node("htmlTableElement", o.start, o.end, {
|
|
119
|
+
name: r,
|
|
120
|
+
children: []
|
|
121
|
+
});
|
|
122
|
+
let s = a?.startTag ? i.attributes(r, n + a.startTag.startOffset, n + a.startTag.endOffset) : {}, c, l = a?.startTag ? n + a.startTag.endOffset : o.start, u = a?.endTag ? n + a.endTag.startOffset : o.end, d = (e.childNodes ?? []).filter((e) => e.tagName);
|
|
123
|
+
if (r === "table" && [
|
|
124
|
+
"caption",
|
|
125
|
+
"thead",
|
|
126
|
+
"tfoot"
|
|
127
|
+
].some((e) => d.filter((t) => t.tagName === e).length > 1) && i.problem("structure", o.start, o.end, r), r === "colgroup" && s.span !== void 0 && d.length > 0 && i.problem("structure", o.start, o.end, r), r === "td" || r === "th" || r === "caption") c = i.content(l, u);
|
|
128
|
+
else {
|
|
129
|
+
c = [];
|
|
130
|
+
let e = l;
|
|
131
|
+
for (let n of d) {
|
|
132
|
+
let a = m(n);
|
|
133
|
+
h(e, a.start) || i.problem("mixed", e, a.start, r), (ee[r] ?? []).includes(n.tagName) ? c.push(g(n, t + 1)) : i.problem("structure", a.start, a.end, r), e = a.end;
|
|
134
|
+
}
|
|
135
|
+
h(e, u) || i.problem("mixed", e, u, r);
|
|
136
|
+
}
|
|
137
|
+
return i.node(r === "table" ? "htmlTable" : "htmlTableElement", o.start, o.end, {
|
|
138
|
+
name: r,
|
|
139
|
+
attrs: s,
|
|
140
|
+
children: c
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
return {
|
|
144
|
+
node: g(p, 0),
|
|
145
|
+
end: c
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// node_modules/@lezer/common/dist/index.js
|
|
149
|
+
var ie = 1024, ae = 0, oe = class {
|
|
150
|
+
constructor(e, t) {
|
|
151
|
+
this.from = e, this.to = t;
|
|
152
|
+
}
|
|
153
|
+
}, A = class {
|
|
154
|
+
constructor(e = {}) {
|
|
155
|
+
this.id = ae++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
|
|
156
|
+
throw Error("This node type doesn't define a deserialize function");
|
|
157
|
+
}), this.combine = e.combine || null;
|
|
158
|
+
}
|
|
159
|
+
add(e) {
|
|
160
|
+
if (this.perNode) throw RangeError("Can't add per-node props to node types");
|
|
161
|
+
return typeof e != "function" && (e = j.match(e)), (t) => {
|
|
162
|
+
let n = e(t);
|
|
163
|
+
return n === void 0 ? null : [this, n];
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
A.closedBy = new A({ deserialize: (e) => e.split(" ") }), A.openedBy = new A({ deserialize: (e) => e.split(" ") }), A.group = new A({ deserialize: (e) => e.split(" ") }), A.isolate = new A({ deserialize: (e) => {
|
|
168
|
+
if (e && e != "rtl" && e != "ltr" && e != "auto") throw RangeError("Invalid value for isolate: " + e);
|
|
169
|
+
return e || "auto";
|
|
170
|
+
} }), A.contextHash = new A({ perNode: !0 }), A.lookAhead = new A({ perNode: !0 }), A.mounted = new A({ perNode: !0 });
|
|
171
|
+
var se = class {
|
|
172
|
+
constructor(e, t, n, r = !1) {
|
|
173
|
+
this.tree = e, this.overlay = t, this.parser = n, this.bracketed = r;
|
|
174
|
+
}
|
|
175
|
+
static get(e) {
|
|
176
|
+
return e && e.props && e.props[A.mounted.id];
|
|
177
|
+
}
|
|
178
|
+
}, ce = Object.create(null), j = class e {
|
|
179
|
+
constructor(e, t, n, r = 0) {
|
|
180
|
+
this.name = e, this.props = t, this.id = n, this.flags = r;
|
|
181
|
+
}
|
|
182
|
+
static define(t) {
|
|
183
|
+
let n = t.props && t.props.length ? Object.create(null) : ce, r = +!!t.top | (t.skipped ? 2 : 0) | (t.error ? 4 : 0) | (t.name == null ? 8 : 0), i = new e(t.name || "", n, t.id, r);
|
|
184
|
+
if (t.props) {
|
|
185
|
+
for (let e of t.props) if (Array.isArray(e) || (e = e(i)), e) {
|
|
186
|
+
if (e[0].perNode) throw RangeError("Can't store a per-node prop on a node type");
|
|
187
|
+
n[e[0].id] = e[1];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return i;
|
|
191
|
+
}
|
|
192
|
+
prop(e) {
|
|
193
|
+
return this.props[e.id];
|
|
194
|
+
}
|
|
195
|
+
get isTop() {
|
|
196
|
+
return (this.flags & 1) > 0;
|
|
197
|
+
}
|
|
198
|
+
get isSkipped() {
|
|
199
|
+
return (this.flags & 2) > 0;
|
|
200
|
+
}
|
|
201
|
+
get isError() {
|
|
202
|
+
return (this.flags & 4) > 0;
|
|
203
|
+
}
|
|
204
|
+
get isAnonymous() {
|
|
205
|
+
return (this.flags & 8) > 0;
|
|
206
|
+
}
|
|
207
|
+
is(e) {
|
|
208
|
+
if (typeof e == "string") {
|
|
209
|
+
if (this.name == e) return !0;
|
|
210
|
+
let t = this.prop(A.group);
|
|
211
|
+
return t ? t.indexOf(e) > -1 : !1;
|
|
212
|
+
}
|
|
213
|
+
return this.id == e;
|
|
214
|
+
}
|
|
215
|
+
static match(e) {
|
|
216
|
+
let t = Object.create(null);
|
|
217
|
+
for (let n in e) for (let r of n.split(" ")) t[r] = e[n];
|
|
218
|
+
return (e) => {
|
|
219
|
+
for (let n = e.prop(A.group), r = -1; r < (n ? n.length : 0); r++) {
|
|
220
|
+
let i = t[r < 0 ? e.name : n[r]];
|
|
221
|
+
if (i) return i;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
j.none = new j("", Object.create(null), 0, 8);
|
|
227
|
+
var le = class e {
|
|
228
|
+
constructor(e) {
|
|
229
|
+
this.types = e;
|
|
230
|
+
for (let t = 0; t < e.length; t++) if (e[t].id != t) throw RangeError("Node type ids should correspond to array positions when creating a node set");
|
|
231
|
+
}
|
|
232
|
+
extend(...t) {
|
|
233
|
+
let n = [];
|
|
234
|
+
for (let e of this.types) {
|
|
235
|
+
let r = null;
|
|
236
|
+
for (let n of t) {
|
|
237
|
+
let t = n(e);
|
|
238
|
+
if (t) {
|
|
239
|
+
r ||= Object.assign({}, e.props);
|
|
240
|
+
let n = t[1], i = t[0];
|
|
241
|
+
i.combine && i.id in r && (n = i.combine(r[i.id], n)), r[i.id] = n;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
n.push(r ? new j(e.name, r, e.id, e.flags) : e);
|
|
245
|
+
}
|
|
246
|
+
return new e(n);
|
|
247
|
+
}
|
|
248
|
+
}, ue = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), M;
|
|
249
|
+
(function(e) {
|
|
250
|
+
e[e.ExcludeBuffers = 1] = "ExcludeBuffers", e[e.IncludeAnonymous = 2] = "IncludeAnonymous", e[e.IgnoreMounts = 4] = "IgnoreMounts", e[e.IgnoreOverlays = 8] = "IgnoreOverlays", e[e.EnterBracketed = 16] = "EnterBracketed";
|
|
251
|
+
})(M ||= {});
|
|
252
|
+
var N = class e {
|
|
253
|
+
constructor(e, t, n, r, i) {
|
|
254
|
+
if (this.type = e, this.children = t, this.positions = n, this.length = r, this.props = null, i && i.length) {
|
|
255
|
+
this.props = Object.create(null);
|
|
256
|
+
for (let [e, t] of i) this.props[typeof e == "number" ? e : e.id] = t;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
toString() {
|
|
260
|
+
let e = se.get(this);
|
|
261
|
+
if (e && !e.overlay) return e.tree.toString();
|
|
262
|
+
let t = "";
|
|
263
|
+
for (let e of this.children) {
|
|
264
|
+
let n = e.toString();
|
|
265
|
+
n && (t && (t += ","), t += n);
|
|
266
|
+
}
|
|
267
|
+
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (t.length ? "(" + t + ")" : "") : t;
|
|
268
|
+
}
|
|
269
|
+
cursor(e = 0) {
|
|
270
|
+
return new we(this.topNode, e);
|
|
271
|
+
}
|
|
272
|
+
cursorAt(e, t = 0, n = 0) {
|
|
273
|
+
let r = new we(ue.get(this) || this.topNode);
|
|
274
|
+
return r.moveTo(e, t), ue.set(this, r._tree), r;
|
|
275
|
+
}
|
|
276
|
+
get topNode() {
|
|
277
|
+
return new P(this, 0, 0, null);
|
|
278
|
+
}
|
|
279
|
+
resolve(e, t = 0) {
|
|
280
|
+
let n = he(ue.get(this) || this.topNode, e, t, !1);
|
|
281
|
+
return ue.set(this, n), n;
|
|
282
|
+
}
|
|
283
|
+
resolveInner(e, t = 0) {
|
|
284
|
+
let n = he(de.get(this) || this.topNode, e, t, !0);
|
|
285
|
+
return de.set(this, n), n;
|
|
286
|
+
}
|
|
287
|
+
resolveStack(e, t = 0) {
|
|
288
|
+
return Ce(this, e, t);
|
|
289
|
+
}
|
|
290
|
+
iterate(e) {
|
|
291
|
+
let { enter: t, leave: n, from: r = 0, to: i = this.length } = e, a = e.mode || 0, o = (a & M.IncludeAnonymous) > 0;
|
|
292
|
+
for (let e = this.cursor(a | M.IncludeAnonymous);;) {
|
|
293
|
+
let a = !1;
|
|
294
|
+
if (e.from <= i && e.to >= r && (!o && e.type.isAnonymous || t(e) !== !1)) {
|
|
295
|
+
if (e.firstChild()) continue;
|
|
296
|
+
a = !0;
|
|
297
|
+
}
|
|
298
|
+
for (; a && n && (o || !e.type.isAnonymous) && n(e), !e.nextSibling();) {
|
|
299
|
+
if (!e.parent()) return;
|
|
300
|
+
a = !0;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
prop(e) {
|
|
305
|
+
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
306
|
+
}
|
|
307
|
+
get propValues() {
|
|
308
|
+
let e = [];
|
|
309
|
+
if (this.props) for (let t in this.props) e.push([+t, this.props[t]]);
|
|
310
|
+
return e;
|
|
311
|
+
}
|
|
312
|
+
balance(t = {}) {
|
|
313
|
+
return this.children.length <= 8 ? this : ke(j.none, this.children, this.positions, 0, this.children.length, 0, this.length, (t, n, r) => new e(this.type, t, n, r, this.propValues), t.makeTree || ((t, n, r) => new e(j.none, t, n, r)));
|
|
314
|
+
}
|
|
315
|
+
static build(e) {
|
|
316
|
+
return Ee(e);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
N.empty = new N(j.none, [], [], 0);
|
|
320
|
+
var fe = class e {
|
|
321
|
+
constructor(e, t) {
|
|
322
|
+
this.buffer = e, this.index = t;
|
|
323
|
+
}
|
|
324
|
+
get id() {
|
|
325
|
+
return this.buffer[this.index - 4];
|
|
326
|
+
}
|
|
327
|
+
get start() {
|
|
328
|
+
return this.buffer[this.index - 3];
|
|
329
|
+
}
|
|
330
|
+
get end() {
|
|
331
|
+
return this.buffer[this.index - 2];
|
|
332
|
+
}
|
|
333
|
+
get size() {
|
|
334
|
+
return this.buffer[this.index - 1];
|
|
335
|
+
}
|
|
336
|
+
get pos() {
|
|
337
|
+
return this.index;
|
|
338
|
+
}
|
|
339
|
+
next() {
|
|
340
|
+
this.index -= 4;
|
|
341
|
+
}
|
|
342
|
+
fork() {
|
|
343
|
+
return new e(this.buffer, this.index);
|
|
344
|
+
}
|
|
345
|
+
}, pe = class e {
|
|
346
|
+
constructor(e, t, n) {
|
|
347
|
+
this.buffer = e, this.length = t, this.set = n;
|
|
348
|
+
}
|
|
349
|
+
get type() {
|
|
350
|
+
return j.none;
|
|
351
|
+
}
|
|
352
|
+
toString() {
|
|
353
|
+
let e = [];
|
|
354
|
+
for (let t = 0; t < this.buffer.length;) e.push(this.childString(t)), t = this.buffer[t + 3];
|
|
355
|
+
return e.join(",");
|
|
356
|
+
}
|
|
357
|
+
childString(e) {
|
|
358
|
+
let t = this.buffer[e], n = this.buffer[e + 3], r = this.set.types[t], i = r.name;
|
|
359
|
+
if (/\W/.test(i) && !r.isError && (i = JSON.stringify(i)), e += 4, n == e) return i;
|
|
360
|
+
let a = [];
|
|
361
|
+
for (; e < n;) a.push(this.childString(e)), e = this.buffer[e + 3];
|
|
362
|
+
return i + "(" + a.join(",") + ")";
|
|
363
|
+
}
|
|
364
|
+
findChild(e, t, n, r, i) {
|
|
365
|
+
let { buffer: a } = this, o = -1;
|
|
366
|
+
for (let s = e; s != t && !(me(i, r, a[s + 1], a[s + 2]) && (o = s, n > 0)); s = a[s + 3]);
|
|
367
|
+
return o;
|
|
368
|
+
}
|
|
369
|
+
slice(t, n, r) {
|
|
370
|
+
let i = this.buffer, a = new Uint16Array(n - t), o = 0;
|
|
371
|
+
for (let e = t, s = 0; e < n;) {
|
|
372
|
+
a[s++] = i[e++], a[s++] = i[e++] - r;
|
|
373
|
+
let n = a[s++] = i[e++] - r;
|
|
374
|
+
a[s++] = i[e++] - t, o = Math.max(o, n);
|
|
375
|
+
}
|
|
376
|
+
return new e(a, o, this.set);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
function me(e, t, n, r) {
|
|
380
|
+
switch (e) {
|
|
381
|
+
case -2: return n < t;
|
|
382
|
+
case -1: return r >= t && n < t;
|
|
383
|
+
case 0: return n < t && r > t;
|
|
384
|
+
case 1: return n <= t && r > t;
|
|
385
|
+
case 2: return r > t;
|
|
386
|
+
case 4: return !0;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function he(e, t, n, r) {
|
|
390
|
+
for (; e.from == e.to || (n < 1 ? e.from >= t : e.from > t) || (n > -1 ? e.to <= t : e.to < t);) {
|
|
391
|
+
let t = !r && e instanceof P && e.index < 0 ? null : e.parent;
|
|
392
|
+
if (!t) return e;
|
|
393
|
+
e = t;
|
|
394
|
+
}
|
|
395
|
+
let i = r ? 0 : M.IgnoreOverlays;
|
|
396
|
+
if (r) for (let r = e, a = r.parent; a; r = a, a = r.parent) r instanceof P && r.index < 0 && a.enter(t, n, i)?.from != r.from && (e = a);
|
|
397
|
+
for (;;) {
|
|
398
|
+
let r = e.enter(t, n, i);
|
|
399
|
+
if (!r) return e;
|
|
400
|
+
e = r;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
var ge = class {
|
|
404
|
+
cursor(e = 0) {
|
|
405
|
+
return new we(this, e);
|
|
406
|
+
}
|
|
407
|
+
getChild(e, t = null, n = null) {
|
|
408
|
+
let r = _e(this, e, t, n);
|
|
409
|
+
return r.length ? r[0] : null;
|
|
410
|
+
}
|
|
411
|
+
getChildren(e, t = null, n = null) {
|
|
412
|
+
return _e(this, e, t, n);
|
|
413
|
+
}
|
|
414
|
+
resolve(e, t = 0) {
|
|
415
|
+
return he(this, e, t, !1);
|
|
416
|
+
}
|
|
417
|
+
resolveInner(e, t = 0) {
|
|
418
|
+
return he(this, e, t, !0);
|
|
419
|
+
}
|
|
420
|
+
matchContext(e) {
|
|
421
|
+
return ve(this.parent, e);
|
|
422
|
+
}
|
|
423
|
+
enterUnfinishedNodesBefore(e) {
|
|
424
|
+
let t = this.childBefore(e), n = this;
|
|
425
|
+
for (; t;) {
|
|
426
|
+
let e = t.lastChild;
|
|
427
|
+
if (!e || e.to != t.to) break;
|
|
428
|
+
e.type.isError && e.from == e.to ? (n = t, t = e.prevSibling) : t = e;
|
|
429
|
+
}
|
|
430
|
+
return n;
|
|
431
|
+
}
|
|
432
|
+
get node() {
|
|
433
|
+
return this;
|
|
434
|
+
}
|
|
435
|
+
get next() {
|
|
436
|
+
return this.parent;
|
|
437
|
+
}
|
|
438
|
+
}, P = class e extends ge {
|
|
439
|
+
constructor(e, t, n, r) {
|
|
440
|
+
super(), this._tree = e, this.from = t, this.index = n, this._parent = r;
|
|
441
|
+
}
|
|
442
|
+
get type() {
|
|
443
|
+
return this._tree.type;
|
|
444
|
+
}
|
|
445
|
+
get name() {
|
|
446
|
+
return this._tree.type.name;
|
|
447
|
+
}
|
|
448
|
+
get to() {
|
|
449
|
+
return this.from + this._tree.length;
|
|
450
|
+
}
|
|
451
|
+
nextChild(t, n, r, i, a = 0) {
|
|
452
|
+
for (let o = this;;) {
|
|
453
|
+
for (let { children: s, positions: c } = o._tree, l = n > 0 ? s.length : -1; t != l; t += n) {
|
|
454
|
+
let l = s[t], u = c[t] + o.from, d;
|
|
455
|
+
if (a & M.EnterBracketed && l instanceof N && (d = se.get(l)) && !d.overlay && d.bracketed && r >= u && r <= u + l.length || me(i, r, u, u + l.length)) {
|
|
456
|
+
if (l instanceof pe) {
|
|
457
|
+
if (a & M.ExcludeBuffers) continue;
|
|
458
|
+
let e = l.findChild(0, l.buffer.length, n, r - u, i);
|
|
459
|
+
if (e > -1) return new be(new ye(o, l, t, u), null, e);
|
|
460
|
+
} else if (a & M.IncludeAnonymous || !l.type.isAnonymous || Te(l)) {
|
|
461
|
+
let s;
|
|
462
|
+
if (!(a & M.IgnoreMounts) && (s = se.get(l)) && !s.overlay) return new e(s.tree, u, t, o);
|
|
463
|
+
let c = new e(l, u, t, o);
|
|
464
|
+
return a & M.IncludeAnonymous || !c.type.isAnonymous ? c : c.nextChild(n < 0 ? l.children.length - 1 : 0, n, r, i, a);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (a & M.IncludeAnonymous || !o.type.isAnonymous || (t = o.index >= 0 ? o.index + n : n < 0 ? -1 : o._parent._tree.children.length, o = o._parent, !o)) return null;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
get firstChild() {
|
|
472
|
+
return this.nextChild(0, 1, 0, 4);
|
|
473
|
+
}
|
|
474
|
+
get lastChild() {
|
|
475
|
+
return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
|
|
476
|
+
}
|
|
477
|
+
childAfter(e) {
|
|
478
|
+
return this.nextChild(0, 1, e, 2);
|
|
479
|
+
}
|
|
480
|
+
childBefore(e) {
|
|
481
|
+
return this.nextChild(this._tree.children.length - 1, -1, e, -2);
|
|
482
|
+
}
|
|
483
|
+
prop(e) {
|
|
484
|
+
return this._tree.prop(e);
|
|
485
|
+
}
|
|
486
|
+
enter(t, n, r = 0) {
|
|
487
|
+
let i;
|
|
488
|
+
if (!(r & M.IgnoreOverlays) && (i = se.get(this._tree)) && i.overlay) {
|
|
489
|
+
let a = t - this.from, o = r & M.EnterBracketed && i.bracketed;
|
|
490
|
+
for (let { from: t, to: r } of i.overlay) if ((n > 0 || o ? t <= a : t < a) && (n < 0 || o ? r >= a : r > a)) return new e(i.tree, i.overlay[0].from + this.from, -1, this);
|
|
491
|
+
}
|
|
492
|
+
return this.nextChild(0, 1, t, n, r);
|
|
493
|
+
}
|
|
494
|
+
nextSignificantParent() {
|
|
495
|
+
let e = this;
|
|
496
|
+
for (; e.type.isAnonymous && e._parent;) e = e._parent;
|
|
497
|
+
return e;
|
|
498
|
+
}
|
|
499
|
+
get parent() {
|
|
500
|
+
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
501
|
+
}
|
|
502
|
+
get nextSibling() {
|
|
503
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
|
|
504
|
+
}
|
|
505
|
+
get prevSibling() {
|
|
506
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
|
|
507
|
+
}
|
|
508
|
+
get tree() {
|
|
509
|
+
return this._tree;
|
|
510
|
+
}
|
|
511
|
+
toTree() {
|
|
512
|
+
return this._tree;
|
|
513
|
+
}
|
|
514
|
+
toString() {
|
|
515
|
+
return this._tree.toString();
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
function _e(e, t, n, r) {
|
|
519
|
+
let i = e.cursor(), a = [];
|
|
520
|
+
if (!i.firstChild()) return a;
|
|
521
|
+
if (n != null) {
|
|
522
|
+
for (let e = !1; !e;) if (e = i.type.is(n), !i.nextSibling()) return a;
|
|
523
|
+
}
|
|
524
|
+
for (;;) {
|
|
525
|
+
if (r != null && i.type.is(r)) return a;
|
|
526
|
+
if (i.type.is(t) && a.push(i.node), !i.nextSibling()) return r == null ? a : [];
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function ve(e, t, n = t.length - 1) {
|
|
530
|
+
for (let r = e; n >= 0; r = r.parent) {
|
|
531
|
+
if (!r) return !1;
|
|
532
|
+
if (!r.type.isAnonymous) {
|
|
533
|
+
if (t[n] && t[n] != r.name) return !1;
|
|
534
|
+
n--;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return !0;
|
|
538
|
+
}
|
|
539
|
+
var ye = class {
|
|
540
|
+
constructor(e, t, n, r) {
|
|
541
|
+
this.parent = e, this.buffer = t, this.index = n, this.start = r;
|
|
542
|
+
}
|
|
543
|
+
}, be = class e extends ge {
|
|
544
|
+
get name() {
|
|
545
|
+
return this.type.name;
|
|
546
|
+
}
|
|
547
|
+
get from() {
|
|
548
|
+
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
549
|
+
}
|
|
550
|
+
get to() {
|
|
551
|
+
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
552
|
+
}
|
|
553
|
+
constructor(e, t, n) {
|
|
554
|
+
super(), this.context = e, this._parent = t, this.index = n, this.type = e.buffer.set.types[e.buffer.buffer[n]];
|
|
555
|
+
}
|
|
556
|
+
child(t, n, r) {
|
|
557
|
+
let { buffer: i } = this.context, a = i.findChild(this.index + 4, i.buffer[this.index + 3], t, n - this.context.start, r);
|
|
558
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
559
|
+
}
|
|
560
|
+
get firstChild() {
|
|
561
|
+
return this.child(1, 0, 4);
|
|
562
|
+
}
|
|
563
|
+
get lastChild() {
|
|
564
|
+
return this.child(-1, 0, 4);
|
|
565
|
+
}
|
|
566
|
+
childAfter(e) {
|
|
567
|
+
return this.child(1, e, 2);
|
|
568
|
+
}
|
|
569
|
+
childBefore(e) {
|
|
570
|
+
return this.child(-1, e, -2);
|
|
571
|
+
}
|
|
572
|
+
prop(e) {
|
|
573
|
+
return this.type.prop(e);
|
|
574
|
+
}
|
|
575
|
+
enter(t, n, r = 0) {
|
|
576
|
+
if (r & M.ExcludeBuffers) return null;
|
|
577
|
+
let { buffer: i } = this.context, a = i.findChild(this.index + 4, i.buffer[this.index + 3], n > 0 ? 1 : -1, t - this.context.start, n);
|
|
578
|
+
return a < 0 ? null : new e(this.context, this, a);
|
|
579
|
+
}
|
|
580
|
+
get parent() {
|
|
581
|
+
return this._parent || this.context.parent.nextSignificantParent();
|
|
582
|
+
}
|
|
583
|
+
externalSibling(e) {
|
|
584
|
+
return this._parent ? null : this.context.parent.nextChild(this.context.index + e, e, 0, 4);
|
|
585
|
+
}
|
|
586
|
+
get nextSibling() {
|
|
587
|
+
let { buffer: t } = this.context, n = t.buffer[this.index + 3];
|
|
588
|
+
return n < (this._parent ? t.buffer[this._parent.index + 3] : t.buffer.length) ? new e(this.context, this._parent, n) : this.externalSibling(1);
|
|
589
|
+
}
|
|
590
|
+
get prevSibling() {
|
|
591
|
+
let { buffer: t } = this.context, n = this._parent ? this._parent.index + 4 : 0;
|
|
592
|
+
return this.index == n ? this.externalSibling(-1) : new e(this.context, this._parent, t.findChild(n, this.index, -1, 0, 4));
|
|
593
|
+
}
|
|
594
|
+
get tree() {
|
|
595
|
+
return null;
|
|
596
|
+
}
|
|
597
|
+
toTree() {
|
|
598
|
+
let e = [], t = [], { buffer: n } = this.context, r = this.index + 4, i = n.buffer[this.index + 3];
|
|
599
|
+
if (i > r) {
|
|
600
|
+
let a = n.buffer[this.index + 1];
|
|
601
|
+
e.push(n.slice(r, i, a)), t.push(0);
|
|
602
|
+
}
|
|
603
|
+
return new N(this.type, e, t, this.to - this.from);
|
|
604
|
+
}
|
|
605
|
+
toString() {
|
|
606
|
+
return this.context.buffer.childString(this.index);
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
function xe(e) {
|
|
610
|
+
if (!e.length) return null;
|
|
611
|
+
let t = 0, n = e[0];
|
|
612
|
+
for (let r = 1; r < e.length; r++) {
|
|
613
|
+
let i = e[r];
|
|
614
|
+
(i.from > n.from || i.to < n.to) && (n = i, t = r);
|
|
615
|
+
}
|
|
616
|
+
let r = n instanceof P && n.index < 0 ? null : n.parent, i = e.slice();
|
|
617
|
+
return r ? i[t] = r : i.splice(t, 1), new Se(i, n);
|
|
618
|
+
}
|
|
619
|
+
var Se = class {
|
|
620
|
+
constructor(e, t) {
|
|
621
|
+
this.heads = e, this.node = t;
|
|
622
|
+
}
|
|
623
|
+
get next() {
|
|
624
|
+
return xe(this.heads);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
function Ce(e, t, n) {
|
|
628
|
+
let r = e.resolveInner(t, n), i = null;
|
|
629
|
+
for (let e = r instanceof P ? r : r.context.parent; e; e = e.parent) if (e.index < 0) {
|
|
630
|
+
let a = e.parent;
|
|
631
|
+
(i ||= [r]).push(a.resolve(t, n)), e = a;
|
|
632
|
+
} else {
|
|
633
|
+
let a = se.get(e.tree);
|
|
634
|
+
if (a && a.overlay && a.overlay[0].from <= t && a.overlay[a.overlay.length - 1].to >= t) {
|
|
635
|
+
let o = new P(a.tree, a.overlay[0].from + e.from, -1, e);
|
|
636
|
+
(i ||= [r]).push(he(o, t, n, !1));
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return i ? xe(i) : r;
|
|
640
|
+
}
|
|
641
|
+
var we = class {
|
|
642
|
+
get name() {
|
|
643
|
+
return this.type.name;
|
|
644
|
+
}
|
|
645
|
+
constructor(e, t = 0) {
|
|
646
|
+
if (this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, this.mode = t & ~M.EnterBracketed, e instanceof P) this.yieldNode(e);
|
|
647
|
+
else {
|
|
648
|
+
this._tree = e.context.parent, this.buffer = e.context;
|
|
649
|
+
for (let t = e._parent; t; t = t._parent) this.stack.unshift(t.index);
|
|
650
|
+
this.bufferNode = e, this.yieldBuf(e.index);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
yieldNode(e) {
|
|
654
|
+
return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
|
|
655
|
+
}
|
|
656
|
+
yieldBuf(e, t) {
|
|
657
|
+
this.index = e;
|
|
658
|
+
let { start: n, buffer: r } = this.buffer;
|
|
659
|
+
return this.type = t || r.set.types[r.buffer[e]], this.from = n + r.buffer[e + 1], this.to = n + r.buffer[e + 2], !0;
|
|
660
|
+
}
|
|
661
|
+
yield(e) {
|
|
662
|
+
return e ? e instanceof P ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
663
|
+
}
|
|
664
|
+
toString() {
|
|
665
|
+
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
666
|
+
}
|
|
667
|
+
enterChild(e, t, n) {
|
|
668
|
+
if (!this.buffer) return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, t, n, this.mode));
|
|
669
|
+
let { buffer: r } = this.buffer, i = r.findChild(this.index + 4, r.buffer[this.index + 3], e, t - this.buffer.start, n);
|
|
670
|
+
return i < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(i));
|
|
671
|
+
}
|
|
672
|
+
firstChild() {
|
|
673
|
+
return this.enterChild(1, 0, 4);
|
|
674
|
+
}
|
|
675
|
+
lastChild() {
|
|
676
|
+
return this.enterChild(-1, 0, 4);
|
|
677
|
+
}
|
|
678
|
+
childAfter(e) {
|
|
679
|
+
return this.enterChild(1, e, 2);
|
|
680
|
+
}
|
|
681
|
+
childBefore(e) {
|
|
682
|
+
return this.enterChild(-1, e, -2);
|
|
683
|
+
}
|
|
684
|
+
enter(e, t, n = this.mode) {
|
|
685
|
+
return this.buffer ? n & M.ExcludeBuffers ? !1 : this.enterChild(1, e, t) : this.yield(this._tree.enter(e, t, n));
|
|
686
|
+
}
|
|
687
|
+
parent() {
|
|
688
|
+
if (!this.buffer) return this.yieldNode(this.mode & M.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
689
|
+
if (this.stack.length) return this.yieldBuf(this.stack.pop());
|
|
690
|
+
let e = this.mode & M.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
691
|
+
return this.buffer = null, this.yieldNode(e);
|
|
692
|
+
}
|
|
693
|
+
sibling(e) {
|
|
694
|
+
if (!this.buffer) return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
|
|
695
|
+
let { buffer: t } = this.buffer, n = this.stack.length - 1;
|
|
696
|
+
if (e < 0) {
|
|
697
|
+
let e = n < 0 ? 0 : this.stack[n] + 4;
|
|
698
|
+
if (this.index != e) return this.yieldBuf(t.findChild(e, this.index, -1, 0, 4));
|
|
699
|
+
} else {
|
|
700
|
+
let e = t.buffer[this.index + 3];
|
|
701
|
+
if (e < (n < 0 ? t.buffer.length : t.buffer[this.stack[n] + 3])) return this.yieldBuf(e);
|
|
702
|
+
}
|
|
703
|
+
return n < 0 && this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode));
|
|
704
|
+
}
|
|
705
|
+
nextSibling() {
|
|
706
|
+
return this.sibling(1);
|
|
707
|
+
}
|
|
708
|
+
prevSibling() {
|
|
709
|
+
return this.sibling(-1);
|
|
710
|
+
}
|
|
711
|
+
atLastNode(e) {
|
|
712
|
+
let t, n, { buffer: r } = this;
|
|
713
|
+
if (r) {
|
|
714
|
+
if (e > 0) {
|
|
715
|
+
if (this.index < r.buffer.buffer.length) return !1;
|
|
716
|
+
} else for (let e = 0; e < this.index; e++) if (r.buffer.buffer[e + 3] < this.index) return !1;
|
|
717
|
+
({index: t, parent: n} = r);
|
|
718
|
+
} else ({index: t, _parent: n} = this._tree);
|
|
719
|
+
for (; n; {index: t, _parent: n} = n) if (t > -1) for (let r = t + e, i = e < 0 ? -1 : n._tree.children.length; r != i; r += e) {
|
|
720
|
+
let e = n._tree.children[r];
|
|
721
|
+
if (this.mode & M.IncludeAnonymous || e instanceof pe || !e.type.isAnonymous || Te(e)) return !1;
|
|
722
|
+
}
|
|
723
|
+
return !0;
|
|
724
|
+
}
|
|
725
|
+
move(e, t) {
|
|
726
|
+
if (t && this.enterChild(e, 0, 4)) return !0;
|
|
727
|
+
for (;;) {
|
|
728
|
+
if (this.sibling(e)) return !0;
|
|
729
|
+
if (this.atLastNode(e) || !this.parent()) return !1;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
next(e = !0) {
|
|
733
|
+
return this.move(1, e);
|
|
734
|
+
}
|
|
735
|
+
prev(e = !0) {
|
|
736
|
+
return this.move(-1, e);
|
|
737
|
+
}
|
|
738
|
+
moveTo(e, t = 0) {
|
|
739
|
+
for (; (this.from == this.to || (t < 1 ? this.from >= e : this.from > e) || (t > -1 ? this.to <= e : this.to < e)) && this.parent(););
|
|
740
|
+
for (; this.enterChild(1, e, t););
|
|
741
|
+
return this;
|
|
742
|
+
}
|
|
743
|
+
get node() {
|
|
744
|
+
if (!this.buffer) return this._tree;
|
|
745
|
+
let e = this.bufferNode, t = null, n = 0;
|
|
746
|
+
if (e && e.context == this.buffer) scan: for (let r = this.index, i = this.stack.length; i >= 0;) {
|
|
747
|
+
for (let a = e; a; a = a._parent) if (a.index == r) {
|
|
748
|
+
if (r == this.index) return a;
|
|
749
|
+
t = a, n = i + 1;
|
|
750
|
+
break scan;
|
|
751
|
+
}
|
|
752
|
+
r = this.stack[--i];
|
|
753
|
+
}
|
|
754
|
+
for (let e = n; e < this.stack.length; e++) t = new be(this.buffer, t, this.stack[e]);
|
|
755
|
+
return this.bufferNode = new be(this.buffer, t, this.index);
|
|
756
|
+
}
|
|
757
|
+
get tree() {
|
|
758
|
+
return this.buffer ? null : this._tree._tree;
|
|
759
|
+
}
|
|
760
|
+
iterate(e, t) {
|
|
761
|
+
for (let n = 0;;) {
|
|
762
|
+
let r = !1;
|
|
763
|
+
if (this.type.isAnonymous || e(this) !== !1) {
|
|
764
|
+
if (this.firstChild()) {
|
|
765
|
+
n++;
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
768
|
+
this.type.isAnonymous || (r = !0);
|
|
769
|
+
}
|
|
770
|
+
for (;;) {
|
|
771
|
+
if (r && t && t(this), r = this.type.isAnonymous, !n) return;
|
|
772
|
+
if (this.nextSibling()) break;
|
|
773
|
+
this.parent(), n--, r = !0;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
matchContext(e) {
|
|
778
|
+
if (!this.buffer) return ve(this.node.parent, e);
|
|
779
|
+
let { buffer: t } = this.buffer, { types: n } = t.set;
|
|
780
|
+
for (let r = e.length - 1, i = this.stack.length - 1; r >= 0; i--) {
|
|
781
|
+
if (i < 0) return ve(this._tree, e, r);
|
|
782
|
+
let a = n[t.buffer[this.stack[i]]];
|
|
783
|
+
if (!a.isAnonymous) {
|
|
784
|
+
if (e[r] && e[r] != a.name) return !1;
|
|
785
|
+
r--;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return !0;
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
function Te(e) {
|
|
792
|
+
return e.children.some((e) => e instanceof pe || !e.type.isAnonymous || Te(e));
|
|
793
|
+
}
|
|
794
|
+
function Ee(e) {
|
|
795
|
+
let { buffer: t, nodeSet: n, maxBufferLength: r = ie, reused: i = [], minRepeatType: a = n.types.length } = e, o = Array.isArray(t) ? new fe(t, t.length) : t, s = n.types, c = 0, l = 0;
|
|
796
|
+
function u(e, t, _, v, y, b) {
|
|
797
|
+
let { id: x, start: S, end: C, size: w } = o, T = l, E = c;
|
|
798
|
+
if (w < 0) {
|
|
799
|
+
if (o.next(), w == -1) {
|
|
800
|
+
let t = i[x];
|
|
801
|
+
_.push(t), v.push(S - e);
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
if (w == -3) {
|
|
805
|
+
c = x;
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
if (w == -4) {
|
|
809
|
+
l = x;
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
throw RangeError(`Unrecognized record size: ${w}`);
|
|
813
|
+
}
|
|
814
|
+
let D = s[x], O, k, ee = S - e;
|
|
815
|
+
if (C - S <= r && (k = h(o.pos - t, y))) {
|
|
816
|
+
let t = new Uint16Array(k.size - k.skip), r = o.pos - k.size, i = t.length;
|
|
817
|
+
for (; o.pos > r;) i = g(k.start, t, i);
|
|
818
|
+
O = new pe(t, C - k.start, n), ee = k.start - e;
|
|
819
|
+
} else {
|
|
820
|
+
let e = o.pos - w;
|
|
821
|
+
o.next();
|
|
822
|
+
let t = [], n = [], i = x >= a ? x : -1, s = 0, c = C, h = T;
|
|
823
|
+
for (; o.pos > e;) i >= 0 && o.id == i && o.size >= 0 ? (o.end <= c - r && (p(t, n, S, s, o.end, c, i, h, E), s = t.length, c = o.end, h = l), o.next()) : b > 2500 ? d(S, e, t, n) : u(S, e, t, n, i, b + 1);
|
|
824
|
+
if (i >= 0 && s > 0 && s < t.length && p(t, n, S, s, S, c, i, h, E), t.reverse(), n.reverse(), i > -1 && s > 0) {
|
|
825
|
+
let e = f(D, E);
|
|
826
|
+
O = ke(D, t, n, 0, t.length, 0, C - S, e, e);
|
|
827
|
+
} else O = m(D, t, n, C - S, T - C, E);
|
|
828
|
+
}
|
|
829
|
+
_.push(O), v.push(ee);
|
|
830
|
+
}
|
|
831
|
+
function d(e, t, i, a) {
|
|
832
|
+
let s = [], c = 0, l = -1;
|
|
833
|
+
for (; o.pos > t;) {
|
|
834
|
+
let { id: e, start: t, end: n, size: i } = o;
|
|
835
|
+
if (i > 4) o.next();
|
|
836
|
+
else if (l > -1 && t < l) break;
|
|
837
|
+
else l < 0 && (l = n - r), s.push(e, t, n), c++, o.next();
|
|
838
|
+
}
|
|
839
|
+
if (c) {
|
|
840
|
+
let t = new Uint16Array(c * 4), r = s[s.length - 2];
|
|
841
|
+
for (let e = s.length - 3, n = 0; e >= 0; e -= 3) t[n++] = s[e], t[n++] = s[e + 1] - r, t[n++] = s[e + 2] - r, t[n++] = n;
|
|
842
|
+
i.push(new pe(t, s[2] - r, n)), a.push(r - e);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
function f(e, t) {
|
|
846
|
+
return (n, r, i) => {
|
|
847
|
+
let a = 0, o = n.length - 1, s, c;
|
|
848
|
+
if (o >= 0 && (s = n[o]) instanceof N) {
|
|
849
|
+
if (!o && s.type == e && s.length == i) return s;
|
|
850
|
+
(c = s.prop(A.lookAhead)) && (a = r[o] + s.length + c - i);
|
|
851
|
+
}
|
|
852
|
+
return m(e, n, r, i, a, t);
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function p(e, t, r, i, a, o, s, c, l) {
|
|
856
|
+
let u = [], d = [];
|
|
857
|
+
for (; e.length > i;) u.push(e.pop()), d.push(t.pop() + r - a);
|
|
858
|
+
e.push(m(n.types[s], u, d, o - a, c - o, l)), t.push(a - r);
|
|
859
|
+
}
|
|
860
|
+
function m(e, t, n, r, i, a, o) {
|
|
861
|
+
if (a) {
|
|
862
|
+
let e = [A.contextHash, a];
|
|
863
|
+
o = o ? [e].concat(o) : [e];
|
|
864
|
+
}
|
|
865
|
+
if (i > 25) {
|
|
866
|
+
let e = [A.lookAhead, i];
|
|
867
|
+
o = o ? [e].concat(o) : [e];
|
|
868
|
+
}
|
|
869
|
+
return new N(e, t, n, r, o);
|
|
870
|
+
}
|
|
871
|
+
function h(e, t) {
|
|
872
|
+
let n = o.fork(), i = 0, s = 0, c = 0, l = n.end - r, u = {
|
|
873
|
+
size: 0,
|
|
874
|
+
start: 0,
|
|
875
|
+
skip: 0
|
|
876
|
+
};
|
|
877
|
+
scan: for (let r = n.pos - e; n.pos > r;) {
|
|
878
|
+
let e = n.size;
|
|
879
|
+
if (n.id == t && e >= 0) {
|
|
880
|
+
u.size = i, u.start = s, u.skip = c, c += 4, i += 4, n.next();
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
let o = n.pos - e;
|
|
884
|
+
if (e < 0 || o < r || n.start < l) break;
|
|
885
|
+
let d = n.id >= a ? 4 : 0, f = n.start;
|
|
886
|
+
for (n.next(); n.pos > o;) {
|
|
887
|
+
if (n.size < 0) {
|
|
888
|
+
if (n.size == -3 || n.size == -4) d += 4;
|
|
889
|
+
else break scan;
|
|
890
|
+
} else n.id >= a && (d += 4);
|
|
891
|
+
n.next();
|
|
892
|
+
}
|
|
893
|
+
s = f, i += e, c += d;
|
|
894
|
+
}
|
|
895
|
+
return (t < 0 || i == e) && (u.size = i, u.start = s, u.skip = c), u.size > 4 ? u : void 0;
|
|
896
|
+
}
|
|
897
|
+
function g(e, t, n) {
|
|
898
|
+
let { id: r, start: i, end: s, size: u } = o;
|
|
899
|
+
if (o.next(), u >= 0 && r < a) {
|
|
900
|
+
let a = n;
|
|
901
|
+
if (u > 4) {
|
|
902
|
+
let r = o.pos - (u - 4);
|
|
903
|
+
for (; o.pos > r;) n = g(e, t, n);
|
|
904
|
+
}
|
|
905
|
+
t[--n] = a, t[--n] = s - e, t[--n] = i - e, t[--n] = r;
|
|
906
|
+
} else u == -3 ? c = r : u == -4 && (l = r);
|
|
907
|
+
return n;
|
|
908
|
+
}
|
|
909
|
+
let _ = [], v = [];
|
|
910
|
+
for (; o.pos > 0;) u(e.start || 0, e.bufferStart || 0, _, v, -1, 0);
|
|
911
|
+
let y = e.length ?? (_.length ? v[0] + _[0].length : 0);
|
|
912
|
+
return new N(s[e.topID], _.reverse(), v.reverse(), y);
|
|
913
|
+
}
|
|
914
|
+
var De = /* @__PURE__ */ new WeakMap();
|
|
915
|
+
function Oe(e, t) {
|
|
916
|
+
if (!e.isAnonymous || t instanceof pe || t.type != e) return 1;
|
|
917
|
+
let n = De.get(t);
|
|
918
|
+
if (n == null) {
|
|
919
|
+
n = 1;
|
|
920
|
+
for (let r of t.children) {
|
|
921
|
+
if (r.type != e || !(r instanceof N)) {
|
|
922
|
+
n = 1;
|
|
923
|
+
break;
|
|
924
|
+
}
|
|
925
|
+
n += Oe(e, r);
|
|
926
|
+
}
|
|
927
|
+
De.set(t, n);
|
|
928
|
+
}
|
|
929
|
+
return n;
|
|
930
|
+
}
|
|
931
|
+
function ke(e, t, n, r, i, a, o, s, c) {
|
|
932
|
+
let l = 0;
|
|
933
|
+
for (let n = r; n < i; n++) l += Oe(e, t[n]);
|
|
934
|
+
let u = Math.ceil(l * 1.5 / 8), d = [], f = [];
|
|
935
|
+
function p(t, n, r, i, o) {
|
|
936
|
+
for (let s = r; s < i;) {
|
|
937
|
+
let r = s, l = n[s], m = Oe(e, t[s]);
|
|
938
|
+
for (s++; s < i; s++) {
|
|
939
|
+
let n = Oe(e, t[s]);
|
|
940
|
+
if (m + n >= u) break;
|
|
941
|
+
m += n;
|
|
942
|
+
}
|
|
943
|
+
if (s == r + 1) {
|
|
944
|
+
if (m > u) {
|
|
945
|
+
let e = t[r];
|
|
946
|
+
p(e.children, e.positions, 0, e.children.length, n[r] + o);
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
d.push(t[r]);
|
|
950
|
+
} else {
|
|
951
|
+
let i = n[s - 1] + t[s - 1].length - l;
|
|
952
|
+
d.push(ke(e, t, n, r, s, l, i, null, c));
|
|
953
|
+
}
|
|
954
|
+
f.push(l + o - a);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
return p(t, n, r, i, 0), (s || c)(d, f, o);
|
|
958
|
+
}
|
|
959
|
+
var Ae = class e {
|
|
960
|
+
constructor(e, t, n, r, i = !1, a = !1) {
|
|
961
|
+
this.from = e, this.to = t, this.tree = n, this.offset = r, this.open = !!i | (a ? 2 : 0);
|
|
962
|
+
}
|
|
963
|
+
get openStart() {
|
|
964
|
+
return (this.open & 1) > 0;
|
|
965
|
+
}
|
|
966
|
+
get openEnd() {
|
|
967
|
+
return (this.open & 2) > 0;
|
|
968
|
+
}
|
|
969
|
+
static addTree(t, n = [], r = !1) {
|
|
970
|
+
let i = [new e(0, t.length, t, 0, !1, r)];
|
|
971
|
+
for (let e of n) e.to > t.length && i.push(e);
|
|
972
|
+
return i;
|
|
973
|
+
}
|
|
974
|
+
static applyChanges(t, n, r = 128) {
|
|
975
|
+
if (!n.length) return t;
|
|
976
|
+
let i = [], a = 1, o = t.length ? t[0] : null;
|
|
977
|
+
for (let s = 0, c = 0, l = 0;; s++) {
|
|
978
|
+
let u = s < n.length ? n[s] : null, d = u ? u.fromA : 1e9;
|
|
979
|
+
if (d - c >= r) for (; o && o.from < d;) {
|
|
980
|
+
let n = o;
|
|
981
|
+
if (c >= n.from || d <= n.to || l) {
|
|
982
|
+
let t = Math.max(n.from, c) - l, r = Math.min(n.to, d) - l;
|
|
983
|
+
n = t >= r ? null : new e(t, r, n.tree, n.offset + l, s > 0, !!u);
|
|
984
|
+
}
|
|
985
|
+
if (n && i.push(n), o.to > d) break;
|
|
986
|
+
o = a < t.length ? t[a++] : null;
|
|
987
|
+
}
|
|
988
|
+
if (!u) break;
|
|
989
|
+
c = u.toA, l = u.toA - u.toB;
|
|
990
|
+
}
|
|
991
|
+
return i;
|
|
992
|
+
}
|
|
993
|
+
}, je = class {
|
|
994
|
+
startParse(e, t, n) {
|
|
995
|
+
return typeof e == "string" && (e = new Me(e)), n = n ? n.length ? n.map((e) => new oe(e.from, e.to)) : [new oe(0, 0)] : [new oe(0, e.length)], this.createParse(e, t || [], n);
|
|
996
|
+
}
|
|
997
|
+
parse(e, t, n) {
|
|
998
|
+
let r = this.startParse(e, t, n);
|
|
999
|
+
for (;;) {
|
|
1000
|
+
let e = r.advance();
|
|
1001
|
+
if (e) return e;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}, Me = class {
|
|
1005
|
+
constructor(e) {
|
|
1006
|
+
this.string = e;
|
|
1007
|
+
}
|
|
1008
|
+
get length() {
|
|
1009
|
+
return this.string.length;
|
|
1010
|
+
}
|
|
1011
|
+
chunk(e) {
|
|
1012
|
+
return this.string.slice(e);
|
|
1013
|
+
}
|
|
1014
|
+
get lineChunks() {
|
|
1015
|
+
return !1;
|
|
1016
|
+
}
|
|
1017
|
+
read(e, t) {
|
|
1018
|
+
return this.string.slice(e, t);
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
new A({ perNode: !0 });
|
|
1022
|
+
// node_modules/@lezer/highlight/dist/index.js
|
|
1023
|
+
var Ne = 0, F = class e {
|
|
1024
|
+
constructor(e, t, n, r) {
|
|
1025
|
+
this.name = e, this.set = t, this.base = n, this.modified = r, this.id = Ne++;
|
|
1026
|
+
}
|
|
1027
|
+
toString() {
|
|
1028
|
+
let { name: e } = this;
|
|
1029
|
+
for (let t of this.modified) t.name && (e = `${t.name}(${e})`);
|
|
1030
|
+
return e;
|
|
1031
|
+
}
|
|
1032
|
+
static define(t, n) {
|
|
1033
|
+
let r = typeof t == "string" ? t : "?";
|
|
1034
|
+
if (t instanceof e && (n = t), n?.base) throw Error("Can not derive from a modified tag");
|
|
1035
|
+
let i = new e(r, [], null, []);
|
|
1036
|
+
if (i.set.push(i), n) for (let e of n.set) i.set.push(e);
|
|
1037
|
+
return i;
|
|
1038
|
+
}
|
|
1039
|
+
static defineModifier(e) {
|
|
1040
|
+
let t = new Fe(e);
|
|
1041
|
+
return (e) => e.modified.indexOf(t) > -1 ? e : Fe.get(e.base || e, e.modified.concat(t).sort((e, t) => e.id - t.id));
|
|
1042
|
+
}
|
|
1043
|
+
}, Pe = 0, Fe = class e {
|
|
1044
|
+
constructor(e) {
|
|
1045
|
+
this.name = e, this.instances = [], this.id = Pe++;
|
|
1046
|
+
}
|
|
1047
|
+
static get(t, n) {
|
|
1048
|
+
if (!n.length) return t;
|
|
1049
|
+
let r = n[0].instances.find((e) => e.base == t && Ie(n, e.modified));
|
|
1050
|
+
if (r) return r;
|
|
1051
|
+
let i = [], a = new F(t.name, i, t, n);
|
|
1052
|
+
for (let e of n) e.instances.push(a);
|
|
1053
|
+
let o = Le(n);
|
|
1054
|
+
for (let n of t.set) if (!n.modified.length) for (let t of o) i.push(e.get(n, t));
|
|
1055
|
+
return a;
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
function Ie(e, t) {
|
|
1059
|
+
return e.length == t.length && e.every((e, n) => e == t[n]);
|
|
1060
|
+
}
|
|
1061
|
+
function Le(e) {
|
|
1062
|
+
let t = [[]];
|
|
1063
|
+
for (let n = 0; n < e.length; n++) for (let r = 0, i = t.length; r < i; r++) t.push(t[r].concat(e[n]));
|
|
1064
|
+
return t.sort((e, t) => t.length - e.length);
|
|
1065
|
+
}
|
|
1066
|
+
function Re(e) {
|
|
1067
|
+
let t = Object.create(null);
|
|
1068
|
+
for (let n in e) {
|
|
1069
|
+
let r = e[n];
|
|
1070
|
+
Array.isArray(r) || (r = [r]);
|
|
1071
|
+
for (let e of n.split(" ")) if (e) {
|
|
1072
|
+
let n = [], i = 2, a = e;
|
|
1073
|
+
for (let t = 0;;) {
|
|
1074
|
+
if (a == "..." && t > 0 && t + 3 == e.length) {
|
|
1075
|
+
i = 1;
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
let r = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);
|
|
1079
|
+
if (!r) throw RangeError("Invalid path: " + e);
|
|
1080
|
+
if (n.push(r[0] == "*" ? "" : r[0][0] == "\"" ? JSON.parse(r[0]) : r[0]), t += r[0].length, t == e.length) break;
|
|
1081
|
+
let o = e[t++];
|
|
1082
|
+
if (t == e.length && o == "!") {
|
|
1083
|
+
i = 0;
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
if (o != "/") throw RangeError("Invalid path: " + e);
|
|
1087
|
+
a = e.slice(t);
|
|
1088
|
+
}
|
|
1089
|
+
let o = n.length - 1, s = n[o];
|
|
1090
|
+
if (!s) throw RangeError("Invalid path: " + e);
|
|
1091
|
+
t[s] = new Be(r, i, o > 0 ? n.slice(0, o) : null).sort(t[s]);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
return ze.add(t);
|
|
1095
|
+
}
|
|
1096
|
+
var ze = new A({ combine(e, t) {
|
|
1097
|
+
let n, r, i;
|
|
1098
|
+
for (; e || t;) {
|
|
1099
|
+
if (!e || t && e.depth <= t.depth ? (i = t, t = t.next) : (i = e, e = e.next), n && n.mode == i.mode && !i.context && !n.context) continue;
|
|
1100
|
+
let a = new Be(i.tags, i.mode, i.context);
|
|
1101
|
+
n ? n.next = a : r = a, n = a;
|
|
1102
|
+
}
|
|
1103
|
+
return r;
|
|
1104
|
+
} }), Be = class {
|
|
1105
|
+
constructor(e, t, n, r) {
|
|
1106
|
+
this.tags = e, this.mode = t, this.context = n, this.next = r;
|
|
1107
|
+
}
|
|
1108
|
+
get opaque() {
|
|
1109
|
+
return this.mode == 0;
|
|
1110
|
+
}
|
|
1111
|
+
get inherit() {
|
|
1112
|
+
return this.mode == 1;
|
|
1113
|
+
}
|
|
1114
|
+
sort(e) {
|
|
1115
|
+
return !e || e.depth < this.depth ? (this.next = e, this) : (e.next = this.sort(e.next), e);
|
|
1116
|
+
}
|
|
1117
|
+
get depth() {
|
|
1118
|
+
return this.context ? this.context.length : 0;
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
Be.empty = new Be([], 2, null);
|
|
1122
|
+
function Ve(e, t) {
|
|
1123
|
+
let n = Object.create(null);
|
|
1124
|
+
for (let t of e) if (!Array.isArray(t.tag)) n[t.tag.id] = t.class;
|
|
1125
|
+
else for (let e of t.tag) n[e.id] = t.class;
|
|
1126
|
+
let { scope: r, all: i = null } = t || {};
|
|
1127
|
+
return {
|
|
1128
|
+
style: (e) => {
|
|
1129
|
+
let t = i;
|
|
1130
|
+
for (let r of e) for (let e of r.set) {
|
|
1131
|
+
let r = n[e.id];
|
|
1132
|
+
if (r) {
|
|
1133
|
+
t = t ? t + " " + r : r;
|
|
1134
|
+
break;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
return t;
|
|
1138
|
+
},
|
|
1139
|
+
scope: r
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
var I = F.define, He = I(), L = I(), Ue = I(L), We = I(L), R = I(), Ge = I(R), Ke = I(R), z = I(), B = I(z), V = I(), H = I(), qe = I(), Je = I(qe), Ye = I(), U = {
|
|
1143
|
+
comment: He,
|
|
1144
|
+
lineComment: I(He),
|
|
1145
|
+
blockComment: I(He),
|
|
1146
|
+
docComment: I(He),
|
|
1147
|
+
name: L,
|
|
1148
|
+
variableName: I(L),
|
|
1149
|
+
typeName: Ue,
|
|
1150
|
+
tagName: I(Ue),
|
|
1151
|
+
propertyName: We,
|
|
1152
|
+
attributeName: I(We),
|
|
1153
|
+
className: I(L),
|
|
1154
|
+
labelName: I(L),
|
|
1155
|
+
namespace: I(L),
|
|
1156
|
+
macroName: I(L),
|
|
1157
|
+
literal: R,
|
|
1158
|
+
string: Ge,
|
|
1159
|
+
docString: I(Ge),
|
|
1160
|
+
character: I(Ge),
|
|
1161
|
+
attributeValue: I(Ge),
|
|
1162
|
+
number: Ke,
|
|
1163
|
+
integer: I(Ke),
|
|
1164
|
+
float: I(Ke),
|
|
1165
|
+
bool: I(R),
|
|
1166
|
+
regexp: I(R),
|
|
1167
|
+
escape: I(R),
|
|
1168
|
+
color: I(R),
|
|
1169
|
+
url: I(R),
|
|
1170
|
+
keyword: V,
|
|
1171
|
+
self: I(V),
|
|
1172
|
+
null: I(V),
|
|
1173
|
+
atom: I(V),
|
|
1174
|
+
unit: I(V),
|
|
1175
|
+
modifier: I(V),
|
|
1176
|
+
operatorKeyword: I(V),
|
|
1177
|
+
controlKeyword: I(V),
|
|
1178
|
+
definitionKeyword: I(V),
|
|
1179
|
+
moduleKeyword: I(V),
|
|
1180
|
+
operator: H,
|
|
1181
|
+
derefOperator: I(H),
|
|
1182
|
+
arithmeticOperator: I(H),
|
|
1183
|
+
logicOperator: I(H),
|
|
1184
|
+
bitwiseOperator: I(H),
|
|
1185
|
+
compareOperator: I(H),
|
|
1186
|
+
updateOperator: I(H),
|
|
1187
|
+
definitionOperator: I(H),
|
|
1188
|
+
typeOperator: I(H),
|
|
1189
|
+
controlOperator: I(H),
|
|
1190
|
+
punctuation: qe,
|
|
1191
|
+
separator: I(qe),
|
|
1192
|
+
bracket: Je,
|
|
1193
|
+
angleBracket: I(Je),
|
|
1194
|
+
squareBracket: I(Je),
|
|
1195
|
+
paren: I(Je),
|
|
1196
|
+
brace: I(Je),
|
|
1197
|
+
content: z,
|
|
1198
|
+
heading: B,
|
|
1199
|
+
heading1: I(B),
|
|
1200
|
+
heading2: I(B),
|
|
1201
|
+
heading3: I(B),
|
|
1202
|
+
heading4: I(B),
|
|
1203
|
+
heading5: I(B),
|
|
1204
|
+
heading6: I(B),
|
|
1205
|
+
contentSeparator: I(z),
|
|
1206
|
+
list: I(z),
|
|
1207
|
+
quote: I(z),
|
|
1208
|
+
emphasis: I(z),
|
|
1209
|
+
strong: I(z),
|
|
1210
|
+
link: I(z),
|
|
1211
|
+
monospace: I(z),
|
|
1212
|
+
strikethrough: I(z),
|
|
1213
|
+
inserted: I(),
|
|
1214
|
+
deleted: I(),
|
|
1215
|
+
changed: I(),
|
|
1216
|
+
invalid: I(),
|
|
1217
|
+
meta: Ye,
|
|
1218
|
+
documentMeta: I(Ye),
|
|
1219
|
+
annotation: I(Ye),
|
|
1220
|
+
processingInstruction: I(Ye),
|
|
1221
|
+
definition: F.defineModifier("definition"),
|
|
1222
|
+
constant: F.defineModifier("constant"),
|
|
1223
|
+
function: F.defineModifier("function"),
|
|
1224
|
+
standard: F.defineModifier("standard"),
|
|
1225
|
+
local: F.defineModifier("local"),
|
|
1226
|
+
special: F.defineModifier("special")
|
|
1227
|
+
};
|
|
1228
|
+
for (let e in U) {
|
|
1229
|
+
let t = U[e];
|
|
1230
|
+
t instanceof F && (t.name = e);
|
|
1231
|
+
}
|
|
1232
|
+
Ve([
|
|
1233
|
+
{
|
|
1234
|
+
tag: U.link,
|
|
1235
|
+
class: "tok-link"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
tag: U.heading,
|
|
1239
|
+
class: "tok-heading"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
tag: U.emphasis,
|
|
1243
|
+
class: "tok-emphasis"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
tag: U.strong,
|
|
1247
|
+
class: "tok-strong"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
tag: U.keyword,
|
|
1251
|
+
class: "tok-keyword"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
tag: U.atom,
|
|
1255
|
+
class: "tok-atom"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
tag: U.bool,
|
|
1259
|
+
class: "tok-bool"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
tag: U.url,
|
|
1263
|
+
class: "tok-url"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
tag: U.labelName,
|
|
1267
|
+
class: "tok-labelName"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
tag: U.inserted,
|
|
1271
|
+
class: "tok-inserted"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
tag: U.deleted,
|
|
1275
|
+
class: "tok-deleted"
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
tag: U.literal,
|
|
1279
|
+
class: "tok-literal"
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
tag: U.string,
|
|
1283
|
+
class: "tok-string"
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
tag: U.number,
|
|
1287
|
+
class: "tok-number"
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
tag: [
|
|
1291
|
+
U.regexp,
|
|
1292
|
+
U.escape,
|
|
1293
|
+
U.special(U.string)
|
|
1294
|
+
],
|
|
1295
|
+
class: "tok-string2"
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
tag: U.variableName,
|
|
1299
|
+
class: "tok-variableName"
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
tag: U.local(U.variableName),
|
|
1303
|
+
class: "tok-variableName tok-local"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
tag: U.definition(U.variableName),
|
|
1307
|
+
class: "tok-variableName tok-definition"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
tag: U.special(U.variableName),
|
|
1311
|
+
class: "tok-variableName2"
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
tag: U.definition(U.propertyName),
|
|
1315
|
+
class: "tok-propertyName tok-definition"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
tag: U.typeName,
|
|
1319
|
+
class: "tok-typeName"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
tag: U.namespace,
|
|
1323
|
+
class: "tok-namespace"
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
tag: U.className,
|
|
1327
|
+
class: "tok-className"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
tag: U.macroName,
|
|
1331
|
+
class: "tok-macroName"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
tag: U.propertyName,
|
|
1335
|
+
class: "tok-propertyName"
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
tag: U.operator,
|
|
1339
|
+
class: "tok-operator"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
tag: U.comment,
|
|
1343
|
+
class: "tok-comment"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
tag: U.meta,
|
|
1347
|
+
class: "tok-meta"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
tag: U.invalid,
|
|
1351
|
+
class: "tok-invalid"
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
tag: U.punctuation,
|
|
1355
|
+
class: "tok-punctuation"
|
|
1356
|
+
}
|
|
1357
|
+
]);
|
|
1358
|
+
// node_modules/@lezer/markdown/dist/index.js
|
|
1359
|
+
var Xe = class e {
|
|
1360
|
+
static create(t, n, r, i, a) {
|
|
1361
|
+
let o = i + (i << 8) + t + (n << 4) | 0;
|
|
1362
|
+
return new e(t, n, r, o, a, [], []);
|
|
1363
|
+
}
|
|
1364
|
+
constructor(e, t, n, r, i, a, o) {
|
|
1365
|
+
this.type = e, this.value = t, this.from = n, this.hash = r, this.end = i, this.children = a, this.positions = o, this.blankFirstLine = !1, this.hashProp = [[A.contextHash, r]];
|
|
1366
|
+
}
|
|
1367
|
+
addChild(e, t) {
|
|
1368
|
+
e.prop(A.contextHash) != this.hash && (e = new N(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(t);
|
|
1369
|
+
}
|
|
1370
|
+
toTree(e, t = this.end) {
|
|
1371
|
+
let n = this.children.length - 1;
|
|
1372
|
+
return n >= 0 && (t = Math.max(t, this.positions[n] + this.children[n].length + this.from)), new N(e.types[this.type], this.children, this.positions, t - this.from).balance({ makeTree: (e, t, n) => new N(j.none, e, t, n, this.hashProp) });
|
|
1373
|
+
}
|
|
1374
|
+
}, W;
|
|
1375
|
+
(function(e) {
|
|
1376
|
+
e[e.Document = 1] = "Document", e[e.CodeBlock = 2] = "CodeBlock", e[e.FencedCode = 3] = "FencedCode", e[e.Blockquote = 4] = "Blockquote", e[e.HorizontalRule = 5] = "HorizontalRule", e[e.BulletList = 6] = "BulletList", e[e.OrderedList = 7] = "OrderedList", e[e.ListItem = 8] = "ListItem", e[e.ATXHeading1 = 9] = "ATXHeading1", e[e.ATXHeading2 = 10] = "ATXHeading2", e[e.ATXHeading3 = 11] = "ATXHeading3", e[e.ATXHeading4 = 12] = "ATXHeading4", e[e.ATXHeading5 = 13] = "ATXHeading5", e[e.ATXHeading6 = 14] = "ATXHeading6", e[e.SetextHeading1 = 15] = "SetextHeading1", e[e.SetextHeading2 = 16] = "SetextHeading2", e[e.HTMLBlock = 17] = "HTMLBlock", e[e.LinkReference = 18] = "LinkReference", e[e.Paragraph = 19] = "Paragraph", e[e.CommentBlock = 20] = "CommentBlock", e[e.ProcessingInstructionBlock = 21] = "ProcessingInstructionBlock", e[e.Escape = 22] = "Escape", e[e.Entity = 23] = "Entity", e[e.HardBreak = 24] = "HardBreak", e[e.Emphasis = 25] = "Emphasis", e[e.StrongEmphasis = 26] = "StrongEmphasis", e[e.Link = 27] = "Link", e[e.Image = 28] = "Image", e[e.InlineCode = 29] = "InlineCode", e[e.HTMLTag = 30] = "HTMLTag", e[e.Comment = 31] = "Comment", e[e.ProcessingInstruction = 32] = "ProcessingInstruction", e[e.Autolink = 33] = "Autolink", e[e.HeaderMark = 34] = "HeaderMark", e[e.QuoteMark = 35] = "QuoteMark", e[e.ListMark = 36] = "ListMark", e[e.LinkMark = 37] = "LinkMark", e[e.EmphasisMark = 38] = "EmphasisMark", e[e.CodeMark = 39] = "CodeMark", e[e.CodeText = 40] = "CodeText", e[e.CodeInfo = 41] = "CodeInfo", e[e.LinkTitle = 42] = "LinkTitle", e[e.LinkLabel = 43] = "LinkLabel", e[e.URL = 44] = "URL";
|
|
1377
|
+
})(W ||= {});
|
|
1378
|
+
var Ze = class {
|
|
1379
|
+
constructor(e, t) {
|
|
1380
|
+
this.start = e, this.content = t, this.marks = [], this.parsers = [];
|
|
1381
|
+
}
|
|
1382
|
+
}, Qe = class {
|
|
1383
|
+
constructor() {
|
|
1384
|
+
this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1;
|
|
1385
|
+
}
|
|
1386
|
+
forward() {
|
|
1387
|
+
this.basePos > this.pos && this.forwardInner();
|
|
1388
|
+
}
|
|
1389
|
+
forwardInner() {
|
|
1390
|
+
let e = this.skipSpace(this.basePos);
|
|
1391
|
+
this.indent = this.countIndent(e, this.pos, this.indent), this.pos = e, this.next = e == this.text.length ? -1 : this.text.charCodeAt(e);
|
|
1392
|
+
}
|
|
1393
|
+
skipSpace(e) {
|
|
1394
|
+
return tt(this.text, e);
|
|
1395
|
+
}
|
|
1396
|
+
reset(e) {
|
|
1397
|
+
for (this.text = e, this.baseIndent = this.basePos = this.pos = this.indent = 0, this.forwardInner(), this.depth = 1; this.markers.length;) this.markers.pop();
|
|
1398
|
+
}
|
|
1399
|
+
moveBase(e) {
|
|
1400
|
+
this.basePos = e, this.baseIndent = this.countIndent(e, this.pos, this.indent);
|
|
1401
|
+
}
|
|
1402
|
+
moveBaseColumn(e) {
|
|
1403
|
+
this.baseIndent = e, this.basePos = this.findColumn(e);
|
|
1404
|
+
}
|
|
1405
|
+
addMarker(e) {
|
|
1406
|
+
this.markers.push(e);
|
|
1407
|
+
}
|
|
1408
|
+
countIndent(e, t = 0, n = 0) {
|
|
1409
|
+
for (let r = t; r < e; r++) n += this.text.charCodeAt(r) == 9 ? 4 - n % 4 : 1;
|
|
1410
|
+
return n;
|
|
1411
|
+
}
|
|
1412
|
+
findColumn(e) {
|
|
1413
|
+
let t = 0;
|
|
1414
|
+
for (let n = 0; t < this.text.length && n < e; t++) n += this.text.charCodeAt(t) == 9 ? 4 - n % 4 : 1;
|
|
1415
|
+
return t;
|
|
1416
|
+
}
|
|
1417
|
+
scrub() {
|
|
1418
|
+
if (!this.baseIndent) return this.text;
|
|
1419
|
+
let e = "";
|
|
1420
|
+
for (let t = 0; t < this.basePos; t++) e += " ";
|
|
1421
|
+
return e + this.text.slice(this.basePos);
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
function $e(e, t, n) {
|
|
1425
|
+
if (n.pos == n.text.length || e != t.block && n.indent >= t.stack[n.depth + 1].value + n.baseIndent) return !0;
|
|
1426
|
+
if (n.indent >= n.baseIndent + 4) return !1;
|
|
1427
|
+
let r = (e.type == W.OrderedList ? ct : st)(n, t, !1);
|
|
1428
|
+
return r > 0 && (e.type != W.BulletList || at(n, t, !1) < 0) && n.text.charCodeAt(n.pos + r - 1) == e.value;
|
|
1429
|
+
}
|
|
1430
|
+
var et = {
|
|
1431
|
+
[W.Blockquote](e, t, n) {
|
|
1432
|
+
return n.next == 62 && (n.markers.push(J(W.QuoteMark, t.lineStart + n.pos, t.lineStart + n.pos + 1)), n.moveBase(n.pos + (G(n.text.charCodeAt(n.pos + 1)) ? 2 : 1)), e.end = t.lineStart + n.text.length, !0);
|
|
1433
|
+
},
|
|
1434
|
+
[W.ListItem](e, t, n) {
|
|
1435
|
+
return !(n.next < 0 ? e.blankFirstLine && e.children.length == 1 : n.indent < n.baseIndent + e.value) && (n.moveBaseColumn(n.baseIndent + e.value), !0);
|
|
1436
|
+
},
|
|
1437
|
+
[W.OrderedList]: $e,
|
|
1438
|
+
[W.BulletList]: $e,
|
|
1439
|
+
[W.Document]() {
|
|
1440
|
+
return !0;
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
function G(e) {
|
|
1444
|
+
return e == 32 || e == 9 || e == 10 || e == 13;
|
|
1445
|
+
}
|
|
1446
|
+
function tt(e, t = 0) {
|
|
1447
|
+
for (; t < e.length && G(e.charCodeAt(t));) t++;
|
|
1448
|
+
return t;
|
|
1449
|
+
}
|
|
1450
|
+
function nt(e, t, n) {
|
|
1451
|
+
for (; t > n && G(e.charCodeAt(t - 1));) t--;
|
|
1452
|
+
return t;
|
|
1453
|
+
}
|
|
1454
|
+
function rt(e) {
|
|
1455
|
+
if (e.next != 96 && e.next != 126) return -1;
|
|
1456
|
+
let t = e.pos + 1;
|
|
1457
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
1458
|
+
if (t < e.pos + 3) return -1;
|
|
1459
|
+
if (e.next == 96) {
|
|
1460
|
+
for (let n = t; n < e.text.length; n++) if (e.text.charCodeAt(n) == 96) return -1;
|
|
1461
|
+
}
|
|
1462
|
+
return t;
|
|
1463
|
+
}
|
|
1464
|
+
function it(e) {
|
|
1465
|
+
return e.next == 62 ? e.text.charCodeAt(e.pos + 1) == 32 ? 2 : 1 : -1;
|
|
1466
|
+
}
|
|
1467
|
+
function at(e, t, n) {
|
|
1468
|
+
if (e.next != 42 && e.next != 45 && e.next != 95) return -1;
|
|
1469
|
+
let r = 1;
|
|
1470
|
+
for (let t = e.pos + 1; t < e.text.length; t++) {
|
|
1471
|
+
let n = e.text.charCodeAt(t);
|
|
1472
|
+
if (n == e.next) r++;
|
|
1473
|
+
else if (!G(n)) return -1;
|
|
1474
|
+
}
|
|
1475
|
+
return n && e.next == 45 && ut(e) > -1 && e.depth == t.stack.length && t.parser.leafBlockParsers.indexOf(xt.SetextHeading) > -1 || r < 3 ? -1 : 1;
|
|
1476
|
+
}
|
|
1477
|
+
function ot(e, t) {
|
|
1478
|
+
for (let n = e.stack.length - 1; n >= 0; n--) if (e.stack[n].type == t) return !0;
|
|
1479
|
+
return !1;
|
|
1480
|
+
}
|
|
1481
|
+
function st(e, t, n) {
|
|
1482
|
+
return (e.next == 45 || e.next == 43 || e.next == 42) && (e.pos == e.text.length - 1 || G(e.text.charCodeAt(e.pos + 1))) && (!n || ot(t, W.BulletList) || e.skipSpace(e.pos + 2) < e.text.length) ? 1 : -1;
|
|
1483
|
+
}
|
|
1484
|
+
function ct(e, t, n) {
|
|
1485
|
+
let r = e.pos, i = e.next;
|
|
1486
|
+
for (; i >= 48 && i <= 57;) {
|
|
1487
|
+
if (r++, r == e.text.length) return -1;
|
|
1488
|
+
i = e.text.charCodeAt(r);
|
|
1489
|
+
}
|
|
1490
|
+
return r == e.pos || r > e.pos + 9 || i != 46 && i != 41 || r < e.text.length - 1 && !G(e.text.charCodeAt(r + 1)) || n && !ot(t, W.OrderedList) && (e.skipSpace(r + 1) == e.text.length || r > e.pos + 1 || e.next != 49) ? -1 : r + 1 - e.pos;
|
|
1491
|
+
}
|
|
1492
|
+
function lt(e) {
|
|
1493
|
+
if (e.next != 35) return -1;
|
|
1494
|
+
let t = e.pos + 1;
|
|
1495
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == 35;) t++;
|
|
1496
|
+
if (t < e.text.length && !G(e.text.charCodeAt(t))) return -1;
|
|
1497
|
+
let n = t - e.pos;
|
|
1498
|
+
return n > 6 ? -1 : n;
|
|
1499
|
+
}
|
|
1500
|
+
function ut(e) {
|
|
1501
|
+
if (e.next != 45 && e.next != 61 || e.indent >= e.baseIndent + 4) return -1;
|
|
1502
|
+
let t = e.pos + 1;
|
|
1503
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
1504
|
+
let n = t;
|
|
1505
|
+
for (; t < e.text.length && G(e.text.charCodeAt(t));) t++;
|
|
1506
|
+
return t == e.text.length ? n : -1;
|
|
1507
|
+
}
|
|
1508
|
+
var dt = /^[ \t]*$/, ft = /-->/, pt = /\?>/, mt = [
|
|
1509
|
+
[/^<(?:script|pre|style|textarea)(?:\s|>|$)/i, /<\/(?:script|pre|style|textarea)>/i],
|
|
1510
|
+
[/^\s*<!--/, ft],
|
|
1511
|
+
[/^\s*<\?/, pt],
|
|
1512
|
+
[/^\s*<![A-Z]/, />/],
|
|
1513
|
+
[/^\s*<!\[CDATA\[/, /\]\]>/],
|
|
1514
|
+
[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i, dt],
|
|
1515
|
+
[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i, dt]
|
|
1516
|
+
];
|
|
1517
|
+
function ht(e, t, n) {
|
|
1518
|
+
if (e.next != 60) return -1;
|
|
1519
|
+
let r = e.text.slice(e.pos);
|
|
1520
|
+
for (let e = 0, t = mt.length - +!!n; e < t; e++) if (mt[e][0].test(r)) return e;
|
|
1521
|
+
return -1;
|
|
1522
|
+
}
|
|
1523
|
+
function gt(e, t) {
|
|
1524
|
+
let n = e.countIndent(t, e.pos, e.indent), r = e.skipSpace(t), i = e.countIndent(r, t, n);
|
|
1525
|
+
return i >= n + 5 || r == e.text.length ? n + 1 : i;
|
|
1526
|
+
}
|
|
1527
|
+
function K(e, t, n) {
|
|
1528
|
+
let r = e.length - 1;
|
|
1529
|
+
r >= 0 && e[r].to == t && e[r].type == W.CodeText ? e[r].to = n : e.push(J(W.CodeText, t, n));
|
|
1530
|
+
}
|
|
1531
|
+
var _t = {
|
|
1532
|
+
LinkReference: void 0,
|
|
1533
|
+
IndentedCode(e, t) {
|
|
1534
|
+
let n = t.baseIndent + 4;
|
|
1535
|
+
if (t.indent < n) return !1;
|
|
1536
|
+
let r = t.findColumn(n), i = e.lineStart + r, a = e.lineStart + t.text.length, o = [], s = [];
|
|
1537
|
+
for (K(o, i, a); e.nextLine() && t.depth >= e.stack.length;) if (t.pos == t.text.length) {
|
|
1538
|
+
K(s, e.lineStart - 1, e.lineStart);
|
|
1539
|
+
for (let e of t.markers) s.push(e);
|
|
1540
|
+
} else if (t.indent < n) break;
|
|
1541
|
+
else {
|
|
1542
|
+
if (s.length) {
|
|
1543
|
+
for (let e of s) e.type == W.CodeText ? K(o, e.from, e.to) : o.push(e);
|
|
1544
|
+
s = [];
|
|
1545
|
+
}
|
|
1546
|
+
K(o, e.lineStart - 1, e.lineStart);
|
|
1547
|
+
for (let e of t.markers) o.push(e);
|
|
1548
|
+
a = e.lineStart + t.text.length;
|
|
1549
|
+
let n = e.lineStart + t.findColumn(t.baseIndent + 4);
|
|
1550
|
+
n < a && K(o, n, a);
|
|
1551
|
+
}
|
|
1552
|
+
return s.length && (s = s.filter((e) => e.type != W.CodeText), s.length && (t.markers = s.concat(t.markers))), e.addNode(e.buffer.writeElements(o, -i).finish(W.CodeBlock, a - i), i), !0;
|
|
1553
|
+
},
|
|
1554
|
+
FencedCode(e, t) {
|
|
1555
|
+
let n = rt(t);
|
|
1556
|
+
if (n < 0) return !1;
|
|
1557
|
+
let r = e.lineStart + t.pos, i = t.next, a = n - t.pos, o = t.skipSpace(n), s = nt(t.text, t.text.length, o), c = [J(W.CodeMark, r, r + a)];
|
|
1558
|
+
o < s && c.push(J(W.CodeInfo, e.lineStart + o, e.lineStart + s));
|
|
1559
|
+
for (let n = !0, r = !0, o = !1; e.nextLine() && t.depth >= e.stack.length; n = !1) {
|
|
1560
|
+
let s = t.pos;
|
|
1561
|
+
if (t.indent - t.baseIndent < 4) for (; s < t.text.length && t.text.charCodeAt(s) == i;) s++;
|
|
1562
|
+
if (s - t.pos >= a && t.skipSpace(s) == t.text.length) {
|
|
1563
|
+
for (let e of t.markers) c.push(e);
|
|
1564
|
+
r && o && K(c, e.lineStart - 1, e.lineStart), c.push(J(W.CodeMark, e.lineStart + t.pos, e.lineStart + s)), e.nextLine();
|
|
1565
|
+
break;
|
|
1566
|
+
}
|
|
1567
|
+
{
|
|
1568
|
+
o = !0, n || (K(c, e.lineStart - 1, e.lineStart), r = !1);
|
|
1569
|
+
for (let e of t.markers) c.push(e);
|
|
1570
|
+
let i = e.lineStart + t.basePos, a = e.lineStart + t.text.length;
|
|
1571
|
+
i < a && (K(c, i, a), r = !1);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
return e.addNode(e.buffer.writeElements(c, -r).finish(W.FencedCode, e.prevLineEnd() - r), r), !0;
|
|
1575
|
+
},
|
|
1576
|
+
Blockquote(e, t) {
|
|
1577
|
+
let n = it(t);
|
|
1578
|
+
return n < 0 ? !1 : (e.startContext(W.Blockquote, t.pos), e.addNode(W.QuoteMark, e.lineStart + t.pos, e.lineStart + t.pos + 1), t.moveBase(t.pos + n), null);
|
|
1579
|
+
},
|
|
1580
|
+
HorizontalRule(e, t) {
|
|
1581
|
+
if (at(t, e, !1) < 0) return !1;
|
|
1582
|
+
let n = e.lineStart + t.pos;
|
|
1583
|
+
return e.nextLine(), e.addNode(W.HorizontalRule, n), !0;
|
|
1584
|
+
},
|
|
1585
|
+
BulletList(e, t) {
|
|
1586
|
+
let n = st(t, e, !1);
|
|
1587
|
+
if (n < 0) return !1;
|
|
1588
|
+
e.block.type != W.BulletList && e.startContext(W.BulletList, t.basePos, t.next);
|
|
1589
|
+
let r = gt(t, t.pos + 1);
|
|
1590
|
+
return e.startContext(W.ListItem, t.basePos, r - t.baseIndent), e.addNode(W.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), e.block.blankFirstLine = r >= t.text.length, null;
|
|
1591
|
+
},
|
|
1592
|
+
OrderedList(e, t) {
|
|
1593
|
+
let n = ct(t, e, !1);
|
|
1594
|
+
if (n < 0) return !1;
|
|
1595
|
+
e.block.type != W.OrderedList && e.startContext(W.OrderedList, t.basePos, t.text.charCodeAt(t.pos + n - 1));
|
|
1596
|
+
let r = gt(t, t.pos + n);
|
|
1597
|
+
return e.startContext(W.ListItem, t.basePos, r - t.baseIndent), e.addNode(W.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), e.block.blankFirstLine = r == t.text.length, null;
|
|
1598
|
+
},
|
|
1599
|
+
ATXHeading(e, t) {
|
|
1600
|
+
let n = lt(t);
|
|
1601
|
+
if (n < 0) return !1;
|
|
1602
|
+
let r = t.pos, i = e.lineStart + r, a = nt(t.text, t.text.length, r), o = a;
|
|
1603
|
+
for (; o > r && t.text.charCodeAt(o - 1) == t.next;) o--;
|
|
1604
|
+
o != a && o != r && G(t.text.charCodeAt(o - 1)) || (o = t.text.length);
|
|
1605
|
+
let s = e.buffer.write(W.HeaderMark, 0, n).writeElements(e.parser.parseInline(t.text.slice(r + n + 1, o), i + n + 1), -i);
|
|
1606
|
+
o < t.text.length && s.write(W.HeaderMark, o - r, a - r);
|
|
1607
|
+
let c = s.finish(W.ATXHeading1 - 1 + n, t.text.length - r);
|
|
1608
|
+
return e.nextLine(), e.addNode(c, i), !0;
|
|
1609
|
+
},
|
|
1610
|
+
HTMLBlock(e, t) {
|
|
1611
|
+
let n = ht(t, e, !1);
|
|
1612
|
+
if (n < 0) return !1;
|
|
1613
|
+
let r = e.lineStart + t.pos, i = mt[n][1], a = [], o = i != dt;
|
|
1614
|
+
for (; !i.test(t.text) && e.nextLine();) {
|
|
1615
|
+
if (t.depth < e.stack.length) {
|
|
1616
|
+
o = !1;
|
|
1617
|
+
break;
|
|
1618
|
+
}
|
|
1619
|
+
for (let e of t.markers) a.push(e);
|
|
1620
|
+
}
|
|
1621
|
+
o && e.nextLine();
|
|
1622
|
+
let s = i == ft ? W.CommentBlock : i == pt ? W.ProcessingInstructionBlock : W.HTMLBlock, c = e.prevLineEnd();
|
|
1623
|
+
return e.addNode(e.buffer.writeElements(a, -r).finish(s, c - r), r), !0;
|
|
1624
|
+
},
|
|
1625
|
+
SetextHeading: void 0
|
|
1626
|
+
}, vt = class {
|
|
1627
|
+
constructor(e) {
|
|
1628
|
+
this.stage = 0, this.elts = [], this.pos = 0, this.start = e.start, this.advance(e.content);
|
|
1629
|
+
}
|
|
1630
|
+
nextLine(e, t, n) {
|
|
1631
|
+
if (this.stage == -1) return !1;
|
|
1632
|
+
let r = n.content + "\n" + t.scrub(), i = this.advance(r);
|
|
1633
|
+
return i > -1 && i < r.length && this.complete(e, n, i);
|
|
1634
|
+
}
|
|
1635
|
+
finish(e, t) {
|
|
1636
|
+
return (this.stage == 2 || this.stage == 3) && tt(t.content, this.pos) == t.content.length && this.complete(e, t, t.content.length);
|
|
1637
|
+
}
|
|
1638
|
+
complete(e, t, n) {
|
|
1639
|
+
return e.addLeafElement(t, J(W.LinkReference, this.start, this.start + n, this.elts)), !0;
|
|
1640
|
+
}
|
|
1641
|
+
nextStage(e) {
|
|
1642
|
+
return e ? (this.pos = e.to - this.start, this.elts.push(e), this.stage++, !0) : (e === !1 && (this.stage = -1), !1);
|
|
1643
|
+
}
|
|
1644
|
+
advance(e) {
|
|
1645
|
+
for (;;) if (this.stage == -1) return -1;
|
|
1646
|
+
else if (this.stage == 0) {
|
|
1647
|
+
if (!this.nextStage(Ut(e, this.pos, this.start, !0))) return -1;
|
|
1648
|
+
if (e.charCodeAt(this.pos) != 58) return this.stage = -1;
|
|
1649
|
+
this.elts.push(J(W.LinkMark, this.pos + this.start, this.pos + this.start + 1)), this.pos++;
|
|
1650
|
+
} else if (this.stage == 1) {
|
|
1651
|
+
if (!this.nextStage(Vt(e, tt(e, this.pos), this.start))) return -1;
|
|
1652
|
+
} else if (this.stage == 2) {
|
|
1653
|
+
let t = tt(e, this.pos), n = 0;
|
|
1654
|
+
if (t > this.pos) {
|
|
1655
|
+
let r = Ht(e, t, this.start);
|
|
1656
|
+
if (r) {
|
|
1657
|
+
let t = yt(e, r.to - this.start);
|
|
1658
|
+
t > 0 && (this.nextStage(r), n = t);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
return n ||= yt(e, this.pos), n > 0 && n < e.length ? n : -1;
|
|
1662
|
+
} else return yt(e, this.pos);
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
function yt(e, t) {
|
|
1666
|
+
for (; t < e.length; t++) {
|
|
1667
|
+
let n = e.charCodeAt(t);
|
|
1668
|
+
if (n == 10) break;
|
|
1669
|
+
if (!G(n)) return -1;
|
|
1670
|
+
}
|
|
1671
|
+
return t;
|
|
1672
|
+
}
|
|
1673
|
+
var bt = class {
|
|
1674
|
+
nextLine(e, t, n) {
|
|
1675
|
+
let r = t.depth < e.stack.length ? -1 : ut(t), i = t.next;
|
|
1676
|
+
if (r < 0) return !1;
|
|
1677
|
+
let a = J(W.HeaderMark, e.lineStart + t.pos, e.lineStart + r);
|
|
1678
|
+
return e.nextLine(), e.addLeafElement(n, J(i == 61 ? W.SetextHeading1 : W.SetextHeading2, n.start, e.prevLineEnd(), [...e.parser.parseInline(n.content, n.start), a])), !0;
|
|
1679
|
+
}
|
|
1680
|
+
finish() {
|
|
1681
|
+
return !1;
|
|
1682
|
+
}
|
|
1683
|
+
}, xt = {
|
|
1684
|
+
LinkReference(e, t) {
|
|
1685
|
+
return t.content.charCodeAt(0) == 91 ? new vt(t) : null;
|
|
1686
|
+
},
|
|
1687
|
+
SetextHeading() {
|
|
1688
|
+
return new bt();
|
|
1689
|
+
}
|
|
1690
|
+
}, St = [
|
|
1691
|
+
(e, t) => lt(t) >= 0,
|
|
1692
|
+
(e, t) => rt(t) >= 0,
|
|
1693
|
+
(e, t) => it(t) >= 0,
|
|
1694
|
+
(e, t) => st(t, e, !0) >= 0,
|
|
1695
|
+
(e, t) => ct(t, e, !0) >= 0,
|
|
1696
|
+
(e, t) => at(t, e, !0) >= 0,
|
|
1697
|
+
(e, t) => ht(t, e, !0) >= 0
|
|
1698
|
+
], Ct = {
|
|
1699
|
+
text: "",
|
|
1700
|
+
end: 0
|
|
1701
|
+
}, wt = class {
|
|
1702
|
+
constructor(e, t, n, r) {
|
|
1703
|
+
this.parser = e, this.input = t, this.ranges = r, this.line = new Qe(), this.atEnd = !1, this.reusePlaceholders = /* @__PURE__ */ new Map(), this.stoppedAt = null, this.rangeI = 0, this.to = r[r.length - 1].to, this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = r[0].from, this.block = Xe.create(W.Document, 0, this.lineStart, 0, 0), this.stack = [this.block], this.fragments = n.length ? new qt(n, t) : null, this.readLine();
|
|
1704
|
+
}
|
|
1705
|
+
get parsedPos() {
|
|
1706
|
+
return this.absoluteLineStart;
|
|
1707
|
+
}
|
|
1708
|
+
advance() {
|
|
1709
|
+
if (this.stoppedAt != null && this.absoluteLineStart > this.stoppedAt) return this.finish();
|
|
1710
|
+
let { line: e } = this;
|
|
1711
|
+
for (;;) {
|
|
1712
|
+
for (let t = 0;;) {
|
|
1713
|
+
let n = e.depth < this.stack.length ? this.stack[this.stack.length - 1] : null;
|
|
1714
|
+
for (; t < e.markers.length && (!n || e.markers[t].from < n.end);) {
|
|
1715
|
+
let n = e.markers[t++];
|
|
1716
|
+
this.addNode(n.type, n.from, n.to);
|
|
1717
|
+
}
|
|
1718
|
+
if (!n) break;
|
|
1719
|
+
this.finishContext();
|
|
1720
|
+
}
|
|
1721
|
+
if (e.pos < e.text.length) break;
|
|
1722
|
+
if (!this.nextLine()) return this.finish();
|
|
1723
|
+
}
|
|
1724
|
+
if (this.fragments && this.reuseFragment(e.basePos)) return null;
|
|
1725
|
+
start: for (;;) {
|
|
1726
|
+
for (let t of this.parser.blockParsers) if (t) {
|
|
1727
|
+
let n = t(this, e);
|
|
1728
|
+
if (n != 0) {
|
|
1729
|
+
if (n == 1) return null;
|
|
1730
|
+
e.forward();
|
|
1731
|
+
continue start;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
if (e.pos == e.text.length) return this.nextLine() ? null : this.finish();
|
|
1737
|
+
let t = new Ze(this.lineStart + e.pos, e.text.slice(e.pos));
|
|
1738
|
+
for (let e of this.parser.leafBlockParsers) if (e) {
|
|
1739
|
+
let n = e(this, t);
|
|
1740
|
+
n && t.parsers.push(n);
|
|
1741
|
+
}
|
|
1742
|
+
lines: for (; this.nextLine() && e.pos != e.text.length;) {
|
|
1743
|
+
if (e.indent < e.baseIndent + 4) {
|
|
1744
|
+
for (let n of this.parser.endLeafBlock) if (n(this, e, t)) break lines;
|
|
1745
|
+
}
|
|
1746
|
+
for (let n of t.parsers) if (n.nextLine(this, e, t)) return null;
|
|
1747
|
+
t.content += "\n" + e.scrub();
|
|
1748
|
+
for (let n of e.markers) t.marks.push(n);
|
|
1749
|
+
}
|
|
1750
|
+
return this.finishLeaf(t), null;
|
|
1751
|
+
}
|
|
1752
|
+
stopAt(e) {
|
|
1753
|
+
if (this.stoppedAt != null && this.stoppedAt < e) throw RangeError("Can't move stoppedAt forward");
|
|
1754
|
+
this.stoppedAt = e;
|
|
1755
|
+
}
|
|
1756
|
+
reuseFragment(e) {
|
|
1757
|
+
if (!this.fragments.moveTo(this.absoluteLineStart + e, this.absoluteLineStart) || !this.fragments.matches(this.block.hash)) return !1;
|
|
1758
|
+
let t = this.fragments.takeNodes(this);
|
|
1759
|
+
return t ? (this.absoluteLineStart += t, this.lineStart = Yt(this.absoluteLineStart, this.ranges), this.moveRangeI(), this.absoluteLineStart < this.to ? (this.lineStart++, this.absoluteLineStart++, this.readLine()) : (this.atEnd = !0, this.readLine()), !0) : !1;
|
|
1760
|
+
}
|
|
1761
|
+
get depth() {
|
|
1762
|
+
return this.stack.length;
|
|
1763
|
+
}
|
|
1764
|
+
parentType(e = this.depth - 1) {
|
|
1765
|
+
return this.parser.nodeSet.types[this.stack[e].type];
|
|
1766
|
+
}
|
|
1767
|
+
nextLine() {
|
|
1768
|
+
return this.lineStart += this.line.text.length, this.absoluteLineEnd >= this.to ? (this.absoluteLineStart = this.absoluteLineEnd, this.atEnd = !0, this.readLine(), !1) : (this.lineStart++, this.absoluteLineStart = this.absoluteLineEnd + 1, this.moveRangeI(), this.readLine(), !0);
|
|
1769
|
+
}
|
|
1770
|
+
peekLine() {
|
|
1771
|
+
return this.scanLine(this.absoluteLineEnd + 1).text;
|
|
1772
|
+
}
|
|
1773
|
+
moveRangeI() {
|
|
1774
|
+
for (; this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to;) this.rangeI++, this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);
|
|
1775
|
+
}
|
|
1776
|
+
scanLine(e) {
|
|
1777
|
+
let t = Ct;
|
|
1778
|
+
if (t.end = e, e >= this.to) t.text = "";
|
|
1779
|
+
else if (t.text = this.lineChunkAt(e), t.end += t.text.length, this.ranges.length > 1) {
|
|
1780
|
+
let e = this.absoluteLineStart, n = this.rangeI;
|
|
1781
|
+
for (; this.ranges[n].to < t.end;) {
|
|
1782
|
+
n++;
|
|
1783
|
+
let r = this.ranges[n].from, i = this.lineChunkAt(r);
|
|
1784
|
+
t.end = r + i.length, t.text = t.text.slice(0, this.ranges[n - 1].to - e) + i, e = t.end - t.text.length;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
return t;
|
|
1788
|
+
}
|
|
1789
|
+
readLine() {
|
|
1790
|
+
let { line: e } = this, { text: t, end: n } = this.scanLine(this.absoluteLineStart);
|
|
1791
|
+
for (this.absoluteLineEnd = n, e.reset(t); e.depth < this.stack.length; e.depth++) {
|
|
1792
|
+
let t = this.stack[e.depth], n = this.parser.skipContextMarkup[t.type];
|
|
1793
|
+
if (!n) throw Error("Unhandled block context " + W[t.type]);
|
|
1794
|
+
let r = this.line.markers.length;
|
|
1795
|
+
if (!n(t, this, e)) {
|
|
1796
|
+
this.line.markers.length > r && (t.end = this.line.markers[this.line.markers.length - 1].to), e.forward();
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
e.forward();
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
lineChunkAt(e) {
|
|
1803
|
+
let t = this.input.chunk(e), n;
|
|
1804
|
+
if (this.input.lineChunks) n = t == "\n" ? "" : t;
|
|
1805
|
+
else {
|
|
1806
|
+
let e = t.indexOf("\n");
|
|
1807
|
+
n = e < 0 ? t : t.slice(0, e);
|
|
1808
|
+
}
|
|
1809
|
+
return e + n.length > this.to ? n.slice(0, this.to - e) : n;
|
|
1810
|
+
}
|
|
1811
|
+
prevLineEnd() {
|
|
1812
|
+
return this.atEnd ? this.lineStart : this.lineStart - 1;
|
|
1813
|
+
}
|
|
1814
|
+
startContext(e, t, n = 0) {
|
|
1815
|
+
this.block = Xe.create(e, n, this.lineStart + t, this.block.hash, this.lineStart + this.line.text.length), this.stack.push(this.block);
|
|
1816
|
+
}
|
|
1817
|
+
startComposite(e, t, n = 0) {
|
|
1818
|
+
this.startContext(this.parser.getNodeType(e), t, n);
|
|
1819
|
+
}
|
|
1820
|
+
addNode(e, t, n) {
|
|
1821
|
+
typeof e == "number" && (e = new N(this.parser.nodeSet.types[e], q, q, (n ?? this.prevLineEnd()) - t)), this.block.addChild(e, t - this.block.from);
|
|
1822
|
+
}
|
|
1823
|
+
addElement(e) {
|
|
1824
|
+
this.block.addChild(e.toTree(this.parser.nodeSet), e.from - this.block.from);
|
|
1825
|
+
}
|
|
1826
|
+
addLeafElement(e, t) {
|
|
1827
|
+
this.addNode(this.buffer.writeElements(Gt(t.children, e.marks), -t.from).finish(t.type, t.to - t.from), t.from);
|
|
1828
|
+
}
|
|
1829
|
+
finishContext() {
|
|
1830
|
+
let e = this.stack.pop(), t = this.stack[this.stack.length - 1];
|
|
1831
|
+
t.addChild(e.toTree(this.parser.nodeSet), e.from - t.from), this.block = t;
|
|
1832
|
+
}
|
|
1833
|
+
finish() {
|
|
1834
|
+
for (; this.stack.length > 1;) this.finishContext();
|
|
1835
|
+
return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));
|
|
1836
|
+
}
|
|
1837
|
+
addGaps(e) {
|
|
1838
|
+
return this.ranges.length > 1 ? Tt(this.ranges, 0, e.topNode, this.ranges[0].from, this.reusePlaceholders) : e;
|
|
1839
|
+
}
|
|
1840
|
+
finishLeaf(e) {
|
|
1841
|
+
for (let t of e.parsers) if (t.finish(this, e)) return;
|
|
1842
|
+
let t = Gt(this.parser.parseInline(e.content, e.start), e.marks);
|
|
1843
|
+
this.addNode(this.buffer.writeElements(t, -e.start).finish(W.Paragraph, e.content.length), e.start);
|
|
1844
|
+
}
|
|
1845
|
+
elt(e, t, n, r) {
|
|
1846
|
+
return typeof e == "string" ? J(this.parser.getNodeType(e), t, n, r) : new Nt(e, t);
|
|
1847
|
+
}
|
|
1848
|
+
get buffer() {
|
|
1849
|
+
return new jt(this.parser.nodeSet);
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
function Tt(e, t, n, r, i) {
|
|
1853
|
+
let a = e[t].to, o = [], s = [], c = n.from + r;
|
|
1854
|
+
function l(n, i) {
|
|
1855
|
+
for (; i ? n >= a : n > a;) {
|
|
1856
|
+
let i = e[t + 1].from - a;
|
|
1857
|
+
r += i, n += i, t++, a = e[t].to;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
for (let u = n.firstChild; u; u = u.nextSibling) {
|
|
1861
|
+
l(u.from + r, !0);
|
|
1862
|
+
let n = u.from + r, d, f = i.get(u.tree);
|
|
1863
|
+
f ? d = f : u.to + r > a ? (d = Tt(e, t, u, r, i), l(u.to + r, !1)) : d = u.toTree(), o.push(d), s.push(n - c);
|
|
1864
|
+
}
|
|
1865
|
+
return l(n.to + r, !1), new N(n.type, o, s, n.to + r - c, n.tree ? n.tree.propValues : void 0);
|
|
1866
|
+
}
|
|
1867
|
+
var Et = class e extends je {
|
|
1868
|
+
constructor(e, t, n, r, i, a, o, s, c) {
|
|
1869
|
+
super(), this.nodeSet = e, this.blockParsers = t, this.leafBlockParsers = n, this.blockNames = r, this.endLeafBlock = i, this.skipContextMarkup = a, this.inlineParsers = o, this.inlineNames = s, this.wrappers = c, this.nodeTypes = Object.create(null);
|
|
1870
|
+
for (let t of e.types) this.nodeTypes[t.name] = t.id;
|
|
1871
|
+
}
|
|
1872
|
+
createParse(e, t, n) {
|
|
1873
|
+
let r = new wt(this, e, t, n);
|
|
1874
|
+
for (let i of this.wrappers) r = i(r, e, t, n);
|
|
1875
|
+
return r;
|
|
1876
|
+
}
|
|
1877
|
+
configure(t) {
|
|
1878
|
+
let n = Ot(t);
|
|
1879
|
+
if (!n) return this;
|
|
1880
|
+
let { nodeSet: r, skipContextMarkup: i } = this, a = this.blockParsers.slice(), o = this.leafBlockParsers.slice(), s = this.blockNames.slice(), c = this.inlineParsers.slice(), l = this.inlineNames.slice(), u = this.endLeafBlock.slice(), d = this.wrappers;
|
|
1881
|
+
if (Dt(n.defineNodes)) {
|
|
1882
|
+
i = Object.assign({}, i);
|
|
1883
|
+
let e = r.types.slice(), t;
|
|
1884
|
+
for (let r of n.defineNodes) {
|
|
1885
|
+
let { name: n, block: a, composite: o, style: s } = typeof r == "string" ? { name: r } : r;
|
|
1886
|
+
if (e.some((e) => e.name == n)) continue;
|
|
1887
|
+
o && (i[e.length] = (e, t, n) => o(t, n, e.value));
|
|
1888
|
+
let c = e.length, l = o ? ["Block", "BlockContext"] : a ? c >= W.ATXHeading1 && c <= W.SetextHeading2 ? [
|
|
1889
|
+
"Block",
|
|
1890
|
+
"LeafBlock",
|
|
1891
|
+
"Heading"
|
|
1892
|
+
] : ["Block", "LeafBlock"] : void 0;
|
|
1893
|
+
e.push(j.define({
|
|
1894
|
+
id: c,
|
|
1895
|
+
name: n,
|
|
1896
|
+
props: l && [[A.group, l]]
|
|
1897
|
+
})), s && (t ||= {}, Array.isArray(s) || s instanceof F ? t[n] = s : Object.assign(t, s));
|
|
1898
|
+
}
|
|
1899
|
+
r = new le(e), t && (r = r.extend(Re(t)));
|
|
1900
|
+
}
|
|
1901
|
+
if (Dt(n.props) && (r = r.extend(...n.props)), Dt(n.remove)) for (let e of n.remove) {
|
|
1902
|
+
let t = this.blockNames.indexOf(e), n = this.inlineNames.indexOf(e);
|
|
1903
|
+
t > -1 && (a[t] = o[t] = void 0), n > -1 && (c[n] = void 0);
|
|
1904
|
+
}
|
|
1905
|
+
if (Dt(n.parseBlock)) for (let e of n.parseBlock) {
|
|
1906
|
+
let t = s.indexOf(e.name);
|
|
1907
|
+
if (t > -1) a[t] = e.parse, o[t] = e.leaf;
|
|
1908
|
+
else {
|
|
1909
|
+
let t = e.before ? kt(s, e.before) : e.after ? kt(s, e.after) + 1 : s.length - 1;
|
|
1910
|
+
a.splice(t, 0, e.parse), o.splice(t, 0, e.leaf), s.splice(t, 0, e.name);
|
|
1911
|
+
}
|
|
1912
|
+
e.endLeaf && u.push(e.endLeaf);
|
|
1913
|
+
}
|
|
1914
|
+
if (Dt(n.parseInline)) for (let e of n.parseInline) {
|
|
1915
|
+
let t = l.indexOf(e.name);
|
|
1916
|
+
if (t > -1) c[t] = e.parse;
|
|
1917
|
+
else {
|
|
1918
|
+
let t = e.before ? kt(l, e.before) : e.after ? kt(l, e.after) + 1 : l.length - 1;
|
|
1919
|
+
c.splice(t, 0, e.parse), l.splice(t, 0, e.name);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
return n.wrap && (d = d.concat(n.wrap)), new e(r, a, o, s, u, i, c, l, d);
|
|
1923
|
+
}
|
|
1924
|
+
getNodeType(e) {
|
|
1925
|
+
let t = this.nodeTypes[e];
|
|
1926
|
+
if (t == null) throw RangeError(`Unknown node type '${e}'`);
|
|
1927
|
+
return t;
|
|
1928
|
+
}
|
|
1929
|
+
parseInline(e, t) {
|
|
1930
|
+
let n = new Wt(this, e, t);
|
|
1931
|
+
outer: for (let e = t; e < n.end;) {
|
|
1932
|
+
let t = n.char(e);
|
|
1933
|
+
for (let r of this.inlineParsers) if (r) {
|
|
1934
|
+
let i = r(n, t, e);
|
|
1935
|
+
if (i >= 0) {
|
|
1936
|
+
e = i;
|
|
1937
|
+
continue outer;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
e++;
|
|
1941
|
+
}
|
|
1942
|
+
return n.resolveMarkers(0);
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
function Dt(e) {
|
|
1946
|
+
return e != null && e.length > 0;
|
|
1947
|
+
}
|
|
1948
|
+
function Ot(e) {
|
|
1949
|
+
if (!Array.isArray(e)) return e;
|
|
1950
|
+
if (e.length == 0) return null;
|
|
1951
|
+
let t = Ot(e[0]);
|
|
1952
|
+
if (e.length == 1) return t;
|
|
1953
|
+
let n = Ot(e.slice(1));
|
|
1954
|
+
if (!n || !t) return t || n;
|
|
1955
|
+
let r = (e, t) => (e || q).concat(t || q), i = t.wrap, a = n.wrap;
|
|
1956
|
+
return {
|
|
1957
|
+
props: r(t.props, n.props),
|
|
1958
|
+
defineNodes: r(t.defineNodes, n.defineNodes),
|
|
1959
|
+
parseBlock: r(t.parseBlock, n.parseBlock),
|
|
1960
|
+
parseInline: r(t.parseInline, n.parseInline),
|
|
1961
|
+
remove: r(t.remove, n.remove),
|
|
1962
|
+
wrap: i ? a ? (e, t, n, r) => i(a(e, t, n, r), t, n, r) : i : a
|
|
1963
|
+
};
|
|
1964
|
+
}
|
|
1965
|
+
function kt(e, t) {
|
|
1966
|
+
let n = e.indexOf(t);
|
|
1967
|
+
if (n < 0) throw RangeError(`Position specified relative to unknown parser ${t}`);
|
|
1968
|
+
return n;
|
|
1969
|
+
}
|
|
1970
|
+
var At = [j.none];
|
|
1971
|
+
for (let e = 1, t; t = W[e]; e++) At[e] = j.define({
|
|
1972
|
+
id: e,
|
|
1973
|
+
name: t,
|
|
1974
|
+
props: e >= W.Escape ? [] : [[A.group, e in et ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]],
|
|
1975
|
+
top: t == "Document"
|
|
1976
|
+
});
|
|
1977
|
+
var q = [], jt = class {
|
|
1978
|
+
constructor(e) {
|
|
1979
|
+
this.nodeSet = e, this.content = [], this.nodes = [];
|
|
1980
|
+
}
|
|
1981
|
+
write(e, t, n, r = 0) {
|
|
1982
|
+
return this.content.push(e, t, n, 4 + r * 4), this;
|
|
1983
|
+
}
|
|
1984
|
+
writeElements(e, t = 0) {
|
|
1985
|
+
for (let n of e) n.writeTo(this, t);
|
|
1986
|
+
return this;
|
|
1987
|
+
}
|
|
1988
|
+
finish(e, t) {
|
|
1989
|
+
return N.build({
|
|
1990
|
+
buffer: this.content,
|
|
1991
|
+
nodeSet: this.nodeSet,
|
|
1992
|
+
reused: this.nodes,
|
|
1993
|
+
topID: e,
|
|
1994
|
+
length: t
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
}, Mt = class {
|
|
1998
|
+
constructor(e, t, n, r = q) {
|
|
1999
|
+
this.type = e, this.from = t, this.to = n, this.children = r;
|
|
2000
|
+
}
|
|
2001
|
+
writeTo(e, t) {
|
|
2002
|
+
let n = e.content.length;
|
|
2003
|
+
e.writeElements(this.children, t), e.content.push(this.type, this.from + t, this.to + t, e.content.length + 4 - n);
|
|
2004
|
+
}
|
|
2005
|
+
toTree(e) {
|
|
2006
|
+
return new jt(e).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
|
|
2007
|
+
}
|
|
2008
|
+
}, Nt = class {
|
|
2009
|
+
constructor(e, t) {
|
|
2010
|
+
this.tree = e, this.from = t;
|
|
2011
|
+
}
|
|
2012
|
+
get to() {
|
|
2013
|
+
return this.from + this.tree.length;
|
|
2014
|
+
}
|
|
2015
|
+
get type() {
|
|
2016
|
+
return this.tree.type.id;
|
|
2017
|
+
}
|
|
2018
|
+
get children() {
|
|
2019
|
+
return q;
|
|
2020
|
+
}
|
|
2021
|
+
writeTo(e, t) {
|
|
2022
|
+
e.nodes.push(this.tree), e.content.push(e.nodes.length - 1, this.from + t, this.to + t, -1);
|
|
2023
|
+
}
|
|
2024
|
+
toTree() {
|
|
2025
|
+
return this.tree;
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
function J(e, t, n, r) {
|
|
2029
|
+
return new Mt(e, t, n, r);
|
|
2030
|
+
}
|
|
2031
|
+
var Pt = {
|
|
2032
|
+
resolve: "Emphasis",
|
|
2033
|
+
mark: "EmphasisMark"
|
|
2034
|
+
}, Ft = {
|
|
2035
|
+
resolve: "Emphasis",
|
|
2036
|
+
mark: "EmphasisMark"
|
|
2037
|
+
}, Y = {}, It = {}, X = class {
|
|
2038
|
+
constructor(e, t, n, r, i = n - t) {
|
|
2039
|
+
this.type = e, this.from = t, this.to = n, this.side = r, this.size = i;
|
|
2040
|
+
}
|
|
2041
|
+
}, Lt = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", Rt = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;
|
|
2042
|
+
try {
|
|
2043
|
+
Rt = /* @__PURE__ */ RegExp("[\\p{S}|\\p{P}]", "u");
|
|
2044
|
+
} catch {}
|
|
2045
|
+
var zt = {
|
|
2046
|
+
Escape(e, t, n) {
|
|
2047
|
+
if (t != 92 || n == e.end - 1) return -1;
|
|
2048
|
+
let r = e.char(n + 1);
|
|
2049
|
+
for (let t = 0; t < 32; t++) if (Lt.charCodeAt(t) == r) return e.append(J(W.Escape, n, n + 2));
|
|
2050
|
+
return -1;
|
|
2051
|
+
},
|
|
2052
|
+
Entity(e, t, n) {
|
|
2053
|
+
if (t != 38) return -1;
|
|
2054
|
+
let r = /^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n + 1, n + 31));
|
|
2055
|
+
return r ? e.append(J(W.Entity, n, n + 1 + r[0].length)) : -1;
|
|
2056
|
+
},
|
|
2057
|
+
InlineCode(e, t, n) {
|
|
2058
|
+
if (t != 96 || n && e.char(n - 1) == 96) return -1;
|
|
2059
|
+
let r = n + 1;
|
|
2060
|
+
for (; r < e.end && e.char(r) == 96;) r++;
|
|
2061
|
+
let i = r - n, a = 0;
|
|
2062
|
+
for (; r < e.end; r++) if (e.char(r) == 96) {
|
|
2063
|
+
if (a++, a == i && e.char(r + 1) != 96) return e.append(J(W.InlineCode, n, r + 1, [J(W.CodeMark, n, n + i), J(W.CodeMark, r + 1 - i, r + 1)]));
|
|
2064
|
+
} else a = 0;
|
|
2065
|
+
return -1;
|
|
2066
|
+
},
|
|
2067
|
+
HTMLTag(e, t, n) {
|
|
2068
|
+
if (t != 60 || n == e.end - 1) return -1;
|
|
2069
|
+
let r = e.slice(n + 1, e.end), i = /^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);
|
|
2070
|
+
if (i) return e.append(J(W.Autolink, n, n + 1 + i[0].length, [
|
|
2071
|
+
J(W.LinkMark, n, n + 1),
|
|
2072
|
+
J(W.URL, n + 1, n + i[0].length),
|
|
2073
|
+
J(W.LinkMark, n + i[0].length, n + 1 + i[0].length)
|
|
2074
|
+
]));
|
|
2075
|
+
let a = /^!--(?:-?>|[^]*?-->)/.exec(r);
|
|
2076
|
+
if (a) return e.append(J(W.Comment, n, n + 1 + a[0].length));
|
|
2077
|
+
let o = /^\?[^]*?\?>/.exec(r);
|
|
2078
|
+
if (o) return e.append(J(W.ProcessingInstruction, n, n + 1 + o[0].length));
|
|
2079
|
+
let s = /^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/[a-zA-Z][\w-]*\s*>|[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>)/.exec(r);
|
|
2080
|
+
return s ? e.append(J(W.HTMLTag, n, n + 1 + s[0].length)) : -1;
|
|
2081
|
+
},
|
|
2082
|
+
Emphasis(e, t, n) {
|
|
2083
|
+
if (t != 95 && t != 42) return -1;
|
|
2084
|
+
let r = n + 1;
|
|
2085
|
+
for (; e.char(r) == t;) r++;
|
|
2086
|
+
let i = e.slice(n - 1, n), a = e.slice(r, r + 1), o = Rt.test(i), s = Rt.test(a), c = /\s|^$/.test(i), l = /\s|^$/.test(a), u = !l && (!s || c || o), d = !c && (!o || l || s), f = u && (t == 42 || !d || o), p = d && (t == 42 || !u || s);
|
|
2087
|
+
return e.append(new X(t == 95 ? Pt : Ft, n, r, !!f | (p ? 2 : 0)));
|
|
2088
|
+
},
|
|
2089
|
+
HardBreak(e, t, n) {
|
|
2090
|
+
if (t == 92 && e.char(n + 1) == 10) return e.append(J(W.HardBreak, n, n + 2));
|
|
2091
|
+
if (t == 32) {
|
|
2092
|
+
let t = n + 1;
|
|
2093
|
+
for (; e.char(t) == 32;) t++;
|
|
2094
|
+
if (e.char(t) == 10 && t >= n + 2) return e.append(J(W.HardBreak, n, t + 1));
|
|
2095
|
+
}
|
|
2096
|
+
return -1;
|
|
2097
|
+
},
|
|
2098
|
+
Link(e, t, n) {
|
|
2099
|
+
return t == 91 ? e.append(new X(Y, n, n + 1, 1)) : -1;
|
|
2100
|
+
},
|
|
2101
|
+
Image(e, t, n) {
|
|
2102
|
+
return t == 33 && e.char(n + 1) == 91 ? e.append(new X(It, n, n + 2, 1)) : -1;
|
|
2103
|
+
},
|
|
2104
|
+
LinkEnd(e, t, n) {
|
|
2105
|
+
if (t != 93) return -1;
|
|
2106
|
+
for (let t = e.parts.length - 1; t >= 0; t--) {
|
|
2107
|
+
let r = e.parts[t];
|
|
2108
|
+
if (r instanceof X && (r.type == Y || r.type == It)) {
|
|
2109
|
+
if (!r.side || e.skipSpace(r.to) == n && !/[(\[]/.test(e.slice(n + 1, n + 2))) return e.parts[t] = null, -1;
|
|
2110
|
+
let i = e.takeContent(t), a = e.parts[t] = Bt(e, i, r.type == Y ? W.Link : W.Image, r.from, n + 1);
|
|
2111
|
+
if (r.type == Y) for (let n = 0; n < t; n++) {
|
|
2112
|
+
let t = e.parts[n];
|
|
2113
|
+
t instanceof X && t.type == Y && (t.side = 0);
|
|
2114
|
+
}
|
|
2115
|
+
return a.to;
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
return -1;
|
|
2119
|
+
}
|
|
2120
|
+
};
|
|
2121
|
+
function Bt(e, t, n, r, i) {
|
|
2122
|
+
let { text: a } = e, o = e.char(i), s = i;
|
|
2123
|
+
if (t.unshift(J(W.LinkMark, r, r + (n == W.Image ? 2 : 1))), t.push(J(W.LinkMark, i - 1, i)), o == 40) {
|
|
2124
|
+
let n = e.skipSpace(i + 1), r = Vt(a, n - e.offset, e.offset), o;
|
|
2125
|
+
r && (n = e.skipSpace(r.to), n != r.to && (o = Ht(a, n - e.offset, e.offset), o && (n = e.skipSpace(o.to)))), e.char(n) == 41 && (t.push(J(W.LinkMark, i, i + 1)), s = n + 1, r && t.push(r), o && t.push(o), t.push(J(W.LinkMark, n, s)));
|
|
2126
|
+
} else if (o == 91) {
|
|
2127
|
+
let n = Ut(a, i - e.offset, e.offset, !1);
|
|
2128
|
+
n && (t.push(n), s = n.to);
|
|
2129
|
+
}
|
|
2130
|
+
return J(n, r, s, t);
|
|
2131
|
+
}
|
|
2132
|
+
function Vt(e, t, n) {
|
|
2133
|
+
if (e.charCodeAt(t) == 60) {
|
|
2134
|
+
for (let r = t + 1, i = !1; r < e.length; r++) {
|
|
2135
|
+
let a = e.charCodeAt(r);
|
|
2136
|
+
if (a == 62 && !i) return J(W.URL, t + n, r + 1 + n);
|
|
2137
|
+
if (a == 60 && !i || a == 10) return !1;
|
|
2138
|
+
i = a == 92;
|
|
2139
|
+
}
|
|
2140
|
+
return null;
|
|
2141
|
+
}
|
|
2142
|
+
{
|
|
2143
|
+
let r = 0, i = t;
|
|
2144
|
+
for (let t = !1; i < e.length; i++) {
|
|
2145
|
+
let n = e.charCodeAt(i);
|
|
2146
|
+
if (G(n)) break;
|
|
2147
|
+
if (t) t = !1;
|
|
2148
|
+
else if (n == 40) r++;
|
|
2149
|
+
else if (n == 41) {
|
|
2150
|
+
if (!r) break;
|
|
2151
|
+
r--;
|
|
2152
|
+
} else n == 92 && (t = !0);
|
|
2153
|
+
}
|
|
2154
|
+
return i > t ? J(W.URL, t + n, i + n) : i == e.length && null;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function Ht(e, t, n) {
|
|
2158
|
+
let r = e.charCodeAt(t);
|
|
2159
|
+
if (r != 39 && r != 34 && r != 40) return !1;
|
|
2160
|
+
let i = r == 40 ? 41 : r;
|
|
2161
|
+
for (let r = t + 1, a = !1; r < e.length; r++) {
|
|
2162
|
+
let o = e.charCodeAt(r);
|
|
2163
|
+
if (a) a = !1;
|
|
2164
|
+
else if (o == i) return J(W.LinkTitle, t + n, r + 1 + n);
|
|
2165
|
+
else o == 92 && (a = !0);
|
|
2166
|
+
}
|
|
2167
|
+
return null;
|
|
2168
|
+
}
|
|
2169
|
+
function Ut(e, t, n, r) {
|
|
2170
|
+
for (let i = !1, a = t + 1, o = Math.min(e.length, a + 999); a < o; a++) {
|
|
2171
|
+
let o = e.charCodeAt(a);
|
|
2172
|
+
if (i) i = !1;
|
|
2173
|
+
else if (o == 93) return !r && J(W.LinkLabel, t + n, a + 1 + n);
|
|
2174
|
+
else {
|
|
2175
|
+
if (r && !G(o) && (r = !1), o == 91) return !1;
|
|
2176
|
+
o == 92 && (i = !0);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
return null;
|
|
2180
|
+
}
|
|
2181
|
+
var Wt = class {
|
|
2182
|
+
constructor(e, t, n) {
|
|
2183
|
+
this.parser = e, this.text = t, this.offset = n, this.parts = [];
|
|
2184
|
+
}
|
|
2185
|
+
char(e) {
|
|
2186
|
+
return e >= this.end ? -1 : this.text.charCodeAt(e - this.offset);
|
|
2187
|
+
}
|
|
2188
|
+
get end() {
|
|
2189
|
+
return this.offset + this.text.length;
|
|
2190
|
+
}
|
|
2191
|
+
slice(e, t) {
|
|
2192
|
+
return this.text.slice(e - this.offset, t - this.offset);
|
|
2193
|
+
}
|
|
2194
|
+
append(e) {
|
|
2195
|
+
return this.parts.push(e), e.to;
|
|
2196
|
+
}
|
|
2197
|
+
addDelimiter(e, t, n, r, i) {
|
|
2198
|
+
return this.append(new X(e, t, n, !!r | (i ? 2 : 0)));
|
|
2199
|
+
}
|
|
2200
|
+
get hasOpenLink() {
|
|
2201
|
+
for (let e = this.parts.length - 1; e >= 0; e--) {
|
|
2202
|
+
let t = this.parts[e];
|
|
2203
|
+
if (t instanceof X && (t.type == Y || t.type == It)) return !0;
|
|
2204
|
+
}
|
|
2205
|
+
return !1;
|
|
2206
|
+
}
|
|
2207
|
+
addElement(e) {
|
|
2208
|
+
return this.append(e);
|
|
2209
|
+
}
|
|
2210
|
+
resolveMarkers(e) {
|
|
2211
|
+
for (let t = e; t < this.parts.length; t++) {
|
|
2212
|
+
let n = this.parts[t];
|
|
2213
|
+
if (!(n instanceof X && n.type.resolve && n.side & 2)) continue;
|
|
2214
|
+
let r = n.type == Pt || n.type == Ft, i = n.to - n.from, a, o = t - 1;
|
|
2215
|
+
for (; o >= e; o--) {
|
|
2216
|
+
let e = this.parts[o];
|
|
2217
|
+
if (e instanceof X && e.side & 1 && e.type == n.type && !(r && (n.side & 1 || e.side & 2) && (e.size + n.size) % 3 == 0 && (e.size % 3 || n.size % 3))) {
|
|
2218
|
+
a = e;
|
|
2219
|
+
break;
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
if (!a) continue;
|
|
2223
|
+
let s = n.type.resolve, c = [], l = a.from, u = n.to;
|
|
2224
|
+
if (r) {
|
|
2225
|
+
let e = Math.min(2, a.to - a.from, i);
|
|
2226
|
+
l = a.to - e, u = n.from + e, s = e == 1 ? "Emphasis" : "StrongEmphasis";
|
|
2227
|
+
}
|
|
2228
|
+
a.type.mark && c.push(this.elt(a.type.mark, l, a.to));
|
|
2229
|
+
for (let e = o + 1; e < t; e++) this.parts[e] instanceof Mt && c.push(this.parts[e]), this.parts[e] = null;
|
|
2230
|
+
n.type.mark && c.push(this.elt(n.type.mark, n.from, u));
|
|
2231
|
+
let d = this.elt(s, l, u, c);
|
|
2232
|
+
this.parts[o] = r && a.from != l ? new X(a.type, a.from, l, a.side, a.size) : null, (this.parts[t] = r && n.to != u ? new X(n.type, u, n.to, n.side, n.size) : null) ? this.parts.splice(t, 0, d) : this.parts[t] = d;
|
|
2233
|
+
}
|
|
2234
|
+
let t = [];
|
|
2235
|
+
for (let n = e; n < this.parts.length; n++) {
|
|
2236
|
+
let e = this.parts[n];
|
|
2237
|
+
e instanceof Mt && t.push(e);
|
|
2238
|
+
}
|
|
2239
|
+
return t;
|
|
2240
|
+
}
|
|
2241
|
+
findOpeningDelimiter(e) {
|
|
2242
|
+
for (let t = this.parts.length - 1; t >= 0; t--) {
|
|
2243
|
+
let n = this.parts[t];
|
|
2244
|
+
if (n instanceof X && n.type == e && n.side & 1) return t;
|
|
2245
|
+
}
|
|
2246
|
+
return null;
|
|
2247
|
+
}
|
|
2248
|
+
takeContent(e) {
|
|
2249
|
+
let t = this.resolveMarkers(e);
|
|
2250
|
+
return this.parts.length = e, t;
|
|
2251
|
+
}
|
|
2252
|
+
getDelimiterAt(e) {
|
|
2253
|
+
let t = this.parts[e];
|
|
2254
|
+
return t instanceof X ? t : null;
|
|
2255
|
+
}
|
|
2256
|
+
skipSpace(e) {
|
|
2257
|
+
return tt(this.text, e - this.offset) + this.offset;
|
|
2258
|
+
}
|
|
2259
|
+
elt(e, t, n, r) {
|
|
2260
|
+
return typeof e == "string" ? J(this.parser.getNodeType(e), t, n, r) : new Nt(e, t);
|
|
2261
|
+
}
|
|
2262
|
+
};
|
|
2263
|
+
Wt.linkStart = Y, Wt.imageStart = It, Wt.emphasisAsterisk = Ft, Wt.emphasisUnderscore = Pt;
|
|
2264
|
+
function Gt(e, t) {
|
|
2265
|
+
if (!t.length) return e;
|
|
2266
|
+
if (!e.length) return t;
|
|
2267
|
+
let n = e.slice(), r = 0;
|
|
2268
|
+
for (let e of t) {
|
|
2269
|
+
for (; r < n.length && n[r].to < e.to;) r++;
|
|
2270
|
+
if (r < n.length && n[r].from < e.from) {
|
|
2271
|
+
let t = n[r];
|
|
2272
|
+
t instanceof Mt && (n[r] = new Mt(t.type, t.from, t.to, Gt(t.children, [e])));
|
|
2273
|
+
} else n.splice(r++, 0, e);
|
|
2274
|
+
}
|
|
2275
|
+
return n;
|
|
2276
|
+
}
|
|
2277
|
+
var Kt = [
|
|
2278
|
+
W.CodeBlock,
|
|
2279
|
+
W.ListItem,
|
|
2280
|
+
W.OrderedList,
|
|
2281
|
+
W.BulletList
|
|
2282
|
+
], qt = class {
|
|
2283
|
+
constructor(e, t) {
|
|
2284
|
+
this.fragments = e, this.input = t, this.i = 0, this.fragment = null, this.fragmentEnd = -1, this.cursor = null, e.length && (this.fragment = e[this.i++]);
|
|
2285
|
+
}
|
|
2286
|
+
nextFragment() {
|
|
2287
|
+
this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null, this.cursor = null, this.fragmentEnd = -1;
|
|
2288
|
+
}
|
|
2289
|
+
moveTo(e, t) {
|
|
2290
|
+
for (; this.fragment && this.fragment.to <= e;) this.nextFragment();
|
|
2291
|
+
if (!this.fragment || this.fragment.from > (e ? e - 1 : 0)) return !1;
|
|
2292
|
+
if (this.fragmentEnd < 0) {
|
|
2293
|
+
let e = this.fragment.to;
|
|
2294
|
+
for (; e > 0 && this.input.read(e - 1, e) != "\n";) e--;
|
|
2295
|
+
this.fragmentEnd = e ? e - 1 : 0;
|
|
2296
|
+
}
|
|
2297
|
+
let n = this.cursor;
|
|
2298
|
+
n || (n = this.cursor = this.fragment.tree.cursor(M.IncludeAnonymous | M.IgnoreMounts), n.firstChild());
|
|
2299
|
+
let r = e + this.fragment.offset;
|
|
2300
|
+
for (; n.to <= r;) if (!n.parent()) return !1;
|
|
2301
|
+
for (;;) {
|
|
2302
|
+
if (n.from >= r) return this.fragment.from <= t;
|
|
2303
|
+
if (!n.childAfter(r)) return !1;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
matches(e) {
|
|
2307
|
+
let t = this.cursor.tree;
|
|
2308
|
+
for (; t && t.type.isAnonymous && t.children[0] instanceof N;) t = t.children[0];
|
|
2309
|
+
return t && t.prop(A.contextHash) == e;
|
|
2310
|
+
}
|
|
2311
|
+
takeNodes(e) {
|
|
2312
|
+
let t = this.cursor, n = this.fragment.offset, r = this.fragmentEnd - +!!this.fragment.openEnd, i = e.absoluteLineStart, a = i, o = e.block.children.length, s = e.lineStart - e.block.from >> 2, c = a, l = o;
|
|
2313
|
+
scan: for (;;) {
|
|
2314
|
+
if (t.to - n > Math.min(r, e.to) || t.type.isAnonymous && t.tree && (t.to - t.from > s || !Jt(t.tree))) {
|
|
2315
|
+
if (t.type.isAnonymous && t.firstChild()) continue;
|
|
2316
|
+
break;
|
|
2317
|
+
}
|
|
2318
|
+
let i = Yt(t.from - n, e.ranges);
|
|
2319
|
+
if (t.to - n <= e.ranges[e.rangeI].to) e.addNode(t.tree, i);
|
|
2320
|
+
else {
|
|
2321
|
+
let n = new N(e.parser.nodeSet.types[W.Paragraph], [], [], 0, e.block.hashProp);
|
|
2322
|
+
e.reusePlaceholders.set(n, t.tree), e.addNode(n, i);
|
|
2323
|
+
}
|
|
2324
|
+
for ((t.type.isAnonymous || t.type.is("Block")) && (t.type.isAnonymous || Kt.indexOf(t.type.id) < 0 ? (a = t.to - n, o = e.block.children.length) : (a = c, o = l), c = t.to - n, l = e.block.children.length);;) {
|
|
2325
|
+
if (t.nextSibling()) continue scan;
|
|
2326
|
+
if (!t.parent() || !t.type.isAnonymous) break scan;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
for (; e.block.children.length > o;) e.block.children.pop(), e.block.positions.pop();
|
|
2330
|
+
return a - i;
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
function Jt(e) {
|
|
2334
|
+
for (; e.type.isAnonymous;) {
|
|
2335
|
+
let t = e.children[e.children.length - 1];
|
|
2336
|
+
if (t instanceof N) e = t;
|
|
2337
|
+
else return !1;
|
|
2338
|
+
}
|
|
2339
|
+
return e.type.is("Block") && Kt.indexOf(e.type.id) < 0;
|
|
2340
|
+
}
|
|
2341
|
+
function Yt(e, t) {
|
|
2342
|
+
let n = e;
|
|
2343
|
+
for (let r = 1; r < t.length; r++) {
|
|
2344
|
+
let i = t[r - 1].to, a = t[r].from;
|
|
2345
|
+
i < e && (n -= a - i);
|
|
2346
|
+
}
|
|
2347
|
+
return n;
|
|
2348
|
+
}
|
|
2349
|
+
var Xt = Re({
|
|
2350
|
+
"Blockquote/...": U.quote,
|
|
2351
|
+
HorizontalRule: U.contentSeparator,
|
|
2352
|
+
"ATXHeading1/... SetextHeading1/...": U.heading1,
|
|
2353
|
+
"ATXHeading2/... SetextHeading2/...": U.heading2,
|
|
2354
|
+
"ATXHeading3/...": U.heading3,
|
|
2355
|
+
"ATXHeading4/...": U.heading4,
|
|
2356
|
+
"ATXHeading5/...": U.heading5,
|
|
2357
|
+
"ATXHeading6/...": U.heading6,
|
|
2358
|
+
"Comment CommentBlock": U.comment,
|
|
2359
|
+
Escape: U.escape,
|
|
2360
|
+
Entity: U.character,
|
|
2361
|
+
"Emphasis/...": U.emphasis,
|
|
2362
|
+
"StrongEmphasis/...": U.strong,
|
|
2363
|
+
"Link/... Image/...": U.link,
|
|
2364
|
+
"OrderedList/... BulletList/...": U.list,
|
|
2365
|
+
"BlockQuote/...": U.quote,
|
|
2366
|
+
"InlineCode CodeText": U.monospace,
|
|
2367
|
+
"URL Autolink": U.url,
|
|
2368
|
+
"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": U.processingInstruction,
|
|
2369
|
+
"CodeInfo LinkLabel": U.labelName,
|
|
2370
|
+
LinkTitle: U.string,
|
|
2371
|
+
Paragraph: U.content
|
|
2372
|
+
}), Zt = new Et(new le(At).extend(Xt), Object.keys(_t).map((e) => _t[e]), Object.keys(_t).map((e) => xt[e]), Object.keys(_t), St, et, Object.keys(zt).map((e) => zt[e]), Object.keys(zt), []), Qt = {
|
|
2373
|
+
resolve: "Strikethrough",
|
|
2374
|
+
mark: "StrikethroughMark"
|
|
2375
|
+
}, $t = {
|
|
2376
|
+
defineNodes: [{
|
|
2377
|
+
name: "Strikethrough",
|
|
2378
|
+
style: { "Strikethrough/...": U.strikethrough }
|
|
2379
|
+
}, {
|
|
2380
|
+
name: "StrikethroughMark",
|
|
2381
|
+
style: U.processingInstruction
|
|
2382
|
+
}],
|
|
2383
|
+
parseInline: [{
|
|
2384
|
+
name: "Strikethrough",
|
|
2385
|
+
parse(e, t, n) {
|
|
2386
|
+
if (t != 126 || e.char(n + 1) != 126 || e.char(n + 2) == 126) return -1;
|
|
2387
|
+
let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s = Rt.test(r), c = Rt.test(i);
|
|
2388
|
+
return e.addDelimiter(Qt, n, n + 2, !o && (!c || a || s), !a && (!s || o || c));
|
|
2389
|
+
},
|
|
2390
|
+
after: "Emphasis"
|
|
2391
|
+
}]
|
|
2392
|
+
};
|
|
2393
|
+
function en(e, t, n = 0, r, i = 0) {
|
|
2394
|
+
let a = 0, o = !0, s = -1, c = -1, l = !1, u = () => {
|
|
2395
|
+
r.push(e.elt("TableCell", i + s, i + c, e.parser.parseInline(t.slice(s, c), i + s)));
|
|
2396
|
+
};
|
|
2397
|
+
for (let d = n; d < t.length; d++) {
|
|
2398
|
+
let n = t.charCodeAt(d);
|
|
2399
|
+
n == 124 && !l ? ((!o || s > -1) && a++, o = !1, r && (s > -1 && u(), r.push(e.elt("TableDelimiter", d + i, d + i + 1))), s = c = -1) : (l || n != 32 && n != 9) && (s < 0 && (s = d), c = d + 1), l = !l && n == 92;
|
|
2400
|
+
}
|
|
2401
|
+
return s > -1 && (a++, r && u()), a;
|
|
2402
|
+
}
|
|
2403
|
+
function tn(e, t) {
|
|
2404
|
+
for (let n = t; n < e.length; n++) {
|
|
2405
|
+
let t = e.charCodeAt(n);
|
|
2406
|
+
if (t == 124) return !0;
|
|
2407
|
+
t == 92 && n++;
|
|
2408
|
+
}
|
|
2409
|
+
return !1;
|
|
2410
|
+
}
|
|
2411
|
+
var nn = /^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/, rn = class {
|
|
2412
|
+
constructor() {
|
|
2413
|
+
this.rows = null;
|
|
2414
|
+
}
|
|
2415
|
+
nextLine(e, t, n) {
|
|
2416
|
+
if (this.rows == null) {
|
|
2417
|
+
this.rows = !1;
|
|
2418
|
+
let r;
|
|
2419
|
+
if ((t.next == 45 || t.next == 58 || t.next == 124) && nn.test(r = t.text.slice(t.pos))) {
|
|
2420
|
+
let i = [];
|
|
2421
|
+
en(e, n.content, 0, i, n.start) == en(e, r, 0) && (this.rows = [e.elt("TableHeader", n.start, n.start + n.content.length, i), e.elt("TableDelimiter", e.lineStart + t.pos, e.lineStart + t.text.length)]);
|
|
2422
|
+
}
|
|
2423
|
+
} else if (this.rows) {
|
|
2424
|
+
let n = [];
|
|
2425
|
+
en(e, t.text, t.pos, n, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + t.pos, e.lineStart + t.text.length, n));
|
|
2426
|
+
}
|
|
2427
|
+
return !1;
|
|
2428
|
+
}
|
|
2429
|
+
finish(e, t) {
|
|
2430
|
+
return this.rows ? (e.addLeafElement(t, e.elt("Table", t.start, t.start + t.content.length, this.rows)), !0) : !1;
|
|
2431
|
+
}
|
|
2432
|
+
}, an = {
|
|
2433
|
+
defineNodes: [
|
|
2434
|
+
{
|
|
2435
|
+
name: "Table",
|
|
2436
|
+
block: !0
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
name: "TableHeader",
|
|
2440
|
+
style: { "TableHeader/...": U.heading }
|
|
2441
|
+
},
|
|
2442
|
+
"TableRow",
|
|
2443
|
+
{
|
|
2444
|
+
name: "TableCell",
|
|
2445
|
+
style: U.content
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
name: "TableDelimiter",
|
|
2449
|
+
style: U.processingInstruction
|
|
2450
|
+
}
|
|
2451
|
+
],
|
|
2452
|
+
parseBlock: [{
|
|
2453
|
+
name: "Table",
|
|
2454
|
+
leaf(e, t) {
|
|
2455
|
+
return tn(t.content, 0) ? new rn() : null;
|
|
2456
|
+
},
|
|
2457
|
+
endLeaf(e, t, n) {
|
|
2458
|
+
if (n.parsers.some((e) => e instanceof rn) || !tn(t.text, t.basePos)) return !1;
|
|
2459
|
+
let r = e.peekLine();
|
|
2460
|
+
return nn.test(r) && en(e, t.text, t.basePos) == en(e, r, t.basePos);
|
|
2461
|
+
},
|
|
2462
|
+
before: "SetextHeading"
|
|
2463
|
+
}]
|
|
2464
|
+
}, on = class {
|
|
2465
|
+
nextLine() {
|
|
2466
|
+
return !1;
|
|
2467
|
+
}
|
|
2468
|
+
finish(e, t) {
|
|
2469
|
+
return e.addLeafElement(t, e.elt("Task", t.start, t.start + t.content.length, [e.elt("TaskMarker", t.start, t.start + 3), ...e.parser.parseInline(t.content.slice(3), t.start + 3)])), !0;
|
|
2470
|
+
}
|
|
2471
|
+
}, sn = {
|
|
2472
|
+
defineNodes: [{
|
|
2473
|
+
name: "Task",
|
|
2474
|
+
block: !0,
|
|
2475
|
+
style: U.list
|
|
2476
|
+
}, {
|
|
2477
|
+
name: "TaskMarker",
|
|
2478
|
+
style: U.atom
|
|
2479
|
+
}],
|
|
2480
|
+
parseBlock: [{
|
|
2481
|
+
name: "TaskList",
|
|
2482
|
+
leaf(e, t) {
|
|
2483
|
+
return /^\[[ xX]\][ \t]/.test(t.content) && e.parentType().name == "ListItem" ? new on() : null;
|
|
2484
|
+
},
|
|
2485
|
+
after: "SetextHeading"
|
|
2486
|
+
}]
|
|
2487
|
+
}, cn = /(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy, ln = /[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy, un = /[\w-]+\.[\w-]+($|[/:])/, dn = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, fn = /\/[a-zA-Z\d@.]+/gy;
|
|
2488
|
+
function pn(e, t, n, r) {
|
|
2489
|
+
let i = 0;
|
|
2490
|
+
for (let a = t; a < n; a++) e[a] == r && i++;
|
|
2491
|
+
return i;
|
|
2492
|
+
}
|
|
2493
|
+
function mn(e, t) {
|
|
2494
|
+
ln.lastIndex = t;
|
|
2495
|
+
let n = ln.exec(e);
|
|
2496
|
+
if (!n || un.exec(n[0])[0].indexOf("_") > -1) return -1;
|
|
2497
|
+
let r = t + n[0].length;
|
|
2498
|
+
for (;;) {
|
|
2499
|
+
let n = e[r - 1], i;
|
|
2500
|
+
if (/[?!.,:*_~]/.test(n) || n == ")" && pn(e, t, r, ")") > pn(e, t, r, "(")) r--;
|
|
2501
|
+
else if (n == ";" && (i = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t, r)))) r = t + i.index;
|
|
2502
|
+
else break;
|
|
2503
|
+
}
|
|
2504
|
+
return r;
|
|
2505
|
+
}
|
|
2506
|
+
function hn(e, t) {
|
|
2507
|
+
dn.lastIndex = t;
|
|
2508
|
+
let n = dn.exec(e);
|
|
2509
|
+
if (!n) return -1;
|
|
2510
|
+
let r = n[0][n[0].length - 1];
|
|
2511
|
+
return r == "_" || r == "-" ? -1 : t + n[0].length - +(r == ".");
|
|
2512
|
+
}
|
|
2513
|
+
var gn = [
|
|
2514
|
+
an,
|
|
2515
|
+
sn,
|
|
2516
|
+
$t,
|
|
2517
|
+
{ parseInline: [{
|
|
2518
|
+
name: "Autolink",
|
|
2519
|
+
parse(e, t, n) {
|
|
2520
|
+
let r = n - e.offset;
|
|
2521
|
+
if (r && /\w/.test(e.text[r - 1])) return -1;
|
|
2522
|
+
cn.lastIndex = r;
|
|
2523
|
+
let i = cn.exec(e.text), a = -1;
|
|
2524
|
+
return !i || (i[1] || i[2] ? (a = mn(e.text, r + i[0].length), a > -1 && e.hasOpenLink && (a = r + /([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r, a))[0].length)) : i[3] ? a = hn(e.text, r) : (a = hn(e.text, r + i[0].length), a > -1 && i[0] == "xmpp:" && (fn.lastIndex = a, i = fn.exec(e.text), i && (a = i.index + i[0].length))), a < 0) ? -1 : (e.addElement(e.elt("URL", n, a + e.offset)), a + e.offset);
|
|
2525
|
+
}
|
|
2526
|
+
}] }
|
|
2527
|
+
];
|
|
2528
|
+
U.special(U.content), U.processingInstruction, U.special(U.content), U.processingInstruction, U.character;
|
|
2529
|
+
// node_modules/ccount/index.js
|
|
2530
|
+
function _n(e, t) {
|
|
2531
|
+
let n = String(e);
|
|
2532
|
+
if (typeof t != "string") throw TypeError("Expected character");
|
|
2533
|
+
let r = 0, i = n.indexOf(t);
|
|
2534
|
+
for (; i !== -1;) r++, i = n.indexOf(t, i + t.length);
|
|
2535
|
+
return r;
|
|
2536
|
+
}
|
|
2537
|
+
// node_modules/escape-string-regexp/index.js
|
|
2538
|
+
function vn(e) {
|
|
2539
|
+
if (typeof e != "string") throw TypeError("Expected a string");
|
|
2540
|
+
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2541
|
+
}
|
|
2542
|
+
// node_modules/unist-util-is/lib/index.js
|
|
2543
|
+
var yn = (function(e) {
|
|
2544
|
+
if (e == null) return wn;
|
|
2545
|
+
if (typeof e == "function") return Cn(e);
|
|
2546
|
+
if (typeof e == "object") return Array.isArray(e) ? bn(e) : xn(e);
|
|
2547
|
+
if (typeof e == "string") return Sn(e);
|
|
2548
|
+
throw Error("Expected function, string, or object as test");
|
|
2549
|
+
});
|
|
2550
|
+
function bn(e) {
|
|
2551
|
+
let t = [], n = -1;
|
|
2552
|
+
for (; ++n < e.length;) t[n] = yn(e[n]);
|
|
2553
|
+
return Cn(r);
|
|
2554
|
+
function r(...e) {
|
|
2555
|
+
let n = -1;
|
|
2556
|
+
for (; ++n < t.length;) if (t[n].apply(this, e)) return !0;
|
|
2557
|
+
return !1;
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
function xn(e) {
|
|
2561
|
+
let t = e;
|
|
2562
|
+
return Cn(n);
|
|
2563
|
+
function n(n) {
|
|
2564
|
+
let r = n, i;
|
|
2565
|
+
for (i in e) if (r[i] !== t[i]) return !1;
|
|
2566
|
+
return !0;
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
function Sn(e) {
|
|
2570
|
+
return Cn(t);
|
|
2571
|
+
function t(t) {
|
|
2572
|
+
return t && t.type === e;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
function Cn(e) {
|
|
2576
|
+
return t;
|
|
2577
|
+
function t(t, n, r) {
|
|
2578
|
+
return !!(Tn(t) && e.call(this, t, typeof n == "number" ? n : void 0, r || void 0));
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
function wn() {
|
|
2582
|
+
return !0;
|
|
2583
|
+
}
|
|
2584
|
+
function Tn(e) {
|
|
2585
|
+
return typeof e == "object" && !!e && "type" in e;
|
|
2586
|
+
}
|
|
2587
|
+
// node_modules/unist-util-visit-parents/lib/color.js
|
|
2588
|
+
function En(e) {
|
|
2589
|
+
return e;
|
|
2590
|
+
}
|
|
2591
|
+
// node_modules/unist-util-visit-parents/lib/index.js
|
|
2592
|
+
var Dn = [];
|
|
2593
|
+
function On(e, t, n, r) {
|
|
2594
|
+
let i;
|
|
2595
|
+
typeof t == "function" && typeof n != "function" ? (r = n, n = t) : i = t;
|
|
2596
|
+
let a = yn(i), o = r ? -1 : 1;
|
|
2597
|
+
s(e, void 0, [])();
|
|
2598
|
+
function s(e, i, c) {
|
|
2599
|
+
let l = e && typeof e == "object" ? e : {};
|
|
2600
|
+
if (typeof l.type == "string") {
|
|
2601
|
+
let t = typeof l.tagName == "string" ? l.tagName : typeof l.name == "string" ? l.name : void 0;
|
|
2602
|
+
Object.defineProperty(u, "name", { value: "node (" + En(e.type + (t ? "<" + t + ">" : "")) + ")" });
|
|
2603
|
+
}
|
|
2604
|
+
return u;
|
|
2605
|
+
function u() {
|
|
2606
|
+
let l = Dn, u, d, f;
|
|
2607
|
+
if ((!t || a(e, i, c[c.length - 1] || void 0)) && (l = kn(n(e, c)), l[0] === !1)) return l;
|
|
2608
|
+
if ("children" in e && e.children) {
|
|
2609
|
+
let t = e;
|
|
2610
|
+
if (t.children && l[0] !== "skip") for (d = (r ? t.children.length : -1) + o, f = c.concat(t); d > -1 && d < t.children.length;) {
|
|
2611
|
+
let e = t.children[d];
|
|
2612
|
+
if (u = s(e, d, f)(), u[0] === !1) return u;
|
|
2613
|
+
d = typeof u[1] == "number" ? u[1] : d + o;
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
return l;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
function kn(e) {
|
|
2621
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [!0, e] : e == null ? Dn : [e];
|
|
2622
|
+
}
|
|
2623
|
+
// node_modules/mdast-util-find-and-replace/lib/index.js
|
|
2624
|
+
function An(e, t, n) {
|
|
2625
|
+
let r = yn((n || {}).ignore || []), i = jn(t), a = -1;
|
|
2626
|
+
for (; ++a < i.length;) On(e, "text", o);
|
|
2627
|
+
function o(e, t) {
|
|
2628
|
+
let n = -1, i;
|
|
2629
|
+
for (; ++n < t.length;) {
|
|
2630
|
+
let e = t[n], a = i ? i.children : void 0;
|
|
2631
|
+
if (r(e, a ? a.indexOf(e) : void 0, i)) return;
|
|
2632
|
+
i = e;
|
|
2633
|
+
}
|
|
2634
|
+
if (i) return s(e, t);
|
|
2635
|
+
}
|
|
2636
|
+
function s(e, t) {
|
|
2637
|
+
let n = t[t.length - 1], r = i[a][0], o = i[a][1], s = 0, c = n.children.indexOf(e), l = !1, u = [];
|
|
2638
|
+
r.lastIndex = 0;
|
|
2639
|
+
let d = r.exec(e.value);
|
|
2640
|
+
for (; d;) {
|
|
2641
|
+
let n = d.index, i = {
|
|
2642
|
+
index: d.index,
|
|
2643
|
+
input: d.input,
|
|
2644
|
+
stack: [...t, e]
|
|
2645
|
+
}, a = o(...d, i);
|
|
2646
|
+
if (typeof a == "string" && (a = a.length > 0 ? {
|
|
2647
|
+
type: "text",
|
|
2648
|
+
value: a
|
|
2649
|
+
} : void 0), a === !1) r.lastIndex = n + 1;
|
|
2650
|
+
else {
|
|
2651
|
+
if (s !== n && f({
|
|
2652
|
+
type: "text",
|
|
2653
|
+
value: e.value.slice(s, n)
|
|
2654
|
+
}), Array.isArray(a)) for (let e of a) f(e);
|
|
2655
|
+
else a && f(a);
|
|
2656
|
+
s = n + d[0].length, l = !0;
|
|
2657
|
+
}
|
|
2658
|
+
if (!r.global) break;
|
|
2659
|
+
d = r.exec(e.value);
|
|
2660
|
+
}
|
|
2661
|
+
return l ? (s < e.value.length && f({
|
|
2662
|
+
type: "text",
|
|
2663
|
+
value: e.value.slice(s)
|
|
2664
|
+
}), n.children.splice(c, 1, ...u)) : u = [e], c + u.length;
|
|
2665
|
+
function f(e) {
|
|
2666
|
+
let t = u[u.length - 1];
|
|
2667
|
+
t && t.type === "text" && e.type === "text" ? t.value += e.value : u.push(e);
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
function jn(e) {
|
|
2672
|
+
if (!Array.isArray(e)) throw TypeError("Expected find and replace tuple or list of tuples");
|
|
2673
|
+
let t = [], n = !e[0] || Array.isArray(e[0]) ? e : [e], r = -1;
|
|
2674
|
+
for (; ++r < n.length;) {
|
|
2675
|
+
let e = n[r];
|
|
2676
|
+
t.push([Mn(e[0]), Nn(e[1])]);
|
|
2677
|
+
}
|
|
2678
|
+
return t;
|
|
2679
|
+
}
|
|
2680
|
+
function Mn(e) {
|
|
2681
|
+
return typeof e == "string" ? new RegExp(vn(e), "g") : e;
|
|
2682
|
+
}
|
|
2683
|
+
function Nn(e) {
|
|
2684
|
+
return typeof e == "function" ? e : function() {
|
|
2685
|
+
return e;
|
|
2686
|
+
};
|
|
2687
|
+
}
|
|
2688
|
+
// node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
2689
|
+
var Pn = "phrasing", Fn = [
|
|
2690
|
+
"autolink",
|
|
2691
|
+
"link",
|
|
2692
|
+
"image",
|
|
2693
|
+
"label"
|
|
2694
|
+
];
|
|
2695
|
+
function In() {
|
|
2696
|
+
return {
|
|
2697
|
+
transforms: [Wn],
|
|
2698
|
+
enter: {
|
|
2699
|
+
literalAutolink: Rn,
|
|
2700
|
+
literalAutolinkEmail: zn,
|
|
2701
|
+
literalAutolinkHttp: zn,
|
|
2702
|
+
literalAutolinkWww: zn
|
|
2703
|
+
},
|
|
2704
|
+
exit: {
|
|
2705
|
+
literalAutolink: Un,
|
|
2706
|
+
literalAutolinkEmail: Hn,
|
|
2707
|
+
literalAutolinkHttp: Bn,
|
|
2708
|
+
literalAutolinkWww: Vn
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
}
|
|
2712
|
+
function Ln() {
|
|
2713
|
+
return { unsafe: [
|
|
2714
|
+
{
|
|
2715
|
+
character: "@",
|
|
2716
|
+
before: "[+\\-.\\w]",
|
|
2717
|
+
after: "[\\-.\\w]",
|
|
2718
|
+
inConstruct: Pn,
|
|
2719
|
+
notInConstruct: Fn
|
|
2720
|
+
},
|
|
2721
|
+
{
|
|
2722
|
+
character: ".",
|
|
2723
|
+
before: "[Ww]",
|
|
2724
|
+
after: "[\\-.\\w]",
|
|
2725
|
+
inConstruct: Pn,
|
|
2726
|
+
notInConstruct: Fn
|
|
2727
|
+
},
|
|
2728
|
+
{
|
|
2729
|
+
character: ":",
|
|
2730
|
+
before: "[ps]",
|
|
2731
|
+
after: "\\/",
|
|
2732
|
+
inConstruct: Pn,
|
|
2733
|
+
notInConstruct: Fn
|
|
2734
|
+
}
|
|
2735
|
+
] };
|
|
2736
|
+
}
|
|
2737
|
+
function Rn(e) {
|
|
2738
|
+
this.enter({
|
|
2739
|
+
type: "link",
|
|
2740
|
+
title: null,
|
|
2741
|
+
url: "",
|
|
2742
|
+
children: []
|
|
2743
|
+
}, e);
|
|
2744
|
+
}
|
|
2745
|
+
function zn(e) {
|
|
2746
|
+
this.config.enter.autolinkProtocol.call(this, e);
|
|
2747
|
+
}
|
|
2748
|
+
function Bn(e) {
|
|
2749
|
+
this.config.exit.autolinkProtocol.call(this, e);
|
|
2750
|
+
}
|
|
2751
|
+
function Vn(e) {
|
|
2752
|
+
this.config.exit.data.call(this, e);
|
|
2753
|
+
let t = this.stack[this.stack.length - 1];
|
|
2754
|
+
t.type, t.url = "http://" + this.sliceSerialize(e);
|
|
2755
|
+
}
|
|
2756
|
+
function Hn(e) {
|
|
2757
|
+
this.config.exit.autolinkEmail.call(this, e);
|
|
2758
|
+
}
|
|
2759
|
+
function Un(e) {
|
|
2760
|
+
this.exit(e);
|
|
2761
|
+
}
|
|
2762
|
+
function Wn(e) {
|
|
2763
|
+
An(e, [[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Gn], [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Kn]], { ignore: ["link", "linkReference"] });
|
|
2764
|
+
}
|
|
2765
|
+
function Gn(e, t, n, r, i) {
|
|
2766
|
+
let a = "";
|
|
2767
|
+
if (!Yn(i) || (/^w/i.test(t) && (n = t + n, t = "", a = "http://"), !qn(n))) return !1;
|
|
2768
|
+
let o = Jn(n + r);
|
|
2769
|
+
if (!o[0]) return !1;
|
|
2770
|
+
let s = {
|
|
2771
|
+
type: "link",
|
|
2772
|
+
title: null,
|
|
2773
|
+
url: a + t + o[0],
|
|
2774
|
+
children: [{
|
|
2775
|
+
type: "text",
|
|
2776
|
+
value: t + o[0]
|
|
2777
|
+
}]
|
|
2778
|
+
};
|
|
2779
|
+
return o[1] ? [s, {
|
|
2780
|
+
type: "text",
|
|
2781
|
+
value: o[1]
|
|
2782
|
+
}] : s;
|
|
2783
|
+
}
|
|
2784
|
+
function Kn(e, t, n, r) {
|
|
2785
|
+
return !Yn(r, !0) || /[-\d_]$/.test(n) ? !1 : {
|
|
2786
|
+
type: "link",
|
|
2787
|
+
title: null,
|
|
2788
|
+
url: "mailto:" + t + "@" + n,
|
|
2789
|
+
children: [{
|
|
2790
|
+
type: "text",
|
|
2791
|
+
value: t + "@" + n
|
|
2792
|
+
}]
|
|
2793
|
+
};
|
|
2794
|
+
}
|
|
2795
|
+
function qn(e) {
|
|
2796
|
+
let t = e.split(".");
|
|
2797
|
+
return !(t.length < 2 || t[t.length - 1] && (/_/.test(t[t.length - 1]) || !/[a-zA-Z\d]/.test(t[t.length - 1])) || t[t.length - 2] && (/_/.test(t[t.length - 2]) || !/[a-zA-Z\d]/.test(t[t.length - 2])));
|
|
2798
|
+
}
|
|
2799
|
+
function Jn(e) {
|
|
2800
|
+
let t = /[!"&'),.:;<>?\]}]+$/.exec(e);
|
|
2801
|
+
if (!t) return [e, void 0];
|
|
2802
|
+
e = e.slice(0, t.index);
|
|
2803
|
+
let n = t[0], r = n.indexOf(")"), i = _n(e, "("), a = _n(e, ")");
|
|
2804
|
+
for (; r !== -1 && i > a;) e += n.slice(0, r + 1), n = n.slice(r + 1), r = n.indexOf(")"), a++;
|
|
2805
|
+
return [e, n];
|
|
2806
|
+
}
|
|
2807
|
+
function Yn(e, t) {
|
|
2808
|
+
let n = e.input.charCodeAt(e.index - 1);
|
|
2809
|
+
return (e.index === 0 || i(n) || h(n)) && (!t || n !== 47);
|
|
2810
|
+
}
|
|
2811
|
+
// node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
2812
|
+
ar.peek = ir;
|
|
2813
|
+
function Xn() {
|
|
2814
|
+
this.buffer();
|
|
2815
|
+
}
|
|
2816
|
+
function Zn(e) {
|
|
2817
|
+
this.enter({
|
|
2818
|
+
type: "footnoteReference",
|
|
2819
|
+
identifier: "",
|
|
2820
|
+
label: ""
|
|
2821
|
+
}, e);
|
|
2822
|
+
}
|
|
2823
|
+
function Qn() {
|
|
2824
|
+
this.buffer();
|
|
2825
|
+
}
|
|
2826
|
+
function $n(e) {
|
|
2827
|
+
this.enter({
|
|
2828
|
+
type: "footnoteDefinition",
|
|
2829
|
+
identifier: "",
|
|
2830
|
+
label: "",
|
|
2831
|
+
children: []
|
|
2832
|
+
}, e);
|
|
2833
|
+
}
|
|
2834
|
+
function er(e) {
|
|
2835
|
+
let t = this.resume(), n = this.stack[this.stack.length - 1];
|
|
2836
|
+
n.type, n.identifier = a(this.sliceSerialize(e)).toLowerCase(), n.label = t;
|
|
2837
|
+
}
|
|
2838
|
+
function tr(e) {
|
|
2839
|
+
this.exit(e);
|
|
2840
|
+
}
|
|
2841
|
+
function nr(e) {
|
|
2842
|
+
let t = this.resume(), n = this.stack[this.stack.length - 1];
|
|
2843
|
+
n.type, n.identifier = a(this.sliceSerialize(e)).toLowerCase(), n.label = t;
|
|
2844
|
+
}
|
|
2845
|
+
function rr(e) {
|
|
2846
|
+
this.exit(e);
|
|
2847
|
+
}
|
|
2848
|
+
function ir() {
|
|
2849
|
+
return "[";
|
|
2850
|
+
}
|
|
2851
|
+
function ar(e, t, n, r) {
|
|
2852
|
+
let i = n.createTracker(r), a = i.move("[^"), o = n.enter("footnoteReference"), s = n.enter("reference");
|
|
2853
|
+
return a += i.move(n.safe(n.associationId(e), {
|
|
2854
|
+
after: "]",
|
|
2855
|
+
before: a
|
|
2856
|
+
})), s(), o(), a += i.move("]"), a;
|
|
2857
|
+
}
|
|
2858
|
+
function or() {
|
|
2859
|
+
return {
|
|
2860
|
+
enter: {
|
|
2861
|
+
gfmFootnoteCallString: Xn,
|
|
2862
|
+
gfmFootnoteCall: Zn,
|
|
2863
|
+
gfmFootnoteDefinitionLabelString: Qn,
|
|
2864
|
+
gfmFootnoteDefinition: $n
|
|
2865
|
+
},
|
|
2866
|
+
exit: {
|
|
2867
|
+
gfmFootnoteCallString: er,
|
|
2868
|
+
gfmFootnoteCall: tr,
|
|
2869
|
+
gfmFootnoteDefinitionLabelString: nr,
|
|
2870
|
+
gfmFootnoteDefinition: rr
|
|
2871
|
+
}
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2874
|
+
function sr(e) {
|
|
2875
|
+
let t = !1;
|
|
2876
|
+
return e && e.firstLineBlank && (t = !0), {
|
|
2877
|
+
handlers: {
|
|
2878
|
+
footnoteDefinition: n,
|
|
2879
|
+
footnoteReference: ar
|
|
2880
|
+
},
|
|
2881
|
+
unsafe: [{
|
|
2882
|
+
character: "[",
|
|
2883
|
+
inConstruct: [
|
|
2884
|
+
"label",
|
|
2885
|
+
"phrasing",
|
|
2886
|
+
"reference"
|
|
2887
|
+
]
|
|
2888
|
+
}]
|
|
2889
|
+
};
|
|
2890
|
+
function n(e, n, r, i) {
|
|
2891
|
+
let a = r.createTracker(i), o = a.move("[^"), s = r.enter("footnoteDefinition"), c = r.enter("label");
|
|
2892
|
+
return o += a.move(r.safe(r.associationId(e), {
|
|
2893
|
+
before: o,
|
|
2894
|
+
after: "]"
|
|
2895
|
+
})), c(), o += a.move("]:"), e.children && e.children.length > 0 && (a.shift(4), o += a.move((t ? "\n" : " ") + r.indentLines(r.containerFlow(e, a.current()), t ? lr : cr))), s(), o;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
function cr(e, t, n) {
|
|
2899
|
+
return t === 0 ? e : lr(e, t, n);
|
|
2900
|
+
}
|
|
2901
|
+
function lr(e, t, n) {
|
|
2902
|
+
return (n ? "" : " ") + e;
|
|
2903
|
+
}
|
|
2904
|
+
// node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
2905
|
+
var ur = [
|
|
2906
|
+
"autolink",
|
|
2907
|
+
"destinationLiteral",
|
|
2908
|
+
"destinationRaw",
|
|
2909
|
+
"reference",
|
|
2910
|
+
"titleQuote",
|
|
2911
|
+
"titleApostrophe"
|
|
2912
|
+
];
|
|
2913
|
+
hr.attention = gr, hr.peek = _r;
|
|
2914
|
+
function dr() {
|
|
2915
|
+
return {
|
|
2916
|
+
canContainEols: ["delete"],
|
|
2917
|
+
enter: { strikethrough: pr },
|
|
2918
|
+
exit: { strikethrough: mr }
|
|
2919
|
+
};
|
|
2920
|
+
}
|
|
2921
|
+
function fr() {
|
|
2922
|
+
return {
|
|
2923
|
+
handlers: { delete: hr },
|
|
2924
|
+
unsafe: [{
|
|
2925
|
+
character: "~",
|
|
2926
|
+
inConstruct: "phrasing",
|
|
2927
|
+
notInConstruct: ur
|
|
2928
|
+
}]
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
function pr(e) {
|
|
2932
|
+
this.enter({
|
|
2933
|
+
type: "delete",
|
|
2934
|
+
children: [],
|
|
2935
|
+
position: void 0
|
|
2936
|
+
}, e);
|
|
2937
|
+
}
|
|
2938
|
+
function mr(e) {
|
|
2939
|
+
this.exit(e);
|
|
2940
|
+
}
|
|
2941
|
+
function hr(e, t, n, r) {
|
|
2942
|
+
let i = n.createTracker(r), a = n.stack.includes("strikethrough") ? "~" : "~~", o = n.enter("strikethrough"), s = i.move(a);
|
|
2943
|
+
return s += n.containerPhrasing(e, {
|
|
2944
|
+
...i.current(),
|
|
2945
|
+
before: s,
|
|
2946
|
+
after: "~"
|
|
2947
|
+
}), s += i.move(a), o(), s;
|
|
2948
|
+
}
|
|
2949
|
+
function gr() {
|
|
2950
|
+
return {
|
|
2951
|
+
construct: "strikethrough",
|
|
2952
|
+
markers: ["~"],
|
|
2953
|
+
sizes: [2, 1]
|
|
2954
|
+
};
|
|
2955
|
+
}
|
|
2956
|
+
function _r() {
|
|
2957
|
+
return "~";
|
|
2958
|
+
}
|
|
2959
|
+
// node_modules/markdown-table/index.js
|
|
2960
|
+
function vr(e) {
|
|
2961
|
+
return e.length;
|
|
2962
|
+
}
|
|
2963
|
+
function yr(e, t) {
|
|
2964
|
+
let n = t || {}, r = (n.align || []).concat(), i = n.stringLength || vr, a = [], o = [], s = [], c = [], l = 0, u = -1;
|
|
2965
|
+
for (; ++u < e.length;) {
|
|
2966
|
+
let t = [], r = [], a = -1;
|
|
2967
|
+
for (e[u].length > l && (l = e[u].length); ++a < e[u].length;) {
|
|
2968
|
+
let o = br(e[u][a]);
|
|
2969
|
+
if (n.alignDelimiters !== !1) {
|
|
2970
|
+
let e = i(o);
|
|
2971
|
+
r[a] = e, (c[a] === void 0 || e > c[a]) && (c[a] = e);
|
|
2972
|
+
}
|
|
2973
|
+
t.push(o);
|
|
2974
|
+
}
|
|
2975
|
+
o[u] = t, s[u] = r;
|
|
2976
|
+
}
|
|
2977
|
+
let d = -1;
|
|
2978
|
+
if (typeof r == "object" && "length" in r) for (; ++d < l;) a[d] = xr(r[d]);
|
|
2979
|
+
else {
|
|
2980
|
+
let e = xr(r);
|
|
2981
|
+
for (; ++d < l;) a[d] = e;
|
|
2982
|
+
}
|
|
2983
|
+
d = -1;
|
|
2984
|
+
let f = [], p = [];
|
|
2985
|
+
for (; ++d < l;) {
|
|
2986
|
+
let e = a[d], t = "", r = "";
|
|
2987
|
+
e === 99 ? (t = ":", r = ":") : e === 108 ? t = ":" : e === 114 && (r = ":");
|
|
2988
|
+
let i = n.alignDelimiters === !1 ? 1 : Math.max(1, c[d] - t.length - r.length), o = t + "-".repeat(i) + r;
|
|
2989
|
+
n.alignDelimiters !== !1 && (i = t.length + i + r.length, i > c[d] && (c[d] = i), p[d] = i), f[d] = o;
|
|
2990
|
+
}
|
|
2991
|
+
o.splice(1, 0, f), s.splice(1, 0, p), u = -1;
|
|
2992
|
+
let m = [];
|
|
2993
|
+
for (; ++u < o.length;) {
|
|
2994
|
+
let e = o[u], t = s[u];
|
|
2995
|
+
d = -1;
|
|
2996
|
+
let r = [];
|
|
2997
|
+
for (; ++d < l;) {
|
|
2998
|
+
let i = e[d] || "", o = "", s = "";
|
|
2999
|
+
if (n.alignDelimiters !== !1) {
|
|
3000
|
+
let e = c[d] - (t[d] || 0), n = a[d];
|
|
3001
|
+
n === 114 ? o = " ".repeat(e) : n === 99 ? e % 2 ? (o = " ".repeat(e / 2 + .5), s = " ".repeat(e / 2 - .5)) : (o = " ".repeat(e / 2), s = o) : s = " ".repeat(e);
|
|
3002
|
+
}
|
|
3003
|
+
n.delimiterStart !== !1 && !d && r.push("|"), n.padding === !1 || n.alignDelimiters === !1 && i === "" || n.delimiterStart === !1 && !d || r.push(" "), n.alignDelimiters !== !1 && r.push(o), r.push(i), n.alignDelimiters !== !1 && r.push(s), n.padding !== !1 && r.push(" "), (n.delimiterEnd !== !1 || d !== l - 1) && r.push("|");
|
|
3004
|
+
}
|
|
3005
|
+
m.push(n.delimiterEnd === !1 ? r.join("").replace(/ +$/, "") : r.join(""));
|
|
3006
|
+
}
|
|
3007
|
+
return m.join("\n");
|
|
3008
|
+
}
|
|
3009
|
+
function br(e) {
|
|
3010
|
+
return e == null ? "" : String(e);
|
|
3011
|
+
}
|
|
3012
|
+
function xr(e) {
|
|
3013
|
+
let t = typeof e == "string" ? e.codePointAt(0) : 0;
|
|
3014
|
+
return t === 67 || t === 99 ? 99 : t === 76 || t === 108 ? 108 : t === 82 || t === 114 ? 114 : 0;
|
|
3015
|
+
}
|
|
3016
|
+
// node_modules/mdast-util-phrasing/lib/index.js
|
|
3017
|
+
var Sr = yn([
|
|
3018
|
+
"break",
|
|
3019
|
+
"delete",
|
|
3020
|
+
"emphasis",
|
|
3021
|
+
"footnote",
|
|
3022
|
+
"footnoteReference",
|
|
3023
|
+
"image",
|
|
3024
|
+
"imageReference",
|
|
3025
|
+
"inlineCode",
|
|
3026
|
+
"inlineMath",
|
|
3027
|
+
"link",
|
|
3028
|
+
"linkReference",
|
|
3029
|
+
"mdxJsxTextElement",
|
|
3030
|
+
"mdxTextExpression",
|
|
3031
|
+
"strong",
|
|
3032
|
+
"text",
|
|
3033
|
+
"textDirective"
|
|
3034
|
+
]);
|
|
3035
|
+
// node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
|
|
3036
|
+
function Cr(e, t, n, r) {
|
|
3037
|
+
let i = n.enter("blockquote"), a = n.createTracker(r);
|
|
3038
|
+
a.move("> "), a.shift(2);
|
|
3039
|
+
let o = n.indentLines(n.containerFlow(e, a.current()), wr);
|
|
3040
|
+
return i(), o;
|
|
3041
|
+
}
|
|
3042
|
+
function wr(e, t, n) {
|
|
3043
|
+
return ">" + (n ? "" : " ") + e;
|
|
3044
|
+
}
|
|
3045
|
+
// node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
3046
|
+
function Tr(e, t) {
|
|
3047
|
+
return Er(e, t.inConstruct, !0) && !Er(e, t.notInConstruct, !1);
|
|
3048
|
+
}
|
|
3049
|
+
function Er(e, t, n) {
|
|
3050
|
+
if (typeof t == "string" && (t = [t]), !t || t.length === 0) return n;
|
|
3051
|
+
let r = -1;
|
|
3052
|
+
for (; ++r < t.length;) if (e.includes(t[r])) return !0;
|
|
3053
|
+
return !1;
|
|
3054
|
+
}
|
|
3055
|
+
// node_modules/mdast-util-to-markdown/lib/handle/break.js
|
|
3056
|
+
function Dr(e, t, n, r) {
|
|
3057
|
+
let i = -1;
|
|
3058
|
+
for (; ++i < n.unsafe.length;) {
|
|
3059
|
+
let e = n.unsafe[i];
|
|
3060
|
+
if (e.character === "\n" && !e.before && !e.after && Tr(n.stack, e)) return /[\t ]/.test(r.before) ? "" : " ";
|
|
3061
|
+
}
|
|
3062
|
+
return "\\\n";
|
|
3063
|
+
}
|
|
3064
|
+
// node_modules/longest-streak/index.js
|
|
3065
|
+
function Or(e, t) {
|
|
3066
|
+
let n = String(e), r = n.indexOf(t), i = r, a = 0, o = 0;
|
|
3067
|
+
if (typeof t != "string") throw TypeError("Expected substring");
|
|
3068
|
+
for (; r !== -1;) r === i ? ++a > o && (o = a) : a = 1, i = r + t.length, r = n.indexOf(t, i);
|
|
3069
|
+
return o;
|
|
3070
|
+
}
|
|
3071
|
+
// node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
|
|
3072
|
+
function kr(e, t) {
|
|
3073
|
+
return !(t.options.fences !== !1 || !e.value || e.lang || !/[^\n\r ]/.test(e.value) || /^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value));
|
|
3074
|
+
}
|
|
3075
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-fence.js
|
|
3076
|
+
function Ar(e) {
|
|
3077
|
+
let t = e.options.fence || "`";
|
|
3078
|
+
if (t !== "`" && t !== "~") throw Error("Cannot serialize code with `" + t + "` for `options.fence`, expected `` ` `` or `~`");
|
|
3079
|
+
return t;
|
|
3080
|
+
}
|
|
3081
|
+
// node_modules/mdast-util-to-markdown/lib/handle/code.js
|
|
3082
|
+
function jr(e, t, n, r) {
|
|
3083
|
+
let i = Ar(n), a = e.value || "";
|
|
3084
|
+
if (kr(e, n)) {
|
|
3085
|
+
let e = n.enter("codeIndented"), t = n.indentLines(a, Mr);
|
|
3086
|
+
return e(), t;
|
|
3087
|
+
}
|
|
3088
|
+
let o = n.createTracker(r), s = i.repeat(Math.max(Or(a, i) + 1, 3)), c = n.enter("codeFenced"), l = i === "`" ? "GraveAccent" : "Tilde", u = o.move(s);
|
|
3089
|
+
if (e.lang) {
|
|
3090
|
+
let t = n.enter(`codeFencedLang${l}`);
|
|
3091
|
+
u += o.move(n.safe(e.lang, {
|
|
3092
|
+
before: u,
|
|
3093
|
+
after: " ",
|
|
3094
|
+
encode: ["`"],
|
|
3095
|
+
...o.current()
|
|
3096
|
+
})), t();
|
|
3097
|
+
}
|
|
3098
|
+
if (e.lang && e.meta) {
|
|
3099
|
+
let t = n.enter(`codeFencedMeta${l}`);
|
|
3100
|
+
u += o.move(" "), u += o.move(n.safe(e.meta, {
|
|
3101
|
+
before: u,
|
|
3102
|
+
after: "\n",
|
|
3103
|
+
encode: ["`"],
|
|
3104
|
+
...o.current()
|
|
3105
|
+
})), t();
|
|
3106
|
+
}
|
|
3107
|
+
return u += o.move("\n"), a && (u += o.move(a + "\n")), u += o.move(s), c(), u;
|
|
3108
|
+
}
|
|
3109
|
+
function Mr(e, t, n) {
|
|
3110
|
+
return (n ? "" : " ") + e;
|
|
3111
|
+
}
|
|
3112
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-quote.js
|
|
3113
|
+
function Nr(e) {
|
|
3114
|
+
let t = e.options.quote || "\"";
|
|
3115
|
+
if (t !== "\"" && t !== "'") throw Error("Cannot serialize title with `" + t + "` for `options.quote`, expected `\"`, or `'`");
|
|
3116
|
+
return t;
|
|
3117
|
+
}
|
|
3118
|
+
// node_modules/mdast-util-to-markdown/lib/handle/definition.js
|
|
3119
|
+
function Pr(e, t, n, r) {
|
|
3120
|
+
let i = Nr(n), a = i === "\"" ? "Quote" : "Apostrophe", o = n.enter("definition"), s = n.enter("label"), c = n.createTracker(r), l = c.move("[");
|
|
3121
|
+
return l += c.move(n.safe(n.associationId(e), {
|
|
3122
|
+
before: l,
|
|
3123
|
+
after: "]",
|
|
3124
|
+
...c.current()
|
|
3125
|
+
})), l += c.move("]: "), s(), !e.url || /[\0- \u007F]/.test(e.url) ? (s = n.enter("destinationLiteral"), l += c.move("<"), l += c.move(n.safe(e.url, {
|
|
3126
|
+
before: l,
|
|
3127
|
+
after: ">",
|
|
3128
|
+
...c.current()
|
|
3129
|
+
})), l += c.move(">")) : (s = n.enter("destinationRaw"), l += c.move(n.safe(e.url, {
|
|
3130
|
+
before: l,
|
|
3131
|
+
after: e.title ? " " : "\n",
|
|
3132
|
+
...c.current()
|
|
3133
|
+
}))), s(), e.title && (s = n.enter(`title${a}`), l += c.move(" " + i), l += c.move(n.safe(e.title, {
|
|
3134
|
+
before: l,
|
|
3135
|
+
after: i,
|
|
3136
|
+
...c.current()
|
|
3137
|
+
})), l += c.move(i), s()), o(), l;
|
|
3138
|
+
}
|
|
3139
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
|
|
3140
|
+
function Fr(e) {
|
|
3141
|
+
let t = e.options.emphasis || "*";
|
|
3142
|
+
if (t !== "*" && t !== "_") throw Error("Cannot serialize emphasis with `" + t + "` for `options.emphasis`, expected `*`, or `_`");
|
|
3143
|
+
return t;
|
|
3144
|
+
}
|
|
3145
|
+
Ir.attention = Lr, Ir.peek = Rr;
|
|
3146
|
+
function Ir(e, t, n, r) {
|
|
3147
|
+
let i = n.enter("phrasing"), a = n.containerPhrasing({
|
|
3148
|
+
type: "root",
|
|
3149
|
+
children: [e]
|
|
3150
|
+
}, r);
|
|
3151
|
+
return i(), a;
|
|
3152
|
+
}
|
|
3153
|
+
function Lr(e, t) {
|
|
3154
|
+
return {
|
|
3155
|
+
construct: "emphasis",
|
|
3156
|
+
markers: Fr(t) === "*" ? ["*", "_"] : ["_", "*"],
|
|
3157
|
+
sizes: [1]
|
|
3158
|
+
};
|
|
3159
|
+
}
|
|
3160
|
+
function Rr(e, t, n) {
|
|
3161
|
+
return n.options.emphasis || "*";
|
|
3162
|
+
}
|
|
3163
|
+
// node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
|
|
3164
|
+
function zr(e) {
|
|
3165
|
+
return "&#x" + e.toString(16).toUpperCase() + ";";
|
|
3166
|
+
}
|
|
3167
|
+
// node_modules/unist-util-visit/lib/index.js
|
|
3168
|
+
function Br(e, t, n, r) {
|
|
3169
|
+
let i, a, o;
|
|
3170
|
+
typeof t == "function" && typeof n != "function" ? (a = void 0, o = t, i = n) : (a = t, o = n, i = r), On(e, a, s, i);
|
|
3171
|
+
function s(e, t) {
|
|
3172
|
+
let n = t[t.length - 1], r = n ? n.children.indexOf(e) : void 0;
|
|
3173
|
+
return o(e, r, n);
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
// node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
|
|
3177
|
+
function Vr(e, t) {
|
|
3178
|
+
let n = !1;
|
|
3179
|
+
return Br(e, function(e) {
|
|
3180
|
+
if ("value" in e && /\r?\n|\r/.test(e.value) || e.type === "break") return n = !0, !1;
|
|
3181
|
+
}), !!((!e.depth || e.depth < 3) && r(e) && (t.options.setext || n));
|
|
3182
|
+
}
|
|
3183
|
+
// node_modules/mdast-util-to-markdown/lib/handle/heading.js
|
|
3184
|
+
function Hr(e, t, n, r) {
|
|
3185
|
+
let i = Math.max(Math.min(6, e.depth || 1), 1), a = n.createTracker(r);
|
|
3186
|
+
if (Vr(e, n)) {
|
|
3187
|
+
let t = n.enter("headingSetext"), r = n.enter("phrasing"), o = n.containerPhrasing(e, {
|
|
3188
|
+
...a.current(),
|
|
3189
|
+
before: "\n",
|
|
3190
|
+
after: "\n"
|
|
3191
|
+
});
|
|
3192
|
+
return r(), t(), o + "\n" + (i === 1 ? "=" : "-").repeat(o.length - (Math.max(o.lastIndexOf("\r"), o.lastIndexOf("\n")) + 1));
|
|
3193
|
+
}
|
|
3194
|
+
let o = "#".repeat(i), s = n.enter("headingAtx"), c = n.enter("phrasing");
|
|
3195
|
+
a.move(o + " ");
|
|
3196
|
+
let l = n.containerPhrasing(e, {
|
|
3197
|
+
before: "# ",
|
|
3198
|
+
after: "\n",
|
|
3199
|
+
...a.current()
|
|
3200
|
+
}), u = l.charCodeAt(0);
|
|
3201
|
+
return (u === 9 || u === 32) && (l = zr(u) + l.slice(1)), l = l ? o + " " + l : o, n.options.closeAtx && (l += " " + o), c(), s(), l;
|
|
3202
|
+
}
|
|
3203
|
+
// node_modules/mdast-util-to-markdown/lib/handle/html.js
|
|
3204
|
+
Ur.peek = Wr;
|
|
3205
|
+
function Ur(e) {
|
|
3206
|
+
return e.value || "";
|
|
3207
|
+
}
|
|
3208
|
+
function Wr() {
|
|
3209
|
+
return "<";
|
|
3210
|
+
}
|
|
3211
|
+
// node_modules/mdast-util-to-markdown/lib/handle/image.js
|
|
3212
|
+
Gr.peek = Kr;
|
|
3213
|
+
function Gr(e, t, n, r) {
|
|
3214
|
+
let i = Nr(n), a = i === "\"" ? "Quote" : "Apostrophe", o = n.enter("image"), s = n.enter("label"), c = n.createTracker(r), l = c.move("![");
|
|
3215
|
+
return l += c.move(n.safe(e.alt, {
|
|
3216
|
+
before: l,
|
|
3217
|
+
after: "]",
|
|
3218
|
+
...c.current()
|
|
3219
|
+
})), l += c.move("]("), s(), !e.url && e.title || /[\0- \u007F]/.test(e.url) ? (s = n.enter("destinationLiteral"), l += c.move("<"), l += c.move(n.safe(e.url, {
|
|
3220
|
+
before: l,
|
|
3221
|
+
after: ">",
|
|
3222
|
+
...c.current()
|
|
3223
|
+
})), l += c.move(">")) : (s = n.enter("destinationRaw"), l += c.move(n.safe(e.url, {
|
|
3224
|
+
before: l,
|
|
3225
|
+
after: e.title ? " " : ")",
|
|
3226
|
+
...c.current()
|
|
3227
|
+
}))), s(), e.title && (s = n.enter(`title${a}`), l += c.move(" " + i), l += c.move(n.safe(e.title, {
|
|
3228
|
+
before: l,
|
|
3229
|
+
after: i,
|
|
3230
|
+
...c.current()
|
|
3231
|
+
})), l += c.move(i), s()), l += c.move(")"), o(), l;
|
|
3232
|
+
}
|
|
3233
|
+
function Kr() {
|
|
3234
|
+
return "!";
|
|
3235
|
+
}
|
|
3236
|
+
// node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
|
|
3237
|
+
qr.peek = Jr;
|
|
3238
|
+
function qr(e, t, n, r) {
|
|
3239
|
+
let i = e.referenceType, a = n.enter("imageReference"), o = n.enter("label"), s = n.createTracker(r), c = s.move("!["), l = n.safe(e.alt, {
|
|
3240
|
+
before: c,
|
|
3241
|
+
after: "]",
|
|
3242
|
+
...s.current()
|
|
3243
|
+
});
|
|
3244
|
+
c += s.move(l + "]["), o();
|
|
3245
|
+
let u = n.stack;
|
|
3246
|
+
n.stack = u.filter(function(e) {
|
|
3247
|
+
return e !== "phrasing";
|
|
3248
|
+
}), o = n.enter("reference");
|
|
3249
|
+
let d = n.safe(n.associationId(e), {
|
|
3250
|
+
before: c,
|
|
3251
|
+
after: "]",
|
|
3252
|
+
...s.current()
|
|
3253
|
+
});
|
|
3254
|
+
return o(), n.stack = u, a(), i === "full" || !l || l !== d ? c += s.move(d + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += s.move("]"), c;
|
|
3255
|
+
}
|
|
3256
|
+
function Jr() {
|
|
3257
|
+
return "!";
|
|
3258
|
+
}
|
|
3259
|
+
// node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
3260
|
+
Yr.peek = Xr;
|
|
3261
|
+
function Yr(e, t, n) {
|
|
3262
|
+
let r = e.value || "", i = "`", a = -1;
|
|
3263
|
+
for (; RegExp("(^|[^`])" + i + "([^`]|$)").test(r);) i += "`";
|
|
3264
|
+
for (/[^\n\r ]/.test(r) && (/^[\n\r ]/.test(r) && /[\n\r ]$/.test(r) || /^`|`$/.test(r)) && (r = " " + r + " "); ++a < n.unsafe.length;) {
|
|
3265
|
+
let e = n.unsafe[a], t = n.compilePattern(e);
|
|
3266
|
+
if (!e.atBreak) continue;
|
|
3267
|
+
let i;
|
|
3268
|
+
for (; i = t.exec(r);) {
|
|
3269
|
+
let e = i.index;
|
|
3270
|
+
r.charCodeAt(e) === 10 && r.charCodeAt(e - 1) === 13 && e--, r = r.slice(0, e) + " " + r.slice(i.index + 1);
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
return i + r + i;
|
|
3274
|
+
}
|
|
3275
|
+
function Xr() {
|
|
3276
|
+
return "`";
|
|
3277
|
+
}
|
|
3278
|
+
// node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
|
|
3279
|
+
function Zr(e, t) {
|
|
3280
|
+
let n = r(e);
|
|
3281
|
+
return !(t.options.resourceLink || !e.url || e.title || !e.children || e.children.length !== 1 || e.children[0].type !== "text" || n !== e.url && "mailto:" + n !== e.url || !/^[a-z][+\-.a-z]+:/i.test(e.url) || /[\0- <>\u007F]/.test(e.url));
|
|
3282
|
+
}
|
|
3283
|
+
// node_modules/mdast-util-to-markdown/lib/handle/link.js
|
|
3284
|
+
Qr.peek = $r;
|
|
3285
|
+
function Qr(e, t, n, r) {
|
|
3286
|
+
let i = Nr(n), a = i === "\"" ? "Quote" : "Apostrophe", o = n.createTracker(r);
|
|
3287
|
+
if (Zr(e, n)) {
|
|
3288
|
+
let t = n.stack;
|
|
3289
|
+
n.stack = t.filter(function(e) {
|
|
3290
|
+
return e !== "phrasing";
|
|
3291
|
+
});
|
|
3292
|
+
let r = n.enter("autolink"), i = o.move("<");
|
|
3293
|
+
return i += o.move(n.containerPhrasing(e, {
|
|
3294
|
+
before: i,
|
|
3295
|
+
after: ">",
|
|
3296
|
+
...o.current()
|
|
3297
|
+
})), i += o.move(">"), r(), n.stack = t, i;
|
|
3298
|
+
}
|
|
3299
|
+
let s = n.enter("link"), c = n.enter("label"), l = o.move("[");
|
|
3300
|
+
return l += o.move(n.containerPhrasing(e, {
|
|
3301
|
+
before: l,
|
|
3302
|
+
after: "](",
|
|
3303
|
+
...o.current()
|
|
3304
|
+
})), l += o.move("]("), c(), !e.url && e.title || /[\0- \u007F]/.test(e.url) ? (c = n.enter("destinationLiteral"), l += o.move("<"), l += o.move(n.safe(e.url, {
|
|
3305
|
+
before: l,
|
|
3306
|
+
after: ">",
|
|
3307
|
+
...o.current()
|
|
3308
|
+
})), l += o.move(">")) : (c = n.enter("destinationRaw"), l += o.move(n.safe(e.url, {
|
|
3309
|
+
before: l,
|
|
3310
|
+
after: e.title ? " " : ")",
|
|
3311
|
+
...o.current()
|
|
3312
|
+
}))), c(), e.title && (c = n.enter(`title${a}`), l += o.move(" " + i), l += o.move(n.safe(e.title, {
|
|
3313
|
+
before: l,
|
|
3314
|
+
after: i,
|
|
3315
|
+
...o.current()
|
|
3316
|
+
})), l += o.move(i), c()), l += o.move(")"), s(), l;
|
|
3317
|
+
}
|
|
3318
|
+
function $r(e, t, n) {
|
|
3319
|
+
return Zr(e, n) ? "<" : "[";
|
|
3320
|
+
}
|
|
3321
|
+
// node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
|
|
3322
|
+
ei.peek = ti;
|
|
3323
|
+
function ei(e, t, n, r) {
|
|
3324
|
+
let i = e.referenceType, a = n.enter("linkReference"), o = n.enter("label"), s = n.createTracker(r), c = s.move("["), l = n.containerPhrasing(e, {
|
|
3325
|
+
before: c,
|
|
3326
|
+
after: "]",
|
|
3327
|
+
...s.current()
|
|
3328
|
+
});
|
|
3329
|
+
c += s.move(l + "]["), o();
|
|
3330
|
+
let u = n.stack;
|
|
3331
|
+
n.stack = u.filter(function(e) {
|
|
3332
|
+
return e !== "phrasing";
|
|
3333
|
+
}), o = n.enter("reference");
|
|
3334
|
+
let d = n.safe(n.associationId(e), {
|
|
3335
|
+
before: c,
|
|
3336
|
+
after: "]",
|
|
3337
|
+
...s.current()
|
|
3338
|
+
});
|
|
3339
|
+
return o(), n.stack = u, a(), i === "full" || !l || l !== d ? c += s.move(d + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += s.move("]"), c;
|
|
3340
|
+
}
|
|
3341
|
+
function ti() {
|
|
3342
|
+
return "[";
|
|
3343
|
+
}
|
|
3344
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
3345
|
+
function ni(e) {
|
|
3346
|
+
let t = e.options.bullet || "*";
|
|
3347
|
+
if (t !== "*" && t !== "+" && t !== "-") throw Error("Cannot serialize items with `" + t + "` for `options.bullet`, expected `*`, `+`, or `-`");
|
|
3348
|
+
return t;
|
|
3349
|
+
}
|
|
3350
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
|
|
3351
|
+
function ri(e) {
|
|
3352
|
+
let t = ni(e), n = e.options.bulletOther;
|
|
3353
|
+
if (!n) return t === "*" ? "-" : "*";
|
|
3354
|
+
if (n !== "*" && n !== "+" && n !== "-") throw Error("Cannot serialize items with `" + n + "` for `options.bulletOther`, expected `*`, `+`, or `-`");
|
|
3355
|
+
if (n === t) throw Error("Expected `bullet` (`" + t + "`) and `bulletOther` (`" + n + "`) to be different");
|
|
3356
|
+
return n;
|
|
3357
|
+
}
|
|
3358
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
|
|
3359
|
+
function ii(e) {
|
|
3360
|
+
let t = e.options.bulletOrdered || ".";
|
|
3361
|
+
if (t !== "." && t !== ")") throw Error("Cannot serialize items with `" + t + "` for `options.bulletOrdered`, expected `.` or `)`");
|
|
3362
|
+
return t;
|
|
3363
|
+
}
|
|
3364
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-rule.js
|
|
3365
|
+
function ai(e) {
|
|
3366
|
+
let t = e.options.rule || "*";
|
|
3367
|
+
if (t !== "*" && t !== "-" && t !== "_") throw Error("Cannot serialize rules with `" + t + "` for `options.rule`, expected `*`, `-`, or `_`");
|
|
3368
|
+
return t;
|
|
3369
|
+
}
|
|
3370
|
+
// node_modules/mdast-util-to-markdown/lib/handle/list.js
|
|
3371
|
+
function oi(e, t, n, r) {
|
|
3372
|
+
let i = n.enter("list"), a = n.bulletCurrent, o = e.ordered ? ii(n) : ni(n), s = e.ordered ? o === "." ? ")" : "." : ri(n), c = t && n.bulletLastUsed ? o === n.bulletLastUsed : !1;
|
|
3373
|
+
if (!e.ordered) {
|
|
3374
|
+
let t = e.children ? e.children[0] : void 0;
|
|
3375
|
+
if (o !== "*" && o !== "-" || !t || t.children && t.children[0] || n.stack[n.stack.length - 1] !== "list" || n.stack[n.stack.length - 2] !== "listItem" || n.stack[n.stack.length - 3] !== "list" || n.stack[n.stack.length - 4] !== "listItem" || n.indexStack[n.indexStack.length - 1] !== 0 || n.indexStack[n.indexStack.length - 2] !== 0 || n.indexStack[n.indexStack.length - 3] !== 0 || (c = !0), ai(n) === o && t) {
|
|
3376
|
+
let t = -1;
|
|
3377
|
+
for (; ++t < e.children.length;) {
|
|
3378
|
+
let n = e.children[t];
|
|
3379
|
+
if (n && n.type === "listItem" && n.children && n.children[0] && n.children[0].type === "thematicBreak") {
|
|
3380
|
+
c = !0;
|
|
3381
|
+
break;
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
c && (o = s), n.bulletCurrent = o;
|
|
3387
|
+
let l = n.containerFlow(e, r);
|
|
3388
|
+
return n.bulletLastUsed = o, n.bulletCurrent = a, i(), l;
|
|
3389
|
+
}
|
|
3390
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
3391
|
+
function si(e) {
|
|
3392
|
+
let t = e.options.listItemIndent || "one";
|
|
3393
|
+
if (t !== "tab" && t !== "one" && t !== "mixed") throw Error("Cannot serialize items with `" + t + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");
|
|
3394
|
+
return t;
|
|
3395
|
+
}
|
|
3396
|
+
// node_modules/mdast-util-to-markdown/lib/handle/list-item.js
|
|
3397
|
+
function ci(e, t, n, r) {
|
|
3398
|
+
let i = si(n), a = n.bulletCurrent || ni(n);
|
|
3399
|
+
t && t.type === "list" && t.ordered && (a = (typeof t.start == "number" && t.start > -1 ? t.start : 1) + (n.options.incrementListMarker === !1 ? 0 : t.children.indexOf(e)) + a);
|
|
3400
|
+
let o = a.length + 1;
|
|
3401
|
+
(i === "tab" || i === "mixed" && (t && t.type === "list" && t.spread || e.spread)) && (o = Math.ceil(o / 4) * 4);
|
|
3402
|
+
let s = n.createTracker(r);
|
|
3403
|
+
s.move(a + " ".repeat(o - a.length)), s.shift(o);
|
|
3404
|
+
let c = n.enter("listItem"), l = n.indentLines(n.containerFlow(e, s.current()), u);
|
|
3405
|
+
return c(), l;
|
|
3406
|
+
function u(e, t, n) {
|
|
3407
|
+
return t ? (n ? "" : " ".repeat(o)) + e : (n ? a : a + " ".repeat(o - a.length)) + e;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
// node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
|
|
3411
|
+
function li(e, t, n, r) {
|
|
3412
|
+
let i = n.enter("paragraph"), a = n.enter("phrasing"), o = n.containerPhrasing(e, r);
|
|
3413
|
+
return a(), i(), o;
|
|
3414
|
+
}
|
|
3415
|
+
// node_modules/mdast-util-to-markdown/lib/handle/root.js
|
|
3416
|
+
function ui(e, t, n, r) {
|
|
3417
|
+
if (!e.children.some(function(e) {
|
|
3418
|
+
return Sr(e);
|
|
3419
|
+
})) return n.containerFlow(e, r);
|
|
3420
|
+
let i = n.enter("phrasing"), a = n.containerPhrasing(e, r);
|
|
3421
|
+
return i(), a;
|
|
3422
|
+
}
|
|
3423
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-strong.js
|
|
3424
|
+
function di(e) {
|
|
3425
|
+
let t = e.options.strong || "*";
|
|
3426
|
+
if (t !== "*" && t !== "_") throw Error("Cannot serialize strong with `" + t + "` for `options.strong`, expected `*`, or `_`");
|
|
3427
|
+
return t;
|
|
3428
|
+
}
|
|
3429
|
+
fi.attention = pi, fi.peek = mi;
|
|
3430
|
+
function fi(e, t, n, r) {
|
|
3431
|
+
let i = n.enter("phrasing"), a = n.containerPhrasing({
|
|
3432
|
+
type: "root",
|
|
3433
|
+
children: [e]
|
|
3434
|
+
}, r);
|
|
3435
|
+
return i(), a;
|
|
3436
|
+
}
|
|
3437
|
+
function pi(e, t) {
|
|
3438
|
+
return {
|
|
3439
|
+
construct: "strong",
|
|
3440
|
+
markers: di(t) === "*" ? ["*", "_"] : ["_", "*"],
|
|
3441
|
+
sizes: [2]
|
|
3442
|
+
};
|
|
3443
|
+
}
|
|
3444
|
+
function mi(e, t, n) {
|
|
3445
|
+
return n.options.strong || "*";
|
|
3446
|
+
}
|
|
3447
|
+
// node_modules/mdast-util-to-markdown/lib/handle/text.js
|
|
3448
|
+
function hi(e, t, n, r) {
|
|
3449
|
+
/* c8 ignore next -- parent always passed */
|
|
3450
|
+
let i = t ? t.children : [], a = i.indexOf(e);
|
|
3451
|
+
return n.safe(e.value, {
|
|
3452
|
+
...r,
|
|
3453
|
+
afterNode: i[a + 1],
|
|
3454
|
+
beforeNode: i[a - 1]
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
// node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
|
|
3458
|
+
function gi(e) {
|
|
3459
|
+
let t = e.options.ruleRepetition || 3;
|
|
3460
|
+
if (t < 3) throw Error("Cannot serialize rules with repetition `" + t + "` for `options.ruleRepetition`, expected `3` or more");
|
|
3461
|
+
return t;
|
|
3462
|
+
}
|
|
3463
|
+
// node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
|
|
3464
|
+
function _i(e, t, n) {
|
|
3465
|
+
let r = (ai(n) + (n.options.ruleSpaces ? " " : "")).repeat(gi(n));
|
|
3466
|
+
return n.options.ruleSpaces ? r.slice(0, -1) : r;
|
|
3467
|
+
}
|
|
3468
|
+
// node_modules/mdast-util-to-markdown/lib/handle/index.js
|
|
3469
|
+
var vi = {
|
|
3470
|
+
blockquote: Cr,
|
|
3471
|
+
break: Dr,
|
|
3472
|
+
code: jr,
|
|
3473
|
+
definition: Pr,
|
|
3474
|
+
emphasis: Ir,
|
|
3475
|
+
hardBreak: Dr,
|
|
3476
|
+
heading: Hr,
|
|
3477
|
+
html: Ur,
|
|
3478
|
+
image: Gr,
|
|
3479
|
+
imageReference: qr,
|
|
3480
|
+
inlineCode: Yr,
|
|
3481
|
+
link: Qr,
|
|
3482
|
+
linkReference: ei,
|
|
3483
|
+
list: oi,
|
|
3484
|
+
listItem: ci,
|
|
3485
|
+
paragraph: li,
|
|
3486
|
+
root: ui,
|
|
3487
|
+
strong: fi,
|
|
3488
|
+
text: hi,
|
|
3489
|
+
thematicBreak: _i
|
|
3490
|
+
};
|
|
3491
|
+
// node_modules/mdast-util-gfm-table/lib/index.js
|
|
3492
|
+
function yi() {
|
|
3493
|
+
return {
|
|
3494
|
+
enter: {
|
|
3495
|
+
table: bi,
|
|
3496
|
+
tableData: wi,
|
|
3497
|
+
tableHeader: wi,
|
|
3498
|
+
tableRow: Si
|
|
3499
|
+
},
|
|
3500
|
+
exit: {
|
|
3501
|
+
codeText: Ti,
|
|
3502
|
+
table: xi,
|
|
3503
|
+
tableData: Ci,
|
|
3504
|
+
tableHeader: Ci,
|
|
3505
|
+
tableRow: Ci
|
|
3506
|
+
}
|
|
3507
|
+
};
|
|
3508
|
+
}
|
|
3509
|
+
function bi(e) {
|
|
3510
|
+
let t = e._align;
|
|
3511
|
+
this.enter({
|
|
3512
|
+
type: "table",
|
|
3513
|
+
align: t.map(function(e) {
|
|
3514
|
+
return e === "none" ? null : e;
|
|
3515
|
+
}),
|
|
3516
|
+
children: []
|
|
3517
|
+
}, e), this.data.inTable = !0;
|
|
3518
|
+
}
|
|
3519
|
+
function xi(e) {
|
|
3520
|
+
this.exit(e), this.data.inTable = void 0;
|
|
3521
|
+
}
|
|
3522
|
+
function Si(e) {
|
|
3523
|
+
this.enter({
|
|
3524
|
+
type: "tableRow",
|
|
3525
|
+
children: []
|
|
3526
|
+
}, e);
|
|
3527
|
+
}
|
|
3528
|
+
function Ci(e) {
|
|
3529
|
+
this.exit(e);
|
|
3530
|
+
}
|
|
3531
|
+
function wi(e) {
|
|
3532
|
+
this.enter({
|
|
3533
|
+
type: "tableCell",
|
|
3534
|
+
children: []
|
|
3535
|
+
}, e);
|
|
3536
|
+
}
|
|
3537
|
+
function Ti(e) {
|
|
3538
|
+
let t = this.resume();
|
|
3539
|
+
this.data.inTable && (t = t.replace(/\\([\\|])/g, Ei));
|
|
3540
|
+
let n = this.stack[this.stack.length - 1];
|
|
3541
|
+
n.type, n.value = t, this.exit(e);
|
|
3542
|
+
}
|
|
3543
|
+
function Ei(e, t) {
|
|
3544
|
+
return t === "|" ? t : e;
|
|
3545
|
+
}
|
|
3546
|
+
function Di(e) {
|
|
3547
|
+
let t = e || {}, n = t.tableCellPadding, r = t.tablePipeAlign, i = t.stringLength, a = n ? " " : "|";
|
|
3548
|
+
return {
|
|
3549
|
+
unsafe: [
|
|
3550
|
+
{
|
|
3551
|
+
character: "\r",
|
|
3552
|
+
inConstruct: "tableCell"
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
character: "\n",
|
|
3556
|
+
inConstruct: "tableCell"
|
|
3557
|
+
},
|
|
3558
|
+
{
|
|
3559
|
+
atBreak: !0,
|
|
3560
|
+
character: "|",
|
|
3561
|
+
after: "[ :-]"
|
|
3562
|
+
},
|
|
3563
|
+
{
|
|
3564
|
+
character: "|",
|
|
3565
|
+
inConstruct: "tableCell"
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
atBreak: !0,
|
|
3569
|
+
character: ":",
|
|
3570
|
+
after: "-"
|
|
3571
|
+
},
|
|
3572
|
+
{
|
|
3573
|
+
atBreak: !0,
|
|
3574
|
+
character: "-",
|
|
3575
|
+
after: "[:|-]"
|
|
3576
|
+
}
|
|
3577
|
+
],
|
|
3578
|
+
handlers: {
|
|
3579
|
+
inlineCode: f,
|
|
3580
|
+
table: o,
|
|
3581
|
+
tableCell: c,
|
|
3582
|
+
tableRow: s
|
|
3583
|
+
}
|
|
3584
|
+
};
|
|
3585
|
+
function o(e, t, n, r) {
|
|
3586
|
+
return l(u(e, n, r), e.align);
|
|
3587
|
+
}
|
|
3588
|
+
function s(e, t, n, r) {
|
|
3589
|
+
let i = l([d(e, n, r)]);
|
|
3590
|
+
return i.slice(0, i.indexOf("\n"));
|
|
3591
|
+
}
|
|
3592
|
+
function c(e, t, n, r) {
|
|
3593
|
+
let i = n.enter("tableCell"), o = n.enter("phrasing"), s = n.containerPhrasing(e, {
|
|
3594
|
+
...r,
|
|
3595
|
+
before: a,
|
|
3596
|
+
after: a
|
|
3597
|
+
});
|
|
3598
|
+
return o(), i(), s;
|
|
3599
|
+
}
|
|
3600
|
+
function l(e, t) {
|
|
3601
|
+
return yr(e, {
|
|
3602
|
+
align: t,
|
|
3603
|
+
alignDelimiters: r,
|
|
3604
|
+
padding: n,
|
|
3605
|
+
stringLength: i
|
|
3606
|
+
});
|
|
3607
|
+
}
|
|
3608
|
+
function u(e, t, n) {
|
|
3609
|
+
let r = e.children, i = -1, a = [], o = t.enter("table");
|
|
3610
|
+
for (; ++i < r.length;) a[i] = d(r[i], t, n);
|
|
3611
|
+
return o(), a;
|
|
3612
|
+
}
|
|
3613
|
+
function d(e, t, n) {
|
|
3614
|
+
let r = e.children, i = -1, a = [], o = t.enter("tableRow");
|
|
3615
|
+
for (; ++i < r.length;) a[i] = c(r[i], e, t, n);
|
|
3616
|
+
return o(), a;
|
|
3617
|
+
}
|
|
3618
|
+
function f(e, t, n) {
|
|
3619
|
+
let r = vi.inlineCode(e, t, n);
|
|
3620
|
+
return n.stack.includes("tableCell") && (r = r.replace(/\|/g, "\\$&")), r;
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
// node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
3624
|
+
function Oi() {
|
|
3625
|
+
return { exit: {
|
|
3626
|
+
taskListCheckValueChecked: Ai,
|
|
3627
|
+
taskListCheckValueUnchecked: Ai,
|
|
3628
|
+
paragraph: ji
|
|
3629
|
+
} };
|
|
3630
|
+
}
|
|
3631
|
+
function ki() {
|
|
3632
|
+
return {
|
|
3633
|
+
unsafe: [{
|
|
3634
|
+
atBreak: !0,
|
|
3635
|
+
character: "-",
|
|
3636
|
+
after: "[:|-]"
|
|
3637
|
+
}],
|
|
3638
|
+
handlers: { listItem: Mi }
|
|
3639
|
+
};
|
|
3640
|
+
}
|
|
3641
|
+
function Ai(e) {
|
|
3642
|
+
let t = this.stack[this.stack.length - 2];
|
|
3643
|
+
t.type, t.checked = e.type === "taskListCheckValueChecked";
|
|
3644
|
+
}
|
|
3645
|
+
function ji(e) {
|
|
3646
|
+
let t = this.stack[this.stack.length - 2];
|
|
3647
|
+
if (t && t.type === "listItem" && typeof t.checked == "boolean") {
|
|
3648
|
+
let e = this.stack[this.stack.length - 1];
|
|
3649
|
+
e.type;
|
|
3650
|
+
let n = e.children[0];
|
|
3651
|
+
if (n && n.type === "text") {
|
|
3652
|
+
let r = t.children, i = -1, a;
|
|
3653
|
+
for (; ++i < r.length;) {
|
|
3654
|
+
let e = r[i];
|
|
3655
|
+
if (e.type === "paragraph") {
|
|
3656
|
+
a = e;
|
|
3657
|
+
break;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
a === e && (n.value = n.value.slice(1), n.value.length === 0 ? e.children.shift() : e.position && n.position && typeof n.position.start.offset == "number" && (n.position.start.column++, n.position.start.offset++, e.position.start = Object.assign({}, n.position.start)));
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
this.exit(e);
|
|
3664
|
+
}
|
|
3665
|
+
function Mi(e, t, n, r) {
|
|
3666
|
+
let i = e.children[0], a = typeof e.checked == "boolean" && i && i.type === "paragraph", o = "[" + (e.checked ? "x" : " ") + "] ", s = n.createTracker(r);
|
|
3667
|
+
a && s.move(o);
|
|
3668
|
+
let c = vi.listItem(e, t, n, {
|
|
3669
|
+
...r,
|
|
3670
|
+
...s.current()
|
|
3671
|
+
});
|
|
3672
|
+
return a && (c = c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, l)), c;
|
|
3673
|
+
function l(e) {
|
|
3674
|
+
return e + o;
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
// node_modules/mdast-util-gfm/lib/index.js
|
|
3678
|
+
function Ni() {
|
|
3679
|
+
return [
|
|
3680
|
+
In(),
|
|
3681
|
+
or(),
|
|
3682
|
+
dr(),
|
|
3683
|
+
yi(),
|
|
3684
|
+
Oi()
|
|
3685
|
+
];
|
|
3686
|
+
}
|
|
3687
|
+
function Pi(e) {
|
|
3688
|
+
return { extensions: [
|
|
3689
|
+
Ln(),
|
|
3690
|
+
sr(e),
|
|
3691
|
+
fr(),
|
|
3692
|
+
Di(e),
|
|
3693
|
+
ki()
|
|
3694
|
+
] };
|
|
3695
|
+
}
|
|
3696
|
+
// node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
3697
|
+
var Fi = {
|
|
3698
|
+
tokenize: Ki,
|
|
3699
|
+
partial: !0
|
|
3700
|
+
}, Ii = {
|
|
3701
|
+
tokenize: qi,
|
|
3702
|
+
partial: !0
|
|
3703
|
+
}, Li = {
|
|
3704
|
+
tokenize: Ji,
|
|
3705
|
+
partial: !0
|
|
3706
|
+
}, Ri = {
|
|
3707
|
+
tokenize: Yi,
|
|
3708
|
+
partial: !0
|
|
3709
|
+
}, zi = {
|
|
3710
|
+
tokenize: Xi,
|
|
3711
|
+
partial: !0
|
|
3712
|
+
}, Bi = {
|
|
3713
|
+
name: "wwwAutolink",
|
|
3714
|
+
tokenize: Wi,
|
|
3715
|
+
previous: Zi
|
|
3716
|
+
}, Vi = {
|
|
3717
|
+
name: "protocolAutolink",
|
|
3718
|
+
tokenize: Gi,
|
|
3719
|
+
previous: Qi
|
|
3720
|
+
}, Z = {
|
|
3721
|
+
name: "emailAutolink",
|
|
3722
|
+
tokenize: Ui,
|
|
3723
|
+
previous: $i
|
|
3724
|
+
}, Q = {};
|
|
3725
|
+
function Hi() {
|
|
3726
|
+
return { text: Q };
|
|
3727
|
+
}
|
|
3728
|
+
for (var $ = 48; $ < 123;) Q[$] = Z, $++, $ === 58 ? $ = 65 : $ === 91 && ($ = 97);
|
|
3729
|
+
Q[43] = Z, Q[45] = Z, Q[46] = Z, Q[95] = Z, Q[72] = [Z, Vi], Q[104] = [Z, Vi], Q[87] = [Z, Bi], Q[119] = [Z, Bi];
|
|
3730
|
+
function Ui(e, t, n) {
|
|
3731
|
+
let r = this, i, a;
|
|
3732
|
+
return o;
|
|
3733
|
+
function o(t) {
|
|
3734
|
+
return !ea(t) || !$i.call(r, r.previous) || ta(r.events) ? n(t) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), s(t));
|
|
3735
|
+
}
|
|
3736
|
+
function s(t) {
|
|
3737
|
+
return ea(t) ? (e.consume(t), s) : t === 64 ? (e.consume(t), l) : n(t);
|
|
3738
|
+
}
|
|
3739
|
+
function l(t) {
|
|
3740
|
+
return t === 46 ? e.check(zi, d, u)(t) : t === 45 || t === 95 || c(t) ? (a = !0, e.consume(t), l) : d(t);
|
|
3741
|
+
}
|
|
3742
|
+
function u(t) {
|
|
3743
|
+
return e.consume(t), i = !0, l;
|
|
3744
|
+
}
|
|
3745
|
+
function d(o) {
|
|
3746
|
+
return a && i && S(r.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), t(o)) : n(o);
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
function Wi(e, t, n) {
|
|
3750
|
+
let r = this;
|
|
3751
|
+
return i;
|
|
3752
|
+
function i(t) {
|
|
3753
|
+
return t !== 87 && t !== 119 || !Zi.call(r, r.previous) || ta(r.events) ? n(t) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(Fi, e.attempt(Ii, e.attempt(Li, a), n), n)(t));
|
|
3754
|
+
}
|
|
3755
|
+
function a(n) {
|
|
3756
|
+
return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), t(n);
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
function Gi(e, t, n) {
|
|
3760
|
+
let r = this, a = "", o = !1;
|
|
3761
|
+
return s;
|
|
3762
|
+
function s(t) {
|
|
3763
|
+
return (t === 72 || t === 104) && Qi.call(r, r.previous) && !ta(r.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), a += String.fromCodePoint(t), e.consume(t), c) : n(t);
|
|
3764
|
+
}
|
|
3765
|
+
function c(t) {
|
|
3766
|
+
if (S(t) && a.length < 5) return a += String.fromCodePoint(t), e.consume(t), c;
|
|
3767
|
+
if (t === 58) {
|
|
3768
|
+
let n = a.toLowerCase();
|
|
3769
|
+
if (n === "http" || n === "https") return e.consume(t), l;
|
|
3770
|
+
}
|
|
3771
|
+
return n(t);
|
|
3772
|
+
}
|
|
3773
|
+
function l(t) {
|
|
3774
|
+
return t === 47 ? (e.consume(t), o ? u : (o = !0, l)) : n(t);
|
|
3775
|
+
}
|
|
3776
|
+
function u(t) {
|
|
3777
|
+
return t === null || x(t) || g(t) || i(t) || h(t) ? n(t) : e.attempt(Ii, e.attempt(Li, d), n)(t);
|
|
3778
|
+
}
|
|
3779
|
+
function d(n) {
|
|
3780
|
+
return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), t(n);
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
function Ki(e, t, n) {
|
|
3784
|
+
let r = 0;
|
|
3785
|
+
return i;
|
|
3786
|
+
function i(t) {
|
|
3787
|
+
return (t === 87 || t === 119) && r < 3 ? (r++, e.consume(t), i) : t === 46 && r === 3 ? (e.consume(t), a) : n(t);
|
|
3788
|
+
}
|
|
3789
|
+
function a(e) {
|
|
3790
|
+
return e === null ? n(e) : t(e);
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
function qi(e, t, n) {
|
|
3794
|
+
let r, a, o;
|
|
3795
|
+
return s;
|
|
3796
|
+
function s(t) {
|
|
3797
|
+
return t === 46 || t === 95 ? e.check(Ri, l, c)(t) : t === null || g(t) || i(t) || t !== 45 && h(t) ? l(t) : (o = !0, e.consume(t), s);
|
|
3798
|
+
}
|
|
3799
|
+
function c(t) {
|
|
3800
|
+
return t === 95 ? r = !0 : (a = r, r = void 0), e.consume(t), s;
|
|
3801
|
+
}
|
|
3802
|
+
function l(e) {
|
|
3803
|
+
return a || r || !o ? n(e) : t(e);
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
function Ji(e, t) {
|
|
3807
|
+
let n = 0, r = 0;
|
|
3808
|
+
return a;
|
|
3809
|
+
function a(s) {
|
|
3810
|
+
return s === 40 ? (n++, e.consume(s), a) : s === 41 && r < n ? o(s) : s === 33 || s === 34 || s === 38 || s === 39 || s === 41 || s === 42 || s === 44 || s === 46 || s === 58 || s === 59 || s === 60 || s === 63 || s === 93 || s === 95 || s === 126 ? e.check(Ri, t, o)(s) : s === null || g(s) || i(s) ? t(s) : (e.consume(s), a);
|
|
3811
|
+
}
|
|
3812
|
+
function o(t) {
|
|
3813
|
+
return t === 41 && r++, e.consume(t), a;
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
function Yi(e, t, n) {
|
|
3817
|
+
return r;
|
|
3818
|
+
function r(s) {
|
|
3819
|
+
return s === 33 || s === 34 || s === 39 || s === 41 || s === 42 || s === 44 || s === 46 || s === 58 || s === 59 || s === 63 || s === 95 || s === 126 ? (e.consume(s), r) : s === 38 ? (e.consume(s), o) : s === 93 ? (e.consume(s), a) : s === 60 || s === null || g(s) || i(s) ? t(s) : n(s);
|
|
3820
|
+
}
|
|
3821
|
+
function a(e) {
|
|
3822
|
+
return e === null || e === 40 || e === 91 || g(e) || i(e) ? t(e) : r(e);
|
|
3823
|
+
}
|
|
3824
|
+
function o(e) {
|
|
3825
|
+
return S(e) ? s(e) : n(e);
|
|
3826
|
+
}
|
|
3827
|
+
function s(t) {
|
|
3828
|
+
return t === 59 ? (e.consume(t), r) : S(t) ? (e.consume(t), s) : n(t);
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
function Xi(e, t, n) {
|
|
3832
|
+
return r;
|
|
3833
|
+
function r(t) {
|
|
3834
|
+
return e.consume(t), i;
|
|
3835
|
+
}
|
|
3836
|
+
function i(e) {
|
|
3837
|
+
return c(e) ? n(e) : t(e);
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
function Zi(e) {
|
|
3841
|
+
return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || g(e);
|
|
3842
|
+
}
|
|
3843
|
+
function Qi(e) {
|
|
3844
|
+
return !S(e);
|
|
3845
|
+
}
|
|
3846
|
+
function $i(e) {
|
|
3847
|
+
return !(e === 47 || ea(e));
|
|
3848
|
+
}
|
|
3849
|
+
function ea(e) {
|
|
3850
|
+
return e === 43 || e === 45 || e === 46 || e === 95 || c(e);
|
|
3851
|
+
}
|
|
3852
|
+
function ta(e) {
|
|
3853
|
+
let t = e.length, n = !1;
|
|
3854
|
+
for (; t--;) {
|
|
3855
|
+
let r = e[t][1];
|
|
3856
|
+
if ((r.type === "labelLink" || r.type === "labelImage") && !r._balanced) {
|
|
3857
|
+
n = !0;
|
|
3858
|
+
break;
|
|
3859
|
+
}
|
|
3860
|
+
if (r._gfmAutolinkLiteralWalkedInto) {
|
|
3861
|
+
n = !1;
|
|
3862
|
+
break;
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
return e.length > 0 && !n && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), n;
|
|
3866
|
+
}
|
|
3867
|
+
// node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
3868
|
+
var na = {
|
|
3869
|
+
tokenize: ua,
|
|
3870
|
+
partial: !0
|
|
3871
|
+
};
|
|
3872
|
+
function ra() {
|
|
3873
|
+
return {
|
|
3874
|
+
document: { 91: {
|
|
3875
|
+
name: "gfmFootnoteDefinition",
|
|
3876
|
+
tokenize: sa,
|
|
3877
|
+
continuation: { tokenize: ca },
|
|
3878
|
+
exit: la
|
|
3879
|
+
} },
|
|
3880
|
+
text: {
|
|
3881
|
+
91: {
|
|
3882
|
+
name: "gfmFootnoteCall",
|
|
3883
|
+
tokenize: oa
|
|
3884
|
+
},
|
|
3885
|
+
93: {
|
|
3886
|
+
name: "gfmPotentialFootnoteCall",
|
|
3887
|
+
add: "after",
|
|
3888
|
+
tokenize: ia,
|
|
3889
|
+
resolveTo: aa
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
};
|
|
3893
|
+
}
|
|
3894
|
+
function ia(e, t, n) {
|
|
3895
|
+
let r = this, i = r.events.length, o = r.parser.gfmFootnotes || (r.parser.gfmFootnotes = []), s;
|
|
3896
|
+
for (; i--;) {
|
|
3897
|
+
let e = r.events[i][1];
|
|
3898
|
+
if (e.type === "labelImage") {
|
|
3899
|
+
s = e;
|
|
3900
|
+
break;
|
|
3901
|
+
}
|
|
3902
|
+
if (e.type === "gfmFootnoteCall" || e.type === "labelLink" || e.type === "label" || e.type === "image" || e.type === "link") break;
|
|
3903
|
+
}
|
|
3904
|
+
return c;
|
|
3905
|
+
function c(i) {
|
|
3906
|
+
if (!s || !s._balanced) return n(i);
|
|
3907
|
+
let c = a(r.sliceSerialize({
|
|
3908
|
+
start: s.end,
|
|
3909
|
+
end: r.now()
|
|
3910
|
+
}));
|
|
3911
|
+
return c.codePointAt(0) !== 94 || !o.includes(c.slice(1)) ? n(i) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(i), e.exit("gfmFootnoteCallLabelMarker"), t(i));
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
function aa(e, t) {
|
|
3915
|
+
let n = e.length;
|
|
3916
|
+
for (; n--;) if (e[n][1].type === "labelImage" && e[n][0] === "enter") {
|
|
3917
|
+
e[n][1];
|
|
3918
|
+
break;
|
|
3919
|
+
}
|
|
3920
|
+
e[n + 1][1].type = "data", e[n + 3][1].type = "gfmFootnoteCallLabelMarker";
|
|
3921
|
+
let r = {
|
|
3922
|
+
type: "gfmFootnoteCall",
|
|
3923
|
+
start: Object.assign({}, e[n + 3][1].start),
|
|
3924
|
+
end: Object.assign({}, e[e.length - 1][1].end)
|
|
3925
|
+
}, i = {
|
|
3926
|
+
type: "gfmFootnoteCallMarker",
|
|
3927
|
+
start: Object.assign({}, e[n + 3][1].end),
|
|
3928
|
+
end: Object.assign({}, e[n + 3][1].end)
|
|
3929
|
+
};
|
|
3930
|
+
i.end.column++, i.end.offset++, i.end._bufferIndex++;
|
|
3931
|
+
let a = {
|
|
3932
|
+
type: "gfmFootnoteCallString",
|
|
3933
|
+
start: Object.assign({}, i.end),
|
|
3934
|
+
end: Object.assign({}, e[e.length - 1][1].start)
|
|
3935
|
+
}, o = {
|
|
3936
|
+
type: "chunkString",
|
|
3937
|
+
contentType: "string",
|
|
3938
|
+
start: Object.assign({}, a.start),
|
|
3939
|
+
end: Object.assign({}, a.end)
|
|
3940
|
+
}, s = [
|
|
3941
|
+
e[n + 1],
|
|
3942
|
+
e[n + 2],
|
|
3943
|
+
[
|
|
3944
|
+
"enter",
|
|
3945
|
+
r,
|
|
3946
|
+
t
|
|
3947
|
+
],
|
|
3948
|
+
e[n + 3],
|
|
3949
|
+
e[n + 4],
|
|
3950
|
+
[
|
|
3951
|
+
"enter",
|
|
3952
|
+
i,
|
|
3953
|
+
t
|
|
3954
|
+
],
|
|
3955
|
+
[
|
|
3956
|
+
"exit",
|
|
3957
|
+
i,
|
|
3958
|
+
t
|
|
3959
|
+
],
|
|
3960
|
+
[
|
|
3961
|
+
"enter",
|
|
3962
|
+
a,
|
|
3963
|
+
t
|
|
3964
|
+
],
|
|
3965
|
+
[
|
|
3966
|
+
"enter",
|
|
3967
|
+
o,
|
|
3968
|
+
t
|
|
3969
|
+
],
|
|
3970
|
+
[
|
|
3971
|
+
"exit",
|
|
3972
|
+
o,
|
|
3973
|
+
t
|
|
3974
|
+
],
|
|
3975
|
+
[
|
|
3976
|
+
"exit",
|
|
3977
|
+
a,
|
|
3978
|
+
t
|
|
3979
|
+
],
|
|
3980
|
+
e[e.length - 2],
|
|
3981
|
+
e[e.length - 1],
|
|
3982
|
+
[
|
|
3983
|
+
"exit",
|
|
3984
|
+
r,
|
|
3985
|
+
t
|
|
3986
|
+
]
|
|
3987
|
+
];
|
|
3988
|
+
return e.splice(n, e.length - n + 1, ...s), e;
|
|
3989
|
+
}
|
|
3990
|
+
function oa(e, t, n) {
|
|
3991
|
+
let r = this, i = r.parser.gfmFootnotes || (r.parser.gfmFootnotes = []), o = 0, s;
|
|
3992
|
+
return c;
|
|
3993
|
+
function c(t) {
|
|
3994
|
+
return e.enter("gfmFootnoteCall"), e.enter("gfmFootnoteCallLabelMarker"), e.consume(t), e.exit("gfmFootnoteCallLabelMarker"), l;
|
|
3995
|
+
}
|
|
3996
|
+
function l(t) {
|
|
3997
|
+
return t === 94 ? (e.enter("gfmFootnoteCallMarker"), e.consume(t), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", u) : n(t);
|
|
3998
|
+
}
|
|
3999
|
+
function u(c) {
|
|
4000
|
+
if (o > 999 || c === 93 && !s || c === null || c === 91 || g(c)) return n(c);
|
|
4001
|
+
if (c === 93) {
|
|
4002
|
+
e.exit("chunkString");
|
|
4003
|
+
let o = e.exit("gfmFootnoteCallString");
|
|
4004
|
+
return i.includes(a(r.sliceSerialize(o))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), t) : n(c);
|
|
4005
|
+
}
|
|
4006
|
+
return g(c) || (s = !0), o++, e.consume(c), c === 92 ? d : u;
|
|
4007
|
+
}
|
|
4008
|
+
function d(t) {
|
|
4009
|
+
return t === 91 || t === 92 || t === 93 ? (e.consume(t), o++, u) : u(t);
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
function sa(e, t, n) {
|
|
4013
|
+
let r = this, i = r.parser.gfmFootnotes || (r.parser.gfmFootnotes = []), o, s = 0, c;
|
|
4014
|
+
return l;
|
|
4015
|
+
function l(t) {
|
|
4016
|
+
return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(t), e.exit("gfmFootnoteDefinitionLabelMarker"), u;
|
|
4017
|
+
}
|
|
4018
|
+
function u(t) {
|
|
4019
|
+
return t === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(t), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", d) : n(t);
|
|
4020
|
+
}
|
|
4021
|
+
function d(t) {
|
|
4022
|
+
if (s > 999 || t === 93 && !c || t === null || t === 91 || g(t)) return n(t);
|
|
4023
|
+
if (t === 93) {
|
|
4024
|
+
e.exit("chunkString");
|
|
4025
|
+
let n = e.exit("gfmFootnoteDefinitionLabelString");
|
|
4026
|
+
return o = a(r.sliceSerialize(n)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(t), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
|
|
4027
|
+
}
|
|
4028
|
+
return g(t) || (c = !0), s++, e.consume(t), t === 92 ? f : d;
|
|
4029
|
+
}
|
|
4030
|
+
function f(t) {
|
|
4031
|
+
return t === 91 || t === 92 || t === 93 ? (e.consume(t), s++, d) : d(t);
|
|
4032
|
+
}
|
|
4033
|
+
function p(t) {
|
|
4034
|
+
return t === 58 ? (e.enter("definitionMarker"), e.consume(t), e.exit("definitionMarker"), i.includes(o) || i.push(o), C(e, m, "gfmFootnoteDefinitionWhitespace")) : n(t);
|
|
4035
|
+
}
|
|
4036
|
+
function m(e) {
|
|
4037
|
+
return t(e);
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
function ca(e, t, n) {
|
|
4041
|
+
return e.check(p, t, e.attempt(na, t, n));
|
|
4042
|
+
}
|
|
4043
|
+
function la(e) {
|
|
4044
|
+
e.exit("gfmFootnoteDefinition");
|
|
4045
|
+
}
|
|
4046
|
+
function ua(e, t, n) {
|
|
4047
|
+
let r = this;
|
|
4048
|
+
return C(e, i, "gfmFootnoteDefinitionIndent", 5);
|
|
4049
|
+
function i(e) {
|
|
4050
|
+
let i = r.events[r.events.length - 1];
|
|
4051
|
+
return i && i[1].type === "gfmFootnoteDefinitionIndent" && i[2].sliceSerialize(i[1], !0).length === 4 ? t(e) : n(e);
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
4054
|
+
// node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
4055
|
+
function da(e) {
|
|
4056
|
+
let t = (e || {}).singleTilde, r = {
|
|
4057
|
+
name: "strikethrough",
|
|
4058
|
+
tokenize: a,
|
|
4059
|
+
resolveAll: i
|
|
4060
|
+
};
|
|
4061
|
+
return t ??= !0, {
|
|
4062
|
+
text: { 126: r },
|
|
4063
|
+
insideSpan: { null: [r] },
|
|
4064
|
+
attentionMarkers: { null: [126] }
|
|
4065
|
+
};
|
|
4066
|
+
function i(e, t) {
|
|
4067
|
+
let r = -1;
|
|
4068
|
+
for (; ++r < e.length;) if (e[r][0] === "enter" && e[r][1].type === "strikethroughSequenceTemporary" && e[r][1]._close) {
|
|
4069
|
+
let i = r;
|
|
4070
|
+
for (; i--;) if (e[i][0] === "exit" && e[i][1].type === "strikethroughSequenceTemporary" && e[i][1]._open && e[r][1].end.offset - e[r][1].start.offset === e[i][1].end.offset - e[i][1].start.offset) {
|
|
4071
|
+
e[r][1].type = "strikethroughSequence", e[i][1].type = "strikethroughSequence";
|
|
4072
|
+
let a = {
|
|
4073
|
+
type: "strikethrough",
|
|
4074
|
+
start: Object.assign({}, e[i][1].start),
|
|
4075
|
+
end: Object.assign({}, e[r][1].end)
|
|
4076
|
+
}, o = {
|
|
4077
|
+
type: "strikethroughText",
|
|
4078
|
+
start: Object.assign({}, e[i][1].end),
|
|
4079
|
+
end: Object.assign({}, e[r][1].start)
|
|
4080
|
+
}, s = [
|
|
4081
|
+
[
|
|
4082
|
+
"enter",
|
|
4083
|
+
a,
|
|
4084
|
+
t
|
|
4085
|
+
],
|
|
4086
|
+
[
|
|
4087
|
+
"enter",
|
|
4088
|
+
e[i][1],
|
|
4089
|
+
t
|
|
4090
|
+
],
|
|
4091
|
+
[
|
|
4092
|
+
"exit",
|
|
4093
|
+
e[i][1],
|
|
4094
|
+
t
|
|
4095
|
+
],
|
|
4096
|
+
[
|
|
4097
|
+
"enter",
|
|
4098
|
+
o,
|
|
4099
|
+
t
|
|
4100
|
+
]
|
|
4101
|
+
], c = t.parser.constructs.insideSpan.null;
|
|
4102
|
+
c && n(s, s.length, 0, l(c, e.slice(i + 1, r), t)), n(s, s.length, 0, [
|
|
4103
|
+
[
|
|
4104
|
+
"exit",
|
|
4105
|
+
o,
|
|
4106
|
+
t
|
|
4107
|
+
],
|
|
4108
|
+
[
|
|
4109
|
+
"enter",
|
|
4110
|
+
e[r][1],
|
|
4111
|
+
t
|
|
4112
|
+
],
|
|
4113
|
+
[
|
|
4114
|
+
"exit",
|
|
4115
|
+
e[r][1],
|
|
4116
|
+
t
|
|
4117
|
+
],
|
|
4118
|
+
[
|
|
4119
|
+
"exit",
|
|
4120
|
+
a,
|
|
4121
|
+
t
|
|
4122
|
+
]
|
|
4123
|
+
]), n(e, i - 1, r - i + 3, s), r = i + s.length - 2;
|
|
4124
|
+
break;
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
for (r = -1; ++r < e.length;) e[r][1].type === "strikethroughSequenceTemporary" && (e[r][1].type = "data");
|
|
4128
|
+
return e;
|
|
4129
|
+
}
|
|
4130
|
+
function a(e, n, r) {
|
|
4131
|
+
let i = this.previous, a = this.events, o = 0;
|
|
4132
|
+
return s;
|
|
4133
|
+
function s(t) {
|
|
4134
|
+
return i === 126 && a[a.length - 1][1].type !== "characterEscape" ? r(t) : (e.enter("strikethroughSequenceTemporary"), c(t));
|
|
4135
|
+
}
|
|
4136
|
+
function c(a) {
|
|
4137
|
+
let s = b(i);
|
|
4138
|
+
if (a === 126) return o > 1 ? r(a) : (e.consume(a), o++, c);
|
|
4139
|
+
if (o < 2 && !t) return r(a);
|
|
4140
|
+
let l = e.exit("strikethroughSequenceTemporary"), u = b(a);
|
|
4141
|
+
return l._open = !u || u === 2 && !!s, l._close = !s || s === 2 && !!u, n(a);
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4145
|
+
// node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
4146
|
+
var fa = class {
|
|
4147
|
+
constructor() {
|
|
4148
|
+
this.map = [], this.index = /* @__PURE__ */ new Map();
|
|
4149
|
+
}
|
|
4150
|
+
add(e, t, n) {
|
|
4151
|
+
pa(this, e, t, n);
|
|
4152
|
+
}
|
|
4153
|
+
consume(e) {
|
|
4154
|
+
/* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
|
|
4155
|
+
if (this.map.sort(function(e, t) {
|
|
4156
|
+
return e[0] - t[0];
|
|
4157
|
+
}), this.map.length === 0) return;
|
|
4158
|
+
let t = this.map.length, n = [];
|
|
4159
|
+
for (; t > 0;) --t, n.push(e.slice(this.map[t][0] + this.map[t][1]), this.map[t][2]), e.length = this.map[t][0];
|
|
4160
|
+
n.push(e.slice()), e.length = 0;
|
|
4161
|
+
let r = n.pop();
|
|
4162
|
+
for (; r;) {
|
|
4163
|
+
for (let t of r) e.push(t);
|
|
4164
|
+
r = n.pop();
|
|
4165
|
+
}
|
|
4166
|
+
this.map.length = 0, this.index.clear();
|
|
4167
|
+
}
|
|
4168
|
+
};
|
|
4169
|
+
function pa(e, t, n, r) {
|
|
4170
|
+
/* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
|
|
4171
|
+
if (n === 0 && r.length === 0) return;
|
|
4172
|
+
let i = e.index.get(t);
|
|
4173
|
+
if (i) {
|
|
4174
|
+
i[1] += n, i[2].push(...r);
|
|
4175
|
+
return;
|
|
4176
|
+
}
|
|
4177
|
+
let a = [
|
|
4178
|
+
t,
|
|
4179
|
+
n,
|
|
4180
|
+
r
|
|
4181
|
+
];
|
|
4182
|
+
e.map.push(a), e.index.set(t, a);
|
|
4183
|
+
}
|
|
4184
|
+
// node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
4185
|
+
function ma(e, t) {
|
|
4186
|
+
let n = !1, r = [];
|
|
4187
|
+
for (; t < e.length;) {
|
|
4188
|
+
let i = e[t];
|
|
4189
|
+
if (n) {
|
|
4190
|
+
if (i[0] === "enter") i[1].type === "tableContent" && r.push(e[t + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
|
|
4191
|
+
else if (i[1].type === "tableContent") {
|
|
4192
|
+
if (e[t - 1][1].type === "tableDelimiterMarker") {
|
|
4193
|
+
let e = r.length - 1;
|
|
4194
|
+
r[e] = r[e] === "left" ? "center" : "right";
|
|
4195
|
+
}
|
|
4196
|
+
} else if (i[1].type === "tableDelimiterRow") break;
|
|
4197
|
+
} else i[0] === "enter" && i[1].type === "tableDelimiterRow" && (n = !0);
|
|
4198
|
+
t += 1;
|
|
4199
|
+
}
|
|
4200
|
+
return r;
|
|
4201
|
+
}
|
|
4202
|
+
// node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
4203
|
+
function ha() {
|
|
4204
|
+
return { flow: { null: {
|
|
4205
|
+
name: "table",
|
|
4206
|
+
tokenize: ga,
|
|
4207
|
+
resolveAll: _a
|
|
4208
|
+
} } };
|
|
4209
|
+
}
|
|
4210
|
+
function ga(e, n, r) {
|
|
4211
|
+
let i = this, a = 0, s = 0, c;
|
|
4212
|
+
return l;
|
|
4213
|
+
function l(e) {
|
|
4214
|
+
let t = i.events.length - 1;
|
|
4215
|
+
for (; t > -1;) {
|
|
4216
|
+
let { type: e } = i.events[t][1];
|
|
4217
|
+
if (e === "lineEnding" || e === "linePrefix") t--;
|
|
4218
|
+
else break;
|
|
4219
|
+
}
|
|
4220
|
+
let n = t > -1 ? i.events[t][1].type : null, a = n === "tableHead" || n === "tableRow" ? E : u;
|
|
4221
|
+
return a === E && i.parser.lazy[i.now().line] ? r(e) : a(e);
|
|
4222
|
+
}
|
|
4223
|
+
function u(t) {
|
|
4224
|
+
return e.enter("tableHead"), e.enter("tableRow"), d(t);
|
|
4225
|
+
}
|
|
4226
|
+
function d(e) {
|
|
4227
|
+
return e === 124 || (c = !0, s += 1), f(e);
|
|
4228
|
+
}
|
|
4229
|
+
function f(n) {
|
|
4230
|
+
return n === null ? r(n) : o(n) ? s > 1 ? (s = 0, i.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), h) : r(n) : t(n) ? C(e, f, "whitespace")(n) : (s += 1, c && (c = !1, a += 1), n === 124 ? (e.enter("tableCellDivider"), e.consume(n), e.exit("tableCellDivider"), c = !0, f) : (e.enter("data"), p(n)));
|
|
4231
|
+
}
|
|
4232
|
+
function p(t) {
|
|
4233
|
+
return t === null || t === 124 || g(t) ? (e.exit("data"), f(t)) : (e.consume(t), t === 92 ? m : p);
|
|
4234
|
+
}
|
|
4235
|
+
function m(t) {
|
|
4236
|
+
return t === 92 || t === 124 ? (e.consume(t), p) : p(t);
|
|
4237
|
+
}
|
|
4238
|
+
function h(n) {
|
|
4239
|
+
return i.interrupt = !1, i.parser.lazy[i.now().line] ? r(n) : (e.enter("tableDelimiterRow"), c = !1, t(n) ? C(e, _, "linePrefix", i.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(n) : _(n));
|
|
4240
|
+
}
|
|
4241
|
+
function _(t) {
|
|
4242
|
+
return t === 45 || t === 58 ? y(t) : t === 124 ? (c = !0, e.enter("tableCellDivider"), e.consume(t), e.exit("tableCellDivider"), v) : T(t);
|
|
4243
|
+
}
|
|
4244
|
+
function v(n) {
|
|
4245
|
+
return t(n) ? C(e, y, "whitespace")(n) : y(n);
|
|
4246
|
+
}
|
|
4247
|
+
function y(t) {
|
|
4248
|
+
return t === 58 ? (s += 1, c = !0, e.enter("tableDelimiterMarker"), e.consume(t), e.exit("tableDelimiterMarker"), b) : t === 45 ? (s += 1, b(t)) : t === null || o(t) ? w(t) : T(t);
|
|
4249
|
+
}
|
|
4250
|
+
function b(t) {
|
|
4251
|
+
return t === 45 ? (e.enter("tableDelimiterFiller"), x(t)) : T(t);
|
|
4252
|
+
}
|
|
4253
|
+
function x(t) {
|
|
4254
|
+
return t === 45 ? (e.consume(t), x) : t === 58 ? (c = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(t), e.exit("tableDelimiterMarker"), S) : (e.exit("tableDelimiterFiller"), S(t));
|
|
4255
|
+
}
|
|
4256
|
+
function S(n) {
|
|
4257
|
+
return t(n) ? C(e, w, "whitespace")(n) : w(n);
|
|
4258
|
+
}
|
|
4259
|
+
function w(t) {
|
|
4260
|
+
return t === 124 ? _(t) : t === null || o(t) ? !c || a !== s ? T(t) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(t)) : T(t);
|
|
4261
|
+
}
|
|
4262
|
+
function T(e) {
|
|
4263
|
+
return r(e);
|
|
4264
|
+
}
|
|
4265
|
+
function E(t) {
|
|
4266
|
+
return e.enter("tableRow"), D(t);
|
|
4267
|
+
}
|
|
4268
|
+
function D(r) {
|
|
4269
|
+
return r === 124 ? (e.enter("tableCellDivider"), e.consume(r), e.exit("tableCellDivider"), D) : r === null || o(r) ? (e.exit("tableRow"), n(r)) : t(r) ? C(e, D, "whitespace")(r) : (e.enter("data"), O(r));
|
|
4270
|
+
}
|
|
4271
|
+
function O(t) {
|
|
4272
|
+
return t === null || t === 124 || g(t) ? (e.exit("data"), D(t)) : (e.consume(t), t === 92 ? k : O);
|
|
4273
|
+
}
|
|
4274
|
+
function k(t) {
|
|
4275
|
+
return t === 92 || t === 124 ? (e.consume(t), O) : O(t);
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
function _a(e, t) {
|
|
4279
|
+
let n = -1, r = !0, i = 0, a = [
|
|
4280
|
+
0,
|
|
4281
|
+
0,
|
|
4282
|
+
0,
|
|
4283
|
+
0
|
|
4284
|
+
], o = [
|
|
4285
|
+
0,
|
|
4286
|
+
0,
|
|
4287
|
+
0,
|
|
4288
|
+
0
|
|
4289
|
+
], s = !1, c = 0, l, u, d, f = new fa();
|
|
4290
|
+
for (; ++n < e.length;) {
|
|
4291
|
+
let p = e[n], m = p[1];
|
|
4292
|
+
p[0] === "enter" ? m.type === "tableHead" ? (s = !1, c !== 0 && (ya(f, t, c, l, u), u = void 0, c = 0), l = {
|
|
4293
|
+
type: "table",
|
|
4294
|
+
start: Object.assign({}, m.start),
|
|
4295
|
+
end: Object.assign({}, m.end)
|
|
4296
|
+
}, f.add(n, 0, [[
|
|
4297
|
+
"enter",
|
|
4298
|
+
l,
|
|
4299
|
+
t
|
|
4300
|
+
]])) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (r = !0, d = void 0, a = [
|
|
4301
|
+
0,
|
|
4302
|
+
0,
|
|
4303
|
+
0,
|
|
4304
|
+
0
|
|
4305
|
+
], o = [
|
|
4306
|
+
0,
|
|
4307
|
+
n + 1,
|
|
4308
|
+
0,
|
|
4309
|
+
0
|
|
4310
|
+
], s && (s = !1, u = {
|
|
4311
|
+
type: "tableBody",
|
|
4312
|
+
start: Object.assign({}, m.start),
|
|
4313
|
+
end: Object.assign({}, m.end)
|
|
4314
|
+
}, f.add(n, 0, [[
|
|
4315
|
+
"enter",
|
|
4316
|
+
u,
|
|
4317
|
+
t
|
|
4318
|
+
]])), i = m.type === "tableDelimiterRow" ? 2 : u ? 3 : 1) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") ? (r = !1, o[2] === 0 && (a[1] !== 0 && (o[0] = o[1], d = va(f, t, a, i, void 0, d), a = [
|
|
4319
|
+
0,
|
|
4320
|
+
0,
|
|
4321
|
+
0,
|
|
4322
|
+
0
|
|
4323
|
+
]), o[2] = n)) : m.type === "tableCellDivider" && (r ? r = !1 : (a[1] !== 0 && (o[0] = o[1], d = va(f, t, a, i, void 0, d)), a = o, o = [
|
|
4324
|
+
a[1],
|
|
4325
|
+
n,
|
|
4326
|
+
0,
|
|
4327
|
+
0
|
|
4328
|
+
])) : m.type === "tableHead" ? (s = !0, c = n) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (c = n, a[1] === 0 ? o[1] !== 0 && (d = va(f, t, o, i, n, d)) : (o[0] = o[1], d = va(f, t, a, i, n, d)), i = 0) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") && (o[3] = n);
|
|
4329
|
+
}
|
|
4330
|
+
for (c !== 0 && ya(f, t, c, l, u), f.consume(t.events), n = -1; ++n < t.events.length;) {
|
|
4331
|
+
let e = t.events[n];
|
|
4332
|
+
e[0] === "enter" && e[1].type === "table" && (e[1]._align = ma(t.events, n));
|
|
4333
|
+
}
|
|
4334
|
+
return e;
|
|
4335
|
+
}
|
|
4336
|
+
function va(e, t, n, r, i, a) {
|
|
4337
|
+
let o = r === 1 ? "tableHeader" : r === 2 ? "tableDelimiter" : "tableData";
|
|
4338
|
+
n[0] !== 0 && (a.end = Object.assign({}, ba(t.events, n[0])), e.add(n[0], 0, [[
|
|
4339
|
+
"exit",
|
|
4340
|
+
a,
|
|
4341
|
+
t
|
|
4342
|
+
]]));
|
|
4343
|
+
let s = ba(t.events, n[1]);
|
|
4344
|
+
if (a = {
|
|
4345
|
+
type: o,
|
|
4346
|
+
start: Object.assign({}, s),
|
|
4347
|
+
end: Object.assign({}, s)
|
|
4348
|
+
}, e.add(n[1], 0, [[
|
|
4349
|
+
"enter",
|
|
4350
|
+
a,
|
|
4351
|
+
t
|
|
4352
|
+
]]), n[2] !== 0) {
|
|
4353
|
+
let i = ba(t.events, n[2]), a = ba(t.events, n[3]), o = {
|
|
4354
|
+
type: "tableContent",
|
|
4355
|
+
start: Object.assign({}, i),
|
|
4356
|
+
end: Object.assign({}, a)
|
|
4357
|
+
};
|
|
4358
|
+
if (e.add(n[2], 0, [[
|
|
4359
|
+
"enter",
|
|
4360
|
+
o,
|
|
4361
|
+
t
|
|
4362
|
+
]]), r !== 2) {
|
|
4363
|
+
let r = t.events[n[2]], i = t.events[n[3]];
|
|
4364
|
+
if (r[1].end = Object.assign({}, i[1].end), r[1].type = "chunkText", r[1].contentType = "text", n[3] > n[2] + 1) {
|
|
4365
|
+
let t = n[2] + 1, r = n[3] - n[2] - 1;
|
|
4366
|
+
e.add(t, r, []);
|
|
4367
|
+
}
|
|
4368
|
+
}
|
|
4369
|
+
e.add(n[3] + 1, 0, [[
|
|
4370
|
+
"exit",
|
|
4371
|
+
o,
|
|
4372
|
+
t
|
|
4373
|
+
]]);
|
|
4374
|
+
}
|
|
4375
|
+
return i !== void 0 && (a.end = Object.assign({}, ba(t.events, i)), e.add(i, 0, [[
|
|
4376
|
+
"exit",
|
|
4377
|
+
a,
|
|
4378
|
+
t
|
|
4379
|
+
]]), a = void 0), a;
|
|
4380
|
+
}
|
|
4381
|
+
function ya(e, t, n, r, i) {
|
|
4382
|
+
let a = [], o = ba(t.events, n);
|
|
4383
|
+
i && (i.end = Object.assign({}, o), a.push([
|
|
4384
|
+
"exit",
|
|
4385
|
+
i,
|
|
4386
|
+
t
|
|
4387
|
+
])), r.end = Object.assign({}, o), a.push([
|
|
4388
|
+
"exit",
|
|
4389
|
+
r,
|
|
4390
|
+
t
|
|
4391
|
+
]), e.add(n + 1, 0, a);
|
|
4392
|
+
}
|
|
4393
|
+
function ba(e, t) {
|
|
4394
|
+
let n = e[t], r = n[0] === "enter" ? "start" : "end";
|
|
4395
|
+
return n[1][r];
|
|
4396
|
+
}
|
|
4397
|
+
// node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
4398
|
+
var xa = {
|
|
4399
|
+
name: "tasklistCheck",
|
|
4400
|
+
tokenize: Ca
|
|
4401
|
+
};
|
|
4402
|
+
function Sa() {
|
|
4403
|
+
return { text: { 91: xa } };
|
|
4404
|
+
}
|
|
4405
|
+
function Ca(e, n, r) {
|
|
4406
|
+
let i = this;
|
|
4407
|
+
return a;
|
|
4408
|
+
function a(t) {
|
|
4409
|
+
return i.previous !== null || !i._gfmTasklistFirstContentOfListItem ? r(t) : (e.enter("taskListCheck"), e.enter("taskListCheckMarker"), e.consume(t), e.exit("taskListCheckMarker"), s);
|
|
4410
|
+
}
|
|
4411
|
+
function s(t) {
|
|
4412
|
+
return g(t) ? (e.enter("taskListCheckValueUnchecked"), e.consume(t), e.exit("taskListCheckValueUnchecked"), c) : t === 88 || t === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(t), e.exit("taskListCheckValueChecked"), c) : r(t);
|
|
4413
|
+
}
|
|
4414
|
+
function c(t) {
|
|
4415
|
+
return t === 93 ? (e.enter("taskListCheckMarker"), e.consume(t), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), l) : r(t);
|
|
4416
|
+
}
|
|
4417
|
+
function l(i) {
|
|
4418
|
+
return o(i) ? n(i) : t(i) ? e.check({ tokenize: wa }, n, r)(i) : r(i);
|
|
4419
|
+
}
|
|
4420
|
+
}
|
|
4421
|
+
function wa(e, t, n) {
|
|
4422
|
+
return C(e, r, "whitespace");
|
|
4423
|
+
function r(e) {
|
|
4424
|
+
return e === null ? n(e) : t(e);
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
// node_modules/micromark-extension-gfm/index.js
|
|
4428
|
+
function Ta(e) {
|
|
4429
|
+
return s([
|
|
4430
|
+
Hi(),
|
|
4431
|
+
ra(),
|
|
4432
|
+
da(e),
|
|
4433
|
+
ha(),
|
|
4434
|
+
Sa()
|
|
4435
|
+
]);
|
|
4436
|
+
}
|
|
4437
|
+
// node_modules/remark-gfm/lib/index.js
|
|
4438
|
+
var Ea = {};
|
|
4439
|
+
function Da(e) {
|
|
4440
|
+
let t = this, n = e || Ea, r = t.data(), i = r.micromarkExtensions ||= [], a = r.fromMarkdownExtensions ||= [], o = r.toMarkdownExtensions ||= [];
|
|
4441
|
+
i.push(Ta(n)), a.push(Ni()), o.push(Pi(n));
|
|
4442
|
+
}
|
|
4443
|
+
// src/local/html/html-entities.ts
|
|
4444
|
+
function Oa(e, t = !1) {
|
|
4445
|
+
let n = (e) => t ? e.replace(/\u0000/g, "�") : e;
|
|
4446
|
+
if (!e.includes("&")) return n(e);
|
|
4447
|
+
try {
|
|
4448
|
+
let t = D(n(e).replace(/</g, "<"), { scriptingEnabled: !1 }), r = "", i = (e) => {
|
|
4449
|
+
if (e.nodeName === "#text") r += e.value;
|
|
4450
|
+
else {
|
|
4451
|
+
for (let t of e.childNodes ?? []) i(t);
|
|
4452
|
+
if (e.content?.childNodes) for (let t of e.content.childNodes) i(t);
|
|
4453
|
+
}
|
|
4454
|
+
};
|
|
4455
|
+
for (let e of t.childNodes) i(e);
|
|
4456
|
+
return n(r);
|
|
4457
|
+
} catch {
|
|
4458
|
+
return n(e);
|
|
4459
|
+
}
|
|
4460
|
+
}
|
|
4461
|
+
function ka(e) {
|
|
4462
|
+
let t = e.replace(/\u0000/g, "�");
|
|
4463
|
+
if (!t.includes("&")) return t;
|
|
4464
|
+
try {
|
|
4465
|
+
return D(`<x a="${t.replace(/"/g, """)}">`, { scriptingEnabled: !1 }).childNodes[0]?.attrs?.find((e) => e.name === "a")?.value ?? t;
|
|
4466
|
+
} catch {
|
|
4467
|
+
return t;
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
// src/local/html/html-recovery.ts
|
|
4471
|
+
var Aa = O.HTML, ja = /* @__PURE__ */ new Set([
|
|
4472
|
+
"html",
|
|
4473
|
+
"head",
|
|
4474
|
+
"body"
|
|
4475
|
+
]), Ma = e, Na = {
|
|
4476
|
+
table: [
|
|
4477
|
+
"caption",
|
|
4478
|
+
"colgroup",
|
|
4479
|
+
"thead",
|
|
4480
|
+
"tbody",
|
|
4481
|
+
"tfoot"
|
|
4482
|
+
],
|
|
4483
|
+
colgroup: ["col"],
|
|
4484
|
+
thead: ["tr"],
|
|
4485
|
+
tbody: ["tr"],
|
|
4486
|
+
tfoot: ["tr"],
|
|
4487
|
+
tr: ["th", "td"],
|
|
4488
|
+
col: []
|
|
4489
|
+
}, Pa = 100;
|
|
4490
|
+
function Fa(t, n, r, i, a) {
|
|
4491
|
+
let o = a === void 0 ? null : a.toLowerCase();
|
|
4492
|
+
if (o !== null && !w.has(o) && !e.has(o)) return null;
|
|
4493
|
+
let s = o !== null && Ma.has(o), c = [], l = null, u = s, d = n;
|
|
4494
|
+
for (; d < r;) {
|
|
4495
|
+
let n = t.indexOf("<", d), a = n < 0 || n >= r ? r : n;
|
|
4496
|
+
if (t.slice(d, a).includes("{{")) return null;
|
|
4497
|
+
if (n < 0 || n >= r) break;
|
|
4498
|
+
if (d = n, t.startsWith("<!--", d)) {
|
|
4499
|
+
d = f(t, d, r);
|
|
4500
|
+
continue;
|
|
4501
|
+
}
|
|
4502
|
+
let o = /^<(\/?)([A-Za-z][A-Za-z0-9:-]*)/.exec(t.slice(d, Math.min(r, d + 80)));
|
|
4503
|
+
if (!o) {
|
|
4504
|
+
d += 1;
|
|
4505
|
+
continue;
|
|
4506
|
+
}
|
|
4507
|
+
let p = d + o[0].length, m = t[p];
|
|
4508
|
+
if (!(m === ">" || m === "/" || m !== void 0 && /\s/.test(m))) {
|
|
4509
|
+
d = p;
|
|
4510
|
+
continue;
|
|
4511
|
+
}
|
|
4512
|
+
let h = o[2].toLowerCase(), g = o[1] === "/", _ = v(t, p, r);
|
|
4513
|
+
if (_ < 0) return null;
|
|
4514
|
+
let b = {
|
|
4515
|
+
name: h,
|
|
4516
|
+
closing: g,
|
|
4517
|
+
self: !g && /\/\s*$/.test(t.slice(p, _ - 1)),
|
|
4518
|
+
start: d,
|
|
4519
|
+
end: _
|
|
4520
|
+
};
|
|
4521
|
+
if (i.has(h)) return null;
|
|
4522
|
+
if (g) {
|
|
4523
|
+
if (h !== "table" && !e.has(h) && !w.has(h) || h !== "table" && e.has(h) && !s && !c.some((e) => e.name === "table")) return null;
|
|
4524
|
+
let t = -1;
|
|
4525
|
+
for (let e = c.length - 1; e >= 0; --e) if (c[e].name === h) {
|
|
4526
|
+
t = e;
|
|
4527
|
+
break;
|
|
4528
|
+
}
|
|
4529
|
+
t >= 0 ? c.length = t : l ??= b, d = b.end;
|
|
4530
|
+
} else {
|
|
4531
|
+
if (h === "table") u = !0;
|
|
4532
|
+
else if (e.has(h)) {
|
|
4533
|
+
if (!s && !c.some((e) => e.name === "table")) return null;
|
|
4534
|
+
} else if (!w.has(h)) return null;
|
|
4535
|
+
if (ja.has(h)) return null;
|
|
4536
|
+
if (!y.has(h) && !b.self) {
|
|
4537
|
+
if (h === "code" || h === "pre") {
|
|
4538
|
+
let e = RegExp(`</${h}\\s*>`, "gi");
|
|
4539
|
+
e.lastIndex = b.end;
|
|
4540
|
+
let n = e.exec(t);
|
|
4541
|
+
if (n && n.index < r) {
|
|
4542
|
+
d = n.index + n[0].length;
|
|
4543
|
+
continue;
|
|
4544
|
+
}
|
|
4545
|
+
c.push(b), d = r;
|
|
4546
|
+
continue;
|
|
4547
|
+
}
|
|
4548
|
+
c.push(b);
|
|
4549
|
+
}
|
|
4550
|
+
d = b.end;
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
return c.length > 0 ? {
|
|
4554
|
+
tableMode: u,
|
|
4555
|
+
contextTag: o,
|
|
4556
|
+
strayClose: l,
|
|
4557
|
+
unclosed: c[0]
|
|
4558
|
+
} : {
|
|
4559
|
+
tableMode: u,
|
|
4560
|
+
contextTag: o,
|
|
4561
|
+
strayClose: l,
|
|
4562
|
+
unclosed: null
|
|
4563
|
+
};
|
|
4564
|
+
}
|
|
4565
|
+
function Ia(e, t) {
|
|
4566
|
+
let n = {};
|
|
4567
|
+
for (let r of t.attrs) {
|
|
4568
|
+
if (r.prefix || r.namespace || r.value.includes("{{")) return null;
|
|
4569
|
+
let t = r.name.toLowerCase();
|
|
4570
|
+
if (!_(e, t)) return null;
|
|
4571
|
+
if (t === "align" && T.has(e)) {
|
|
4572
|
+
let t = d(e, r.value);
|
|
4573
|
+
if (!t) return null;
|
|
4574
|
+
n.align = t;
|
|
4575
|
+
} else {
|
|
4576
|
+
if (!m(t, r.value)) return null;
|
|
4577
|
+
n[t] = r.value;
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
return e === "details" && Object.hasOwn(n, "open") && (n.open = "true"), n;
|
|
4581
|
+
}
|
|
4582
|
+
function La(t, n, r, i, a, o) {
|
|
4583
|
+
if (!Number.isInteger(n) || !Number.isInteger(r) || n < 0 || r > t.length || r <= n) return null;
|
|
4584
|
+
let s = Fa(t, n, r, a, o);
|
|
4585
|
+
if (s === null) return null;
|
|
4586
|
+
let c = r - n, l = (e) => Math.max(0, Math.min(c, e)), d = (e) => n + l(e), f = [], p = [];
|
|
4587
|
+
s.strayClose && f.push({
|
|
4588
|
+
start: s.strayClose.start,
|
|
4589
|
+
end: s.strayClose.end
|
|
4590
|
+
}), s.unclosed && f.push({
|
|
4591
|
+
start: s.unclosed.start,
|
|
4592
|
+
end: s.unclosed.end
|
|
4593
|
+
});
|
|
4594
|
+
let m = s.tableMode, h = {
|
|
4595
|
+
scriptingEnabled: !1,
|
|
4596
|
+
sourceCodeLocationInfo: !0
|
|
4597
|
+
}, g = t.slice(n, r), _ = s.contextTag === null ? D(g, h) : D(E.createElement(s.contextTag, Aa, []), g, h);
|
|
4598
|
+
function v(e) {
|
|
4599
|
+
if (!Number.isInteger(e.startOffset) || !Number.isInteger(e.endOffset)) return null;
|
|
4600
|
+
let t = d(e.startOffset), n = d(e.endOffset);
|
|
4601
|
+
return n < t ? null : {
|
|
4602
|
+
start: t,
|
|
4603
|
+
end: n
|
|
4604
|
+
};
|
|
4605
|
+
}
|
|
4606
|
+
function b(e) {
|
|
4607
|
+
if (e.length === 0) return null;
|
|
4608
|
+
let t = Infinity, i = -Infinity;
|
|
4609
|
+
for (let n of e) t = Math.min(t, n.range.start), i = Math.max(i, n.range.end);
|
|
4610
|
+
return {
|
|
4611
|
+
start: Math.max(n, t),
|
|
4612
|
+
end: Math.min(r, Math.max(t, i))
|
|
4613
|
+
};
|
|
4614
|
+
}
|
|
4615
|
+
function x(e, t) {
|
|
4616
|
+
return b(e) ?? {
|
|
4617
|
+
start: Math.max(n, Math.min(r, t)),
|
|
4618
|
+
end: Math.max(n, Math.min(r, t))
|
|
4619
|
+
};
|
|
4620
|
+
}
|
|
4621
|
+
function S(e, t) {
|
|
4622
|
+
e.synthetic = !0, e.syntheticBoundary = {
|
|
4623
|
+
start: t.start,
|
|
4624
|
+
end: t.end
|
|
4625
|
+
}, p.push({
|
|
4626
|
+
start: t.start,
|
|
4627
|
+
end: t.end
|
|
4628
|
+
});
|
|
4629
|
+
}
|
|
4630
|
+
function C(e, t) {
|
|
4631
|
+
let n = t;
|
|
4632
|
+
if (e === "details") {
|
|
4633
|
+
let e = n.findIndex((e) => e.type === "summary");
|
|
4634
|
+
if (e > 0) {
|
|
4635
|
+
let [t] = n.splice(e, 1);
|
|
4636
|
+
n.unshift(t);
|
|
4637
|
+
}
|
|
4638
|
+
return n;
|
|
4639
|
+
}
|
|
4640
|
+
if (e === "li" && n.length === 1 && n[0].type === "paragraph") return n[0].children ?? [];
|
|
4641
|
+
if (e === "ul" || e === "ol") {
|
|
4642
|
+
let e = n.filter((e) => !(e.type === "comment" || e.type === "text" && !(e.value ?? "").trim()));
|
|
4643
|
+
return e.every((e) => e.type === "listItem") ? e : null;
|
|
4644
|
+
}
|
|
4645
|
+
return n;
|
|
4646
|
+
}
|
|
4647
|
+
function T(e, t, n, r) {
|
|
4648
|
+
let i = [], a = -Infinity;
|
|
4649
|
+
for (let t of e.childNodes) {
|
|
4650
|
+
let e = O(t, n + 1, r);
|
|
4651
|
+
if (e === null) return null;
|
|
4652
|
+
if (e !== void 0) {
|
|
4653
|
+
if (e.range.start < a) return null;
|
|
4654
|
+
a = e.range.end, i.push(e);
|
|
4655
|
+
}
|
|
4656
|
+
}
|
|
4657
|
+
return C(t, i);
|
|
4658
|
+
}
|
|
4659
|
+
function O(e, t, n) {
|
|
4660
|
+
if (E.isTextNode(e)) {
|
|
4661
|
+
let t = e.sourceCodeLocation;
|
|
4662
|
+
if (!t) return null;
|
|
4663
|
+
let n = v(t);
|
|
4664
|
+
return n === null ? null : n.start === n.end ? void 0 : e.value.includes("{{") ? null : i("text", n.start, n.end, { value: e.value.replace(/\u0000/g, "�") });
|
|
4665
|
+
}
|
|
4666
|
+
if (E.isCommentNode(e)) {
|
|
4667
|
+
let t = e.sourceCodeLocation;
|
|
4668
|
+
if (!t) return null;
|
|
4669
|
+
let n = v(t);
|
|
4670
|
+
return n === null ? null : i("comment", n.start, n.end);
|
|
4671
|
+
}
|
|
4672
|
+
return E.isElementNode(e) ? ee(e, t, n) : null;
|
|
4673
|
+
}
|
|
4674
|
+
function k(e, t, n) {
|
|
4675
|
+
let r = {
|
|
4676
|
+
attrs: t,
|
|
4677
|
+
children: n
|
|
4678
|
+
};
|
|
4679
|
+
if (e === "a") return t.href === void 0 ? r.type = "span" : (r.type = "link", r.url = t.href, r.title = t.title ?? null), r;
|
|
4680
|
+
if (/^h[1-6]$/.test(e)) return r.type = "heading", r.depth = Number(e.slice(1)), r;
|
|
4681
|
+
if (e === "ul" || e === "ol") {
|
|
4682
|
+
r.type = "list", r.ordered = e === "ol";
|
|
4683
|
+
let n = t.start === void 0 ? void 0 : Number(t.start);
|
|
4684
|
+
return e === "ol" && n !== void 0 && Number.isFinite(n) && (r.start = n), r;
|
|
4685
|
+
}
|
|
4686
|
+
return r.type = e === "p" ? "paragraph" : e === "div" ? "div" : e === "blockquote" ? "blockquote" : e === "details" ? "details" : e === "li" ? "listItem" : u[e] ?? e, r;
|
|
4687
|
+
}
|
|
4688
|
+
function ee(n, r, a) {
|
|
4689
|
+
if (r > Pa || n.namespaceURI !== Aa) return null;
|
|
4690
|
+
let o = n.tagName.toLowerCase();
|
|
4691
|
+
if (ja.has(o) || !w.has(o) && !(m && e.has(o))) return null;
|
|
4692
|
+
let s = n.sourceCodeLocation, c = !s, l = Ia(o, n);
|
|
4693
|
+
if (l === null) return null;
|
|
4694
|
+
if (o === "br" || o === "hr" || o === "img") {
|
|
4695
|
+
if (!s) return null;
|
|
4696
|
+
let e = v(s);
|
|
4697
|
+
if (e === null) return null;
|
|
4698
|
+
if (o === "br") return i("break", e.start, e.end, { attrs: l });
|
|
4699
|
+
if (o === "hr") return i("thematicBreak", e.start, e.end, { attrs: l });
|
|
4700
|
+
let t = l.width === void 0 ? void 0 : Number(l.width), n = l.height === void 0 ? void 0 : Number(l.height);
|
|
4701
|
+
return i("image", e.start, e.end, {
|
|
4702
|
+
attrs: l,
|
|
4703
|
+
url: l.src,
|
|
4704
|
+
alt: l.alt ?? "",
|
|
4705
|
+
title: l.title ?? null,
|
|
4706
|
+
...t === void 0 ? {} : { width: t },
|
|
4707
|
+
...n === void 0 ? {} : { height: n }
|
|
4708
|
+
});
|
|
4709
|
+
}
|
|
4710
|
+
if (o === "code" || o === "pre") {
|
|
4711
|
+
if (!s || !s.startTag) return null;
|
|
4712
|
+
let e = v(s);
|
|
4713
|
+
if (e === null) return null;
|
|
4714
|
+
let n = d(s.startTag.endOffset), r = s.endTag ? d(s.endTag.startOffset) : d(s.endOffset);
|
|
4715
|
+
if (r < n) return null;
|
|
4716
|
+
let a = t.slice(n, r);
|
|
4717
|
+
if (s.endTag === void 0 && f.push({
|
|
4718
|
+
start: d(s.startTag.startOffset),
|
|
4719
|
+
end: d(s.startTag.endOffset)
|
|
4720
|
+
}), o === "pre") {
|
|
4721
|
+
let t = /^<code(?:\s[^>]*)?>([\s\S]*)<\/code>$/.exec(a);
|
|
4722
|
+
return i("code", e.start, e.end, {
|
|
4723
|
+
attrs: l,
|
|
4724
|
+
value: Oa(t ? t[1] : a, !0)
|
|
4725
|
+
});
|
|
4726
|
+
}
|
|
4727
|
+
return i("inlineCode", e.start, e.end, {
|
|
4728
|
+
attrs: l,
|
|
4729
|
+
value: Oa(a, !0)
|
|
4730
|
+
});
|
|
4731
|
+
}
|
|
4732
|
+
if (e.has(o)) return ne(n, o, l, r, a, s);
|
|
4733
|
+
let u = T(n, o, r, a);
|
|
4734
|
+
if (u === null) return null;
|
|
4735
|
+
let p = k(o, l, u), h;
|
|
4736
|
+
if (c) h = x(u, a), S(p, h);
|
|
4737
|
+
else {
|
|
4738
|
+
let e = v(s);
|
|
4739
|
+
if (e === null) return null;
|
|
4740
|
+
h = e, !s?.endTag && s?.startTag && f.push({
|
|
4741
|
+
start: d(s.startTag.startOffset),
|
|
4742
|
+
end: d(s.startTag.endOffset)
|
|
4743
|
+
});
|
|
4744
|
+
}
|
|
4745
|
+
return i(p.type ?? o, h.start, h.end, p);
|
|
4746
|
+
}
|
|
4747
|
+
function te(e, t, n, r) {
|
|
4748
|
+
let i = Na[t];
|
|
4749
|
+
if (i === void 0) return null;
|
|
4750
|
+
let a = [], o = -Infinity;
|
|
4751
|
+
for (let t of e.childNodes) {
|
|
4752
|
+
if (E.isTextNode(t)) {
|
|
4753
|
+
if (!t.value.trim()) continue;
|
|
4754
|
+
return null;
|
|
4755
|
+
}
|
|
4756
|
+
if (E.isCommentNode(t)) continue;
|
|
4757
|
+
if (!E.isElementNode(t) || t.namespaceURI !== Aa) return null;
|
|
4758
|
+
let e = t.tagName.toLowerCase();
|
|
4759
|
+
if (!i.includes(e)) return null;
|
|
4760
|
+
let s = Ia(e, t);
|
|
4761
|
+
if (s === null) return null;
|
|
4762
|
+
let c = ne(t, e, s, n + 1, r, t.sourceCodeLocation);
|
|
4763
|
+
if (c === null || c.range.start < o) return null;
|
|
4764
|
+
o = c.range.end, a.push(c);
|
|
4765
|
+
}
|
|
4766
|
+
return a;
|
|
4767
|
+
}
|
|
4768
|
+
function ne(e, t, n, r, a, o) {
|
|
4769
|
+
if (r > Pa) return null;
|
|
4770
|
+
let s = !o, c;
|
|
4771
|
+
if (c = t === "td" || t === "th" || t === "caption" ? T(e, t, r, a) : te(e, t, r, a), c === null) return null;
|
|
4772
|
+
let l, u = t === "table" ? {
|
|
4773
|
+
attrs: n,
|
|
4774
|
+
children: c
|
|
4775
|
+
} : {
|
|
4776
|
+
attrs: n,
|
|
4777
|
+
children: c,
|
|
4778
|
+
name: t
|
|
4779
|
+
};
|
|
4780
|
+
if (s) l = x(c, a), S(u, l);
|
|
4781
|
+
else {
|
|
4782
|
+
let e = v(o);
|
|
4783
|
+
if (e === null) return null;
|
|
4784
|
+
l = e, !o?.endTag && !y.has(t) && o?.startTag && f.push({
|
|
4785
|
+
start: d(o.startTag.startOffset),
|
|
4786
|
+
end: d(o.startTag.endOffset)
|
|
4787
|
+
});
|
|
4788
|
+
}
|
|
4789
|
+
return i(t === "table" ? "htmlTable" : "htmlTableElement", l.start, l.end, u);
|
|
4790
|
+
}
|
|
4791
|
+
let re = [], ie = -Infinity;
|
|
4792
|
+
for (let e of _.childNodes) {
|
|
4793
|
+
let t = O(e, 0, n);
|
|
4794
|
+
if (t === null) return null;
|
|
4795
|
+
if (t !== void 0) {
|
|
4796
|
+
if (t.range.start < ie || t.range.start < n || t.range.end > r) return null;
|
|
4797
|
+
ie = t.range.end, re.push(t);
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
if (re.length === 0 || !re.some((e) => !(e.type === "comment" || e.type === "text" && !(e.value ?? "").trim()))) return null;
|
|
4801
|
+
f.sort((e, t) => e.start - t.start || e.end - t.end), p.sort((e, t) => e.start - t.start || e.end - t.end);
|
|
4802
|
+
let ae = f[0] ?? p[0], oe = ae === void 0 ? n : Math.max(n, Math.min(r, ae.start));
|
|
4803
|
+
return {
|
|
4804
|
+
nodes: re,
|
|
4805
|
+
recovery: {
|
|
4806
|
+
code: "local.html.repair",
|
|
4807
|
+
causeRange: {
|
|
4808
|
+
start: oe,
|
|
4809
|
+
end: ae === void 0 ? oe : Math.max(oe, Math.min(r, ae.end))
|
|
4810
|
+
},
|
|
4811
|
+
affectedRange: {
|
|
4812
|
+
start: n,
|
|
4813
|
+
end: r
|
|
4814
|
+
},
|
|
4815
|
+
action: "html-repair",
|
|
4816
|
+
boundary: "fragment"
|
|
4817
|
+
},
|
|
4818
|
+
end: r
|
|
4819
|
+
};
|
|
4820
|
+
}
|
|
4821
|
+
// src/local/parsing/parser-standard.ts
|
|
4822
|
+
var Ra = Zt.configure(gn);
|
|
4823
|
+
function za(e) {
|
|
4824
|
+
let t;
|
|
4825
|
+
try {
|
|
4826
|
+
t = Ra.parse(e.replace(/\r(?!\n)/g, "\n"));
|
|
4827
|
+
} catch {
|
|
4828
|
+
return {
|
|
4829
|
+
candidates: [],
|
|
4830
|
+
maxDepth: 0,
|
|
4831
|
+
codeRanges: []
|
|
4832
|
+
};
|
|
4833
|
+
}
|
|
4834
|
+
let n = [];
|
|
4835
|
+
for (let e = t.topNode.firstChild; e; e = e.nextSibling) n.push({
|
|
4836
|
+
from: e.from,
|
|
4837
|
+
to: e.to,
|
|
4838
|
+
type: e.type.name
|
|
4839
|
+
});
|
|
4840
|
+
let r = 0, i = 0, a = [], o = /* @__PURE__ */ new Set([
|
|
4841
|
+
"Blockquote",
|
|
4842
|
+
"BulletList",
|
|
4843
|
+
"OrderedList"
|
|
4844
|
+
]);
|
|
4845
|
+
return t.iterate({
|
|
4846
|
+
enter(e) {
|
|
4847
|
+
o.has(e.name) && (r++, i = Math.max(i, r)), (e.name === "FencedCode" || e.name === "CodeBlock") && a.push({
|
|
4848
|
+
start: e.from,
|
|
4849
|
+
end: e.to
|
|
4850
|
+
});
|
|
4851
|
+
},
|
|
4852
|
+
leave(e) {
|
|
4853
|
+
o.has(e.name) && r--;
|
|
4854
|
+
}
|
|
4855
|
+
}), {
|
|
4856
|
+
candidates: n,
|
|
4857
|
+
maxDepth: i,
|
|
4858
|
+
codeRanges: a
|
|
4859
|
+
};
|
|
4860
|
+
}
|
|
4861
|
+
var Ba = Object.freeze({
|
|
4862
|
+
markdownPlugins: Object.freeze([Da]),
|
|
4863
|
+
html: Object.freeze({
|
|
4864
|
+
nativeTagNames: new Set(Object.values(k)),
|
|
4865
|
+
decodeEntities: (e) => Oa(e, !0),
|
|
4866
|
+
decodeAttribute: ka,
|
|
4867
|
+
readTable: re,
|
|
4868
|
+
recoverFragment: La
|
|
4869
|
+
}),
|
|
4870
|
+
markdownStructure: za
|
|
4871
|
+
});
|
|
4872
|
+
export { Ae as i, gn as n, Zt as r, Ba as t };
|