import { markdownLineEnding as e, markdownSpace as t } from "../../micromark-util-character/index.js";
import { factorySpace as n } from "../../micromark-factory-space/index.js";
//#region ../../node_modules/micromark-core-commonmark/lib/thematic-break.js
var r = {
	name: "thematicBreak",
	tokenize: i
};
function i(r, i, a) {
	let o = 0, s;
	return c;
	function c(e) {
		return r.enter("thematicBreak"), l(e);
	}
	function l(e) {
		return s = e, u(e);
	}
	function u(t) {
		return t === s ? (r.enter("thematicBreakSequence"), d(t)) : o >= 3 && (t === null || e(t)) ? (r.exit("thematicBreak"), i(t)) : a(t);
	}
	function d(e) {
		return e === s ? (r.consume(e), o++, d) : (r.exit("thematicBreakSequence"), t(e) ? n(r, u, "whitespace")(e) : u(e));
	}
}
//#endregion
export { r as thematicBreak };
