From bd47e95879923f42085ada1adfd7be88b9c36269 Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 12 Nov 2024 02:21:00 +0000 Subject: [PATCH] Freshen generated index.js file. --- dist/index.js | 2441 +++++++++++++++++++++++++------------------------ 1 file changed, 1244 insertions(+), 1197 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3441116..2001562 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21344,30 +21344,25 @@ module.exports = outputFormatter; -const micromark = __nccwpck_require__(3302); +const micromark = __nccwpck_require__(1670); const { newLineRe, nextLinesRe } = __nccwpck_require__(7389); module.exports.newLineRe = newLineRe; module.exports.nextLinesRe = nextLinesRe; +/** @typedef {import("../lib/markdownlint.js").RuleOnError} RuleOnError */ +/** @typedef {import("../lib/markdownlint.js").RuleOnErrorFixInfo} RuleOnErrorFixInfo */ + // Regular expression for matching common front matter (YAML and TOML) module.exports.frontMatterRe = - /((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m; + /((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m; // Regular expression for matching the start of inline disable/enable comments const inlineCommentStartRe = /()/gi; module.exports.inlineCommentStartRe = inlineCommentStartRe; -// Regular expression for blockquote prefixes -const blockquotePrefixRe = /^[>\s]*/; -module.exports.blockquotePrefixRe = blockquotePrefixRe; - -// Regular expression for link reference definitions -const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/; -module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe; - // Regular expression for identifying an HTML entity at the end of a line module.exports.endOfLineHtmlEntityRe = /&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/; @@ -21565,99 +21560,6 @@ module.exports.escapeForRegExp = function escapeForRegExp(str) { return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); }; -/** - * Return the string representation of a fence markup character. - * - * @param {string} markup Fence string. - * @returns {string} String representation. - */ -module.exports.fencedCodeBlockStyleFor = - function fencedCodeBlockStyleFor(markup) { - switch (markup[0]) { - case "~": - return "tilde"; - default: - return "backtick"; - } - }; - -/** - * Return the string representation of a emphasis or strong markup character. - * - * @param {string} markup Emphasis or strong string. - * @returns {"asterisk" | "underscore"} String representation. - */ -module.exports.emphasisOrStrongStyleFor = - function emphasisOrStrongStyleFor(markup) { - switch (markup[0]) { - case "*": - return "asterisk"; - default: - return "underscore"; - } - }; - -/** - * @callback InlineCodeSpanCallback - * @param {string} code Code content. - * @param {number} lineIndex Line index (0-based). - * @param {number} columnIndex Column index (0-based). - * @param {number} ticks Count of backticks. - * @returns {void} - */ - -/** - * Calls the provided function for each inline code span's content. - * - * @param {string} input Markdown content. - * @param {InlineCodeSpanCallback} handler Callback function taking (code, - * lineIndex, columnIndex, ticks). - * @returns {void} - */ -function forEachInlineCodeSpan(input, handler) { - const backtickRe = /`+/g; - let match = null; - const backticksLengthAndIndex = []; - while ((match = backtickRe.exec(input)) !== null) { - backticksLengthAndIndex.push([ match[0].length, match.index ]); - } - const newLinesIndex = []; - while ((match = newLineRe.exec(input)) !== null) { - newLinesIndex.push(match.index); - } - let lineIndex = 0; - let lineStartIndex = 0; - let k = 0; - for (let i = 0; i < backticksLengthAndIndex.length - 1; i++) { - const [ startLength, startIndex ] = backticksLengthAndIndex[i]; - if ((startIndex === 0) || (input[startIndex - 1] !== "\\")) { - for (let j = i + 1; j < backticksLengthAndIndex.length; j++) { - const [ endLength, endIndex ] = backticksLengthAndIndex[j]; - if (startLength === endLength) { - for (; k < newLinesIndex.length; k++) { - const newLineIndex = newLinesIndex[k]; - if (startIndex < newLineIndex) { - break; - } - lineIndex++; - lineStartIndex = newLineIndex + 1; - } - const columnIndex = startIndex - lineStartIndex + startLength; - handler( - input.slice(startIndex + startLength, endIndex), - lineIndex, - columnIndex, - startLength - ); - i = j; - break; - } - } - } - } -} -module.exports.forEachInlineCodeSpan = forEachInlineCodeSpan; - /** * Adds ellipsis to the left/right/middle of the specified text. * @@ -21683,12 +21585,12 @@ module.exports.ellipsify = ellipsify; /** * Adds a generic error object via the onError callback. * - * @param {Object} onError RuleOnError instance. + * @param {RuleOnError} onError RuleOnError instance. * @param {number} lineNumber Line number. * @param {string} [detail] Error details. * @param {string} [context] Error context. * @param {number[]} [range] Column and length of error. - * @param {Object} [fixInfo] RuleOnErrorFixInfo instance. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. * @returns {void} */ function addError(onError, lineNumber, detail, context, range, fixInfo) { @@ -21705,14 +21607,14 @@ module.exports.addError = addError; /** * Adds an error object with details conditionally via the onError callback. * - * @param {Object} onError RuleOnError instance. + * @param {RuleOnError} onError RuleOnError instance. * @param {number} lineNumber Line number. * @param {Object} expected Expected value. * @param {Object} actual Actual value. * @param {string} [detail] Error details. * @param {string} [context] Error context. * @param {number[]} [range] Column and length of error. - * @param {Object} [fixInfo] RuleOnErrorFixInfo instance. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. * @returns {void} */ function addErrorDetailIf( @@ -21733,13 +21635,13 @@ module.exports.addErrorDetailIf = addErrorDetailIf; /** * Adds an error object with context via the onError callback. * - * @param {Object} onError RuleOnError instance. + * @param {RuleOnError} onError RuleOnError instance. * @param {number} lineNumber Line number. * @param {string} context Error context. * @param {boolean} [start] True iff the start of the text is important. * @param {boolean} [end] True iff the end of the text is important. * @param {number[]} [range] Column and length of error. - * @param {Object} [fixInfo] RuleOnErrorFixInfo instance. + * @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance. * @returns {void} */ function addErrorContext( @@ -21750,50 +21652,42 @@ function addErrorContext( module.exports.addErrorContext = addErrorContext; /** - * Adds an error object with context for a construct missing a blank line. + * Defines a range within a file (start line/column to end line/column, subset of MicromarkToken). * - * @param {Object} onError RuleOnError instance. - * @param {string[]} lines Lines of Markdown content. - * @param {number} lineIndex Line index of line. - * @param {number} [lineNumber] Line number for override. - * @returns {void} + * @typedef {Object} FileRange + * @property {number} startLine Start line (1-based). + * @property {number} startColumn Start column (1-based). + * @property {number} endLine End line (1-based). + * @property {number} endColumn End column (1-based). */ -function addErrorContextForLine(onError, lines, lineIndex, lineNumber) { - const line = lines[lineIndex]; - // @ts-ignore - const quotePrefix = line.match(blockquotePrefixRe)[0].trimEnd(); - addErrorContext( - onError, - lineIndex + 1, - line.trim(), - undefined, - undefined, - undefined, - { - lineNumber, - "insertText": `${quotePrefix}\n` - } - ); -} -module.exports.addErrorContextForLine = addErrorContextForLine; /** - * Determines whether the specified range is within another range. + * Returns whether line/column A is less than or equal to line/column B. * - * @param {number[][]} ranges Array of ranges (line, index, length). - * @param {number} lineIndex Line index to check. - * @param {number} index Index to check. - * @param {number} length Length to check. - * @returns {boolean} True iff the specified range is within. + * @param {number} lineA Line A. + * @param {number} columnA Column A. + * @param {number} lineB Line B. + * @param {number} columnB Column B. + * @returns {boolean} True iff A is less than or equal to B. */ -const withinAnyRange = (ranges, lineIndex, index, length) => ( - !ranges.every((span) => ( - (lineIndex !== span[0]) || - (index < span[1]) || - (index + length > span[1] + span[2]) - )) +const positionLessThanOrEqual = (lineA, columnA, lineB, columnB) => ( + (lineA < lineB) || + ((lineA === lineB) && (columnA <= columnB)) ); -module.exports.withinAnyRange = withinAnyRange; + +/** + * Returns whether two ranges (or MicromarkTokens) overlap anywhere. + * + * @param {FileRange|import("../lib/markdownlint.js").MicromarkToken} rangeA Range A. + * @param {FileRange|import("../lib/markdownlint.js").MicromarkToken} rangeB Range B. + * @returns {boolean} True iff the two ranges overlap. + */ +module.exports.hasOverlap = function hasOverlap(rangeA, rangeB) { + const lte = positionLessThanOrEqual(rangeA.startLine, rangeA.startColumn, rangeB.startLine, rangeB.startColumn); + const first = lte ? rangeA : rangeB; + const second = lte ? rangeB : rangeA; + return positionLessThanOrEqual(second.startLine, second.startColumn, first.endLine, first.endColumn); +}; // Determines if the front matter includes a title module.exports.frontMatterHasTitle = @@ -21812,16 +21706,28 @@ module.exports.frontMatterHasTitle = /** * Returns an object with information about reference links and images. * - * @param {import("../helpers/micromark.cjs").Token[]} tokens Micromark tokens. + * @param {import("../helpers/micromark-helpers.cjs").Token[]} tokens Micromark tokens. * @returns {Object} Reference link/image data. */ function getReferenceLinkImageData(tokens) { const normalizeReference = (s) => s.toLowerCase().trim().replace(/\s+/g, " "); + const references = new Map(); + const shortcuts = new Map(); + const addReferenceToDictionary = (token, label, isShortcut) => { + const referenceDatum = [ + token.startLine - 1, + token.startColumn - 1, + token.text.length + ]; + const reference = normalizeReference(label); + const dictionary = isShortcut ? shortcuts : references; + const referenceData = dictionary.get(reference) || []; + referenceData.push(referenceDatum); + dictionary.set(reference, referenceData); + }; const definitions = new Map(); const definitionLineIndices = []; const duplicateDefinitions = []; - const references = new Map(); - const shortcuts = new Map(); const filteredTokens = micromark.filterByTypes( tokens, @@ -21831,7 +21737,9 @@ function getReferenceLinkImageData(tokens) { // definitions and definitionLineIndices "definitionLabelString", "gfmFootnoteDefinitionLabelString", // references and shortcuts - "gfmFootnoteCall", "image", "link" + "gfmFootnoteCall", "image", "link", + // undefined link labels + "undefinedReferenceCollapsed", "undefinedReferenceFull", "undefinedReferenceShortcut" ] ); for (const token of filteredTokens) { @@ -21854,15 +21762,10 @@ function getReferenceLinkImageData(tokens) { if (definitions.has(reference)) { duplicateDefinitions.push([ reference, token.startLine - 1 ]); } else { - let destinationString = null; const parent = - micromark.getTokenParentOfType(token, [ "definition" ]); - if (parent) { - destinationString = micromark.getTokenTextByType( - micromark.filterByPredicate(parent.children), - "definitionDestinationString" - ); - } + micromark.getParentOfType(token, [ "definition" ]); + const destinationString = parent && + micromark.getDescendantsByType(parent, [ "definitionDestination", "definitionDestinationRaw", "definitionDestinationString" ])[0]?.text; definitions.set( reference, [ token.startLine - 1, destinationString ] @@ -21874,67 +21777,38 @@ function getReferenceLinkImageData(tokens) { case "image": case "link": { - let isShortcut = false; - let isFullOrCollapsed = false; - let labelText = null; - let referenceStringText = null; - const shortcutCandidate = - micromark.matchAndGetTokensByType(token.children, [ "label" ]); - if (shortcutCandidate) { - labelText = - micromark.getTokenTextByType( - shortcutCandidate[0].children, "labelText" - ); - isShortcut = (labelText !== null); - } - const fullAndCollapsedCandidate = - micromark.matchAndGetTokensByType( - token.children, [ "label", "reference" ] + // Identify if shortcut or full/collapsed + let isShortcut = (token.children.length === 1); + const isFullOrCollapsed = (token.children.length === 2) && !token.children.some((t) => t.type === "resource"); + const [ labelText ] = micromark.getDescendantsByType(token, [ "label", "labelText" ]); + const [ referenceString ] = micromark.getDescendantsByType(token, [ "reference", "referenceString" ]); + let label = labelText?.text; + // Identify if footnote + if (!isShortcut && !isFullOrCollapsed) { + const [ footnoteCallMarker, footnoteCallString ] = token.children.filter( + (t) => [ "gfmFootnoteCallMarker", "gfmFootnoteCallString" ].includes(t.type) ); - if (fullAndCollapsedCandidate) { - labelText = - micromark.getTokenTextByType( - fullAndCollapsedCandidate[0].children, "labelText" - ); - referenceStringText = - micromark.getTokenTextByType( - fullAndCollapsedCandidate[1].children, "referenceString" - ); - isFullOrCollapsed = (labelText !== null); - } - const footnote = micromark.matchAndGetTokensByType( - token.children, - [ - "gfmFootnoteCallLabelMarker", "gfmFootnoteCallMarker", - "gfmFootnoteCallString", "gfmFootnoteCallLabelMarker" - ], - [ "gfmFootnoteCallMarker", "gfmFootnoteCallString" ] - ); - if (footnote) { - const callMarkerText = footnote[0].text; - const callString = footnote[1].text; - labelText = `${callMarkerText}${callString}`; - isShortcut = true; + if (footnoteCallMarker && footnoteCallString) { + label = `${footnoteCallMarker.text}${footnoteCallString.text}`; + isShortcut = true; + } } - // Track shortcuts separately due to ambiguity in "text [text] text" + // Track link (handle shortcuts separately due to ambiguity in "text [text] text") if (isShortcut || isFullOrCollapsed) { - const referenceDatum = [ - token.startLine - 1, - token.startColumn - 1, - token.text.length, - // @ts-ignore - labelText.length, - (referenceStringText || "").length - ]; - const reference = - normalizeReference(referenceStringText || labelText); - const dictionary = isShortcut ? shortcuts : references; - const referenceData = dictionary.get(reference) || []; - referenceData.push(referenceDatum); - dictionary.set(reference, referenceData); + addReferenceToDictionary(token, referenceString?.text || label, isShortcut); } } break; + case "undefinedReferenceCollapsed": + case "undefinedReferenceFull": + case "undefinedReferenceShortcut": + { + const undefinedReference = micromark.getDescendantsByType(token, [ "undefinedReference" ])[0]; + const label = undefinedReference.children.map((t) => t.text).join(""); + const isShortcut = (token.type === "undefinedReferenceShortcut"); + addReferenceToDictionary(token, label, isShortcut); + } + break; } } return { @@ -21987,120 +21861,6 @@ function getPreferredLineEnding(input, os) { } module.exports.getPreferredLineEnding = getPreferredLineEnding; -/** - * Normalizes the fields of a RuleOnErrorFixInfo instance. - * - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {number} [lineNumber] Line number. - * @returns {Object} Normalized RuleOnErrorFixInfo instance. - */ -function normalizeFixInfo(fixInfo, lineNumber) { - return { - "lineNumber": fixInfo.lineNumber || lineNumber, - "editColumn": fixInfo.editColumn || 1, - "deleteCount": fixInfo.deleteCount || 0, - "insertText": fixInfo.insertText || "" - }; -} - -/** - * Fixes the specified error on a line of Markdown content. - * - * @param {string} line Line of Markdown content. - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {string} [lineEnding] Line ending to use. - * @returns {string | null} Fixed content. - */ -function applyFix(line, fixInfo, lineEnding) { - const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo); - const editIndex = editColumn - 1; - return (deleteCount === -1) ? - null : - line.slice(0, editIndex) + - insertText.replace(/\n/g, lineEnding || "\n") + - line.slice(editIndex + deleteCount); -} -module.exports.applyFix = applyFix; - -/** - * Applies as many fixes as possible to Markdown content. - * - * @param {string} input Lines of Markdown content. - * @param {Object[]} errors RuleOnErrorInfo instances. - * @returns {string} Corrected content. - */ -function applyFixes(input, errors) { - const lineEnding = getPreferredLineEnding(input, __nccwpck_require__(8161)); - const lines = input.split(newLineRe); - // Normalize fixInfo objects - let fixInfos = errors - .filter((error) => error.fixInfo) - .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber)); - // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short - fixInfos.sort((a, b) => { - const aDeletingLine = (a.deleteCount === -1); - const bDeletingLine = (b.deleteCount === -1); - return ( - (b.lineNumber - a.lineNumber) || - (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || - (b.editColumn - a.editColumn) || - (b.insertText.length - a.insertText.length) - ); - }); - // Remove duplicate entries (needed for following collapse step) - let lastFixInfo = {}; - fixInfos = fixInfos.filter((fixInfo) => { - const unique = ( - (fixInfo.lineNumber !== lastFixInfo.lineNumber) || - (fixInfo.editColumn !== lastFixInfo.editColumn) || - (fixInfo.deleteCount !== lastFixInfo.deleteCount) || - (fixInfo.insertText !== lastFixInfo.insertText) - ); - lastFixInfo = fixInfo; - return unique; - }); - // Collapse insert/no-delete and no-insert/delete for same line/column - lastFixInfo = { - "lineNumber": -1 - }; - for (const fixInfo of fixInfos) { - if ( - (fixInfo.lineNumber === lastFixInfo.lineNumber) && - (fixInfo.editColumn === lastFixInfo.editColumn) && - !fixInfo.insertText && - (fixInfo.deleteCount > 0) && - lastFixInfo.insertText && - !lastFixInfo.deleteCount) { - fixInfo.insertText = lastFixInfo.insertText; - lastFixInfo.lineNumber = 0; - } - lastFixInfo = fixInfo; - } - fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber); - // Apply all (remaining/updated) fixes - let lastLineIndex = -1; - let lastEditIndex = -1; - for (const fixInfo of fixInfos) { - const { lineNumber, editColumn, deleteCount } = fixInfo; - const lineIndex = lineNumber - 1; - const editIndex = editColumn - 1; - if ( - (lineIndex !== lastLineIndex) || - (deleteCount === -1) || - ((editIndex + deleteCount) <= - (lastEditIndex - ((deleteCount > 0) ? 0 : 1))) - ) { - // @ts-ignore - lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding); - } - lastLineIndex = lineIndex; - lastEditIndex = editIndex; - } - // Return corrected input - return lines.filter((line) => line !== null).join(lineEnding); -} -module.exports.applyFixes = applyFixes; - /** * Expands a path with a tilde to an absolute path. * @@ -22114,26 +21874,6 @@ function expandTildePath(file, os) { } module.exports.expandTildePath = expandTildePath; -// Copied from markdownlint.js to avoid TypeScript compiler import() issue. -/** - * @typedef {Object} MarkdownItToken - * @property {string[][]} attrs HTML attributes. - * @property {boolean} block Block-level token. - * @property {MarkdownItToken[]} children Child nodes. - * @property {string} content Tag contents. - * @property {boolean} hidden Ignore element. - * @property {string} info Fence info. - * @property {number} level Nesting level. - * @property {number[]} map Beginning/ending line numbers. - * @property {string} markup Markup text. - * @property {Object} meta Arbitrary data. - * @property {number} nesting Level change. - * @property {string} tag HTML tag name. - * @property {string} type Token type. - * @property {number} lineNumber Line number (1-based). - * @property {string} line Line content. - */ - /***/ }), @@ -22145,6 +21885,12 @@ module.exports.expandTildePath = expandTildePath; +// Symbol for identifing the flat tokens array from micromark parse +module.exports.flatTokensSymbol = Symbol("flat-tokens"); + +// Symbol for identifying the htmlFlow token from micromark parse +module.exports.htmlFlowSymbol = Symbol("html-flow"); + // Regular expression for matching common newline characters // See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js module.exports.newLineRe = /\r\n?|\n/g; @@ -48923,6 +48669,14 @@ module.exports = require("node:stream"); /***/ }), +/***/ 8321: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:stream/consumers"); + +/***/ }), + /***/ 3136: /***/ ((module) => { @@ -50728,21 +50482,25 @@ const pathDefault = __nccwpck_require__(6760); const pathPosix = pathDefault.posix; const { pathToFileURL } = __nccwpck_require__(3136); const markdownlintLibrary = __nccwpck_require__(9061); +const { + applyFixes, + "getVersion": getLibraryVersion, + "promises": markdownlintPromises +} = markdownlintLibrary; const { markdownlint, "extendConfig": markdownlintExtendConfig, "readConfig": markdownlintReadConfig -} = markdownlintLibrary.promises; -const markdownlintRuleHelpers = __nccwpck_require__(8307); +} = markdownlintPromises; const appendToArray = __nccwpck_require__(3730); const mergeOptions = __nccwpck_require__(6211); const resolveAndRequire = __nccwpck_require__(2034); // Variables const packageName = "markdownlint-cli2"; -const packageVersion = "0.14.0"; +const packageVersion = "0.15.0"; const libraryName = "markdownlint"; -const libraryVersion = markdownlintLibrary.getVersion(); +const libraryVersion = getLibraryVersion(); const bannerMessage = `${packageName} v${packageVersion} (${libraryName} v${libraryVersion})`; const dotOnlySubstitute = "*.{md,markdown}"; const utf8 = "utf8"; @@ -50766,7 +50524,6 @@ const negateGlob = (glob) => `!${glob}`; const throwForConfigurationFile = (file, error) => { throw new Error( `Unable to use configuration file '${file}'; ${error?.message}`, - // @ts-ignore { "cause": error } ); }; @@ -50775,9 +50532,10 @@ const throwForConfigurationFile = (file, error) => { const posixPath = (p) => p.split(pathDefault.sep).join(pathPosix.sep); // Expands a path with a tilde to an absolute path -const expandTildePath = (id) => ( - markdownlintRuleHelpers.expandTildePath(id, __nccwpck_require__(8161)) -); +const expandTildePath = (id) => { + const markdownlintRuleHelpers = __nccwpck_require__(8307); + return markdownlintRuleHelpers.expandTildePath(id, __nccwpck_require__(8161)); +}; // Resolves module paths relative to the specified directory const resolveModulePaths = (dir, modulePaths) => ( @@ -50824,7 +50582,6 @@ const importOrRequireResolve = async (dirOrDirs, id, noRequire) => { } catch (error) { errors.push(error); } - // @ts-ignore throw new AggregateError( errors, `Unable to require or import module '${id}'.` @@ -50972,6 +50729,7 @@ Glob expressions (from the globby library): - {} allows for a comma-separated list of "or" expressions - ! or # at the beginning of a pattern negate the match - : at the beginning identifies a literal file path +- - as a glob represents standard input (stdin) Dot-only glob: - The command "markdownlint-cli2 ." would lint every file in the current directory tree which is probably not intended @@ -51486,6 +51244,7 @@ const lintFiles = (fs, dirInfos, fileContents) => { const filteredFiles = filesAfterIgnores.filter( (file) => fileContents[file] === undefined ); + /** @type {Record} */ const filteredStrings = {}; for (const file of filesAfterIgnores) { if (fileContents[file] !== undefined) { @@ -51493,6 +51252,7 @@ const lintFiles = (fs, dirInfos, fileContents) => { } } // Create markdownlint options object + /** @type {import("markdownlint").Options} */ const options = { "files": filteredFiles, "strings": filteredStrings, @@ -51509,14 +51269,14 @@ const lintFiles = (fs, dirInfos, fileContents) => { fs }; // Invoke markdownlint - // @ts-ignore let task = markdownlint(options); // For any fixable errors, read file, apply fixes, and write it back if (markdownlintOptions.fix) { task = task.then((results) => { options.files = []; const subTasks = []; - const errorFiles = Object.keys(results); + const errorFiles = Object.keys(results). + filter((result) => filteredFiles.includes(result)); for (const fileName of errorFiles) { const errorInfos = results[fileName]. filter((errorInfo) => errorInfo.fixInfo); @@ -51525,15 +51285,13 @@ const lintFiles = (fs, dirInfos, fileContents) => { options.files.push(fileName); subTasks.push(fs.promises.readFile(fileName, utf8). then((original) => { - const fixed = markdownlintRuleHelpers. - applyFixes(original, errorInfos); + const fixed = applyFixes(original, errorInfos); return fs.promises.writeFile(fileName, fixed, utf8); }) ); } } return Promise.all(subTasks). - // @ts-ignore then(() => markdownlint(options)). then((fixResults) => ({ ...results, @@ -51619,11 +51377,12 @@ const main = async (params) => { optionsDefault, optionsOverride, fileContents, - nonFileContents, - noRequire + noRequire, + allowStdin } = params; let { - noGlobs + noGlobs, + nonFileContents } = params; const logMessage = params.logMessage || noop; const logError = params.logError || noop; @@ -51636,6 +51395,7 @@ const main = async (params) => { let fixDefault = false; // eslint-disable-next-line unicorn/no-useless-undefined let configPath = undefined; + let useStdin = false; let sawDashDash = false; let shouldShowHelp = false; const argvFiltered = (argv || []).filter((arg) => { @@ -51643,6 +51403,8 @@ const main = async (params) => { return true; } else if (configPath === null) { configPath = arg; + } else if ((arg === "-") && allowStdin) { + useStdin = true; // eslint-disable-next-line unicorn/prefer-switch } else if (arg === "--") { sawDashDash = true; @@ -51693,22 +51455,30 @@ const main = async (params) => { } } if ( - ((globPatterns.length === 0) && !nonFileContents) || + ((globPatterns.length === 0) && !useStdin && !nonFileContents) || (configPath === null) ) { return showHelp(logMessage, false); } + // Add stdin as a non-file input if necessary + if (useStdin) { + const key = pathPosix.join(baseDir, "stdin"); + const { text } = __nccwpck_require__(8321); + nonFileContents = { + ...nonFileContents, + [key]: await text(process.stdin) + }; + } // Include any file overrides or non-file content - const { baseMarkdownlintOptions, dirToDirInfo } = baseOptions; const resolvedFileContents = {}; for (const file in fileContents) { const resolvedFile = posixPath(pathDefault.resolve(baseDirSystem, file)); - resolvedFileContents[resolvedFile] = - fileContents[file]; + resolvedFileContents[resolvedFile] = fileContents[file]; } for (const nonFile in nonFileContents) { resolvedFileContents[nonFile] = nonFileContents[nonFile]; } + const { baseMarkdownlintOptions, dirToDirInfo } = baseOptions; appendToArray( dirToDirInfo[baseDir].files, Object.keys(nonFileContents || {}) @@ -51780,37 +51550,12 @@ const main = async (params) => { return errorsPresent ? 1 : 0; }; -// Run function -const run = (overrides, args) => { - (async () => { - const argsAndArgv = args || []; - appendToArray(argsAndArgv, process.argv.slice(2)); - try { - const defaultParams = { - "argv": argsAndArgv, - "logMessage": console.log, - "logError": console.error - }; - const params = { - ...defaultParams, - ...overrides - }; - process.exitCode = await main(params); - } catch (error) { - console.error(error); - process.exitCode = 2; - } - })(); -}; - // Export functions module.exports = { - main, - run + main }; // Run if invoked as a CLI -// @ts-ignore if (false) {} @@ -51965,11 +51710,10 @@ module.exports = resolveAndRequire; const helpers = __nccwpck_require__(8307); -const { filterByTypes } = __nccwpck_require__(3302); +const { filterByTypes } = __nccwpck_require__(1670); /** @type {Map} */ const map = new Map(); -// eslint-disable-next-line no-undef-init let params = undefined; /** @@ -52008,7 +51752,8 @@ function getCached(name, getValue) { */ function filterByTypesCached(types, htmlFlow) { return getCached( - types.join("|"), + // eslint-disable-next-line prefer-rest-params + JSON.stringify(arguments), () => filterByTypes(params.parsers.micromark.tokens, types, htmlFlow) ); } @@ -52052,7 +51797,7 @@ module.exports.fixableRuleNames = [ "MD058" ]; module.exports.homepage = "https://github.com/DavidAnson/markdownlint"; -module.exports.version = "0.35.0"; +module.exports.version = "0.36.1"; /***/ }), @@ -52067,8 +51812,8 @@ module.exports.version = "0.35.0"; const path = __nccwpck_require__(6760); const { promisify } = __nccwpck_require__(7975); -const micromark = __nccwpck_require__(3302); -// const { deprecatedRuleNames } = require("./constants"); +const micromark = __nccwpck_require__(7132); +const { version } = __nccwpck_require__(6072); const rules = __nccwpck_require__(5414); const helpers = __nccwpck_require__(8307); const cache = __nccwpck_require__(5791); @@ -52121,7 +51866,7 @@ function validateRuleList(ruleList, synchronous) { !result && (rule.parser !== undefined) && (rule.parser !== "markdownit") && - !((customIndex < 0) && (rule.parser === "micromark")) && + (rule.parser !== "micromark") && (rule.parser !== "none") ) { result = newError("parser", rule.parser); @@ -52260,87 +52005,6 @@ function removeFrontMatter(content, frontMatter) { }; } -/** - * Freeze all freeze-able members of a token and its children. - * - * @param {MarkdownItToken} token A markdown-it token. - * @returns {void} - */ -function freezeToken(token) { - if (token.attrs) { - for (const attr of token.attrs) { - Object.freeze(attr); - } - Object.freeze(token.attrs); - } - if (token.children) { - for (const child of token.children) { - freezeToken(child); - } - Object.freeze(token.children); - } - if (token.map) { - Object.freeze(token.map); - } - Object.freeze(token); -} - -/** - * Annotate tokens with line/lineNumber and freeze them. - * - * @param {import("markdown-it").Token[]} tokens Array of markdown-it tokens. - * @param {string[]} lines Lines of Markdown content. - * @returns {void} - */ -function annotateAndFreezeTokens(tokens, lines) { - let trMap = null; - // eslint-disable-next-line jsdoc/valid-types - /** @type MarkdownItToken[] */ - // @ts-ignore - const markdownItTokens = tokens; - for (const token of markdownItTokens) { - // Provide missing maps for table content - if (token.type === "tr_open") { - trMap = token.map; - } else if (token.type === "tr_close") { - trMap = null; - } - if (!token.map && trMap) { - token.map = [ ...trMap ]; - } - // Update token metadata - if (token.map) { - token.line = lines[token.map[0]]; - token.lineNumber = token.map[0] + 1; - // Trim bottom of token to exclude whitespace lines - while (token.map[1] && !((lines[token.map[1] - 1] || "").trim())) { - token.map[1]--; - } - } - // Annotate children with lineNumber - if (token.children) { - const codeSpanExtraLines = []; - if (token.children.some((child) => child.type === "code_inline")) { - helpers.forEachInlineCodeSpan(token.content, (code) => { - codeSpanExtraLines.push(code.split(helpers.newLineRe).length - 1); - }); - } - let lineNumber = token.lineNumber; - for (const child of token.children) { - child.lineNumber = lineNumber; - child.line = lines[lineNumber - 1]; - if ((child.type === "softbreak") || (child.type === "hardbreak")) { - lineNumber++; - } else if (child.type === "code_inline") { - lineNumber += codeSpanExtraLines.shift(); - } - } - } - freezeToken(token); - } - Object.freeze(tokens); -} - /** * Map rule names/tags to canonical rule name. * @@ -52596,7 +52260,7 @@ function getEnabledRulesPerLineNumber( * names. * @param {string} name Identifier for the content. * @param {string} content Markdown content. - * @param {GetMarkdownIt} getMarkdownIt Getter for instance of markdown-it. + * @param {Plugin[]} markdownItPlugins Additional plugins. * @param {Configuration} config Configuration object. * @param {ConfigurationParser[] | null} configParsers Configuration parsers. * @param {RegExp | null} frontMatter Regular expression for front matter. @@ -52611,7 +52275,7 @@ function lintContent( aliasToRuleNames, name, content, - getMarkdownIt, + markdownItPlugins, config, configParsers, frontMatter, @@ -52639,14 +52303,20 @@ function lintContent( const needMarkdownItTokens = enabledRuleList.some( (rule) => (rule.parser === "markdownit") || (rule.parser === undefined) ); + const customRulesPresent = (ruleList.length !== rules.length); // Parse content into parser tokens - const markdownitTokens = needMarkdownItTokens ? getMarkdownIt().parse(content, {}) : []; - const micromarkTokens = micromark.parse(content); + const micromarkTokens = micromark.parse( + content, + { "freezeTokens": customRulesPresent } + ); // Hide the content of HTML comments from rules + const preClearedContent = content; content = helpers.clearHtmlCommentText(content); - // Parse content into lines and update markdown-it tokens + // Parse content into lines and get markdown-it tokens const lines = content.split(helpers.newLineRe); - annotateAndFreezeTokens(markdownitTokens, lines); + const markdownitTokens = needMarkdownItTokens ? + (__nccwpck_require__(9917).getMarkdownItTokens)(markdownItPlugins, preClearedContent, lines) : + []; // Create (frozen) parameters for rules /** @type {MarkdownParsers} */ // @ts-ignore @@ -52667,6 +52337,7 @@ function lintContent( const parsersNone = Object.freeze({}); const paramsBase = { name, + version, "lines": Object.freeze(lines), "frontMatterLines": Object.freeze(frontMatterLines) }; @@ -52899,7 +52570,7 @@ function lintContent( * @param {Object.} aliasToRuleNames Map of alias to rule * names. * @param {string} file Path of file to lint. - * @param {GetMarkdownIt} getMarkdownIt Getter for instance of markdown-it. + * @param {Plugin[]} markdownItPlugins Additional plugins. * @param {Configuration} config Configuration object. * @param {ConfigurationParser[] | null} configParsers Configuration parsers. * @param {RegExp | null} frontMatter Regular expression for front matter. @@ -52915,7 +52586,7 @@ function lintFile( ruleList, aliasToRuleNames, file, - getMarkdownIt, + markdownItPlugins, config, configParsers, frontMatter, @@ -52935,7 +52606,7 @@ function lintFile( aliasToRuleNames, file, content, - getMarkdownIt, + markdownItPlugins, config, configParsers, frontMatter, @@ -52995,21 +52666,14 @@ function lintInput(options, synchronous, callback) { const config = options.config || { "default": true }; const configParsers = options.configParsers || null; const frontMatter = (options.frontMatter === undefined) ? - helpers.frontMatterRe : options.frontMatter; + helpers.frontMatterRe : + options.frontMatter; const handleRuleFailures = !!options.handleRuleFailures; const noInlineConfig = !!options.noInlineConfig; const resultVersion = (options.resultVersion === undefined) ? - 3 : options.resultVersion; - const getMarkdownIt = () => { - const markdownit = __nccwpck_require__(5182); - const md = markdownit({ "html": true }); - const markdownItPlugins = options.markdownItPlugins || []; - for (const plugin of markdownItPlugins) { - // @ts-ignore - md.use(...plugin); - } - return md; - }; + 3 : + options.resultVersion; + const markdownItPlugins = options.markdownItPlugins || []; const fs = options.fs || __nccwpck_require__(3024); const aliasToRuleNames = mapAliasToRuleNames(ruleList); const results = newResults(ruleList); @@ -53041,7 +52705,7 @@ function lintInput(options, synchronous, callback) { ruleList, aliasToRuleNames, currentItem, - getMarkdownIt, + markdownItPlugins, config, configParsers, frontMatter, @@ -53060,7 +52724,7 @@ function lintInput(options, synchronous, callback) { aliasToRuleNames, currentItem, strings[currentItem] || "", - getMarkdownIt, + markdownItPlugins, config, configParsers, frontMatter, @@ -53352,13 +53016,126 @@ function readConfigSync(file, parsers, fs) { return config; } +/** + * Normalizes the fields of a RuleOnErrorFixInfo instance. + * + * @param {RuleOnErrorFixInfo} fixInfo RuleOnErrorFixInfo instance. + * @param {number} [lineNumber] Line number. + * @returns {RuleOnErrorFixInfoNormalized} Normalized RuleOnErrorFixInfo instance. + */ +function normalizeFixInfo(fixInfo, lineNumber = 0) { + return { + "lineNumber": fixInfo.lineNumber || lineNumber, + "editColumn": fixInfo.editColumn || 1, + "deleteCount": fixInfo.deleteCount || 0, + "insertText": fixInfo.insertText || "" + }; +} + +/** + * Applies the specified fix to a Markdown content line. + * + * @param {string} line Line of Markdown content. + * @param {RuleOnErrorFixInfo} fixInfo RuleOnErrorFixInfo instance. + * @param {string} [lineEnding] Line ending to use. + * @returns {string | null} Fixed content or null if deleted. + */ +function applyFix(line, fixInfo, lineEnding = "\n") { + const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo); + const editIndex = editColumn - 1; + return (deleteCount === -1) ? + null : + line.slice(0, editIndex) + insertText.replace(/\n/g, lineEnding) + line.slice(editIndex + deleteCount); +} + +/** + * Applies as many of the specified fixes as possible to Markdown content. + * + * @param {string} input Lines of Markdown content. + * @param {RuleOnErrorInfo[]} errors RuleOnErrorInfo instances. + * @returns {string} Fixed content. + */ +function applyFixes(input, errors) { + const lineEnding = helpers.getPreferredLineEnding(input, __nccwpck_require__(8161)); + const lines = input.split(helpers.newLineRe); + // Normalize fixInfo objects + let fixInfos = errors + .filter((error) => error.fixInfo) + // @ts-ignore + .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber)); + // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short + fixInfos.sort((a, b) => { + const aDeletingLine = (a.deleteCount === -1); + const bDeletingLine = (b.deleteCount === -1); + return ( + (b.lineNumber - a.lineNumber) || + (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || + (b.editColumn - a.editColumn) || + (b.insertText.length - a.insertText.length) + ); + }); + // Remove duplicate entries (needed for following collapse step) + // eslint-disable-next-line jsdoc/valid-types + /** @type RuleOnErrorFixInfo */ + let lastFixInfo = {}; + fixInfos = fixInfos.filter((fixInfo) => { + const unique = ( + (fixInfo.lineNumber !== lastFixInfo.lineNumber) || + (fixInfo.editColumn !== lastFixInfo.editColumn) || + (fixInfo.deleteCount !== lastFixInfo.deleteCount) || + (fixInfo.insertText !== lastFixInfo.insertText) + ); + lastFixInfo = fixInfo; + return unique; + }); + // Collapse insert/no-delete and no-insert/delete for same line/column + lastFixInfo = { + "lineNumber": -1 + }; + for (const fixInfo of fixInfos) { + if ( + (fixInfo.lineNumber === lastFixInfo.lineNumber) && + (fixInfo.editColumn === lastFixInfo.editColumn) && + !fixInfo.insertText && + (fixInfo.deleteCount > 0) && + lastFixInfo.insertText && + !lastFixInfo.deleteCount) { + fixInfo.insertText = lastFixInfo.insertText; + lastFixInfo.lineNumber = 0; + } + lastFixInfo = fixInfo; + } + fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber); + // Apply all (remaining/updated) fixes + let lastLineIndex = -1; + let lastEditIndex = -1; + for (const fixInfo of fixInfos) { + const { lineNumber, editColumn, deleteCount } = fixInfo; + const lineIndex = lineNumber - 1; + const editIndex = editColumn - 1; + if ( + (lineIndex !== lastLineIndex) || + (deleteCount === -1) || + ((editIndex + deleteCount) <= + (lastEditIndex - ((deleteCount > 0) ? 0 : 1))) + ) { + // @ts-ignore + lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding); + } + lastLineIndex = lineIndex; + lastEditIndex = editIndex; + } + // Return corrected input + return lines.filter((line) => line !== null).join(lineEnding); +} + /** * Gets the (semantic) version of the library. * * @returns {string} SemVer string. */ function getVersion() { - return (__nccwpck_require__(6072).version); + return version; } // Export a/synchronous/Promise APIs @@ -53371,17 +53148,12 @@ markdownlint.promises = { "extendConfig": extendConfigPromise, "readConfig": readConfigPromise }; +markdownlint.applyFix = applyFix; +markdownlint.applyFixes = applyFixes; module.exports = markdownlint; // Type declarations -/** - * Function to get an instance of the markdown-it parser. - * - * @callback GetMarkdownIt - * @returns {import("markdown-it")} - */ - /** * Function to implement rule logic. * @@ -53402,6 +53174,7 @@ module.exports = markdownlint; * @property {readonly string[]} lines File/string lines. * @property {readonly string[]} frontMatterLines Front matter lines. * @property {RuleConfiguration} config Rule configuration. + * @property {string} version Version of the markdownlint library. */ /* eslint-enable jsdoc/valid-types */ @@ -53495,6 +53268,16 @@ module.exports = markdownlint; * @property {string} [insertText] Text to insert (after deleting). */ +/** + * RuleOnErrorInfo with all optional properties present. + * + * @typedef {Object} RuleOnErrorFixInfoNormalized + * @property {number} lineNumber Line number (1-based). + * @property {number} editColumn Column of the fix (1-based). + * @property {number} deleteCount Count of characters to delete. + * @property {string} insertText Text to insert (after deleting). + */ + /** * Rule definition. * @@ -53646,7 +53429,7 @@ module.exports = markdownlint; const { addErrorDetailIf } = __nccwpck_require__(8307); -const { getHeadingLevel } = __nccwpck_require__(3302); +const { getHeadingLevel } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -53685,7 +53468,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { getHeadingLevel, getHeadingStyle } = __nccwpck_require__(3302); +const { getHeadingLevel, getHeadingStyle } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -53743,7 +53526,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { getDescendantsByType, getTokenParentOfType } = __nccwpck_require__(3302); +const { getDescendantsByType, getParentOfType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const markerToStyle = { @@ -53783,10 +53566,10 @@ module.exports = { for (const listUnordered of filterByTypesCached([ "listUnordered" ])) { let nesting = 0; if (style === "sublist") { - /** @type {import("../helpers/micromark.cjs").Token | null} */ + /** @type {import("../helpers/micromark-helpers.cjs").Token | null} */ let parent = listUnordered; // @ts-ignore - while ((parent = getTokenParentOfType(parent, [ "listOrdered", "listUnordered" ]))) { + while ((parent = getParentOfType(parent, [ "listOrdered", "listUnordered" ]))) { nesting++; } } @@ -53917,7 +53700,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { getTokenParentOfType } = __nccwpck_require__(3302); +const { getParentOfType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -53949,11 +53732,11 @@ module.exports = { lastBlockQuotePrefix = token; } else if (type === "listUnordered") { let nesting = 0; - /** @type {import("../helpers/micromark.cjs").Token | null} */ + /** @type {import("../helpers/micromark-helpers.cjs").Token | null} */ let current = token; while ( // @ts-ignore - (current = getTokenParentOfType(current, unorderedParentTypes)) + (current = getParentOfType(current, unorderedParentTypes)) ) { if (current.type === "listUnordered") { nesting++; @@ -54013,7 +53796,7 @@ module.exports = { const { addError } = __nccwpck_require__(8307); -const { addRangeToSet } = __nccwpck_require__(3302); +const { addRangeToSet } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -54115,8 +53898,8 @@ module.exports = { -const { addError, withinAnyRange } = __nccwpck_require__(8307); -const { getDescendantsByType, getExclusionsForToken } = __nccwpck_require__(3302); +const { addError, hasOverlap } = __nccwpck_require__(8307); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const tabRe = /\t+/g; @@ -54139,9 +53922,8 @@ module.exports = { const spaceMultiplier = (spacesPerTab === undefined) ? 1 : Math.max(0, Number(spacesPerTab)); - const exclusions = []; // eslint-disable-next-line jsdoc/valid-types - /** @type import("../helpers/micromark.cjs").TokenType[] */ + /** @type import("../helpers/micromark-helpers.cjs").TokenType[] */ const exclusionTypes = []; if (includeCode) { if (ignoreCodeLanguages.size > 0) { @@ -54157,24 +53939,29 @@ module.exports = { } return true; }); - for (const codeToken of codeTokens) { - const exclusionsForToken = getExclusionsForToken(params.lines, codeToken); - if (codeToken.type === "codeFenced") { - exclusionsForToken.pop(); - exclusionsForToken.shift(); - } - exclusions.push(...exclusionsForToken); - } + const codeRanges = codeTokens.map((token) => { + const { type, startLine, startColumn, endLine, endColumn } = token; + const codeFenced = (type === "codeFenced"); + return { + "startLine": startLine + (codeFenced ? 1 : 0), + "startColumn": codeFenced ? 0 : startColumn, + "endLine": endLine - (codeFenced ? 1 : 0), + "endColumn": codeFenced ? Number.MAX_SAFE_INTEGER : endColumn + }; + }); for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) { const line = params.lines[lineIndex]; let match = null; while ((match = tabRe.exec(line)) !== null) { + const lineNumber = lineIndex + 1; const column = match.index + 1; const length = match[0].length; - if (!withinAnyRange(exclusions, lineIndex + 1, column, length)) { + /** @type {import("../helpers").FileRange} */ + const range = { "startLine": lineNumber, "startColumn": column, "endLine": lineNumber, "endColumn": column + length - 1 }; + if (!codeRanges.some((codeRange) => hasOverlap(codeRange, range))) { addError( onError, - lineIndex + 1, + lineNumber, "Column: " + column, undefined, [ column, length ], @@ -54201,8 +53988,8 @@ module.exports = { -const { addError, withinAnyRange } = __nccwpck_require__(8307); -const { addRangeToSet, getExclusionsForToken } = __nccwpck_require__(3302); +const { addError, hasOverlap } = __nccwpck_require__(8307); +const { addRangeToSet } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const reversedLinkRe = @@ -54220,34 +54007,35 @@ module.exports = { for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) { addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine); } - const exclusions = []; - for (const codeText of filterByTypesCached([ "codeText" ])) { - exclusions.push(...getExclusionsForToken(params.lines, codeText)); - } + const codeTexts = filterByTypesCached([ "codeText" ]); for (const [ lineIndex, line ] of params.lines.entries()) { - if (!codeBlockLineNumbers.has(lineIndex + 1)) { + const lineNumber = lineIndex + 1; + if (!codeBlockLineNumbers.has(lineNumber)) { let match = null; while ((match = reversedLinkRe.exec(line)) !== null) { const [ reversedLink, preChar, linkText, linkDestination ] = match; - const index = match.index + preChar.length; - const length = match[0].length - preChar.length; if ( !linkText.endsWith("\\") && - !linkDestination.endsWith("\\") && - !withinAnyRange(exclusions, lineIndex + 1, index, length) + !linkDestination.endsWith("\\") ) { - addError( - onError, - lineIndex + 1, - reversedLink.slice(preChar.length), - undefined, - [ index + 1, length ], - { - "editColumn": index + 1, - "deleteCount": length, - "insertText": `[${linkText}](${linkDestination})` - } - ); + const column = match.index + preChar.length + 1; + const length = match[0].length - preChar.length; + /** @type {import("../helpers").FileRange} */ + const range = { "startLine": lineNumber, "startColumn": column, "endLine": lineNumber, "endColumn": column + length - 1 }; + if (!codeTexts.some((codeText) => hasOverlap(codeText, range))) { + addError( + onError, + lineNumber, + reversedLink.slice(preChar.length), + undefined, + [ column, length ], + { + "editColumn": column, + "deleteCount": length, + "insertText": `[${linkText}](${linkDestination})` + } + ); + } } } } @@ -54267,7 +54055,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { addRangeToSet } = __nccwpck_require__(3302); +const { addRangeToSet } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -54319,7 +54107,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); const { getReferenceLinkImageData } = __nccwpck_require__(5791); -const { addRangeToSet, getDescendantsByType } = __nccwpck_require__(3302); +const { addRangeToSet, getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const longLineRePrefix = "^.{"; @@ -54431,7 +54219,6 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { filterByTypes } = __nccwpck_require__(3302); const { filterByTypesCached } = __nccwpck_require__(5791); const dollarCommandRe = /^(\s*)(\$\s+)/; @@ -54445,18 +54232,15 @@ module.exports = { "parser": "micromark", "function": function MD014(params, onError) { for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) { - const codeFlowValues = filterByTypes( - codeBlock.children, - [ "codeFlowValue" ] - ); - const dollarMatches = codeFlowValues. - map((codeFlowValue) => ({ + const codeFlowValues = codeBlock.children.filter((child) => child.type === "codeFlowValue"); + const dollarMatches = codeFlowValues + .map((codeFlowValue) => ({ "result": codeFlowValue.text.match(dollarCommandRe), "startColumn": codeFlowValue.startColumn, "startLine": codeFlowValue.startLine, "text": codeFlowValue.text - })). - filter((dollarMatch) => dollarMatch.result); + })) + .filter((dollarMatch) => dollarMatch.result); if (dollarMatches.length === codeFlowValues.length) { for (const dollarMatch of dollarMatches) { // @ts-ignore @@ -54493,7 +54277,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { addRangeToSet } = __nccwpck_require__(3302); +const { addRangeToSet } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -54547,7 +54331,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { getHeadingStyle } = __nccwpck_require__(3302); +const { getHeadingStyle } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); /** @@ -54635,7 +54419,7 @@ module.exports = [ const { addErrorContext } = __nccwpck_require__(8307); -const { addRangeToSet } = __nccwpck_require__(3302); +const { addRangeToSet } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -54654,7 +54438,7 @@ module.exports = { for (const [ lineIndex, line ] of lines.entries()) { if (!ignoreBlockLineNumbers.has(lineIndex + 1)) { const match = - /^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line); + /^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line); if (match) { const [ , @@ -54713,8 +54497,8 @@ module.exports = { -const { addErrorDetailIf, blockquotePrefixRe, isBlankLine } = __nccwpck_require__(8307); -const { getHeadingLevel } = __nccwpck_require__(3302); +const { addErrorDetailIf, isBlankLine } = __nccwpck_require__(8307); +const { getBlockQuotePrefixText, getHeadingLevel } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const defaultLines = 1; @@ -54732,15 +54516,6 @@ const getLinesFunction = (linesParam) => { return () => lines; }; -const getBlockQuote = (str, count) => ( - (str || "") - .match(blockquotePrefixRe)[0] - .trimEnd() - // eslint-disable-next-line unicorn/prefer-spread - .concat("\n") - .repeat(count) -); - // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ module.exports = { @@ -54752,6 +54527,7 @@ module.exports = { const getLinesAbove = getLinesFunction(params.config.lines_above); const getLinesBelow = getLinesFunction(params.config.lines_below); const { lines } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) { const { startLine, endLine } = heading; const line = lines[startLine - 1].trim(); @@ -54776,8 +54552,9 @@ module.exports = { line, undefined, { - "insertText": getBlockQuote( - lines[startLine - 2], + "insertText": getBlockQuotePrefixText( + blockQuotePrefixes, + startLine - 1, linesAbove - actualAbove ) } @@ -54805,8 +54582,9 @@ module.exports = { undefined, { "lineNumber": endLine + 1, - "insertText": getBlockQuote( - lines[endLine], + "insertText": getBlockQuotePrefixText( + blockQuotePrefixes, + endLine + 1, linesBelow - actualBelow ) } @@ -54876,7 +54654,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { getHeadingLevel, getHeadingText } = __nccwpck_require__(3302); +const { getHeadingLevel, getHeadingText } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -54932,7 +54710,7 @@ module.exports = { const { addErrorContext, frontMatterHasTitle } = __nccwpck_require__(8307); -const { getHeadingLevel, getHeadingText } = __nccwpck_require__(3302); +const { getHeadingLevel, getHeadingText } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -55042,9 +54820,9 @@ const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ module.exports = { - "names": ["MD027", "no-multiple-space-blockquote"], + "names": [ "MD027", "no-multiple-space-blockquote" ], "description": "Multiple spaces after blockquote symbol", - "tags": ["blockquote", "whitespace", "indentation"], + "tags": [ "blockquote", "whitespace", "indentation" ], "parser": "micromark", "function": function MD027(params, onError) { for (const token of filterByTypesCached([ "linePrefix" ])) { @@ -55132,7 +54910,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { getDescendantsByType, getTokenTextByType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const listStyleExamples = { @@ -55144,11 +54922,11 @@ const listStyleExamples = { /** * Gets the value of an ordered list item prefix token. * - * @param {import("../helpers/micromark.cjs").Token} listItemPrefix List item prefix token. + * @param {import("../helpers/micromark-helpers.cjs").Token} listItemPrefix List item prefix token. * @returns {number} List item value. */ function getOrderedListItemValue(listItemPrefix) { - return Number(getTokenTextByType(listItemPrefix.children, "listItemValue")); + return Number(getDescendantsByType(listItemPrefix, [ "listItemValue" ])[0].text); } // eslint-disable-next-line jsdoc/valid-types @@ -55284,7 +55062,7 @@ module.exports = { const { addErrorContext, isBlankLine } = __nccwpck_require__(8307); -const { getTokenParentOfType } = __nccwpck_require__(3302); +const { getParentOfType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const codeFencePrefixRe = /^(.*?)[`~]/; @@ -55304,10 +55082,12 @@ const codeFencePrefixRe = /^(.*?)[`~]/; function addError(onError, lines, lineNumber, top) { const line = lines[lineNumber - 1]; const [ , prefix ] = line.match(codeFencePrefixRe) || []; - const fixInfo = (prefix === undefined) ? null : { - "lineNumber": lineNumber + (top ? 0 : 1), - "insertText": `${prefix.replace(/[^>]/g, " ").trim()}\n` - }; + const fixInfo = (prefix === undefined) ? + null : + { + "lineNumber": lineNumber + (top ? 0 : 1), + "insertText": `${prefix.replace(/[^>]/g, " ").trim()}\n` + }; addErrorContext( onError, lineNumber, @@ -55331,7 +55111,7 @@ module.exports = { const includeListItems = (listItems === undefined) ? true : !!listItems; const { lines } = params; for (const codeBlock of filterByTypesCached([ "codeFenced" ])) { - if (includeListItems || !(getTokenParentOfType(codeBlock, [ "listOrdered", "listUnordered" ]))) { + if (includeListItems || !(getParentOfType(codeBlock, [ "listOrdered", "listUnordered" ]))) { if (!isBlankLine(lines[codeBlock.startLine - 2])) { addError(onError, lines, codeBlock.startLine, true); } @@ -55354,8 +55134,9 @@ module.exports = { -const { addErrorContextForLine, isBlankLine } = __nccwpck_require__(8307); -const { filterByPredicate, nonContentTokens } = __nccwpck_require__(3302); +const { addErrorContext, isBlankLine } = __nccwpck_require__(8307); +const { filterByPredicate, getBlockQuotePrefixText, nonContentTokens } = __nccwpck_require__(1670); +const { filterByTypesCached } = __nccwpck_require__(5791); const isList = (token) => ( (token.type === "listOrdered") || (token.type === "listUnordered") @@ -55370,6 +55151,7 @@ module.exports = { "parser": "micromark", "function": function MD032(params, onError) { const { lines, parsers } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); // For every top-level list... const topLevelLists = filterByPredicate( @@ -55382,13 +55164,18 @@ module.exports = { for (const list of topLevelLists) { // Look for a blank line above the list - const firstIndex = list.startLine - 1; - if (!isBlankLine(lines[firstIndex - 1])) { - addErrorContextForLine( + const firstLineNumber = list.startLine; + if (!isBlankLine(lines[firstLineNumber - 2])) { + addErrorContext( onError, - // @ts-ignore - lines, - firstIndex + firstLineNumber, + lines[firstLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, firstLineNumber) + } ); } @@ -55403,14 +55190,19 @@ module.exports = { } // Look for a blank line below the list - const lastIndex = endLine - 1; - if (!isBlankLine(lines[lastIndex + 1])) { - addErrorContextForLine( + const lastLineNumber = endLine; + if (!isBlankLine(lines[lastLineNumber])) { + addErrorContext( onError, - // @ts-ignore - lines, - lastIndex, - lastIndex + 2 + lastLineNumber, + lines[lastLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "lineNumber": lastLineNumber + 1, + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, lastLineNumber) + } ); } } @@ -55429,7 +55221,7 @@ module.exports = { const { addError, nextLinesRe } = __nccwpck_require__(8307); -const { getHtmlTagInfo } = __nccwpck_require__(3302); +const { getHtmlTagInfo } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -55478,8 +55270,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { filterByPredicate, getHtmlTagInfo, inHtmlFlow, parse } = __nccwpck_require__(3302); -const { filterByTypesCached } = __nccwpck_require__(5791); +const { filterByPredicate, getHtmlTagInfo, inHtmlFlow } = __nccwpck_require__(1670); // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ @@ -55496,8 +55287,6 @@ module.exports = { if ((token.type === "literalAutolink") && !inHtmlFlow(token)) { // Detect and ignore https://github.com/micromark/micromark/issues/164 const siblings = token.parent?.children; - // Commented-out due to not being able to exercise in test/code coverage - // || micromarkTokens; const index = siblings?.indexOf(token); // @ts-ignore const prev = siblings?.at(index - 1); @@ -55515,6 +55304,7 @@ module.exports = { return false; }, (token) => { + // Ignore content of inline HTML tags const { children } = token; const result = []; for (let i = 0; i < children.length; i++) { @@ -55545,31 +55335,25 @@ module.exports = { } ) ); - const autoLinks = filterByTypesCached([ "literalAutolink" ]); - if (autoLinks.length > 0) { - // Re-parse with correct link/image reference definition handling - const document = params.lines.join("\n"); - const tokens = parse(document, undefined, false); - for (const token of literalAutolinks(tokens)) { - const range = [ - token.startColumn, - token.endColumn - token.startColumn - ]; - const fixInfo = { - "editColumn": range[0], - "deleteCount": range[1], - "insertText": `<${token.text}>` - }; - addErrorContext( - onError, - token.startLine, - token.text, - undefined, - undefined, - range, - fixInfo - ); - } + for (const token of literalAutolinks(params.parsers.micromark.tokens)) { + const range = [ + token.startColumn, + token.endColumn - token.startColumn + ]; + const fixInfo = { + "editColumn": range[0], + "deleteCount": range[1], + "insertText": `<${token.text}>` + }; + addErrorContext( + onError, + token.startLine, + token.text, + undefined, + undefined, + range, + fixInfo + ); } } }; @@ -55620,15 +55404,15 @@ module.exports = { const { addErrorContext, allPunctuation } = __nccwpck_require__(8307); -const { matchAndGetTokensByType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); -/** @typedef {import("../helpers/micromark.cjs").TokenType} TokenType */ -/** @type {Map} */ -const emphasisAndChildrenTypes = new Map([ - [ "emphasis", [ "emphasisSequence", "emphasisText", "emphasisSequence" ] ], - [ "strong", [ "strongSequence", "strongText", "strongSequence" ] ] -]); +/** @typedef {import("../helpers/micromark-helpers.cjs").TokenType} TokenType */ +/** @type {TokenType[][]} */ +const emphasisTypes = [ + [ "emphasis", "emphasisText" ], + [ "strong", "strongText" ] +]; // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ @@ -55642,25 +55426,19 @@ module.exports = { punctuation = String((punctuation === undefined) ? allPunctuation : punctuation); const punctuationRe = new RegExp("[" + punctuation + "]$"); const paragraphTokens = - filterByTypesCached([ "paragraph" ]). - filter((token) => + filterByTypesCached([ "paragraph" ]) + .filter((token) => (token.parent?.type === "content") && !token.parent?.parent && (token.children.length === 1) ); - for (const paragraphToken of paragraphTokens) { - const childToken = paragraphToken.children[0]; - for (const [ emphasisType, emphasisChildrenTypes ] of emphasisAndChildrenTypes) { - if (childToken.type === emphasisType) { - const matchingTokens = matchAndGetTokensByType(childToken.children, emphasisChildrenTypes); - if (matchingTokens) { - const textToken = matchingTokens[1]; - if ( - (textToken.children.length === 1) && - (textToken.children[0].type === "data") && - !punctuationRe.test(textToken.text) - ) { - addErrorContext(onError, textToken.startLine, textToken.text); - } - } + for (const emphasisType of emphasisTypes) { + const textTokens = getDescendantsByType(paragraphTokens, emphasisType); + for (const textToken of textTokens) { + if ( + (textToken.children.length === 1) && + (textToken.children[0].type === "data") && + !punctuationRe.test(textToken.text) + ) { + addErrorContext(onError, textToken.startLine, textToken.text); } } } @@ -55679,7 +55457,7 @@ module.exports = { const { addError } = __nccwpck_require__(8307); -const { filterByPredicate, inHtmlFlow } = __nccwpck_require__(3302); +const { filterByPredicate, inHtmlFlow } = __nccwpck_require__(1670); // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ @@ -55781,7 +55559,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { tokenIfType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const leftSpaceRe = /^\s(?:[^`]|$)/; @@ -55807,24 +55585,19 @@ module.exports = { "function": function MD038(params, onError) { const codeTexts = filterByTypesCached([ "codeText" ]); for (const codeText of codeTexts) { - const { children } = codeText; - const first = 0; - const last = children.length - 1; - const startSequence = tokenIfType(children[first], "codeTextSequence"); - const endSequence = tokenIfType(children[last], "codeTextSequence"); - const startData = - tokenIfType(children[first + 1], "codeTextData") || - tokenIfType(children[first + 2], "codeTextData"); - const endData = - tokenIfType(children[last - 1], "codeTextData") || - tokenIfType(children[last - 2], "codeTextData"); + const sequences = getDescendantsByType(codeText, [ "codeTextSequence" ]); + const startSequence = sequences[0]; + const endSequence = sequences[sequences.length - 1]; + const datas = getDescendantsByType(codeText, [ "codeTextData" ]); + const startData = datas[0]; + const endData = datas[datas.length - 1]; if (startSequence && endSequence && startData && endData) { const spaceLeft = leftSpaceRe.test(startData.text); const spaceRight = rightSpaceRe.test(endData.text); if (spaceLeft || spaceRight) { let lineNumber = startSequence.startLine; - let range = null; - let fixInfo = null; + let range = undefined; + let fixInfo = undefined; if (startSequence.startLine === endSequence.endLine) { range = [ startSequence.startColumn, @@ -55889,15 +55662,14 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { filterByTypes } = __nccwpck_require__(3302); const { getReferenceLinkImageData, filterByTypesCached } = __nccwpck_require__(5791); /** * Adds an error for a label space issue. * * @param {import("./markdownlint").RuleOnError} onError Error-reporting callback. - * @param {import("../helpers/micromark.cjs").Token} label Label token. - * @param {import("../helpers/micromark.cjs").Token} labelText LabelText token. + * @param {import("../helpers/micromark-helpers.cjs").Token} label Label token. + * @param {import("../helpers/micromark-helpers.cjs").Token} labelText LabelText token. * @param {boolean} isStart True iff error is at the start of the link. */ function addLabelSpaceError(onError, label, labelText, isStart) { @@ -55915,18 +55687,20 @@ function addLabelSpaceError(onError, label, labelText, isStart) { isStart, !isStart, range, - range ? { - "editColumn": range[0], - "deleteCount": range[1] - } : undefined + range ? + { + "editColumn": range[0], + "deleteCount": range[1] + } : + undefined ); } /** * Determines if a link is a valid link (and not a fake shortcut link due to parser tricks). * - * @param {import("../helpers/micromark.cjs").Token} label Label token. - * @param {import("../helpers/micromark.cjs").Token} labelText LabelText token. + * @param {import("../helpers/micromark-helpers.cjs").Token} label Label token. + * @param {import("../helpers/micromark-helpers.cjs").Token} labelText LabelText token. * @param {Map} definitions Map of link definitions. * @returns {boolean} True iff the link is valid. */ @@ -55943,13 +55717,10 @@ module.exports = { "parser": "micromark", "function": function MD039(params, onError) { const { definitions } = getReferenceLinkImageData(); - const labels = filterByTypesCached([ "label" ]). - filter((label) => label.parent?.type === "link"); + const labels = filterByTypesCached([ "label" ]) + .filter((label) => label.parent?.type === "link"); for (const label of labels) { - const labelTexts = filterByTypes( - label.children, - [ "labelText" ] - ); + const labelTexts = label.children.filter((child) => child.type === "labelText"); for (const labelText of labelTexts) { if ( (labelText.text.trimStart().length !== labelText.text.length) && @@ -55980,7 +55751,7 @@ module.exports = { const { addError, addErrorContext } = __nccwpck_require__(8307); -const { getTokenTextByType, tokenIfType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -55996,18 +55767,16 @@ module.exports = { const languageOnly = !!params.config.language_only; const fencedCodes = filterByTypesCached([ "codeFenced" ]); for (const fencedCode of fencedCodes) { - const openingFence = tokenIfType(fencedCode.children[0], "codeFencedFence"); - if (openingFence) { - const { children, startLine, text } = openingFence; - const info = getTokenTextByType(children, "codeFencedFenceInfo"); - if (!info) { - addErrorContext(onError, startLine, text); - } else if ((allowed.length > 0) && !allowed.includes(info)) { - addError(onError, startLine, `"${info}" is not allowed`); - } - if (languageOnly && getTokenTextByType(children, "codeFencedFenceMeta")) { - addError(onError, startLine, `Info string contains more than language: "${text}"`); - } + const openingFence = getDescendantsByType(fencedCode, [ "codeFencedFence" ])[0]; + const { startLine, text } = openingFence; + const info = getDescendantsByType(openingFence, [ "codeFencedFenceInfo" ])[0]?.text; + if (!info) { + addErrorContext(onError, startLine, text); + } else if ((allowed.length > 0) && !allowed.includes(info)) { + addError(onError, startLine, `"${info}" is not allowed`); + } + if (languageOnly && getDescendantsByType(openingFence, [ "codeFencedFenceMeta" ]).length > 0) { + addError(onError, startLine, `Info string contains more than language: "${text}"`); } } } @@ -56026,7 +55795,7 @@ module.exports = { const { addErrorContext, frontMatterHasTitle } = __nccwpck_require__(8307); const { filterByTypes, getHeadingLevel, getHtmlTagInfo, isHtmlFlowComment, nonContentTokens } = - __nccwpck_require__(3302); + __nccwpck_require__(1670); // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ @@ -56038,9 +55807,9 @@ module.exports = { "function": function MD041(params, onError) { const level = Number(params.config.level || 1); if (!frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title)) { - params.parsers.micromark.tokens. - filter((token) => !nonContentTokens.has(token.type) && !isHtmlFlowComment(token)). - every((token) => { + params.parsers.micromark.tokens + .filter((token) => !nonContentTokens.has(token.type) && !isHtmlFlowComment(token)) + .every((token) => { let isError = true; if ((token.type === "atxHeading") || (token.type === "setextHeading")) { isError = (getHeadingLevel(token) !== level); @@ -56070,7 +55839,7 @@ module.exports = { const { addErrorContext } = __nccwpck_require__(8307); -const { getDescendantsByType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { getReferenceLinkImageData, filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -56092,11 +55861,7 @@ module.exports = { const reference = getDescendantsByType(link, [ "reference" ]); const resource = getDescendantsByType(link, [ "resource" ]); const referenceString = getDescendantsByType(reference, [ "referenceString" ]); - const resourceDestination = getDescendantsByType(resource, [ "resourceDestination" ]); - const resourceDestinationString = [ - ...getDescendantsByType(resourceDestination, [ "resourceDestinationRaw", "resourceDestinationString" ]), - ...getDescendantsByType(resourceDestination, [ "resourceDestinationLiteral", "resourceDestinationString" ]) - ]; + const resourceDestinationString = getDescendantsByType(resource, [ "resourceDestination", [ "resourceDestinationLiteral", "resourceDestinationRaw" ], "resourceDestinationString" ]); const hasLabelText = labelText.length > 0; const hasReference = reference.length > 0; const hasResource = resource.length > 0; @@ -56141,7 +55906,7 @@ module.exports = { const { addErrorContext, addErrorDetailIf } = __nccwpck_require__(8307); -const { getHeadingLevel, getHeadingText } = __nccwpck_require__(3302); +const { getHeadingLevel, getHeadingText } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -56221,10 +55986,9 @@ module.exports = { -const { addErrorDetailIf, escapeForRegExp, withinAnyRange } = - __nccwpck_require__(8307); -const { filterByPredicate, filterByTypes, parse } = - __nccwpck_require__(3302); +const { addErrorDetailIf, escapeForRegExp, hasOverlap } = __nccwpck_require__(8307); +const { filterByPredicate, filterByTypes } = __nccwpck_require__(1670); +const { parse } = __nccwpck_require__(7132); const ignoredChildTypes = new Set( [ "codeFencedFence", "definition", "reference", "resource" ] @@ -56268,43 +56032,47 @@ module.exports = { token.children.filter((t) => !ignoredChildTypes.has(t.type)) ) ); + /** @type {import("../helpers").FileRange[]} */ const exclusions = []; - const autoLinked = new Set(); + const scannedTokens = new Set(); for (const name of names) { const escapedName = escapeForRegExp(name); const startNamePattern = /^\W/.test(name) ? "" : "\\b_*"; const endNamePattern = /\W$/.test(name) ? "" : "_*\\b"; - const namePattern = - `(${startNamePattern})(${escapedName})${endNamePattern}`; + const namePattern = `(${startNamePattern})(${escapedName})${endNamePattern}`; const nameRe = new RegExp(namePattern, "gi"); for (const token of contentTokens) { let match = null; while ((match = nameRe.exec(token.text)) !== null) { const [ , leftMatch, nameMatch ] = match; - const index = token.startColumn - 1 + match.index + leftMatch.length; + const column = token.startColumn + match.index + leftMatch.length; const length = nameMatch.length; - const lineIndex = token.startLine - 1; + const lineNumber = token.startLine; + /** @type {import("../helpers").FileRange} */ + const nameRange = { + "startLine": lineNumber, + "startColumn": column, + "endLine": lineNumber, + "endColumn": column + length - 1 + }; if ( - !withinAnyRange(exclusions, lineIndex, index, length) && - !names.includes(nameMatch) + !names.includes(nameMatch) && + !exclusions.some((exclusion) => hasOverlap(exclusion, nameRange)) ) { - let urlRanges = []; - if (!autoLinked.has(token)) { - urlRanges = filterByTypes( - parse(token.text), - [ "literalAutolink" ] - ).map( - (t) => [ - lineIndex, - token.startColumn - 1 + t.startColumn - 1, - t.endColumn - t.startColumn - ] - ); - exclusions.push(...urlRanges); - autoLinked.add(token); + /** @type {import("../helpers").FileRange[]} */ + let autolinkRanges = []; + if (!scannedTokens.has(token)) { + autolinkRanges = filterByTypes(parse(token.text), [ "literalAutolink" ]) + .map((tok) => ({ + "startLine": lineNumber, + "startColumn": token.startColumn + tok.startColumn - 1, + "endLine": lineNumber, + "endColumn": token.endColumn + tok.endColumn - 1 + })); + exclusions.push(...autolinkRanges); + scannedTokens.add(token); } - if (!withinAnyRange(urlRanges, lineIndex, index, length)) { - const column = index + 1; + if (!autolinkRanges.some((autolinkRange) => hasOverlap(autolinkRange, nameRange))) { addErrorDetailIf( onError, token.startLine, @@ -56321,7 +56089,7 @@ module.exports = { ); } } - exclusions.push([ lineIndex, index, length ]); + exclusions.push(nameRange); } } } @@ -56340,7 +56108,7 @@ module.exports = { const { addError, getHtmlAttributeRe, nextLinesRe } = __nccwpck_require__(8307); -const { filterByTypes, getHtmlTagInfo } = __nccwpck_require__(3302); +const { getHtmlTagInfo, getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const altRe = getHtmlAttributeRe("alt"); @@ -56356,7 +56124,7 @@ module.exports = { // Process Markdown images const images = filterByTypesCached([ "image" ]); for (const image of images) { - const labelTexts = filterByTypes(image.children, [ "labelText" ]); + const labelTexts = getDescendantsByType(image, [ "label", "labelText" ]); if (labelTexts.some((labelText) => labelText.text.length === 0)) { const range = (image.startLine === image.endLine) ? [ image.startColumn, image.endColumn - image.startColumn ] : @@ -56490,10 +56258,25 @@ module.exports = { -const { addErrorDetailIf, fencedCodeBlockStyleFor } = __nccwpck_require__(8307); -const { tokenIfType } = __nccwpck_require__(3302); +const { addErrorDetailIf } = __nccwpck_require__(8307); +const { getDescendantsByType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); +/** + * Return the string representation of a fence markup character. + * + * @param {string} markup Fence string. + * @returns {"tilde" | "backtick"} String representation. + */ +function fencedCodeBlockStyleFor(markup) { + switch (markup[0]) { + case "~": + return "tilde"; + default: + return "backtick"; + } +}; + // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ module.exports = { @@ -56506,22 +56289,18 @@ module.exports = { let expectedStyle = style; const codeFenceds = filterByTypesCached([ "codeFenced" ]); for (const codeFenced of codeFenceds) { - const codeFencedFence = tokenIfType(codeFenced.children[0], "codeFencedFence"); - if (codeFencedFence) { - const codeFencedFenceSequence = tokenIfType(codeFencedFence.children[0], "codeFencedFenceSequence"); - if (codeFencedFenceSequence) { - const { startLine, text } = codeFencedFenceSequence; - if (expectedStyle === "consistent") { - expectedStyle = fencedCodeBlockStyleFor(text); - } - addErrorDetailIf( - onError, - startLine, - expectedStyle, - fencedCodeBlockStyleFor(text) - ); - } + const codeFencedFenceSequence = + getDescendantsByType(codeFenced, [ "codeFencedFence", "codeFencedFenceSequence" ])[0]; + const { startLine, text } = codeFencedFenceSequence; + if (expectedStyle === "consistent") { + expectedStyle = fencedCodeBlockStyleFor(text); } + addErrorDetailIf( + onError, + startLine, + expectedStyle, + fencedCodeBlockStyleFor(text) + ); } } }; @@ -56537,11 +56316,26 @@ module.exports = { -const { addError, emphasisOrStrongStyleFor } = __nccwpck_require__(8307); -const { filterByPredicate, tokenIfType } = __nccwpck_require__(3302); +const { addError } = __nccwpck_require__(8307); +const { filterByPredicate, getDescendantsByType } = __nccwpck_require__(1670); const intrawordRe = /^\w$/; +/** + * Return the string representation of a emphasis or strong markup character. + * + * @param {string} markup Emphasis or strong string. + * @returns {"asterisk" | "underscore"} String representation. + */ +function emphasisOrStrongStyleFor(markup) { + switch (markup[0]) { + case "*": + return "asterisk"; + default: + return "underscore"; + } +}; + /** * @param {import("./markdownlint").RuleParams} params Rule parameters. * @param {import("./markdownlint").RuleOnError} onError Error-reporting callback. @@ -56560,9 +56354,9 @@ const impl = (token) => ((token.type === "htmlFlow") ? [] : token.children) ); for (const token of emphasisTokens) { - const { children } = token; - const startSequence = tokenIfType(children[0], typeSequence); - const endSequence = tokenIfType(children[children.length - 1], typeSequence); + const sequences = getDescendantsByType(token, [ typeSequence ]); + const startSequence = sequences[0]; + const endSequence = sequences[sequences.length - 1]; if (startSequence && endSequence) { const markupStyle = emphasisOrStrongStyleFor(startSequence.text); if (style === "consistent") { @@ -56648,8 +56442,8 @@ module.exports = [ -const { addError, addErrorDetailIf, getHtmlAttributeRe } = __nccwpck_require__(8307); -const { filterByPredicate, filterByTypes, getHtmlTagInfo } = __nccwpck_require__(3302); +const { addError, getHtmlAttributeRe } = __nccwpck_require__(8307); +const { filterByPredicate, filterByTypes, getHtmlTagInfo } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // Regular expression for identifying HTML anchor names @@ -56668,7 +56462,7 @@ const tokensInclude = new Set( * Converts a Markdown heading into an HTML fragment according to the rules * used by GitHub. * - * @param {import("../helpers/micromark.cjs").Token} headingText Heading text token. + * @param {import("../helpers/micromark-helpers.cjs").Token} headingText Heading text token. * @returns {string} Fragment string for heading. */ function convertHeadingToHTMLFragment(headingText) { @@ -56697,7 +56491,7 @@ function convertHeadingToHTMLFragment(headingText) { /** * Unescapes the text of a String-type micromark Token. * - * @param {import("../helpers/micromark.cjs").Token} token String-type micromark Token. + * @param {import("../helpers/micromark-helpers.cjs").Token} token String-type micromark Token. * @returns {string} Unescaped token text. */ function unescapeStringTokenText(token) { @@ -56714,6 +56508,7 @@ module.exports = { "tags": [ "links" ], "parser": "micromark", "function": function MD051(params, onError) { + const ignoreCase = params.config.ignore_case || false; const fragments = new Map(); // Process headings @@ -56750,7 +56545,7 @@ module.exports = { // Process link and definition fragments // eslint-disable-next-line jsdoc/valid-types - /** @type import("../helpers/micromark.cjs").TokenType[][] */ + /** @type import("../helpers/micromark-helpers.cjs").TokenType[][] */ const parentChilds = [ [ "link", "resourceDestinationString" ], [ "definition", "definitionDestinationString" ] @@ -56769,11 +56564,8 @@ module.exports = { !fragments.has(encodedText) && !lineFragmentRe.test(encodedText) ) { - // eslint-disable-next-line no-undef-init let context = undefined; - // eslint-disable-next-line no-undef-init let range = undefined; - // eslint-disable-next-line no-undef-init let fixInfo = undefined; if (link.startLine === link.endLine) { context = link.text; @@ -56789,16 +56581,16 @@ module.exports = { if (mixedCaseKey) { // @ts-ignore (fixInfo || {}).insertText = mixedCaseKey; - addErrorDetailIf( - onError, - link.startLine, - mixedCaseKey, - text, - undefined, - context, - range, - fixInfo - ); + if (!ignoreCase && (mixedCaseKey !== text)) { + addError( + onError, + link.startLine, + `Expected: ${mixedCaseKey}; Actual: ${text}`, + context, + range, + fixInfo + ); + } } else { addError( onError, @@ -56876,10 +56668,11 @@ module.exports = { -const { addError, ellipsify, linkReferenceDefinitionRe } = - __nccwpck_require__(8307); +const { addError, ellipsify } = __nccwpck_require__(8307); const { getReferenceLinkImageData } = __nccwpck_require__(5791); +const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/; + // eslint-disable-next-line jsdoc/valid-types /** @type import("./markdownlint").Rule */ module.exports = { @@ -56913,7 +56706,7 @@ module.exports = { `Unused link or image reference definition: "${label}"`, ellipsify(line), [ 1, line.length ], - singleLineDefinition(line) ? deleteFixInfo : 0 + singleLineDefinition(line) ? deleteFixInfo : undefined ); } } @@ -56928,7 +56721,7 @@ module.exports = { `Duplicate link or image reference definition: "${label}"`, ellipsify(line), [ 1, line.length ], - singleLineDefinition(line) ? deleteFixInfo : 0 + singleLineDefinition(line) ? deleteFixInfo : undefined ); } } @@ -56947,7 +56740,7 @@ module.exports = { const { addErrorContext, nextLinesRe } = __nccwpck_require__(8307); -const { filterByPredicate, getTokenTextByType } = __nccwpck_require__(3302); +const { getDescendantsByType } = __nccwpck_require__(1670); const { getReferenceLinkImageData, filterByTypesCached } = __nccwpck_require__(5791); const backslashEscapeRe = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; @@ -56989,24 +56782,23 @@ module.exports = { let label = null; let destination = null; const { - children, endColumn, endLine, startColumn, startLine, text, type + endColumn, endLine, startColumn, startLine, text, type } = link; const image = (type === "image"); let isError = false; if (type === "autolink") { // link kind is an autolink - destination = getTokenTextByType(children, "autolinkProtocol"); + destination = getDescendantsByType(link, [ [ "autolinkEmail", "autolinkProtocol" ] ])[0]?.text; label = destination; - isError = !autolink; + isError = !autolink && Boolean(destination); } else { // link type is "image" or "link" - const descendents = filterByPredicate(children); - label = getTokenTextByType(descendents, "labelText"); + label = getDescendantsByType(link, [ "label", "labelText" ])[0].text; destination = - getTokenTextByType(descendents, "resourceDestinationString"); + getDescendantsByType(link, [ "resource", "resourceDestination", [ "resourceDestinationLiteral", "resourceDestinationRaw" ], "resourceDestinationString" ])[0]?.text; if (destination) { // link kind is an inline link - const title = getTokenTextByType(descendents, "resourceTitleString"); + const title = getDescendantsByType(link, [ "resource", "resourceTitle", "resourceTitleString" ])[0]?.text; isError = !inline || ( !urlInline && autolink && @@ -57017,9 +56809,9 @@ module.exports = { ); } else { // link kind is a full/collapsed/shortcut reference link - const isShortcut = !children.some((t) => t.type === "reference"); - const referenceString = getTokenTextByType(descendents, "referenceString"); - const isCollapsed = (referenceString === null); + const isShortcut = getDescendantsByType(link, [ "reference" ]).length === 0; + const referenceString = getDescendantsByType(link, [ "reference", "referenceString" ])[0]?.text; + const isCollapsed = (referenceString === undefined); const definition = definitions.get(referenceString || label); destination = definition && definition[1]; isError = destination && @@ -57027,9 +56819,8 @@ module.exports = { } } if (isError) { - // eslint-disable-next-line no-undef-init let range = undefined; - let fixInfo = null; + let fixInfo = undefined; if (startLine === endLine) { range = [ startColumn, endColumn - startColumn ]; let insertText = null; @@ -57080,7 +56871,6 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { filterByTypes } = __nccwpck_require__(3302); const { filterByTypesCached } = __nccwpck_require__(5791); const whitespaceTypes = new Set([ "linePrefix", "whitespace" ]); @@ -57105,51 +56895,45 @@ module.exports = { ((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "trailing_only")); let expectedTrailingPipe = ((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "leading_only")); - const tables = filterByTypesCached([ "table" ]); - for (const table of tables) { - const rows = filterByTypes( - table.children, - [ "tableDelimiterRow", "tableRow" ] - ); - for (const row of rows) { - // The following uses of first/lastOrNothing lack fallback handling - // because it seems not to be possible (i.e., 0% coverage) - const firstCell = firstOrNothing(row.children); - const leadingToken = firstOrNothing(ignoreWhitespace(firstCell.children)); - const actualLeadingPipe = (leadingToken.type === "tableCellDivider"); - const lastCell = lastOrNothing(row.children); - const trailingToken = lastOrNothing(ignoreWhitespace(lastCell.children)); - const actualTrailingPipe = (trailingToken.type === "tableCellDivider"); - const actualStyle = actualLeadingPipe ? - (actualTrailingPipe ? "leading_and_trailing" : "leading_only") : - (actualTrailingPipe ? "trailing_only" : "no_leading_or_trailing"); - if (expectedStyle === "consistent") { - expectedStyle = actualStyle; - expectedLeadingPipe = actualLeadingPipe; - expectedTrailingPipe = actualTrailingPipe; - } - if (actualLeadingPipe !== expectedLeadingPipe) { - addErrorDetailIf( - onError, - firstCell.startLine, - expectedStyle, - actualStyle, - `${expectedLeadingPipe ? "Missing" : "Unexpected"} leading pipe`, - undefined, - makeRange(row.startColumn, firstCell.startColumn) - ); - } - if (actualTrailingPipe !== expectedTrailingPipe) { - addErrorDetailIf( - onError, - lastCell.endLine, - expectedStyle, - actualStyle, - `${expectedTrailingPipe ? "Missing" : "Unexpected"} trailing pipe`, - undefined, - makeRange(lastCell.endColumn - 1, row.endColumn - 1) - ); - } + const rows = filterByTypesCached([ "tableDelimiterRow", "tableRow" ]); + for (const row of rows) { + // The following uses of first/lastOrNothing lack fallback handling + // because it seems not to be possible (i.e., 0% coverage) + const firstCell = firstOrNothing(row.children); + const leadingToken = firstOrNothing(ignoreWhitespace(firstCell.children)); + const actualLeadingPipe = (leadingToken.type === "tableCellDivider"); + const lastCell = lastOrNothing(row.children); + const trailingToken = lastOrNothing(ignoreWhitespace(lastCell.children)); + const actualTrailingPipe = (trailingToken.type === "tableCellDivider"); + const actualStyle = actualLeadingPipe ? + (actualTrailingPipe ? "leading_and_trailing" : "leading_only") : + (actualTrailingPipe ? "trailing_only" : "no_leading_or_trailing"); + if (expectedStyle === "consistent") { + expectedStyle = actualStyle; + expectedLeadingPipe = actualLeadingPipe; + expectedTrailingPipe = actualTrailingPipe; + } + if (actualLeadingPipe !== expectedLeadingPipe) { + addErrorDetailIf( + onError, + firstCell.startLine, + expectedStyle, + actualStyle, + `${expectedLeadingPipe ? "Missing" : "Unexpected"} leading pipe`, + undefined, + makeRange(row.startColumn, firstCell.startColumn) + ); + } + if (actualTrailingPipe !== expectedTrailingPipe) { + addErrorDetailIf( + onError, + lastCell.endLine, + expectedStyle, + actualStyle, + `${expectedTrailingPipe ? "Missing" : "Unexpected"} trailing pipe`, + undefined, + makeRange(lastCell.endColumn - 1, row.endColumn - 1) + ); } } } @@ -57167,7 +56951,7 @@ module.exports = { const { addErrorDetailIf } = __nccwpck_require__(8307); -const { filterByTypes } = __nccwpck_require__(3302); +const { getParentOfType } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); const makeRange = (start, end) => [ start, end - start + 1 ]; @@ -57180,44 +56964,39 @@ module.exports = { "tags": [ "table" ], "parser": "micromark", "function": function MD056(params, onError) { - const tables = filterByTypesCached([ "table" ]); - for (const table of tables) { - const rows = filterByTypes( - table.children, - [ "tableDelimiterRow", "tableRow" ] - ); - let expectedCount = 0; - for (const row of rows) { - const cells = filterByTypes( - row.children, - [ "tableData", "tableDelimiter", "tableHeader" ] - ); - const actualCount = cells.length; - expectedCount ||= actualCount; - // eslint-disable-next-line no-undef-init - let detail = undefined; - // eslint-disable-next-line no-undef-init - let range = undefined; - if (actualCount < expectedCount) { - detail = "Too few cells, row will be missing data"; - range = [ row.endColumn - 1, 1 ]; - } else if (expectedCount < actualCount) { - detail = "Too many cells, extra data will be missing"; - range = makeRange(cells[expectedCount].startColumn, row.endColumn - 1); - } - addErrorDetailIf( - onError, - row.endLine, - expectedCount, - actualCount, - detail, - undefined, - range - ); + const rows = filterByTypesCached([ "tableDelimiterRow", "tableRow" ]); + let expectedCount = 0; + let currentTable = null; + for (const row of rows) { + const table = getParentOfType(row, [ "table" ]); + if (currentTable !== table) { + expectedCount = 0; + currentTable = table; + } + const cells = row.children.filter((child) => [ "tableData", "tableDelimiter", "tableHeader" ].includes(child.type)); + const actualCount = cells.length; + expectedCount ||= actualCount; + let detail = undefined; + let range = undefined; + if (actualCount < expectedCount) { + detail = "Too few cells, row will be missing data"; + range = [ row.endColumn - 1, 1 ]; + } else if (expectedCount < actualCount) { + detail = "Too many cells, extra data will be missing"; + range = makeRange(cells[expectedCount].startColumn, row.endColumn - 1); } + addErrorDetailIf( + onError, + row.endLine, + expectedCount, + actualCount, + detail, + undefined, + range + ); } } -} +}; /***/ }), @@ -57230,7 +57009,8 @@ module.exports = { -const { addErrorContextForLine, isBlankLine } = __nccwpck_require__(8307); +const { addErrorContext, isBlankLine } = __nccwpck_require__(8307); +const { getBlockQuotePrefixText } = __nccwpck_require__(1670); const { filterByTypesCached } = __nccwpck_require__(5791); // eslint-disable-next-line jsdoc/valid-types @@ -57242,28 +57022,42 @@ module.exports = { "parser": "micromark", "function": function MD058(params, onError) { const { lines } = params; + const blockQuotePrefixes = filterByTypesCached([ "blockQuotePrefix", "linePrefix" ]); + // For every table... const tables = filterByTypesCached([ "table" ]); for (const table of tables) { + // Look for a blank line above the table - const firstIndex = table.startLine - 1; - if (!isBlankLine(lines[firstIndex - 1])) { - addErrorContextForLine( + const firstLineNumber = table.startLine; + if (!isBlankLine(lines[firstLineNumber - 2])) { + addErrorContext( onError, - // @ts-ignore - lines, - firstIndex + firstLineNumber, + lines[firstLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, firstLineNumber) + } ); } + // Look for a blank line below the table - const lastIndex = table.endLine - 1; - if (!isBlankLine(lines[lastIndex + 1])) { - addErrorContextForLine( + const lastLineNumber = table.endLine; + if (!isBlankLine(lines[lastLineNumber])) { + addErrorContext( onError, - // @ts-ignore - lines, - lastIndex, - lastIndex + 2 + lastLineNumber, + lines[lastLineNumber - 1].trim(), + undefined, + undefined, + undefined, + { + "lineNumber": lastLineNumber + 1, + "insertText": getBlockQuotePrefixText(blockQuotePrefixes, lastLineNumber) + } ); } } @@ -57358,11 +57152,11 @@ module.exports = rules; /***/ 9520: /***/ ((__unused_webpack_module, exports) => { -/*! markdownlint-micromark 0.1.10 https://github.com/DavidAnson/markdownlint */(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{directive:()=>F,gfmAutolinkLiteral:()=>B,gfmFootnote:()=>K,gfmTable:()=>ce,math:()=>be,parse:()=>It,postprocess:()=>Mt,preprocess:()=>Ot});var n={};e.r(n),e.d(n,{attentionMarkers:()=>Ft,contentInitial:()=>Lt,disable:()=>zt,document:()=>St,flow:()=>Dt,flowInitial:()=>Tt,insideSpan:()=>Ct,string:()=>Et,text:()=>At});const r=g(/[A-Za-z]/),i=g(/[\dA-Za-z]/),o=g(/[#-'*+\--9=?A-Z^-~]/);function c(e){return null!==e&&(e<32||127===e)}const u=g(/\d/),a=g(/[\dA-Fa-f]/),l=g(/[!-/:-@[-`{-~]/);function s(e){return null!==e&&e<-2}function f(e){return null!==e&&(e<0||32===e)}function p(e){return-2===e||-1===e||32===e}const d=g(/\p{P}|\p{S}/u),m=g(/\s/);function g(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function h(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){return p(r)?(e.enter(n),c(r)):t(r)};function c(r){return p(r)&&o++999||91===t&&++l>32?n(t):93!==t||l--?s(t)?c?n(t):(e.consume(t),e.exit("chunkText"),p):(e.consume(t),92===t?m:d):(e.exit("chunkText"),g(t))}function m(t){return 91===t||92===t||93===t?(e.consume(t),a++,d):d(t)}function g(n){return e.exit(o),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function k(e,t,n,o){const c=this;return function(t){return r(t)?(e.enter(o),e.consume(t),u):n(t)};function u(r){return 45===r||95===r||i(r)?(e.consume(r),u):(e.exit(o),45===c.previous||95===c.previous?n(r):t(r))}}const y={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let c,u=0;return function(t){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),a(t)};function a(t){return 58===t?(e.consume(t),u++,a):u<3?n(t):(e.exit("directiveContainerSequence"),k.call(r,e,l,n,"directiveContainerName")(t))}function l(t){return 91===t?e.attempt(w,f,f)(t):f(t)}function f(t){return 123===t?e.attempt(q,p,p)(t):p(t)}function p(t){return h(e,d,"whitespace")(t)}function d(i){return e.exit("directiveContainerFence"),null===i?m(i):s(i)?r.interrupt?t(i):e.attempt(S,g,m)(i):n(i)}function m(n){return e.exit("directiveContainer"),t(n)}function g(n){return null===n?(e.exit("directiveContainer"),t(n)):(e.enter("directiveContainerContent"),b(n))}function b(t){return null===t?T(t):e.attempt({tokenize:D,partial:!0},T,o?h(e,x,"linePrefix",o+1):x)(t)}function x(t){if(null===t)return T(t);const n=e.enter("chunkDocument",{contentType:"document",previous:c});return c&&(c.next=n),c=n,v(t)}function v(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,T(t)}return s(t)?e.check(S,y,L)(t):(e.consume(t),v)}function y(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,b}function L(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,T(t)}function T(n){return e.exit("directiveContainerContent"),e.exit("directiveContainer"),t(n)}function D(e,t,n){let r=0;return h(e,(function(t){return e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),i(t)}),"linePrefix",4);function i(t){return 58===t?(e.consume(t),r++,i):r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}_[43]=V,_[45]=V,_[46]=V,_[95]=V,_[72]=[V,N],_[104]=[V,N],_[87]=[V,P],_[119]=[V,P];const Z={tokenize:function(e,t,n){return function(t){return p(t)?h(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||s(e)?t(e):n(e)}},partial:!0};function J(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Y={tokenize:function(e,t,n){const r=this;return h(e,(function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function K(){return{document:{91:{tokenize:te,continuation:{tokenize:ne},exit:re}},text:{91:{tokenize:ee},93:{add:"after",tokenize:X,resolveTo:$}}}}function X(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){c=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!c||!c._balanced)return n(i);const u=J(r.sliceSerialize({start:c.end,end:r.now()}));return 94===u.codePointAt(0)&&o.includes(u.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function $(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},a=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",c,t],["enter",u,t],["exit",u,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...a),e}function ee(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,c=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),u};function u(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(u){if(c>999||93===u&&!o||null===u||91===u||f(u))return n(u);if(93===u){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return i.includes(J(r.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return f(u)||(o=!0),c++,e.consume(u),92===u?l:a}function l(t){return 91===t||92===t||93===t?(e.consume(t),c++,a):a(t)}}function te(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,c,u=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",l):n(t)}function l(t){if(u>999||93===t&&!c||null===t||91===t||f(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=J(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return f(t)||(c=!0),u++,e.consume(t),92===t?s:l}function s(t){return 91===t||92===t||93===t?(e.consume(t),u++,l):l(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(o)||i.push(o),h(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function ne(e,t,n){return e.check(Z,t,e.attempt(Y,t,n))}function re(e){e.exit("gfmFootnoteDefinition")}class ie{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function oe(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,o="tableHead"===i||"tableRow"===i?S:u;return o===S&&r.parser.lazy[r.now().line]?n(e):o(e)};function u(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,c+=1),a(e)}(t)}function a(t){return null===t?n(t):s(t)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m):n(t):p(t)?h(e,a,"whitespace")(t):(c+=1,i&&(i=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,a):(e.enter("data"),l(t)))}function l(t){return null===t||124===t||f(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?d:l)}function d(t){return 92===t||124===t?(e.consume(t),l):l(t)}function m(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,p(t)?h(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):g(t))}function g(t){return 45===t||58===t?x(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),b):q(t)}function b(t){return p(t)?h(e,x,"whitespace")(t):x(t)}function x(t){return 58===t?(c+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),v):45===t?(c+=1,v(t)):null===t||s(t)?w(t):q(t)}function v(t){return 45===t?(e.enter("tableDelimiterFiller"),k(t)):q(t)}function k(t){return 45===t?(e.consume(t),k):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return p(t)?h(e,w,"whitespace")(t):w(t)}function w(n){return 124===n?g(n):(null===n||s(n))&&i&&o===c?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):q(n)}function q(e){return n(e)}function S(t){return e.enter("tableRow"),L(t)}function L(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),L):null===n||s(n)?(e.exit("tableRow"),t(n)):p(n)?h(e,L,"whitespace")(n):(e.enter("data"),T(n))}function T(t){return null===t||124===t||f(t)?(e.exit("data"),L(t)):(e.consume(t),92===t?D:T)}function D(t){return 92===t||124===t?(e.consume(t),T):T(t)}}function ae(e,t){let n,r,i,o=-1,c=!0,u=0,a=[0,0,0,0],l=[0,0,0,0],s=!1,f=0;const p=new ie;for(;++on[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return void 0!==i&&(o.end=Object.assign({},fe(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function se(e,t,n,r,i){const o=[],c=fe(t.events,n);i&&(i.end=Object.assign({},c),o.push(["exit",i,t])),r.end=Object.assign({},c),o.push(["exit",r,t]),e.add(n+1,0,o)}function fe(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const pe={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let c=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),u(t)};function u(t){return 36===t?(e.consume(t),c++,u):c<2?n(t):(e.exit("mathFlowFenceSequence"),h(e,a,"whitespace")(t))}function a(t){return null===t||s(t)?f(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return null===t||s(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),f(t)):36===t?n(t):(e.consume(t),l)}function f(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(de,p,b)(n)}function p(t){return e.attempt({tokenize:x,partial:!0},b,d)(t)}function d(t){return(o?h(e,m,"linePrefix",o+1):m)(t)}function m(t){return null===t?b(t):s(t)?e.attempt(de,p,b)(t):(e.enter("mathFlowValue"),g(t))}function g(t){return null===t||s(t)?(e.exit("mathFlowValue"),m(t)):(e.consume(t),g)}function b(n){return e.exit("mathFlow"),t(n)}function x(e,t,n){let i=0;return h(e,(function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(t)}),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return 36===t?(i++,e.consume(t),o):ii?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);c0?(xe(e,e.length,0,t),e):t}const ke={}.hasOwnProperty;function ye(e,t){let n;for(n in t){const r=(ke.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){ke.call(r,o)||(r[o]=[]);const e=i[o];we(r[o],Array.isArray(e)?e:e?[e]:[])}}}function we(e,t){let n=-1;const r=[];for(;++no))return;const n=t.events.length;let i,u,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(i){u=t.events[a][1].end;break}i=!0}for(x(c),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Le={tokenize:function(e,t,n){return h(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function Te(e){const t={};let n,r,i,o,c,u,a,l=-1;for(;++l=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0},Ce={tokenize:function(e){const t=this,n=e.attempt(Z,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,h(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ee,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},Fe={resolveAll:Re()},ze=Me("string"),Ie=Me("text");function Me(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,c);return o;function o(e){return a(e)?i(e):c(e)}function c(e){if(null!==e)return t.enter("data"),t.consume(e),u;t.consume(e)}function u(e){return a(e)?(t.exit("data"),i(e)):(t.consume(e),u)}function a(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i-1){const e=c[0];"string"==typeof e?c[0]=e.slice(r):c.shift()}o>0&&c.push(e[i].slice(0,o))}return c}(c,e)}function g(){const{line:e,column:t,offset:n,_index:i,_bufferIndex:o}=r;return{line:e,column:t,offset:n,_index:i,_bufferIndex:o}}function h(e){a=void 0,p=e,d=d(e)}function b(e,t){t.restore()}function x(e,t){return function(n,i,o){let c,s,p,d;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):(m=n,function(e){const t=null!==e&&m[e],n=null!==e&&m.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var m;function h(e){return c=e,s=0,0===e.length?o:b(e[s])}function b(e){return function(n){return d=function(){const e=g(),t=f.previous,n=f.currentConstruct,i=f.events.length,o=Array.from(u);return{restore:function(){r=e,f.previous=t,f.currentConstruct=n,f.events.length=i,u=o,k()},from:i}}(),p=e,e.partial||(f.currentConstruct=e),e.name&&f.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(f),t):f,l,x,v)(n)}}function x(t){return a=!0,e(p,d),i}function v(e){return a=!0,d.restore(),++s=3&&(null===o||s(o))?(e.exit("thematicBreak"),t(o)):n(o)}function c(t){return t===r?(e.consume(t),i++,c):(e.exit("thematicBreakSequence"),p(t)?h(e,o,"whitespace")(t):o(t))}}},_e={name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,c=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:u(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(Ve,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return u(t)&&++c<10?(e.consume(t),a):(!r.interrupt||c<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Z,r.interrupt?n:s,e.attempt(Be,d,f))}function s(e){return r.containerState.initialBlankLine=!0,o++,d(e)}function f(t){return p(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Z,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,h(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!p(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(je,t,i)(n))}));function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,h(e,e.attempt(_e,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},Be={tokenize:function(e,t,n){const r=this;return h(e,(function(e){const i=r.events[r.events.length-1];return!p(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},je={tokenize:function(e,t,n){const r=this;return h(e,(function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},He={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return p(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return p(t)?h(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(He,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function Ue(e,t,n,r,i,o,u,a,l){const p=l||Number.POSITIVE_INFINITY;let d=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),m):null===t||32===t||41===t||c(t)?n(t):(e.enter(r),e.enter(u),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(t))};function m(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(n))}function g(t){return 62===t?(e.exit("chunkString"),e.exit(a),m(t)):null===t||60===t||s(t)?n(t):(e.consume(t),92===t?h:g)}function h(t){return 60===t||62===t||92===t?(e.consume(t),g):g(t)}function b(i){return d||null!==i&&41!==i&&!f(i)?d999||null===p||91===p||93===p&&!u||94===p&&!a&&"_hiddenFootnoteSupport"in c.parser.constructs?n(p):93===p?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):s(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(t){return null===t||91===t||93===t||s(t)||a++>999?(e.exit("chunkString"),l(t)):(e.consume(t),u||(u=!p(t)),92===t?d:f)}function d(t){return 91===t||92===t||93===t?(e.consume(t),a++,f):f(t)}}function Qe(e,t,n,r,i,o){let c;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),c=40===t?41:t,u):n(t)};function u(n){return n===c?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),a(n))}function a(t){return t===c?(e.exit(o),u(c)):null===t?n(t):s(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===c||null===t||s(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?f:l)}function f(t){return t===c||92===t?(e.consume(t),l):l(t)}}const We={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return Ge.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return i=J(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),c):n(t)}function c(t){return f(t)?b(e,u)(t):u(t)}function u(t){return Ue(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(Ze,l,l)(t)}function l(t){return p(t)?h(e,d,"whitespace")(t):d(t)}function d(o){return null===o||s(o)?(e.exit("definition"),r.parser.defined.push(i),t(o)):n(o)}}},Ze={tokenize:function(e,t,n){return function(t){return f(t)?b(e,r)(t):n(t)};function r(t){return Qe(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return p(t)?h(e,o,"whitespace")(t):o(t)}function o(e){return null===e||s(e)?t(e):n(e)}},partial:!0},Je={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),h(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?u(t):s(t)?e.attempt(Ye,o,u)(t):(e.enter("codeFlowValue"),c(t))}function c(t){return null===t||s(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),c)}function u(n){return e.exit("codeIndented"),t(n)}}},Ye={tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):s(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):h(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):s(e)?i(e):n(e)}},partial:!0},Ke={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||f(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),c(n)):null===n||s(n)?(e.exit("atxHeading"),t(n)):p(n)?h(e,o,"whitespace")(n):(e.enter("atxHeadingText"),u(n))}function c(t){return 35===t?(e.consume(t),c):(e.exit("atxHeadingSequence"),o(t))}function u(t){return null===t||35===t||f(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),u)}},resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},xe(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},Xe={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let i;return function(t){let c,u=r.events.length;for(;u--;)if("lineEnding"!==r.events[u][1].type&&"linePrefix"!==r.events[u][1].type&&"content"!==r.events[u][1].type){c="paragraph"===r.events[u][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!c?n(t):(e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===i?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),p(t)?h(e,c,"lineSuffix")(t):c(t))}function c(r){return null===r||s(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const c={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",c,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=c,e.push(["exit",c,t]),e}},$e=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],et=["pre","script","style","textarea"],tt={name:"htmlFlow",tokenize:function(e,t,n){const o=this;let c,u,a,l,d;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),m}(t)};function m(i){return 33===i?(e.consume(i),g):47===i?(e.consume(i),u=!0,x):63===i?(e.consume(i),c=3,o.interrupt?t:V):r(i)?(e.consume(i),a=String.fromCharCode(i),v):n(i)}function g(i){return 45===i?(e.consume(i),c=2,h):91===i?(e.consume(i),c=5,l=0,b):r(i)?(e.consume(i),c=4,o.interrupt?t:V):n(i)}function h(r){return 45===r?(e.consume(r),o.interrupt?t:V):n(r)}function b(r){return r==="CDATA[".charCodeAt(l++)?(e.consume(r),6===l?o.interrupt?t:F:b):n(r)}function x(t){return r(t)?(e.consume(t),a=String.fromCharCode(t),v):n(t)}function v(r){if(null===r||47===r||62===r||f(r)){const i=47===r,l=a.toLowerCase();return i||u||!et.includes(l)?$e.includes(a.toLowerCase())?(c=6,i?(e.consume(r),k):o.interrupt?t(r):F(r)):(c=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(r):u?y(r):w(r)):(c=1,o.interrupt?t(r):F(r))}return 45===r||i(r)?(e.consume(r),a+=String.fromCharCode(r),v):n(r)}function k(r){return 62===r?(e.consume(r),o.interrupt?t:F):n(r)}function y(t){return p(t)?(e.consume(t),y):A(t)}function w(t){return 47===t?(e.consume(t),A):58===t||95===t||r(t)?(e.consume(t),q):p(t)?(e.consume(t),w):A(t)}function q(t){return 45===t||46===t||58===t||95===t||i(t)?(e.consume(t),q):S(t)}function S(t){return 61===t?(e.consume(t),L):p(t)?(e.consume(t),S):w(t)}function L(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),d=t,T):p(t)?(e.consume(t),L):D(t)}function T(t){return t===d?(e.consume(t),d=null,E):null===t||s(t)?n(t):(e.consume(t),T)}function D(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||f(t)?S(t):(e.consume(t),D)}function E(e){return 47===e||62===e||p(e)?w(e):n(e)}function A(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||s(t)?F(t):p(t)?(e.consume(t),C):n(t)}function F(t){return 45===t&&2===c?(e.consume(t),R):60===t&&1===c?(e.consume(t),O):62===t&&4===c?(e.consume(t),_):63===t&&3===c?(e.consume(t),V):93===t&&5===c?(e.consume(t),N):!s(t)||6!==c&&7!==c?null===t||s(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),F):(e.exit("htmlFlowData"),e.check(nt,B,z)(t))}function z(t){return e.check(rt,I,B)(t)}function I(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||s(t)?z(t):(e.enter("htmlFlowData"),F(t))}function R(t){return 45===t?(e.consume(t),V):F(t)}function O(t){return 47===t?(e.consume(t),a="",P):F(t)}function P(t){if(62===t){const n=a.toLowerCase();return et.includes(n)?(e.consume(t),_):F(t)}return r(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),P):F(t)}function N(t){return 93===t?(e.consume(t),V):F(t)}function V(t){return 62===t?(e.consume(t),_):45===t&&2===c?(e.consume(t),V):F(t)}function _(t){return null===t||s(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),_)}function B(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},nt={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Z,t,n)}},partial:!0},rt={tokenize:function(e,t,n){const r=this;return function(t){return s(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},it={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},ot={name:"codeFenced",tokenize:function(e,t,n){const r=this,i={tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),c};function c(t){return e.enter("codeFencedFence"),p(t)?h(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)}function a(t){return t===o?(e.enter("codeFencedFenceSequence"),l(t)):n(t)}function l(t){return t===o?(i++,e.consume(t),l):i>=u?(e.exit("codeFencedFenceSequence"),p(t)?h(e,f,"whitespace")(t):f(t)):n(t)}function f(r){return null===r||s(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let o,c=0,u=0;return function(t){return function(t){const n=r.events[r.events.length-1];return c=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===o?(u++,e.consume(t),a):u<3?n(t):(e.exit("codeFencedFenceSequence"),p(t)?h(e,l,"whitespace")(t):l(t))}function l(n){return null===n||s(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(it,g,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return null===t||s(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(t)):p(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),f)}function d(t){return null===t||s(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(t))}function m(t){return null===t||s(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(t)):96===t&&t===o?n(t):(e.consume(t),m)}function g(t){return e.attempt(i,y,b)(t)}function b(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),x}function x(t){return c>0&&p(t)?h(e,v,"linePrefix",c+1)(t):v(t)}function v(t){return null===t||s(t)?e.check(it,g,y)(t):(e.enter("codeFlowValue"),k(t))}function k(t){return null===t||s(t)?(e.exit("codeFlowValue"),v(t)):(e.consume(t),k)}function y(n){return e.exit("codeFenced"),t(n)}},concrete:!0},ct={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},ut={}.hasOwnProperty,at={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,c,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,c=i,p(t))}function f(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=a,p):(e.enter("characterReferenceValue"),o=7,c=u,p(t))}function p(u){if(59===u&&l){const o=e.exit("characterReferenceValue");return c!==i||function(e){return!!ut.call(ct,e)&&ct[e]}(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(u)}return c(u)&&l++1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const f=Object.assign({},e[n][1].end),p=Object.assign({},e[s][1].start);xt(f,-u),xt(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[n][1].end)},c={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[s][1].start),end:p},i={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[s][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},c.end)},e[n][1].end=Object.assign({},o.start),e[s][1].start=Object.assign({},c.end),a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=ve(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=ve(a,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),a=ve(a,Pe(t.parser.constructs.insideSpan.null,e.slice(n+1,s),t)),a=ve(a,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",r,t]]),e[s][1].end.offset-e[s][1].start.offset?(l=2,a=ve(a,[["enter",e[s][1],t],["exit",e[s][1],t]])):l=0,xe(e,n-1,s-n+3,a),s=n+a.length-l-2;break}for(s=-1;++s{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{directive:()=>I,gfmAutolinkLiteral:()=>B,gfmFootnote:()=>K,gfmTable:()=>ce,labelEnd:()=>dt,math:()=>be,parse:()=>Mt,postprocess:()=>Rt,preprocess:()=>Pt});var n={};e.r(n),e.d(n,{attentionMarkers:()=>zt,contentInitial:()=>Lt,disable:()=>Nt,document:()=>Et,flow:()=>At,flowInitial:()=>Dt,insideSpan:()=>Ft,string:()=>Ct,text:()=>It});const r=h(/[A-Za-z]/),i=h(/[\dA-Za-z]/),o=h(/[#-'*+\--9=?A-Z^-~]/);function c(e){return null!==e&&(e<32||127===e)}const u=h(/\d/),a=h(/[\dA-Fa-f]/),s=h(/[!-/:-@[-`{-~]/);function l(e){return null!==e&&e<-2}function f(e){return null!==e&&(e<0||32===e)}function p(e){return-2===e||-1===e||32===e}const d=h(/\p{P}|\p{S}/u),m=h(/\s/);function h(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function g(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){return p(r)?(e.enter(n),c(r)):t(r)};function c(r){return p(r)&&o++999||91===t&&++s>32?n(t):93!==t||s--?l(t)?c?n(t):(e.consume(t),e.exit("chunkText"),p):(e.consume(t),92===t?m:d):(e.exit("chunkText"),h(t))}function m(t){return 91===t||92===t||93===t?(e.consume(t),a++,d):d(t)}function h(n){return e.exit(o),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function k(e,t,n,o){const c=this;return function(t){return r(t)?(e.enter(o),e.consume(t),u):n(t)};function u(r){return 45===r||95===r||i(r)?(e.consume(r),u):(e.exit(o),45===c.previous||95===c.previous?n(r):t(r))}}const y={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let c,u=0;return function(t){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),a(t)};function a(t){return 58===t?(e.consume(t),u++,a):u<3?n(t):(e.exit("directiveContainerSequence"),k.call(r,e,s,n,"directiveContainerName")(t))}function s(t){return 91===t?e.attempt(w,f,f)(t):f(t)}function f(t){return 123===t?e.attempt(S,p,p)(t):p(t)}function p(t){return g(e,d,"whitespace")(t)}function d(i){return e.exit("directiveContainerFence"),null===i?D(i):l(i)?r.interrupt?t(i):e.attempt(q,m,D)(i):n(i)}function m(t){return null===t?D(t):l(t)?e.check(q,y,D)(t):(e.enter("directiveContainerContent"),h(t))}function h(t){return e.attempt({tokenize:A,partial:!0},L,o?g(e,b,"linePrefix",o+1):b)(t)}function b(t){return null===t?L(t):l(t)?e.check(q,v,L)(t):v(t)}function x(t){if(null===t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,L(t)}return l(t)?e.check(q,T,E)(t):(e.consume(t),x)}function v(t){const n=e.enter("chunkDocument",{contentType:"document",previous:c});return c&&(c.next=n),c=n,x(t)}function y(t){return e.enter("directiveContainerContent"),h(t)}function T(t){e.consume(t);const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,h}function E(t){const n=e.exit("chunkDocument");return r.parser.lazy[n.start.line]=!1,L(t)}function L(t){return e.exit("directiveContainerContent"),D(t)}function D(n){return e.exit("directiveContainer"),t(n)}function A(e,t,n){let i=0;return g(e,(function(t){return e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),o(t)}),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return 58===t?(e.consume(t),i++,o):i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}_[43]=V,_[45]=V,_[46]=V,_[95]=V,_[72]=[V,P],_[104]=[V,P],_[87]=[V,O],_[119]=[V,O];const W={tokenize:function(e,t,n){return function(t){return p(t)?g(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||l(e)?t(e):n(e)}},partial:!0};function Z(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J={tokenize:function(e,t,n){const r=this;return g(e,(function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function K(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:te,continuation:{tokenize:ne},exit:re}},text:{91:{name:"gfmFootnoteCall",tokenize:ee},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:X,resolveTo:$}}}}function X(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){c=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!c||!c._balanced)return n(i);const u=Z(r.sliceSerialize({start:c.end,end:r.now()}));return 94===u.codePointAt(0)&&o.includes(u.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function $(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},a=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",c,t],["enter",u,t],["exit",u,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...a),e}function ee(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,c=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),u};function u(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(u){if(c>999||93===u&&!o||null===u||91===u||f(u))return n(u);if(93===u){e.exit("chunkString");const o=e.exit("gfmFootnoteCallString");return i.includes(Z(r.sliceSerialize(o)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return f(u)||(o=!0),c++,e.consume(u),92===u?s:a}function s(t){return 91===t||92===t||93===t?(e.consume(t),c++,a):a(t)}}function te(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,c,u=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",s):n(t)}function s(t){if(u>999||93===t&&!c||null===t||91===t||f(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return o=Z(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return f(t)||(c=!0),u++,e.consume(t),92===t?l:s}function l(t){return 91===t||92===t||93===t?(e.consume(t),u++,s):s(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(o)||i.push(o),g(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function ne(e,t,n){return e.check(W,t,e.attempt(J,t,n))}function re(e){e.exit("gfmFootnoteDefinition")}class ie{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function oe(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,o="tableHead"===i||"tableRow"===i?q:u;return o===q&&r.parser.lazy[r.now().line]?n(e):o(e)};function u(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,c+=1),a(e)}(t)}function a(t){return null===t?n(t):l(t)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m):n(t):p(t)?g(e,a,"whitespace")(t):(c+=1,i&&(i=!1,o+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,a):(e.enter("data"),s(t)))}function s(t){return null===t||124===t||f(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?d:s)}function d(t){return 92===t||124===t?(e.consume(t),s):s(t)}function m(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,p(t)?g(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t))}function h(t){return 45===t||58===t?x(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),b):S(t)}function b(t){return p(t)?g(e,x,"whitespace")(t):x(t)}function x(t){return 58===t?(c+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),v):45===t?(c+=1,v(t)):null===t||l(t)?w(t):S(t)}function v(t){return 45===t?(e.enter("tableDelimiterFiller"),k(t)):S(t)}function k(t){return 45===t?(e.consume(t),k):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return p(t)?g(e,w,"whitespace")(t):w(t)}function w(n){return 124===n?h(n):(null===n||l(n))&&i&&o===c?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):S(n)}function S(e){return n(e)}function q(t){return e.enter("tableRow"),T(t)}function T(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),T):null===n||l(n)?(e.exit("tableRow"),t(n)):p(n)?g(e,T,"whitespace")(n):(e.enter("data"),E(n))}function E(t){return null===t||124===t||f(t)?(e.exit("data"),T(t)):(e.consume(t),92===t?L:E)}function L(t){return 92===t||124===t?(e.consume(t),E):E(t)}}function ae(e,t){let n,r,i,o=-1,c=!0,u=0,a=[0,0,0,0],s=[0,0,0,0],l=!1,f=0;const p=new ie;for(;++on[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return void 0!==i&&(o.end=Object.assign({},fe(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function le(e,t,n,r,i){const o=[],c=fe(t.events,n);i&&(i.end=Object.assign({},c),o.push(["exit",i,t])),r.end=Object.assign({},c),o.push(["exit",r,t]),e.add(n+1,0,o)}function fe(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const pe={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let c=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),u(t)};function u(t){return 36===t?(e.consume(t),c++,u):c<2?n(t):(e.exit("mathFlowFenceSequence"),g(e,a,"whitespace")(t))}function a(t){return null===t||l(t)?f(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),s(t))}function s(t){return null===t||l(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),f(t)):36===t?n(t):(e.consume(t),s)}function f(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(de,p,b)(n)}function p(t){return e.attempt({tokenize:x,partial:!0},b,d)(t)}function d(t){return(o?g(e,m,"linePrefix",o+1):m)(t)}function m(t){return null===t?b(t):l(t)?e.attempt(de,p,b)(t):(e.enter("mathFlowValue"),h(t))}function h(t){return null===t||l(t)?(e.exit("mathFlowValue"),m(t)):(e.consume(t),h)}function b(n){return e.exit("mathFlow"),t(n)}function x(e,t,n){let i=0;return g(e,(function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(t)}),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return 36===t?(i++,e.consume(t),o):ii?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);c0?(xe(e,e.length,0,t),e):t}const ke={}.hasOwnProperty;function ye(e,t){let n;for(n in t){const r=(ke.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){ke.call(r,o)||(r[o]=[]);const e=i[o];we(r[o],Array.isArray(e)?e:e?[e]:[])}}}function we(e,t){let n=-1;const r=[];for(;++no))return;const n=t.events.length;let i,u,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(i){u=t.events[a][1].end;break}i=!0}for(x(c),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Te={tokenize:function(e,t,n){return g(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};class Ee{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Le(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Le(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Le(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0},Fe={tokenize:function(e){const t=this,n=e.attempt(W,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,g(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ce,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},ze={resolveAll:Oe()},Ne=Re("string"),Me=Re("text");function Re(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,c);return o;function o(e){return a(e)?i(e):c(e)}function c(e){if(null!==e)return t.enter("data"),t.consume(e),u;t.consume(e)}function u(e){return a(e)?(t.exit("data"),i(e)):(t.consume(e),u)}function a(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i-1){const e=c[0];"string"==typeof e?c[0]=e.slice(r):c.shift()}o>0&&c.push(e[i].slice(0,o))}return c}(c,e)}function h(){const{line:e,column:t,offset:n,_index:i,_bufferIndex:o}=r;return{line:e,column:t,offset:n,_index:i,_bufferIndex:o}}function g(e){a=void 0,p=e,d=d(e)}function b(e,t){t.restore()}function x(e,t){return function(n,i,o){let c,l,p,d;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(m=n,function(e){const t=null!==e&&m[e],n=null!==e&&m.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var m;function g(e){return c=e,l=0,0===e.length?o:b(e[l])}function b(e){return function(n){return d=function(){const e=h(),t=f.previous,n=f.currentConstruct,i=f.events.length,o=Array.from(u);return{restore:function(){r=e,f.previous=t,f.currentConstruct=n,f.events.length=i,u=o,k()},from:i}}(),p=e,e.partial||(f.currentConstruct=e),e.name&&f.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(f),t):f,s,x,v)(n)}}function x(t){return a=!0,e(p,d),i}function v(e){return a=!0,d.restore(),++l=3&&(null===o||l(o))?(e.exit("thematicBreak"),t(o)):n(o)}function c(t){return t===r?(e.consume(t),i++,c):(e.exit("thematicBreakSequence"),p(t)?g(e,o,"whitespace")(t):o(t))}}},je={name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,c=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:u(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(Be,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return u(t)&&++c<10?(e.consume(t),a):(!r.interrupt||c<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(W,r.interrupt?n:l,e.attempt(He,d,f))}function l(e){return r.containerState.initialBlankLine=!0,o++,d(e)}function f(t){return p(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(W,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,g(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!p(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ue,t,i)(n))}));function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,g(e,e.attempt(je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},He={tokenize:function(e,t,n){const r=this;return g(e,(function(e){const i=r.events[r.events.length-1];return!p(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},Ue={tokenize:function(e,t,n){const r=this;return g(e,(function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},Ge={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return p(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return p(t)?g(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(Ge,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function Ye(e,t,n,r,i,o,u,a,s){const p=s||Number.POSITIVE_INFINITY;let d=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),m):null===t||32===t||41===t||c(t)?n(t):(e.enter(r),e.enter(u),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(t))};function m(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(a),m(t)):null===t||60===t||l(t)?n(t):(e.consume(t),92===t?g:h)}function g(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function b(i){return d||null!==i&&41!==i&&!f(i)?d999||null===p||91===p||93===p&&!u||94===p&&!a&&"_hiddenFootnoteSupport"in c.parser.constructs?n(p):93===p?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):l(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(t){return null===t||91===t||93===t||l(t)||a++>999?(e.exit("chunkString"),s(t)):(e.consume(t),u||(u=!p(t)),92===t?d:f)}function d(t){return 91===t||92===t||93===t?(e.consume(t),a++,f):f(t)}}function We(e,t,n,r,i,o){let c;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),c=40===t?41:t,u):n(t)};function u(n){return n===c?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),a(n))}function a(t){return t===c?(e.exit(o),u(c)):null===t?n(t):l(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(t))}function s(t){return t===c||null===t||l(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?f:s)}function f(t){return t===c||92===t?(e.consume(t),s):s(t)}}const Ze={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return Qe.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return i=Z(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),c):n(t)}function c(t){return f(t)?b(e,u)(t):u(t)}function u(t){return Ye(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(Je,s,s)(t)}function s(t){return p(t)?g(e,d,"whitespace")(t):d(t)}function d(o){return null===o||l(o)?(e.exit("definition"),r.parser.defined.push(i),t(o)):n(o)}}},Je={tokenize:function(e,t,n){return function(t){return f(t)?b(e,r)(t):n(t)};function r(t){return We(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return p(t)?g(e,o,"whitespace")(t):o(t)}function o(e){return null===e||l(e)?t(e):n(e)}},partial:!0},Ke={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),g(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?u(t):l(t)?e.attempt(Xe,o,u)(t):(e.enter("codeFlowValue"),c(t))}function c(t){return null===t||l(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),c)}function u(n){return e.exit("codeIndented"),t(n)}}},Xe={tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):l(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):g(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):l(e)?i(e):n(e)}},partial:!0},$e={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||f(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),c(n)):null===n||l(n)?(e.exit("atxHeading"),t(n)):p(n)?g(e,o,"whitespace")(n):(e.enter("atxHeadingText"),u(n))}function c(t){return 35===t?(e.consume(t),c):(e.exit("atxHeadingSequence"),o(t))}function u(t){return null===t||35===t||f(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),u)}},resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},xe(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},et={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let i;return function(t){let c,u=r.events.length;for(;u--;)if("lineEnding"!==r.events[u][1].type&&"linePrefix"!==r.events[u][1].type&&"content"!==r.events[u][1].type){c="paragraph"===r.events[u][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!c?n(t):(e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t))};function o(t){return t===i?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),p(t)?g(e,c,"lineSuffix")(t):c(t))}function c(r){return null===r||l(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const c={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",c,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=c,e.push(["exit",c,t]),e}},tt=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nt=["pre","script","style","textarea"],rt={name:"htmlFlow",tokenize:function(e,t,n){const o=this;let c,u,a,s,d;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),m}(t)};function m(i){return 33===i?(e.consume(i),h):47===i?(e.consume(i),u=!0,x):63===i?(e.consume(i),c=3,o.interrupt?t:V):r(i)?(e.consume(i),a=String.fromCharCode(i),v):n(i)}function h(i){return 45===i?(e.consume(i),c=2,g):91===i?(e.consume(i),c=5,s=0,b):r(i)?(e.consume(i),c=4,o.interrupt?t:V):n(i)}function g(r){return 45===r?(e.consume(r),o.interrupt?t:V):n(r)}function b(r){return r==="CDATA[".charCodeAt(s++)?(e.consume(r),6===s?o.interrupt?t:I:b):n(r)}function x(t){return r(t)?(e.consume(t),a=String.fromCharCode(t),v):n(t)}function v(r){if(null===r||47===r||62===r||f(r)){const i=47===r,s=a.toLowerCase();return i||u||!nt.includes(s)?tt.includes(a.toLowerCase())?(c=6,i?(e.consume(r),k):o.interrupt?t(r):I(r)):(c=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(r):u?y(r):w(r)):(c=1,o.interrupt?t(r):I(r))}return 45===r||i(r)?(e.consume(r),a+=String.fromCharCode(r),v):n(r)}function k(r){return 62===r?(e.consume(r),o.interrupt?t:I):n(r)}function y(t){return p(t)?(e.consume(t),y):A(t)}function w(t){return 47===t?(e.consume(t),A):58===t||95===t||r(t)?(e.consume(t),S):p(t)?(e.consume(t),w):A(t)}function S(t){return 45===t||46===t||58===t||95===t||i(t)?(e.consume(t),S):q(t)}function q(t){return 61===t?(e.consume(t),T):p(t)?(e.consume(t),q):w(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),d=t,E):p(t)?(e.consume(t),T):L(t)}function E(t){return t===d?(e.consume(t),d=null,D):null===t||l(t)?n(t):(e.consume(t),E)}function L(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||f(t)?q(t):(e.consume(t),L)}function D(e){return 47===e||62===e||p(e)?w(e):n(e)}function A(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||l(t)?I(t):p(t)?(e.consume(t),C):n(t)}function I(t){return 45===t&&2===c?(e.consume(t),M):60===t&&1===c?(e.consume(t),R):62===t&&4===c?(e.consume(t),_):63===t&&3===c?(e.consume(t),V):93===t&&5===c?(e.consume(t),P):!l(t)||6!==c&&7!==c?null===t||l(t)?(e.exit("htmlFlowData"),F(t)):(e.consume(t),I):(e.exit("htmlFlowData"),e.check(it,B,F)(t))}function F(t){return e.check(ot,z,B)(t)}function z(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||l(t)?F(t):(e.enter("htmlFlowData"),I(t))}function M(t){return 45===t?(e.consume(t),V):I(t)}function R(t){return 47===t?(e.consume(t),a="",O):I(t)}function O(t){if(62===t){const n=a.toLowerCase();return nt.includes(n)?(e.consume(t),_):I(t)}return r(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),O):I(t)}function P(t){return 93===t?(e.consume(t),V):I(t)}function V(t){return 62===t?(e.consume(t),_):45===t&&2===c?(e.consume(t),V):I(t)}function _(t){return null===t||l(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),_)}function B(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},it={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(W,t,n)}},partial:!0},ot={tokenize:function(e,t,n){const r=this;return function(t){return l(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},ct={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},ut={name:"codeFenced",tokenize:function(e,t,n){const r=this,i={tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),c};function c(t){return e.enter("codeFencedFence"),p(t)?g(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)}function a(t){return t===o?(e.enter("codeFencedFenceSequence"),s(t)):n(t)}function s(t){return t===o?(i++,e.consume(t),s):i>=u?(e.exit("codeFencedFenceSequence"),p(t)?g(e,f,"whitespace")(t):f(t)):n(t)}function f(r){return null===r||l(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let o,c=0,u=0;return function(t){return function(t){const n=r.events[r.events.length-1];return c=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===o?(u++,e.consume(t),a):u<3?n(t):(e.exit("codeFencedFenceSequence"),p(t)?g(e,s,"whitespace")(t):s(t))}function s(n){return null===n||l(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(ct,h,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return null===t||l(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(t)):p(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(e,d,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),f)}function d(t){return null===t||l(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(t))}function m(t){return null===t||l(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(t)):96===t&&t===o?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,y,b)(t)}function b(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),x}function x(t){return c>0&&p(t)?g(e,v,"linePrefix",c+1)(t):v(t)}function v(t){return null===t||l(t)?e.check(ct,h,y)(t):(e.enter("codeFlowValue"),k(t))}function k(t){return null===t||l(t)?(e.exit("codeFlowValue"),v(t)):(e.consume(t),k)}function y(n){return e.exit("codeFenced"),t(n)}},concrete:!0},at={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},st={}.hasOwnProperty,lt={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,c,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,c=i,p(t))}function f(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=a,p):(e.enter("characterReferenceValue"),o=7,c=u,p(t))}function p(u){if(59===u&&s){const o=e.exit("characterReferenceValue");return c!==i||function(e){return!!st.call(at,e)&&at[e]}(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(u)}return c(u)&&s++1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const f=Object.assign({},e[n][1].end),p=Object.assign({},e[l][1].start);kt(f,-u),kt(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[n][1].end)},c={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[l][1].start),end:p},i={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[l][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},c.end)},e[n][1].end=Object.assign({},o.start),e[l][1].start=Object.assign({},c.end),a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=ve(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=ve(a,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),a=ve(a,Ve(t.parser.constructs.insideSpan.null,e.slice(n+1,l),t)),a=ve(a,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",r,t]]),e[l][1].end.offset-e[l][1].start.offset?(s=2,a=ve(a,[["enter",e[l][1],t],["exit",e[l][1],t]])):s=0,xe(e,n-1,l-n+3,a),l=n+a.length-s-2;break}for(l=-1;++l { "use strict"; @@ -57370,30 +57164,19 @@ module.exports = rules; -// @ts-ignore -const { - directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math, - parse, postprocess, preprocess - // @ts-ignore -} = __nccwpck_require__(9520); -const { newLineRe } = __nccwpck_require__(7389); +const { flatTokensSymbol, htmlFlowSymbol } = __nccwpck_require__(7389); -const flatTokensSymbol = Symbol("flat-tokens"); -const reparseSymbol = Symbol("reparse"); - -/** @typedef {import("markdownlint-micromark").Event} Event */ -/** @typedef {import("markdownlint-micromark").ParseOptions} ParseOptions */ /** @typedef {import("markdownlint-micromark").TokenType} TokenType */ /** @typedef {import("../lib/markdownlint.js").MicromarkToken} Token */ /** - * Determines if a Micromark token is within an htmlFlow. + * Determines if a Micromark token is within an htmlFlow type. * * @param {Token} token Micromark token. - * @returns {boolean} True iff the token is within an htmlFlow. + * @returns {boolean} True iff the token is within an htmlFlow type. */ function inHtmlFlow(token) { - return token[reparseSymbol]; + return Boolean(token[htmlFlowSymbol]); } /** @@ -57425,180 +57208,6 @@ function isHtmlFlowComment(token) { return false; } -/** - * Parses a Markdown document and returns Micromark events. - * - * @param {string} markdown Markdown document. - * @param {ParseOptions} [micromarkOptions] Options for micromark. - * @param {boolean} [referencesDefined] Treat references as defined. - * @returns {Event[]} Micromark events. - */ -function getMicromarkEvents( - markdown, - micromarkOptions = {}, - referencesDefined = true -) { - - // Customize options object to add useful extensions - micromarkOptions.extensions = micromarkOptions.extensions || []; - micromarkOptions.extensions.push( - directive(), - gfmAutolinkLiteral(), - gfmFootnote(), - gfmTable(), - math() - ); - - // Use micromark to parse document into Events - const encoding = undefined; - const eol = true; - const parseContext = parse(micromarkOptions); - if (referencesDefined) { - // Customize ParseContext to treat all references as defined - parseContext.defined.includes = (searchElement) => searchElement.length > 0; - } - const chunks = preprocess()(markdown, encoding, eol); - const events = postprocess(parseContext.document().write(chunks)); - return events; -} - -/** - * Parses a Markdown document and returns (frozen) tokens. - * - * @param {string} markdown Markdown document. - * @param {ParseOptions} micromarkOptions Options for micromark. - * @param {boolean} referencesDefined Treat references as defined. - * @param {number} lineDelta Offset to apply to start/end line. - * @param {Token} [ancestor] Parent of top-most tokens. - * @returns {Token[]} Micromark tokens (frozen). - */ -function micromarkParseWithOffset( - markdown, - micromarkOptions, - referencesDefined, - lineDelta, - ancestor -) { - // Use micromark to parse document into Events - const events = getMicromarkEvents( - markdown, micromarkOptions, referencesDefined - ); - - // Create Token objects - const document = []; - let flatTokens = []; - /** @type {Token} */ - const root = { - "type": "data", - "startLine": -1, - "startColumn": -1, - "endLine": -1, - "endColumn": -1, - "text": "ROOT", - "children": document, - "parent": null - }; - const history = [ root ]; - let current = root; - // eslint-disable-next-line jsdoc/valid-types - /** @type ParseOptions | null */ - let reparseOptions = null; - let lines = null; - let skipHtmlFlowChildren = false; - for (const event of events) { - const [ kind, token, context ] = event; - const { type, start, end } = token; - const { "column": startColumn, "line": startLine } = start; - const { "column": endColumn, "line": endLine } = end; - const text = context.sliceSerialize(token); - if ((kind === "enter") && !skipHtmlFlowChildren) { - const previous = current; - history.push(previous); - current = { - type, - "startLine": startLine + lineDelta, - startColumn, - "endLine": endLine + lineDelta, - endColumn, - text, - "children": [], - "parent": ((previous === root) ? (ancestor || null) : previous) - }; - if (ancestor) { - Object.defineProperty(current, reparseSymbol, { "value": true }); - } - previous.children.push(current); - flatTokens.push(current); - if ((current.type === "htmlFlow") && !isHtmlFlowComment(current)) { - skipHtmlFlowChildren = true; - if (!reparseOptions || !lines) { - reparseOptions = { - ...micromarkOptions, - "extensions": [ - { - "disable": { - "null": [ "codeIndented", "htmlFlow" ] - } - } - ] - }; - lines = markdown.split(newLineRe); - } - const reparseMarkdown = lines - .slice(current.startLine - 1, current.endLine) - .join("\n"); - const tokens = micromarkParseWithOffset( - reparseMarkdown, - reparseOptions, - referencesDefined, - current.startLine - 1, - current - ); - current.children = tokens; - // Avoid stack overflow of Array.push(...spread) - // eslint-disable-next-line unicorn/prefer-spread - flatTokens = flatTokens.concat(tokens[flatTokensSymbol]); - } - } else if (kind === "exit") { - if (type === "htmlFlow") { - skipHtmlFlowChildren = false; - } - if (!skipHtmlFlowChildren) { - Object.freeze(current.children); - Object.freeze(current); - // @ts-ignore - current = history.pop(); - } - } - } - - // Return document - Object.defineProperty(document, flatTokensSymbol, { "value": flatTokens }); - Object.freeze(document); - return document; -} - -/** - * Parses a Markdown document and returns (frozen) tokens. - * - * @param {string} markdown Markdown document. - * @param {ParseOptions} [micromarkOptions] Options for micromark. - * @param {boolean} [referencesDefined] Treat references as defined. - * @returns {Token[]} Micromark tokens (frozen). - */ -function micromarkParse( - markdown, - micromarkOptions = {}, - referencesDefined = true -) { - return micromarkParseWithOffset( - markdown, - micromarkOptions, - referencesDefined, - 0 - ); -} - /** * Adds a range of numbers to a set. * @@ -57677,8 +57286,7 @@ function filterByPredicate(tokens, allowed, transformChildren) { * @returns {Token[]} Filtered tokens. */ function filterByTypes(tokens, types, htmlFlow) { - const predicate = (token) => - (htmlFlow || !inHtmlFlow(token)) && types.includes(token.type); + const predicate = (token) => types.includes(token.type) && (htmlFlow || !inHtmlFlow(token)); const flatTokens = tokens[flatTokensSymbol]; if (flatTokens) { return flatTokens.filter(predicate); @@ -57686,46 +57294,41 @@ function filterByTypes(tokens, types, htmlFlow) { return filterByPredicate(tokens, predicate); } +/** + * Gets the blockquote prefix text (if any) for the specified line number. + * + * @param {Token[]} tokens Micromark tokens. + * @param {number} lineNumber Line number to examine. + * @param {number} [count] Number of times to repeat. + * @returns {string} Blockquote prefix text. + */ +function getBlockQuotePrefixText(tokens, lineNumber, count = 1) { + return filterByTypes(tokens, [ "blockQuotePrefix", "linePrefix" ]) + .filter((prefix) => prefix.startLine === lineNumber) + .map((prefix) => prefix.text) + .join("") + .trimEnd() + // eslint-disable-next-line unicorn/prefer-spread + .concat("\n") + .repeat(count); +}; + /** * Gets a list of nested Micromark token descendants by type path. * * @param {Token|Token[]} parent Micromark token parent or parents. - * @param {TokenType[]} typePath Micromark token type path. + * @param {(TokenType|TokenType[])[]} typePath Micromark token type path. * @returns {Token[]} Micromark token descendants. */ function getDescendantsByType(parent, typePath) { let tokens = Array.isArray(parent) ? parent : [ parent ]; for (const type of typePath) { - tokens = tokens.flatMap((t) => t.children).filter((t) => t.type === type); + const predicate = (token) => Array.isArray(type) ? type.includes(token.type) : (type === token.type); + tokens = tokens.flatMap((t) => t.children.filter(predicate)); } return tokens; } -// eslint-disable-next-line jsdoc/valid-types -/** @typedef {readonly string[]} ReadonlyStringArray */ - -/** - * Gets the line/column/length exclusions for a Micromark token. - * - * @param {ReadonlyStringArray} lines File/string lines. - * @param {Token} token Micromark token. - * @returns {number[][]} Exclusions (line number, start column, length). - */ -function getExclusionsForToken(lines, token) { - const exclusions = []; - const { endColumn, endLine, startColumn, startLine } = token; - for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++) { - const start = (lineNumber === startLine) ? startColumn : 1; - const end = (lineNumber === endLine) ? endColumn : lines[lineNumber - 1].length; - exclusions.push([ - lineNumber, - start, - end - start + 1 - ]); - } - return exclusions; -} - /** * Gets the heading level of a Micromark heading tokan. * @@ -57733,12 +57336,12 @@ function getExclusionsForToken(lines, token) { * @returns {number} Heading level. */ function getHeadingLevel(heading) { - const headingSequence = filterByTypes( - heading.children, - [ "atxHeadingSequence", "setextHeadingLineSequence" ] - ); let level = 1; - const { text } = headingSequence[0]; + const headingSequence = heading.children.find( + (child) => [ "atxHeadingSequence", "setextHeadingLine" ].includes(child.type) + ); + // @ts-ignore + const { text } = headingSequence; if (text[0] === "#") { level = Math.min(text.length, 6); } else if (text[0] === "-") { @@ -57757,9 +57360,8 @@ function getHeadingStyle(heading) { if (heading.type === "setextHeading") { return "setext"; } - const atxHeadingSequenceLength = filterByTypes( - heading.children, - [ "atxHeadingSequence" ] + const atxHeadingSequenceLength = heading.children.filter( + (child) => child.type === "atxHeadingSequence" ).length; if (atxHeadingSequenceLength === 1) { return "atx"; @@ -57774,10 +57376,7 @@ function getHeadingStyle(heading) { * @returns {string} Heading text. */ function getHeadingText(heading) { - const headingTexts = filterByTypes( - heading.children, - [ "atxHeadingText", "setextHeadingText" ] - ); + const headingTexts = getDescendantsByType(heading, [ [ "atxHeadingText", "setextHeadingText" ] ]); return headingTexts[0]?.text.replace(/[\r\n]+/g, " ") || ""; } @@ -57818,7 +57417,7 @@ function getHtmlTagInfo(token) { * @param {TokenType[]} types Types to allow. * @returns {Token | null} Parent token. */ -function getTokenParentOfType(token, types) { +function getParentOfType(token, types) { /** @type {Token | null} */ let current = token; while ((current = current.parent) && !types.includes(current.type)) { @@ -57827,54 +57426,6 @@ function getTokenParentOfType(token, types) { return current; } -/** - * Get the text of the first match from a list of Micromark tokens by type. - * - * @param {Token[]} tokens Micromark tokens. - * @param {TokenType} type Type to match. - * @returns {string | null} Text of token. - */ -function getTokenTextByType(tokens, type) { - const filtered = tokens.filter((token) => token.type === type); - return (filtered.length > 0) ? filtered[0].text : null; -} - -/** - * Determines a list of Micromark tokens matches and returns a subset. - * - * @param {Token[]} tokens Micromark tokens. - * @param {TokenType[]} matchTypes Types to match. - * @param {TokenType[]} [resultTypes] Types to return. - * @returns {Token[] | null} Matching tokens. - */ -function matchAndGetTokensByType(tokens, matchTypes, resultTypes) { - if (tokens.length !== matchTypes.length) { - return null; - } - resultTypes = resultTypes || matchTypes; - const result = []; - // eslint-disable-next-line unicorn/no-for-loop - for (let i = 0; i < matchTypes.length; i++) { - if (tokens[i].type !== matchTypes[i]) { - return null; - } else if (resultTypes.includes(matchTypes[i])) { - result.push(tokens[i]); - } - } - return result; -} - -/** - * Returns the specified token iff it is of the desired type. - * - * @param {Token} token Micromark token candidate. - * @param {TokenType} type Desired type. - * @returns {Token | null} Token instance. - */ -function tokenIfType(token, type) { - return (token && (token.type === type)) ? token : null; -} - /** * Set containing token types that do not contain content. * @@ -57891,24 +57442,520 @@ const nonContentTokens = new Set([ ]); module.exports = { - "parse": micromarkParse, addRangeToSet, filterByPredicate, filterByTypes, + getBlockQuotePrefixText, getDescendantsByType, - getExclusionsForToken, getHeadingLevel, getHeadingStyle, getHeadingText, getHtmlTagInfo, - getMicromarkEvents, - getTokenParentOfType, - getTokenTextByType, + getParentOfType, inHtmlFlow, isHtmlFlowComment, - matchAndGetTokensByType, - nonContentTokens, - tokenIfType + nonContentTokens +}; + + +/***/ }), + +/***/ 7132: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// @ts-check + + + +const micromark = __nccwpck_require__(9520); +const { isHtmlFlowComment } = __nccwpck_require__(1670); +const { flatTokensSymbol, htmlFlowSymbol, newLineRe } = __nccwpck_require__(7389); + +/** @typedef {import("markdownlint-micromark").Construct} Construct */ +/** @typedef {import("markdownlint-micromark").Event} Event */ +/** @typedef {import("markdownlint-micromark").ParseOptions} MicromarkParseOptions */ +/** @typedef {import("markdownlint-micromark").State} State */ +/** @typedef {import("markdownlint-micromark").Token} Token */ +/** @typedef {import("markdownlint-micromark").Tokenizer} Tokenizer */ +/** @typedef {import("../lib/markdownlint.js").MicromarkToken} MicromarkToken */ + +/** + * Parse options. + * + * @typedef {Object} ParseOptions + * @property {boolean} [freezeTokens] Whether to freeze output Tokens. + */ + +/** + * Parses a Markdown document and returns Micromark events. + * + * @param {string} markdown Markdown document. + * @param {MicromarkParseOptions} [micromarkParseOptions] Options for micromark. + * @returns {Event[]} Micromark events. + */ +function getEvents( + markdown, + micromarkParseOptions = {} +) { + // Customize extensions list to add useful extensions + const extensions = [ + micromark.directive(), + micromark.gfmAutolinkLiteral(), + micromark.gfmFootnote(), + micromark.gfmTable(), + micromark.math(), + ...(micromarkParseOptions.extensions || []) + ]; + + // // Shim labelEnd to identify undefined link labels + /** @type {Event[][]} */ + const artificialEventLists = []; + /** @type {Construct} */ + const labelEnd = + // @ts-ignore + micromark.labelEnd; + const tokenizeOriginal = labelEnd.tokenize; + + /** @type {Tokenizer} */ + function tokenizeShim(effects, okOriginal, nokOriginal) { + // eslint-disable-next-line consistent-this, unicorn/no-this-assignment, no-invalid-this + const tokenizeContext = this; + const events = tokenizeContext.events; + + /** @type {State} */ + const nokShim = (code) => { + // Find start of label (image or link) + let indexStart = events.length; + while (--indexStart >= 0) { + const event = events[indexStart]; + const [ kind, token ] = event; + if (kind === "enter") { + const { type } = token; + if ((type === "labelImage") || (type === "labelLink")) { + // Found it + break; + } + } + } + + // If found... + if (indexStart >= 0) { + // Create artificial enter/exit events and replicate all data/lineEnding events within + const eventStart = events[indexStart]; + const [ , eventStartToken ] = eventStart; + const eventEnd = events[events.length - 1]; + const [ , eventEndToken ] = eventEnd; + /** @type {Token} */ + const undefinedReferenceType = { + "type": "undefinedReferenceShortcut", + "start": eventStartToken.start, + "end": eventEndToken.end + }; + /** @type {Token} */ + const undefinedReference = { + "type": "undefinedReference", + "start": eventStartToken.start, + "end": eventEndToken.end + }; + const eventsToReplicate = events + .slice(indexStart) + .filter((event) => { + const [ , eventToken ] = event; + const { type } = eventToken; + return (type === "data") || (type === "lineEnding"); + }); + + // Determine the type of the undefined reference + const previousUndefinedEvent = (artificialEventLists.length > 0) && artificialEventLists[artificialEventLists.length - 1][0]; + const previousUndefinedToken = previousUndefinedEvent && previousUndefinedEvent[1]; + if ( + previousUndefinedToken && + (previousUndefinedToken.end.line === undefinedReferenceType.start.line) && + (previousUndefinedToken.end.column === undefinedReferenceType.start.column) + ) { + // Previous undefined reference event is immediately before this one + if (eventsToReplicate.length === 0) { + // The pair represent a collapsed reference (ex: [...][]) + previousUndefinedToken.type = "undefinedReferenceCollapsed"; + previousUndefinedToken.end = eventEndToken.end; + } else { + // The pair represent a full reference (ex: [...][...]) + undefinedReferenceType.type = "undefinedReferenceFull"; + undefinedReferenceType.start = previousUndefinedToken.start; + artificialEventLists.pop(); + } + } + + // Create artificial event list and replicate content + const text = eventsToReplicate + .filter((event) => event[0] === "enter") + .map((event) => tokenizeContext.sliceSerialize(event[1])) + .join("") + .trim(); + if ((text.length > 0) && !text.includes("]")) { + /** @type {Event[]} */ + const artificialEvents = []; + artificialEvents.push( + [ "enter", undefinedReferenceType, tokenizeContext ], + [ "enter", undefinedReference, tokenizeContext ] + ); + for (const event of eventsToReplicate) { + const [ kind, token ] = event; + // Copy token because the current object will get modified by the parser + artificialEvents.push([ kind, { ...token }, tokenizeContext ]); + } + artificialEvents.push( + [ "exit", undefinedReference, tokenizeContext ], + [ "exit", undefinedReferenceType, tokenizeContext ] + ); + artificialEventLists.push(artificialEvents); + } + } + + // Continue with original behavior + return nokOriginal(code); + }; + + // Shim nok handler of labelEnd's tokenize + return tokenizeOriginal.call(tokenizeContext, effects, okOriginal, nokShim); + } + + try { + // Shim labelEnd behavior to detect undefined references + labelEnd.tokenize = tokenizeShim; + + // Use micromark to parse document into Events + const encoding = undefined; + const eol = true; + const parseContext = micromark.parse({ ...micromarkParseOptions, extensions }); + const chunks = micromark.preprocess()(markdown, encoding, eol); + const events = micromark.postprocess(parseContext.document().write(chunks)); + + // Append artificial events and return all events + // eslint-disable-next-line unicorn/prefer-spread + return events.concat(...artificialEventLists); + } finally { + // Restore shimmed labelEnd behavior + labelEnd.tokenize = tokenizeOriginal; + } +} + +/** + * Parses a Markdown document and returns micromark tokens (internal). + * + * @param {string} markdown Markdown document. + * @param {ParseOptions} [parseOptions] Options. + * @param {MicromarkParseOptions} [micromarkParseOptions] Options for micromark. + * @param {number} [lineDelta] Offset for start/end line. + * @param {MicromarkToken} [ancestor] Parent of top-most tokens. + * @returns {MicromarkToken[]} Micromark tokens. + */ +function parseInternal( + markdown, + parseOptions = {}, + micromarkParseOptions = {}, + lineDelta = 0, + ancestor = undefined +) { + // Get options + const freezeTokens = Boolean(parseOptions.freezeTokens); + + // Use micromark to parse document into Events + const events = getEvents(markdown, micromarkParseOptions); + + // Create Token objects + const document = []; + let flatTokens = []; + /** @type {MicromarkToken} */ + const root = { + "type": "data", + "startLine": -1, + "startColumn": -1, + "endLine": -1, + "endColumn": -1, + "text": "ROOT", + "children": document, + "parent": null + }; + const history = [ root ]; + let current = root; + // eslint-disable-next-line jsdoc/valid-types + /** @type MicromarkParseOptions | null */ + let reparseOptions = null; + let lines = null; + let skipHtmlFlowChildren = false; + for (const event of events) { + const [ kind, token, context ] = event; + const { type, start, end } = token; + const { "column": startColumn, "line": startLine } = start; + const { "column": endColumn, "line": endLine } = end; + const text = context.sliceSerialize(token); + if ((kind === "enter") && !skipHtmlFlowChildren) { + const previous = current; + history.push(previous); + current = { + type, + "startLine": startLine + lineDelta, + startColumn, + "endLine": endLine + lineDelta, + endColumn, + text, + "children": [], + "parent": ((previous === root) ? (ancestor || null) : previous) + }; + if (ancestor) { + Object.defineProperty(current, htmlFlowSymbol, { "value": true }); + } + previous.children.push(current); + flatTokens.push(current); + if ((current.type === "htmlFlow") && !isHtmlFlowComment(current)) { + skipHtmlFlowChildren = true; + if (!reparseOptions || !lines) { + reparseOptions = { + ...micromarkParseOptions, + "extensions": [ + { + "disable": { + "null": [ "codeIndented", "htmlFlow" ] + } + } + ] + }; + lines = markdown.split(newLineRe); + } + const reparseMarkdown = lines + .slice(current.startLine - 1, current.endLine) + .join("\n"); + const tokens = parseInternal( + reparseMarkdown, + parseOptions, + reparseOptions, + current.startLine - 1, + current + ); + current.children = tokens; + // Avoid stack overflow of Array.push(...spread) + // eslint-disable-next-line unicorn/prefer-spread + flatTokens = flatTokens.concat(tokens[flatTokensSymbol]); + } + } else if (kind === "exit") { + if (type === "htmlFlow") { + skipHtmlFlowChildren = false; + } + if (!skipHtmlFlowChildren) { + if (freezeTokens) { + Object.freeze(current.children); + Object.freeze(current); + } + // @ts-ignore + current = history.pop(); + } + } + } + + // Return document + Object.defineProperty(document, flatTokensSymbol, { "value": flatTokens }); + if (freezeTokens) { + Object.freeze(document); + } + return document; +} + +/** + * Parses a Markdown document and returns micromark tokens. + * + * @param {string} markdown Markdown document. + * @param {ParseOptions} [parseOptions] Options. + * @returns {MicromarkToken[]} Micromark tokens. + */ +function parse(markdown, parseOptions) { + return parseInternal(markdown, parseOptions); +} + +module.exports = { + getEvents, + parse +}; + + +/***/ }), + +/***/ 9917: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// @ts-check + + + +const { newLineRe } = __nccwpck_require__(8307); + +/** + * @callback InlineCodeSpanCallback + * @param {string} code Code content. + * @param {number} lineIndex Line index (0-based). + * @param {number} columnIndex Column index (0-based). + * @param {number} ticks Count of backticks. + * @returns {void} + */ + +/** + * Calls the provided function for each inline code span's content. + * + * @param {string} input Markdown content. + * @param {InlineCodeSpanCallback} handler Callback function taking (code, + * lineIndex, columnIndex, ticks). + * @returns {void} + */ +function forEachInlineCodeSpan(input, handler) { + const backtickRe = /`+/g; + let match = null; + const backticksLengthAndIndex = []; + while ((match = backtickRe.exec(input)) !== null) { + backticksLengthAndIndex.push([ match[0].length, match.index ]); + } + const newLinesIndex = []; + while ((match = newLineRe.exec(input)) !== null) { + newLinesIndex.push(match.index); + } + let lineIndex = 0; + let lineStartIndex = 0; + let k = 0; + for (let i = 0; i < backticksLengthAndIndex.length - 1; i++) { + const [ startLength, startIndex ] = backticksLengthAndIndex[i]; + if ((startIndex === 0) || (input[startIndex - 1] !== "\\")) { + for (let j = i + 1; j < backticksLengthAndIndex.length; j++) { + const [ endLength, endIndex ] = backticksLengthAndIndex[j]; + if (startLength === endLength) { + for (; k < newLinesIndex.length; k++) { + const newLineIndex = newLinesIndex[k]; + if (startIndex < newLineIndex) { + break; + } + lineIndex++; + lineStartIndex = newLineIndex + 1; + } + const columnIndex = startIndex - lineStartIndex + startLength; + handler( + input.slice(startIndex + startLength, endIndex), + lineIndex, + columnIndex, + startLength + ); + i = j; + break; + } + } + } + } +} + +/** + * Freeze all freeze-able members of a token and its children. + * + * @param {import("./markdownlint").MarkdownItToken} token A markdown-it token. + * @returns {void} + */ +function freezeToken(token) { + if (token.attrs) { + for (const attr of token.attrs) { + Object.freeze(attr); + } + Object.freeze(token.attrs); + } + if (token.children) { + for (const child of token.children) { + freezeToken(child); + } + Object.freeze(token.children); + } + if (token.map) { + Object.freeze(token.map); + } + Object.freeze(token); +} + +/** + * Annotate tokens with line/lineNumber and freeze them. + * + * @param {Object[]} tokens Array of markdown-it tokens. + * @param {string[]} lines Lines of Markdown content. + * @returns {void} + */ +function annotateAndFreezeTokens(tokens, lines) { + let trMap = null; + // eslint-disable-next-line jsdoc/valid-types + /** @type import("./markdownlint").MarkdownItToken[] */ + // @ts-ignore + const markdownItTokens = tokens; + for (const token of markdownItTokens) { + // Provide missing maps for table content + if (token.type === "tr_open") { + trMap = token.map; + } else if (token.type === "tr_close") { + trMap = null; + } + if (!token.map && trMap) { + token.map = [ ...trMap ]; + } + // Update token metadata + if (token.map) { + token.line = lines[token.map[0]]; + token.lineNumber = token.map[0] + 1; + // Trim bottom of token to exclude whitespace lines + while (token.map[1] && !((lines[token.map[1] - 1] || "").trim())) { + token.map[1]--; + } + } + // Annotate children with lineNumber + if (token.children) { + const codeSpanExtraLines = []; + if (token.children.some((child) => child.type === "code_inline")) { + forEachInlineCodeSpan(token.content, (code) => { + codeSpanExtraLines.push(code.split(newLineRe).length - 1); + }); + } + let lineNumber = token.lineNumber; + for (const child of token.children) { + child.lineNumber = lineNumber; + child.line = lines[lineNumber - 1]; + if ((child.type === "softbreak") || (child.type === "hardbreak")) { + lineNumber++; + } else if (child.type === "code_inline") { + lineNumber += codeSpanExtraLines.shift(); + } + } + } + freezeToken(token); + } + Object.freeze(tokens); +} + +/** + * Gets an array of markdown-it tokens for the input. + * + * @param {import("./markdownlint").Plugin[]} markdownItPlugins Additional plugins. + * @param {string} content Markdown content. + * @param {string[]} lines Lines of Markdown content. + * @returns {import("../lib/markdownlint").MarkdownItToken} Array of markdown-it tokens. + */ +function getMarkdownItTokens(markdownItPlugins, content, lines) { + const markdownit = __nccwpck_require__(5182); + const md = markdownit({ "html": true }); + for (const plugin of markdownItPlugins) { + // @ts-ignore + md.use(...plugin); + } + const tokens = md.parse(content, {}); + annotateAndFreezeTokens(tokens, lines); + // @ts-ignore + return tokens; +}; + +module.exports = { + forEachInlineCodeSpan, + getMarkdownItTokens };