function u(o, f, s) {
  let p, i, r, l;
  const d = o.posMax, n = o.pos;
  for (o.pos = f + 1, p = 1; o.pos < d; ) {
    if (r = o.src.charCodeAt(o.pos), r === 93 && (p--, p === 0)) {
      i = !0;
      break;
    }
    if (l = o.pos, o.md.inline.skipToken(o), r === 91) {
      if (l === o.pos - 1)
        p++;
      else if (s)
        return o.pos = n, -1;
    }
  }
  let e = -1;
  return i && (e = o.pos), o.pos = n, e;
}
export {
  u as default
};
