"use client";
import { factorySpace as o } from "../../micromark-factory-space/index.js";
import { markdownSpace as B, markdownLineEnding as c } from "../../micromark-util-character/index.js";
const q = {
  name: "thematicBreak",
  tokenize: p
};
function p(e, u, m) {
  let i = 0, r;
  return k;
  function k(t) {
    return e.enter("thematicBreak"), h(t);
  }
  function h(t) {
    return r = t, n(t);
  }
  function n(t) {
    return t === r ? (e.enter("thematicBreakSequence"), a(t)) : i >= 3 && (t === null || c(t)) ? (e.exit("thematicBreak"), u(t)) : m(t);
  }
  function a(t) {
    return t === r ? (e.consume(t), i++, a) : (e.exit("thematicBreakSequence"), B(t) ? o(e, n, "whitespace")(t) : n(t));
  }
}
export {
  q as thematicBreak
};
