"use client";
import { normalizeUri as o } from "../../../micromark-util-sanitize-uri/index.js";
import { revert as p } from "../revert.js";
function m(i, t) {
  const l = String(t.identifier).toUpperCase(), e = i.definitionById.get(l);
  if (!e)
    return p(i, t);
  const r = { src: o(e.url || ""), alt: t.alt };
  e.title !== null && e.title !== void 0 && (r.title = e.title);
  const n = { type: "element", tagName: "img", properties: r, children: [] };
  return i.patch(t, n), i.applyData(t, n);
}
export {
  m as imageReference
};
