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