"use client";
function f(a, e) {
  const s = e.referenceType;
  let l = "]";
  if (s === "collapsed" ? l += "[]" : s === "full" && (l += "[" + (e.label || e.identifier) + "]"), e.type === "imageReference")
    return [{ type: "text", value: "![" + e.alt + l }];
  const t = a.all(e), u = t[0];
  u && u.type === "text" ? u.value = "[" + u.value : t.unshift({ type: "text", value: "[" });
  const i = t[t.length - 1];
  return i && i.type === "text" ? i.value += l : t.push({ type: "text", value: l }), t;
}
export {
  f as revert
};
