import { parseDef as a } from "../parseDef.js";
const o = (t) => "type" in t && t.type === "string" ? !1 : "allOf" in t;
function p(t, n) {
  const f = [
    a(t.left._def, {
      ...n,
      currentPath: [...n.currentPath, "allOf", "0"]
    }),
    a(t.right._def, {
      ...n,
      currentPath: [...n.currentPath, "allOf", "1"]
    })
  ].filter((e) => !!e);
  let l = n.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0;
  const r = [];
  return f.forEach((e) => {
    if (o(e))
      r.push(...e.allOf), e.unevaluatedProperties === void 0 && (l = void 0);
    else {
      let i = e;
      if ("additionalProperties" in e && e.additionalProperties === !1) {
        const { additionalProperties: u, ...d } = e;
        i = d;
      } else
        l = void 0;
      r.push(i);
    }
  }), r.length ? {
    allOf: r,
    ...l
  } : void 0;
}
export {
  p as parseIntersectionDef
};
//# sourceMappingURL=intersection.js.map
