import { checkQuote as l } from "../util/check-quote.es.js";
function a(o, m, t, n) {
  const f = l(t), u = f === '"' ? "Quote" : "Apostrophe", c = t.enter("definition");
  let i = t.enter("label");
  const e = t.createTracker(n);
  let r = e.move("[");
  return r += e.move(
    t.safe(t.associationId(o), {
      before: r,
      after: "]",
      ...e.current()
    })
  ), r += e.move("]: "), i(), // If there’s no url, or…
  !o.url || // If there are control characters or whitespace.
  /[\0- \u007F]/.test(o.url) ? (i = t.enter("destinationLiteral"), r += e.move("<"), r += e.move(
    t.safe(o.url, { before: r, after: ">", ...e.current() })
  ), r += e.move(">")) : (i = t.enter("destinationRaw"), r += e.move(
    t.safe(o.url, {
      before: r,
      after: o.title ? " " : `
`,
      ...e.current()
    })
  )), i(), o.title && (i = t.enter(`title${u}`), r += e.move(" " + f), r += e.move(
    t.safe(o.title, {
      before: r,
      after: f,
      ...e.current()
    })
  ), r += e.move(f), i()), c(), r;
}
export {
  a as definition
};
//# sourceMappingURL=definition.es.js.map
