var i = Object.defineProperty;
var m = (r, t) => i(r, "name", { value: t, configurable: !0 });
import { ensureAnchor as s } from "./ensureAnchor.js";
import { getLineAtPosition as a } from "./getLineAtPosition.js";
function x(r, t, f) {
  const o = a(r, t), n = Math.max(o.from, t - 250), c = o.text.slice(n - o.from, t - o.from), e = c.search(s(f));
  return e < 0 ? null : { from: n + e, to: t, text: c.slice(e) };
}
m(x, "matchBefore");
export {
  x as matchBefore
};
