import { __module as u } from "../../../../../_virtual/index13.js";
var _;
function b() {
  if (_) return u.exports;
  _ = 1;
  const d = typeof Buffer < "u", a = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, l = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
  function p(r, o, e) {
    e == null && o !== null && typeof o == "object" && (e = o, o = void 0), d && Buffer.isBuffer(r) && (r = r.toString()), r && r.charCodeAt(0) === 65279 && (r = r.slice(1));
    const t = JSON.parse(r, o);
    if (t === null || typeof t != "object")
      return t;
    const n = e && e.protoAction || "error", c = e && e.constructorAction || "error";
    if (n === "ignore" && c === "ignore")
      return t;
    if (n !== "ignore" && c !== "ignore") {
      if (a.test(r) === !1 && l.test(r) === !1)
        return t;
    } else if (n !== "ignore" && c === "ignore") {
      if (a.test(r) === !1)
        return t;
    } else if (l.test(r) === !1)
      return t;
    return y(t, { protoAction: n, constructorAction: c, safe: e && e.safe });
  }
  function y(r, { protoAction: o = "error", constructorAction: e = "error", safe: t } = {}) {
    let n = [r];
    for (; n.length; ) {
      const c = n;
      n = [];
      for (const s of c) {
        if (o !== "ignore" && Object.prototype.hasOwnProperty.call(s, "__proto__")) {
          if (t === !0)
            return null;
          if (o === "error")
            throw new SyntaxError("Object contains forbidden prototype property");
          delete s.__proto__;
        }
        if (e !== "ignore" && Object.prototype.hasOwnProperty.call(s, "constructor") && Object.prototype.hasOwnProperty.call(s.constructor, "prototype")) {
          if (t === !0)
            return null;
          if (e === "error")
            throw new SyntaxError("Object contains forbidden prototype property");
          delete s.constructor;
        }
        for (const m in s) {
          const i = s[m];
          i && typeof i == "object" && n.push(i);
        }
      }
    }
    return r;
  }
  function f(r, o, e) {
    const t = Error.stackTraceLimit;
    Error.stackTraceLimit = 0;
    try {
      return p(r, o, e);
    } finally {
      Error.stackTraceLimit = t;
    }
  }
  function h(r, o) {
    const e = Error.stackTraceLimit;
    Error.stackTraceLimit = 0;
    try {
      return p(r, o, { safe: !0 });
    } catch {
      return null;
    } finally {
      Error.stackTraceLimit = e;
    }
  }
  return u.exports = f, u.exports.default = f, u.exports.parse = f, u.exports.safeParse = h, u.exports.scan = y, u.exports;
}
export {
  b as __require
};
//# sourceMappingURL=index.js.map
