import l from "escape-html";
import { LINK_PLUGIN as f } from "../../Plugins/LinkPlugin/id.es.js";
import { reactCssPropsToCss as o } from "../utils/reactCssPropsToCss.es.js";
const u = (r, a, s, $) => {
  var e;
  if (r.chosenLink) {
    const { chosenLink: t } = r;
    return `<a dir="auto" class="${s}" style="${o($[f])}" target=${t != null && t.openInNewTab ? "_blank" : "_self"} href="${l((e = t == null ? void 0 : t.searchResult) == null ? void 0 : e.link)}">${a}</a>`;
  }
  const p = (r == null ? void 0 : r.target) ?? "_self";
  return `<a dir="auto" class="${s}" style="${o($[f])}" target="${p}" href="${l(r.url)}">${a}</a>`;
};
export {
  u as linkNode
};
//# sourceMappingURL=link.es.js.map
