import{getNodeAttribute as l,setNodeAttributeValue as m}from"../../../../shared/markdoc.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 A(o,r,n,{context:i,actions:a}){const e=l(o,r),s=a.contentDir;if(e){const t=u(e,n,s);if(!await 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;m(o,r+"RawContent",f)}}export{A as resolveSvgContent};
