import { __require as c } from "./at-rule.js";
import { __require as d } from "./comment.js";
import { __require as w } from "./declaration.js";
import { __require as R } from "./input.js";
import { __require as v } from "./previous-map.js";
import { __require as A } from "./root.js";
import { __require as I } from "./rule.js";
var p, l;
function F() {
  if (l) return p;
  l = 1;
  let m = c(), a = d(), f = w(), _ = R(), s = v(), q = A(), y = I();
  function o(u, i) {
    if (Array.isArray(u)) return u.map((r) => o(r));
    let { inputs: n, ...e } = u;
    if (n) {
      i = [];
      for (let r of n) {
        let t = { ...r, __proto__: _.prototype };
        t.map && (t.map = {
          ...t.map,
          __proto__: s.prototype
        }), i.push(t);
      }
    }
    if (e.nodes && (e.nodes = u.nodes.map((r) => o(r, i))), e.source) {
      let { inputId: r, ...t } = e.source;
      e.source = t, r != null && (e.source.input = i[r]);
    }
    if (e.type === "root")
      return new q(e);
    if (e.type === "decl")
      return new f(e);
    if (e.type === "rule")
      return new y(e);
    if (e.type === "comment")
      return new a(e);
    if (e.type === "atrule")
      return new m(e);
    throw new Error("Unknown node type: " + u.type);
  }
  return p = o, o.default = o, p;
}
export {
  F as __require
};
//# sourceMappingURL=fromJSON.js.map
