import{s as n}from"../../../../_virtual/source-map-generator.mjs";const e=new Set(["Atrule","Selector","Declaration"]);function o(o){const t=new n.SourceMapGenerator,l={line:1,column:0},c={line:0,column:0},r={line:1,column:0},i={generated:r};let a=1,u=0,s=!1;const m=o.node;o.node=function(n){if(n.loc&&n.loc.start&&e.has(n.type)){const e=n.loc.start.line,o=n.loc.start.column-1;c.line===e&&c.column===o||(c.line=e,c.column=o,l.line=a,l.column=u,s&&(s=!1,l.line===r.line&&l.column===r.column||t.addMapping(i)),s=!0,t.addMapping({source:n.loc.source,original:c,generated:l}))}m.call(this,n),s&&e.has(n.type)&&(r.line=a,r.column=u)};const p=o.emit;o.emit=function(n,e,o){for(let e=0;e<n.length;e++)10===n.charCodeAt(e)?(a++,u=0):u++;p(n,e,o)};const d=o.result;return o.result=function(){return s&&t.addMapping(i),{css:d(),map:t}},o}export{o as generateSourceMap};