import { __exports as o } from "../../../../../../../../_virtual/defaults.js";
import { __require as g } from "../codegen/index.js";
import { __require as m } from "../util.js";
var l;
function y() {
  if (l) return o;
  l = 1, Object.defineProperty(o, "__esModule", { value: !0 }), o.assignDefaults = void 0;
  const e = g(), d = m();
  function _(r, n) {
    const { properties: t, items: u } = r.schema;
    if (n === "object" && t)
      for (const i in t)
        c(r, i, t[i].default);
    else n === "array" && Array.isArray(u) && u.forEach((i, a) => c(r, a, i.default));
  }
  o.assignDefaults = _;
  function c(r, n, t) {
    const { gen: u, compositeRule: i, data: a, opts: p } = r;
    if (t === void 0)
      return;
    const s = (0, e._)`${a}${(0, e.getProperty)(n)}`;
    if (i) {
      (0, d.checkStrictMode)(r, `default is ignored for: ${s}`);
      return;
    }
    let f = (0, e._)`${s} === undefined`;
    p.useDefaults === "empty" && (f = (0, e._)`${f} || ${s} === null || ${s} === ""`), u.if(f, (0, e._)`${s} = ${(0, e.stringify)(t)}`);
  }
  return o;
}
export {
  y as __require
};
//# sourceMappingURL=defaults.js.map
