import{d as c}from"./vendor-mdast-util-definitions-CBjSIrGZ.js";import{v as u}from"./vendor-unist-util-visit-8PRsQcuP.js";import{S as n}from"./vendor-unist-util-visit-parents-BHoKBdZX.js";function s(){return function(f){const l=c(f);u(f,function(i,e,r){if(i.type==="definition"&&r!==void 0&&typeof e=="number")return r.children.splice(e,1),[n,e];if(i.type==="imageReference"||i.type==="linkReference"){const t=l(i.identifier);if(t&&r&&typeof e=="number")return r.children[e]=i.type==="imageReference"?{type:"image",url:t.url,title:t.title,alt:i.alt}:{type:"link",url:t.url,title:t.title,children:i.children},[n,e]}})}}export{s as r};
