import{reporter as c}from"../../../tools/notifiers/reporter.js";import{getNodeAttribute as a}from"../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as m}from"../markdoc/helpers/set-node-attribute-value.js";import{FileNotFoundError as p,resolveSrcSet as u}from"../../../utils/index.js";import{getLinkOriginalAttrName as g}from"./utils.js";import{MdResolveError as v}from"./md-resolve-error.js";async function k(t,e,l,{actions:{contentDir:n,outdir:s},context:f}){if(a(t,e)){const i=g(e),o=t[i]||a(t,e);if(t[i]=o,!o)return;try{const r=await u(o,f.fs,{fromFileRelativePath:l,contentDir:n,outdir:s});m(t,e,r)}catch(r){if(r instanceof p)throw new v(`File ${r.filePath} does not exist`,{rawLink:r.filePath,link:r.filePath});c.panicOnBuild(`Cannot resolve 'srcSet' attribute: ${r.message}`)}}}export{k as resolveImageSrcSet};
