import { parseJsonPointerSegments as i } from "@scalar/helpers/json/parse-json-pointer-segments";
const o = (r) => {
  const t = r.trim();
  if (t.startsWith("/"))
    return t;
  if (t.startsWith("#")) {
    const s = t.slice(1);
    return s.startsWith("/") ? s : null;
  }
  const n = t.indexOf("#");
  if (n === -1)
    return null;
  const e = t.slice(n + 1);
  return e.startsWith("/") ? e : null;
}, c = (r) => {
  const t = o(r);
  return t ? i(t) : null;
};
export {
  c as parseJsonPointerPath
};
