import{getNodeAttribute as m}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as l}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{optimize as p}from"../../../../compiled/svgo/svgo-node.js";import{slug as c}from"../../../utils/index.js";import{MdResolveError as d}from"./md-resolve-error.js";import{resolvePathInMarkdown as u}from"../resolve-path-in-markdown.js";async function b(o,r,n,{context:i,actions:s}){const e=m(o,r),a=s.contentDir;if(e){const t=u(e,n,a);if(!i.fs.exists(t))throw new d(`File ${t} does not exist`,{rawLink:e});let f=p(await i.fs.read(t),{plugins:[{name:"prefixIds",params:{prefix:c(t).replaceAll(/[\/\.]/g,"-")}}]}).data;l(o,r+"RawContent",f)}}export{b as resolveSvgContent};
