"use client";
function h(t) {
  return (l, c = {}) => {
    const n = l.match(t.matchPattern);
    if (!n) return null;
    const u = n[0], a = l.match(t.parsePattern);
    if (!a) return null;
    let e = t.valueCallback ? t.valueCallback(a[0]) : a[0];
    e = c.valueCallback ? c.valueCallback(e) : e;
    const r = l.slice(u.length);
    return { value: e, rest: r };
  };
}
export {
  h as buildMatchPatternFn
};
