function L() {
	return {
		async: !1,
		breaks: !1,
		extensions: null,
		gfm: !0,
		hooks: null,
		pedantic: !1,
		renderer: null,
		silent: !1,
		tokenizer: null,
		walkTokens: null
	};
}
var T = L();
function G(e) {
	T = e;
}
var E = { exec: () => null };
function d(e, l = "") {
	let u = typeof e == "string" ? e : e.source, f = {
		replace: (e, l) => {
			let p = typeof l == "string" ? l : l.source;
			return p = p.replace(m.caret, "$1"), u = u.replace(e, p), f;
		},
		getRegex: () => new RegExp(u, l)
	};
	return f;
}
var be = (() => {
	try {
		return !0;
	} catch {
		return !1;
	}
})(), m = {
	codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
	outputLinkReplace: /\\([\[\]])/g,
	indentCodeCompensation: /^(\s+)(?:```)/,
	beginningSpace: /^\s+/,
	endingHash: /#$/,
	startingSpaceChar: /^ /,
	endingSpaceChar: / $/,
	nonSpaceChar: /[^ ]/,
	newLineCharGlobal: /\n/g,
	tabCharGlobal: /\t/g,
	multipleSpaceGlobal: /\s+/g,
	blankLine: /^[ \t]*$/,
	doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
	blockquoteStart: /^ {0,3}>/,
	blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
	blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
	listReplaceTabs: /^\t+/,
	listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
	listIsTask: /^\[[ xX]\] /,
	listReplaceTask: /^\[[ xX]\] +/,
	anyLine: /\n.*\n/,
	hrefBrackets: /^<(.*)>$/,
	tableDelimiter: /[:|]/,
	tableAlignChars: /^\||\| *$/g,
	tableRowBlankLine: /\n[ \t]*$/,
	tableAlignRight: /^ *-+: *$/,
	tableAlignCenter: /^ *:-+: *$/,
	tableAlignLeft: /^ *:-+ *$/,
	startATag: /^<a /i,
	endATag: /^<\/a>/i,
	startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
	endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
	startAngleBracket: /^</,
	endAngleBracket: />$/,
	pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
	unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
	escapeTest: /[&<>"']/,
	escapeReplace: /[&<>"']/g,
	escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
	escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
	unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
	caret: /(^|[^\[])\^/g,
	percentDecode: /%25/g,
	findPipe: /\|/g,
	splitPipe: / \|/,
	slashPipe: /\\\|/g,
	carriageReturn: /\r\n|\r/g,
	spaceLine: /^ +$/gm,
	notSpaceStart: /^\S*/,
	endingNewline: /\n$/,
	listItemRegex: (e) => /* @__PURE__ */ RegExp(`^( {0,3}${e})((?:[	 ][^\\n]*)?(?:\\n|$))`),
	nextBulletRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),
	hrRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
	fencesBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
	headingBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
	htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
}, Re = /^(?:[ \t]*(?:\n|$))+/, Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, oe = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ye = d(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Pe = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), K = {
	blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(),
	code: Te,
	def: Se,
	fences: Oe,
	heading: we,
	hr: I,
	html: _e,
	lheading: oe,
	list: $e,
	newline: Re,
	paragraph: ae,
	table: E,
	text: Pe
}, re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}	)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Me = {
	...K,
	lheading: ye,
	table: re,
	paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
}, ze = {
	...K,
	html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
	def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
	heading: /^(#{1,6})(.*)(?:\n+|$)/,
	fences: E,
	lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
	paragraph: d(j).replace("hr", I).replace("heading", " *#{1,6} *[^\n]").replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, De = d(ce, "u").replace(/punct/g, D).getRegex(), He = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ze = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ge = d(he, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex(), Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), je = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qe = d(U).replace("(?:-->|$)", "-->").getRegex(), Ue = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = {
	_backpedal: E,
	anyPunctuation: Fe,
	autolink: je,
	blockSkip: ve,
	br: le,
	code: Ee,
	del: E,
	emStrongLDelim: De,
	emStrongRDelimAst: Ze,
	emStrongRDelimUnd: Ne,
	escape: Ae,
	link: Ke,
	nolink: ke,
	punctuation: Ce,
	reflink: de,
	reflinkSearch: We,
	tag: Ue,
	text: Ie,
	url: E
}, Xe = {
	...X,
	link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
	reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
}, N = {
	...X,
	emStrongRDelimAst: Ge,
	emStrongLDelim: He,
	url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
	_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
	del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
	text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex()
}, Je = {
	...N,
	br: d(le).replace("{2,}", "*").getRegex(),
	text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, C = {
	normal: K,
	gfm: Me,
	pedantic: ze
}, M = {
	normal: X,
	gfm: N,
	breaks: Je,
	pedantic: Xe
}, Ve = {
	"&": "&amp;",
	"<": "&lt;",
	">": "&gt;",
	"\"": "&quot;",
	"'": "&#39;"
}, ge = (e) => Ve[e];
function w(e, l) {
	if (l) {
		if (m.escapeTest.test(e)) return e.replace(m.escapeReplace, ge);
	} else if (m.escapeTestNoEncode.test(e)) return e.replace(m.escapeReplaceNoEncode, ge);
	return e;
}
function J(e) {
	try {
		e = encodeURI(e).replace(m.percentDecode, "%");
	} catch {
		return null;
	}
	return e;
}
function V(e, l) {
	let u = e.replace(m.findPipe, (e, l, u) => {
		let f = !1, p = l;
		for (; --p >= 0 && u[p] === "\\";) f = !f;
		return f ? "|" : " |";
	}).split(m.splitPipe), f = 0;
	if (u[0].trim() || u.shift(), u.length > 0 && !u.at(-1)?.trim() && u.pop(), l) if (u.length > l) u.splice(l);
	else for (; u.length < l;) u.push("");
	for (; f < u.length; f++) u[f] = u[f].trim().replace(m.slashPipe, "|");
	return u;
}
function z(e, l, u) {
	let f = e.length;
	if (f === 0) return "";
	let p = 0;
	for (; p < f;) {
		let h = e.charAt(f - p - 1);
		if (h === l && !u) p++;
		else if (h !== l && u) p++;
		else break;
	}
	return e.slice(0, f - p);
}
function fe(e, l) {
	if (e.indexOf(l[1]) === -1) return -1;
	let u = 0;
	for (let f = 0; f < e.length; f++) if (e[f] === "\\") f++;
	else if (e[f] === l[0]) u++;
	else if (e[f] === l[1] && (u--, u < 0)) return f;
	return u > 0 ? -2 : -1;
}
function me(e, l, u, f, p) {
	let h = l.href, g = l.title || null, O = e[1].replace(p.other.outputLinkReplace, "$1");
	f.state.inLink = !0;
	let A = {
		type: e[0].charAt(0) === "!" ? "image" : "link",
		raw: u,
		href: h,
		title: g,
		text: O,
		tokens: f.inlineTokens(O)
	};
	return f.state.inLink = !1, A;
}
function Ye(e, l, u) {
	let f = e.match(u.other.indentCodeCompensation);
	if (f === null) return l;
	let p = f[1];
	return l.split("\n").map((e) => {
		let l = e.match(u.other.beginningSpace);
		if (l === null) return e;
		let [f] = l;
		return f.length >= p.length ? e.slice(p.length) : e;
	}).join("\n");
}
var y = class {
	options;
	rules;
	lexer;
	constructor(e) {
		this.options = e || T;
	}
	space(e) {
		let l = this.rules.block.newline.exec(e);
		if (l && l[0].length > 0) return {
			type: "space",
			raw: l[0]
		};
	}
	code(e) {
		let l = this.rules.block.code.exec(e);
		if (l) {
			let e = l[0].replace(this.rules.other.codeRemoveIndent, "");
			return {
				type: "code",
				raw: l[0],
				codeBlockStyle: "indented",
				text: this.options.pedantic ? e : z(e, "\n")
			};
		}
	}
	fences(e) {
		let l = this.rules.block.fences.exec(e);
		if (l) {
			let e = l[0], u = Ye(e, l[3] || "", this.rules);
			return {
				type: "code",
				raw: e,
				lang: l[2] ? l[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : l[2],
				text: u
			};
		}
	}
	heading(e) {
		let l = this.rules.block.heading.exec(e);
		if (l) {
			let e = l[2].trim();
			if (this.rules.other.endingHash.test(e)) {
				let l = z(e, "#");
				(this.options.pedantic || !l || this.rules.other.endingSpaceChar.test(l)) && (e = l.trim());
			}
			return {
				type: "heading",
				raw: l[0],
				depth: l[1].length,
				text: e,
				tokens: this.lexer.inline(e)
			};
		}
	}
	hr(e) {
		let l = this.rules.block.hr.exec(e);
		if (l) return {
			type: "hr",
			raw: z(l[0], "\n")
		};
	}
	blockquote(e) {
		let l = this.rules.block.blockquote.exec(e);
		if (l) {
			let e = z(l[0], "\n").split("\n"), u = "", f = "", p = [];
			for (; e.length > 0;) {
				let l = !1, h = [], g;
				for (g = 0; g < e.length; g++) if (this.rules.other.blockquoteStart.test(e[g])) h.push(e[g]), l = !0;
				else if (!l) h.push(e[g]);
				else break;
				e = e.slice(g);
				let O = h.join("\n"), A = O.replace(this.rules.other.blockquoteSetextReplace, "\n    $1").replace(this.rules.other.blockquoteSetextReplace2, "");
				u = u ? `${u}
${O}` : O, f = f ? `${f}
${A}` : A;
				let R = this.lexer.state.top;
				if (this.lexer.state.top = !0, this.lexer.blockTokens(A, p, !0), this.lexer.state.top = R, e.length === 0) break;
				let B = p.at(-1);
				if (B?.type === "code") break;
				if (B?.type === "blockquote") {
					let l = B, h = l.raw + "\n" + e.join("\n"), g = this.blockquote(h);
					p[p.length - 1] = g, u = u.substring(0, u.length - l.raw.length) + g.raw, f = f.substring(0, f.length - l.text.length) + g.text;
					break;
				} else if (B?.type === "list") {
					let l = B, h = l.raw + "\n" + e.join("\n"), g = this.list(h);
					p[p.length - 1] = g, u = u.substring(0, u.length - B.raw.length) + g.raw, f = f.substring(0, f.length - l.raw.length) + g.raw, e = h.substring(p.at(-1).raw.length).split("\n");
					continue;
				}
			}
			return {
				type: "blockquote",
				raw: u,
				tokens: p,
				text: f
			};
		}
	}
	list(e) {
		let l = this.rules.block.list.exec(e);
		if (l) {
			let u = l[1].trim(), f = u.length > 1, p = {
				type: "list",
				raw: "",
				ordered: f,
				start: f ? +u.slice(0, -1) : "",
				loose: !1,
				items: []
			};
			u = f ? `\\d{1,9}\\${u.slice(-1)}` : `\\${u}`, this.options.pedantic && (u = f ? u : "[*+-]");
			let h = this.rules.other.listItemRegex(u), g = !1;
			for (; e;) {
				let u = !1, f = "", O = "";
				if (!(l = h.exec(e)) || this.rules.block.hr.test(e)) break;
				f = l[0], e = e.substring(f.length);
				let A = l[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), R = e.split("\n", 1)[0], B = !A.trim(), H = 0;
				if (this.options.pedantic ? (H = 2, O = A.trimStart()) : B ? H = l[1].length + 1 : (H = l[2].search(this.rules.other.nonSpaceChar), H = H > 4 ? 1 : H, O = A.slice(H), H += l[1].length), B && this.rules.other.blankLine.test(R) && (f += R + "\n", e = e.substring(R.length + 1), u = !0), !u) {
					let l = this.rules.other.nextBulletRegex(H), u = this.rules.other.hrRegex(H), p = this.rules.other.fencesBeginRegex(H), h = this.rules.other.headingBeginRegex(H), g = this.rules.other.htmlBeginRegex(H);
					for (; e;) {
						let Y = e.split("\n", 1)[0], Z;
						if (R = Y, this.options.pedantic ? (R = R.replace(this.rules.other.listReplaceNesting, "  "), Z = R) : Z = R.replace(this.rules.other.tabCharGlobal, "    "), p.test(R) || h.test(R) || g.test(R) || l.test(R) || u.test(R)) break;
						if (Z.search(this.rules.other.nonSpaceChar) >= H || !R.trim()) O += "\n" + Z.slice(H);
						else {
							if (B || A.replace(this.rules.other.tabCharGlobal, "    ").search(this.rules.other.nonSpaceChar) >= 4 || p.test(A) || h.test(A) || u.test(A)) break;
							O += "\n" + R;
						}
						!B && !R.trim() && (B = !0), f += Y + "\n", e = e.substring(Y.length + 1), A = Z.slice(H);
					}
				}
				p.loose || (g ? p.loose = !0 : this.rules.other.doubleBlankLine.test(f) && (g = !0));
				let Y = null, Z;
				this.options.gfm && (Y = this.rules.other.listIsTask.exec(O), Y && (Z = Y[0] !== "[ ] ", O = O.replace(this.rules.other.listReplaceTask, ""))), p.items.push({
					type: "list_item",
					raw: f,
					task: !!Y,
					checked: Z,
					loose: !1,
					text: O,
					tokens: []
				}), p.raw += f;
			}
			let O = p.items.at(-1);
			if (O) O.raw = O.raw.trimEnd(), O.text = O.text.trimEnd();
			else return;
			p.raw = p.raw.trimEnd();
			for (let e = 0; e < p.items.length; e++) if (this.lexer.state.top = !1, p.items[e].tokens = this.lexer.blockTokens(p.items[e].text, []), !p.loose) {
				let l = p.items[e].tokens.filter((e) => e.type === "space");
				p.loose = l.length > 0 && l.some((e) => this.rules.other.anyLine.test(e.raw));
			}
			if (p.loose) for (let e = 0; e < p.items.length; e++) p.items[e].loose = !0;
			return p;
		}
	}
	html(e) {
		let l = this.rules.block.html.exec(e);
		if (l) return {
			type: "html",
			block: !0,
			raw: l[0],
			pre: l[1] === "pre" || l[1] === "script" || l[1] === "style",
			text: l[0]
		};
	}
	def(e) {
		let l = this.rules.block.def.exec(e);
		if (l) {
			let e = l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), u = l[2] ? l[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", f = l[3] ? l[3].substring(1, l[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : l[3];
			return {
				type: "def",
				tag: e,
				raw: l[0],
				href: u,
				title: f
			};
		}
	}
	table(e) {
		let l = this.rules.block.table.exec(e);
		if (!l || !this.rules.other.tableDelimiter.test(l[2])) return;
		let u = V(l[1]), f = l[2].replace(this.rules.other.tableAlignChars, "").split("|"), p = l[3]?.trim() ? l[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], h = {
			type: "table",
			raw: l[0],
			header: [],
			align: [],
			rows: []
		};
		if (u.length === f.length) {
			for (let e of f) this.rules.other.tableAlignRight.test(e) ? h.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? h.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? h.align.push("left") : h.align.push(null);
			for (let e = 0; e < u.length; e++) h.header.push({
				text: u[e],
				tokens: this.lexer.inline(u[e]),
				header: !0,
				align: h.align[e]
			});
			for (let e of p) h.rows.push(V(e, h.header.length).map((e, l) => ({
				text: e,
				tokens: this.lexer.inline(e),
				header: !1,
				align: h.align[l]
			})));
			return h;
		}
	}
	lheading(e) {
		let l = this.rules.block.lheading.exec(e);
		if (l) return {
			type: "heading",
			raw: l[0],
			depth: l[2].charAt(0) === "=" ? 1 : 2,
			text: l[1],
			tokens: this.lexer.inline(l[1])
		};
	}
	paragraph(e) {
		let l = this.rules.block.paragraph.exec(e);
		if (l) {
			let e = l[1].charAt(l[1].length - 1) === "\n" ? l[1].slice(0, -1) : l[1];
			return {
				type: "paragraph",
				raw: l[0],
				text: e,
				tokens: this.lexer.inline(e)
			};
		}
	}
	text(e) {
		let l = this.rules.block.text.exec(e);
		if (l) return {
			type: "text",
			raw: l[0],
			text: l[0],
			tokens: this.lexer.inline(l[0])
		};
	}
	escape(e) {
		let l = this.rules.inline.escape.exec(e);
		if (l) return {
			type: "escape",
			raw: l[0],
			text: l[1]
		};
	}
	tag(e) {
		let l = this.rules.inline.tag.exec(e);
		if (l) return !this.lexer.state.inLink && this.rules.other.startATag.test(l[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(l[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(l[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(l[0]) && (this.lexer.state.inRawBlock = !1), {
			type: "html",
			raw: l[0],
			inLink: this.lexer.state.inLink,
			inRawBlock: this.lexer.state.inRawBlock,
			block: !1,
			text: l[0]
		};
	}
	link(e) {
		let l = this.rules.inline.link.exec(e);
		if (l) {
			let e = l[2].trim();
			if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
				if (!this.rules.other.endAngleBracket.test(e)) return;
				let l = z(e.slice(0, -1), "\\");
				if ((e.length - l.length) % 2 == 0) return;
			} else {
				let e = fe(l[2], "()");
				if (e === -2) return;
				if (e > -1) {
					let u = (l[0].indexOf("!") === 0 ? 5 : 4) + l[1].length + e;
					l[2] = l[2].substring(0, e), l[0] = l[0].substring(0, u).trim(), l[3] = "";
				}
			}
			let u = l[2], f = "";
			if (this.options.pedantic) {
				let e = this.rules.other.pedanticHrefTitle.exec(u);
				e && (u = e[1], f = e[3]);
			} else f = l[3] ? l[3].slice(1, -1) : "";
			return u = u.trim(), this.rules.other.startAngleBracket.test(u) && (u = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? u.slice(1) : u.slice(1, -1)), me(l, {
				href: u && u.replace(this.rules.inline.anyPunctuation, "$1"),
				title: f && f.replace(this.rules.inline.anyPunctuation, "$1")
			}, l[0], this.lexer, this.rules);
		}
	}
	reflink(e, l) {
		let u;
		if ((u = this.rules.inline.reflink.exec(e)) || (u = this.rules.inline.nolink.exec(e))) {
			let e = l[(u[2] || u[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
			if (!e) {
				let e = u[0].charAt(0);
				return {
					type: "text",
					raw: e,
					text: e
				};
			}
			return me(u, e, u[0], this.lexer, this.rules);
		}
	}
	emStrong(e, l, u = "") {
		let f = this.rules.inline.emStrongLDelim.exec(e);
		if (!(!f || f[3] && u.match(this.rules.other.unicodeAlphaNumeric)) && (!(f[1] || f[2]) || !u || this.rules.inline.punctuation.exec(u))) {
			let u = [...f[0]].length - 1, p, h, g = u, O = 0, A = f[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
			for (A.lastIndex = 0, l = l.slice(-1 * e.length + u); (f = A.exec(l)) != null;) {
				if (p = f[1] || f[2] || f[3] || f[4] || f[5] || f[6], !p) continue;
				if (h = [...p].length, f[3] || f[4]) {
					g += h;
					continue;
				} else if ((f[5] || f[6]) && u % 3 && !((u + h) % 3)) {
					O += h;
					continue;
				}
				if (g -= h, g > 0) continue;
				h = Math.min(h, h + g + O);
				let l = [...f[0]][0].length, A = e.slice(0, u + f.index + l + h);
				if (Math.min(u, h) % 2) {
					let e = A.slice(1, -1);
					return {
						type: "em",
						raw: A,
						text: e,
						tokens: this.lexer.inlineTokens(e)
					};
				}
				let R = A.slice(2, -2);
				return {
					type: "strong",
					raw: A,
					text: R,
					tokens: this.lexer.inlineTokens(R)
				};
			}
		}
	}
	codespan(e) {
		let l = this.rules.inline.code.exec(e);
		if (l) {
			let e = l[2].replace(this.rules.other.newLineCharGlobal, " "), u = this.rules.other.nonSpaceChar.test(e), f = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
			return u && f && (e = e.substring(1, e.length - 1)), {
				type: "codespan",
				raw: l[0],
				text: e
			};
		}
	}
	br(e) {
		let l = this.rules.inline.br.exec(e);
		if (l) return {
			type: "br",
			raw: l[0]
		};
	}
	del(e) {
		let l = this.rules.inline.del.exec(e);
		if (l) return {
			type: "del",
			raw: l[0],
			text: l[2],
			tokens: this.lexer.inlineTokens(l[2])
		};
	}
	autolink(e) {
		let l = this.rules.inline.autolink.exec(e);
		if (l) {
			let e, u;
			return l[2] === "@" ? (e = l[1], u = "mailto:" + e) : (e = l[1], u = e), {
				type: "link",
				raw: l[0],
				text: e,
				href: u,
				tokens: [{
					type: "text",
					raw: e,
					text: e
				}]
			};
		}
	}
	url(e) {
		let l;
		if (l = this.rules.inline.url.exec(e)) {
			let e, u;
			if (l[2] === "@") e = l[0], u = "mailto:" + e;
			else {
				let f;
				do
					f = l[0], l[0] = this.rules.inline._backpedal.exec(l[0])?.[0] ?? "";
				while (f !== l[0]);
				e = l[0], u = l[1] === "www." ? "http://" + l[0] : l[0];
			}
			return {
				type: "link",
				raw: l[0],
				text: e,
				href: u,
				tokens: [{
					type: "text",
					raw: e,
					text: e
				}]
			};
		}
	}
	inlineText(e) {
		let l = this.rules.inline.text.exec(e);
		if (l) {
			let e = this.lexer.state.inRawBlock;
			return {
				type: "text",
				raw: l[0],
				text: l[0],
				escaped: e
			};
		}
	}
}, x = class e {
	tokens;
	options;
	state;
	tokenizer;
	inlineQueue;
	constructor(e) {
		this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
			inLink: !1,
			inRawBlock: !1,
			top: !0
		};
		let u = {
			other: m,
			block: C.normal,
			inline: M.normal
		};
		this.options.pedantic ? (u.block = C.pedantic, u.inline = M.pedantic) : this.options.gfm && (u.block = C.gfm, this.options.breaks ? u.inline = M.breaks : u.inline = M.gfm), this.tokenizer.rules = u;
	}
	static get rules() {
		return {
			block: C,
			inline: M
		};
	}
	static lex(l, u) {
		return new e(u).lex(l);
	}
	static lexInline(l, u) {
		return new e(u).inlineTokens(l);
	}
	lex(e) {
		e = e.replace(m.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
		for (let e = 0; e < this.inlineQueue.length; e++) {
			let l = this.inlineQueue[e];
			this.inlineTokens(l.src, l.tokens);
		}
		return this.inlineQueue = [], this.tokens;
	}
	blockTokens(e, l = [], u = !1) {
		for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, "    ").replace(m.spaceLine, "")); e;) {
			let f;
			if (this.options.extensions?.block?.some((u) => (f = u.call({ lexer: this }, e, l)) ? (e = e.substring(f.raw.length), l.push(f), !0) : !1)) continue;
			if (f = this.tokenizer.space(e)) {
				e = e.substring(f.raw.length);
				let u = l.at(-1);
				f.raw.length === 1 && u !== void 0 ? u.raw += "\n" : l.push(f);
				continue;
			}
			if (f = this.tokenizer.code(e)) {
				e = e.substring(f.raw.length);
				let u = l.at(-1);
				u?.type === "paragraph" || u?.type === "text" ? (u.raw += (u.raw.endsWith("\n") ? "" : "\n") + f.raw, u.text += "\n" + f.text, this.inlineQueue.at(-1).src = u.text) : l.push(f);
				continue;
			}
			if (f = this.tokenizer.fences(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.heading(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.hr(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.blockquote(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.list(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.html(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.def(e)) {
				e = e.substring(f.raw.length);
				let u = l.at(-1);
				u?.type === "paragraph" || u?.type === "text" ? (u.raw += (u.raw.endsWith("\n") ? "" : "\n") + f.raw, u.text += "\n" + f.raw, this.inlineQueue.at(-1).src = u.text) : this.tokens.links[f.tag] || (this.tokens.links[f.tag] = {
					href: f.href,
					title: f.title
				}, l.push(f));
				continue;
			}
			if (f = this.tokenizer.table(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.lheading(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			let p = e;
			if (this.options.extensions?.startBlock) {
				let l = Infinity, u = e.slice(1), f;
				this.options.extensions.startBlock.forEach((e) => {
					f = e.call({ lexer: this }, u), typeof f == "number" && f >= 0 && (l = Math.min(l, f));
				}), l < Infinity && l >= 0 && (p = e.substring(0, l + 1));
			}
			if (this.state.top && (f = this.tokenizer.paragraph(p))) {
				let h = l.at(-1);
				u && h?.type === "paragraph" ? (h.raw += (h.raw.endsWith("\n") ? "" : "\n") + f.raw, h.text += "\n" + f.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = h.text) : l.push(f), u = p.length !== e.length, e = e.substring(f.raw.length);
				continue;
			}
			if (f = this.tokenizer.text(e)) {
				e = e.substring(f.raw.length);
				let u = l.at(-1);
				u?.type === "text" ? (u.raw += (u.raw.endsWith("\n") ? "" : "\n") + f.raw, u.text += "\n" + f.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text) : l.push(f);
				continue;
			}
			if (e) {
				let l = "Infinite loop on byte: " + e.charCodeAt(0);
				if (this.options.silent) {
					console.error(l);
					break;
				} else throw Error(l);
			}
		}
		return this.state.top = !0, l;
	}
	inline(e, l = []) {
		return this.inlineQueue.push({
			src: e,
			tokens: l
		}), l;
	}
	inlineTokens(e, l = []) {
		let u = e, f = null;
		if (this.tokens.links) {
			let e = Object.keys(this.tokens.links);
			if (e.length > 0) for (; (f = this.tokenizer.rules.inline.reflinkSearch.exec(u)) != null;) e.includes(f[0].slice(f[0].lastIndexOf("[") + 1, -1)) && (u = u.slice(0, f.index) + "[" + "a".repeat(f[0].length - 2) + "]" + u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
		}
		for (; (f = this.tokenizer.rules.inline.anyPunctuation.exec(u)) != null;) u = u.slice(0, f.index) + "++" + u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
		let p;
		for (; (f = this.tokenizer.rules.inline.blockSkip.exec(u)) != null;) p = f[2] ? f[2].length : 0, u = u.slice(0, f.index + p) + "[" + "a".repeat(f[0].length - p - 2) + "]" + u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
		u = this.options.hooks?.emStrongMask?.call({ lexer: this }, u) ?? u;
		let h = !1, g = "";
		for (; e;) {
			h || (g = ""), h = !1;
			let f;
			if (this.options.extensions?.inline?.some((u) => (f = u.call({ lexer: this }, e, l)) ? (e = e.substring(f.raw.length), l.push(f), !0) : !1)) continue;
			if (f = this.tokenizer.escape(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.tag(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.link(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.reflink(e, this.tokens.links)) {
				e = e.substring(f.raw.length);
				let u = l.at(-1);
				f.type === "text" && u?.type === "text" ? (u.raw += f.raw, u.text += f.text) : l.push(f);
				continue;
			}
			if (f = this.tokenizer.emStrong(e, u, g)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.codespan(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.br(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.del(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (f = this.tokenizer.autolink(e)) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			if (!this.state.inLink && (f = this.tokenizer.url(e))) {
				e = e.substring(f.raw.length), l.push(f);
				continue;
			}
			let p = e;
			if (this.options.extensions?.startInline) {
				let l = Infinity, u = e.slice(1), f;
				this.options.extensions.startInline.forEach((e) => {
					f = e.call({ lexer: this }, u), typeof f == "number" && f >= 0 && (l = Math.min(l, f));
				}), l < Infinity && l >= 0 && (p = e.substring(0, l + 1));
			}
			if (f = this.tokenizer.inlineText(p)) {
				e = e.substring(f.raw.length), f.raw.slice(-1) !== "_" && (g = f.raw.slice(-1)), h = !0;
				let u = l.at(-1);
				u?.type === "text" ? (u.raw += f.raw, u.text += f.text) : l.push(f);
				continue;
			}
			if (e) {
				let l = "Infinite loop on byte: " + e.charCodeAt(0);
				if (this.options.silent) {
					console.error(l);
					break;
				} else throw Error(l);
			}
		}
		return l;
	}
}, P = class {
	options;
	parser;
	constructor(e) {
		this.options = e || T;
	}
	space(e) {
		return "";
	}
	code({ text: e, lang: l, escaped: u }) {
		let f = (l || "").match(m.notSpaceStart)?.[0], p = e.replace(m.endingNewline, "") + "\n";
		return f ? "<pre><code class=\"language-" + w(f) + "\">" + (u ? p : w(p, !0)) + "</code></pre>\n" : "<pre><code>" + (u ? p : w(p, !0)) + "</code></pre>\n";
	}
	blockquote({ tokens: e }) {
		return `<blockquote>
${this.parser.parse(e)}</blockquote>
`;
	}
	html({ text: e }) {
		return e;
	}
	def(e) {
		return "";
	}
	heading({ tokens: e, depth: l }) {
		return `<h${l}>${this.parser.parseInline(e)}</h${l}>
`;
	}
	hr(e) {
		return "<hr>\n";
	}
	list(e) {
		let l = e.ordered, u = e.start, f = "";
		for (let l = 0; l < e.items.length; l++) {
			let u = e.items[l];
			f += this.listitem(u);
		}
		let p = l ? "ol" : "ul", h = l && u !== 1 ? " start=\"" + u + "\"" : "";
		return "<" + p + h + ">\n" + f + "</" + p + ">\n";
	}
	listitem(e) {
		let l = "";
		if (e.task) {
			let u = this.checkbox({ checked: !!e.checked });
			e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = u + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = u + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
				type: "text",
				raw: u + " ",
				text: u + " ",
				escaped: !0
			}) : l += u + " ";
		}
		return l += this.parser.parse(e.tokens, !!e.loose), `<li>${l}</li>
`;
	}
	checkbox({ checked: e }) {
		return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
	}
	paragraph({ tokens: e }) {
		return `<p>${this.parser.parseInline(e)}</p>
`;
	}
	table(e) {
		let l = "", u = "";
		for (let l = 0; l < e.header.length; l++) u += this.tablecell(e.header[l]);
		l += this.tablerow({ text: u });
		let f = "";
		for (let l = 0; l < e.rows.length; l++) {
			let p = e.rows[l];
			u = "";
			for (let e = 0; e < p.length; e++) u += this.tablecell(p[e]);
			f += this.tablerow({ text: u });
		}
		return f &&= `<tbody>${f}</tbody>`, "<table>\n<thead>\n" + l + "</thead>\n" + f + "</table>\n";
	}
	tablerow({ text: e }) {
		return `<tr>
${e}</tr>
`;
	}
	tablecell(e) {
		let l = this.parser.parseInline(e.tokens), u = e.header ? "th" : "td";
		return (e.align ? `<${u} align="${e.align}">` : `<${u}>`) + l + `</${u}>
`;
	}
	strong({ tokens: e }) {
		return `<strong>${this.parser.parseInline(e)}</strong>`;
	}
	em({ tokens: e }) {
		return `<em>${this.parser.parseInline(e)}</em>`;
	}
	codespan({ text: e }) {
		return `<code>${w(e, !0)}</code>`;
	}
	br(e) {
		return "<br>";
	}
	del({ tokens: e }) {
		return `<del>${this.parser.parseInline(e)}</del>`;
	}
	link({ href: e, title: l, tokens: u }) {
		let f = this.parser.parseInline(u), p = J(e);
		if (p === null) return f;
		e = p;
		let h = "<a href=\"" + e + "\"";
		return l && (h += " title=\"" + w(l) + "\""), h += ">" + f + "</a>", h;
	}
	image({ href: e, title: l, text: u, tokens: f }) {
		f && (u = this.parser.parseInline(f, this.parser.textRenderer));
		let p = J(e);
		if (p === null) return w(u);
		e = p;
		let h = `<img src="${e}" alt="${u}"`;
		return l && (h += ` title="${w(l)}"`), h += ">", h;
	}
	text(e) {
		return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
	}
}, $ = class {
	strong({ text: e }) {
		return e;
	}
	em({ text: e }) {
		return e;
	}
	codespan({ text: e }) {
		return e;
	}
	del({ text: e }) {
		return e;
	}
	html({ text: e }) {
		return e;
	}
	text({ text: e }) {
		return e;
	}
	link({ text: e }) {
		return "" + e;
	}
	image({ text: e }) {
		return "" + e;
	}
	br() {
		return "";
	}
}, b = class e {
	options;
	renderer;
	textRenderer;
	constructor(e) {
		this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
	}
	static parse(l, u) {
		return new e(u).parse(l);
	}
	static parseInline(l, u) {
		return new e(u).parseInline(l);
	}
	parse(e, l = !0) {
		let u = "";
		for (let f = 0; f < e.length; f++) {
			let p = e[f];
			if (this.options.extensions?.renderers?.[p.type]) {
				let e = p, l = this.options.extensions.renderers[e.type].call({ parser: this }, e);
				if (l !== !1 || ![
					"space",
					"hr",
					"heading",
					"code",
					"table",
					"blockquote",
					"list",
					"html",
					"def",
					"paragraph",
					"text"
				].includes(e.type)) {
					u += l || "";
					continue;
				}
			}
			let h = p;
			switch (h.type) {
				case "space":
					u += this.renderer.space(h);
					continue;
				case "hr":
					u += this.renderer.hr(h);
					continue;
				case "heading":
					u += this.renderer.heading(h);
					continue;
				case "code":
					u += this.renderer.code(h);
					continue;
				case "table":
					u += this.renderer.table(h);
					continue;
				case "blockquote":
					u += this.renderer.blockquote(h);
					continue;
				case "list":
					u += this.renderer.list(h);
					continue;
				case "html":
					u += this.renderer.html(h);
					continue;
				case "def":
					u += this.renderer.def(h);
					continue;
				case "paragraph":
					u += this.renderer.paragraph(h);
					continue;
				case "text": {
					let p = h, g = this.renderer.text(p);
					for (; f + 1 < e.length && e[f + 1].type === "text";) p = e[++f], g += "\n" + this.renderer.text(p);
					l ? u += this.renderer.paragraph({
						type: "paragraph",
						raw: g,
						text: g,
						tokens: [{
							type: "text",
							raw: g,
							text: g,
							escaped: !0
						}]
					}) : u += g;
					continue;
				}
				default: {
					let e = "Token with \"" + h.type + "\" type was not found.";
					if (this.options.silent) return console.error(e), "";
					throw Error(e);
				}
			}
		}
		return u;
	}
	parseInline(e, l = this.renderer) {
		let u = "";
		for (let f = 0; f < e.length; f++) {
			let p = e[f];
			if (this.options.extensions?.renderers?.[p.type]) {
				let e = this.options.extensions.renderers[p.type].call({ parser: this }, p);
				if (e !== !1 || ![
					"escape",
					"html",
					"link",
					"image",
					"strong",
					"em",
					"codespan",
					"br",
					"del",
					"text"
				].includes(p.type)) {
					u += e || "";
					continue;
				}
			}
			let h = p;
			switch (h.type) {
				case "escape":
					u += l.text(h);
					break;
				case "html":
					u += l.html(h);
					break;
				case "link":
					u += l.link(h);
					break;
				case "image":
					u += l.image(h);
					break;
				case "strong":
					u += l.strong(h);
					break;
				case "em":
					u += l.em(h);
					break;
				case "codespan":
					u += l.codespan(h);
					break;
				case "br":
					u += l.br(h);
					break;
				case "del":
					u += l.del(h);
					break;
				case "text":
					u += l.text(h);
					break;
				default: {
					let e = "Token with \"" + h.type + "\" type was not found.";
					if (this.options.silent) return console.error(e), "";
					throw Error(e);
				}
			}
		}
		return u;
	}
}, S = class {
	options;
	block;
	constructor(e) {
		this.options = e || T;
	}
	static passThroughHooks = new Set([
		"preprocess",
		"postprocess",
		"processAllTokens",
		"emStrongMask"
	]);
	static passThroughHooksRespectAsync = new Set([
		"preprocess",
		"postprocess",
		"processAllTokens"
	]);
	preprocess(e) {
		return e;
	}
	postprocess(e) {
		return e;
	}
	processAllTokens(e) {
		return e;
	}
	emStrongMask(e) {
		return e;
	}
	provideLexer() {
		return this.block ? x.lex : x.lexInline;
	}
	provideParser() {
		return this.block ? b.parse : b.parseInline;
	}
}, _ = new class {
	defaults = L();
	options = this.setOptions;
	parse = this.parseMarkdown(!0);
	parseInline = this.parseMarkdown(!1);
	Parser = b;
	Renderer = P;
	TextRenderer = $;
	Lexer = x;
	Tokenizer = y;
	Hooks = S;
	constructor(...e) {
		this.use(...e);
	}
	walkTokens(e, l) {
		let u = [];
		for (let f of e) switch (u = u.concat(l.call(this, f)), f.type) {
			case "table": {
				let e = f;
				for (let f of e.header) u = u.concat(this.walkTokens(f.tokens, l));
				for (let f of e.rows) for (let e of f) u = u.concat(this.walkTokens(e.tokens, l));
				break;
			}
			case "list": {
				let e = f;
				u = u.concat(this.walkTokens(e.items, l));
				break;
			}
			default: {
				let e = f;
				this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((f) => {
					let p = e[f].flat(Infinity);
					u = u.concat(this.walkTokens(p, l));
				}) : e.tokens && (u = u.concat(this.walkTokens(e.tokens, l)));
			}
		}
		return u;
	}
	use(...e) {
		let l = this.defaults.extensions || {
			renderers: {},
			childTokens: {}
		};
		return e.forEach((e) => {
			let u = { ...e };
			if (u.async = this.defaults.async || u.async || !1, e.extensions && (e.extensions.forEach((e) => {
				if (!e.name) throw Error("extension name required");
				if ("renderer" in e) {
					let u = l.renderers[e.name];
					u ? l.renderers[e.name] = function(...l) {
						let f = e.renderer.apply(this, l);
						return f === !1 && (f = u.apply(this, l)), f;
					} : l.renderers[e.name] = e.renderer;
				}
				if ("tokenizer" in e) {
					if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
					let u = l[e.level];
					u ? u.unshift(e.tokenizer) : l[e.level] = [e.tokenizer], e.start && (e.level === "block" ? l.startBlock ? l.startBlock.push(e.start) : l.startBlock = [e.start] : e.level === "inline" && (l.startInline ? l.startInline.push(e.start) : l.startInline = [e.start]));
				}
				"childTokens" in e && e.childTokens && (l.childTokens[e.name] = e.childTokens);
			}), u.extensions = l), e.renderer) {
				let l = this.defaults.renderer || new P(this.defaults);
				for (let u in e.renderer) {
					if (!(u in l)) throw Error(`renderer '${u}' does not exist`);
					if (["options", "parser"].includes(u)) continue;
					let f = u, p = e.renderer[f], h = l[f];
					l[f] = (...e) => {
						let u = p.apply(l, e);
						return u === !1 && (u = h.apply(l, e)), u || "";
					};
				}
				u.renderer = l;
			}
			if (e.tokenizer) {
				let l = this.defaults.tokenizer || new y(this.defaults);
				for (let u in e.tokenizer) {
					if (!(u in l)) throw Error(`tokenizer '${u}' does not exist`);
					if ([
						"options",
						"rules",
						"lexer"
					].includes(u)) continue;
					let f = u, p = e.tokenizer[f], h = l[f];
					l[f] = (...e) => {
						let u = p.apply(l, e);
						return u === !1 && (u = h.apply(l, e)), u;
					};
				}
				u.tokenizer = l;
			}
			if (e.hooks) {
				let l = this.defaults.hooks || new S();
				for (let u in e.hooks) {
					if (!(u in l)) throw Error(`hook '${u}' does not exist`);
					if (["options", "block"].includes(u)) continue;
					let f = u, p = e.hooks[f], h = l[f];
					S.passThroughHooks.has(u) ? l[f] = (e) => {
						if (this.defaults.async && S.passThroughHooksRespectAsync.has(u)) return (async () => {
							let u = await p.call(l, e);
							return h.call(l, u);
						})();
						let f = p.call(l, e);
						return h.call(l, f);
					} : l[f] = (...e) => {
						if (this.defaults.async) return (async () => {
							let u = await p.apply(l, e);
							return u === !1 && (u = await h.apply(l, e)), u;
						})();
						let u = p.apply(l, e);
						return u === !1 && (u = h.apply(l, e)), u;
					};
				}
				u.hooks = l;
			}
			if (e.walkTokens) {
				let l = this.defaults.walkTokens, f = e.walkTokens;
				u.walkTokens = function(e) {
					let u = [];
					return u.push(f.call(this, e)), l && (u = u.concat(l.call(this, e))), u;
				};
			}
			this.defaults = {
				...this.defaults,
				...u
			};
		}), this;
	}
	setOptions(e) {
		return this.defaults = {
			...this.defaults,
			...e
		}, this;
	}
	lexer(e, l) {
		return x.lex(e, l ?? this.defaults);
	}
	parser(e, l) {
		return b.parse(e, l ?? this.defaults);
	}
	parseMarkdown(e) {
		return (l, u) => {
			let f = { ...u }, p = {
				...this.defaults,
				...f
			}, h = this.onError(!!p.silent, !!p.async);
			if (this.defaults.async === !0 && f.async === !1) return h(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
			if (typeof l > "u" || l === null) return h(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
			if (typeof l != "string") return h(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(l) + ", string expected"));
			if (p.hooks && (p.hooks.options = p, p.hooks.block = e), p.async) return (async () => {
				let u = p.hooks ? await p.hooks.preprocess(l) : l, f = await (p.hooks ? await p.hooks.provideLexer() : e ? x.lex : x.lexInline)(u, p), h = p.hooks ? await p.hooks.processAllTokens(f) : f;
				p.walkTokens && await Promise.all(this.walkTokens(h, p.walkTokens));
				let g = await (p.hooks ? await p.hooks.provideParser() : e ? b.parse : b.parseInline)(h, p);
				return p.hooks ? await p.hooks.postprocess(g) : g;
			})().catch(h);
			try {
				p.hooks && (l = p.hooks.preprocess(l));
				let u = (p.hooks ? p.hooks.provideLexer() : e ? x.lex : x.lexInline)(l, p);
				p.hooks && (u = p.hooks.processAllTokens(u)), p.walkTokens && this.walkTokens(u, p.walkTokens);
				let f = (p.hooks ? p.hooks.provideParser() : e ? b.parse : b.parseInline)(u, p);
				return p.hooks && (f = p.hooks.postprocess(f)), f;
			} catch (e) {
				return h(e);
			}
		};
	}
	onError(e, l) {
		return (u) => {
			if (u.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
				let e = "<p>An error occurred:</p><pre>" + w(u.message + "", !0) + "</pre>";
				return l ? Promise.resolve(e) : e;
			}
			if (l) return Promise.reject(u);
			throw u;
		};
	}
}();
function k(e, l) {
	return _.parse(e, l);
}
k.options = k.setOptions = function(e) {
	return _.setOptions(e), k.defaults = _.defaults, G(k.defaults), k;
}, k.getDefaults = L, k.defaults = T, k.use = function(...e) {
	return _.use(...e), k.defaults = _.defaults, G(k.defaults), k;
}, k.walkTokens = function(e, l) {
	return _.walkTokens(e, l);
}, k.parseInline = _.parseInline, k.Parser = b, k.parser = b.parse, k.Renderer = P, k.TextRenderer = $, k.Lexer = x, k.lexer = x.lex, k.Tokenizer = y, k.Hooks = S, k.parse = k, k.options, k.setOptions, k.use, k.walkTokens, k.parseInline, b.parse, x.lex;
export { k };
