var Mh = Object.defineProperty;
var Es = (n) => {
  throw TypeError(n);
};
var zh = (n, e, t) => e in n ? Mh(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
var Ue = (n, e, t) => zh(n, typeof e != "symbol" ? e + "" : e, t), hi = (n, e, t) => e.has(n) || Es("Cannot " + t);
var qr = (n, e, t) => (hi(n, e, "read from private field"), t ? t.call(n) : e.get(n)), di = (n, e, t) => e.has(n) ? Es("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Cs = (n, e, t, r) => (hi(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), jn = (n, e, t) => (hi(n, e, "access private method"), t);
const {
  SvelteComponent: Bh,
  append_hydration: ol,
  assign: Lh,
  attr: kt,
  binding_callbacks: Rh,
  children: bn,
  claim_element: u1,
  claim_space: c1,
  claim_svg_element: fi,
  create_slot: qh,
  detach: C0,
  element: h1,
  empty: Ts,
  get_all_dirty_from_scope: Ih,
  get_slot_changes: Nh,
  get_spread_update: Oh,
  init: Ph,
  insert_hydration: An,
  listen: Hh,
  noop: Uh,
  safe_not_equal: Gh,
  set_dynamic_element_data: Fs,
  set_style: Be,
  space: d1,
  svg_element: mi,
  toggle_class: pt,
  transition_in: f1,
  transition_out: m1,
  update_slot_base: Vh
} = window.__gradio__svelte__internal;
function $s(n) {
  let e, t, r, a, i;
  return {
    c() {
      e = mi("svg"), t = mi("line"), r = mi("line"), this.h();
    },
    l(l) {
      e = fi(l, "svg", { class: !0, xmlns: !0, viewBox: !0 });
      var s = bn(e);
      t = fi(s, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), bn(t).forEach(C0), r = fi(s, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), bn(r).forEach(C0), s.forEach(C0), this.h();
    },
    h() {
      kt(t, "x1", "1"), kt(t, "y1", "9"), kt(t, "x2", "9"), kt(t, "y2", "1"), kt(t, "stroke", "gray"), kt(t, "stroke-width", "0.5"), kt(r, "x1", "5"), kt(r, "y1", "9"), kt(r, "x2", "9"), kt(r, "y2", "5"), kt(r, "stroke", "gray"), kt(r, "stroke-width", "0.5"), kt(e, "class", "resize-handle svelte-239wnu"), kt(e, "xmlns", "http://www.w3.org/2000/svg"), kt(e, "viewBox", "0 0 10 10");
    },
    m(l, s) {
      An(l, e, s), ol(e, t), ol(e, r), a || (i = Hh(
        e,
        "mousedown",
        /*resize*/
        n[27]
      ), a = !0);
    },
    p: Uh,
    d(l) {
      l && C0(e), a = !1, i();
    }
  };
}
function jh(n) {
  var f;
  let e, t, r, a, i;
  const l = (
    /*#slots*/
    n[31].default
  ), s = qh(
    l,
    n,
    /*$$scope*/
    n[30],
    null
  );
  let o = (
    /*resizable*/
    n[19] && $s(n)
  ), u = [
    { "data-testid": (
      /*test_id*/
      n[11]
    ) },
    { id: (
      /*elem_id*/
      n[6]
    ) },
    {
      class: r = "block " + /*elem_classes*/
      (((f = n[7]) == null ? void 0 : f.join(" ")) || "") + " svelte-239wnu"
    },
    {
      dir: a = /*rtl*/
      n[20] ? "rtl" : "ltr"
    }
  ], h = {};
  for (let p = 0; p < u.length; p += 1)
    h = Lh(h, u[p]);
  return {
    c() {
      e = h1(
        /*tag*/
        n[25]
      ), s && s.c(), t = d1(), o && o.c(), this.h();
    },
    l(p) {
      e = u1(
        p,
        /*tag*/
        (n[25] || "null").toUpperCase(),
        {
          "data-testid": !0,
          id: !0,
          class: !0,
          dir: !0
        }
      );
      var g = bn(e);
      s && s.l(g), t = c1(g), o && o.l(g), g.forEach(C0), this.h();
    },
    h() {
      Fs(
        /*tag*/
        n[25]
      )(e, h), pt(
        e,
        "hidden",
        /*visible*/
        n[14] === !1
      ), pt(
        e,
        "padded",
        /*padding*/
        n[10]
      ), pt(
        e,
        "flex",
        /*flex*/
        n[1]
      ), pt(
        e,
        "border_focus",
        /*border_mode*/
        n[9] === "focus"
      ), pt(
        e,
        "border_contrast",
        /*border_mode*/
        n[9] === "contrast"
      ), pt(e, "hide-container", !/*explicit_call*/
      n[12] && !/*container*/
      n[13]), pt(
        e,
        "fullscreen",
        /*fullscreen*/
        n[0]
      ), pt(
        e,
        "animating",
        /*fullscreen*/
        n[0] && /*preexpansionBoundingRect*/
        n[24] !== null
      ), pt(
        e,
        "auto-margin",
        /*scale*/
        n[17] === null
      ), Be(
        e,
        "height",
        /*fullscreen*/
        n[0] ? void 0 : (
          /*get_dimension*/
          n[26](
            /*height*/
            n[2]
          )
        )
      ), Be(
        e,
        "min-height",
        /*fullscreen*/
        n[0] ? void 0 : (
          /*get_dimension*/
          n[26](
            /*min_height*/
            n[3]
          )
        )
      ), Be(
        e,
        "max-height",
        /*fullscreen*/
        n[0] ? void 0 : (
          /*get_dimension*/
          n[26](
            /*max_height*/
            n[4]
          )
        )
      ), Be(
        e,
        "--start-top",
        /*preexpansionBoundingRect*/
        n[24] ? `${/*preexpansionBoundingRect*/
        n[24].top}px` : "0px"
      ), Be(
        e,
        "--start-left",
        /*preexpansionBoundingRect*/
        n[24] ? `${/*preexpansionBoundingRect*/
        n[24].left}px` : "0px"
      ), Be(
        e,
        "--start-width",
        /*preexpansionBoundingRect*/
        n[24] ? `${/*preexpansionBoundingRect*/
        n[24].width}px` : "0px"
      ), Be(
        e,
        "--start-height",
        /*preexpansionBoundingRect*/
        n[24] ? `${/*preexpansionBoundingRect*/
        n[24].height}px` : "0px"
      ), Be(
        e,
        "width",
        /*fullscreen*/
        n[0] ? void 0 : typeof /*width*/
        n[5] == "number" ? `calc(min(${/*width*/
        n[5]}px, 100%))` : (
          /*get_dimension*/
          n[26](
            /*width*/
            n[5]
          )
        )
      ), Be(
        e,
        "border-style",
        /*variant*/
        n[8]
      ), Be(
        e,
        "overflow",
        /*allow_overflow*/
        n[15] ? (
          /*overflow_behavior*/
          n[16]
        ) : "hidden"
      ), Be(
        e,
        "flex-grow",
        /*scale*/
        n[17]
      ), Be(e, "min-width", `calc(min(${/*min_width*/
      n[18]}px, 100%))`), Be(e, "border-width", "var(--block-border-width)");
    },
    m(p, g) {
      An(p, e, g), s && s.m(e, null), ol(e, t), o && o.m(e, null), n[32](e), i = !0;
    },
    p(p, g) {
      var w;
      s && s.p && (!i || g[0] & /*$$scope*/
      1073741824) && Vh(
        s,
        l,
        p,
        /*$$scope*/
        p[30],
        i ? Nh(
          l,
          /*$$scope*/
          p[30],
          g,
          null
        ) : Ih(
          /*$$scope*/
          p[30]
        ),
        null
      ), /*resizable*/
      p[19] ? o ? o.p(p, g) : (o = $s(p), o.c(), o.m(e, null)) : o && (o.d(1), o = null), Fs(
        /*tag*/
        p[25]
      )(e, h = Oh(u, [
        (!i || g[0] & /*test_id*/
        2048) && { "data-testid": (
          /*test_id*/
          p[11]
        ) },
        (!i || g[0] & /*elem_id*/
        64) && { id: (
          /*elem_id*/
          p[6]
        ) },
        (!i || g[0] & /*elem_classes*/
        128 && r !== (r = "block " + /*elem_classes*/
        (((w = p[7]) == null ? void 0 : w.join(" ")) || "") + " svelte-239wnu")) && { class: r },
        (!i || g[0] & /*rtl*/
        1048576 && a !== (a = /*rtl*/
        p[20] ? "rtl" : "ltr")) && { dir: a }
      ])), pt(
        e,
        "hidden",
        /*visible*/
        p[14] === !1
      ), pt(
        e,
        "padded",
        /*padding*/
        p[10]
      ), pt(
        e,
        "flex",
        /*flex*/
        p[1]
      ), pt(
        e,
        "border_focus",
        /*border_mode*/
        p[9] === "focus"
      ), pt(
        e,
        "border_contrast",
        /*border_mode*/
        p[9] === "contrast"
      ), pt(e, "hide-container", !/*explicit_call*/
      p[12] && !/*container*/
      p[13]), pt(
        e,
        "fullscreen",
        /*fullscreen*/
        p[0]
      ), pt(
        e,
        "animating",
        /*fullscreen*/
        p[0] && /*preexpansionBoundingRect*/
        p[24] !== null
      ), pt(
        e,
        "auto-margin",
        /*scale*/
        p[17] === null
      ), g[0] & /*fullscreen, height*/
      5 && Be(
        e,
        "height",
        /*fullscreen*/
        p[0] ? void 0 : (
          /*get_dimension*/
          p[26](
            /*height*/
            p[2]
          )
        )
      ), g[0] & /*fullscreen, min_height*/
      9 && Be(
        e,
        "min-height",
        /*fullscreen*/
        p[0] ? void 0 : (
          /*get_dimension*/
          p[26](
            /*min_height*/
            p[3]
          )
        )
      ), g[0] & /*fullscreen, max_height*/
      17 && Be(
        e,
        "max-height",
        /*fullscreen*/
        p[0] ? void 0 : (
          /*get_dimension*/
          p[26](
            /*max_height*/
            p[4]
          )
        )
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && Be(
        e,
        "--start-top",
        /*preexpansionBoundingRect*/
        p[24] ? `${/*preexpansionBoundingRect*/
        p[24].top}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && Be(
        e,
        "--start-left",
        /*preexpansionBoundingRect*/
        p[24] ? `${/*preexpansionBoundingRect*/
        p[24].left}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && Be(
        e,
        "--start-width",
        /*preexpansionBoundingRect*/
        p[24] ? `${/*preexpansionBoundingRect*/
        p[24].width}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && Be(
        e,
        "--start-height",
        /*preexpansionBoundingRect*/
        p[24] ? `${/*preexpansionBoundingRect*/
        p[24].height}px` : "0px"
      ), g[0] & /*fullscreen, width*/
      33 && Be(
        e,
        "width",
        /*fullscreen*/
        p[0] ? void 0 : typeof /*width*/
        p[5] == "number" ? `calc(min(${/*width*/
        p[5]}px, 100%))` : (
          /*get_dimension*/
          p[26](
            /*width*/
            p[5]
          )
        )
      ), g[0] & /*variant*/
      256 && Be(
        e,
        "border-style",
        /*variant*/
        p[8]
      ), g[0] & /*allow_overflow, overflow_behavior*/
      98304 && Be(
        e,
        "overflow",
        /*allow_overflow*/
        p[15] ? (
          /*overflow_behavior*/
          p[16]
        ) : "hidden"
      ), g[0] & /*scale*/
      131072 && Be(
        e,
        "flex-grow",
        /*scale*/
        p[17]
      ), g[0] & /*min_width*/
      262144 && Be(e, "min-width", `calc(min(${/*min_width*/
      p[18]}px, 100%))`);
    },
    i(p) {
      i || (f1(s, p), i = !0);
    },
    o(p) {
      m1(s, p), i = !1;
    },
    d(p) {
      p && C0(e), s && s.d(p), o && o.d(), n[32](null);
    }
  };
}
function Ms(n) {
  let e;
  return {
    c() {
      e = h1("div"), this.h();
    },
    l(t) {
      e = u1(t, "DIV", { class: !0 }), bn(e).forEach(C0), this.h();
    },
    h() {
      kt(e, "class", "placeholder svelte-239wnu"), Be(
        e,
        "height",
        /*placeholder_height*/
        n[22] + "px"
      ), Be(
        e,
        "width",
        /*placeholder_width*/
        n[23] + "px"
      );
    },
    m(t, r) {
      An(t, e, r);
    },
    p(t, r) {
      r[0] & /*placeholder_height*/
      4194304 && Be(
        e,
        "height",
        /*placeholder_height*/
        t[22] + "px"
      ), r[0] & /*placeholder_width*/
      8388608 && Be(
        e,
        "width",
        /*placeholder_width*/
        t[23] + "px"
      );
    },
    d(t) {
      t && C0(e);
    }
  };
}
function Wh(n) {
  let e, t, r, a = (
    /*tag*/
    n[25] && jh(n)
  ), i = (
    /*fullscreen*/
    n[0] && Ms(n)
  );
  return {
    c() {
      a && a.c(), e = d1(), i && i.c(), t = Ts();
    },
    l(l) {
      a && a.l(l), e = c1(l), i && i.l(l), t = Ts();
    },
    m(l, s) {
      a && a.m(l, s), An(l, e, s), i && i.m(l, s), An(l, t, s), r = !0;
    },
    p(l, s) {
      /*tag*/
      l[25] && a.p(l, s), /*fullscreen*/
      l[0] ? i ? i.p(l, s) : (i = Ms(l), i.c(), i.m(t.parentNode, t)) : i && (i.d(1), i = null);
    },
    i(l) {
      r || (f1(a, l), r = !0);
    },
    o(l) {
      m1(a, l), r = !1;
    },
    d(l) {
      l && (C0(e), C0(t)), a && a.d(l), i && i.d(l);
    }
  };
}
function Yh(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { height: i = void 0 } = e, { min_height: l = void 0 } = e, { max_height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: u = "" } = e, { elem_classes: h = [] } = e, { variant: f = "solid" } = e, { border_mode: p = "base" } = e, { padding: g = !0 } = e, { type: w = "normal" } = e, { test_id: v = void 0 } = e, { explicit_call: y = !1 } = e, { container: E = !0 } = e, { visible: k = !0 } = e, { allow_overflow: b = !0 } = e, { overflow_behavior: A = "auto" } = e, { scale: M = null } = e, { min_width: R = 0 } = e, { flex: L = !1 } = e, { resizable: H = !1 } = e, { rtl: q = !1 } = e, { fullscreen: X = !1 } = e, Z = X, J, De = w === "fieldset" ? "fieldset" : "div", ye = 0, ve = 0, $e = null;
  function Me(N) {
    X && N.key === "Escape" && t(0, X = !1);
  }
  const ge = (N) => {
    if (N !== void 0) {
      if (typeof N == "number")
        return N + "px";
      if (typeof N == "string")
        return N;
    }
  }, qe = (N) => {
    let S = N.clientY;
    const T = (C) => {
      const P = C.clientY - S;
      S = C.clientY, t(21, J.style.height = `${J.offsetHeight + P}px`, J);
    }, z = () => {
      window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", z);
    };
    window.addEventListener("mousemove", T), window.addEventListener("mouseup", z);
  };
  function Ce(N) {
    Rh[N ? "unshift" : "push"](() => {
      J = N, t(21, J);
    });
  }
  return n.$$set = (N) => {
    "height" in N && t(2, i = N.height), "min_height" in N && t(3, l = N.min_height), "max_height" in N && t(4, s = N.max_height), "width" in N && t(5, o = N.width), "elem_id" in N && t(6, u = N.elem_id), "elem_classes" in N && t(7, h = N.elem_classes), "variant" in N && t(8, f = N.variant), "border_mode" in N && t(9, p = N.border_mode), "padding" in N && t(10, g = N.padding), "type" in N && t(28, w = N.type), "test_id" in N && t(11, v = N.test_id), "explicit_call" in N && t(12, y = N.explicit_call), "container" in N && t(13, E = N.container), "visible" in N && t(14, k = N.visible), "allow_overflow" in N && t(15, b = N.allow_overflow), "overflow_behavior" in N && t(16, A = N.overflow_behavior), "scale" in N && t(17, M = N.scale), "min_width" in N && t(18, R = N.min_width), "flex" in N && t(1, L = N.flex), "resizable" in N && t(19, H = N.resizable), "rtl" in N && t(20, q = N.rtl), "fullscreen" in N && t(0, X = N.fullscreen), "$$scope" in N && t(30, a = N.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*fullscreen, old_fullscreen, element*/
    538968065 && X !== Z && (t(29, Z = X), X ? (t(24, $e = J.getBoundingClientRect()), t(22, ye = J.offsetHeight), t(23, ve = J.offsetWidth), window.addEventListener("keydown", Me)) : (t(24, $e = null), window.removeEventListener("keydown", Me))), n.$$.dirty[0] & /*visible*/
    16384 && (k || t(1, L = !1));
  }, [
    X,
    L,
    i,
    l,
    s,
    o,
    u,
    h,
    f,
    p,
    g,
    v,
    y,
    E,
    k,
    b,
    A,
    M,
    R,
    H,
    q,
    J,
    ye,
    ve,
    $e,
    De,
    ge,
    qe,
    w,
    Z,
    a,
    r,
    Ce
  ];
}
class Xh extends Bh {
  constructor(e) {
    super(), Ph(
      this,
      e,
      Yh,
      Wh,
      Gh,
      {
        height: 2,
        min_height: 3,
        max_height: 4,
        width: 5,
        elem_id: 6,
        elem_classes: 7,
        variant: 8,
        border_mode: 9,
        padding: 10,
        type: 28,
        test_id: 11,
        explicit_call: 12,
        container: 13,
        visible: 14,
        allow_overflow: 15,
        overflow_behavior: 16,
        scale: 17,
        min_width: 18,
        flex: 1,
        resizable: 19,
        rtl: 20,
        fullscreen: 0
      },
      null,
      [-1, -1]
    );
  }
}
class Ut {
  // The + prefix indicates that these fields aren't writeable
  // Lexer holding the input string.
  // Start offset, zero-based inclusive.
  // End offset, zero-based exclusive.
  constructor(e, t, r) {
    this.lexer = void 0, this.start = void 0, this.end = void 0, this.lexer = e, this.start = t, this.end = r;
  }
  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(e, t) {
    return t ? !e || !e.loc || !t.loc || e.loc.lexer !== t.loc.lexer ? null : new Ut(e.loc.lexer, e.loc.start, t.loc.end) : e && e.loc;
  }
}
class l0 {
  // don't expand the token
  // used in \noexpand
  constructor(e, t) {
    this.text = void 0, this.loc = void 0, this.noexpand = void 0, this.treatAsRelax = void 0, this.text = e, this.loc = t;
  }
  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(e, t) {
    return new l0(t, Ut.range(this, e));
  }
}
class V {
  // Error start position based on passed-in Token or ParseNode.
  // Length of affected text based on passed-in Token or ParseNode.
  // The underlying error message without any context added.
  constructor(e, t) {
    this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0;
    var r = "KaTeX parse error: " + e, a, i, l = t && t.loc;
    if (l && l.start <= l.end) {
      var s = l.lexer.input;
      a = l.start, i = l.end, a === s.length ? r += " at end of input: " : r += " at position " + (a + 1) + ": ";
      var o = s.slice(a, i).replace(/[^]/g, "$&̲"), u;
      a > 15 ? u = "…" + s.slice(a - 15, a) : u = s.slice(0, a);
      var h;
      i + 15 < s.length ? h = s.slice(i, i + 15) + "…" : h = s.slice(i), r += u + o + h;
    }
    var f = new Error(r);
    return f.name = "ParseError", f.__proto__ = V.prototype, f.position = a, a != null && i != null && (f.length = i - a), f.rawMessage = e, f;
  }
}
V.prototype.__proto__ = Error.prototype;
var Zh = function(e, t) {
  return e.indexOf(t) !== -1;
}, Kh = function(e, t) {
  return e === void 0 ? t : e;
}, Qh = /([A-Z])/g, Jh = function(e) {
  return e.replace(Qh, "-$1").toLowerCase();
}, ed = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, td = /[&><"']/g;
function rd(n) {
  return String(n).replace(td, (e) => ed[e]);
}
var p1 = function n(e) {
  return e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? n(e.body[0]) : e : e.type === "font" ? n(e.body) : e;
}, nd = function(e) {
  var t = p1(e);
  return t.type === "mathord" || t.type === "textord" || t.type === "atom";
}, ad = function(e) {
  if (!e)
    throw new Error("Expected non-null, but got " + String(e));
  return e;
}, id = function(e) {
  var t = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);
  return t ? t[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1]) ? null : t[1].toLowerCase() : "_relative";
}, le = {
  contains: Zh,
  deflt: Kh,
  escape: rd,
  hyphenate: Jh,
  getBaseElem: p1,
  isCharacterBox: nd,
  protocolFromUrl: id
}, yn = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: !0,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",
    cliProcessor: (n) => "#" + n
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (n, e) => (e.push(n), e)
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: (n) => Math.max(0, n),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: !1
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: 1 / 0,
    description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",
    processor: (n) => Math.max(0, n),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1e3,
    description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",
    processor: (n) => Math.max(0, n),
    cli: "-e, --max-expand <n>",
    cliProcessor: (n) => n === "Infinity" ? 1 / 0 : parseInt(n)
  },
  globalGroup: {
    type: "boolean",
    cli: !1
  }
};
function ld(n) {
  if (n.default)
    return n.default;
  var e = n.type, t = Array.isArray(e) ? e[0] : e;
  if (typeof t != "string")
    return t.enum[0];
  switch (t) {
    case "boolean":
      return !1;
    case "string":
      return "";
    case "number":
      return 0;
    case "object":
      return {};
  }
}
class zl {
  constructor(e) {
    this.displayMode = void 0, this.output = void 0, this.leqno = void 0, this.fleqn = void 0, this.throwOnError = void 0, this.errorColor = void 0, this.macros = void 0, this.minRuleThickness = void 0, this.colorIsTextColor = void 0, this.strict = void 0, this.trust = void 0, this.maxSize = void 0, this.maxExpand = void 0, this.globalGroup = void 0, e = e || {};
    for (var t in yn)
      if (yn.hasOwnProperty(t)) {
        var r = yn[t];
        this[t] = e[t] !== void 0 ? r.processor ? r.processor(e[t]) : e[t] : ld(r);
      }
  }
  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(e, t, r) {
    var a = this.strict;
    if (typeof a == "function" && (a = a(e, t, r)), !(!a || a === "ignore")) {
      if (a === !0 || a === "error")
        throw new V("LaTeX-incompatible input and strict mode is set to 'error': " + (t + " [" + e + "]"), r);
      a === "warn" ? typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")) : typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]"));
    }
  }
  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(e, t, r) {
    var a = this.strict;
    if (typeof a == "function")
      try {
        a = a(e, t, r);
      } catch {
        a = "error";
      }
    return !a || a === "ignore" ? !1 : a === !0 || a === "error" ? !0 : a === "warn" ? (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")), !1) : (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]")), !1);
  }
  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(e) {
    if (e.url && !e.protocol) {
      var t = le.protocolFromUrl(e.url);
      if (t == null)
        return !1;
      e.protocol = t;
    }
    var r = typeof this.trust == "function" ? this.trust(e) : this.trust;
    return !!r;
  }
}
class lr {
  constructor(e, t, r) {
    this.id = void 0, this.size = void 0, this.cramped = void 0, this.id = e, this.size = t, this.cramped = r;
  }
  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return E0[sd[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return E0[od[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return E0[ud[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return E0[cd[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return E0[hd[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return E0[dd[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var Bl = 0, Ia = 1, Wr = 2, J0 = 3, En = 4, r0 = 5, Kr = 6, Ct = 7, E0 = [new lr(Bl, 0, !1), new lr(Ia, 0, !0), new lr(Wr, 1, !1), new lr(J0, 1, !0), new lr(En, 2, !1), new lr(r0, 2, !0), new lr(Kr, 3, !1), new lr(Ct, 3, !0)], sd = [En, r0, En, r0, Kr, Ct, Kr, Ct], od = [r0, r0, r0, r0, Ct, Ct, Ct, Ct], ud = [Wr, J0, En, r0, Kr, Ct, Kr, Ct], cd = [J0, J0, r0, r0, Ct, Ct, Ct, Ct], hd = [Ia, Ia, J0, J0, r0, r0, Ct, Ct], dd = [Bl, Ia, Wr, J0, Wr, J0, Wr, J0], oe = {
  DISPLAY: E0[Bl],
  TEXT: E0[Wr],
  SCRIPT: E0[En],
  SCRIPTSCRIPT: E0[Kr]
}, ul = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: "latin",
  blocks: [
    [256, 591],
    // Latin Extended-A and Latin Extended-B
    [768, 879]
    // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: "cyrillic",
  blocks: [[1024, 1279]]
}, {
  // Armenian
  name: "armenian",
  blocks: [[1328, 1423]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: "brahmic",
  blocks: [[2304, 4255]]
}, {
  name: "georgian",
  blocks: [[4256, 4351]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [
    [12288, 12543],
    // CJK symbols and punctuation, Hiragana, Katakana
    [19968, 40879],
    // CJK ideograms
    [65280, 65376]
    // Fullwidth punctuation
    // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: "hangul",
  blocks: [[44032, 55215]]
}];
function fd(n) {
  for (var e = 0; e < ul.length; e++)
    for (var t = ul[e], r = 0; r < t.blocks.length; r++) {
      var a = t.blocks[r];
      if (n >= a[0] && n <= a[1])
        return t.name;
    }
  return null;
}
var Ta = [];
ul.forEach((n) => n.blocks.forEach((e) => Ta.push(...e)));
function g1(n) {
  for (var e = 0; e < Ta.length; e += 2)
    if (n >= Ta[e] && n <= Ta[e + 1])
      return !0;
  return !1;
}
var Ir = 80, md = function(e, t) {
  return "M95," + (622 + e + t) + `
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l` + e / 2.075 + " -" + e + `
c5.3,-9.3,12,-14,20,-14
H400000v` + (40 + e) + `H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M` + (834 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, pd = function(e, t) {
  return "M263," + (601 + e + t) + `c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l` + e / 2.084 + " -" + e + `
c4.7,-7.3,11,-11,19,-11
H40000v` + (40 + e) + `H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, gd = function(e, t) {
  return "M983 " + (10 + e + t) + `
l` + e / 3.13 + " -" + e + `
c4,-6.7,10,-10,18,-10 H400000v` + (40 + e) + `
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, _d = function(e, t) {
  return "M424," + (2398 + e + t) + `
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l` + e / 4.223 + " -" + e + `c4,-6.7,10,-10,18,-10 H400000
v` + (40 + e) + `H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M` + (1001 + e) + " " + t + `
h400000v` + (40 + e) + "h-400000z";
}, vd = function(e, t) {
  return "M473," + (2713 + e + t) + `
c339.3,-1799.3,509.3,-2700,510,-2702 l` + e / 5.298 + " -" + e + `
c3.3,-7.3,9.3,-11,18,-11 H400000v` + (40 + e) + `H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "H1017.7z";
}, bd = function(e) {
  var t = e / 2;
  return "M400000 " + e + " H0 L" + t + " 0 l65 45 L145 " + (e - 80) + " H400000z";
}, yd = function(e, t, r) {
  var a = r - 54 - t - e;
  return "M702 " + (e + t) + "H400000" + (40 + e) + `
H742v` + a + `l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ` + t + "H400000v" + (40 + e) + "H742z";
}, wd = function(e, t, r) {
  t = 1e3 * t;
  var a = "";
  switch (e) {
    case "sqrtMain":
      a = md(t, Ir);
      break;
    case "sqrtSize1":
      a = pd(t, Ir);
      break;
    case "sqrtSize2":
      a = gd(t, Ir);
      break;
    case "sqrtSize3":
      a = _d(t, Ir);
      break;
    case "sqrtSize4":
      a = vd(t, Ir);
      break;
    case "sqrtTall":
      a = yd(t, Ir, r);
  }
  return a;
}, kd = function(e, t) {
  switch (e) {
    case "⎜":
      return "M291 0 H417 V" + t + " H291z M291 0 H417 V" + t + " H291z";
    case "∣":
      return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145z";
    case "∥":
      return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145z" + ("M367 0 H410 V" + t + " H367z M367 0 H410 V" + t + " H367z");
    case "⎟":
      return "M457 0 H583 V" + t + " H457z M457 0 H583 V" + t + " H457z";
    case "⎢":
      return "M319 0 H403 V" + t + " H319z M319 0 H403 V" + t + " H319z";
    case "⎥":
      return "M263 0 H347 V" + t + " H263z M263 0 H347 V" + t + " H263z";
    case "⎪":
      return "M384 0 H504 V" + t + " H384z M384 0 H504 V" + t + " H384z";
    case "⏐":
      return "M312 0 H355 V" + t + " H312z M312 0 H355 V" + t + " H312z";
    case "‖":
      return "M257 0 H300 V" + t + " H257z M257 0 H300 V" + t + " H257z" + ("M478 0 H521 V" + t + " H478z M478 0 H521 V" + t + " H478z");
    default:
      return "";
  }
}, zs = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: `M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: `M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,
  leftbraceunder: `M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: `M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,
  leftgroupunder: `M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,
  leftharpoonplus: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,
  leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,
  leftharpoondownplus: `M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,
  leftlinesegment: `M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,
  leftmapsto: `M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: `M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,
  longequal: `M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,
  midbrace: `M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,
  midbraceunder: `M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,
  oiintSize1: `M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,
  oiintSize2: `M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,
  oiiintSize1: `M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,
  oiiintSize2: `M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,
  rightarrow: `M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,
  rightbrace: `M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,
  rightbraceunder: `M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,
  rightgroup: `M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,
  rightgroupunder: `M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,
  rightharpoon: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,
  rightharpoonplus: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,
  rightharpoondown: `M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,
  rightharpoondownplus: `M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,
  righthook: `M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,
  rightlinesegment: `M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,
  rightToFrom: `M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: `M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,
  twoheadrightarrow: `M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,
  // ditto tilde2, tilde3, & tilde4
  tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,
  tilde3: `M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,
  tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,
  // ditto widehat2, widehat3, & widehat4
  widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat3: `M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat4: `M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  // widecheck paths are all inverted versions of widehat
  widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,
  widecheck2: `M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck3: `M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck4: `M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  // The next ten paths support reaction arrows from the mhchem package.
  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,
  rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,
  shortbaraboveleftharpoon: `M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,
  shortrightharpoonabovebar: `M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`
}, Dd = function(e, t) {
  switch (e) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + t + ` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v` + t + " v1759 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + t + ` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v` + t + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + t + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + t + ` v585 h43z
M367 15 v585 v` + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v` + t + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + t + ` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v` + t + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + t + ` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v` + t + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + t + ` v602 h84z
M403 1759 V0 H319 V1759 v` + t + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + t + ` v602 h84z
M347 1759 V0 h-84 V1759 v` + t + " v602 h84z";
    case "lparen":
      return `M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,` + (t + 84) + `c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-` + (t + 92) + `c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;
    case "rparen":
      return `M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,` + (t + 9) + `
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-` + (t + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;
    default:
      throw new Error("Unknown stretchy delimiter.");
  }
};
class Bn {
  // HtmlDomNode
  // Never used; needed for satisfying interface.
  constructor(e) {
    this.children = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.children = e, this.classes = [], this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = {};
  }
  hasClass(e) {
    return le.contains(this.classes, e);
  }
  /** Convert the fragment into a node. */
  toNode() {
    for (var e = document.createDocumentFragment(), t = 0; t < this.children.length; t++)
      e.appendChild(this.children[t].toNode());
    return e;
  }
  /** Convert the fragment into HTML markup. */
  toMarkup() {
    for (var e = "", t = 0; t < this.children.length; t++)
      e += this.children[t].toMarkup();
    return e;
  }
  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    var e = (t) => t.toText();
    return this.children.map(e).join("");
  }
}
var T0 = {
  "AMS-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68889, 0, 0, 0.72222],
    66: [0, 0.68889, 0, 0, 0.66667],
    67: [0, 0.68889, 0, 0, 0.72222],
    68: [0, 0.68889, 0, 0, 0.72222],
    69: [0, 0.68889, 0, 0, 0.66667],
    70: [0, 0.68889, 0, 0, 0.61111],
    71: [0, 0.68889, 0, 0, 0.77778],
    72: [0, 0.68889, 0, 0, 0.77778],
    73: [0, 0.68889, 0, 0, 0.38889],
    74: [0.16667, 0.68889, 0, 0, 0.5],
    75: [0, 0.68889, 0, 0, 0.77778],
    76: [0, 0.68889, 0, 0, 0.66667],
    77: [0, 0.68889, 0, 0, 0.94445],
    78: [0, 0.68889, 0, 0, 0.72222],
    79: [0.16667, 0.68889, 0, 0, 0.77778],
    80: [0, 0.68889, 0, 0, 0.61111],
    81: [0.16667, 0.68889, 0, 0, 0.77778],
    82: [0, 0.68889, 0, 0, 0.72222],
    83: [0, 0.68889, 0, 0, 0.55556],
    84: [0, 0.68889, 0, 0, 0.66667],
    85: [0, 0.68889, 0, 0, 0.72222],
    86: [0, 0.68889, 0, 0, 0.72222],
    87: [0, 0.68889, 0, 0, 1],
    88: [0, 0.68889, 0, 0, 0.72222],
    89: [0, 0.68889, 0, 0, 0.72222],
    90: [0, 0.68889, 0, 0, 0.66667],
    107: [0, 0.68889, 0, 0, 0.55556],
    160: [0, 0, 0, 0, 0.25],
    165: [0, 0.675, 0.025, 0, 0.75],
    174: [0.15559, 0.69224, 0, 0, 0.94666],
    240: [0, 0.68889, 0, 0, 0.55556],
    295: [0, 0.68889, 0, 0, 0.54028],
    710: [0, 0.825, 0, 0, 2.33334],
    732: [0, 0.9, 0, 0, 2.33334],
    770: [0, 0.825, 0, 0, 2.33334],
    771: [0, 0.9, 0, 0, 2.33334],
    989: [0.08167, 0.58167, 0, 0, 0.77778],
    1008: [0, 0.43056, 0.04028, 0, 0.66667],
    8245: [0, 0.54986, 0, 0, 0.275],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8487: [0, 0.68889, 0, 0, 0.72222],
    8498: [0, 0.68889, 0, 0, 0.55556],
    8502: [0, 0.68889, 0, 0, 0.66667],
    8503: [0, 0.68889, 0, 0, 0.44445],
    8504: [0, 0.68889, 0, 0, 0.66667],
    8513: [0, 0.68889, 0, 0, 0.63889],
    8592: [-0.03598, 0.46402, 0, 0, 0.5],
    8594: [-0.03598, 0.46402, 0, 0, 0.5],
    8602: [-0.13313, 0.36687, 0, 0, 1],
    8603: [-0.13313, 0.36687, 0, 0, 1],
    8606: [0.01354, 0.52239, 0, 0, 1],
    8608: [0.01354, 0.52239, 0, 0, 1],
    8610: [0.01354, 0.52239, 0, 0, 1.11111],
    8611: [0.01354, 0.52239, 0, 0, 1.11111],
    8619: [0, 0.54986, 0, 0, 1],
    8620: [0, 0.54986, 0, 0, 1],
    8621: [-0.13313, 0.37788, 0, 0, 1.38889],
    8622: [-0.13313, 0.36687, 0, 0, 1],
    8624: [0, 0.69224, 0, 0, 0.5],
    8625: [0, 0.69224, 0, 0, 0.5],
    8630: [0, 0.43056, 0, 0, 1],
    8631: [0, 0.43056, 0, 0, 1],
    8634: [0.08198, 0.58198, 0, 0, 0.77778],
    8635: [0.08198, 0.58198, 0, 0, 0.77778],
    8638: [0.19444, 0.69224, 0, 0, 0.41667],
    8639: [0.19444, 0.69224, 0, 0, 0.41667],
    8642: [0.19444, 0.69224, 0, 0, 0.41667],
    8643: [0.19444, 0.69224, 0, 0, 0.41667],
    8644: [0.1808, 0.675, 0, 0, 1],
    8646: [0.1808, 0.675, 0, 0, 1],
    8647: [0.1808, 0.675, 0, 0, 1],
    8648: [0.19444, 0.69224, 0, 0, 0.83334],
    8649: [0.1808, 0.675, 0, 0, 1],
    8650: [0.19444, 0.69224, 0, 0, 0.83334],
    8651: [0.01354, 0.52239, 0, 0, 1],
    8652: [0.01354, 0.52239, 0, 0, 1],
    8653: [-0.13313, 0.36687, 0, 0, 1],
    8654: [-0.13313, 0.36687, 0, 0, 1],
    8655: [-0.13313, 0.36687, 0, 0, 1],
    8666: [0.13667, 0.63667, 0, 0, 1],
    8667: [0.13667, 0.63667, 0, 0, 1],
    8669: [-0.13313, 0.37788, 0, 0, 1],
    8672: [-0.064, 0.437, 0, 0, 1.334],
    8674: [-0.064, 0.437, 0, 0, 1.334],
    8705: [0, 0.825, 0, 0, 0.5],
    8708: [0, 0.68889, 0, 0, 0.55556],
    8709: [0.08167, 0.58167, 0, 0, 0.77778],
    8717: [0, 0.43056, 0, 0, 0.42917],
    8722: [-0.03598, 0.46402, 0, 0, 0.5],
    8724: [0.08198, 0.69224, 0, 0, 0.77778],
    8726: [0.08167, 0.58167, 0, 0, 0.77778],
    8733: [0, 0.69224, 0, 0, 0.77778],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8737: [0, 0.69224, 0, 0, 0.72222],
    8738: [0.03517, 0.52239, 0, 0, 0.72222],
    8739: [0.08167, 0.58167, 0, 0, 0.22222],
    8740: [0.25142, 0.74111, 0, 0, 0.27778],
    8741: [0.08167, 0.58167, 0, 0, 0.38889],
    8742: [0.25142, 0.74111, 0, 0, 0.5],
    8756: [0, 0.69224, 0, 0, 0.66667],
    8757: [0, 0.69224, 0, 0, 0.66667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8765: [-0.13313, 0.37788, 0, 0, 0.77778],
    8769: [-0.13313, 0.36687, 0, 0, 0.77778],
    8770: [-0.03625, 0.46375, 0, 0, 0.77778],
    8774: [0.30274, 0.79383, 0, 0, 0.77778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8778: [0.08167, 0.58167, 0, 0, 0.77778],
    8782: [0.06062, 0.54986, 0, 0, 0.77778],
    8783: [0.06062, 0.54986, 0, 0, 0.77778],
    8785: [0.08198, 0.58198, 0, 0, 0.77778],
    8786: [0.08198, 0.58198, 0, 0, 0.77778],
    8787: [0.08198, 0.58198, 0, 0, 0.77778],
    8790: [0, 0.69224, 0, 0, 0.77778],
    8791: [0.22958, 0.72958, 0, 0, 0.77778],
    8796: [0.08198, 0.91667, 0, 0, 0.77778],
    8806: [0.25583, 0.75583, 0, 0, 0.77778],
    8807: [0.25583, 0.75583, 0, 0, 0.77778],
    8808: [0.25142, 0.75726, 0, 0, 0.77778],
    8809: [0.25142, 0.75726, 0, 0, 0.77778],
    8812: [0.25583, 0.75583, 0, 0, 0.5],
    8814: [0.20576, 0.70576, 0, 0, 0.77778],
    8815: [0.20576, 0.70576, 0, 0, 0.77778],
    8816: [0.30274, 0.79383, 0, 0, 0.77778],
    8817: [0.30274, 0.79383, 0, 0, 0.77778],
    8818: [0.22958, 0.72958, 0, 0, 0.77778],
    8819: [0.22958, 0.72958, 0, 0, 0.77778],
    8822: [0.1808, 0.675, 0, 0, 0.77778],
    8823: [0.1808, 0.675, 0, 0, 0.77778],
    8828: [0.13667, 0.63667, 0, 0, 0.77778],
    8829: [0.13667, 0.63667, 0, 0, 0.77778],
    8830: [0.22958, 0.72958, 0, 0, 0.77778],
    8831: [0.22958, 0.72958, 0, 0, 0.77778],
    8832: [0.20576, 0.70576, 0, 0, 0.77778],
    8833: [0.20576, 0.70576, 0, 0, 0.77778],
    8840: [0.30274, 0.79383, 0, 0, 0.77778],
    8841: [0.30274, 0.79383, 0, 0, 0.77778],
    8842: [0.13597, 0.63597, 0, 0, 0.77778],
    8843: [0.13597, 0.63597, 0, 0, 0.77778],
    8847: [0.03517, 0.54986, 0, 0, 0.77778],
    8848: [0.03517, 0.54986, 0, 0, 0.77778],
    8858: [0.08198, 0.58198, 0, 0, 0.77778],
    8859: [0.08198, 0.58198, 0, 0, 0.77778],
    8861: [0.08198, 0.58198, 0, 0, 0.77778],
    8862: [0, 0.675, 0, 0, 0.77778],
    8863: [0, 0.675, 0, 0, 0.77778],
    8864: [0, 0.675, 0, 0, 0.77778],
    8865: [0, 0.675, 0, 0, 0.77778],
    8872: [0, 0.69224, 0, 0, 0.61111],
    8873: [0, 0.69224, 0, 0, 0.72222],
    8874: [0, 0.69224, 0, 0, 0.88889],
    8876: [0, 0.68889, 0, 0, 0.61111],
    8877: [0, 0.68889, 0, 0, 0.61111],
    8878: [0, 0.68889, 0, 0, 0.72222],
    8879: [0, 0.68889, 0, 0, 0.72222],
    8882: [0.03517, 0.54986, 0, 0, 0.77778],
    8883: [0.03517, 0.54986, 0, 0, 0.77778],
    8884: [0.13667, 0.63667, 0, 0, 0.77778],
    8885: [0.13667, 0.63667, 0, 0, 0.77778],
    8888: [0, 0.54986, 0, 0, 1.11111],
    8890: [0.19444, 0.43056, 0, 0, 0.55556],
    8891: [0.19444, 0.69224, 0, 0, 0.61111],
    8892: [0.19444, 0.69224, 0, 0, 0.61111],
    8901: [0, 0.54986, 0, 0, 0.27778],
    8903: [0.08167, 0.58167, 0, 0, 0.77778],
    8905: [0.08167, 0.58167, 0, 0, 0.77778],
    8906: [0.08167, 0.58167, 0, 0, 0.77778],
    8907: [0, 0.69224, 0, 0, 0.77778],
    8908: [0, 0.69224, 0, 0, 0.77778],
    8909: [-0.03598, 0.46402, 0, 0, 0.77778],
    8910: [0, 0.54986, 0, 0, 0.76042],
    8911: [0, 0.54986, 0, 0, 0.76042],
    8912: [0.03517, 0.54986, 0, 0, 0.77778],
    8913: [0.03517, 0.54986, 0, 0, 0.77778],
    8914: [0, 0.54986, 0, 0, 0.66667],
    8915: [0, 0.54986, 0, 0, 0.66667],
    8916: [0, 0.69224, 0, 0, 0.66667],
    8918: [0.0391, 0.5391, 0, 0, 0.77778],
    8919: [0.0391, 0.5391, 0, 0, 0.77778],
    8920: [0.03517, 0.54986, 0, 0, 1.33334],
    8921: [0.03517, 0.54986, 0, 0, 1.33334],
    8922: [0.38569, 0.88569, 0, 0, 0.77778],
    8923: [0.38569, 0.88569, 0, 0, 0.77778],
    8926: [0.13667, 0.63667, 0, 0, 0.77778],
    8927: [0.13667, 0.63667, 0, 0, 0.77778],
    8928: [0.30274, 0.79383, 0, 0, 0.77778],
    8929: [0.30274, 0.79383, 0, 0, 0.77778],
    8934: [0.23222, 0.74111, 0, 0, 0.77778],
    8935: [0.23222, 0.74111, 0, 0, 0.77778],
    8936: [0.23222, 0.74111, 0, 0, 0.77778],
    8937: [0.23222, 0.74111, 0, 0, 0.77778],
    8938: [0.20576, 0.70576, 0, 0, 0.77778],
    8939: [0.20576, 0.70576, 0, 0, 0.77778],
    8940: [0.30274, 0.79383, 0, 0, 0.77778],
    8941: [0.30274, 0.79383, 0, 0, 0.77778],
    8994: [0.19444, 0.69224, 0, 0, 0.77778],
    8995: [0.19444, 0.69224, 0, 0, 0.77778],
    9416: [0.15559, 0.69224, 0, 0, 0.90222],
    9484: [0, 0.69224, 0, 0, 0.5],
    9488: [0, 0.69224, 0, 0, 0.5],
    9492: [0, 0.37788, 0, 0, 0.5],
    9496: [0, 0.37788, 0, 0, 0.5],
    9585: [0.19444, 0.68889, 0, 0, 0.88889],
    9586: [0.19444, 0.74111, 0, 0, 0.88889],
    9632: [0, 0.675, 0, 0, 0.77778],
    9633: [0, 0.675, 0, 0, 0.77778],
    9650: [0, 0.54986, 0, 0, 0.72222],
    9651: [0, 0.54986, 0, 0, 0.72222],
    9654: [0.03517, 0.54986, 0, 0, 0.77778],
    9660: [0, 0.54986, 0, 0, 0.72222],
    9661: [0, 0.54986, 0, 0, 0.72222],
    9664: [0.03517, 0.54986, 0, 0, 0.77778],
    9674: [0.11111, 0.69224, 0, 0, 0.66667],
    9733: [0.19444, 0.69224, 0, 0, 0.94445],
    10003: [0, 0.69224, 0, 0, 0.83334],
    10016: [0, 0.69224, 0, 0, 0.83334],
    10731: [0.11111, 0.69224, 0, 0, 0.66667],
    10846: [0.19444, 0.75583, 0, 0, 0.61111],
    10877: [0.13667, 0.63667, 0, 0, 0.77778],
    10878: [0.13667, 0.63667, 0, 0, 0.77778],
    10885: [0.25583, 0.75583, 0, 0, 0.77778],
    10886: [0.25583, 0.75583, 0, 0, 0.77778],
    10887: [0.13597, 0.63597, 0, 0, 0.77778],
    10888: [0.13597, 0.63597, 0, 0, 0.77778],
    10889: [0.26167, 0.75726, 0, 0, 0.77778],
    10890: [0.26167, 0.75726, 0, 0, 0.77778],
    10891: [0.48256, 0.98256, 0, 0, 0.77778],
    10892: [0.48256, 0.98256, 0, 0, 0.77778],
    10901: [0.13667, 0.63667, 0, 0, 0.77778],
    10902: [0.13667, 0.63667, 0, 0, 0.77778],
    10933: [0.25142, 0.75726, 0, 0, 0.77778],
    10934: [0.25142, 0.75726, 0, 0, 0.77778],
    10935: [0.26167, 0.75726, 0, 0, 0.77778],
    10936: [0.26167, 0.75726, 0, 0, 0.77778],
    10937: [0.26167, 0.75726, 0, 0, 0.77778],
    10938: [0.26167, 0.75726, 0, 0, 0.77778],
    10949: [0.25583, 0.75583, 0, 0, 0.77778],
    10950: [0.25583, 0.75583, 0, 0, 0.77778],
    10955: [0.28481, 0.79383, 0, 0, 0.77778],
    10956: [0.28481, 0.79383, 0, 0, 0.77778],
    57350: [0.08167, 0.58167, 0, 0, 0.22222],
    57351: [0.08167, 0.58167, 0, 0, 0.38889],
    57352: [0.08167, 0.58167, 0, 0, 0.77778],
    57353: [0, 0.43056, 0.04028, 0, 0.66667],
    57356: [0.25142, 0.75726, 0, 0, 0.77778],
    57357: [0.25142, 0.75726, 0, 0, 0.77778],
    57358: [0.41951, 0.91951, 0, 0, 0.77778],
    57359: [0.30274, 0.79383, 0, 0, 0.77778],
    57360: [0.30274, 0.79383, 0, 0, 0.77778],
    57361: [0.41951, 0.91951, 0, 0, 0.77778],
    57366: [0.25142, 0.75726, 0, 0, 0.77778],
    57367: [0.25142, 0.75726, 0, 0, 0.77778],
    57368: [0.25142, 0.75726, 0, 0, 0.77778],
    57369: [0.25142, 0.75726, 0, 0, 0.77778],
    57370: [0.13597, 0.63597, 0, 0, 0.77778],
    57371: [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68333, 0, 0.19445, 0.79847],
    66: [0, 0.68333, 0.03041, 0.13889, 0.65681],
    67: [0, 0.68333, 0.05834, 0.13889, 0.52653],
    68: [0, 0.68333, 0.02778, 0.08334, 0.77139],
    69: [0, 0.68333, 0.08944, 0.11111, 0.52778],
    70: [0, 0.68333, 0.09931, 0.11111, 0.71875],
    71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    72: [0, 0.68333, 965e-5, 0.11111, 0.84452],
    73: [0, 0.68333, 0.07382, 0, 0.54452],
    74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    75: [0, 0.68333, 0.01445, 0.05556, 0.76195],
    76: [0, 0.68333, 0, 0.13889, 0.68972],
    77: [0, 0.68333, 0, 0.13889, 1.2009],
    78: [0, 0.68333, 0.14736, 0.08334, 0.82049],
    79: [0, 0.68333, 0.02778, 0.11111, 0.79611],
    80: [0, 0.68333, 0.08222, 0.08334, 0.69556],
    81: [0.09722, 0.68333, 0, 0.11111, 0.81667],
    82: [0, 0.68333, 0, 0.08334, 0.8475],
    83: [0, 0.68333, 0.075, 0.13889, 0.60556],
    84: [0, 0.68333, 0.25417, 0, 0.54464],
    85: [0, 0.68333, 0.09931, 0.08334, 0.62583],
    86: [0, 0.68333, 0.08222, 0, 0.61278],
    87: [0, 0.68333, 0.08222, 0.08334, 0.98778],
    88: [0, 0.68333, 0.14643, 0.13889, 0.7133],
    89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    90: [0, 0.68333, 0.07944, 0.13889, 0.72473],
    160: [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69141, 0, 0, 0.29574],
    34: [0, 0.69141, 0, 0, 0.21471],
    38: [0, 0.69141, 0, 0, 0.73786],
    39: [0, 0.69141, 0, 0, 0.21201],
    40: [0.24982, 0.74947, 0, 0, 0.38865],
    41: [0.24982, 0.74947, 0, 0, 0.38865],
    42: [0, 0.62119, 0, 0, 0.27764],
    43: [0.08319, 0.58283, 0, 0, 0.75623],
    44: [0, 0.10803, 0, 0, 0.27764],
    45: [0.08319, 0.58283, 0, 0, 0.75623],
    46: [0, 0.10803, 0, 0, 0.27764],
    47: [0.24982, 0.74947, 0, 0, 0.50181],
    48: [0, 0.47534, 0, 0, 0.50181],
    49: [0, 0.47534, 0, 0, 0.50181],
    50: [0, 0.47534, 0, 0, 0.50181],
    51: [0.18906, 0.47534, 0, 0, 0.50181],
    52: [0.18906, 0.47534, 0, 0, 0.50181],
    53: [0.18906, 0.47534, 0, 0, 0.50181],
    54: [0, 0.69141, 0, 0, 0.50181],
    55: [0.18906, 0.47534, 0, 0, 0.50181],
    56: [0, 0.69141, 0, 0, 0.50181],
    57: [0.18906, 0.47534, 0, 0, 0.50181],
    58: [0, 0.47534, 0, 0, 0.21606],
    59: [0.12604, 0.47534, 0, 0, 0.21606],
    61: [-0.13099, 0.36866, 0, 0, 0.75623],
    63: [0, 0.69141, 0, 0, 0.36245],
    65: [0, 0.69141, 0, 0, 0.7176],
    66: [0, 0.69141, 0, 0, 0.88397],
    67: [0, 0.69141, 0, 0, 0.61254],
    68: [0, 0.69141, 0, 0, 0.83158],
    69: [0, 0.69141, 0, 0, 0.66278],
    70: [0.12604, 0.69141, 0, 0, 0.61119],
    71: [0, 0.69141, 0, 0, 0.78539],
    72: [0.06302, 0.69141, 0, 0, 0.7203],
    73: [0, 0.69141, 0, 0, 0.55448],
    74: [0.12604, 0.69141, 0, 0, 0.55231],
    75: [0, 0.69141, 0, 0, 0.66845],
    76: [0, 0.69141, 0, 0, 0.66602],
    77: [0, 0.69141, 0, 0, 1.04953],
    78: [0, 0.69141, 0, 0, 0.83212],
    79: [0, 0.69141, 0, 0, 0.82699],
    80: [0.18906, 0.69141, 0, 0, 0.82753],
    81: [0.03781, 0.69141, 0, 0, 0.82699],
    82: [0, 0.69141, 0, 0, 0.82807],
    83: [0, 0.69141, 0, 0, 0.82861],
    84: [0, 0.69141, 0, 0, 0.66899],
    85: [0, 0.69141, 0, 0, 0.64576],
    86: [0, 0.69141, 0, 0, 0.83131],
    87: [0, 0.69141, 0, 0, 1.04602],
    88: [0, 0.69141, 0, 0, 0.71922],
    89: [0.18906, 0.69141, 0, 0, 0.83293],
    90: [0.12604, 0.69141, 0, 0, 0.60201],
    91: [0.24982, 0.74947, 0, 0, 0.27764],
    93: [0.24982, 0.74947, 0, 0, 0.27764],
    94: [0, 0.69141, 0, 0, 0.49965],
    97: [0, 0.47534, 0, 0, 0.50046],
    98: [0, 0.69141, 0, 0, 0.51315],
    99: [0, 0.47534, 0, 0, 0.38946],
    100: [0, 0.62119, 0, 0, 0.49857],
    101: [0, 0.47534, 0, 0, 0.40053],
    102: [0.18906, 0.69141, 0, 0, 0.32626],
    103: [0.18906, 0.47534, 0, 0, 0.5037],
    104: [0.18906, 0.69141, 0, 0, 0.52126],
    105: [0, 0.69141, 0, 0, 0.27899],
    106: [0, 0.69141, 0, 0, 0.28088],
    107: [0, 0.69141, 0, 0, 0.38946],
    108: [0, 0.69141, 0, 0, 0.27953],
    109: [0, 0.47534, 0, 0, 0.76676],
    110: [0, 0.47534, 0, 0, 0.52666],
    111: [0, 0.47534, 0, 0, 0.48885],
    112: [0.18906, 0.52396, 0, 0, 0.50046],
    113: [0.18906, 0.47534, 0, 0, 0.48912],
    114: [0, 0.47534, 0, 0, 0.38919],
    115: [0, 0.47534, 0, 0, 0.44266],
    116: [0, 0.62119, 0, 0, 0.33301],
    117: [0, 0.47534, 0, 0, 0.5172],
    118: [0, 0.52396, 0, 0, 0.5118],
    119: [0, 0.52396, 0, 0, 0.77351],
    120: [0.18906, 0.47534, 0, 0, 0.38865],
    121: [0.18906, 0.47534, 0, 0, 0.49884],
    122: [0.18906, 0.47534, 0, 0, 0.39054],
    160: [0, 0, 0, 0, 0.25],
    8216: [0, 0.69141, 0, 0, 0.21471],
    8217: [0, 0.69141, 0, 0, 0.21471],
    58112: [0, 0.62119, 0, 0, 0.49749],
    58113: [0, 0.62119, 0, 0, 0.4983],
    58114: [0.18906, 0.69141, 0, 0, 0.33328],
    58115: [0.18906, 0.69141, 0, 0, 0.32923],
    58116: [0.18906, 0.47534, 0, 0, 0.50343],
    58117: [0, 0.69141, 0, 0, 0.33301],
    58118: [0, 0.62119, 0, 0, 0.33409],
    58119: [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.35],
    34: [0, 0.69444, 0, 0, 0.60278],
    35: [0.19444, 0.69444, 0, 0, 0.95833],
    36: [0.05556, 0.75, 0, 0, 0.575],
    37: [0.05556, 0.75, 0, 0, 0.95833],
    38: [0, 0.69444, 0, 0, 0.89444],
    39: [0, 0.69444, 0, 0, 0.31944],
    40: [0.25, 0.75, 0, 0, 0.44722],
    41: [0.25, 0.75, 0, 0, 0.44722],
    42: [0, 0.75, 0, 0, 0.575],
    43: [0.13333, 0.63333, 0, 0, 0.89444],
    44: [0.19444, 0.15556, 0, 0, 0.31944],
    45: [0, 0.44444, 0, 0, 0.38333],
    46: [0, 0.15556, 0, 0, 0.31944],
    47: [0.25, 0.75, 0, 0, 0.575],
    48: [0, 0.64444, 0, 0, 0.575],
    49: [0, 0.64444, 0, 0, 0.575],
    50: [0, 0.64444, 0, 0, 0.575],
    51: [0, 0.64444, 0, 0, 0.575],
    52: [0, 0.64444, 0, 0, 0.575],
    53: [0, 0.64444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0, 0.64444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0, 0.64444, 0, 0, 0.575],
    58: [0, 0.44444, 0, 0, 0.31944],
    59: [0.19444, 0.44444, 0, 0, 0.31944],
    60: [0.08556, 0.58556, 0, 0, 0.89444],
    61: [-0.10889, 0.39111, 0, 0, 0.89444],
    62: [0.08556, 0.58556, 0, 0, 0.89444],
    63: [0, 0.69444, 0, 0, 0.54305],
    64: [0, 0.69444, 0, 0, 0.89444],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0, 0, 0.81805],
    67: [0, 0.68611, 0, 0, 0.83055],
    68: [0, 0.68611, 0, 0, 0.88194],
    69: [0, 0.68611, 0, 0, 0.75555],
    70: [0, 0.68611, 0, 0, 0.72361],
    71: [0, 0.68611, 0, 0, 0.90416],
    72: [0, 0.68611, 0, 0, 0.9],
    73: [0, 0.68611, 0, 0, 0.43611],
    74: [0, 0.68611, 0, 0, 0.59444],
    75: [0, 0.68611, 0, 0, 0.90138],
    76: [0, 0.68611, 0, 0, 0.69166],
    77: [0, 0.68611, 0, 0, 1.09166],
    78: [0, 0.68611, 0, 0, 0.9],
    79: [0, 0.68611, 0, 0, 0.86388],
    80: [0, 0.68611, 0, 0, 0.78611],
    81: [0.19444, 0.68611, 0, 0, 0.86388],
    82: [0, 0.68611, 0, 0, 0.8625],
    83: [0, 0.68611, 0, 0, 0.63889],
    84: [0, 0.68611, 0, 0, 0.8],
    85: [0, 0.68611, 0, 0, 0.88472],
    86: [0, 0.68611, 0.01597, 0, 0.86944],
    87: [0, 0.68611, 0.01597, 0, 1.18888],
    88: [0, 0.68611, 0, 0, 0.86944],
    89: [0, 0.68611, 0.02875, 0, 0.86944],
    90: [0, 0.68611, 0, 0, 0.70277],
    91: [0.25, 0.75, 0, 0, 0.31944],
    92: [0.25, 0.75, 0, 0, 0.575],
    93: [0.25, 0.75, 0, 0, 0.31944],
    94: [0, 0.69444, 0, 0, 0.575],
    95: [0.31, 0.13444, 0.03194, 0, 0.575],
    97: [0, 0.44444, 0, 0, 0.55902],
    98: [0, 0.69444, 0, 0, 0.63889],
    99: [0, 0.44444, 0, 0, 0.51111],
    100: [0, 0.69444, 0, 0, 0.63889],
    101: [0, 0.44444, 0, 0, 0.52708],
    102: [0, 0.69444, 0.10903, 0, 0.35139],
    103: [0.19444, 0.44444, 0.01597, 0, 0.575],
    104: [0, 0.69444, 0, 0, 0.63889],
    105: [0, 0.69444, 0, 0, 0.31944],
    106: [0.19444, 0.69444, 0, 0, 0.35139],
    107: [0, 0.69444, 0, 0, 0.60694],
    108: [0, 0.69444, 0, 0, 0.31944],
    109: [0, 0.44444, 0, 0, 0.95833],
    110: [0, 0.44444, 0, 0, 0.63889],
    111: [0, 0.44444, 0, 0, 0.575],
    112: [0.19444, 0.44444, 0, 0, 0.63889],
    113: [0.19444, 0.44444, 0, 0, 0.60694],
    114: [0, 0.44444, 0, 0, 0.47361],
    115: [0, 0.44444, 0, 0, 0.45361],
    116: [0, 0.63492, 0, 0, 0.44722],
    117: [0, 0.44444, 0, 0, 0.63889],
    118: [0, 0.44444, 0.01597, 0, 0.60694],
    119: [0, 0.44444, 0.01597, 0, 0.83055],
    120: [0, 0.44444, 0, 0, 0.60694],
    121: [0.19444, 0.44444, 0.01597, 0, 0.60694],
    122: [0, 0.44444, 0, 0, 0.51111],
    123: [0.25, 0.75, 0, 0, 0.575],
    124: [0.25, 0.75, 0, 0, 0.31944],
    125: [0.25, 0.75, 0, 0, 0.575],
    126: [0.35, 0.34444, 0, 0, 0.575],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.86853],
    168: [0, 0.69444, 0, 0, 0.575],
    172: [0, 0.44444, 0, 0, 0.76666],
    176: [0, 0.69444, 0, 0, 0.86944],
    177: [0.13333, 0.63333, 0, 0, 0.89444],
    184: [0.17014, 0, 0, 0, 0.51111],
    198: [0, 0.68611, 0, 0, 1.04166],
    215: [0.13333, 0.63333, 0, 0, 0.89444],
    216: [0.04861, 0.73472, 0, 0, 0.89444],
    223: [0, 0.69444, 0, 0, 0.59722],
    230: [0, 0.44444, 0, 0, 0.83055],
    247: [0.13333, 0.63333, 0, 0, 0.89444],
    248: [0.09722, 0.54167, 0, 0, 0.575],
    305: [0, 0.44444, 0, 0, 0.31944],
    338: [0, 0.68611, 0, 0, 1.16944],
    339: [0, 0.44444, 0, 0, 0.89444],
    567: [0.19444, 0.44444, 0, 0, 0.35139],
    710: [0, 0.69444, 0, 0, 0.575],
    711: [0, 0.63194, 0, 0, 0.575],
    713: [0, 0.59611, 0, 0, 0.575],
    714: [0, 0.69444, 0, 0, 0.575],
    715: [0, 0.69444, 0, 0, 0.575],
    728: [0, 0.69444, 0, 0, 0.575],
    729: [0, 0.69444, 0, 0, 0.31944],
    730: [0, 0.69444, 0, 0, 0.86944],
    732: [0, 0.69444, 0, 0, 0.575],
    733: [0, 0.69444, 0, 0, 0.575],
    915: [0, 0.68611, 0, 0, 0.69166],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0, 0, 0.89444],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0, 0, 0.76666],
    928: [0, 0.68611, 0, 0, 0.9],
    931: [0, 0.68611, 0, 0, 0.83055],
    933: [0, 0.68611, 0, 0, 0.89444],
    934: [0, 0.68611, 0, 0, 0.83055],
    936: [0, 0.68611, 0, 0, 0.89444],
    937: [0, 0.68611, 0, 0, 0.83055],
    8211: [0, 0.44444, 0.03194, 0, 0.575],
    8212: [0, 0.44444, 0.03194, 0, 1.14999],
    8216: [0, 0.69444, 0, 0, 0.31944],
    8217: [0, 0.69444, 0, 0, 0.31944],
    8220: [0, 0.69444, 0, 0, 0.60278],
    8221: [0, 0.69444, 0, 0, 0.60278],
    8224: [0.19444, 0.69444, 0, 0, 0.51111],
    8225: [0.19444, 0.69444, 0, 0, 0.51111],
    8242: [0, 0.55556, 0, 0, 0.34444],
    8407: [0, 0.72444, 0.15486, 0, 0.575],
    8463: [0, 0.69444, 0, 0, 0.66759],
    8465: [0, 0.69444, 0, 0, 0.83055],
    8467: [0, 0.69444, 0, 0, 0.47361],
    8472: [0.19444, 0.44444, 0, 0, 0.74027],
    8476: [0, 0.69444, 0, 0, 0.83055],
    8501: [0, 0.69444, 0, 0, 0.70277],
    8592: [-0.10889, 0.39111, 0, 0, 1.14999],
    8593: [0.19444, 0.69444, 0, 0, 0.575],
    8594: [-0.10889, 0.39111, 0, 0, 1.14999],
    8595: [0.19444, 0.69444, 0, 0, 0.575],
    8596: [-0.10889, 0.39111, 0, 0, 1.14999],
    8597: [0.25, 0.75, 0, 0, 0.575],
    8598: [0.19444, 0.69444, 0, 0, 1.14999],
    8599: [0.19444, 0.69444, 0, 0, 1.14999],
    8600: [0.19444, 0.69444, 0, 0, 1.14999],
    8601: [0.19444, 0.69444, 0, 0, 1.14999],
    8636: [-0.10889, 0.39111, 0, 0, 1.14999],
    8637: [-0.10889, 0.39111, 0, 0, 1.14999],
    8640: [-0.10889, 0.39111, 0, 0, 1.14999],
    8641: [-0.10889, 0.39111, 0, 0, 1.14999],
    8656: [-0.10889, 0.39111, 0, 0, 1.14999],
    8657: [0.19444, 0.69444, 0, 0, 0.70277],
    8658: [-0.10889, 0.39111, 0, 0, 1.14999],
    8659: [0.19444, 0.69444, 0, 0, 0.70277],
    8660: [-0.10889, 0.39111, 0, 0, 1.14999],
    8661: [0.25, 0.75, 0, 0, 0.70277],
    8704: [0, 0.69444, 0, 0, 0.63889],
    8706: [0, 0.69444, 0.06389, 0, 0.62847],
    8707: [0, 0.69444, 0, 0, 0.63889],
    8709: [0.05556, 0.75, 0, 0, 0.575],
    8711: [0, 0.68611, 0, 0, 0.95833],
    8712: [0.08556, 0.58556, 0, 0, 0.76666],
    8715: [0.08556, 0.58556, 0, 0, 0.76666],
    8722: [0.13333, 0.63333, 0, 0, 0.89444],
    8723: [0.13333, 0.63333, 0, 0, 0.89444],
    8725: [0.25, 0.75, 0, 0, 0.575],
    8726: [0.25, 0.75, 0, 0, 0.575],
    8727: [-0.02778, 0.47222, 0, 0, 0.575],
    8728: [-0.02639, 0.47361, 0, 0, 0.575],
    8729: [-0.02639, 0.47361, 0, 0, 0.575],
    8730: [0.18, 0.82, 0, 0, 0.95833],
    8733: [0, 0.44444, 0, 0, 0.89444],
    8734: [0, 0.44444, 0, 0, 1.14999],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.31944],
    8741: [0.25, 0.75, 0, 0, 0.575],
    8743: [0, 0.55556, 0, 0, 0.76666],
    8744: [0, 0.55556, 0, 0, 0.76666],
    8745: [0, 0.55556, 0, 0, 0.76666],
    8746: [0, 0.55556, 0, 0, 0.76666],
    8747: [0.19444, 0.69444, 0.12778, 0, 0.56875],
    8764: [-0.10889, 0.39111, 0, 0, 0.89444],
    8768: [0.19444, 0.69444, 0, 0, 0.31944],
    8771: [222e-5, 0.50222, 0, 0, 0.89444],
    8773: [0.027, 0.638, 0, 0, 0.894],
    8776: [0.02444, 0.52444, 0, 0, 0.89444],
    8781: [222e-5, 0.50222, 0, 0, 0.89444],
    8801: [222e-5, 0.50222, 0, 0, 0.89444],
    8804: [0.19667, 0.69667, 0, 0, 0.89444],
    8805: [0.19667, 0.69667, 0, 0, 0.89444],
    8810: [0.08556, 0.58556, 0, 0, 1.14999],
    8811: [0.08556, 0.58556, 0, 0, 1.14999],
    8826: [0.08556, 0.58556, 0, 0, 0.89444],
    8827: [0.08556, 0.58556, 0, 0, 0.89444],
    8834: [0.08556, 0.58556, 0, 0, 0.89444],
    8835: [0.08556, 0.58556, 0, 0, 0.89444],
    8838: [0.19667, 0.69667, 0, 0, 0.89444],
    8839: [0.19667, 0.69667, 0, 0, 0.89444],
    8846: [0, 0.55556, 0, 0, 0.76666],
    8849: [0.19667, 0.69667, 0, 0, 0.89444],
    8850: [0.19667, 0.69667, 0, 0, 0.89444],
    8851: [0, 0.55556, 0, 0, 0.76666],
    8852: [0, 0.55556, 0, 0, 0.76666],
    8853: [0.13333, 0.63333, 0, 0, 0.89444],
    8854: [0.13333, 0.63333, 0, 0, 0.89444],
    8855: [0.13333, 0.63333, 0, 0, 0.89444],
    8856: [0.13333, 0.63333, 0, 0, 0.89444],
    8857: [0.13333, 0.63333, 0, 0, 0.89444],
    8866: [0, 0.69444, 0, 0, 0.70277],
    8867: [0, 0.69444, 0, 0, 0.70277],
    8868: [0, 0.69444, 0, 0, 0.89444],
    8869: [0, 0.69444, 0, 0, 0.89444],
    8900: [-0.02639, 0.47361, 0, 0, 0.575],
    8901: [-0.02639, 0.47361, 0, 0, 0.31944],
    8902: [-0.02778, 0.47222, 0, 0, 0.575],
    8968: [0.25, 0.75, 0, 0, 0.51111],
    8969: [0.25, 0.75, 0, 0, 0.51111],
    8970: [0.25, 0.75, 0, 0, 0.51111],
    8971: [0.25, 0.75, 0, 0, 0.51111],
    8994: [-0.13889, 0.36111, 0, 0, 1.14999],
    8995: [-0.13889, 0.36111, 0, 0, 1.14999],
    9651: [0.19444, 0.69444, 0, 0, 1.02222],
    9657: [-0.02778, 0.47222, 0, 0, 0.575],
    9661: [0.19444, 0.69444, 0, 0, 1.02222],
    9667: [-0.02778, 0.47222, 0, 0, 0.575],
    9711: [0.19444, 0.69444, 0, 0, 1.14999],
    9824: [0.12963, 0.69444, 0, 0, 0.89444],
    9825: [0.12963, 0.69444, 0, 0, 0.89444],
    9826: [0.12963, 0.69444, 0, 0, 0.89444],
    9827: [0.12963, 0.69444, 0, 0, 0.89444],
    9837: [0, 0.75, 0, 0, 0.44722],
    9838: [0.19444, 0.69444, 0, 0, 0.44722],
    9839: [0.19444, 0.69444, 0, 0, 0.44722],
    10216: [0.25, 0.75, 0, 0, 0.44722],
    10217: [0.25, 0.75, 0, 0, 0.44722],
    10815: [0, 0.68611, 0, 0, 0.9],
    10927: [0.19667, 0.69667, 0, 0, 0.89444],
    10928: [0.19667, 0.69667, 0, 0, 0.89444],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.11417, 0, 0.38611],
    34: [0, 0.69444, 0.07939, 0, 0.62055],
    35: [0.19444, 0.69444, 0.06833, 0, 0.94444],
    37: [0.05556, 0.75, 0.12861, 0, 0.94444],
    38: [0, 0.69444, 0.08528, 0, 0.88555],
    39: [0, 0.69444, 0.12945, 0, 0.35555],
    40: [0.25, 0.75, 0.15806, 0, 0.47333],
    41: [0.25, 0.75, 0.03306, 0, 0.47333],
    42: [0, 0.75, 0.14333, 0, 0.59111],
    43: [0.10333, 0.60333, 0.03306, 0, 0.88555],
    44: [0.19444, 0.14722, 0, 0, 0.35555],
    45: [0, 0.44444, 0.02611, 0, 0.41444],
    46: [0, 0.14722, 0, 0, 0.35555],
    47: [0.25, 0.75, 0.15806, 0, 0.59111],
    48: [0, 0.64444, 0.13167, 0, 0.59111],
    49: [0, 0.64444, 0.13167, 0, 0.59111],
    50: [0, 0.64444, 0.13167, 0, 0.59111],
    51: [0, 0.64444, 0.13167, 0, 0.59111],
    52: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    53: [0, 0.64444, 0.13167, 0, 0.59111],
    54: [0, 0.64444, 0.13167, 0, 0.59111],
    55: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    56: [0, 0.64444, 0.13167, 0, 0.59111],
    57: [0, 0.64444, 0.13167, 0, 0.59111],
    58: [0, 0.44444, 0.06695, 0, 0.35555],
    59: [0.19444, 0.44444, 0.06695, 0, 0.35555],
    61: [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    63: [0, 0.69444, 0.11472, 0, 0.59111],
    64: [0, 0.69444, 0.09208, 0, 0.88555],
    65: [0, 0.68611, 0, 0, 0.86555],
    66: [0, 0.68611, 0.0992, 0, 0.81666],
    67: [0, 0.68611, 0.14208, 0, 0.82666],
    68: [0, 0.68611, 0.09062, 0, 0.87555],
    69: [0, 0.68611, 0.11431, 0, 0.75666],
    70: [0, 0.68611, 0.12903, 0, 0.72722],
    71: [0, 0.68611, 0.07347, 0, 0.89527],
    72: [0, 0.68611, 0.17208, 0, 0.8961],
    73: [0, 0.68611, 0.15681, 0, 0.47166],
    74: [0, 0.68611, 0.145, 0, 0.61055],
    75: [0, 0.68611, 0.14208, 0, 0.89499],
    76: [0, 0.68611, 0, 0, 0.69777],
    77: [0, 0.68611, 0.17208, 0, 1.07277],
    78: [0, 0.68611, 0.17208, 0, 0.8961],
    79: [0, 0.68611, 0.09062, 0, 0.85499],
    80: [0, 0.68611, 0.0992, 0, 0.78721],
    81: [0.19444, 0.68611, 0.09062, 0, 0.85499],
    82: [0, 0.68611, 0.02559, 0, 0.85944],
    83: [0, 0.68611, 0.11264, 0, 0.64999],
    84: [0, 0.68611, 0.12903, 0, 0.7961],
    85: [0, 0.68611, 0.17208, 0, 0.88083],
    86: [0, 0.68611, 0.18625, 0, 0.86555],
    87: [0, 0.68611, 0.18625, 0, 1.15999],
    88: [0, 0.68611, 0.15681, 0, 0.86555],
    89: [0, 0.68611, 0.19803, 0, 0.86555],
    90: [0, 0.68611, 0.14208, 0, 0.70888],
    91: [0.25, 0.75, 0.1875, 0, 0.35611],
    93: [0.25, 0.75, 0.09972, 0, 0.35611],
    94: [0, 0.69444, 0.06709, 0, 0.59111],
    95: [0.31, 0.13444, 0.09811, 0, 0.59111],
    97: [0, 0.44444, 0.09426, 0, 0.59111],
    98: [0, 0.69444, 0.07861, 0, 0.53222],
    99: [0, 0.44444, 0.05222, 0, 0.53222],
    100: [0, 0.69444, 0.10861, 0, 0.59111],
    101: [0, 0.44444, 0.085, 0, 0.53222],
    102: [0.19444, 0.69444, 0.21778, 0, 0.4],
    103: [0.19444, 0.44444, 0.105, 0, 0.53222],
    104: [0, 0.69444, 0.09426, 0, 0.59111],
    105: [0, 0.69326, 0.11387, 0, 0.35555],
    106: [0.19444, 0.69326, 0.1672, 0, 0.35555],
    107: [0, 0.69444, 0.11111, 0, 0.53222],
    108: [0, 0.69444, 0.10861, 0, 0.29666],
    109: [0, 0.44444, 0.09426, 0, 0.94444],
    110: [0, 0.44444, 0.09426, 0, 0.64999],
    111: [0, 0.44444, 0.07861, 0, 0.59111],
    112: [0.19444, 0.44444, 0.07861, 0, 0.59111],
    113: [0.19444, 0.44444, 0.105, 0, 0.53222],
    114: [0, 0.44444, 0.11111, 0, 0.50167],
    115: [0, 0.44444, 0.08167, 0, 0.48694],
    116: [0, 0.63492, 0.09639, 0, 0.385],
    117: [0, 0.44444, 0.09426, 0, 0.62055],
    118: [0, 0.44444, 0.11111, 0, 0.53222],
    119: [0, 0.44444, 0.11111, 0, 0.76777],
    120: [0, 0.44444, 0.12583, 0, 0.56055],
    121: [0.19444, 0.44444, 0.105, 0, 0.56166],
    122: [0, 0.44444, 0.13889, 0, 0.49055],
    126: [0.35, 0.34444, 0.11472, 0, 0.59111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0.11473, 0, 0.59111],
    176: [0, 0.69444, 0, 0, 0.94888],
    184: [0.17014, 0, 0, 0, 0.53222],
    198: [0, 0.68611, 0.11431, 0, 1.02277],
    216: [0.04861, 0.73472, 0.09062, 0, 0.88555],
    223: [0.19444, 0.69444, 0.09736, 0, 0.665],
    230: [0, 0.44444, 0.085, 0, 0.82666],
    248: [0.09722, 0.54167, 0.09458, 0, 0.59111],
    305: [0, 0.44444, 0.09426, 0, 0.35555],
    338: [0, 0.68611, 0.11431, 0, 1.14054],
    339: [0, 0.44444, 0.085, 0, 0.82666],
    567: [0.19444, 0.44444, 0.04611, 0, 0.385],
    710: [0, 0.69444, 0.06709, 0, 0.59111],
    711: [0, 0.63194, 0.08271, 0, 0.59111],
    713: [0, 0.59444, 0.10444, 0, 0.59111],
    714: [0, 0.69444, 0.08528, 0, 0.59111],
    715: [0, 0.69444, 0, 0, 0.59111],
    728: [0, 0.69444, 0.10333, 0, 0.59111],
    729: [0, 0.69444, 0.12945, 0, 0.35555],
    730: [0, 0.69444, 0, 0, 0.94888],
    732: [0, 0.69444, 0.11472, 0, 0.59111],
    733: [0, 0.69444, 0.11472, 0, 0.59111],
    915: [0, 0.68611, 0.12903, 0, 0.69777],
    916: [0, 0.68611, 0, 0, 0.94444],
    920: [0, 0.68611, 0.09062, 0, 0.88555],
    923: [0, 0.68611, 0, 0, 0.80666],
    926: [0, 0.68611, 0.15092, 0, 0.76777],
    928: [0, 0.68611, 0.17208, 0, 0.8961],
    931: [0, 0.68611, 0.11431, 0, 0.82666],
    933: [0, 0.68611, 0.10778, 0, 0.88555],
    934: [0, 0.68611, 0.05632, 0, 0.82666],
    936: [0, 0.68611, 0.10778, 0, 0.88555],
    937: [0, 0.68611, 0.0992, 0, 0.82666],
    8211: [0, 0.44444, 0.09811, 0, 0.59111],
    8212: [0, 0.44444, 0.09811, 0, 1.18221],
    8216: [0, 0.69444, 0.12945, 0, 0.35555],
    8217: [0, 0.69444, 0.12945, 0, 0.35555],
    8220: [0, 0.69444, 0.16772, 0, 0.62055],
    8221: [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.12417, 0, 0.30667],
    34: [0, 0.69444, 0.06961, 0, 0.51444],
    35: [0.19444, 0.69444, 0.06616, 0, 0.81777],
    37: [0.05556, 0.75, 0.13639, 0, 0.81777],
    38: [0, 0.69444, 0.09694, 0, 0.76666],
    39: [0, 0.69444, 0.12417, 0, 0.30667],
    40: [0.25, 0.75, 0.16194, 0, 0.40889],
    41: [0.25, 0.75, 0.03694, 0, 0.40889],
    42: [0, 0.75, 0.14917, 0, 0.51111],
    43: [0.05667, 0.56167, 0.03694, 0, 0.76666],
    44: [0.19444, 0.10556, 0, 0, 0.30667],
    45: [0, 0.43056, 0.02826, 0, 0.35778],
    46: [0, 0.10556, 0, 0, 0.30667],
    47: [0.25, 0.75, 0.16194, 0, 0.51111],
    48: [0, 0.64444, 0.13556, 0, 0.51111],
    49: [0, 0.64444, 0.13556, 0, 0.51111],
    50: [0, 0.64444, 0.13556, 0, 0.51111],
    51: [0, 0.64444, 0.13556, 0, 0.51111],
    52: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    53: [0, 0.64444, 0.13556, 0, 0.51111],
    54: [0, 0.64444, 0.13556, 0, 0.51111],
    55: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    56: [0, 0.64444, 0.13556, 0, 0.51111],
    57: [0, 0.64444, 0.13556, 0, 0.51111],
    58: [0, 0.43056, 0.0582, 0, 0.30667],
    59: [0.19444, 0.43056, 0.0582, 0, 0.30667],
    61: [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    63: [0, 0.69444, 0.1225, 0, 0.51111],
    64: [0, 0.69444, 0.09597, 0, 0.76666],
    65: [0, 0.68333, 0, 0, 0.74333],
    66: [0, 0.68333, 0.10257, 0, 0.70389],
    67: [0, 0.68333, 0.14528, 0, 0.71555],
    68: [0, 0.68333, 0.09403, 0, 0.755],
    69: [0, 0.68333, 0.12028, 0, 0.67833],
    70: [0, 0.68333, 0.13305, 0, 0.65277],
    71: [0, 0.68333, 0.08722, 0, 0.77361],
    72: [0, 0.68333, 0.16389, 0, 0.74333],
    73: [0, 0.68333, 0.15806, 0, 0.38555],
    74: [0, 0.68333, 0.14028, 0, 0.525],
    75: [0, 0.68333, 0.14528, 0, 0.76888],
    76: [0, 0.68333, 0, 0, 0.62722],
    77: [0, 0.68333, 0.16389, 0, 0.89666],
    78: [0, 0.68333, 0.16389, 0, 0.74333],
    79: [0, 0.68333, 0.09403, 0, 0.76666],
    80: [0, 0.68333, 0.10257, 0, 0.67833],
    81: [0.19444, 0.68333, 0.09403, 0, 0.76666],
    82: [0, 0.68333, 0.03868, 0, 0.72944],
    83: [0, 0.68333, 0.11972, 0, 0.56222],
    84: [0, 0.68333, 0.13305, 0, 0.71555],
    85: [0, 0.68333, 0.16389, 0, 0.74333],
    86: [0, 0.68333, 0.18361, 0, 0.74333],
    87: [0, 0.68333, 0.18361, 0, 0.99888],
    88: [0, 0.68333, 0.15806, 0, 0.74333],
    89: [0, 0.68333, 0.19383, 0, 0.74333],
    90: [0, 0.68333, 0.14528, 0, 0.61333],
    91: [0.25, 0.75, 0.1875, 0, 0.30667],
    93: [0.25, 0.75, 0.10528, 0, 0.30667],
    94: [0, 0.69444, 0.06646, 0, 0.51111],
    95: [0.31, 0.12056, 0.09208, 0, 0.51111],
    97: [0, 0.43056, 0.07671, 0, 0.51111],
    98: [0, 0.69444, 0.06312, 0, 0.46],
    99: [0, 0.43056, 0.05653, 0, 0.46],
    100: [0, 0.69444, 0.10333, 0, 0.51111],
    101: [0, 0.43056, 0.07514, 0, 0.46],
    102: [0.19444, 0.69444, 0.21194, 0, 0.30667],
    103: [0.19444, 0.43056, 0.08847, 0, 0.46],
    104: [0, 0.69444, 0.07671, 0, 0.51111],
    105: [0, 0.65536, 0.1019, 0, 0.30667],
    106: [0.19444, 0.65536, 0.14467, 0, 0.30667],
    107: [0, 0.69444, 0.10764, 0, 0.46],
    108: [0, 0.69444, 0.10333, 0, 0.25555],
    109: [0, 0.43056, 0.07671, 0, 0.81777],
    110: [0, 0.43056, 0.07671, 0, 0.56222],
    111: [0, 0.43056, 0.06312, 0, 0.51111],
    112: [0.19444, 0.43056, 0.06312, 0, 0.51111],
    113: [0.19444, 0.43056, 0.08847, 0, 0.46],
    114: [0, 0.43056, 0.10764, 0, 0.42166],
    115: [0, 0.43056, 0.08208, 0, 0.40889],
    116: [0, 0.61508, 0.09486, 0, 0.33222],
    117: [0, 0.43056, 0.07671, 0, 0.53666],
    118: [0, 0.43056, 0.10764, 0, 0.46],
    119: [0, 0.43056, 0.10764, 0, 0.66444],
    120: [0, 0.43056, 0.12042, 0, 0.46389],
    121: [0.19444, 0.43056, 0.08847, 0, 0.48555],
    122: [0, 0.43056, 0.12292, 0, 0.40889],
    126: [0.35, 0.31786, 0.11585, 0, 0.51111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.66786, 0.10474, 0, 0.51111],
    176: [0, 0.69444, 0, 0, 0.83129],
    184: [0.17014, 0, 0, 0, 0.46],
    198: [0, 0.68333, 0.12028, 0, 0.88277],
    216: [0.04861, 0.73194, 0.09403, 0, 0.76666],
    223: [0.19444, 0.69444, 0.10514, 0, 0.53666],
    230: [0, 0.43056, 0.07514, 0, 0.71555],
    248: [0.09722, 0.52778, 0.09194, 0, 0.51111],
    338: [0, 0.68333, 0.12028, 0, 0.98499],
    339: [0, 0.43056, 0.07514, 0, 0.71555],
    710: [0, 0.69444, 0.06646, 0, 0.51111],
    711: [0, 0.62847, 0.08295, 0, 0.51111],
    713: [0, 0.56167, 0.10333, 0, 0.51111],
    714: [0, 0.69444, 0.09694, 0, 0.51111],
    715: [0, 0.69444, 0, 0, 0.51111],
    728: [0, 0.69444, 0.10806, 0, 0.51111],
    729: [0, 0.66786, 0.11752, 0, 0.30667],
    730: [0, 0.69444, 0, 0, 0.83129],
    732: [0, 0.66786, 0.11585, 0, 0.51111],
    733: [0, 0.69444, 0.1225, 0, 0.51111],
    915: [0, 0.68333, 0.13305, 0, 0.62722],
    916: [0, 0.68333, 0, 0, 0.81777],
    920: [0, 0.68333, 0.09403, 0, 0.76666],
    923: [0, 0.68333, 0, 0, 0.69222],
    926: [0, 0.68333, 0.15294, 0, 0.66444],
    928: [0, 0.68333, 0.16389, 0, 0.74333],
    931: [0, 0.68333, 0.12028, 0, 0.71555],
    933: [0, 0.68333, 0.11111, 0, 0.76666],
    934: [0, 0.68333, 0.05986, 0, 0.71555],
    936: [0, 0.68333, 0.11111, 0, 0.76666],
    937: [0, 0.68333, 0.10257, 0, 0.71555],
    8211: [0, 0.43056, 0.09208, 0, 0.51111],
    8212: [0, 0.43056, 0.09208, 0, 1.02222],
    8216: [0, 0.69444, 0.12417, 0, 0.30667],
    8217: [0, 0.69444, 0.12417, 0, 0.30667],
    8220: [0, 0.69444, 0.1685, 0, 0.51444],
    8221: [0, 0.69444, 0.06961, 0, 0.51444],
    8463: [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.27778],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.77778],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.19444, 0.10556, 0, 0, 0.27778],
    45: [0, 0.43056, 0, 0, 0.33333],
    46: [0, 0.10556, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.64444, 0, 0, 0.5],
    49: [0, 0.64444, 0, 0, 0.5],
    50: [0, 0.64444, 0, 0, 0.5],
    51: [0, 0.64444, 0, 0, 0.5],
    52: [0, 0.64444, 0, 0, 0.5],
    53: [0, 0.64444, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0, 0.64444, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0, 0.64444, 0, 0, 0.5],
    58: [0, 0.43056, 0, 0, 0.27778],
    59: [0.19444, 0.43056, 0, 0, 0.27778],
    60: [0.0391, 0.5391, 0, 0, 0.77778],
    61: [-0.13313, 0.36687, 0, 0, 0.77778],
    62: [0.0391, 0.5391, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.77778],
    65: [0, 0.68333, 0, 0, 0.75],
    66: [0, 0.68333, 0, 0, 0.70834],
    67: [0, 0.68333, 0, 0, 0.72222],
    68: [0, 0.68333, 0, 0, 0.76389],
    69: [0, 0.68333, 0, 0, 0.68056],
    70: [0, 0.68333, 0, 0, 0.65278],
    71: [0, 0.68333, 0, 0, 0.78472],
    72: [0, 0.68333, 0, 0, 0.75],
    73: [0, 0.68333, 0, 0, 0.36111],
    74: [0, 0.68333, 0, 0, 0.51389],
    75: [0, 0.68333, 0, 0, 0.77778],
    76: [0, 0.68333, 0, 0, 0.625],
    77: [0, 0.68333, 0, 0, 0.91667],
    78: [0, 0.68333, 0, 0, 0.75],
    79: [0, 0.68333, 0, 0, 0.77778],
    80: [0, 0.68333, 0, 0, 0.68056],
    81: [0.19444, 0.68333, 0, 0, 0.77778],
    82: [0, 0.68333, 0, 0, 0.73611],
    83: [0, 0.68333, 0, 0, 0.55556],
    84: [0, 0.68333, 0, 0, 0.72222],
    85: [0, 0.68333, 0, 0, 0.75],
    86: [0, 0.68333, 0.01389, 0, 0.75],
    87: [0, 0.68333, 0.01389, 0, 1.02778],
    88: [0, 0.68333, 0, 0, 0.75],
    89: [0, 0.68333, 0.025, 0, 0.75],
    90: [0, 0.68333, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.27778],
    92: [0.25, 0.75, 0, 0, 0.5],
    93: [0.25, 0.75, 0, 0, 0.27778],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.31, 0.12056, 0.02778, 0, 0.5],
    97: [0, 0.43056, 0, 0, 0.5],
    98: [0, 0.69444, 0, 0, 0.55556],
    99: [0, 0.43056, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.55556],
    101: [0, 0.43056, 0, 0, 0.44445],
    102: [0, 0.69444, 0.07778, 0, 0.30556],
    103: [0.19444, 0.43056, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.55556],
    105: [0, 0.66786, 0, 0, 0.27778],
    106: [0.19444, 0.66786, 0, 0, 0.30556],
    107: [0, 0.69444, 0, 0, 0.52778],
    108: [0, 0.69444, 0, 0, 0.27778],
    109: [0, 0.43056, 0, 0, 0.83334],
    110: [0, 0.43056, 0, 0, 0.55556],
    111: [0, 0.43056, 0, 0, 0.5],
    112: [0.19444, 0.43056, 0, 0, 0.55556],
    113: [0.19444, 0.43056, 0, 0, 0.52778],
    114: [0, 0.43056, 0, 0, 0.39167],
    115: [0, 0.43056, 0, 0, 0.39445],
    116: [0, 0.61508, 0, 0, 0.38889],
    117: [0, 0.43056, 0, 0, 0.55556],
    118: [0, 0.43056, 0.01389, 0, 0.52778],
    119: [0, 0.43056, 0.01389, 0, 0.72222],
    120: [0, 0.43056, 0, 0, 0.52778],
    121: [0.19444, 0.43056, 0.01389, 0, 0.52778],
    122: [0, 0.43056, 0, 0, 0.44445],
    123: [0.25, 0.75, 0, 0, 0.5],
    124: [0.25, 0.75, 0, 0, 0.27778],
    125: [0.25, 0.75, 0, 0, 0.5],
    126: [0.35, 0.31786, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.76909],
    167: [0.19444, 0.69444, 0, 0, 0.44445],
    168: [0, 0.66786, 0, 0, 0.5],
    172: [0, 0.43056, 0, 0, 0.66667],
    176: [0, 0.69444, 0, 0, 0.75],
    177: [0.08333, 0.58333, 0, 0, 0.77778],
    182: [0.19444, 0.69444, 0, 0, 0.61111],
    184: [0.17014, 0, 0, 0, 0.44445],
    198: [0, 0.68333, 0, 0, 0.90278],
    215: [0.08333, 0.58333, 0, 0, 0.77778],
    216: [0.04861, 0.73194, 0, 0, 0.77778],
    223: [0, 0.69444, 0, 0, 0.5],
    230: [0, 0.43056, 0, 0, 0.72222],
    247: [0.08333, 0.58333, 0, 0, 0.77778],
    248: [0.09722, 0.52778, 0, 0, 0.5],
    305: [0, 0.43056, 0, 0, 0.27778],
    338: [0, 0.68333, 0, 0, 1.01389],
    339: [0, 0.43056, 0, 0, 0.77778],
    567: [0.19444, 0.43056, 0, 0, 0.30556],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.62847, 0, 0, 0.5],
    713: [0, 0.56778, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.66786, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.75],
    732: [0, 0.66786, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.68333, 0, 0, 0.625],
    916: [0, 0.68333, 0, 0, 0.83334],
    920: [0, 0.68333, 0, 0, 0.77778],
    923: [0, 0.68333, 0, 0, 0.69445],
    926: [0, 0.68333, 0, 0, 0.66667],
    928: [0, 0.68333, 0, 0, 0.75],
    931: [0, 0.68333, 0, 0, 0.72222],
    933: [0, 0.68333, 0, 0, 0.77778],
    934: [0, 0.68333, 0, 0, 0.72222],
    936: [0, 0.68333, 0, 0, 0.77778],
    937: [0, 0.68333, 0, 0, 0.72222],
    8211: [0, 0.43056, 0.02778, 0, 0.5],
    8212: [0, 0.43056, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5],
    8224: [0.19444, 0.69444, 0, 0, 0.44445],
    8225: [0.19444, 0.69444, 0, 0, 0.44445],
    8230: [0, 0.123, 0, 0, 1.172],
    8242: [0, 0.55556, 0, 0, 0.275],
    8407: [0, 0.71444, 0.15382, 0, 0.5],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8465: [0, 0.69444, 0, 0, 0.72222],
    8467: [0, 0.69444, 0, 0.11111, 0.41667],
    8472: [0.19444, 0.43056, 0, 0.11111, 0.63646],
    8476: [0, 0.69444, 0, 0, 0.72222],
    8501: [0, 0.69444, 0, 0, 0.61111],
    8592: [-0.13313, 0.36687, 0, 0, 1],
    8593: [0.19444, 0.69444, 0, 0, 0.5],
    8594: [-0.13313, 0.36687, 0, 0, 1],
    8595: [0.19444, 0.69444, 0, 0, 0.5],
    8596: [-0.13313, 0.36687, 0, 0, 1],
    8597: [0.25, 0.75, 0, 0, 0.5],
    8598: [0.19444, 0.69444, 0, 0, 1],
    8599: [0.19444, 0.69444, 0, 0, 1],
    8600: [0.19444, 0.69444, 0, 0, 1],
    8601: [0.19444, 0.69444, 0, 0, 1],
    8614: [0.011, 0.511, 0, 0, 1],
    8617: [0.011, 0.511, 0, 0, 1.126],
    8618: [0.011, 0.511, 0, 0, 1.126],
    8636: [-0.13313, 0.36687, 0, 0, 1],
    8637: [-0.13313, 0.36687, 0, 0, 1],
    8640: [-0.13313, 0.36687, 0, 0, 1],
    8641: [-0.13313, 0.36687, 0, 0, 1],
    8652: [0.011, 0.671, 0, 0, 1],
    8656: [-0.13313, 0.36687, 0, 0, 1],
    8657: [0.19444, 0.69444, 0, 0, 0.61111],
    8658: [-0.13313, 0.36687, 0, 0, 1],
    8659: [0.19444, 0.69444, 0, 0, 0.61111],
    8660: [-0.13313, 0.36687, 0, 0, 1],
    8661: [0.25, 0.75, 0, 0, 0.61111],
    8704: [0, 0.69444, 0, 0, 0.55556],
    8706: [0, 0.69444, 0.05556, 0.08334, 0.5309],
    8707: [0, 0.69444, 0, 0, 0.55556],
    8709: [0.05556, 0.75, 0, 0, 0.5],
    8711: [0, 0.68333, 0, 0, 0.83334],
    8712: [0.0391, 0.5391, 0, 0, 0.66667],
    8715: [0.0391, 0.5391, 0, 0, 0.66667],
    8722: [0.08333, 0.58333, 0, 0, 0.77778],
    8723: [0.08333, 0.58333, 0, 0, 0.77778],
    8725: [0.25, 0.75, 0, 0, 0.5],
    8726: [0.25, 0.75, 0, 0, 0.5],
    8727: [-0.03472, 0.46528, 0, 0, 0.5],
    8728: [-0.05555, 0.44445, 0, 0, 0.5],
    8729: [-0.05555, 0.44445, 0, 0, 0.5],
    8730: [0.2, 0.8, 0, 0, 0.83334],
    8733: [0, 0.43056, 0, 0, 0.77778],
    8734: [0, 0.43056, 0, 0, 1],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.27778],
    8741: [0.25, 0.75, 0, 0, 0.5],
    8743: [0, 0.55556, 0, 0, 0.66667],
    8744: [0, 0.55556, 0, 0, 0.66667],
    8745: [0, 0.55556, 0, 0, 0.66667],
    8746: [0, 0.55556, 0, 0, 0.66667],
    8747: [0.19444, 0.69444, 0.11111, 0, 0.41667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8768: [0.19444, 0.69444, 0, 0, 0.27778],
    8771: [-0.03625, 0.46375, 0, 0, 0.77778],
    8773: [-0.022, 0.589, 0, 0, 0.778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8781: [-0.03625, 0.46375, 0, 0, 0.77778],
    8784: [-0.133, 0.673, 0, 0, 0.778],
    8801: [-0.03625, 0.46375, 0, 0, 0.77778],
    8804: [0.13597, 0.63597, 0, 0, 0.77778],
    8805: [0.13597, 0.63597, 0, 0, 0.77778],
    8810: [0.0391, 0.5391, 0, 0, 1],
    8811: [0.0391, 0.5391, 0, 0, 1],
    8826: [0.0391, 0.5391, 0, 0, 0.77778],
    8827: [0.0391, 0.5391, 0, 0, 0.77778],
    8834: [0.0391, 0.5391, 0, 0, 0.77778],
    8835: [0.0391, 0.5391, 0, 0, 0.77778],
    8838: [0.13597, 0.63597, 0, 0, 0.77778],
    8839: [0.13597, 0.63597, 0, 0, 0.77778],
    8846: [0, 0.55556, 0, 0, 0.66667],
    8849: [0.13597, 0.63597, 0, 0, 0.77778],
    8850: [0.13597, 0.63597, 0, 0, 0.77778],
    8851: [0, 0.55556, 0, 0, 0.66667],
    8852: [0, 0.55556, 0, 0, 0.66667],
    8853: [0.08333, 0.58333, 0, 0, 0.77778],
    8854: [0.08333, 0.58333, 0, 0, 0.77778],
    8855: [0.08333, 0.58333, 0, 0, 0.77778],
    8856: [0.08333, 0.58333, 0, 0, 0.77778],
    8857: [0.08333, 0.58333, 0, 0, 0.77778],
    8866: [0, 0.69444, 0, 0, 0.61111],
    8867: [0, 0.69444, 0, 0, 0.61111],
    8868: [0, 0.69444, 0, 0, 0.77778],
    8869: [0, 0.69444, 0, 0, 0.77778],
    8872: [0.249, 0.75, 0, 0, 0.867],
    8900: [-0.05555, 0.44445, 0, 0, 0.5],
    8901: [-0.05555, 0.44445, 0, 0, 0.27778],
    8902: [-0.03472, 0.46528, 0, 0, 0.5],
    8904: [5e-3, 0.505, 0, 0, 0.9],
    8942: [0.03, 0.903, 0, 0, 0.278],
    8943: [-0.19, 0.313, 0, 0, 1.172],
    8945: [-0.1, 0.823, 0, 0, 1.282],
    8968: [0.25, 0.75, 0, 0, 0.44445],
    8969: [0.25, 0.75, 0, 0, 0.44445],
    8970: [0.25, 0.75, 0, 0, 0.44445],
    8971: [0.25, 0.75, 0, 0, 0.44445],
    8994: [-0.14236, 0.35764, 0, 0, 1],
    8995: [-0.14236, 0.35764, 0, 0, 1],
    9136: [0.244, 0.744, 0, 0, 0.412],
    9137: [0.244, 0.745, 0, 0, 0.412],
    9651: [0.19444, 0.69444, 0, 0, 0.88889],
    9657: [-0.03472, 0.46528, 0, 0, 0.5],
    9661: [0.19444, 0.69444, 0, 0, 0.88889],
    9667: [-0.03472, 0.46528, 0, 0, 0.5],
    9711: [0.19444, 0.69444, 0, 0, 1],
    9824: [0.12963, 0.69444, 0, 0, 0.77778],
    9825: [0.12963, 0.69444, 0, 0, 0.77778],
    9826: [0.12963, 0.69444, 0, 0, 0.77778],
    9827: [0.12963, 0.69444, 0, 0, 0.77778],
    9837: [0, 0.75, 0, 0, 0.38889],
    9838: [0.19444, 0.69444, 0, 0, 0.38889],
    9839: [0.19444, 0.69444, 0, 0, 0.38889],
    10216: [0.25, 0.75, 0, 0, 0.38889],
    10217: [0.25, 0.75, 0, 0, 0.38889],
    10222: [0.244, 0.744, 0, 0, 0.412],
    10223: [0.244, 0.745, 0, 0, 0.412],
    10229: [0.011, 0.511, 0, 0, 1.609],
    10230: [0.011, 0.511, 0, 0, 1.638],
    10231: [0.011, 0.511, 0, 0, 1.859],
    10232: [0.024, 0.525, 0, 0, 1.609],
    10233: [0.024, 0.525, 0, 0, 1.638],
    10234: [0.024, 0.525, 0, 0, 1.858],
    10236: [0.011, 0.511, 0, 0, 1.638],
    10815: [0, 0.68333, 0, 0, 0.75],
    10927: [0.13597, 0.63597, 0, 0, 0.77778],
    10928: [0.13597, 0.63597, 0, 0, 0.77778],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.44444, 0, 0, 0.575],
    49: [0, 0.44444, 0, 0, 0.575],
    50: [0, 0.44444, 0, 0, 0.575],
    51: [0.19444, 0.44444, 0, 0, 0.575],
    52: [0.19444, 0.44444, 0, 0, 0.575],
    53: [0.19444, 0.44444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0.19444, 0.44444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0.19444, 0.44444, 0, 0, 0.575],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0.04835, 0, 0.8664],
    67: [0, 0.68611, 0.06979, 0, 0.81694],
    68: [0, 0.68611, 0.03194, 0, 0.93812],
    69: [0, 0.68611, 0.05451, 0, 0.81007],
    70: [0, 0.68611, 0.15972, 0, 0.68889],
    71: [0, 0.68611, 0, 0, 0.88673],
    72: [0, 0.68611, 0.08229, 0, 0.98229],
    73: [0, 0.68611, 0.07778, 0, 0.51111],
    74: [0, 0.68611, 0.10069, 0, 0.63125],
    75: [0, 0.68611, 0.06979, 0, 0.97118],
    76: [0, 0.68611, 0, 0, 0.75555],
    77: [0, 0.68611, 0.11424, 0, 1.14201],
    78: [0, 0.68611, 0.11424, 0, 0.95034],
    79: [0, 0.68611, 0.03194, 0, 0.83666],
    80: [0, 0.68611, 0.15972, 0, 0.72309],
    81: [0.19444, 0.68611, 0, 0, 0.86861],
    82: [0, 0.68611, 421e-5, 0, 0.87235],
    83: [0, 0.68611, 0.05382, 0, 0.69271],
    84: [0, 0.68611, 0.15972, 0, 0.63663],
    85: [0, 0.68611, 0.11424, 0, 0.80027],
    86: [0, 0.68611, 0.25555, 0, 0.67778],
    87: [0, 0.68611, 0.15972, 0, 1.09305],
    88: [0, 0.68611, 0.07778, 0, 0.94722],
    89: [0, 0.68611, 0.25555, 0, 0.67458],
    90: [0, 0.68611, 0.06979, 0, 0.77257],
    97: [0, 0.44444, 0, 0, 0.63287],
    98: [0, 0.69444, 0, 0, 0.52083],
    99: [0, 0.44444, 0, 0, 0.51342],
    100: [0, 0.69444, 0, 0, 0.60972],
    101: [0, 0.44444, 0, 0, 0.55361],
    102: [0.19444, 0.69444, 0.11042, 0, 0.56806],
    103: [0.19444, 0.44444, 0.03704, 0, 0.5449],
    104: [0, 0.69444, 0, 0, 0.66759],
    105: [0, 0.69326, 0, 0, 0.4048],
    106: [0.19444, 0.69326, 0.0622, 0, 0.47083],
    107: [0, 0.69444, 0.01852, 0, 0.6037],
    108: [0, 0.69444, 88e-4, 0, 0.34815],
    109: [0, 0.44444, 0, 0, 1.0324],
    110: [0, 0.44444, 0, 0, 0.71296],
    111: [0, 0.44444, 0, 0, 0.58472],
    112: [0.19444, 0.44444, 0, 0, 0.60092],
    113: [0.19444, 0.44444, 0.03704, 0, 0.54213],
    114: [0, 0.44444, 0.03194, 0, 0.5287],
    115: [0, 0.44444, 0, 0, 0.53125],
    116: [0, 0.63492, 0, 0, 0.41528],
    117: [0, 0.44444, 0, 0, 0.68102],
    118: [0, 0.44444, 0.03704, 0, 0.56666],
    119: [0, 0.44444, 0.02778, 0, 0.83148],
    120: [0, 0.44444, 0, 0, 0.65903],
    121: [0.19444, 0.44444, 0.03704, 0, 0.59028],
    122: [0, 0.44444, 0.04213, 0, 0.55509],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68611, 0.15972, 0, 0.65694],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0.03194, 0, 0.86722],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0.07458, 0, 0.84125],
    928: [0, 0.68611, 0.08229, 0, 0.98229],
    931: [0, 0.68611, 0.05451, 0, 0.88507],
    933: [0, 0.68611, 0.15972, 0, 0.67083],
    934: [0, 0.68611, 0, 0, 0.76666],
    936: [0, 0.68611, 0.11653, 0, 0.71402],
    937: [0, 0.68611, 0.04835, 0, 0.8789],
    945: [0, 0.44444, 0, 0, 0.76064],
    946: [0.19444, 0.69444, 0.03403, 0, 0.65972],
    947: [0.19444, 0.44444, 0.06389, 0, 0.59003],
    948: [0, 0.69444, 0.03819, 0, 0.52222],
    949: [0, 0.44444, 0, 0, 0.52882],
    950: [0.19444, 0.69444, 0.06215, 0, 0.50833],
    951: [0.19444, 0.44444, 0.03704, 0, 0.6],
    952: [0, 0.69444, 0.03194, 0, 0.5618],
    953: [0, 0.44444, 0, 0, 0.41204],
    954: [0, 0.44444, 0, 0, 0.66759],
    955: [0, 0.69444, 0, 0, 0.67083],
    956: [0.19444, 0.44444, 0, 0, 0.70787],
    957: [0, 0.44444, 0.06898, 0, 0.57685],
    958: [0.19444, 0.69444, 0.03021, 0, 0.50833],
    959: [0, 0.44444, 0, 0, 0.58472],
    960: [0, 0.44444, 0.03704, 0, 0.68241],
    961: [0.19444, 0.44444, 0, 0, 0.6118],
    962: [0.09722, 0.44444, 0.07917, 0, 0.42361],
    963: [0, 0.44444, 0.03704, 0, 0.68588],
    964: [0, 0.44444, 0.13472, 0, 0.52083],
    965: [0, 0.44444, 0.03704, 0, 0.63055],
    966: [0.19444, 0.44444, 0, 0, 0.74722],
    967: [0.19444, 0.44444, 0, 0, 0.71805],
    968: [0.19444, 0.69444, 0.03704, 0, 0.75833],
    969: [0, 0.44444, 0.03704, 0, 0.71782],
    977: [0, 0.69444, 0, 0, 0.69155],
    981: [0.19444, 0.69444, 0, 0, 0.7125],
    982: [0, 0.44444, 0.03194, 0, 0.975],
    1009: [0.19444, 0.44444, 0, 0, 0.6118],
    1013: [0, 0.44444, 0, 0, 0.48333],
    57649: [0, 0.44444, 0, 0, 0.39352],
    57911: [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.43056, 0, 0, 0.5],
    49: [0, 0.43056, 0, 0, 0.5],
    50: [0, 0.43056, 0, 0, 0.5],
    51: [0.19444, 0.43056, 0, 0, 0.5],
    52: [0.19444, 0.43056, 0, 0, 0.5],
    53: [0.19444, 0.43056, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0.19444, 0.43056, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0.19444, 0.43056, 0, 0, 0.5],
    65: [0, 0.68333, 0, 0.13889, 0.75],
    66: [0, 0.68333, 0.05017, 0.08334, 0.75851],
    67: [0, 0.68333, 0.07153, 0.08334, 0.71472],
    68: [0, 0.68333, 0.02778, 0.05556, 0.82792],
    69: [0, 0.68333, 0.05764, 0.08334, 0.7382],
    70: [0, 0.68333, 0.13889, 0.08334, 0.64306],
    71: [0, 0.68333, 0, 0.08334, 0.78625],
    72: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    73: [0, 0.68333, 0.07847, 0.11111, 0.43958],
    74: [0, 0.68333, 0.09618, 0.16667, 0.55451],
    75: [0, 0.68333, 0.07153, 0.05556, 0.84931],
    76: [0, 0.68333, 0, 0.02778, 0.68056],
    77: [0, 0.68333, 0.10903, 0.08334, 0.97014],
    78: [0, 0.68333, 0.10903, 0.08334, 0.80347],
    79: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    80: [0, 0.68333, 0.13889, 0.08334, 0.64201],
    81: [0.19444, 0.68333, 0, 0.08334, 0.79056],
    82: [0, 0.68333, 773e-5, 0.08334, 0.75929],
    83: [0, 0.68333, 0.05764, 0.08334, 0.6132],
    84: [0, 0.68333, 0.13889, 0.08334, 0.58438],
    85: [0, 0.68333, 0.10903, 0.02778, 0.68278],
    86: [0, 0.68333, 0.22222, 0, 0.58333],
    87: [0, 0.68333, 0.13889, 0, 0.94445],
    88: [0, 0.68333, 0.07847, 0.08334, 0.82847],
    89: [0, 0.68333, 0.22222, 0, 0.58056],
    90: [0, 0.68333, 0.07153, 0.08334, 0.68264],
    97: [0, 0.43056, 0, 0, 0.52859],
    98: [0, 0.69444, 0, 0, 0.42917],
    99: [0, 0.43056, 0, 0.05556, 0.43276],
    100: [0, 0.69444, 0, 0.16667, 0.52049],
    101: [0, 0.43056, 0, 0.05556, 0.46563],
    102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    104: [0, 0.69444, 0, 0, 0.57616],
    105: [0, 0.65952, 0, 0, 0.34451],
    106: [0.19444, 0.65952, 0.05724, 0, 0.41181],
    107: [0, 0.69444, 0.03148, 0, 0.5206],
    108: [0, 0.69444, 0.01968, 0.08334, 0.29838],
    109: [0, 0.43056, 0, 0, 0.87801],
    110: [0, 0.43056, 0, 0, 0.60023],
    111: [0, 0.43056, 0, 0.05556, 0.48472],
    112: [0.19444, 0.43056, 0, 0.08334, 0.50313],
    113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    114: [0, 0.43056, 0.02778, 0.05556, 0.45116],
    115: [0, 0.43056, 0, 0.05556, 0.46875],
    116: [0, 0.61508, 0, 0.08334, 0.36111],
    117: [0, 0.43056, 0, 0.02778, 0.57246],
    118: [0, 0.43056, 0.03588, 0.02778, 0.48472],
    119: [0, 0.43056, 0.02691, 0.08334, 0.71592],
    120: [0, 0.43056, 0, 0.02778, 0.57153],
    121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    122: [0, 0.43056, 0.04398, 0.05556, 0.46505],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68333, 0.13889, 0.08334, 0.61528],
    916: [0, 0.68333, 0, 0.16667, 0.83334],
    920: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    923: [0, 0.68333, 0, 0.16667, 0.69445],
    926: [0, 0.68333, 0.07569, 0.08334, 0.74236],
    928: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    931: [0, 0.68333, 0.05764, 0.08334, 0.77986],
    933: [0, 0.68333, 0.13889, 0.05556, 0.58333],
    934: [0, 0.68333, 0, 0.08334, 0.66667],
    936: [0, 0.68333, 0.11, 0.05556, 0.61222],
    937: [0, 0.68333, 0.05017, 0.08334, 0.7724],
    945: [0, 0.43056, 37e-4, 0.02778, 0.6397],
    946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    947: [0.19444, 0.43056, 0.05556, 0, 0.51773],
    948: [0, 0.69444, 0.03785, 0.05556, 0.44444],
    949: [0, 0.43056, 0, 0.08334, 0.46632],
    950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    952: [0, 0.69444, 0.02778, 0.08334, 0.46944],
    953: [0, 0.43056, 0, 0.05556, 0.35394],
    954: [0, 0.43056, 0, 0, 0.57616],
    955: [0, 0.69444, 0, 0, 0.58334],
    956: [0.19444, 0.43056, 0, 0.02778, 0.60255],
    957: [0, 0.43056, 0.06366, 0.02778, 0.49398],
    958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    959: [0, 0.43056, 0, 0.05556, 0.48472],
    960: [0, 0.43056, 0.03588, 0, 0.57003],
    961: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    963: [0, 0.43056, 0.03588, 0, 0.57141],
    964: [0, 0.43056, 0.1132, 0.02778, 0.43715],
    965: [0, 0.43056, 0.03588, 0.02778, 0.54028],
    966: [0.19444, 0.43056, 0, 0.08334, 0.65417],
    967: [0.19444, 0.43056, 0, 0.05556, 0.62569],
    968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    969: [0, 0.43056, 0.03588, 0, 0.62245],
    977: [0, 0.69444, 0, 0.08334, 0.59144],
    981: [0.19444, 0.69444, 0, 0.08334, 0.59583],
    982: [0, 0.43056, 0.02778, 0, 0.82813],
    1009: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    1013: [0, 0.43056, 0, 0.05556, 0.4059],
    57649: [0, 0.43056, 0, 0.02778, 0.32246],
    57911: [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.36667],
    34: [0, 0.69444, 0, 0, 0.55834],
    35: [0.19444, 0.69444, 0, 0, 0.91667],
    36: [0.05556, 0.75, 0, 0, 0.55],
    37: [0.05556, 0.75, 0, 0, 1.02912],
    38: [0, 0.69444, 0, 0, 0.83056],
    39: [0, 0.69444, 0, 0, 0.30556],
    40: [0.25, 0.75, 0, 0, 0.42778],
    41: [0.25, 0.75, 0, 0, 0.42778],
    42: [0, 0.75, 0, 0, 0.55],
    43: [0.11667, 0.61667, 0, 0, 0.85556],
    44: [0.10556, 0.13056, 0, 0, 0.30556],
    45: [0, 0.45833, 0, 0, 0.36667],
    46: [0, 0.13056, 0, 0, 0.30556],
    47: [0.25, 0.75, 0, 0, 0.55],
    48: [0, 0.69444, 0, 0, 0.55],
    49: [0, 0.69444, 0, 0, 0.55],
    50: [0, 0.69444, 0, 0, 0.55],
    51: [0, 0.69444, 0, 0, 0.55],
    52: [0, 0.69444, 0, 0, 0.55],
    53: [0, 0.69444, 0, 0, 0.55],
    54: [0, 0.69444, 0, 0, 0.55],
    55: [0, 0.69444, 0, 0, 0.55],
    56: [0, 0.69444, 0, 0, 0.55],
    57: [0, 0.69444, 0, 0, 0.55],
    58: [0, 0.45833, 0, 0, 0.30556],
    59: [0.10556, 0.45833, 0, 0, 0.30556],
    61: [-0.09375, 0.40625, 0, 0, 0.85556],
    63: [0, 0.69444, 0, 0, 0.51945],
    64: [0, 0.69444, 0, 0, 0.73334],
    65: [0, 0.69444, 0, 0, 0.73334],
    66: [0, 0.69444, 0, 0, 0.73334],
    67: [0, 0.69444, 0, 0, 0.70278],
    68: [0, 0.69444, 0, 0, 0.79445],
    69: [0, 0.69444, 0, 0, 0.64167],
    70: [0, 0.69444, 0, 0, 0.61111],
    71: [0, 0.69444, 0, 0, 0.73334],
    72: [0, 0.69444, 0, 0, 0.79445],
    73: [0, 0.69444, 0, 0, 0.33056],
    74: [0, 0.69444, 0, 0, 0.51945],
    75: [0, 0.69444, 0, 0, 0.76389],
    76: [0, 0.69444, 0, 0, 0.58056],
    77: [0, 0.69444, 0, 0, 0.97778],
    78: [0, 0.69444, 0, 0, 0.79445],
    79: [0, 0.69444, 0, 0, 0.79445],
    80: [0, 0.69444, 0, 0, 0.70278],
    81: [0.10556, 0.69444, 0, 0, 0.79445],
    82: [0, 0.69444, 0, 0, 0.70278],
    83: [0, 0.69444, 0, 0, 0.61111],
    84: [0, 0.69444, 0, 0, 0.73334],
    85: [0, 0.69444, 0, 0, 0.76389],
    86: [0, 0.69444, 0.01528, 0, 0.73334],
    87: [0, 0.69444, 0.01528, 0, 1.03889],
    88: [0, 0.69444, 0, 0, 0.73334],
    89: [0, 0.69444, 0.0275, 0, 0.73334],
    90: [0, 0.69444, 0, 0, 0.67223],
    91: [0.25, 0.75, 0, 0, 0.34306],
    93: [0.25, 0.75, 0, 0, 0.34306],
    94: [0, 0.69444, 0, 0, 0.55],
    95: [0.35, 0.10833, 0.03056, 0, 0.55],
    97: [0, 0.45833, 0, 0, 0.525],
    98: [0, 0.69444, 0, 0, 0.56111],
    99: [0, 0.45833, 0, 0, 0.48889],
    100: [0, 0.69444, 0, 0, 0.56111],
    101: [0, 0.45833, 0, 0, 0.51111],
    102: [0, 0.69444, 0.07639, 0, 0.33611],
    103: [0.19444, 0.45833, 0.01528, 0, 0.55],
    104: [0, 0.69444, 0, 0, 0.56111],
    105: [0, 0.69444, 0, 0, 0.25556],
    106: [0.19444, 0.69444, 0, 0, 0.28611],
    107: [0, 0.69444, 0, 0, 0.53056],
    108: [0, 0.69444, 0, 0, 0.25556],
    109: [0, 0.45833, 0, 0, 0.86667],
    110: [0, 0.45833, 0, 0, 0.56111],
    111: [0, 0.45833, 0, 0, 0.55],
    112: [0.19444, 0.45833, 0, 0, 0.56111],
    113: [0.19444, 0.45833, 0, 0, 0.56111],
    114: [0, 0.45833, 0.01528, 0, 0.37222],
    115: [0, 0.45833, 0, 0, 0.42167],
    116: [0, 0.58929, 0, 0, 0.40417],
    117: [0, 0.45833, 0, 0, 0.56111],
    118: [0, 0.45833, 0.01528, 0, 0.5],
    119: [0, 0.45833, 0.01528, 0, 0.74445],
    120: [0, 0.45833, 0, 0, 0.5],
    121: [0.19444, 0.45833, 0.01528, 0, 0.5],
    122: [0, 0.45833, 0, 0, 0.47639],
    126: [0.35, 0.34444, 0, 0, 0.55],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0, 0, 0.55],
    176: [0, 0.69444, 0, 0, 0.73334],
    180: [0, 0.69444, 0, 0, 0.55],
    184: [0.17014, 0, 0, 0, 0.48889],
    305: [0, 0.45833, 0, 0, 0.25556],
    567: [0.19444, 0.45833, 0, 0, 0.28611],
    710: [0, 0.69444, 0, 0, 0.55],
    711: [0, 0.63542, 0, 0, 0.55],
    713: [0, 0.63778, 0, 0, 0.55],
    728: [0, 0.69444, 0, 0, 0.55],
    729: [0, 0.69444, 0, 0, 0.30556],
    730: [0, 0.69444, 0, 0, 0.73334],
    732: [0, 0.69444, 0, 0, 0.55],
    733: [0, 0.69444, 0, 0, 0.55],
    915: [0, 0.69444, 0, 0, 0.58056],
    916: [0, 0.69444, 0, 0, 0.91667],
    920: [0, 0.69444, 0, 0, 0.85556],
    923: [0, 0.69444, 0, 0, 0.67223],
    926: [0, 0.69444, 0, 0, 0.73334],
    928: [0, 0.69444, 0, 0, 0.79445],
    931: [0, 0.69444, 0, 0, 0.79445],
    933: [0, 0.69444, 0, 0, 0.85556],
    934: [0, 0.69444, 0, 0, 0.79445],
    936: [0, 0.69444, 0, 0, 0.85556],
    937: [0, 0.69444, 0, 0, 0.79445],
    8211: [0, 0.45833, 0.03056, 0, 0.55],
    8212: [0, 0.45833, 0.03056, 0, 1.10001],
    8216: [0, 0.69444, 0, 0, 0.30556],
    8217: [0, 0.69444, 0, 0, 0.30556],
    8220: [0, 0.69444, 0, 0, 0.55834],
    8221: [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.05733, 0, 0.31945],
    34: [0, 0.69444, 316e-5, 0, 0.5],
    35: [0.19444, 0.69444, 0.05087, 0, 0.83334],
    36: [0.05556, 0.75, 0.11156, 0, 0.5],
    37: [0.05556, 0.75, 0.03126, 0, 0.83334],
    38: [0, 0.69444, 0.03058, 0, 0.75834],
    39: [0, 0.69444, 0.07816, 0, 0.27778],
    40: [0.25, 0.75, 0.13164, 0, 0.38889],
    41: [0.25, 0.75, 0.02536, 0, 0.38889],
    42: [0, 0.75, 0.11775, 0, 0.5],
    43: [0.08333, 0.58333, 0.02536, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0.01946, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0.13164, 0, 0.5],
    48: [0, 0.65556, 0.11156, 0, 0.5],
    49: [0, 0.65556, 0.11156, 0, 0.5],
    50: [0, 0.65556, 0.11156, 0, 0.5],
    51: [0, 0.65556, 0.11156, 0, 0.5],
    52: [0, 0.65556, 0.11156, 0, 0.5],
    53: [0, 0.65556, 0.11156, 0, 0.5],
    54: [0, 0.65556, 0.11156, 0, 0.5],
    55: [0, 0.65556, 0.11156, 0, 0.5],
    56: [0, 0.65556, 0.11156, 0, 0.5],
    57: [0, 0.65556, 0.11156, 0, 0.5],
    58: [0, 0.44444, 0.02502, 0, 0.27778],
    59: [0.125, 0.44444, 0.02502, 0, 0.27778],
    61: [-0.13, 0.37, 0.05087, 0, 0.77778],
    63: [0, 0.69444, 0.11809, 0, 0.47222],
    64: [0, 0.69444, 0.07555, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0.08293, 0, 0.66667],
    67: [0, 0.69444, 0.11983, 0, 0.63889],
    68: [0, 0.69444, 0.07555, 0, 0.72223],
    69: [0, 0.69444, 0.11983, 0, 0.59722],
    70: [0, 0.69444, 0.13372, 0, 0.56945],
    71: [0, 0.69444, 0.11983, 0, 0.66667],
    72: [0, 0.69444, 0.08094, 0, 0.70834],
    73: [0, 0.69444, 0.13372, 0, 0.27778],
    74: [0, 0.69444, 0.08094, 0, 0.47222],
    75: [0, 0.69444, 0.11983, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0.08094, 0, 0.875],
    78: [0, 0.69444, 0.08094, 0, 0.70834],
    79: [0, 0.69444, 0.07555, 0, 0.73611],
    80: [0, 0.69444, 0.08293, 0, 0.63889],
    81: [0.125, 0.69444, 0.07555, 0, 0.73611],
    82: [0, 0.69444, 0.08293, 0, 0.64584],
    83: [0, 0.69444, 0.09205, 0, 0.55556],
    84: [0, 0.69444, 0.13372, 0, 0.68056],
    85: [0, 0.69444, 0.08094, 0, 0.6875],
    86: [0, 0.69444, 0.1615, 0, 0.66667],
    87: [0, 0.69444, 0.1615, 0, 0.94445],
    88: [0, 0.69444, 0.13372, 0, 0.66667],
    89: [0, 0.69444, 0.17261, 0, 0.66667],
    90: [0, 0.69444, 0.11983, 0, 0.61111],
    91: [0.25, 0.75, 0.15942, 0, 0.28889],
    93: [0.25, 0.75, 0.08719, 0, 0.28889],
    94: [0, 0.69444, 0.0799, 0, 0.5],
    95: [0.35, 0.09444, 0.08616, 0, 0.5],
    97: [0, 0.44444, 981e-5, 0, 0.48056],
    98: [0, 0.69444, 0.03057, 0, 0.51667],
    99: [0, 0.44444, 0.08336, 0, 0.44445],
    100: [0, 0.69444, 0.09483, 0, 0.51667],
    101: [0, 0.44444, 0.06778, 0, 0.44445],
    102: [0, 0.69444, 0.21705, 0, 0.30556],
    103: [0.19444, 0.44444, 0.10836, 0, 0.5],
    104: [0, 0.69444, 0.01778, 0, 0.51667],
    105: [0, 0.67937, 0.09718, 0, 0.23889],
    106: [0.19444, 0.67937, 0.09162, 0, 0.26667],
    107: [0, 0.69444, 0.08336, 0, 0.48889],
    108: [0, 0.69444, 0.09483, 0, 0.23889],
    109: [0, 0.44444, 0.01778, 0, 0.79445],
    110: [0, 0.44444, 0.01778, 0, 0.51667],
    111: [0, 0.44444, 0.06613, 0, 0.5],
    112: [0.19444, 0.44444, 0.0389, 0, 0.51667],
    113: [0.19444, 0.44444, 0.04169, 0, 0.51667],
    114: [0, 0.44444, 0.10836, 0, 0.34167],
    115: [0, 0.44444, 0.0778, 0, 0.38333],
    116: [0, 0.57143, 0.07225, 0, 0.36111],
    117: [0, 0.44444, 0.04169, 0, 0.51667],
    118: [0, 0.44444, 0.10836, 0, 0.46111],
    119: [0, 0.44444, 0.10836, 0, 0.68334],
    120: [0, 0.44444, 0.09169, 0, 0.46111],
    121: [0.19444, 0.44444, 0.10836, 0, 0.46111],
    122: [0, 0.44444, 0.08752, 0, 0.43472],
    126: [0.35, 0.32659, 0.08826, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0.06385, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.73752],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0.04169, 0, 0.23889],
    567: [0.19444, 0.44444, 0.04169, 0, 0.26667],
    710: [0, 0.69444, 0.0799, 0, 0.5],
    711: [0, 0.63194, 0.08432, 0, 0.5],
    713: [0, 0.60889, 0.08776, 0, 0.5],
    714: [0, 0.69444, 0.09205, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0.09483, 0, 0.5],
    729: [0, 0.67937, 0.07774, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.73752],
    732: [0, 0.67659, 0.08826, 0, 0.5],
    733: [0, 0.69444, 0.09205, 0, 0.5],
    915: [0, 0.69444, 0.13372, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0.07555, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0.12816, 0, 0.66667],
    928: [0, 0.69444, 0.08094, 0, 0.70834],
    931: [0, 0.69444, 0.11983, 0, 0.72222],
    933: [0, 0.69444, 0.09031, 0, 0.77778],
    934: [0, 0.69444, 0.04603, 0, 0.72222],
    936: [0, 0.69444, 0.09031, 0, 0.77778],
    937: [0, 0.69444, 0.08293, 0, 0.72222],
    8211: [0, 0.44444, 0.08616, 0, 0.5],
    8212: [0, 0.44444, 0.08616, 0, 1],
    8216: [0, 0.69444, 0.07816, 0, 0.27778],
    8217: [0, 0.69444, 0.07816, 0, 0.27778],
    8220: [0, 0.69444, 0.14205, 0, 0.5],
    8221: [0, 0.69444, 316e-5, 0, 0.5]
  },
  "SansSerif-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.31945],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.75834],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.65556, 0, 0, 0.5],
    49: [0, 0.65556, 0, 0, 0.5],
    50: [0, 0.65556, 0, 0, 0.5],
    51: [0, 0.65556, 0, 0, 0.5],
    52: [0, 0.65556, 0, 0, 0.5],
    53: [0, 0.65556, 0, 0, 0.5],
    54: [0, 0.65556, 0, 0, 0.5],
    55: [0, 0.65556, 0, 0, 0.5],
    56: [0, 0.65556, 0, 0, 0.5],
    57: [0, 0.65556, 0, 0, 0.5],
    58: [0, 0.44444, 0, 0, 0.27778],
    59: [0.125, 0.44444, 0, 0, 0.27778],
    61: [-0.13, 0.37, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0, 0, 0.66667],
    67: [0, 0.69444, 0, 0, 0.63889],
    68: [0, 0.69444, 0, 0, 0.72223],
    69: [0, 0.69444, 0, 0, 0.59722],
    70: [0, 0.69444, 0, 0, 0.56945],
    71: [0, 0.69444, 0, 0, 0.66667],
    72: [0, 0.69444, 0, 0, 0.70834],
    73: [0, 0.69444, 0, 0, 0.27778],
    74: [0, 0.69444, 0, 0, 0.47222],
    75: [0, 0.69444, 0, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0, 0, 0.875],
    78: [0, 0.69444, 0, 0, 0.70834],
    79: [0, 0.69444, 0, 0, 0.73611],
    80: [0, 0.69444, 0, 0, 0.63889],
    81: [0.125, 0.69444, 0, 0, 0.73611],
    82: [0, 0.69444, 0, 0, 0.64584],
    83: [0, 0.69444, 0, 0, 0.55556],
    84: [0, 0.69444, 0, 0, 0.68056],
    85: [0, 0.69444, 0, 0, 0.6875],
    86: [0, 0.69444, 0.01389, 0, 0.66667],
    87: [0, 0.69444, 0.01389, 0, 0.94445],
    88: [0, 0.69444, 0, 0, 0.66667],
    89: [0, 0.69444, 0.025, 0, 0.66667],
    90: [0, 0.69444, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.28889],
    93: [0.25, 0.75, 0, 0, 0.28889],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.35, 0.09444, 0.02778, 0, 0.5],
    97: [0, 0.44444, 0, 0, 0.48056],
    98: [0, 0.69444, 0, 0, 0.51667],
    99: [0, 0.44444, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.51667],
    101: [0, 0.44444, 0, 0, 0.44445],
    102: [0, 0.69444, 0.06944, 0, 0.30556],
    103: [0.19444, 0.44444, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.51667],
    105: [0, 0.67937, 0, 0, 0.23889],
    106: [0.19444, 0.67937, 0, 0, 0.26667],
    107: [0, 0.69444, 0, 0, 0.48889],
    108: [0, 0.69444, 0, 0, 0.23889],
    109: [0, 0.44444, 0, 0, 0.79445],
    110: [0, 0.44444, 0, 0, 0.51667],
    111: [0, 0.44444, 0, 0, 0.5],
    112: [0.19444, 0.44444, 0, 0, 0.51667],
    113: [0.19444, 0.44444, 0, 0, 0.51667],
    114: [0, 0.44444, 0.01389, 0, 0.34167],
    115: [0, 0.44444, 0, 0, 0.38333],
    116: [0, 0.57143, 0, 0, 0.36111],
    117: [0, 0.44444, 0, 0, 0.51667],
    118: [0, 0.44444, 0.01389, 0, 0.46111],
    119: [0, 0.44444, 0.01389, 0, 0.68334],
    120: [0, 0.44444, 0, 0, 0.46111],
    121: [0.19444, 0.44444, 0.01389, 0, 0.46111],
    122: [0, 0.44444, 0, 0, 0.43472],
    126: [0.35, 0.32659, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.66667],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0, 0, 0.23889],
    567: [0.19444, 0.44444, 0, 0, 0.26667],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.63194, 0, 0, 0.5],
    713: [0, 0.60889, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.67937, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.66667],
    732: [0, 0.67659, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.69444, 0, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0, 0, 0.66667],
    928: [0, 0.69444, 0, 0, 0.70834],
    931: [0, 0.69444, 0, 0, 0.72222],
    933: [0, 0.69444, 0, 0, 0.77778],
    934: [0, 0.69444, 0, 0, 0.72222],
    936: [0, 0.69444, 0, 0, 0.77778],
    937: [0, 0.69444, 0, 0, 0.72222],
    8211: [0, 0.44444, 0.02778, 0, 0.5],
    8212: [0, 0.44444, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.7, 0.22925, 0, 0.80253],
    66: [0, 0.7, 0.04087, 0, 0.90757],
    67: [0, 0.7, 0.1689, 0, 0.66619],
    68: [0, 0.7, 0.09371, 0, 0.77443],
    69: [0, 0.7, 0.18583, 0, 0.56162],
    70: [0, 0.7, 0.13634, 0, 0.89544],
    71: [0, 0.7, 0.17322, 0, 0.60961],
    72: [0, 0.7, 0.29694, 0, 0.96919],
    73: [0, 0.7, 0.19189, 0, 0.80907],
    74: [0.27778, 0.7, 0.19189, 0, 1.05159],
    75: [0, 0.7, 0.31259, 0, 0.91364],
    76: [0, 0.7, 0.19189, 0, 0.87373],
    77: [0, 0.7, 0.15981, 0, 1.08031],
    78: [0, 0.7, 0.3525, 0, 0.9015],
    79: [0, 0.7, 0.08078, 0, 0.73787],
    80: [0, 0.7, 0.08078, 0, 1.01262],
    81: [0, 0.7, 0.03305, 0, 0.88282],
    82: [0, 0.7, 0.06259, 0, 0.85],
    83: [0, 0.7, 0.19189, 0, 0.86767],
    84: [0, 0.7, 0.29087, 0, 0.74697],
    85: [0, 0.7, 0.25815, 0, 0.79996],
    86: [0, 0.7, 0.27523, 0, 0.62204],
    87: [0, 0.7, 0.27523, 0, 0.80532],
    88: [0, 0.7, 0.26006, 0, 0.94445],
    89: [0, 0.7, 0.2939, 0, 0.70961],
    90: [0, 0.7, 0.24037, 0, 0.8212],
    160: [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.35001, 0.85, 0, 0, 0.45834],
    41: [0.35001, 0.85, 0, 0, 0.45834],
    47: [0.35001, 0.85, 0, 0, 0.57778],
    91: [0.35001, 0.85, 0, 0, 0.41667],
    92: [0.35001, 0.85, 0, 0, 0.57778],
    93: [0.35001, 0.85, 0, 0, 0.41667],
    123: [0.35001, 0.85, 0, 0, 0.58334],
    125: [0.35001, 0.85, 0, 0, 0.58334],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.72222, 0, 0, 0.55556],
    732: [0, 0.72222, 0, 0, 0.55556],
    770: [0, 0.72222, 0, 0, 0.55556],
    771: [0, 0.72222, 0, 0, 0.55556],
    8214: [-99e-5, 0.601, 0, 0, 0.77778],
    8593: [1e-5, 0.6, 0, 0, 0.66667],
    8595: [1e-5, 0.6, 0, 0, 0.66667],
    8657: [1e-5, 0.6, 0, 0, 0.77778],
    8659: [1e-5, 0.6, 0, 0, 0.77778],
    8719: [0.25001, 0.75, 0, 0, 0.94445],
    8720: [0.25001, 0.75, 0, 0, 0.94445],
    8721: [0.25001, 0.75, 0, 0, 1.05556],
    8730: [0.35001, 0.85, 0, 0, 1],
    8739: [-599e-5, 0.606, 0, 0, 0.33333],
    8741: [-599e-5, 0.606, 0, 0, 0.55556],
    8747: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8748: [0.306, 0.805, 0.19445, 0, 0.47222],
    8749: [0.306, 0.805, 0.19445, 0, 0.47222],
    8750: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8896: [0.25001, 0.75, 0, 0, 0.83334],
    8897: [0.25001, 0.75, 0, 0, 0.83334],
    8898: [0.25001, 0.75, 0, 0, 0.83334],
    8899: [0.25001, 0.75, 0, 0, 0.83334],
    8968: [0.35001, 0.85, 0, 0, 0.47222],
    8969: [0.35001, 0.85, 0, 0, 0.47222],
    8970: [0.35001, 0.85, 0, 0, 0.47222],
    8971: [0.35001, 0.85, 0, 0, 0.47222],
    9168: [-99e-5, 0.601, 0, 0, 0.66667],
    10216: [0.35001, 0.85, 0, 0, 0.47222],
    10217: [0.35001, 0.85, 0, 0, 0.47222],
    10752: [0.25001, 0.75, 0, 0, 1.11111],
    10753: [0.25001, 0.75, 0, 0, 1.11111],
    10754: [0.25001, 0.75, 0, 0, 1.11111],
    10756: [0.25001, 0.75, 0, 0, 0.83334],
    10758: [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.65002, 1.15, 0, 0, 0.59722],
    41: [0.65002, 1.15, 0, 0, 0.59722],
    47: [0.65002, 1.15, 0, 0, 0.81111],
    91: [0.65002, 1.15, 0, 0, 0.47222],
    92: [0.65002, 1.15, 0, 0, 0.81111],
    93: [0.65002, 1.15, 0, 0, 0.47222],
    123: [0.65002, 1.15, 0, 0, 0.66667],
    125: [0.65002, 1.15, 0, 0, 0.66667],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1],
    732: [0, 0.75, 0, 0, 1],
    770: [0, 0.75, 0, 0, 1],
    771: [0, 0.75, 0, 0, 1],
    8719: [0.55001, 1.05, 0, 0, 1.27778],
    8720: [0.55001, 1.05, 0, 0, 1.27778],
    8721: [0.55001, 1.05, 0, 0, 1.44445],
    8730: [0.65002, 1.15, 0, 0, 1],
    8747: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8748: [0.862, 1.36, 0.44445, 0, 0.55556],
    8749: [0.862, 1.36, 0.44445, 0, 0.55556],
    8750: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8896: [0.55001, 1.05, 0, 0, 1.11111],
    8897: [0.55001, 1.05, 0, 0, 1.11111],
    8898: [0.55001, 1.05, 0, 0, 1.11111],
    8899: [0.55001, 1.05, 0, 0, 1.11111],
    8968: [0.65002, 1.15, 0, 0, 0.52778],
    8969: [0.65002, 1.15, 0, 0, 0.52778],
    8970: [0.65002, 1.15, 0, 0, 0.52778],
    8971: [0.65002, 1.15, 0, 0, 0.52778],
    10216: [0.65002, 1.15, 0, 0, 0.61111],
    10217: [0.65002, 1.15, 0, 0, 0.61111],
    10752: [0.55001, 1.05, 0, 0, 1.51112],
    10753: [0.55001, 1.05, 0, 0, 1.51112],
    10754: [0.55001, 1.05, 0, 0, 1.51112],
    10756: [0.55001, 1.05, 0, 0, 1.11111],
    10758: [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.95003, 1.45, 0, 0, 0.73611],
    41: [0.95003, 1.45, 0, 0, 0.73611],
    47: [0.95003, 1.45, 0, 0, 1.04445],
    91: [0.95003, 1.45, 0, 0, 0.52778],
    92: [0.95003, 1.45, 0, 0, 1.04445],
    93: [0.95003, 1.45, 0, 0, 0.52778],
    123: [0.95003, 1.45, 0, 0, 0.75],
    125: [0.95003, 1.45, 0, 0, 0.75],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1.44445],
    732: [0, 0.75, 0, 0, 1.44445],
    770: [0, 0.75, 0, 0, 1.44445],
    771: [0, 0.75, 0, 0, 1.44445],
    8730: [0.95003, 1.45, 0, 0, 1],
    8968: [0.95003, 1.45, 0, 0, 0.58334],
    8969: [0.95003, 1.45, 0, 0, 0.58334],
    8970: [0.95003, 1.45, 0, 0, 0.58334],
    8971: [0.95003, 1.45, 0, 0, 0.58334],
    10216: [0.95003, 1.45, 0, 0, 0.75],
    10217: [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [1.25003, 1.75, 0, 0, 0.79167],
    41: [1.25003, 1.75, 0, 0, 0.79167],
    47: [1.25003, 1.75, 0, 0, 1.27778],
    91: [1.25003, 1.75, 0, 0, 0.58334],
    92: [1.25003, 1.75, 0, 0, 1.27778],
    93: [1.25003, 1.75, 0, 0, 0.58334],
    123: [1.25003, 1.75, 0, 0, 0.80556],
    125: [1.25003, 1.75, 0, 0, 0.80556],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.825, 0, 0, 1.8889],
    732: [0, 0.825, 0, 0, 1.8889],
    770: [0, 0.825, 0, 0, 1.8889],
    771: [0, 0.825, 0, 0, 1.8889],
    8730: [1.25003, 1.75, 0, 0, 1],
    8968: [1.25003, 1.75, 0, 0, 0.63889],
    8969: [1.25003, 1.75, 0, 0, 0.63889],
    8970: [1.25003, 1.75, 0, 0, 0.63889],
    8971: [1.25003, 1.75, 0, 0, 0.63889],
    9115: [0.64502, 1.155, 0, 0, 0.875],
    9116: [1e-5, 0.6, 0, 0, 0.875],
    9117: [0.64502, 1.155, 0, 0, 0.875],
    9118: [0.64502, 1.155, 0, 0, 0.875],
    9119: [1e-5, 0.6, 0, 0, 0.875],
    9120: [0.64502, 1.155, 0, 0, 0.875],
    9121: [0.64502, 1.155, 0, 0, 0.66667],
    9122: [-99e-5, 0.601, 0, 0, 0.66667],
    9123: [0.64502, 1.155, 0, 0, 0.66667],
    9124: [0.64502, 1.155, 0, 0, 0.66667],
    9125: [-99e-5, 0.601, 0, 0, 0.66667],
    9126: [0.64502, 1.155, 0, 0, 0.66667],
    9127: [1e-5, 0.9, 0, 0, 0.88889],
    9128: [0.65002, 1.15, 0, 0, 0.88889],
    9129: [0.90001, 0, 0, 0, 0.88889],
    9130: [0, 0.3, 0, 0, 0.88889],
    9131: [1e-5, 0.9, 0, 0, 0.88889],
    9132: [0.65002, 1.15, 0, 0, 0.88889],
    9133: [0.90001, 0, 0, 0, 0.88889],
    9143: [0.88502, 0.915, 0, 0, 1.05556],
    10216: [1.25003, 1.75, 0, 0, 0.80556],
    10217: [1.25003, 1.75, 0, 0, 0.80556],
    57344: [-499e-5, 0.605, 0, 0, 1.05556],
    57345: [-499e-5, 0.605, 0, 0, 1.05556],
    57680: [0, 0.12, 0, 0, 0.45],
    57681: [0, 0.12, 0, 0, 0.45],
    57682: [0, 0.12, 0, 0, 0.45],
    57683: [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    32: [0, 0, 0, 0, 0.525],
    33: [0, 0.61111, 0, 0, 0.525],
    34: [0, 0.61111, 0, 0, 0.525],
    35: [0, 0.61111, 0, 0, 0.525],
    36: [0.08333, 0.69444, 0, 0, 0.525],
    37: [0.08333, 0.69444, 0, 0, 0.525],
    38: [0, 0.61111, 0, 0, 0.525],
    39: [0, 0.61111, 0, 0, 0.525],
    40: [0.08333, 0.69444, 0, 0, 0.525],
    41: [0.08333, 0.69444, 0, 0, 0.525],
    42: [0, 0.52083, 0, 0, 0.525],
    43: [-0.08056, 0.53055, 0, 0, 0.525],
    44: [0.13889, 0.125, 0, 0, 0.525],
    45: [-0.08056, 0.53055, 0, 0, 0.525],
    46: [0, 0.125, 0, 0, 0.525],
    47: [0.08333, 0.69444, 0, 0, 0.525],
    48: [0, 0.61111, 0, 0, 0.525],
    49: [0, 0.61111, 0, 0, 0.525],
    50: [0, 0.61111, 0, 0, 0.525],
    51: [0, 0.61111, 0, 0, 0.525],
    52: [0, 0.61111, 0, 0, 0.525],
    53: [0, 0.61111, 0, 0, 0.525],
    54: [0, 0.61111, 0, 0, 0.525],
    55: [0, 0.61111, 0, 0, 0.525],
    56: [0, 0.61111, 0, 0, 0.525],
    57: [0, 0.61111, 0, 0, 0.525],
    58: [0, 0.43056, 0, 0, 0.525],
    59: [0.13889, 0.43056, 0, 0, 0.525],
    60: [-0.05556, 0.55556, 0, 0, 0.525],
    61: [-0.19549, 0.41562, 0, 0, 0.525],
    62: [-0.05556, 0.55556, 0, 0, 0.525],
    63: [0, 0.61111, 0, 0, 0.525],
    64: [0, 0.61111, 0, 0, 0.525],
    65: [0, 0.61111, 0, 0, 0.525],
    66: [0, 0.61111, 0, 0, 0.525],
    67: [0, 0.61111, 0, 0, 0.525],
    68: [0, 0.61111, 0, 0, 0.525],
    69: [0, 0.61111, 0, 0, 0.525],
    70: [0, 0.61111, 0, 0, 0.525],
    71: [0, 0.61111, 0, 0, 0.525],
    72: [0, 0.61111, 0, 0, 0.525],
    73: [0, 0.61111, 0, 0, 0.525],
    74: [0, 0.61111, 0, 0, 0.525],
    75: [0, 0.61111, 0, 0, 0.525],
    76: [0, 0.61111, 0, 0, 0.525],
    77: [0, 0.61111, 0, 0, 0.525],
    78: [0, 0.61111, 0, 0, 0.525],
    79: [0, 0.61111, 0, 0, 0.525],
    80: [0, 0.61111, 0, 0, 0.525],
    81: [0.13889, 0.61111, 0, 0, 0.525],
    82: [0, 0.61111, 0, 0, 0.525],
    83: [0, 0.61111, 0, 0, 0.525],
    84: [0, 0.61111, 0, 0, 0.525],
    85: [0, 0.61111, 0, 0, 0.525],
    86: [0, 0.61111, 0, 0, 0.525],
    87: [0, 0.61111, 0, 0, 0.525],
    88: [0, 0.61111, 0, 0, 0.525],
    89: [0, 0.61111, 0, 0, 0.525],
    90: [0, 0.61111, 0, 0, 0.525],
    91: [0.08333, 0.69444, 0, 0, 0.525],
    92: [0.08333, 0.69444, 0, 0, 0.525],
    93: [0.08333, 0.69444, 0, 0, 0.525],
    94: [0, 0.61111, 0, 0, 0.525],
    95: [0.09514, 0, 0, 0, 0.525],
    96: [0, 0.61111, 0, 0, 0.525],
    97: [0, 0.43056, 0, 0, 0.525],
    98: [0, 0.61111, 0, 0, 0.525],
    99: [0, 0.43056, 0, 0, 0.525],
    100: [0, 0.61111, 0, 0, 0.525],
    101: [0, 0.43056, 0, 0, 0.525],
    102: [0, 0.61111, 0, 0, 0.525],
    103: [0.22222, 0.43056, 0, 0, 0.525],
    104: [0, 0.61111, 0, 0, 0.525],
    105: [0, 0.61111, 0, 0, 0.525],
    106: [0.22222, 0.61111, 0, 0, 0.525],
    107: [0, 0.61111, 0, 0, 0.525],
    108: [0, 0.61111, 0, 0, 0.525],
    109: [0, 0.43056, 0, 0, 0.525],
    110: [0, 0.43056, 0, 0, 0.525],
    111: [0, 0.43056, 0, 0, 0.525],
    112: [0.22222, 0.43056, 0, 0, 0.525],
    113: [0.22222, 0.43056, 0, 0, 0.525],
    114: [0, 0.43056, 0, 0, 0.525],
    115: [0, 0.43056, 0, 0, 0.525],
    116: [0, 0.55358, 0, 0, 0.525],
    117: [0, 0.43056, 0, 0, 0.525],
    118: [0, 0.43056, 0, 0, 0.525],
    119: [0, 0.43056, 0, 0, 0.525],
    120: [0, 0.43056, 0, 0, 0.525],
    121: [0.22222, 0.43056, 0, 0, 0.525],
    122: [0, 0.43056, 0, 0, 0.525],
    123: [0.08333, 0.69444, 0, 0, 0.525],
    124: [0.08333, 0.69444, 0, 0, 0.525],
    125: [0.08333, 0.69444, 0, 0, 0.525],
    126: [0, 0.61111, 0, 0, 0.525],
    127: [0, 0.61111, 0, 0, 0.525],
    160: [0, 0, 0, 0, 0.525],
    176: [0, 0.61111, 0, 0, 0.525],
    184: [0.19445, 0, 0, 0, 0.525],
    305: [0, 0.43056, 0, 0, 0.525],
    567: [0.22222, 0.43056, 0, 0, 0.525],
    711: [0, 0.56597, 0, 0, 0.525],
    713: [0, 0.56555, 0, 0, 0.525],
    714: [0, 0.61111, 0, 0, 0.525],
    715: [0, 0.61111, 0, 0, 0.525],
    728: [0, 0.61111, 0, 0, 0.525],
    730: [0, 0.61111, 0, 0, 0.525],
    770: [0, 0.61111, 0, 0, 0.525],
    771: [0, 0.61111, 0, 0, 0.525],
    776: [0, 0.61111, 0, 0, 0.525],
    915: [0, 0.61111, 0, 0, 0.525],
    916: [0, 0.61111, 0, 0, 0.525],
    920: [0, 0.61111, 0, 0, 0.525],
    923: [0, 0.61111, 0, 0, 0.525],
    926: [0, 0.61111, 0, 0, 0.525],
    928: [0, 0.61111, 0, 0, 0.525],
    931: [0, 0.61111, 0, 0, 0.525],
    933: [0, 0.61111, 0, 0, 0.525],
    934: [0, 0.61111, 0, 0, 0.525],
    936: [0, 0.61111, 0, 0, 0.525],
    937: [0, 0.61111, 0, 0, 0.525],
    8216: [0, 0.61111, 0, 0, 0.525],
    8217: [0, 0.61111, 0, 0, 0.525],
    8242: [0, 0.61111, 0, 0, 0.525],
    9251: [0.11111, 0.21944, 0, 0, 0.525]
  }
}, Wn = {
  slant: [0.25, 0.25, 0.25],
  // sigma1
  space: [0, 0, 0],
  // sigma2
  stretch: [0, 0, 0],
  // sigma3
  shrink: [0, 0, 0],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1, 1.171, 1.472],
  // sigma6
  extraSpace: [0, 0, 0],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.15, 0.143, 0.2],
  // sigma16
  sub2: [0.247, 0.286, 0.4],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.05, 0.071, 0.1],
  // sigma19
  delim1: [2.39, 1.7, 1.98],
  // sigma20
  delim2: [1.01, 1.157, 1.42],
  // sigma21
  axisHeight: [0.25, 0.25, 0.25],
  // sigma22
  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143
  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10, 10, 10],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04]
  // 0.4 pt / ptPerEm
}, Bs = {
  // Latin-1
  Å: "A",
  Ð: "D",
  Þ: "o",
  å: "a",
  ð: "d",
  þ: "o",
  // Cyrillic
  А: "A",
  Б: "B",
  В: "B",
  Г: "F",
  Д: "A",
  Е: "E",
  Ж: "K",
  З: "3",
  И: "N",
  Й: "N",
  К: "K",
  Л: "N",
  М: "M",
  Н: "H",
  О: "O",
  П: "N",
  Р: "P",
  С: "C",
  Т: "T",
  У: "y",
  Ф: "O",
  Х: "X",
  Ц: "U",
  Ч: "h",
  Ш: "W",
  Щ: "W",
  Ъ: "B",
  Ы: "X",
  Ь: "B",
  Э: "3",
  Ю: "X",
  Я: "R",
  а: "a",
  б: "b",
  в: "a",
  г: "r",
  д: "y",
  е: "e",
  ж: "m",
  з: "e",
  и: "n",
  й: "n",
  к: "n",
  л: "n",
  м: "m",
  н: "n",
  о: "o",
  п: "n",
  р: "p",
  с: "c",
  т: "o",
  у: "y",
  ф: "b",
  х: "x",
  ц: "n",
  ч: "n",
  ш: "w",
  щ: "w",
  ъ: "a",
  ы: "m",
  ь: "a",
  э: "e",
  ю: "m",
  я: "r"
};
function _1(n, e) {
  T0[n] = e;
}
function Ll(n, e, t) {
  if (!T0[e])
    throw new Error("Font metrics not found for font: " + e + ".");
  var r = n.charCodeAt(0), a = T0[e][r];
  if (!a && n[0] in Bs && (r = Bs[n[0]].charCodeAt(0), a = T0[e][r]), !a && t === "text" && g1(r) && (a = T0[e][77]), a)
    return {
      depth: a[0],
      height: a[1],
      italic: a[2],
      skew: a[3],
      width: a[4]
    };
}
var pi = {};
function Sd(n) {
  var e;
  if (n >= 5 ? e = 0 : n >= 3 ? e = 1 : e = 2, !pi[e]) {
    var t = pi[e] = {
      cssEmPerMu: Wn.quad[e] / 18
    };
    for (var r in Wn)
      Wn.hasOwnProperty(r) && (t[r] = Wn[r][e]);
  }
  return pi[e];
}
var xd = [
  // Each element contains [textsize, scriptsize, scriptscriptsize].
  // The size mappings are taken from TeX with \normalsize=10pt.
  [1, 1, 1],
  // size1: [5, 5, 5]              \tiny
  [2, 1, 1],
  // size2: [6, 5, 5]
  [3, 1, 1],
  // size3: [7, 5, 5]              \scriptsize
  [4, 2, 1],
  // size4: [8, 6, 5]              \footnotesize
  [5, 2, 1],
  // size5: [9, 6, 5]              \small
  [6, 3, 1],
  // size6: [10, 7, 5]             \normalsize
  [7, 4, 2],
  // size7: [12, 8, 6]             \large
  [8, 6, 3],
  // size8: [14.4, 10, 7]          \Large
  [9, 7, 6],
  // size9: [17.28, 12, 10]        \LARGE
  [10, 8, 7],
  // size10: [20.74, 14.4, 12]     \huge
  [11, 10, 9]
  // size11: [24.88, 20.74, 17.28] \HUGE
], Ls = [
  // fontMetrics.js:getGlobalMetrics also uses size indexes, so if
  // you change size indexes, change that function.
  0.5,
  0.6,
  0.7,
  0.8,
  0.9,
  1,
  1.2,
  1.44,
  1.728,
  2.074,
  2.488
], Rs = function(e, t) {
  return t.size < 2 ? e : xd[e - 1][t.size - 1];
};
class K0 {
  // A font family applies to a group of fonts (i.e. SansSerif), while a font
  // represents a specific font (i.e. SansSerif Bold).
  // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
  /**
   * The base size index.
   */
  constructor(e) {
    this.style = void 0, this.color = void 0, this.size = void 0, this.textSize = void 0, this.phantom = void 0, this.font = void 0, this.fontFamily = void 0, this.fontWeight = void 0, this.fontShape = void 0, this.sizeMultiplier = void 0, this.maxSize = void 0, this.minRuleThickness = void 0, this._fontMetrics = void 0, this.style = e.style, this.color = e.color, this.size = e.size || K0.BASESIZE, this.textSize = e.textSize || this.size, this.phantom = !!e.phantom, this.font = e.font || "", this.fontFamily = e.fontFamily || "", this.fontWeight = e.fontWeight || "", this.fontShape = e.fontShape || "", this.sizeMultiplier = Ls[this.size - 1], this.maxSize = e.maxSize, this.minRuleThickness = e.minRuleThickness, this._fontMetrics = void 0;
  }
  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(e) {
    var t = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    for (var r in e)
      e.hasOwnProperty(r) && (t[r] = e[r]);
    return new K0(t);
  }
  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(e) {
    return this.style === e ? this : this.extend({
      style: e,
      size: Rs(this.textSize, e)
    });
  }
  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }
  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(e) {
    return this.size === e && this.textSize === e ? this : this.extend({
      style: this.style.text(),
      size: e,
      textSize: e,
      sizeMultiplier: Ls[e - 1]
    });
  }
  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(e) {
    e = e || this.style.text();
    var t = Rs(K0.BASESIZE, e);
    return this.size === t && this.textSize === K0.BASESIZE && this.style === e ? this : this.extend({
      style: e,
      size: t
    });
  }
  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    var e;
    switch (this.style.id) {
      case 4:
      case 5:
        e = 3;
        break;
      case 6:
      case 7:
        e = 1;
        break;
      default:
        e = 6;
    }
    return this.extend({
      style: this.style.text(),
      size: e
    });
  }
  /**
   * Create a new options object with the given color.
   */
  withColor(e) {
    return this.extend({
      color: e
    });
  }
  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: !0
    });
  }
  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(e) {
    return this.extend({
      font: e
    });
  }
  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(e) {
    return this.extend({
      fontFamily: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(e) {
    return this.extend({
      fontWeight: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(e) {
    return this.extend({
      fontShape: e,
      font: ""
    });
  }
  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(e) {
    return e.size !== this.size ? ["sizing", "reset-size" + e.size, "size" + this.size] : [];
  }
  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    return this.size !== K0.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + K0.BASESIZE] : [];
  }
  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    return this._fontMetrics || (this._fontMetrics = Sd(this.size)), this._fontMetrics;
  }
  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    return this.phantom ? "transparent" : this.color;
  }
}
K0.BASESIZE = 6;
var cl = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  pt: 1,
  // TeX point
  mm: 7227 / 2540,
  // millimeter
  cm: 7227 / 254,
  // centimeter
  in: 72.27,
  // inch
  bp: 803 / 800,
  // big (PostScript) points
  pc: 12,
  // pica
  dd: 1238 / 1157,
  // didot
  cc: 14856 / 1157,
  // cicero (12 didot)
  nd: 685 / 642,
  // new didot
  nc: 1370 / 107,
  // new cicero (12 new didot)
  sp: 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  px: 803 / 800
  // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
}, Ad = {
  ex: !0,
  em: !0,
  mu: !0
}, v1 = function(e) {
  return typeof e != "string" && (e = e.unit), e in cl || e in Ad || e === "ex";
}, Xe = function(e, t) {
  var r;
  if (e.unit in cl)
    r = cl[e.unit] / t.fontMetrics().ptPerEm / t.sizeMultiplier;
  else if (e.unit === "mu")
    r = t.fontMetrics().cssEmPerMu;
  else {
    var a;
    if (t.style.isTight() ? a = t.havingStyle(t.style.text()) : a = t, e.unit === "ex")
      r = a.fontMetrics().xHeight;
    else if (e.unit === "em")
      r = a.fontMetrics().quad;
    else
      throw new V("Invalid unit: '" + e.unit + "'");
    a !== t && (r *= a.sizeMultiplier / t.sizeMultiplier);
  }
  return Math.min(e.number * r, t.maxSize);
}, Y = function(e) {
  return +e.toFixed(4) + "em";
}, _r = function(e) {
  return e.filter((t) => t).join(" ");
}, b1 = function(e, t, r) {
  if (this.classes = e || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = r || {}, t) {
    t.style.isTight() && this.classes.push("mtight");
    var a = t.getColor();
    a && (this.style.color = a);
  }
}, y1 = function(e) {
  var t = document.createElement(e);
  t.className = _r(this.classes);
  for (var r in this.style)
    this.style.hasOwnProperty(r) && (t.style[r] = this.style[r]);
  for (var a in this.attributes)
    this.attributes.hasOwnProperty(a) && t.setAttribute(a, this.attributes[a]);
  for (var i = 0; i < this.children.length; i++)
    t.appendChild(this.children[i].toNode());
  return t;
}, Ed = /[\s"'>/=\x00-\x1f]/, w1 = function(e) {
  var t = "<" + e;
  this.classes.length && (t += ' class="' + le.escape(_r(this.classes)) + '"');
  var r = "";
  for (var a in this.style)
    this.style.hasOwnProperty(a) && (r += le.hyphenate(a) + ":" + this.style[a] + ";");
  r && (t += ' style="' + le.escape(r) + '"');
  for (var i in this.attributes)
    if (this.attributes.hasOwnProperty(i)) {
      if (Ed.test(i))
        throw new V("Invalid attribute name '" + i + "'");
      t += " " + i + '="' + le.escape(this.attributes[i]) + '"';
    }
  t += ">";
  for (var l = 0; l < this.children.length; l++)
    t += this.children[l].toMarkup();
  return t += "</" + e + ">", t;
};
class Ln {
  constructor(e, t, r, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.width = void 0, this.maxFontSize = void 0, this.style = void 0, b1.call(this, e, r, a), this.children = t || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return le.contains(this.classes, e);
  }
  toNode() {
    return y1.call(this, "span");
  }
  toMarkup() {
    return w1.call(this, "span");
  }
}
class Rl {
  constructor(e, t, r, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, b1.call(this, t, a), this.children = r || [], this.setAttribute("href", e);
  }
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return le.contains(this.classes, e);
  }
  toNode() {
    return y1.call(this, "a");
  }
  toMarkup() {
    return w1.call(this, "a");
  }
}
class Cd {
  constructor(e, t, r) {
    this.src = void 0, this.alt = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.alt = t, this.src = e, this.classes = ["mord"], this.style = r;
  }
  hasClass(e) {
    return le.contains(this.classes, e);
  }
  toNode() {
    var e = document.createElement("img");
    e.src = this.src, e.alt = this.alt, e.className = "mord";
    for (var t in this.style)
      this.style.hasOwnProperty(t) && (e.style[t] = this.style[t]);
    return e;
  }
  toMarkup() {
    var e = '<img src="' + le.escape(this.src) + '"' + (' alt="' + le.escape(this.alt) + '"'), t = "";
    for (var r in this.style)
      this.style.hasOwnProperty(r) && (t += le.hyphenate(r) + ":" + this.style[r] + ";");
    return t && (e += ' style="' + le.escape(t) + '"'), e += "'/>", e;
  }
}
var Td = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class s0 {
  constructor(e, t, r, a, i, l, s, o) {
    this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = e, this.height = t || 0, this.depth = r || 0, this.italic = a || 0, this.skew = i || 0, this.width = l || 0, this.classes = s || [], this.style = o || {}, this.maxFontSize = 0;
    var u = fd(this.text.charCodeAt(0));
    u && this.classes.push(u + "_fallback"), /[îïíì]/.test(this.text) && (this.text = Td[this.text]);
  }
  hasClass(e) {
    return le.contains(this.classes, e);
  }
  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created if it is needed.
   */
  toNode() {
    var e = document.createTextNode(this.text), t = null;
    this.italic > 0 && (t = document.createElement("span"), t.style.marginRight = Y(this.italic)), this.classes.length > 0 && (t = t || document.createElement("span"), t.className = _r(this.classes));
    for (var r in this.style)
      this.style.hasOwnProperty(r) && (t = t || document.createElement("span"), t.style[r] = this.style[r]);
    return t ? (t.appendChild(e), t) : e;
  }
  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    var e = !1, t = "<span";
    this.classes.length && (e = !0, t += ' class="', t += le.escape(_r(this.classes)), t += '"');
    var r = "";
    this.italic > 0 && (r += "margin-right:" + this.italic + "em;");
    for (var a in this.style)
      this.style.hasOwnProperty(a) && (r += le.hyphenate(a) + ":" + this.style[a] + ";");
    r && (e = !0, t += ' style="' + le.escape(r) + '"');
    var i = le.escape(this.text);
    return e ? (t += ">", t += i, t += "</span>", t) : i;
  }
}
class rr {
  constructor(e, t) {
    this.children = void 0, this.attributes = void 0, this.children = e || [], this.attributes = t || {};
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && t.setAttribute(r, this.attributes[r]);
    for (var a = 0; a < this.children.length; a++)
      t.appendChild(this.children[a].toNode());
    return t;
  }
  toMarkup() {
    var e = '<svg xmlns="http://www.w3.org/2000/svg"';
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="' + le.escape(this.attributes[t]) + '"');
    e += ">";
    for (var r = 0; r < this.children.length; r++)
      e += this.children[r].toMarkup();
    return e += "</svg>", e;
  }
}
class vr {
  constructor(e, t) {
    this.pathName = void 0, this.alternate = void 0, this.pathName = e, this.alternate = t;
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "path");
    return this.alternate ? t.setAttribute("d", this.alternate) : t.setAttribute("d", zs[this.pathName]), t;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + le.escape(this.alternate) + '"/>' : '<path d="' + le.escape(zs[this.pathName]) + '"/>';
  }
}
class hl {
  constructor(e) {
    this.attributes = void 0, this.attributes = e || {};
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "line");
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && t.setAttribute(r, this.attributes[r]);
    return t;
  }
  toMarkup() {
    var e = "<line";
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="' + le.escape(this.attributes[t]) + '"');
    return e += "/>", e;
  }
}
function qs(n) {
  if (n instanceof s0)
    return n;
  throw new Error("Expected symbolNode but got " + String(n) + ".");
}
function Fd(n) {
  if (n instanceof Ln)
    return n;
  throw new Error("Expected span<HtmlDomNode> but got " + String(n) + ".");
}
var $d = {
  bin: 1,
  close: 1,
  inner: 1,
  open: 1,
  punct: 1,
  rel: 1
}, Md = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, He = {
  math: {},
  text: {}
};
function c(n, e, t, r, a, i) {
  He[n][a] = {
    font: e,
    group: t,
    replace: r
  }, i && r && (He[n][r] = He[n][a]);
}
var d = "math", O = "text", m = "main", D = "ams", je = "accent-token", Q = "bin", $t = "close", Qr = "inner", se = "mathord", ht = "op-token", Wt = "open", Xa = "punct", x = "rel", ir = "spacing", F = "textord";
c(d, m, x, "≡", "\\equiv", !0);
c(d, m, x, "≺", "\\prec", !0);
c(d, m, x, "≻", "\\succ", !0);
c(d, m, x, "∼", "\\sim", !0);
c(d, m, x, "⊥", "\\perp");
c(d, m, x, "⪯", "\\preceq", !0);
c(d, m, x, "⪰", "\\succeq", !0);
c(d, m, x, "≃", "\\simeq", !0);
c(d, m, x, "∣", "\\mid", !0);
c(d, m, x, "≪", "\\ll", !0);
c(d, m, x, "≫", "\\gg", !0);
c(d, m, x, "≍", "\\asymp", !0);
c(d, m, x, "∥", "\\parallel");
c(d, m, x, "⋈", "\\bowtie", !0);
c(d, m, x, "⌣", "\\smile", !0);
c(d, m, x, "⊑", "\\sqsubseteq", !0);
c(d, m, x, "⊒", "\\sqsupseteq", !0);
c(d, m, x, "≐", "\\doteq", !0);
c(d, m, x, "⌢", "\\frown", !0);
c(d, m, x, "∋", "\\ni", !0);
c(d, m, x, "∝", "\\propto", !0);
c(d, m, x, "⊢", "\\vdash", !0);
c(d, m, x, "⊣", "\\dashv", !0);
c(d, m, x, "∋", "\\owns");
c(d, m, Xa, ".", "\\ldotp");
c(d, m, Xa, "⋅", "\\cdotp");
c(d, m, F, "#", "\\#");
c(O, m, F, "#", "\\#");
c(d, m, F, "&", "\\&");
c(O, m, F, "&", "\\&");
c(d, m, F, "ℵ", "\\aleph", !0);
c(d, m, F, "∀", "\\forall", !0);
c(d, m, F, "ℏ", "\\hbar", !0);
c(d, m, F, "∃", "\\exists", !0);
c(d, m, F, "∇", "\\nabla", !0);
c(d, m, F, "♭", "\\flat", !0);
c(d, m, F, "ℓ", "\\ell", !0);
c(d, m, F, "♮", "\\natural", !0);
c(d, m, F, "♣", "\\clubsuit", !0);
c(d, m, F, "℘", "\\wp", !0);
c(d, m, F, "♯", "\\sharp", !0);
c(d, m, F, "♢", "\\diamondsuit", !0);
c(d, m, F, "ℜ", "\\Re", !0);
c(d, m, F, "♡", "\\heartsuit", !0);
c(d, m, F, "ℑ", "\\Im", !0);
c(d, m, F, "♠", "\\spadesuit", !0);
c(d, m, F, "§", "\\S", !0);
c(O, m, F, "§", "\\S");
c(d, m, F, "¶", "\\P", !0);
c(O, m, F, "¶", "\\P");
c(d, m, F, "†", "\\dag");
c(O, m, F, "†", "\\dag");
c(O, m, F, "†", "\\textdagger");
c(d, m, F, "‡", "\\ddag");
c(O, m, F, "‡", "\\ddag");
c(O, m, F, "‡", "\\textdaggerdbl");
c(d, m, $t, "⎱", "\\rmoustache", !0);
c(d, m, Wt, "⎰", "\\lmoustache", !0);
c(d, m, $t, "⟯", "\\rgroup", !0);
c(d, m, Wt, "⟮", "\\lgroup", !0);
c(d, m, Q, "∓", "\\mp", !0);
c(d, m, Q, "⊖", "\\ominus", !0);
c(d, m, Q, "⊎", "\\uplus", !0);
c(d, m, Q, "⊓", "\\sqcap", !0);
c(d, m, Q, "∗", "\\ast");
c(d, m, Q, "⊔", "\\sqcup", !0);
c(d, m, Q, "◯", "\\bigcirc", !0);
c(d, m, Q, "∙", "\\bullet", !0);
c(d, m, Q, "‡", "\\ddagger");
c(d, m, Q, "≀", "\\wr", !0);
c(d, m, Q, "⨿", "\\amalg");
c(d, m, Q, "&", "\\And");
c(d, m, x, "⟵", "\\longleftarrow", !0);
c(d, m, x, "⇐", "\\Leftarrow", !0);
c(d, m, x, "⟸", "\\Longleftarrow", !0);
c(d, m, x, "⟶", "\\longrightarrow", !0);
c(d, m, x, "⇒", "\\Rightarrow", !0);
c(d, m, x, "⟹", "\\Longrightarrow", !0);
c(d, m, x, "↔", "\\leftrightarrow", !0);
c(d, m, x, "⟷", "\\longleftrightarrow", !0);
c(d, m, x, "⇔", "\\Leftrightarrow", !0);
c(d, m, x, "⟺", "\\Longleftrightarrow", !0);
c(d, m, x, "↦", "\\mapsto", !0);
c(d, m, x, "⟼", "\\longmapsto", !0);
c(d, m, x, "↗", "\\nearrow", !0);
c(d, m, x, "↩", "\\hookleftarrow", !0);
c(d, m, x, "↪", "\\hookrightarrow", !0);
c(d, m, x, "↘", "\\searrow", !0);
c(d, m, x, "↼", "\\leftharpoonup", !0);
c(d, m, x, "⇀", "\\rightharpoonup", !0);
c(d, m, x, "↙", "\\swarrow", !0);
c(d, m, x, "↽", "\\leftharpoondown", !0);
c(d, m, x, "⇁", "\\rightharpoondown", !0);
c(d, m, x, "↖", "\\nwarrow", !0);
c(d, m, x, "⇌", "\\rightleftharpoons", !0);
c(d, D, x, "≮", "\\nless", !0);
c(d, D, x, "", "\\@nleqslant");
c(d, D, x, "", "\\@nleqq");
c(d, D, x, "⪇", "\\lneq", !0);
c(d, D, x, "≨", "\\lneqq", !0);
c(d, D, x, "", "\\@lvertneqq");
c(d, D, x, "⋦", "\\lnsim", !0);
c(d, D, x, "⪉", "\\lnapprox", !0);
c(d, D, x, "⊀", "\\nprec", !0);
c(d, D, x, "⋠", "\\npreceq", !0);
c(d, D, x, "⋨", "\\precnsim", !0);
c(d, D, x, "⪹", "\\precnapprox", !0);
c(d, D, x, "≁", "\\nsim", !0);
c(d, D, x, "", "\\@nshortmid");
c(d, D, x, "∤", "\\nmid", !0);
c(d, D, x, "⊬", "\\nvdash", !0);
c(d, D, x, "⊭", "\\nvDash", !0);
c(d, D, x, "⋪", "\\ntriangleleft");
c(d, D, x, "⋬", "\\ntrianglelefteq", !0);
c(d, D, x, "⊊", "\\subsetneq", !0);
c(d, D, x, "", "\\@varsubsetneq");
c(d, D, x, "⫋", "\\subsetneqq", !0);
c(d, D, x, "", "\\@varsubsetneqq");
c(d, D, x, "≯", "\\ngtr", !0);
c(d, D, x, "", "\\@ngeqslant");
c(d, D, x, "", "\\@ngeqq");
c(d, D, x, "⪈", "\\gneq", !0);
c(d, D, x, "≩", "\\gneqq", !0);
c(d, D, x, "", "\\@gvertneqq");
c(d, D, x, "⋧", "\\gnsim", !0);
c(d, D, x, "⪊", "\\gnapprox", !0);
c(d, D, x, "⊁", "\\nsucc", !0);
c(d, D, x, "⋡", "\\nsucceq", !0);
c(d, D, x, "⋩", "\\succnsim", !0);
c(d, D, x, "⪺", "\\succnapprox", !0);
c(d, D, x, "≆", "\\ncong", !0);
c(d, D, x, "", "\\@nshortparallel");
c(d, D, x, "∦", "\\nparallel", !0);
c(d, D, x, "⊯", "\\nVDash", !0);
c(d, D, x, "⋫", "\\ntriangleright");
c(d, D, x, "⋭", "\\ntrianglerighteq", !0);
c(d, D, x, "", "\\@nsupseteqq");
c(d, D, x, "⊋", "\\supsetneq", !0);
c(d, D, x, "", "\\@varsupsetneq");
c(d, D, x, "⫌", "\\supsetneqq", !0);
c(d, D, x, "", "\\@varsupsetneqq");
c(d, D, x, "⊮", "\\nVdash", !0);
c(d, D, x, "⪵", "\\precneqq", !0);
c(d, D, x, "⪶", "\\succneqq", !0);
c(d, D, x, "", "\\@nsubseteqq");
c(d, D, Q, "⊴", "\\unlhd");
c(d, D, Q, "⊵", "\\unrhd");
c(d, D, x, "↚", "\\nleftarrow", !0);
c(d, D, x, "↛", "\\nrightarrow", !0);
c(d, D, x, "⇍", "\\nLeftarrow", !0);
c(d, D, x, "⇏", "\\nRightarrow", !0);
c(d, D, x, "↮", "\\nleftrightarrow", !0);
c(d, D, x, "⇎", "\\nLeftrightarrow", !0);
c(d, D, x, "△", "\\vartriangle");
c(d, D, F, "ℏ", "\\hslash");
c(d, D, F, "▽", "\\triangledown");
c(d, D, F, "◊", "\\lozenge");
c(d, D, F, "Ⓢ", "\\circledS");
c(d, D, F, "®", "\\circledR");
c(O, D, F, "®", "\\circledR");
c(d, D, F, "∡", "\\measuredangle", !0);
c(d, D, F, "∄", "\\nexists");
c(d, D, F, "℧", "\\mho");
c(d, D, F, "Ⅎ", "\\Finv", !0);
c(d, D, F, "⅁", "\\Game", !0);
c(d, D, F, "‵", "\\backprime");
c(d, D, F, "▲", "\\blacktriangle");
c(d, D, F, "▼", "\\blacktriangledown");
c(d, D, F, "■", "\\blacksquare");
c(d, D, F, "⧫", "\\blacklozenge");
c(d, D, F, "★", "\\bigstar");
c(d, D, F, "∢", "\\sphericalangle", !0);
c(d, D, F, "∁", "\\complement", !0);
c(d, D, F, "ð", "\\eth", !0);
c(O, m, F, "ð", "ð");
c(d, D, F, "╱", "\\diagup");
c(d, D, F, "╲", "\\diagdown");
c(d, D, F, "□", "\\square");
c(d, D, F, "□", "\\Box");
c(d, D, F, "◊", "\\Diamond");
c(d, D, F, "¥", "\\yen", !0);
c(O, D, F, "¥", "\\yen", !0);
c(d, D, F, "✓", "\\checkmark", !0);
c(O, D, F, "✓", "\\checkmark");
c(d, D, F, "ℶ", "\\beth", !0);
c(d, D, F, "ℸ", "\\daleth", !0);
c(d, D, F, "ℷ", "\\gimel", !0);
c(d, D, F, "ϝ", "\\digamma", !0);
c(d, D, F, "ϰ", "\\varkappa");
c(d, D, Wt, "┌", "\\@ulcorner", !0);
c(d, D, $t, "┐", "\\@urcorner", !0);
c(d, D, Wt, "└", "\\@llcorner", !0);
c(d, D, $t, "┘", "\\@lrcorner", !0);
c(d, D, x, "≦", "\\leqq", !0);
c(d, D, x, "⩽", "\\leqslant", !0);
c(d, D, x, "⪕", "\\eqslantless", !0);
c(d, D, x, "≲", "\\lesssim", !0);
c(d, D, x, "⪅", "\\lessapprox", !0);
c(d, D, x, "≊", "\\approxeq", !0);
c(d, D, Q, "⋖", "\\lessdot");
c(d, D, x, "⋘", "\\lll", !0);
c(d, D, x, "≶", "\\lessgtr", !0);
c(d, D, x, "⋚", "\\lesseqgtr", !0);
c(d, D, x, "⪋", "\\lesseqqgtr", !0);
c(d, D, x, "≑", "\\doteqdot");
c(d, D, x, "≓", "\\risingdotseq", !0);
c(d, D, x, "≒", "\\fallingdotseq", !0);
c(d, D, x, "∽", "\\backsim", !0);
c(d, D, x, "⋍", "\\backsimeq", !0);
c(d, D, x, "⫅", "\\subseteqq", !0);
c(d, D, x, "⋐", "\\Subset", !0);
c(d, D, x, "⊏", "\\sqsubset", !0);
c(d, D, x, "≼", "\\preccurlyeq", !0);
c(d, D, x, "⋞", "\\curlyeqprec", !0);
c(d, D, x, "≾", "\\precsim", !0);
c(d, D, x, "⪷", "\\precapprox", !0);
c(d, D, x, "⊲", "\\vartriangleleft");
c(d, D, x, "⊴", "\\trianglelefteq");
c(d, D, x, "⊨", "\\vDash", !0);
c(d, D, x, "⊪", "\\Vvdash", !0);
c(d, D, x, "⌣", "\\smallsmile");
c(d, D, x, "⌢", "\\smallfrown");
c(d, D, x, "≏", "\\bumpeq", !0);
c(d, D, x, "≎", "\\Bumpeq", !0);
c(d, D, x, "≧", "\\geqq", !0);
c(d, D, x, "⩾", "\\geqslant", !0);
c(d, D, x, "⪖", "\\eqslantgtr", !0);
c(d, D, x, "≳", "\\gtrsim", !0);
c(d, D, x, "⪆", "\\gtrapprox", !0);
c(d, D, Q, "⋗", "\\gtrdot");
c(d, D, x, "⋙", "\\ggg", !0);
c(d, D, x, "≷", "\\gtrless", !0);
c(d, D, x, "⋛", "\\gtreqless", !0);
c(d, D, x, "⪌", "\\gtreqqless", !0);
c(d, D, x, "≖", "\\eqcirc", !0);
c(d, D, x, "≗", "\\circeq", !0);
c(d, D, x, "≜", "\\triangleq", !0);
c(d, D, x, "∼", "\\thicksim");
c(d, D, x, "≈", "\\thickapprox");
c(d, D, x, "⫆", "\\supseteqq", !0);
c(d, D, x, "⋑", "\\Supset", !0);
c(d, D, x, "⊐", "\\sqsupset", !0);
c(d, D, x, "≽", "\\succcurlyeq", !0);
c(d, D, x, "⋟", "\\curlyeqsucc", !0);
c(d, D, x, "≿", "\\succsim", !0);
c(d, D, x, "⪸", "\\succapprox", !0);
c(d, D, x, "⊳", "\\vartriangleright");
c(d, D, x, "⊵", "\\trianglerighteq");
c(d, D, x, "⊩", "\\Vdash", !0);
c(d, D, x, "∣", "\\shortmid");
c(d, D, x, "∥", "\\shortparallel");
c(d, D, x, "≬", "\\between", !0);
c(d, D, x, "⋔", "\\pitchfork", !0);
c(d, D, x, "∝", "\\varpropto");
c(d, D, x, "◀", "\\blacktriangleleft");
c(d, D, x, "∴", "\\therefore", !0);
c(d, D, x, "∍", "\\backepsilon");
c(d, D, x, "▶", "\\blacktriangleright");
c(d, D, x, "∵", "\\because", !0);
c(d, D, x, "⋘", "\\llless");
c(d, D, x, "⋙", "\\gggtr");
c(d, D, Q, "⊲", "\\lhd");
c(d, D, Q, "⊳", "\\rhd");
c(d, D, x, "≂", "\\eqsim", !0);
c(d, m, x, "⋈", "\\Join");
c(d, D, x, "≑", "\\Doteq", !0);
c(d, D, Q, "∔", "\\dotplus", !0);
c(d, D, Q, "∖", "\\smallsetminus");
c(d, D, Q, "⋒", "\\Cap", !0);
c(d, D, Q, "⋓", "\\Cup", !0);
c(d, D, Q, "⩞", "\\doublebarwedge", !0);
c(d, D, Q, "⊟", "\\boxminus", !0);
c(d, D, Q, "⊞", "\\boxplus", !0);
c(d, D, Q, "⋇", "\\divideontimes", !0);
c(d, D, Q, "⋉", "\\ltimes", !0);
c(d, D, Q, "⋊", "\\rtimes", !0);
c(d, D, Q, "⋋", "\\leftthreetimes", !0);
c(d, D, Q, "⋌", "\\rightthreetimes", !0);
c(d, D, Q, "⋏", "\\curlywedge", !0);
c(d, D, Q, "⋎", "\\curlyvee", !0);
c(d, D, Q, "⊝", "\\circleddash", !0);
c(d, D, Q, "⊛", "\\circledast", !0);
c(d, D, Q, "⋅", "\\centerdot");
c(d, D, Q, "⊺", "\\intercal", !0);
c(d, D, Q, "⋒", "\\doublecap");
c(d, D, Q, "⋓", "\\doublecup");
c(d, D, Q, "⊠", "\\boxtimes", !0);
c(d, D, x, "⇢", "\\dashrightarrow", !0);
c(d, D, x, "⇠", "\\dashleftarrow", !0);
c(d, D, x, "⇇", "\\leftleftarrows", !0);
c(d, D, x, "⇆", "\\leftrightarrows", !0);
c(d, D, x, "⇚", "\\Lleftarrow", !0);
c(d, D, x, "↞", "\\twoheadleftarrow", !0);
c(d, D, x, "↢", "\\leftarrowtail", !0);
c(d, D, x, "↫", "\\looparrowleft", !0);
c(d, D, x, "⇋", "\\leftrightharpoons", !0);
c(d, D, x, "↶", "\\curvearrowleft", !0);
c(d, D, x, "↺", "\\circlearrowleft", !0);
c(d, D, x, "↰", "\\Lsh", !0);
c(d, D, x, "⇈", "\\upuparrows", !0);
c(d, D, x, "↿", "\\upharpoonleft", !0);
c(d, D, x, "⇃", "\\downharpoonleft", !0);
c(d, m, x, "⊶", "\\origof", !0);
c(d, m, x, "⊷", "\\imageof", !0);
c(d, D, x, "⊸", "\\multimap", !0);
c(d, D, x, "↭", "\\leftrightsquigarrow", !0);
c(d, D, x, "⇉", "\\rightrightarrows", !0);
c(d, D, x, "⇄", "\\rightleftarrows", !0);
c(d, D, x, "↠", "\\twoheadrightarrow", !0);
c(d, D, x, "↣", "\\rightarrowtail", !0);
c(d, D, x, "↬", "\\looparrowright", !0);
c(d, D, x, "↷", "\\curvearrowright", !0);
c(d, D, x, "↻", "\\circlearrowright", !0);
c(d, D, x, "↱", "\\Rsh", !0);
c(d, D, x, "⇊", "\\downdownarrows", !0);
c(d, D, x, "↾", "\\upharpoonright", !0);
c(d, D, x, "⇂", "\\downharpoonright", !0);
c(d, D, x, "⇝", "\\rightsquigarrow", !0);
c(d, D, x, "⇝", "\\leadsto");
c(d, D, x, "⇛", "\\Rrightarrow", !0);
c(d, D, x, "↾", "\\restriction");
c(d, m, F, "‘", "`");
c(d, m, F, "$", "\\$");
c(O, m, F, "$", "\\$");
c(O, m, F, "$", "\\textdollar");
c(d, m, F, "%", "\\%");
c(O, m, F, "%", "\\%");
c(d, m, F, "_", "\\_");
c(O, m, F, "_", "\\_");
c(O, m, F, "_", "\\textunderscore");
c(d, m, F, "∠", "\\angle", !0);
c(d, m, F, "∞", "\\infty", !0);
c(d, m, F, "′", "\\prime");
c(d, m, F, "△", "\\triangle");
c(d, m, F, "Γ", "\\Gamma", !0);
c(d, m, F, "Δ", "\\Delta", !0);
c(d, m, F, "Θ", "\\Theta", !0);
c(d, m, F, "Λ", "\\Lambda", !0);
c(d, m, F, "Ξ", "\\Xi", !0);
c(d, m, F, "Π", "\\Pi", !0);
c(d, m, F, "Σ", "\\Sigma", !0);
c(d, m, F, "Υ", "\\Upsilon", !0);
c(d, m, F, "Φ", "\\Phi", !0);
c(d, m, F, "Ψ", "\\Psi", !0);
c(d, m, F, "Ω", "\\Omega", !0);
c(d, m, F, "A", "Α");
c(d, m, F, "B", "Β");
c(d, m, F, "E", "Ε");
c(d, m, F, "Z", "Ζ");
c(d, m, F, "H", "Η");
c(d, m, F, "I", "Ι");
c(d, m, F, "K", "Κ");
c(d, m, F, "M", "Μ");
c(d, m, F, "N", "Ν");
c(d, m, F, "O", "Ο");
c(d, m, F, "P", "Ρ");
c(d, m, F, "T", "Τ");
c(d, m, F, "X", "Χ");
c(d, m, F, "¬", "\\neg", !0);
c(d, m, F, "¬", "\\lnot");
c(d, m, F, "⊤", "\\top");
c(d, m, F, "⊥", "\\bot");
c(d, m, F, "∅", "\\emptyset");
c(d, D, F, "∅", "\\varnothing");
c(d, m, se, "α", "\\alpha", !0);
c(d, m, se, "β", "\\beta", !0);
c(d, m, se, "γ", "\\gamma", !0);
c(d, m, se, "δ", "\\delta", !0);
c(d, m, se, "ϵ", "\\epsilon", !0);
c(d, m, se, "ζ", "\\zeta", !0);
c(d, m, se, "η", "\\eta", !0);
c(d, m, se, "θ", "\\theta", !0);
c(d, m, se, "ι", "\\iota", !0);
c(d, m, se, "κ", "\\kappa", !0);
c(d, m, se, "λ", "\\lambda", !0);
c(d, m, se, "μ", "\\mu", !0);
c(d, m, se, "ν", "\\nu", !0);
c(d, m, se, "ξ", "\\xi", !0);
c(d, m, se, "ο", "\\omicron", !0);
c(d, m, se, "π", "\\pi", !0);
c(d, m, se, "ρ", "\\rho", !0);
c(d, m, se, "σ", "\\sigma", !0);
c(d, m, se, "τ", "\\tau", !0);
c(d, m, se, "υ", "\\upsilon", !0);
c(d, m, se, "ϕ", "\\phi", !0);
c(d, m, se, "χ", "\\chi", !0);
c(d, m, se, "ψ", "\\psi", !0);
c(d, m, se, "ω", "\\omega", !0);
c(d, m, se, "ε", "\\varepsilon", !0);
c(d, m, se, "ϑ", "\\vartheta", !0);
c(d, m, se, "ϖ", "\\varpi", !0);
c(d, m, se, "ϱ", "\\varrho", !0);
c(d, m, se, "ς", "\\varsigma", !0);
c(d, m, se, "φ", "\\varphi", !0);
c(d, m, Q, "∗", "*", !0);
c(d, m, Q, "+", "+");
c(d, m, Q, "−", "-", !0);
c(d, m, Q, "⋅", "\\cdot", !0);
c(d, m, Q, "∘", "\\circ", !0);
c(d, m, Q, "÷", "\\div", !0);
c(d, m, Q, "±", "\\pm", !0);
c(d, m, Q, "×", "\\times", !0);
c(d, m, Q, "∩", "\\cap", !0);
c(d, m, Q, "∪", "\\cup", !0);
c(d, m, Q, "∖", "\\setminus", !0);
c(d, m, Q, "∧", "\\land");
c(d, m, Q, "∨", "\\lor");
c(d, m, Q, "∧", "\\wedge", !0);
c(d, m, Q, "∨", "\\vee", !0);
c(d, m, F, "√", "\\surd");
c(d, m, Wt, "⟨", "\\langle", !0);
c(d, m, Wt, "∣", "\\lvert");
c(d, m, Wt, "∥", "\\lVert");
c(d, m, $t, "?", "?");
c(d, m, $t, "!", "!");
c(d, m, $t, "⟩", "\\rangle", !0);
c(d, m, $t, "∣", "\\rvert");
c(d, m, $t, "∥", "\\rVert");
c(d, m, x, "=", "=");
c(d, m, x, ":", ":");
c(d, m, x, "≈", "\\approx", !0);
c(d, m, x, "≅", "\\cong", !0);
c(d, m, x, "≥", "\\ge");
c(d, m, x, "≥", "\\geq", !0);
c(d, m, x, "←", "\\gets");
c(d, m, x, ">", "\\gt", !0);
c(d, m, x, "∈", "\\in", !0);
c(d, m, x, "", "\\@not");
c(d, m, x, "⊂", "\\subset", !0);
c(d, m, x, "⊃", "\\supset", !0);
c(d, m, x, "⊆", "\\subseteq", !0);
c(d, m, x, "⊇", "\\supseteq", !0);
c(d, D, x, "⊈", "\\nsubseteq", !0);
c(d, D, x, "⊉", "\\nsupseteq", !0);
c(d, m, x, "⊨", "\\models");
c(d, m, x, "←", "\\leftarrow", !0);
c(d, m, x, "≤", "\\le");
c(d, m, x, "≤", "\\leq", !0);
c(d, m, x, "<", "\\lt", !0);
c(d, m, x, "→", "\\rightarrow", !0);
c(d, m, x, "→", "\\to");
c(d, D, x, "≱", "\\ngeq", !0);
c(d, D, x, "≰", "\\nleq", !0);
c(d, m, ir, " ", "\\ ");
c(d, m, ir, " ", "\\space");
c(d, m, ir, " ", "\\nobreakspace");
c(O, m, ir, " ", "\\ ");
c(O, m, ir, " ", " ");
c(O, m, ir, " ", "\\space");
c(O, m, ir, " ", "\\nobreakspace");
c(d, m, ir, null, "\\nobreak");
c(d, m, ir, null, "\\allowbreak");
c(d, m, Xa, ",", ",");
c(d, m, Xa, ";", ";");
c(d, D, Q, "⊼", "\\barwedge", !0);
c(d, D, Q, "⊻", "\\veebar", !0);
c(d, m, Q, "⊙", "\\odot", !0);
c(d, m, Q, "⊕", "\\oplus", !0);
c(d, m, Q, "⊗", "\\otimes", !0);
c(d, m, F, "∂", "\\partial", !0);
c(d, m, Q, "⊘", "\\oslash", !0);
c(d, D, Q, "⊚", "\\circledcirc", !0);
c(d, D, Q, "⊡", "\\boxdot", !0);
c(d, m, Q, "△", "\\bigtriangleup");
c(d, m, Q, "▽", "\\bigtriangledown");
c(d, m, Q, "†", "\\dagger");
c(d, m, Q, "⋄", "\\diamond");
c(d, m, Q, "⋆", "\\star");
c(d, m, Q, "◃", "\\triangleleft");
c(d, m, Q, "▹", "\\triangleright");
c(d, m, Wt, "{", "\\{");
c(O, m, F, "{", "\\{");
c(O, m, F, "{", "\\textbraceleft");
c(d, m, $t, "}", "\\}");
c(O, m, F, "}", "\\}");
c(O, m, F, "}", "\\textbraceright");
c(d, m, Wt, "{", "\\lbrace");
c(d, m, $t, "}", "\\rbrace");
c(d, m, Wt, "[", "\\lbrack", !0);
c(O, m, F, "[", "\\lbrack", !0);
c(d, m, $t, "]", "\\rbrack", !0);
c(O, m, F, "]", "\\rbrack", !0);
c(d, m, Wt, "(", "\\lparen", !0);
c(d, m, $t, ")", "\\rparen", !0);
c(O, m, F, "<", "\\textless", !0);
c(O, m, F, ">", "\\textgreater", !0);
c(d, m, Wt, "⌊", "\\lfloor", !0);
c(d, m, $t, "⌋", "\\rfloor", !0);
c(d, m, Wt, "⌈", "\\lceil", !0);
c(d, m, $t, "⌉", "\\rceil", !0);
c(d, m, F, "\\", "\\backslash");
c(d, m, F, "∣", "|");
c(d, m, F, "∣", "\\vert");
c(O, m, F, "|", "\\textbar", !0);
c(d, m, F, "∥", "\\|");
c(d, m, F, "∥", "\\Vert");
c(O, m, F, "∥", "\\textbardbl");
c(O, m, F, "~", "\\textasciitilde");
c(O, m, F, "\\", "\\textbackslash");
c(O, m, F, "^", "\\textasciicircum");
c(d, m, x, "↑", "\\uparrow", !0);
c(d, m, x, "⇑", "\\Uparrow", !0);
c(d, m, x, "↓", "\\downarrow", !0);
c(d, m, x, "⇓", "\\Downarrow", !0);
c(d, m, x, "↕", "\\updownarrow", !0);
c(d, m, x, "⇕", "\\Updownarrow", !0);
c(d, m, ht, "∐", "\\coprod");
c(d, m, ht, "⋁", "\\bigvee");
c(d, m, ht, "⋀", "\\bigwedge");
c(d, m, ht, "⨄", "\\biguplus");
c(d, m, ht, "⋂", "\\bigcap");
c(d, m, ht, "⋃", "\\bigcup");
c(d, m, ht, "∫", "\\int");
c(d, m, ht, "∫", "\\intop");
c(d, m, ht, "∬", "\\iint");
c(d, m, ht, "∭", "\\iiint");
c(d, m, ht, "∏", "\\prod");
c(d, m, ht, "∑", "\\sum");
c(d, m, ht, "⨂", "\\bigotimes");
c(d, m, ht, "⨁", "\\bigoplus");
c(d, m, ht, "⨀", "\\bigodot");
c(d, m, ht, "∮", "\\oint");
c(d, m, ht, "∯", "\\oiint");
c(d, m, ht, "∰", "\\oiiint");
c(d, m, ht, "⨆", "\\bigsqcup");
c(d, m, ht, "∫", "\\smallint");
c(O, m, Qr, "…", "\\textellipsis");
c(d, m, Qr, "…", "\\mathellipsis");
c(O, m, Qr, "…", "\\ldots", !0);
c(d, m, Qr, "…", "\\ldots", !0);
c(d, m, Qr, "⋯", "\\@cdots", !0);
c(d, m, Qr, "⋱", "\\ddots", !0);
c(d, m, F, "⋮", "\\varvdots");
c(O, m, F, "⋮", "\\varvdots");
c(d, m, je, "ˊ", "\\acute");
c(d, m, je, "ˋ", "\\grave");
c(d, m, je, "¨", "\\ddot");
c(d, m, je, "~", "\\tilde");
c(d, m, je, "ˉ", "\\bar");
c(d, m, je, "˘", "\\breve");
c(d, m, je, "ˇ", "\\check");
c(d, m, je, "^", "\\hat");
c(d, m, je, "⃗", "\\vec");
c(d, m, je, "˙", "\\dot");
c(d, m, je, "˚", "\\mathring");
c(d, m, se, "", "\\@imath");
c(d, m, se, "", "\\@jmath");
c(d, m, F, "ı", "ı");
c(d, m, F, "ȷ", "ȷ");
c(O, m, F, "ı", "\\i", !0);
c(O, m, F, "ȷ", "\\j", !0);
c(O, m, F, "ß", "\\ss", !0);
c(O, m, F, "æ", "\\ae", !0);
c(O, m, F, "œ", "\\oe", !0);
c(O, m, F, "ø", "\\o", !0);
c(O, m, F, "Æ", "\\AE", !0);
c(O, m, F, "Œ", "\\OE", !0);
c(O, m, F, "Ø", "\\O", !0);
c(O, m, je, "ˊ", "\\'");
c(O, m, je, "ˋ", "\\`");
c(O, m, je, "ˆ", "\\^");
c(O, m, je, "˜", "\\~");
c(O, m, je, "ˉ", "\\=");
c(O, m, je, "˘", "\\u");
c(O, m, je, "˙", "\\.");
c(O, m, je, "¸", "\\c");
c(O, m, je, "˚", "\\r");
c(O, m, je, "ˇ", "\\v");
c(O, m, je, "¨", '\\"');
c(O, m, je, "˝", "\\H");
c(O, m, je, "◯", "\\textcircled");
var k1 = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
c(O, m, F, "–", "--", !0);
c(O, m, F, "–", "\\textendash");
c(O, m, F, "—", "---", !0);
c(O, m, F, "—", "\\textemdash");
c(O, m, F, "‘", "`", !0);
c(O, m, F, "‘", "\\textquoteleft");
c(O, m, F, "’", "'", !0);
c(O, m, F, "’", "\\textquoteright");
c(O, m, F, "“", "``", !0);
c(O, m, F, "“", "\\textquotedblleft");
c(O, m, F, "”", "''", !0);
c(O, m, F, "”", "\\textquotedblright");
c(d, m, F, "°", "\\degree", !0);
c(O, m, F, "°", "\\degree");
c(O, m, F, "°", "\\textdegree", !0);
c(d, m, F, "£", "\\pounds");
c(d, m, F, "£", "\\mathsterling", !0);
c(O, m, F, "£", "\\pounds");
c(O, m, F, "£", "\\textsterling", !0);
c(d, D, F, "✠", "\\maltese");
c(O, D, F, "✠", "\\maltese");
var Is = '0123456789/@."';
for (var gi = 0; gi < Is.length; gi++) {
  var Ns = Is.charAt(gi);
  c(d, m, F, Ns, Ns);
}
var Os = '0123456789!@*()-=+";:?/.,';
for (var _i = 0; _i < Os.length; _i++) {
  var Ps = Os.charAt(_i);
  c(O, m, F, Ps, Ps);
}
var Na = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var vi = 0; vi < Na.length; vi++) {
  var Yn = Na.charAt(vi);
  c(d, m, se, Yn, Yn), c(O, m, F, Yn, Yn);
}
c(d, D, F, "C", "ℂ");
c(O, D, F, "C", "ℂ");
c(d, D, F, "H", "ℍ");
c(O, D, F, "H", "ℍ");
c(d, D, F, "N", "ℕ");
c(O, D, F, "N", "ℕ");
c(d, D, F, "P", "ℙ");
c(O, D, F, "P", "ℙ");
c(d, D, F, "Q", "ℚ");
c(O, D, F, "Q", "ℚ");
c(d, D, F, "R", "ℝ");
c(O, D, F, "R", "ℝ");
c(d, D, F, "Z", "ℤ");
c(O, D, F, "Z", "ℤ");
c(d, m, se, "h", "ℎ");
c(O, m, se, "h", "ℎ");
var he = "";
for (var At = 0; At < Na.length; At++) {
  var rt = Na.charAt(At);
  he = String.fromCharCode(55349, 56320 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56372 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56424 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56580 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56684 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56736 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56788 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56840 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56944 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), At < 26 && (he = String.fromCharCode(55349, 56632 + At), c(d, m, se, rt, he), c(O, m, F, rt, he), he = String.fromCharCode(55349, 56476 + At), c(d, m, se, rt, he), c(O, m, F, rt, he));
}
he = "𝕜";
c(d, m, se, "k", he);
c(O, m, F, "k", he);
for (var Sr = 0; Sr < 10; Sr++) {
  var sr = Sr.toString();
  he = String.fromCharCode(55349, 57294 + Sr), c(d, m, se, sr, he), c(O, m, F, sr, he), he = String.fromCharCode(55349, 57314 + Sr), c(d, m, se, sr, he), c(O, m, F, sr, he), he = String.fromCharCode(55349, 57324 + Sr), c(d, m, se, sr, he), c(O, m, F, sr, he), he = String.fromCharCode(55349, 57334 + Sr), c(d, m, se, sr, he), c(O, m, F, sr, he);
}
var dl = "ÐÞþ";
for (var bi = 0; bi < dl.length; bi++) {
  var Xn = dl.charAt(bi);
  c(d, m, se, Xn, Xn), c(O, m, F, Xn, Xn);
}
var Zn = [
  ["mathbf", "textbf", "Main-Bold"],
  // A-Z bold upright
  ["mathbf", "textbf", "Main-Bold"],
  // a-z bold upright
  ["mathnormal", "textit", "Math-Italic"],
  // A-Z italic
  ["mathnormal", "textit", "Math-Italic"],
  // a-z italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // A-Z bold italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // a-z bold italic
  // Map fancy A-Z letters to script, not calligraphic.
  // This aligns with unicode-math and math fonts (except Cambria Math).
  ["mathscr", "textscr", "Script-Regular"],
  // A-Z script
  ["", "", ""],
  // a-z script.  No font
  ["", "", ""],
  // A-Z bold script. No font
  ["", "", ""],
  // a-z bold script. No font
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // A-Z Fraktur
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // a-z Fraktur
  ["mathbb", "textbb", "AMS-Regular"],
  // A-Z double-struck
  ["mathbb", "textbb", "AMS-Regular"],
  // k double-struck
  // Note that we are using a bold font, but font metrics for regular Fraktur.
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // A-Z bold Fraktur
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // a-z bold Fraktur
  ["mathsf", "textsf", "SansSerif-Regular"],
  // A-Z sans-serif
  ["mathsf", "textsf", "SansSerif-Regular"],
  // a-z sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // A-Z bold sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // a-z bold sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // A-Z italic sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // a-z italic sans-serif
  ["", "", ""],
  // A-Z bold italic sans. No font
  ["", "", ""],
  // a-z bold italic sans. No font
  ["mathtt", "texttt", "Typewriter-Regular"],
  // A-Z monospace
  ["mathtt", "texttt", "Typewriter-Regular"]
  // a-z monospace
], Hs = [
  ["mathbf", "textbf", "Main-Bold"],
  // 0-9 bold
  ["", "", ""],
  // 0-9 double-struck. No KaTeX font.
  ["mathsf", "textsf", "SansSerif-Regular"],
  // 0-9 sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // 0-9 bold sans-serif
  ["mathtt", "texttt", "Typewriter-Regular"]
  // 0-9 monospace
], zd = function(e, t) {
  var r = e.charCodeAt(0), a = e.charCodeAt(1), i = (r - 55296) * 1024 + (a - 56320) + 65536, l = t === "math" ? 0 : 1;
  if (119808 <= i && i < 120484) {
    var s = Math.floor((i - 119808) / 26);
    return [Zn[s][2], Zn[s][l]];
  } else if (120782 <= i && i <= 120831) {
    var o = Math.floor((i - 120782) / 10);
    return [Hs[o][2], Hs[o][l]];
  } else {
    if (i === 120485 || i === 120486)
      return [Zn[0][2], Zn[0][l]];
    if (120486 < i && i < 120782)
      return ["", ""];
    throw new V("Unsupported character: " + e);
  }
}, Za = function(e, t, r) {
  return He[r][e] && He[r][e].replace && (e = He[r][e].replace), {
    value: e,
    metrics: Ll(e, t, r)
  };
}, v0 = function(e, t, r, a, i) {
  var l = Za(e, t, r), s = l.metrics;
  e = l.value;
  var o;
  if (s) {
    var u = s.italic;
    (r === "text" || a && a.font === "mathit") && (u = 0), o = new s0(e, s.height, s.depth, u, s.skew, s.width, i);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + r + "'")), o = new s0(e, 0, 0, 0, 0, 0, i);
  if (a) {
    o.maxFontSize = a.sizeMultiplier, a.style.isTight() && o.classes.push("mtight");
    var h = a.getColor();
    h && (o.style.color = h);
  }
  return o;
}, Bd = function(e, t, r, a) {
  return a === void 0 && (a = []), r.font === "boldsymbol" && Za(e, "Main-Bold", t).metrics ? v0(e, "Main-Bold", t, r, a.concat(["mathbf"])) : e === "\\" || He[t][e].font === "main" ? v0(e, "Main-Regular", t, r, a) : v0(e, "AMS-Regular", t, r, a.concat(["amsrm"]));
}, Ld = function(e, t, r, a, i) {
  return i !== "textord" && Za(e, "Math-BoldItalic", t).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, Rd = function(e, t, r) {
  var a = e.mode, i = e.text, l = ["mord"], s = a === "math" || a === "text" && t.font, o = s ? t.font : t.fontFamily, u = "", h = "";
  if (i.charCodeAt(0) === 55349 && ([u, h] = zd(i, a)), u.length > 0)
    return v0(i, u, a, t, l.concat(h));
  if (o) {
    var f, p;
    if (o === "boldsymbol") {
      var g = Ld(i, a, t, l, r);
      f = g.fontName, p = [g.fontClass];
    } else s ? (f = x1[o].fontName, p = [o]) : (f = Kn(o, t.fontWeight, t.fontShape), p = [o, t.fontWeight, t.fontShape]);
    if (Za(i, f, a).metrics)
      return v0(i, f, a, t, l.concat(p));
    if (k1.hasOwnProperty(i) && f.slice(0, 10) === "Typewriter") {
      for (var w = [], v = 0; v < i.length; v++)
        w.push(v0(i[v], f, a, t, l.concat(p)));
      return S1(w);
    }
  }
  if (r === "mathord")
    return v0(i, "Math-Italic", a, t, l.concat(["mathnormal"]));
  if (r === "textord") {
    var y = He[a][i] && He[a][i].font;
    if (y === "ams") {
      var E = Kn("amsrm", t.fontWeight, t.fontShape);
      return v0(i, E, a, t, l.concat("amsrm", t.fontWeight, t.fontShape));
    } else if (y === "main" || !y) {
      var k = Kn("textrm", t.fontWeight, t.fontShape);
      return v0(i, k, a, t, l.concat(t.fontWeight, t.fontShape));
    } else {
      var b = Kn(y, t.fontWeight, t.fontShape);
      return v0(i, b, a, t, l.concat(b, t.fontWeight, t.fontShape));
    }
  } else
    throw new Error("unexpected type: " + r + " in makeOrd");
}, qd = (n, e) => {
  if (_r(n.classes) !== _r(e.classes) || n.skew !== e.skew || n.maxFontSize !== e.maxFontSize)
    return !1;
  if (n.classes.length === 1) {
    var t = n.classes[0];
    if (t === "mbin" || t === "mord")
      return !1;
  }
  for (var r in n.style)
    if (n.style.hasOwnProperty(r) && n.style[r] !== e.style[r])
      return !1;
  for (var a in e.style)
    if (e.style.hasOwnProperty(a) && n.style[a] !== e.style[a])
      return !1;
  return !0;
}, Id = (n) => {
  for (var e = 0; e < n.length - 1; e++) {
    var t = n[e], r = n[e + 1];
    t instanceof s0 && r instanceof s0 && qd(t, r) && (t.text += r.text, t.height = Math.max(t.height, r.height), t.depth = Math.max(t.depth, r.depth), t.italic = r.italic, n.splice(e + 1, 1), e--);
  }
  return n;
}, ql = function(e) {
  for (var t = 0, r = 0, a = 0, i = 0; i < e.children.length; i++) {
    var l = e.children[i];
    l.height > t && (t = l.height), l.depth > r && (r = l.depth), l.maxFontSize > a && (a = l.maxFontSize);
  }
  e.height = t, e.depth = r, e.maxFontSize = a;
}, Bt = function(e, t, r, a) {
  var i = new Ln(e, t, r, a);
  return ql(i), i;
}, D1 = (n, e, t, r) => new Ln(n, e, t, r), Nd = function(e, t, r) {
  var a = Bt([e], [], t);
  return a.height = Math.max(r || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), a.style.borderBottomWidth = Y(a.height), a.maxFontSize = 1, a;
}, Od = function(e, t, r, a) {
  var i = new Rl(e, t, r, a);
  return ql(i), i;
}, S1 = function(e) {
  var t = new Bn(e);
  return ql(t), t;
}, Pd = function(e, t) {
  return e instanceof Bn ? Bt([], [e], t) : e;
}, Hd = function(e) {
  if (e.positionType === "individualShift") {
    for (var t = e.children, r = [t[0]], a = -t[0].shift - t[0].elem.depth, i = a, l = 1; l < t.length; l++) {
      var s = -t[l].shift - i - t[l].elem.depth, o = s - (t[l - 1].elem.height + t[l - 1].elem.depth);
      i = i + s, r.push({
        type: "kern",
        size: o
      }), r.push(t[l]);
    }
    return {
      children: r,
      depth: a
    };
  }
  var u;
  if (e.positionType === "top") {
    for (var h = e.positionData, f = 0; f < e.children.length; f++) {
      var p = e.children[f];
      h -= p.type === "kern" ? p.size : p.elem.height + p.elem.depth;
    }
    u = h;
  } else if (e.positionType === "bottom")
    u = -e.positionData;
  else {
    var g = e.children[0];
    if (g.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (e.positionType === "shift")
      u = -g.elem.depth - e.positionData;
    else if (e.positionType === "firstBaseline")
      u = -g.elem.depth;
    else
      throw new Error("Invalid positionType " + e.positionType + ".");
  }
  return {
    children: e.children,
    depth: u
  };
}, Ud = function(e, t) {
  for (var {
    children: r,
    depth: a
  } = Hd(e), i = 0, l = 0; l < r.length; l++) {
    var s = r[l];
    if (s.type === "elem") {
      var o = s.elem;
      i = Math.max(i, o.maxFontSize, o.height);
    }
  }
  i += 2;
  var u = Bt(["pstrut"], []);
  u.style.height = Y(i);
  for (var h = [], f = a, p = a, g = a, w = 0; w < r.length; w++) {
    var v = r[w];
    if (v.type === "kern")
      g += v.size;
    else {
      var y = v.elem, E = v.wrapperClasses || [], k = v.wrapperStyle || {}, b = Bt(E, [u, y], void 0, k);
      b.style.top = Y(-i - g - y.depth), v.marginLeft && (b.style.marginLeft = v.marginLeft), v.marginRight && (b.style.marginRight = v.marginRight), h.push(b), g += y.height + y.depth;
    }
    f = Math.min(f, g), p = Math.max(p, g);
  }
  var A = Bt(["vlist"], h);
  A.style.height = Y(p);
  var M;
  if (f < 0) {
    var R = Bt([], []), L = Bt(["vlist"], [R]);
    L.style.height = Y(-f);
    var H = Bt(["vlist-s"], [new s0("​")]);
    M = [Bt(["vlist-r"], [A, H]), Bt(["vlist-r"], [L])];
  } else
    M = [Bt(["vlist-r"], [A])];
  var q = Bt(["vlist-t"], M);
  return M.length === 2 && q.classes.push("vlist-t2"), q.height = p, q.depth = -f, q;
}, Gd = (n, e) => {
  var t = Bt(["mspace"], [], e), r = Xe(n, e);
  return t.style.marginRight = Y(r), t;
}, Kn = function(e, t, r) {
  var a = "";
  switch (e) {
    case "amsrm":
      a = "AMS";
      break;
    case "textrm":
      a = "Main";
      break;
    case "textsf":
      a = "SansSerif";
      break;
    case "texttt":
      a = "Typewriter";
      break;
    default:
      a = e;
  }
  var i;
  return t === "textbf" && r === "textit" ? i = "BoldItalic" : t === "textbf" ? i = "Bold" : t === "textit" ? i = "Italic" : i = "Regular", a + "-" + i;
}, x1 = {
  // styles
  mathbf: {
    variant: "bold",
    fontName: "Main-Bold"
  },
  mathrm: {
    variant: "normal",
    fontName: "Main-Regular"
  },
  textit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathnormal: {
    variant: "italic",
    fontName: "Math-Italic"
  },
  mathsfit: {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.
  // families
  mathbb: {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  mathcal: {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  mathfrak: {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  mathscr: {
    variant: "script",
    fontName: "Script-Regular"
  },
  mathsf: {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  mathtt: {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
}, A1 = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
}, Vd = function(e, t) {
  var [r, a, i] = A1[e], l = new vr(r), s = new rr([l], {
    width: Y(a),
    height: Y(i),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Y(a),
    viewBox: "0 0 " + 1e3 * a + " " + 1e3 * i,
    preserveAspectRatio: "xMinYMin"
  }), o = D1(["overlay"], [s], t);
  return o.height = i, o.style.height = Y(i), o.style.width = Y(a), o;
}, B = {
  fontMap: x1,
  makeSymbol: v0,
  mathsym: Bd,
  makeSpan: Bt,
  makeSvgSpan: D1,
  makeLineSpan: Nd,
  makeAnchor: Od,
  makeFragment: S1,
  wrapFragment: Pd,
  makeVList: Ud,
  makeOrd: Rd,
  makeGlue: Gd,
  staticSvg: Vd,
  svgData: A1,
  tryCombineChars: Id
}, Ye = {
  number: 3,
  unit: "mu"
}, xr = {
  number: 4,
  unit: "mu"
}, W0 = {
  number: 5,
  unit: "mu"
}, jd = {
  mord: {
    mop: Ye,
    mbin: xr,
    mrel: W0,
    minner: Ye
  },
  mop: {
    mord: Ye,
    mop: Ye,
    mrel: W0,
    minner: Ye
  },
  mbin: {
    mord: xr,
    mop: xr,
    mopen: xr,
    minner: xr
  },
  mrel: {
    mord: W0,
    mop: W0,
    mopen: W0,
    minner: W0
  },
  mopen: {},
  mclose: {
    mop: Ye,
    mbin: xr,
    mrel: W0,
    minner: Ye
  },
  mpunct: {
    mord: Ye,
    mop: Ye,
    mrel: W0,
    mopen: Ye,
    mclose: Ye,
    mpunct: Ye,
    minner: Ye
  },
  minner: {
    mord: Ye,
    mop: Ye,
    mbin: xr,
    mrel: W0,
    mopen: Ye,
    mpunct: Ye,
    minner: Ye
  }
}, Wd = {
  mord: {
    mop: Ye
  },
  mop: {
    mord: Ye,
    mop: Ye
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: Ye
  },
  mpunct: {},
  minner: {
    mop: Ye
  }
}, E1 = {}, Oa = {}, Pa = {};
function K(n) {
  for (var {
    type: e,
    names: t,
    props: r,
    handler: a,
    htmlBuilder: i,
    mathmlBuilder: l
  } = n, s = {
    type: e,
    numArgs: r.numArgs,
    argTypes: r.argTypes,
    allowedInArgument: !!r.allowedInArgument,
    allowedInText: !!r.allowedInText,
    allowedInMath: r.allowedInMath === void 0 ? !0 : r.allowedInMath,
    numOptionalArgs: r.numOptionalArgs || 0,
    infix: !!r.infix,
    primitive: !!r.primitive,
    handler: a
  }, o = 0; o < t.length; ++o)
    E1[t[o]] = s;
  e && (i && (Oa[e] = i), l && (Pa[e] = l));
}
function Mr(n) {
  var {
    type: e,
    htmlBuilder: t,
    mathmlBuilder: r
  } = n;
  K({
    type: e,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: t,
    mathmlBuilder: r
  });
}
var Ha = function(e) {
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
}, it = function(e) {
  return e.type === "ordgroup" ? e.body : [e];
}, nr = B.makeSpan, Yd = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], Xd = ["rightmost", "mrel", "mclose", "mpunct"], Zd = {
  display: oe.DISPLAY,
  text: oe.TEXT,
  script: oe.SCRIPT,
  scriptscript: oe.SCRIPTSCRIPT
}, Kd = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, ft = function(e, t, r, a) {
  a === void 0 && (a = [null, null]);
  for (var i = [], l = 0; l < e.length; l++) {
    var s = Ee(e[l], t);
    if (s instanceof Bn) {
      var o = s.children;
      i.push(...o);
    } else
      i.push(s);
  }
  if (B.tryCombineChars(i), !r)
    return i;
  var u = t;
  if (e.length === 1) {
    var h = e[0];
    h.type === "sizing" ? u = t.havingSize(h.size) : h.type === "styling" && (u = t.havingStyle(Zd[h.style]));
  }
  var f = nr([a[0] || "leftmost"], [], t), p = nr([a[1] || "rightmost"], [], t), g = r === "root";
  return Us(i, (w, v) => {
    var y = v.classes[0], E = w.classes[0];
    y === "mbin" && le.contains(Xd, E) ? v.classes[0] = "mord" : E === "mbin" && le.contains(Yd, y) && (w.classes[0] = "mord");
  }, {
    node: f
  }, p, g), Us(i, (w, v) => {
    var y = fl(v), E = fl(w), k = y && E ? w.hasClass("mtight") ? Wd[y][E] : jd[y][E] : null;
    if (k)
      return B.makeGlue(k, u);
  }, {
    node: f
  }, p, g), i;
}, Us = function n(e, t, r, a, i) {
  a && e.push(a);
  for (var l = 0; l < e.length; l++) {
    var s = e[l], o = C1(s);
    if (o) {
      n(o.children, t, r, null, i);
      continue;
    }
    var u = !s.hasClass("mspace");
    if (u) {
      var h = t(s, r.node);
      h && (r.insertAfter ? r.insertAfter(h) : (e.unshift(h), l++));
    }
    u ? r.node = s : i && s.hasClass("newline") && (r.node = nr(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((f) => (p) => {
      e.splice(f + 1, 0, p), l++;
    })(l);
  }
  a && e.pop();
}, C1 = function(e) {
  return e instanceof Bn || e instanceof Rl || e instanceof Ln && e.hasClass("enclosing") ? e : null;
}, Qd = function n(e, t) {
  var r = C1(e);
  if (r) {
    var a = r.children;
    if (a.length) {
      if (t === "right")
        return n(a[a.length - 1], "right");
      if (t === "left")
        return n(a[0], "left");
    }
  }
  return e;
}, fl = function(e, t) {
  return e ? (t && (e = Qd(e, t)), Kd[e.classes[0]] || null) : null;
}, Cn = function(e, t) {
  var r = ["nulldelimiter"].concat(e.baseSizingClasses());
  return nr(t.concat(r));
}, Ee = function(e, t, r) {
  if (!e)
    return nr();
  if (Oa[e.type]) {
    var a = Oa[e.type](e, t);
    if (r && t.size !== r.size) {
      a = nr(t.sizingClasses(r), [a], t);
      var i = t.sizeMultiplier / r.sizeMultiplier;
      a.height *= i, a.depth *= i;
    }
    return a;
  } else
    throw new V("Got group of unknown type: '" + e.type + "'");
};
function Qn(n, e) {
  var t = nr(["base"], n, e), r = nr(["strut"]);
  return r.style.height = Y(t.height + t.depth), t.depth && (r.style.verticalAlign = Y(-t.depth)), t.children.unshift(r), t;
}
function ml(n, e) {
  var t = null;
  n.length === 1 && n[0].type === "tag" && (t = n[0].tag, n = n[0].body);
  var r = ft(n, e, "root"), a;
  r.length === 2 && r[1].hasClass("tag") && (a = r.pop());
  for (var i = [], l = [], s = 0; s < r.length; s++)
    if (l.push(r[s]), r[s].hasClass("mbin") || r[s].hasClass("mrel") || r[s].hasClass("allowbreak")) {
      for (var o = !1; s < r.length - 1 && r[s + 1].hasClass("mspace") && !r[s + 1].hasClass("newline"); )
        s++, l.push(r[s]), r[s].hasClass("nobreak") && (o = !0);
      o || (i.push(Qn(l, e)), l = []);
    } else r[s].hasClass("newline") && (l.pop(), l.length > 0 && (i.push(Qn(l, e)), l = []), i.push(r[s]));
  l.length > 0 && i.push(Qn(l, e));
  var u;
  t ? (u = Qn(ft(t, e, !0)), u.classes = ["tag"], i.push(u)) : a && i.push(a);
  var h = nr(["katex-html"], i);
  if (h.setAttribute("aria-hidden", "true"), u) {
    var f = u.children[0];
    f.style.height = Y(h.height + h.depth), h.depth && (f.style.verticalAlign = Y(-h.depth));
  }
  return h;
}
function T1(n) {
  return new Bn(n);
}
class Vt {
  constructor(e, t, r) {
    this.type = void 0, this.attributes = void 0, this.children = void 0, this.classes = void 0, this.type = e, this.attributes = {}, this.children = t || [], this.classes = r || [];
  }
  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(e) {
    return this.attributes[e];
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && e.setAttribute(t, this.attributes[t]);
    this.classes.length > 0 && (e.className = _r(this.classes));
    for (var r = 0; r < this.children.length; r++)
      if (this.children[r] instanceof F0 && this.children[r + 1] instanceof F0) {
        for (var a = this.children[r].toText() + this.children[++r].toText(); this.children[r + 1] instanceof F0; )
          a += this.children[++r].toText();
        e.appendChild(new F0(a).toNode());
      } else
        e.appendChild(this.children[r].toNode());
    return e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    var e = "<" + this.type;
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="', e += le.escape(this.attributes[t]), e += '"');
    this.classes.length > 0 && (e += ' class ="' + le.escape(_r(this.classes)) + '"'), e += ">";
    for (var r = 0; r < this.children.length; r++)
      e += this.children[r].toMarkup();
    return e += "</" + this.type + ">", e;
  }
  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map((e) => e.toText()).join("");
  }
}
class F0 {
  constructor(e) {
    this.text = void 0, this.text = e;
  }
  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }
  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return le.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class Jd {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(e) {
    this.width = void 0, this.character = void 0, this.width = e, e >= 0.05555 && e <= 0.05556 ? this.character = " " : e >= 0.1666 && e <= 0.1667 ? this.character = " " : e >= 0.2222 && e <= 0.2223 ? this.character = " " : e >= 0.2777 && e <= 0.2778 ? this.character = "  " : e >= -0.05556 && e <= -0.05555 ? this.character = " ⁣" : e >= -0.1667 && e <= -0.1666 ? this.character = " ⁣" : e >= -0.2223 && e <= -0.2222 ? this.character = " ⁣" : e >= -0.2778 && e <= -0.2777 ? this.character = " ⁣" : this.character = null;
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character)
      return document.createTextNode(this.character);
    var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
    return e.setAttribute("width", Y(this.width)), e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + Y(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var G = {
  MathNode: Vt,
  TextNode: F0,
  SpaceNode: Jd,
  newDocumentFragment: T1
}, o0 = function(e, t, r) {
  return He[t][e] && He[t][e].replace && e.charCodeAt(0) !== 55349 && !(k1.hasOwnProperty(e) && r && (r.fontFamily && r.fontFamily.slice(4, 6) === "tt" || r.font && r.font.slice(4, 6) === "tt")) && (e = He[t][e].replace), new G.TextNode(e);
}, Il = function(e) {
  return e.length === 1 ? e[0] : new G.MathNode("mrow", e);
}, Nl = function(e, t) {
  if (t.fontFamily === "texttt")
    return "monospace";
  if (t.fontFamily === "textsf")
    return t.fontShape === "textit" && t.fontWeight === "textbf" ? "sans-serif-bold-italic" : t.fontShape === "textit" ? "sans-serif-italic" : t.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
  if (t.fontShape === "textit" && t.fontWeight === "textbf")
    return "bold-italic";
  if (t.fontShape === "textit")
    return "italic";
  if (t.fontWeight === "textbf")
    return "bold";
  var r = t.font;
  if (!r || r === "mathnormal")
    return null;
  var a = e.mode;
  if (r === "mathit")
    return "italic";
  if (r === "boldsymbol")
    return e.type === "textord" ? "bold" : "bold-italic";
  if (r === "mathbf")
    return "bold";
  if (r === "mathbb")
    return "double-struck";
  if (r === "mathsfit")
    return "sans-serif-italic";
  if (r === "mathfrak")
    return "fraktur";
  if (r === "mathscr" || r === "mathcal")
    return "script";
  if (r === "mathsf")
    return "sans-serif";
  if (r === "mathtt")
    return "monospace";
  var i = e.text;
  if (le.contains(["\\imath", "\\jmath"], i))
    return null;
  He[a][i] && He[a][i].replace && (i = He[a][i].replace);
  var l = B.fontMap[r].fontName;
  return Ll(i, l, a) ? B.fontMap[r].variant : null;
};
function yi(n) {
  if (!n)
    return !1;
  if (n.type === "mi" && n.children.length === 1) {
    var e = n.children[0];
    return e instanceof F0 && e.text === ".";
  } else if (n.type === "mo" && n.children.length === 1 && n.getAttribute("separator") === "true" && n.getAttribute("lspace") === "0em" && n.getAttribute("rspace") === "0em") {
    var t = n.children[0];
    return t instanceof F0 && t.text === ",";
  } else
    return !1;
}
var Rt = function(e, t, r) {
  if (e.length === 1) {
    var a = Pe(e[0], t);
    return r && a instanceof Vt && a.type === "mo" && (a.setAttribute("lspace", "0em"), a.setAttribute("rspace", "0em")), [a];
  }
  for (var i = [], l, s = 0; s < e.length; s++) {
    var o = Pe(e[s], t);
    if (o instanceof Vt && l instanceof Vt) {
      if (o.type === "mtext" && l.type === "mtext" && o.getAttribute("mathvariant") === l.getAttribute("mathvariant")) {
        l.children.push(...o.children);
        continue;
      } else if (o.type === "mn" && l.type === "mn") {
        l.children.push(...o.children);
        continue;
      } else if (yi(o) && l.type === "mn") {
        l.children.push(...o.children);
        continue;
      } else if (o.type === "mn" && yi(l))
        o.children = [...l.children, ...o.children], i.pop();
      else if ((o.type === "msup" || o.type === "msub") && o.children.length >= 1 && (l.type === "mn" || yi(l))) {
        var u = o.children[0];
        u instanceof Vt && u.type === "mn" && (u.children = [...l.children, ...u.children], i.pop());
      } else if (l.type === "mi" && l.children.length === 1) {
        var h = l.children[0];
        if (h instanceof F0 && h.text === "̸" && (o.type === "mo" || o.type === "mi" || o.type === "mn")) {
          var f = o.children[0];
          f instanceof F0 && f.text.length > 0 && (f.text = f.text.slice(0, 1) + "̸" + f.text.slice(1), i.pop());
        }
      }
    }
    i.push(o), l = o;
  }
  return i;
}, br = function(e, t, r) {
  return Il(Rt(e, t, r));
}, Pe = function(e, t) {
  if (!e)
    return new G.MathNode("mrow");
  if (Pa[e.type]) {
    var r = Pa[e.type](e, t);
    return r;
  } else
    throw new V("Got group of unknown type: '" + e.type + "'");
};
function Gs(n, e, t, r, a) {
  var i = Rt(n, t), l;
  i.length === 1 && i[0] instanceof Vt && le.contains(["mrow", "mtable"], i[0].type) ? l = i[0] : l = new G.MathNode("mrow", i);
  var s = new G.MathNode("annotation", [new G.TextNode(e)]);
  s.setAttribute("encoding", "application/x-tex");
  var o = new G.MathNode("semantics", [l, s]), u = new G.MathNode("math", [o]);
  u.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && u.setAttribute("display", "block");
  var h = a ? "katex" : "katex-mathml";
  return B.makeSpan([h], [u]);
}
var F1 = function(e) {
  return new K0({
    style: e.displayMode ? oe.DISPLAY : oe.TEXT,
    maxSize: e.maxSize,
    minRuleThickness: e.minRuleThickness
  });
}, $1 = function(e, t) {
  if (t.displayMode) {
    var r = ["katex-display"];
    t.leqno && r.push("leqno"), t.fleqn && r.push("fleqn"), e = B.makeSpan(r, [e]);
  }
  return e;
}, ef = function(e, t, r) {
  var a = F1(r), i;
  if (r.output === "mathml")
    return Gs(e, t, a, r.displayMode, !0);
  if (r.output === "html") {
    var l = ml(e, a);
    i = B.makeSpan(["katex"], [l]);
  } else {
    var s = Gs(e, t, a, r.displayMode, !1), o = ml(e, a);
    i = B.makeSpan(["katex"], [s, o]);
  }
  return $1(i, r);
}, tf = function(e, t, r) {
  var a = F1(r), i = ml(e, a), l = B.makeSpan(["katex"], [i]);
  return $1(l, r);
}, rf = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "←",
  underleftarrow: "←",
  xleftarrow: "←",
  overrightarrow: "→",
  underrightarrow: "→",
  xrightarrow: "→",
  underbrace: "⏟",
  overbrace: "⏞",
  overgroup: "⏠",
  undergroup: "⏡",
  overleftrightarrow: "↔",
  underleftrightarrow: "↔",
  xleftrightarrow: "↔",
  Overrightarrow: "⇒",
  xRightarrow: "⇒",
  overleftharpoon: "↼",
  xleftharpoonup: "↼",
  overrightharpoon: "⇀",
  xrightharpoonup: "⇀",
  xLeftarrow: "⇐",
  xLeftrightarrow: "⇔",
  xhookleftarrow: "↩",
  xhookrightarrow: "↪",
  xmapsto: "↦",
  xrightharpoondown: "⇁",
  xleftharpoondown: "↽",
  xrightleftharpoons: "⇌",
  xleftrightharpoons: "⇋",
  xtwoheadleftarrow: "↞",
  xtwoheadrightarrow: "↠",
  xlongequal: "=",
  xtofrom: "⇄",
  xrightleftarrows: "⇄",
  xrightequilibrium: "⇌",
  // Not a perfect match.
  xleftequilibrium: "⇋",
  // None better available.
  "\\cdrightarrow": "→",
  "\\cdleftarrow": "←",
  "\\cdlongequal": "="
}, nf = function(e) {
  var t = new G.MathNode("mo", [new G.TextNode(rf[e.replace(/^\\/, "")])]);
  return t.setAttribute("stretchy", "true"), t;
}, af = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
}, lf = function(e) {
  return e.type === "ordgroup" ? e.body.length : 1;
}, sf = function(e, t) {
  function r() {
    var s = 4e5, o = e.label.slice(1);
    if (le.contains(["widehat", "widecheck", "widetilde", "utilde"], o)) {
      var u = e, h = lf(u.base), f, p, g;
      if (h > 5)
        o === "widehat" || o === "widecheck" ? (f = 420, s = 2364, g = 0.42, p = o + "4") : (f = 312, s = 2340, g = 0.34, p = "tilde4");
      else {
        var w = [1, 1, 2, 2, 3, 3][h];
        o === "widehat" || o === "widecheck" ? (s = [0, 1062, 2364, 2364, 2364][w], f = [0, 239, 300, 360, 420][w], g = [0, 0.24, 0.3, 0.3, 0.36, 0.42][w], p = o + w) : (s = [0, 600, 1033, 2339, 2340][w], f = [0, 260, 286, 306, 312][w], g = [0, 0.26, 0.286, 0.3, 0.306, 0.34][w], p = "tilde" + w);
      }
      var v = new vr(p), y = new rr([v], {
        width: "100%",
        height: Y(g),
        viewBox: "0 0 " + s + " " + f,
        preserveAspectRatio: "none"
      });
      return {
        span: B.makeSvgSpan([], [y], t),
        minWidth: 0,
        height: g
      };
    } else {
      var E = [], k = af[o], [b, A, M] = k, R = M / 1e3, L = b.length, H, q;
      if (L === 1) {
        var X = k[3];
        H = ["hide-tail"], q = [X];
      } else if (L === 2)
        H = ["halfarrow-left", "halfarrow-right"], q = ["xMinYMin", "xMaxYMin"];
      else if (L === 3)
        H = ["brace-left", "brace-center", "brace-right"], q = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + L + " children.");
      for (var Z = 0; Z < L; Z++) {
        var J = new vr(b[Z]), De = new rr([J], {
          width: "400em",
          height: Y(R),
          viewBox: "0 0 " + s + " " + M,
          preserveAspectRatio: q[Z] + " slice"
        }), ye = B.makeSvgSpan([H[Z]], [De], t);
        if (L === 1)
          return {
            span: ye,
            minWidth: A,
            height: R
          };
        ye.style.height = Y(R), E.push(ye);
      }
      return {
        span: B.makeSpan(["stretchy"], E, t),
        minWidth: A,
        height: R
      };
    }
  }
  var {
    span: a,
    minWidth: i,
    height: l
  } = r();
  return a.height = l, a.style.height = Y(l), i > 0 && (a.style.minWidth = Y(i)), a;
}, of = function(e, t, r, a, i) {
  var l, s = e.height + e.depth + r + a;
  if (/fbox|color|angl/.test(t)) {
    if (l = B.makeSpan(["stretchy", t], [], i), t === "fbox") {
      var o = i.color && i.getColor();
      o && (l.style.borderColor = o);
    }
  } else {
    var u = [];
    /^[bx]cancel$/.test(t) && u.push(new hl({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(t) && u.push(new hl({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var h = new rr(u, {
      width: "100%",
      height: Y(s)
    });
    l = B.makeSvgSpan([], [h], i);
  }
  return l.height = s, l.style.height = Y(s), l;
}, ar = {
  encloseSpan: of,
  mathMLnode: nf,
  svgSpan: sf
};
function be(n, e) {
  if (!n || n.type !== e)
    throw new Error("Expected node of type " + e + ", but got " + (n ? "node of type " + n.type : String(n)));
  return n;
}
function Ol(n) {
  var e = Ka(n);
  if (!e)
    throw new Error("Expected node of symbol group type, but got " + (n ? "node of type " + n.type : String(n)));
  return e;
}
function Ka(n) {
  return n && (n.type === "atom" || Md.hasOwnProperty(n.type)) ? n : null;
}
var Pl = (n, e) => {
  var t, r, a;
  n && n.type === "supsub" ? (r = be(n.base, "accent"), t = r.base, n.base = t, a = Fd(Ee(n, e)), n.base = r) : (r = be(n, "accent"), t = r.base);
  var i = Ee(t, e.havingCrampedStyle()), l = r.isShifty && le.isCharacterBox(t), s = 0;
  if (l) {
    var o = le.getBaseElem(t), u = Ee(o, e.havingCrampedStyle());
    s = qs(u).skew;
  }
  var h = r.label === "\\c", f = h ? i.height + i.depth : Math.min(i.height, e.fontMetrics().xHeight), p;
  if (r.isStretchy)
    p = ar.svgSpan(r, e), p = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "elem",
        elem: p,
        wrapperClasses: ["svg-align"],
        wrapperStyle: s > 0 ? {
          width: "calc(100% - " + Y(2 * s) + ")",
          marginLeft: Y(2 * s)
        } : void 0
      }]
    }, e);
  else {
    var g, w;
    r.label === "\\vec" ? (g = B.staticSvg("vec", e), w = B.svgData.vec[1]) : (g = B.makeOrd({
      mode: r.mode,
      text: r.label
    }, e, "textord"), g = qs(g), g.italic = 0, w = g.width, h && (f += g.depth)), p = B.makeSpan(["accent-body"], [g]);
    var v = r.label === "\\textcircled";
    v && (p.classes.push("accent-full"), f = i.height);
    var y = s;
    v || (y -= w / 2), p.style.left = Y(y), r.label === "\\textcircled" && (p.style.top = ".2em"), p = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: -f
      }, {
        type: "elem",
        elem: p
      }]
    }, e);
  }
  var E = B.makeSpan(["mord", "accent"], [p], e);
  return a ? (a.children[0] = E, a.height = Math.max(E.height, a.height), a.classes[0] = "mord", a) : E;
}, M1 = (n, e) => {
  var t = n.isStretchy ? ar.mathMLnode(n.label) : new G.MathNode("mo", [o0(n.label, n.mode)]), r = new G.MathNode("mover", [Pe(n.base, e), t]);
  return r.setAttribute("accent", "true"), r;
}, uf = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((n) => "\\" + n).join("|"));
K({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (n, e) => {
    var t = Ha(e[0]), r = !uf.test(n.funcName), a = !r || n.funcName === "\\widehat" || n.funcName === "\\widetilde" || n.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: n.parser.mode,
      label: n.funcName,
      isStretchy: r,
      isShifty: a,
      base: t
    };
  },
  htmlBuilder: Pl,
  mathmlBuilder: M1
});
K({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (n, e) => {
    var t = e[0], r = n.parser.mode;
    return r === "math" && (n.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + n.funcName + " works only in text mode"), r = "text"), {
      type: "accent",
      mode: r,
      label: n.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: t
    };
  },
  htmlBuilder: Pl,
  mathmlBuilder: M1
});
K({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "accentUnder",
      mode: t.mode,
      label: r,
      base: a
    };
  },
  htmlBuilder: (n, e) => {
    var t = Ee(n.base, e), r = ar.svgSpan(n, e), a = n.label === "\\utilde" ? 0.12 : 0, i = B.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "elem",
        elem: r,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return B.makeSpan(["mord", "accentunder"], [i], e);
  },
  mathmlBuilder: (n, e) => {
    var t = ar.mathMLnode(n.label), r = new G.MathNode("munder", [Pe(n.base, e), t]);
    return r.setAttribute("accentunder", "true"), r;
  }
});
var Jn = (n) => {
  var e = new G.MathNode("mpadded", n ? [n] : []);
  return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e;
};
K({
  type: "xArrow",
  names: [
    "\\xleftarrow",
    "\\xrightarrow",
    "\\xLeftarrow",
    "\\xRightarrow",
    "\\xleftrightarrow",
    "\\xLeftrightarrow",
    "\\xhookleftarrow",
    "\\xhookrightarrow",
    "\\xmapsto",
    "\\xrightharpoondown",
    "\\xrightharpoonup",
    "\\xleftharpoondown",
    "\\xleftharpoonup",
    "\\xrightleftharpoons",
    "\\xleftrightharpoons",
    "\\xlongequal",
    "\\xtwoheadrightarrow",
    "\\xtwoheadleftarrow",
    "\\xtofrom",
    // The next 3 functions are here to support the mhchem extension.
    // Direct use of these functions is discouraged and may break someday.
    "\\xrightleftarrows",
    "\\xrightequilibrium",
    "\\xleftequilibrium",
    // The next 3 functions are here only to support the {CD} environment.
    "\\\\cdrightarrow",
    "\\\\cdleftarrow",
    "\\\\cdlongequal"
  ],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(n, e, t) {
    var {
      parser: r,
      funcName: a
    } = n;
    return {
      type: "xArrow",
      mode: r.mode,
      label: a,
      body: e[0],
      below: t[0]
    };
  },
  // Flow is unable to correctly infer the type of `group`, even though it's
  // unambiguously determined from the passed-in `type` above.
  htmlBuilder(n, e) {
    var t = e.style, r = e.havingStyle(t.sup()), a = B.wrapFragment(Ee(n.body, r, e), e), i = n.label.slice(0, 2) === "\\x" ? "x" : "cd";
    a.classes.push(i + "-arrow-pad");
    var l;
    n.below && (r = e.havingStyle(t.sub()), l = B.wrapFragment(Ee(n.below, r, e), e), l.classes.push(i + "-arrow-pad"));
    var s = ar.svgSpan(n, e), o = -e.fontMetrics().axisHeight + 0.5 * s.height, u = -e.fontMetrics().axisHeight - 0.5 * s.height - 0.111;
    (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (u -= a.depth);
    var h;
    if (l) {
      var f = -e.fontMetrics().axisHeight + l.height + 0.5 * s.height + 0.111;
      h = B.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: s,
          shift: o
        }, {
          type: "elem",
          elem: l,
          shift: f
        }]
      }, e);
    } else
      h = B.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: s,
          shift: o
        }]
      }, e);
    return h.children[0].children[0].children[1].classes.push("svg-align"), B.makeSpan(["mrel", "x-arrow"], [h], e);
  },
  mathmlBuilder(n, e) {
    var t = ar.mathMLnode(n.label);
    t.setAttribute("minsize", n.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var r;
    if (n.body) {
      var a = Jn(Pe(n.body, e));
      if (n.below) {
        var i = Jn(Pe(n.below, e));
        r = new G.MathNode("munderover", [t, i, a]);
      } else
        r = new G.MathNode("mover", [t, a]);
    } else if (n.below) {
      var l = Jn(Pe(n.below, e));
      r = new G.MathNode("munder", [t, l]);
    } else
      r = Jn(), r = new G.MathNode("mover", [t, r]);
    return r;
  }
});
var cf = B.makeSpan;
function z1(n, e) {
  var t = ft(n.body, e, !0);
  return cf([n.mclass], t, e);
}
function B1(n, e) {
  var t, r = Rt(n.body, e);
  return n.mclass === "minner" ? t = new G.MathNode("mpadded", r) : n.mclass === "mord" ? n.isCharacterBox ? (t = r[0], t.type = "mi") : t = new G.MathNode("mi", r) : (n.isCharacterBox ? (t = r[0], t.type = "mo") : t = new G.MathNode("mo", r), n.mclass === "mbin" ? (t.attributes.lspace = "0.22em", t.attributes.rspace = "0.22em") : n.mclass === "mpunct" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0.17em") : n.mclass === "mopen" || n.mclass === "mclose" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0em") : n.mclass === "minner" && (t.attributes.lspace = "0.0556em", t.attributes.width = "+0.1111em")), t;
}
K({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "mclass",
      mode: t.mode,
      mclass: "m" + r.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: it(a),
      isCharacterBox: le.isCharacterBox(a)
    };
  },
  htmlBuilder: z1,
  mathmlBuilder: B1
});
var Qa = (n) => {
  var e = n.type === "ordgroup" && n.body.length ? n.body[0] : n;
  return e.type === "atom" && (e.family === "bin" || e.family === "rel") ? "m" + e.family : "mord";
};
K({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "mclass",
      mode: t.mode,
      mclass: Qa(e[0]),
      body: it(e[1]),
      isCharacterBox: le.isCharacterBox(e[1])
    };
  }
});
K({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[1], i = e[0], l;
    r !== "\\stackrel" ? l = Qa(a) : l = "mrel";
    var s = {
      type: "op",
      mode: a.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: r !== "\\stackrel",
      body: it(a)
    }, o = {
      type: "supsub",
      mode: i.mode,
      base: s,
      sup: r === "\\underset" ? null : i,
      sub: r === "\\underset" ? i : null
    };
    return {
      type: "mclass",
      mode: t.mode,
      mclass: l,
      body: [o],
      isCharacterBox: le.isCharacterBox(o)
    };
  },
  htmlBuilder: z1,
  mathmlBuilder: B1
});
K({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "pmb",
      mode: t.mode,
      mclass: Qa(e[0]),
      body: it(e[0])
    };
  },
  htmlBuilder(n, e) {
    var t = ft(n.body, e, !0), r = B.makeSpan([n.mclass], t, e);
    return r.style.textShadow = "0.02em 0.01em 0.04px", r;
  },
  mathmlBuilder(n, e) {
    var t = Rt(n.body, e), r = new G.MathNode("mstyle", t);
    return r.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), r;
  }
});
var hf = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, Vs = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), js = (n) => n.type === "textord" && n.text === "@", df = (n, e) => (n.type === "mathord" || n.type === "atom") && n.text === e;
function ff(n, e, t) {
  var r = hf[n];
  switch (r) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return t.callFunction(r, [e[0]], [e[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var a = t.callFunction("\\\\cdleft", [e[0]], []), i = {
        type: "atom",
        text: r,
        mode: "math",
        family: "rel"
      }, l = t.callFunction("\\Big", [i], []), s = t.callFunction("\\\\cdright", [e[1]], []), o = {
        type: "ordgroup",
        mode: "math",
        body: [a, l, s]
      };
      return t.callFunction("\\\\cdparent", [o], []);
    }
    case "\\\\cdlongequal":
      return t.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var u = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return t.callFunction("\\Big", [u], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function mf(n) {
  var e = [];
  for (n.gullet.beginGroup(), n.gullet.macros.set("\\cr", "\\\\\\relax"), n.gullet.beginGroup(); ; ) {
    e.push(n.parseExpression(!1, "\\\\")), n.gullet.endGroup(), n.gullet.beginGroup();
    var t = n.fetch().text;
    if (t === "&" || t === "\\\\")
      n.consume();
    else if (t === "\\end") {
      e[e.length - 1].length === 0 && e.pop();
      break;
    } else
      throw new V("Expected \\\\ or \\cr or \\end", n.nextToken);
  }
  for (var r = [], a = [r], i = 0; i < e.length; i++) {
    for (var l = e[i], s = Vs(), o = 0; o < l.length; o++)
      if (!js(l[o]))
        s.body.push(l[o]);
      else {
        r.push(s), o += 1;
        var u = Ol(l[o]).text, h = new Array(2);
        if (h[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, h[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(u) > -1)) if ("<>AV".indexOf(u) > -1)
          for (var f = 0; f < 2; f++) {
            for (var p = !0, g = o + 1; g < l.length; g++) {
              if (df(l[g], u)) {
                p = !1, o = g;
                break;
              }
              if (js(l[g]))
                throw new V("Missing a " + u + " character to complete a CD arrow.", l[g]);
              h[f].body.push(l[g]);
            }
            if (p)
              throw new V("Missing a " + u + " character to complete a CD arrow.", l[o]);
          }
        else
          throw new V('Expected one of "<>AV=|." after @', l[o]);
        var w = ff(u, h, n), v = {
          type: "styling",
          body: [w],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        r.push(v), s = Vs();
      }
    i % 2 === 0 ? r.push(s) : r.shift(), r = [], a.push(r);
  }
  n.gullet.endGroup(), n.gullet.endGroup();
  var y = new Array(a[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25
    // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body: a,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: y,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(a.length + 1).fill([])
  };
}
K({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n;
    return {
      type: "cdlabel",
      mode: t.mode,
      side: r.slice(4),
      label: e[0]
    };
  },
  htmlBuilder(n, e) {
    var t = e.havingStyle(e.style.sup()), r = B.wrapFragment(Ee(n.label, t, e), e);
    return r.classes.push("cd-label-" + n.side), r.style.bottom = Y(0.8 - r.depth), r.height = 0, r.depth = 0, r;
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mrow", [Pe(n.label, e)]);
    return t = new G.MathNode("mpadded", [t]), t.setAttribute("width", "0"), n.side === "left" && t.setAttribute("lspace", "-1width"), t.setAttribute("voffset", "0.7em"), t = new G.MathNode("mstyle", [t]), t.setAttribute("displaystyle", "false"), t.setAttribute("scriptlevel", "1"), t;
  }
});
K({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "cdlabelparent",
      mode: t.mode,
      fragment: e[0]
    };
  },
  htmlBuilder(n, e) {
    var t = B.wrapFragment(Ee(n.fragment, e), e);
    return t.classes.push("cd-vert-arrow"), t;
  },
  mathmlBuilder(n, e) {
    return new G.MathNode("mrow", [Pe(n.fragment, e)]);
  }
});
K({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(n, e) {
    for (var {
      parser: t
    } = n, r = be(e[0], "ordgroup"), a = r.body, i = "", l = 0; l < a.length; l++) {
      var s = be(a[l], "textord");
      i += s.text;
    }
    var o = parseInt(i), u;
    if (isNaN(o))
      throw new V("\\@char has non-numeric argument " + i);
    if (o < 0 || o >= 1114111)
      throw new V("\\@char with invalid code point " + i);
    return o <= 65535 ? u = String.fromCharCode(o) : (o -= 65536, u = String.fromCharCode((o >> 10) + 55296, (o & 1023) + 56320)), {
      type: "textord",
      mode: t.mode,
      text: u
    };
  }
});
var L1 = (n, e) => {
  var t = ft(n.body, e.withColor(n.color), !1);
  return B.makeFragment(t);
}, R1 = (n, e) => {
  var t = Rt(n.body, e.withColor(n.color)), r = new G.MathNode("mstyle", t);
  return r.setAttribute("mathcolor", n.color), r;
};
K({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = be(e[0], "color-token").color, a = e[1];
    return {
      type: "color",
      mode: t.mode,
      color: r,
      body: it(a)
    };
  },
  htmlBuilder: L1,
  mathmlBuilder: R1
});
K({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(n, e) {
    var {
      parser: t,
      breakOnTokenText: r
    } = n, a = be(e[0], "color-token").color;
    t.gullet.macros.set("\\current@color", a);
    var i = t.parseExpression(!0, r);
    return {
      type: "color",
      mode: t.mode,
      color: a,
      body: i
    };
  },
  htmlBuilder: L1,
  mathmlBuilder: R1
});
K({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(n, e, t) {
    var {
      parser: r
    } = n, a = r.gullet.future().text === "[" ? r.parseSizeGroup(!0) : null, i = !r.settings.displayMode || !r.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: r.mode,
      newLine: i,
      size: a && be(a, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(n, e) {
    var t = B.makeSpan(["mspace"], [], e);
    return n.newLine && (t.classes.push("newline"), n.size && (t.style.marginTop = Y(Xe(n.size, e)))), t;
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mspace");
    return n.newLine && (t.setAttribute("linebreak", "newline"), n.size && t.setAttribute("height", Y(Xe(n.size, e)))), t;
  }
});
var pl = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, q1 = (n) => {
  var e = n.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(e))
    throw new V("Expected a control sequence", n);
  return e;
}, pf = (n) => {
  var e = n.gullet.popToken();
  return e.text === "=" && (e = n.gullet.popToken(), e.text === " " && (e = n.gullet.popToken())), e;
}, I1 = (n, e, t, r) => {
  var a = n.gullet.macros.get(t.text);
  a == null && (t.noexpand = !0, a = {
    tokens: [t],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !n.gullet.isExpandable(t.text)
  }), n.gullet.macros.set(e, a, r);
};
K({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n;
    e.consumeSpaces();
    var r = e.fetch();
    if (pl[r.text])
      return (t === "\\global" || t === "\\\\globallong") && (r.text = pl[r.text]), be(e.parseFunction(), "internal");
    throw new V("Invalid token after macro prefix", r);
  }
});
K({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n, r = e.gullet.popToken(), a = r.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(a))
      throw new V("Expected a control sequence", r);
    for (var i = 0, l, s = [[]]; e.gullet.future().text !== "{"; )
      if (r = e.gullet.popToken(), r.text === "#") {
        if (e.gullet.future().text === "{") {
          l = e.gullet.future(), s[i].push("{");
          break;
        }
        if (r = e.gullet.popToken(), !/^[1-9]$/.test(r.text))
          throw new V('Invalid argument number "' + r.text + '"');
        if (parseInt(r.text) !== i + 1)
          throw new V('Argument number "' + r.text + '" out of order');
        i++, s.push([]);
      } else {
        if (r.text === "EOF")
          throw new V("Expected a macro definition");
        s[i].push(r.text);
      }
    var {
      tokens: o
    } = e.gullet.consumeArg();
    return l && o.unshift(l), (t === "\\edef" || t === "\\xdef") && (o = e.gullet.expandTokens(o), o.reverse()), e.gullet.macros.set(a, {
      tokens: o,
      numArgs: i,
      delimiters: s
    }, t === pl[t]), {
      type: "internal",
      mode: e.mode
    };
  }
});
K({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n, r = q1(e.gullet.popToken());
    e.gullet.consumeSpaces();
    var a = pf(e);
    return I1(e, r, a, t === "\\\\globallet"), {
      type: "internal",
      mode: e.mode
    };
  }
});
K({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n, r = q1(e.gullet.popToken()), a = e.gullet.popToken(), i = e.gullet.popToken();
    return I1(e, r, i, t === "\\\\globalfuture"), e.gullet.pushToken(i), e.gullet.pushToken(a), {
      type: "internal",
      mode: e.mode
    };
  }
});
var pn = function(e, t, r) {
  var a = He.math[e] && He.math[e].replace, i = Ll(a || e, t, r);
  if (!i)
    throw new Error("Unsupported symbol " + e + " and font size " + t + ".");
  return i;
}, Hl = function(e, t, r, a) {
  var i = r.havingBaseStyle(t), l = B.makeSpan(a.concat(i.sizingClasses(r)), [e], r), s = i.sizeMultiplier / r.sizeMultiplier;
  return l.height *= s, l.depth *= s, l.maxFontSize = i.sizeMultiplier, l;
}, N1 = function(e, t, r) {
  var a = t.havingBaseStyle(r), i = (1 - t.sizeMultiplier / a.sizeMultiplier) * t.fontMetrics().axisHeight;
  e.classes.push("delimcenter"), e.style.top = Y(i), e.height -= i, e.depth += i;
}, gf = function(e, t, r, a, i, l) {
  var s = B.makeSymbol(e, "Main-Regular", i, a), o = Hl(s, t, a, l);
  return r && N1(o, a, t), o;
}, _f = function(e, t, r, a) {
  return B.makeSymbol(e, "Size" + t + "-Regular", r, a);
}, O1 = function(e, t, r, a, i, l) {
  var s = _f(e, t, i, a), o = Hl(B.makeSpan(["delimsizing", "size" + t], [s], a), oe.TEXT, a, l);
  return r && N1(o, a, oe.TEXT), o;
}, wi = function(e, t, r) {
  var a;
  t === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
  var i = B.makeSpan(["delimsizinginner", a], [B.makeSpan([], [B.makeSymbol(e, t, r)])]);
  return {
    type: "elem",
    elem: i
  };
}, ki = function(e, t, r) {
  var a = T0["Size4-Regular"][e.charCodeAt(0)] ? T0["Size4-Regular"][e.charCodeAt(0)][4] : T0["Size1-Regular"][e.charCodeAt(0)][4], i = new vr("inner", kd(e, Math.round(1e3 * t))), l = new rr([i], {
    width: Y(a),
    height: Y(t),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Y(a),
    viewBox: "0 0 " + 1e3 * a + " " + Math.round(1e3 * t),
    preserveAspectRatio: "xMinYMin"
  }), s = B.makeSvgSpan([], [l], r);
  return s.height = t, s.style.height = Y(t), s.style.width = Y(a), {
    type: "elem",
    elem: s
  };
}, gl = 8e-3, ea = {
  type: "kern",
  size: -1 * gl
}, vf = ["|", "\\lvert", "\\rvert", "\\vert"], bf = ["\\|", "\\lVert", "\\rVert", "\\Vert"], P1 = function(e, t, r, a, i, l) {
  var s, o, u, h, f = "", p = 0;
  s = u = h = e, o = null;
  var g = "Size1-Regular";
  e === "\\uparrow" ? u = h = "⏐" : e === "\\Uparrow" ? u = h = "‖" : e === "\\downarrow" ? s = u = "⏐" : e === "\\Downarrow" ? s = u = "‖" : e === "\\updownarrow" ? (s = "\\uparrow", u = "⏐", h = "\\downarrow") : e === "\\Updownarrow" ? (s = "\\Uparrow", u = "‖", h = "\\Downarrow") : le.contains(vf, e) ? (u = "∣", f = "vert", p = 333) : le.contains(bf, e) ? (u = "∥", f = "doublevert", p = 556) : e === "[" || e === "\\lbrack" ? (s = "⎡", u = "⎢", h = "⎣", g = "Size4-Regular", f = "lbrack", p = 667) : e === "]" || e === "\\rbrack" ? (s = "⎤", u = "⎥", h = "⎦", g = "Size4-Regular", f = "rbrack", p = 667) : e === "\\lfloor" || e === "⌊" ? (u = s = "⎢", h = "⎣", g = "Size4-Regular", f = "lfloor", p = 667) : e === "\\lceil" || e === "⌈" ? (s = "⎡", u = h = "⎢", g = "Size4-Regular", f = "lceil", p = 667) : e === "\\rfloor" || e === "⌋" ? (u = s = "⎥", h = "⎦", g = "Size4-Regular", f = "rfloor", p = 667) : e === "\\rceil" || e === "⌉" ? (s = "⎤", u = h = "⎥", g = "Size4-Regular", f = "rceil", p = 667) : e === "(" || e === "\\lparen" ? (s = "⎛", u = "⎜", h = "⎝", g = "Size4-Regular", f = "lparen", p = 875) : e === ")" || e === "\\rparen" ? (s = "⎞", u = "⎟", h = "⎠", g = "Size4-Regular", f = "rparen", p = 875) : e === "\\{" || e === "\\lbrace" ? (s = "⎧", o = "⎨", h = "⎩", u = "⎪", g = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (s = "⎫", o = "⎬", h = "⎭", u = "⎪", g = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (s = "⎧", h = "⎩", u = "⎪", g = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (s = "⎫", h = "⎭", u = "⎪", g = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (s = "⎧", h = "⎭", u = "⎪", g = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (s = "⎫", h = "⎩", u = "⎪", g = "Size4-Regular");
  var w = pn(s, g, i), v = w.height + w.depth, y = pn(u, g, i), E = y.height + y.depth, k = pn(h, g, i), b = k.height + k.depth, A = 0, M = 1;
  if (o !== null) {
    var R = pn(o, g, i);
    A = R.height + R.depth, M = 2;
  }
  var L = v + b + A, H = Math.max(0, Math.ceil((t - L) / (M * E))), q = L + H * M * E, X = a.fontMetrics().axisHeight;
  r && (X *= a.sizeMultiplier);
  var Z = q / 2 - X, J = [];
  if (f.length > 0) {
    var De = q - v - b, ye = Math.round(q * 1e3), ve = Dd(f, Math.round(De * 1e3)), $e = new vr(f, ve), Me = (p / 1e3).toFixed(3) + "em", ge = (ye / 1e3).toFixed(3) + "em", qe = new rr([$e], {
      width: Me,
      height: ge,
      viewBox: "0 0 " + p + " " + ye
    }), Ce = B.makeSvgSpan([], [qe], a);
    Ce.height = ye / 1e3, Ce.style.width = Me, Ce.style.height = ge, J.push({
      type: "elem",
      elem: Ce
    });
  } else {
    if (J.push(wi(h, g, i)), J.push(ea), o === null) {
      var N = q - v - b + 2 * gl;
      J.push(ki(u, N, a));
    } else {
      var S = (q - v - b - A) / 2 + 2 * gl;
      J.push(ki(u, S, a)), J.push(ea), J.push(wi(o, g, i)), J.push(ea), J.push(ki(u, S, a));
    }
    J.push(ea), J.push(wi(s, g, i));
  }
  var T = a.havingBaseStyle(oe.TEXT), z = B.makeVList({
    positionType: "bottom",
    positionData: Z,
    children: J
  }, T);
  return Hl(B.makeSpan(["delimsizing", "mult"], [z], T), oe.TEXT, a, l);
}, Di = 80, Si = 0.08, xi = function(e, t, r, a, i) {
  var l = wd(e, a, r), s = new vr(e, l), o = new rr([s], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: Y(t),
    viewBox: "0 0 400000 " + r,
    preserveAspectRatio: "xMinYMin slice"
  });
  return B.makeSvgSpan(["hide-tail"], [o], i);
}, yf = function(e, t) {
  var r = t.havingBaseSizing(), a = V1("\\surd", e * r.sizeMultiplier, G1, r), i = r.sizeMultiplier, l = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), s, o = 0, u = 0, h = 0, f;
  return a.type === "small" ? (h = 1e3 + 1e3 * l + Di, e < 1 ? i = 1 : e < 1.4 && (i = 0.7), o = (1 + l + Si) / i, u = (1 + l) / i, s = xi("sqrtMain", o, h, l, t), s.style.minWidth = "0.853em", f = 0.833 / i) : a.type === "large" ? (h = (1e3 + Di) * wn[a.size], u = (wn[a.size] + l) / i, o = (wn[a.size] + l + Si) / i, s = xi("sqrtSize" + a.size, o, h, l, t), s.style.minWidth = "1.02em", f = 1 / i) : (o = e + l + Si, u = e + l, h = Math.floor(1e3 * e + l) + Di, s = xi("sqrtTall", o, h, l, t), s.style.minWidth = "0.742em", f = 1.056), s.height = u, s.style.height = Y(o), {
    span: s,
    advanceWidth: f,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (t.fontMetrics().sqrtRuleThickness + l) * i
  };
}, H1 = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], wf = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], U1 = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], wn = [0, 1.2, 1.8, 2.4, 3], kf = function(e, t, r, a, i) {
  if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), le.contains(H1, e) || le.contains(U1, e))
    return O1(e, t, !1, r, a, i);
  if (le.contains(wf, e))
    return P1(e, wn[t], !1, r, a, i);
  throw new V("Illegal delimiter: '" + e + "'");
}, Df = [{
  type: "small",
  style: oe.SCRIPTSCRIPT
}, {
  type: "small",
  style: oe.SCRIPT
}, {
  type: "small",
  style: oe.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], Sf = [{
  type: "small",
  style: oe.SCRIPTSCRIPT
}, {
  type: "small",
  style: oe.SCRIPT
}, {
  type: "small",
  style: oe.TEXT
}, {
  type: "stack"
}], G1 = [{
  type: "small",
  style: oe.SCRIPTSCRIPT
}, {
  type: "small",
  style: oe.SCRIPT
}, {
  type: "small",
  style: oe.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], xf = function(e) {
  if (e.type === "small")
    return "Main-Regular";
  if (e.type === "large")
    return "Size" + e.size + "-Regular";
  if (e.type === "stack")
    return "Size4-Regular";
  throw new Error("Add support for delim type '" + e.type + "' here.");
}, V1 = function(e, t, r, a) {
  for (var i = Math.min(2, 3 - a.style.size), l = i; l < r.length && r[l].type !== "stack"; l++) {
    var s = pn(e, xf(r[l]), "math"), o = s.height + s.depth;
    if (r[l].type === "small") {
      var u = a.havingBaseStyle(r[l].style);
      o *= u.sizeMultiplier;
    }
    if (o > t)
      return r[l];
  }
  return r[r.length - 1];
}, j1 = function(e, t, r, a, i, l) {
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
  var s;
  le.contains(U1, e) ? s = Df : le.contains(H1, e) ? s = G1 : s = Sf;
  var o = V1(e, t, s, a);
  return o.type === "small" ? gf(e, o.style, r, a, i, l) : o.type === "large" ? O1(e, o.size, r, a, i, l) : P1(e, t, r, a, i, l);
}, Af = function(e, t, r, a, i, l) {
  var s = a.fontMetrics().axisHeight * a.sizeMultiplier, o = 901, u = 5 / a.fontMetrics().ptPerEm, h = Math.max(t - s, r + s), f = Math.max(
    // In real TeX, calculations are done using integral values which are
    // 65536 per pt, or 655360 per em. So, the division here truncates in
    // TeX but doesn't here, producing different results. If we wanted to
    // exactly match TeX's calculation, we could do
    //   Math.floor(655360 * maxDistFromAxis / 500) *
    //    delimiterFactor / 655360
    // (To see the difference, compare
    //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
    // in TeX and KaTeX)
    h / 500 * o,
    2 * h - u
  );
  return j1(e, f, !0, a, i, l);
}, er = {
  sqrtImage: yf,
  sizedDelim: kf,
  sizeToMaxHeight: wn,
  customSizedDelim: j1,
  leftRightDelim: Af
}, Ws = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
}, Ef = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."];
function Ja(n, e) {
  var t = Ka(n);
  if (t && le.contains(Ef, t.text))
    return t;
  throw t ? new V("Invalid delimiter '" + t.text + "' after '" + e.funcName + "'", n) : new V("Invalid delimiter type '" + n.type + "'", n);
}
K({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (n, e) => {
    var t = Ja(e[0], n);
    return {
      type: "delimsizing",
      mode: n.parser.mode,
      size: Ws[n.funcName].size,
      mclass: Ws[n.funcName].mclass,
      delim: t.text
    };
  },
  htmlBuilder: (n, e) => n.delim === "." ? B.makeSpan([n.mclass]) : er.sizedDelim(n.delim, n.size, e, n.mode, [n.mclass]),
  mathmlBuilder: (n) => {
    var e = [];
    n.delim !== "." && e.push(o0(n.delim, n.mode));
    var t = new G.MathNode("mo", e);
    n.mclass === "mopen" || n.mclass === "mclose" ? t.setAttribute("fence", "true") : t.setAttribute("fence", "false"), t.setAttribute("stretchy", "true");
    var r = Y(er.sizeToMaxHeight[n.size]);
    return t.setAttribute("minsize", r), t.setAttribute("maxsize", r), t;
  }
});
function Ys(n) {
  if (!n.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
K({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var t = n.parser.gullet.macros.get("\\current@color");
    if (t && typeof t != "string")
      throw new V("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: n.parser.mode,
      delim: Ja(e[0], n).text,
      color: t
      // undefined if not set via \color
    };
  }
});
K({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var t = Ja(e[0], n), r = n.parser;
    ++r.leftrightDepth;
    var a = r.parseExpression(!1);
    --r.leftrightDepth, r.expect("\\right", !1);
    var i = be(r.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: r.mode,
      body: a,
      left: t.text,
      right: i.delim,
      rightColor: i.color
    };
  },
  htmlBuilder: (n, e) => {
    Ys(n);
    for (var t = ft(n.body, e, !0, ["mopen", "mclose"]), r = 0, a = 0, i = !1, l = 0; l < t.length; l++)
      t[l].isMiddle ? i = !0 : (r = Math.max(t[l].height, r), a = Math.max(t[l].depth, a));
    r *= e.sizeMultiplier, a *= e.sizeMultiplier;
    var s;
    if (n.left === "." ? s = Cn(e, ["mopen"]) : s = er.leftRightDelim(n.left, r, a, e, n.mode, ["mopen"]), t.unshift(s), i)
      for (var o = 1; o < t.length; o++) {
        var u = t[o], h = u.isMiddle;
        h && (t[o] = er.leftRightDelim(h.delim, r, a, h.options, n.mode, []));
      }
    var f;
    if (n.right === ".")
      f = Cn(e, ["mclose"]);
    else {
      var p = n.rightColor ? e.withColor(n.rightColor) : e;
      f = er.leftRightDelim(n.right, r, a, p, n.mode, ["mclose"]);
    }
    return t.push(f), B.makeSpan(["minner"], t, e);
  },
  mathmlBuilder: (n, e) => {
    Ys(n);
    var t = Rt(n.body, e);
    if (n.left !== ".") {
      var r = new G.MathNode("mo", [o0(n.left, n.mode)]);
      r.setAttribute("fence", "true"), t.unshift(r);
    }
    if (n.right !== ".") {
      var a = new G.MathNode("mo", [o0(n.right, n.mode)]);
      a.setAttribute("fence", "true"), n.rightColor && a.setAttribute("mathcolor", n.rightColor), t.push(a);
    }
    return Il(t);
  }
});
K({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var t = Ja(e[0], n);
    if (!n.parser.leftrightDepth)
      throw new V("\\middle without preceding \\left", t);
    return {
      type: "middle",
      mode: n.parser.mode,
      delim: t.text
    };
  },
  htmlBuilder: (n, e) => {
    var t;
    if (n.delim === ".")
      t = Cn(e, []);
    else {
      t = er.sizedDelim(n.delim, 1, e, n.mode, []);
      var r = {
        delim: n.delim,
        options: e
      };
      t.isMiddle = r;
    }
    return t;
  },
  mathmlBuilder: (n, e) => {
    var t = n.delim === "\\vert" || n.delim === "|" ? o0("|", "text") : o0(n.delim, n.mode), r = new G.MathNode("mo", [t]);
    return r.setAttribute("fence", "true"), r.setAttribute("lspace", "0.05em"), r.setAttribute("rspace", "0.05em"), r;
  }
});
var Ul = (n, e) => {
  var t = B.wrapFragment(Ee(n.body, e), e), r = n.label.slice(1), a = e.sizeMultiplier, i, l = 0, s = le.isCharacterBox(n.body);
  if (r === "sout")
    i = B.makeSpan(["stretchy", "sout"]), i.height = e.fontMetrics().defaultRuleThickness / a, l = -0.5 * e.fontMetrics().xHeight;
  else if (r === "phase") {
    var o = Xe({
      number: 0.6,
      unit: "pt"
    }, e), u = Xe({
      number: 0.35,
      unit: "ex"
    }, e), h = e.havingBaseSizing();
    a = a / h.sizeMultiplier;
    var f = t.height + t.depth + o + u;
    t.style.paddingLeft = Y(f / 2 + o);
    var p = Math.floor(1e3 * f * a), g = bd(p), w = new rr([new vr("phase", g)], {
      width: "400em",
      height: Y(p / 1e3),
      viewBox: "0 0 400000 " + p,
      preserveAspectRatio: "xMinYMin slice"
    });
    i = B.makeSvgSpan(["hide-tail"], [w], e), i.style.height = Y(f), l = t.depth + o + u;
  } else {
    /cancel/.test(r) ? s || t.classes.push("cancel-pad") : r === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
    var v = 0, y = 0, E = 0;
    /box/.test(r) ? (E = Math.max(
      e.fontMetrics().fboxrule,
      // default
      e.minRuleThickness
      // User override.
    ), v = e.fontMetrics().fboxsep + (r === "colorbox" ? 0 : E), y = v) : r === "angl" ? (E = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), v = 4 * E, y = Math.max(0, 0.25 - t.depth)) : (v = s ? 0.2 : 0, y = v), i = ar.encloseSpan(t, r, v, y, e), /fbox|boxed|fcolorbox/.test(r) ? (i.style.borderStyle = "solid", i.style.borderWidth = Y(E)) : r === "angl" && E !== 0.049 && (i.style.borderTopWidth = Y(E), i.style.borderRightWidth = Y(E)), l = t.depth + y, n.backgroundColor && (i.style.backgroundColor = n.backgroundColor, n.borderColor && (i.style.borderColor = n.borderColor));
  }
  var k;
  if (n.backgroundColor)
    k = B.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: i,
          shift: l
        },
        {
          type: "elem",
          elem: t,
          shift: 0
        }
      ]
    }, e);
  else {
    var b = /cancel|phase/.test(r) ? ["svg-align"] : [];
    k = B.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: t,
          shift: 0
        },
        {
          type: "elem",
          elem: i,
          shift: l,
          wrapperClasses: b
        }
      ]
    }, e);
  }
  return /cancel/.test(r) && (k.height = t.height, k.depth = t.depth), /cancel/.test(r) && !s ? B.makeSpan(["mord", "cancel-lap"], [k], e) : B.makeSpan(["mord"], [k], e);
}, Gl = (n, e) => {
  var t = 0, r = new G.MathNode(n.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [Pe(n.body, e)]);
  switch (n.label) {
    case "\\cancel":
      r.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      r.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      r.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      r.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      r.setAttribute("notation", "box");
      break;
    case "\\angl":
      r.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      if (t = e.fontMetrics().fboxsep * e.fontMetrics().ptPerEm, r.setAttribute("width", "+" + 2 * t + "pt"), r.setAttribute("height", "+" + 2 * t + "pt"), r.setAttribute("lspace", t + "pt"), r.setAttribute("voffset", t + "pt"), n.label === "\\fcolorbox") {
        var a = Math.max(
          e.fontMetrics().fboxrule,
          // default
          e.minRuleThickness
          // user override
        );
        r.setAttribute("style", "border: " + a + "em solid " + String(n.borderColor));
      }
      break;
    case "\\xcancel":
      r.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return n.backgroundColor && r.setAttribute("mathbackground", n.backgroundColor), r;
};
K({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(n, e, t) {
    var {
      parser: r,
      funcName: a
    } = n, i = be(e[0], "color-token").color, l = e[1];
    return {
      type: "enclose",
      mode: r.mode,
      label: a,
      backgroundColor: i,
      body: l
    };
  },
  htmlBuilder: Ul,
  mathmlBuilder: Gl
});
K({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(n, e, t) {
    var {
      parser: r,
      funcName: a
    } = n, i = be(e[0], "color-token").color, l = be(e[1], "color-token").color, s = e[2];
    return {
      type: "enclose",
      mode: r.mode,
      label: a,
      backgroundColor: l,
      borderColor: i,
      body: s
    };
  },
  htmlBuilder: Ul,
  mathmlBuilder: Gl
});
K({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\fbox",
      body: e[0]
    };
  }
});
K({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "enclose",
      mode: t.mode,
      label: r,
      body: a
    };
  },
  htmlBuilder: Ul,
  mathmlBuilder: Gl
});
K({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\angl",
      body: e[0]
    };
  }
});
var W1 = {};
function O0(n) {
  for (var {
    type: e,
    names: t,
    props: r,
    handler: a,
    htmlBuilder: i,
    mathmlBuilder: l
  } = n, s = {
    type: e,
    numArgs: r.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: a
  }, o = 0; o < t.length; ++o)
    W1[t[o]] = s;
  i && (Oa[e] = i), l && (Pa[e] = l);
}
var Y1 = {};
function _(n, e) {
  Y1[n] = e;
}
function Xs(n) {
  var e = [];
  n.consumeSpaces();
  var t = n.fetch().text;
  for (t === "\\relax" && (n.consume(), n.consumeSpaces(), t = n.fetch().text); t === "\\hline" || t === "\\hdashline"; )
    n.consume(), e.push(t === "\\hdashline"), n.consumeSpaces(), t = n.fetch().text;
  return e;
}
var ei = (n) => {
  var e = n.parser.settings;
  if (!e.displayMode)
    throw new V("{" + n.envName + "} can be used only in display mode.");
};
function Vl(n) {
  if (n.indexOf("ed") === -1)
    return n.indexOf("*") === -1;
}
function kr(n, e, t) {
  var {
    hskipBeforeAndAfter: r,
    addJot: a,
    cols: i,
    arraystretch: l,
    colSeparationType: s,
    autoTag: o,
    singleRow: u,
    emptySingleRow: h,
    maxNumCols: f,
    leqno: p
  } = e;
  if (n.gullet.beginGroup(), u || n.gullet.macros.set("\\cr", "\\\\\\relax"), !l) {
    var g = n.gullet.expandMacroAsText("\\arraystretch");
    if (g == null)
      l = 1;
    else if (l = parseFloat(g), !l || l < 0)
      throw new V("Invalid \\arraystretch: " + g);
  }
  n.gullet.beginGroup();
  var w = [], v = [w], y = [], E = [], k = o != null ? [] : void 0;
  function b() {
    o && n.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function A() {
    k && (n.gullet.macros.get("\\df@tag") ? (k.push(n.subparse([new l0("\\df@tag")])), n.gullet.macros.set("\\df@tag", void 0, !0)) : k.push(!!o && n.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (b(), E.push(Xs(n)); ; ) {
    var M = n.parseExpression(!1, u ? "\\end" : "\\\\");
    n.gullet.endGroup(), n.gullet.beginGroup(), M = {
      type: "ordgroup",
      mode: n.mode,
      body: M
    }, t && (M = {
      type: "styling",
      mode: n.mode,
      style: t,
      body: [M]
    }), w.push(M);
    var R = n.fetch().text;
    if (R === "&") {
      if (f && w.length === f) {
        if (u || s)
          throw new V("Too many tab characters: &", n.nextToken);
        n.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      n.consume();
    } else if (R === "\\end") {
      A(), w.length === 1 && M.type === "styling" && M.body[0].body.length === 0 && (v.length > 1 || !h) && v.pop(), E.length < v.length + 1 && E.push([]);
      break;
    } else if (R === "\\\\") {
      n.consume();
      var L = void 0;
      n.gullet.future().text !== " " && (L = n.parseSizeGroup(!0)), y.push(L ? L.value : null), A(), E.push(Xs(n)), w = [], v.push(w), b();
    } else
      throw new V("Expected & or \\\\ or \\cr or \\end", n.nextToken);
  }
  return n.gullet.endGroup(), n.gullet.endGroup(), {
    type: "array",
    mode: n.mode,
    addJot: a,
    arraystretch: l,
    body: v,
    cols: i,
    rowGaps: y,
    hskipBeforeAndAfter: r,
    hLinesBeforeRow: E,
    colSeparationType: s,
    tags: k,
    leqno: p
  };
}
function jl(n) {
  return n.slice(0, 1) === "d" ? "display" : "text";
}
var P0 = function(e, t) {
  var r, a, i = e.body.length, l = e.hLinesBeforeRow, s = 0, o = new Array(i), u = [], h = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    t.fontMetrics().arrayRuleWidth,
    t.minRuleThickness
    // User override.
  ), f = 1 / t.fontMetrics().ptPerEm, p = 5 * f;
  if (e.colSeparationType && e.colSeparationType === "small") {
    var g = t.havingStyle(oe.SCRIPT).sizeMultiplier;
    p = 0.2778 * (g / t.sizeMultiplier);
  }
  var w = e.colSeparationType === "CD" ? Xe({
    number: 3,
    unit: "ex"
  }, t) : 12 * f, v = 3 * f, y = e.arraystretch * w, E = 0.7 * y, k = 0.3 * y, b = 0;
  function A(We) {
    for (var ze = 0; ze < We.length; ++ze)
      ze > 0 && (b += 0.25), u.push({
        pos: b,
        isDashed: We[ze]
      });
  }
  for (A(l[0]), r = 0; r < e.body.length; ++r) {
    var M = e.body[r], R = E, L = k;
    s < M.length && (s = M.length);
    var H = new Array(M.length);
    for (a = 0; a < M.length; ++a) {
      var q = Ee(M[a], t);
      L < q.depth && (L = q.depth), R < q.height && (R = q.height), H[a] = q;
    }
    var X = e.rowGaps[r], Z = 0;
    X && (Z = Xe(X, t), Z > 0 && (Z += k, L < Z && (L = Z), Z = 0)), e.addJot && (L += v), H.height = R, H.depth = L, b += R, H.pos = b, b += L + Z, o[r] = H, A(l[r + 1]);
  }
  var J = b / 2 + t.fontMetrics().axisHeight, De = e.cols || [], ye = [], ve, $e, Me = [];
  if (e.tags && e.tags.some((We) => We))
    for (r = 0; r < i; ++r) {
      var ge = o[r], qe = ge.pos - J, Ce = e.tags[r], N = void 0;
      Ce === !0 ? N = B.makeSpan(["eqn-num"], [], t) : Ce === !1 ? N = B.makeSpan([], [], t) : N = B.makeSpan([], ft(Ce, t, !0), t), N.depth = ge.depth, N.height = ge.height, Me.push({
        type: "elem",
        elem: N,
        shift: qe
      });
    }
  for (
    a = 0, $e = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    a < s || $e < De.length;
    ++a, ++$e
  ) {
    for (var S = De[$e] || {}, T = !0; S.type === "separator"; ) {
      if (T || (ve = B.makeSpan(["arraycolsep"], []), ve.style.width = Y(t.fontMetrics().doubleRuleSep), ye.push(ve)), S.separator === "|" || S.separator === ":") {
        var z = S.separator === "|" ? "solid" : "dashed", C = B.makeSpan(["vertical-separator"], [], t);
        C.style.height = Y(b), C.style.borderRightWidth = Y(h), C.style.borderRightStyle = z, C.style.margin = "0 " + Y(-h / 2);
        var P = b - J;
        P && (C.style.verticalAlign = Y(-P)), ye.push(C);
      } else
        throw new V("Invalid separator type: " + S.separator);
      $e++, S = De[$e] || {}, T = !1;
    }
    if (!(a >= s)) {
      var I = void 0;
      (a > 0 || e.hskipBeforeAndAfter) && (I = le.deflt(S.pregap, p), I !== 0 && (ve = B.makeSpan(["arraycolsep"], []), ve.style.width = Y(I), ye.push(ve)));
      var ee = [];
      for (r = 0; r < i; ++r) {
        var ue = o[r], fe = ue[a];
        if (fe) {
          var ke = ue.pos - J;
          fe.depth = ue.depth, fe.height = ue.height, ee.push({
            type: "elem",
            elem: fe,
            shift: ke
          });
        }
      }
      ee = B.makeVList({
        positionType: "individualShift",
        children: ee
      }, t), ee = B.makeSpan(["col-align-" + (S.align || "c")], [ee]), ye.push(ee), (a < s - 1 || e.hskipBeforeAndAfter) && (I = le.deflt(S.postgap, p), I !== 0 && (ve = B.makeSpan(["arraycolsep"], []), ve.style.width = Y(I), ye.push(ve)));
    }
  }
  if (o = B.makeSpan(["mtable"], ye), u.length > 0) {
    for (var W = B.makeLineSpan("hline", t, h), te = B.makeLineSpan("hdashline", t, h), ae = [{
      type: "elem",
      elem: o,
      shift: 0
    }]; u.length > 0; ) {
      var _e = u.pop(), Se = _e.pos - J;
      _e.isDashed ? ae.push({
        type: "elem",
        elem: te,
        shift: Se
      }) : ae.push({
        type: "elem",
        elem: W,
        shift: Se
      });
    }
    o = B.makeVList({
      positionType: "individualShift",
      children: ae
    }, t);
  }
  if (Me.length === 0)
    return B.makeSpan(["mord"], [o], t);
  var Te = B.makeVList({
    positionType: "individualShift",
    children: Me
  }, t);
  return Te = B.makeSpan(["tag"], [Te], t), B.makeFragment([o, Te]);
}, Cf = {
  c: "center ",
  l: "left ",
  r: "right "
}, H0 = function(e, t) {
  for (var r = [], a = new G.MathNode("mtd", [], ["mtr-glue"]), i = new G.MathNode("mtd", [], ["mml-eqn-num"]), l = 0; l < e.body.length; l++) {
    for (var s = e.body[l], o = [], u = 0; u < s.length; u++)
      o.push(new G.MathNode("mtd", [Pe(s[u], t)]));
    e.tags && e.tags[l] && (o.unshift(a), o.push(a), e.leqno ? o.unshift(i) : o.push(i)), r.push(new G.MathNode("mtr", o));
  }
  var h = new G.MathNode("mtable", r), f = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
  h.setAttribute("rowspacing", Y(f));
  var p = "", g = "";
  if (e.cols && e.cols.length > 0) {
    var w = e.cols, v = "", y = !1, E = 0, k = w.length;
    w[0].type === "separator" && (p += "top ", E = 1), w[w.length - 1].type === "separator" && (p += "bottom ", k -= 1);
    for (var b = E; b < k; b++)
      w[b].type === "align" ? (g += Cf[w[b].align], y && (v += "none "), y = !0) : w[b].type === "separator" && y && (v += w[b].separator === "|" ? "solid " : "dashed ", y = !1);
    h.setAttribute("columnalign", g.trim()), /[sd]/.test(v) && h.setAttribute("columnlines", v.trim());
  }
  if (e.colSeparationType === "align") {
    for (var A = e.cols || [], M = "", R = 1; R < A.length; R++)
      M += R % 2 ? "0em " : "1em ";
    h.setAttribute("columnspacing", M.trim());
  } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? h.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? h.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? h.setAttribute("columnspacing", "0.5em") : h.setAttribute("columnspacing", "1em");
  var L = "", H = e.hLinesBeforeRow;
  p += H[0].length > 0 ? "left " : "", p += H[H.length - 1].length > 0 ? "right " : "";
  for (var q = 1; q < H.length - 1; q++)
    L += H[q].length === 0 ? "none " : H[q][0] ? "dashed " : "solid ";
  return /[sd]/.test(L) && h.setAttribute("rowlines", L.trim()), p !== "" && (h = new G.MathNode("menclose", [h]), h.setAttribute("notation", p.trim())), e.arraystretch && e.arraystretch < 1 && (h = new G.MathNode("mstyle", [h]), h.setAttribute("scriptlevel", "1")), h;
}, X1 = function(e, t) {
  e.envName.indexOf("ed") === -1 && ei(e);
  var r = [], a = e.envName.indexOf("at") > -1 ? "alignat" : "align", i = e.envName === "split", l = kr(e.parser, {
    cols: r,
    addJot: !0,
    autoTag: i ? void 0 : Vl(e.envName),
    emptySingleRow: !0,
    colSeparationType: a,
    maxNumCols: i ? 2 : void 0,
    leqno: e.parser.settings.leqno
  }, "display"), s, o = 0, u = {
    type: "ordgroup",
    mode: e.mode,
    body: []
  };
  if (t[0] && t[0].type === "ordgroup") {
    for (var h = "", f = 0; f < t[0].body.length; f++) {
      var p = be(t[0].body[f], "textord");
      h += p.text;
    }
    s = Number(h), o = s * 2;
  }
  var g = !o;
  l.body.forEach(function(E) {
    for (var k = 1; k < E.length; k += 2) {
      var b = be(E[k], "styling"), A = be(b.body[0], "ordgroup");
      A.body.unshift(u);
    }
    if (g)
      o < E.length && (o = E.length);
    else {
      var M = E.length / 2;
      if (s < M)
        throw new V("Too many math in a row: " + ("expected " + s + ", but got " + M), E[0]);
    }
  });
  for (var w = 0; w < o; ++w) {
    var v = "r", y = 0;
    w % 2 === 1 ? v = "l" : w > 0 && g && (y = 1), r[w] = {
      type: "align",
      align: v,
      pregap: y,
      postgap: 0
    };
  }
  return l.colSeparationType = g ? "align" : "alignat", l;
};
O0({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var t = Ka(e[0]), r = t ? [e[0]] : be(e[0], "ordgroup").body, a = r.map(function(l) {
      var s = Ol(l), o = s.text;
      if ("lcr".indexOf(o) !== -1)
        return {
          type: "align",
          align: o
        };
      if (o === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (o === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new V("Unknown column alignment: " + o, l);
    }), i = {
      cols: a,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: a.length
    };
    return kr(n.parser, i, jl(n.envName));
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var e = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[n.envName.replace("*", "")], t = "c", r = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: t
      }]
    };
    if (n.envName.charAt(n.envName.length - 1) === "*") {
      var a = n.parser;
      if (a.consumeSpaces(), a.fetch().text === "[") {
        if (a.consume(), a.consumeSpaces(), t = a.fetch().text, "lcr".indexOf(t) === -1)
          throw new V("Expected l or c or r", a.nextToken);
        a.consume(), a.consumeSpaces(), a.expect("]"), a.consume(), r.cols = [{
          type: "align",
          align: t
        }];
      }
    }
    var i = kr(n.parser, r, jl(n.envName)), l = Math.max(0, ...i.body.map((s) => s.length));
    return i.cols = new Array(l).fill({
      type: "align",
      align: t
    }), e ? {
      type: "leftright",
      mode: n.mode,
      body: [i],
      left: e[0],
      right: e[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : i;
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var e = {
      arraystretch: 0.5
    }, t = kr(n.parser, e, "script");
    return t.colSeparationType = "small", t;
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var t = Ka(e[0]), r = t ? [e[0]] : be(e[0], "ordgroup").body, a = r.map(function(l) {
      var s = Ol(l), o = s.text;
      if ("lc".indexOf(o) !== -1)
        return {
          type: "align",
          align: o
        };
      throw new V("Unknown column alignment: " + o, l);
    });
    if (a.length > 1)
      throw new V("{subarray} can contain only one column");
    var i = {
      cols: a,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (i = kr(n.parser, i, "script"), i.body.length > 0 && i.body[0].length > 1)
      throw new V("{subarray} can contain only one column");
    return i;
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var e = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1
        /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    }, t = kr(n.parser, e, jl(n.envName));
    return {
      type: "leftright",
      mode: n.mode,
      body: [t],
      left: n.envName.indexOf("r") > -1 ? "." : "\\{",
      right: n.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: X1,
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(n) {
    le.contains(["gather", "gather*"], n.envName) && ei(n);
    var e = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: Vl(n.envName),
      emptySingleRow: !0,
      leqno: n.parser.settings.leqno
    };
    return kr(n.parser, e, "display");
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: X1,
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(n) {
    ei(n);
    var e = {
      autoTag: Vl(n.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: n.parser.settings.leqno
    };
    return kr(n.parser, e, "display");
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
O0({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(n) {
    return ei(n), mf(n.parser);
  },
  htmlBuilder: P0,
  mathmlBuilder: H0
});
_("\\nonumber", "\\gdef\\@eqnsw{0}");
_("\\notag", "\\nonumber");
K({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(n, e) {
    throw new V(n.funcName + " valid only within array environment");
  }
});
var Zs = W1;
K({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    if (a.type !== "ordgroup")
      throw new V("Invalid environment name", a);
    for (var i = "", l = 0; l < a.body.length; ++l)
      i += be(a.body[l], "textord").text;
    if (r === "\\begin") {
      if (!Zs.hasOwnProperty(i))
        throw new V("No such environment: " + i, a);
      var s = Zs[i], {
        args: o,
        optArgs: u
      } = t.parseArguments("\\begin{" + i + "}", s), h = {
        mode: t.mode,
        envName: i,
        parser: t
      }, f = s.handler(h, o, u);
      t.expect("\\end", !1);
      var p = t.nextToken, g = be(t.parseFunction(), "environment");
      if (g.name !== i)
        throw new V("Mismatch: \\begin{" + i + "} matched by \\end{" + g.name + "}", p);
      return f;
    }
    return {
      type: "environment",
      mode: t.mode,
      name: i,
      nameGroup: a
    };
  }
});
var Z1 = (n, e) => {
  var t = n.font, r = e.withFont(t);
  return Ee(n.body, r);
}, K1 = (n, e) => {
  var t = n.font, r = e.withFont(t);
  return Pe(n.body, r);
}, Ks = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
K({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    "\\mathsfit",
    // families
    "\\mathbb",
    "\\mathcal",
    "\\mathfrak",
    "\\mathscr",
    "\\mathsf",
    "\\mathtt",
    // aliases, except \bm defined below
    "\\Bbb",
    "\\bold",
    "\\frak"
  ],
  props: {
    numArgs: 1,
    allowedInArgument: !0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = Ha(e[0]), i = r;
    return i in Ks && (i = Ks[i]), {
      type: "font",
      mode: t.mode,
      font: i.slice(1),
      body: a
    };
  },
  htmlBuilder: Z1,
  mathmlBuilder: K1
});
K({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0], a = le.isCharacterBox(r);
    return {
      type: "mclass",
      mode: t.mode,
      mclass: Qa(r),
      body: [{
        type: "font",
        mode: t.mode,
        font: "boldsymbol",
        body: r
      }],
      isCharacterBox: a
    };
  }
});
K({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r,
      breakOnTokenText: a
    } = n, {
      mode: i
    } = t, l = t.parseExpression(!0, a), s = "math" + r.slice(1);
    return {
      type: "font",
      mode: i,
      font: s,
      body: {
        type: "ordgroup",
        mode: t.mode,
        body: l
      }
    };
  },
  htmlBuilder: Z1,
  mathmlBuilder: K1
});
var Q1 = (n, e) => {
  var t = e;
  return n === "display" ? t = t.id >= oe.SCRIPT.id ? t.text() : oe.DISPLAY : n === "text" && t.size === oe.DISPLAY.size ? t = oe.TEXT : n === "script" ? t = oe.SCRIPT : n === "scriptscript" && (t = oe.SCRIPTSCRIPT), t;
}, Wl = (n, e) => {
  var t = Q1(n.size, e.style), r = t.fracNum(), a = t.fracDen(), i;
  i = e.havingStyle(r);
  var l = Ee(n.numer, i, e);
  if (n.continued) {
    var s = 8.5 / e.fontMetrics().ptPerEm, o = 3.5 / e.fontMetrics().ptPerEm;
    l.height = l.height < s ? s : l.height, l.depth = l.depth < o ? o : l.depth;
  }
  i = e.havingStyle(a);
  var u = Ee(n.denom, i, e), h, f, p;
  n.hasBarLine ? (n.barSize ? (f = Xe(n.barSize, e), h = B.makeLineSpan("frac-line", e, f)) : h = B.makeLineSpan("frac-line", e), f = h.height, p = h.height) : (h = null, f = 0, p = e.fontMetrics().defaultRuleThickness);
  var g, w, v;
  t.size === oe.DISPLAY.size || n.size === "display" ? (g = e.fontMetrics().num1, f > 0 ? w = 3 * p : w = 7 * p, v = e.fontMetrics().denom1) : (f > 0 ? (g = e.fontMetrics().num2, w = p) : (g = e.fontMetrics().num3, w = 3 * p), v = e.fontMetrics().denom2);
  var y;
  if (h) {
    var k = e.fontMetrics().axisHeight;
    g - l.depth - (k + 0.5 * f) < w && (g += w - (g - l.depth - (k + 0.5 * f))), k - 0.5 * f - (u.height - v) < w && (v += w - (k - 0.5 * f - (u.height - v)));
    var b = -(k - 0.5 * f);
    y = B.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: v
      }, {
        type: "elem",
        elem: h,
        shift: b
      }, {
        type: "elem",
        elem: l,
        shift: -g
      }]
    }, e);
  } else {
    var E = g - l.depth - (u.height - v);
    E < w && (g += 0.5 * (w - E), v += 0.5 * (w - E)), y = B.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: v
      }, {
        type: "elem",
        elem: l,
        shift: -g
      }]
    }, e);
  }
  i = e.havingStyle(t), y.height *= i.sizeMultiplier / e.sizeMultiplier, y.depth *= i.sizeMultiplier / e.sizeMultiplier;
  var A;
  t.size === oe.DISPLAY.size ? A = e.fontMetrics().delim1 : t.size === oe.SCRIPTSCRIPT.size ? A = e.havingStyle(oe.SCRIPT).fontMetrics().delim2 : A = e.fontMetrics().delim2;
  var M, R;
  return n.leftDelim == null ? M = Cn(e, ["mopen"]) : M = er.customSizedDelim(n.leftDelim, A, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? R = B.makeSpan([]) : n.rightDelim == null ? R = Cn(e, ["mclose"]) : R = er.customSizedDelim(n.rightDelim, A, !0, e.havingStyle(t), n.mode, ["mclose"]), B.makeSpan(["mord"].concat(i.sizingClasses(e)), [M, B.makeSpan(["mfrac"], [y]), R], e);
}, Yl = (n, e) => {
  var t = new G.MathNode("mfrac", [Pe(n.numer, e), Pe(n.denom, e)]);
  if (!n.hasBarLine)
    t.setAttribute("linethickness", "0px");
  else if (n.barSize) {
    var r = Xe(n.barSize, e);
    t.setAttribute("linethickness", Y(r));
  }
  var a = Q1(n.size, e.style);
  if (a.size !== e.style.size) {
    t = new G.MathNode("mstyle", [t]);
    var i = a.size === oe.DISPLAY.size ? "true" : "false";
    t.setAttribute("displaystyle", i), t.setAttribute("scriptlevel", "0");
  }
  if (n.leftDelim != null || n.rightDelim != null) {
    var l = [];
    if (n.leftDelim != null) {
      var s = new G.MathNode("mo", [new G.TextNode(n.leftDelim.replace("\\", ""))]);
      s.setAttribute("fence", "true"), l.push(s);
    }
    if (l.push(t), n.rightDelim != null) {
      var o = new G.MathNode("mo", [new G.TextNode(n.rightDelim.replace("\\", ""))]);
      o.setAttribute("fence", "true"), l.push(o);
    }
    return Il(l);
  }
  return t;
};
K({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0], i = e[1], l, s = null, o = null, u = "auto";
    switch (r) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        l = !0;
        break;
      case "\\\\atopfrac":
        l = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        l = !1, s = "(", o = ")";
        break;
      case "\\\\bracefrac":
        l = !1, s = "\\{", o = "\\}";
        break;
      case "\\\\brackfrac":
        l = !1, s = "[", o = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (r) {
      case "\\dfrac":
      case "\\dbinom":
        u = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        u = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !1,
      numer: a,
      denom: i,
      hasBarLine: l,
      leftDelim: s,
      rightDelim: o,
      size: u,
      barSize: null
    };
  },
  htmlBuilder: Wl,
  mathmlBuilder: Yl
});
K({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0], i = e[1];
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !0,
      numer: a,
      denom: i,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
K({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t,
      token: r
    } = n, a;
    switch (t) {
      case "\\over":
        a = "\\frac";
        break;
      case "\\choose":
        a = "\\binom";
        break;
      case "\\atop":
        a = "\\\\atopfrac";
        break;
      case "\\brace":
        a = "\\\\bracefrac";
        break;
      case "\\brack":
        a = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: e.mode,
      replaceWith: a,
      token: r
    };
  }
});
var Qs = ["display", "text", "script", "scriptscript"], Js = function(e) {
  var t = null;
  return e.length > 0 && (t = e, t = t === "." ? null : t), t;
};
K({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = e[4], a = e[5], i = Ha(e[0]), l = i.type === "atom" && i.family === "open" ? Js(i.text) : null, s = Ha(e[1]), o = s.type === "atom" && s.family === "close" ? Js(s.text) : null, u = be(e[2], "size"), h, f = null;
    u.isBlank ? h = !0 : (f = u.value, h = f.number > 0);
    var p = "auto", g = e[3];
    if (g.type === "ordgroup") {
      if (g.body.length > 0) {
        var w = be(g.body[0], "textord");
        p = Qs[Number(w.text)];
      }
    } else
      g = be(g, "textord"), p = Qs[Number(g.text)];
    return {
      type: "genfrac",
      mode: t.mode,
      numer: r,
      denom: a,
      continued: !1,
      hasBarLine: h,
      barSize: f,
      leftDelim: l,
      rightDelim: o,
      size: p
    };
  },
  htmlBuilder: Wl,
  mathmlBuilder: Yl
});
K({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r,
      token: a
    } = n;
    return {
      type: "infix",
      mode: t.mode,
      replaceWith: "\\\\abovefrac",
      size: be(e[0], "size").value,
      token: a
    };
  }
});
K({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0], i = ad(be(e[1], "infix").size), l = e[2], s = i.number > 0;
    return {
      type: "genfrac",
      mode: t.mode,
      numer: a,
      denom: l,
      continued: !1,
      hasBarLine: s,
      barSize: i,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: Wl,
  mathmlBuilder: Yl
});
var J1 = (n, e) => {
  var t = e.style, r, a;
  n.type === "supsub" ? (r = n.sup ? Ee(n.sup, e.havingStyle(t.sup()), e) : Ee(n.sub, e.havingStyle(t.sub()), e), a = be(n.base, "horizBrace")) : a = be(n, "horizBrace");
  var i = Ee(a.base, e.havingBaseStyle(oe.DISPLAY)), l = ar.svgSpan(a, e), s;
  if (a.isOver ? (s = B.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: i
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: l
    }]
  }, e), s.children[0].children[0].children[1].classes.push("svg-align")) : (s = B.makeVList({
    positionType: "bottom",
    positionData: i.depth + 0.1 + l.height,
    children: [{
      type: "elem",
      elem: l
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: i
    }]
  }, e), s.children[0].children[0].children[0].classes.push("svg-align")), r) {
    var o = B.makeSpan(["mord", a.isOver ? "mover" : "munder"], [s], e);
    a.isOver ? s = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: r
      }]
    }, e) : s = B.makeVList({
      positionType: "bottom",
      positionData: o.depth + 0.2 + r.height + r.depth,
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: o
      }]
    }, e);
  }
  return B.makeSpan(["mord", a.isOver ? "mover" : "munder"], [s], e);
}, Tf = (n, e) => {
  var t = ar.mathMLnode(n.label);
  return new G.MathNode(n.isOver ? "mover" : "munder", [Pe(n.base, e), t]);
};
K({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n;
    return {
      type: "horizBrace",
      mode: t.mode,
      label: r,
      isOver: /^\\over/.test(r),
      base: e[0]
    };
  },
  htmlBuilder: J1,
  mathmlBuilder: Tf
});
K({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[1], a = be(e[0], "url").url;
    return t.settings.isTrusted({
      command: "\\href",
      url: a
    }) ? {
      type: "href",
      mode: t.mode,
      href: a,
      body: it(r)
    } : t.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (n, e) => {
    var t = ft(n.body, e, !1);
    return B.makeAnchor(n.href, [], t, e);
  },
  mathmlBuilder: (n, e) => {
    var t = br(n.body, e);
    return t instanceof Vt || (t = new Vt("mrow", [t])), t.setAttribute("href", n.href), t;
  }
});
K({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = be(e[0], "url").url;
    if (!t.settings.isTrusted({
      command: "\\url",
      url: r
    }))
      return t.formatUnsupportedCmd("\\url");
    for (var a = [], i = 0; i < r.length; i++) {
      var l = r[i];
      l === "~" && (l = "\\textasciitilde"), a.push({
        type: "textord",
        mode: "text",
        text: l
      });
    }
    var s = {
      type: "text",
      mode: t.mode,
      font: "\\texttt",
      body: a
    };
    return {
      type: "href",
      mode: t.mode,
      href: r,
      body: it(s)
    };
  }
});
K({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "hbox",
      mode: t.mode,
      body: it(e[0])
    };
  },
  htmlBuilder(n, e) {
    var t = ft(n.body, e, !1);
    return B.makeFragment(t);
  },
  mathmlBuilder(n, e) {
    return new G.MathNode("mrow", Rt(n.body, e));
  }
});
K({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r,
      token: a
    } = n, i = be(e[0], "raw").string, l = e[1];
    t.settings.strict && t.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var s, o = {};
    switch (r) {
      case "\\htmlClass":
        o.class = i, s = {
          command: "\\htmlClass",
          class: i
        };
        break;
      case "\\htmlId":
        o.id = i, s = {
          command: "\\htmlId",
          id: i
        };
        break;
      case "\\htmlStyle":
        o.style = i, s = {
          command: "\\htmlStyle",
          style: i
        };
        break;
      case "\\htmlData": {
        for (var u = i.split(","), h = 0; h < u.length; h++) {
          var f = u[h].split("=");
          if (f.length !== 2)
            throw new V("Error parsing key-value for \\htmlData");
          o["data-" + f[0].trim()] = f[1].trim();
        }
        s = {
          command: "\\htmlData",
          attributes: o
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return t.settings.isTrusted(s) ? {
      type: "html",
      mode: t.mode,
      attributes: o,
      body: it(l)
    } : t.formatUnsupportedCmd(r);
  },
  htmlBuilder: (n, e) => {
    var t = ft(n.body, e, !1), r = ["enclosing"];
    n.attributes.class && r.push(...n.attributes.class.trim().split(/\s+/));
    var a = B.makeSpan(r, t, e);
    for (var i in n.attributes)
      i !== "class" && n.attributes.hasOwnProperty(i) && a.setAttribute(i, n.attributes[i]);
    return a;
  },
  mathmlBuilder: (n, e) => br(n.body, e)
});
K({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n;
    return {
      type: "htmlmathml",
      mode: t.mode,
      html: it(e[0]),
      mathml: it(e[1])
    };
  },
  htmlBuilder: (n, e) => {
    var t = ft(n.html, e, !1);
    return B.makeFragment(t);
  },
  mathmlBuilder: (n, e) => br(n.mathml, e)
});
var Ai = function(e) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))
    return {
      number: +e,
      unit: "bp"
    };
  var t = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);
  if (!t)
    throw new V("Invalid size: '" + e + "' in \\includegraphics");
  var r = {
    number: +(t[1] + t[2]),
    // sign + magnitude, cast to number
    unit: t[3]
  };
  if (!v1(r))
    throw new V("Invalid unit: '" + r.unit + "' in \\includegraphics.");
  return r;
};
K({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (n, e, t) => {
    var {
      parser: r
    } = n, a = {
      number: 0,
      unit: "em"
    }, i = {
      number: 0.9,
      unit: "em"
    }, l = {
      number: 0,
      unit: "em"
    }, s = "";
    if (t[0])
      for (var o = be(t[0], "raw").string, u = o.split(","), h = 0; h < u.length; h++) {
        var f = u[h].split("=");
        if (f.length === 2) {
          var p = f[1].trim();
          switch (f[0].trim()) {
            case "alt":
              s = p;
              break;
            case "width":
              a = Ai(p);
              break;
            case "height":
              i = Ai(p);
              break;
            case "totalheight":
              l = Ai(p);
              break;
            default:
              throw new V("Invalid key: '" + f[0] + "' in \\includegraphics.");
          }
        }
      }
    var g = be(e[0], "url").url;
    return s === "" && (s = g, s = s.replace(/^.*[\\/]/, ""), s = s.substring(0, s.lastIndexOf("."))), r.settings.isTrusted({
      command: "\\includegraphics",
      url: g
    }) ? {
      type: "includegraphics",
      mode: r.mode,
      alt: s,
      width: a,
      height: i,
      totalheight: l,
      src: g
    } : r.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (n, e) => {
    var t = Xe(n.height, e), r = 0;
    n.totalheight.number > 0 && (r = Xe(n.totalheight, e) - t);
    var a = 0;
    n.width.number > 0 && (a = Xe(n.width, e));
    var i = {
      height: Y(t + r)
    };
    a > 0 && (i.width = Y(a)), r > 0 && (i.verticalAlign = Y(-r));
    var l = new Cd(n.src, n.alt, i);
    return l.height = t, l.depth = r, l;
  },
  mathmlBuilder: (n, e) => {
    var t = new G.MathNode("mglyph", []);
    t.setAttribute("alt", n.alt);
    var r = Xe(n.height, e), a = 0;
    if (n.totalheight.number > 0 && (a = Xe(n.totalheight, e) - r, t.setAttribute("valign", Y(-a))), t.setAttribute("height", Y(r + a)), n.width.number > 0) {
      var i = Xe(n.width, e);
      t.setAttribute("width", Y(i));
    }
    return t.setAttribute("src", n.src), t;
  }
});
K({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = be(e[0], "size");
    if (t.settings.strict) {
      var i = r[1] === "m", l = a.value.unit === "mu";
      i ? (l || t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " supports only mu units, " + ("not " + a.value.unit + " units")), t.mode !== "math" && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " works only in math mode")) : l && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + r + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: t.mode,
      dimension: a.value
    };
  },
  htmlBuilder(n, e) {
    return B.makeGlue(n.dimension, e);
  },
  mathmlBuilder(n, e) {
    var t = Xe(n.dimension, e);
    return new G.SpaceNode(t);
  }
});
K({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "lap",
      mode: t.mode,
      alignment: r.slice(5),
      body: a
    };
  },
  htmlBuilder: (n, e) => {
    var t;
    n.alignment === "clap" ? (t = B.makeSpan([], [Ee(n.body, e)]), t = B.makeSpan(["inner"], [t], e)) : t = B.makeSpan(["inner"], [Ee(n.body, e)]);
    var r = B.makeSpan(["fix"], []), a = B.makeSpan([n.alignment], [t, r], e), i = B.makeSpan(["strut"]);
    return i.style.height = Y(a.height + a.depth), a.depth && (i.style.verticalAlign = Y(-a.depth)), a.children.unshift(i), a = B.makeSpan(["thinbox"], [a], e), B.makeSpan(["mord", "vbox"], [a], e);
  },
  mathmlBuilder: (n, e) => {
    var t = new G.MathNode("mpadded", [Pe(n.body, e)]);
    if (n.alignment !== "rlap") {
      var r = n.alignment === "llap" ? "-1" : "-0.5";
      t.setAttribute("lspace", r + "width");
    }
    return t.setAttribute("width", "0px"), t;
  }
});
K({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(n, e) {
    var {
      funcName: t,
      parser: r
    } = n, a = r.mode;
    r.switchMode("math");
    var i = t === "\\(" ? "\\)" : "$", l = r.parseExpression(!1, i);
    return r.expect(i), r.switchMode(a), {
      type: "styling",
      mode: r.mode,
      style: "text",
      body: l
    };
  }
});
K({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(n, e) {
    throw new V("Mismatched " + n.funcName);
  }
});
var eo = (n, e) => {
  switch (e.style.size) {
    case oe.DISPLAY.size:
      return n.display;
    case oe.TEXT.size:
      return n.text;
    case oe.SCRIPT.size:
      return n.script;
    case oe.SCRIPTSCRIPT.size:
      return n.scriptscript;
    default:
      return n.text;
  }
};
K({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n;
    return {
      type: "mathchoice",
      mode: t.mode,
      display: it(e[0]),
      text: it(e[1]),
      script: it(e[2]),
      scriptscript: it(e[3])
    };
  },
  htmlBuilder: (n, e) => {
    var t = eo(n, e), r = ft(t, e, !1);
    return B.makeFragment(r);
  },
  mathmlBuilder: (n, e) => {
    var t = eo(n, e);
    return br(t, e);
  }
});
var ec = (n, e, t, r, a, i, l) => {
  n = B.makeSpan([], [n]);
  var s = t && le.isCharacterBox(t), o, u;
  if (e) {
    var h = Ee(e, r.havingStyle(a.sup()), r);
    u = {
      elem: h,
      kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - h.depth)
    };
  }
  if (t) {
    var f = Ee(t, r.havingStyle(a.sub()), r);
    o = {
      elem: f,
      kern: Math.max(r.fontMetrics().bigOpSpacing2, r.fontMetrics().bigOpSpacing4 - f.height)
    };
  }
  var p;
  if (u && o) {
    var g = r.fontMetrics().bigOpSpacing5 + o.elem.height + o.elem.depth + o.kern + n.depth + l;
    p = B.makeVList({
      positionType: "bottom",
      positionData: g,
      children: [{
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: Y(-i)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: Y(i)
      }, {
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }]
    }, r);
  } else if (o) {
    var w = n.height - l;
    p = B.makeVList({
      positionType: "top",
      positionData: w,
      children: [{
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: Y(-i)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: n
      }]
    }, r);
  } else if (u) {
    var v = n.depth + l;
    p = B.makeVList({
      positionType: "bottom",
      positionData: v,
      children: [{
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: Y(i)
      }, {
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }]
    }, r);
  } else
    return n;
  var y = [p];
  if (o && i !== 0 && !s) {
    var E = B.makeSpan(["mspace"], [], r);
    E.style.marginRight = Y(i), y.unshift(E);
  }
  return B.makeSpan(["mop", "op-limits"], y, r);
}, tc = ["\\smallint"], Jr = (n, e) => {
  var t, r, a = !1, i;
  n.type === "supsub" ? (t = n.sup, r = n.sub, i = be(n.base, "op"), a = !0) : i = be(n, "op");
  var l = e.style, s = !1;
  l.size === oe.DISPLAY.size && i.symbol && !le.contains(tc, i.name) && (s = !0);
  var o;
  if (i.symbol) {
    var u = s ? "Size2-Regular" : "Size1-Regular", h = "";
    if ((i.name === "\\oiint" || i.name === "\\oiiint") && (h = i.name.slice(1), i.name = h === "oiint" ? "\\iint" : "\\iiint"), o = B.makeSymbol(i.name, u, "math", e, ["mop", "op-symbol", s ? "large-op" : "small-op"]), h.length > 0) {
      var f = o.italic, p = B.staticSvg(h + "Size" + (s ? "2" : "1"), e);
      o = B.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: o,
          shift: 0
        }, {
          type: "elem",
          elem: p,
          shift: s ? 0.08 : 0
        }]
      }, e), i.name = "\\" + h, o.classes.unshift("mop"), o.italic = f;
    }
  } else if (i.body) {
    var g = ft(i.body, e, !0);
    g.length === 1 && g[0] instanceof s0 ? (o = g[0], o.classes[0] = "mop") : o = B.makeSpan(["mop"], g, e);
  } else {
    for (var w = [], v = 1; v < i.name.length; v++)
      w.push(B.mathsym(i.name[v], i.mode, e));
    o = B.makeSpan(["mop"], w, e);
  }
  var y = 0, E = 0;
  return (o instanceof s0 || i.name === "\\oiint" || i.name === "\\oiiint") && !i.suppressBaseShift && (y = (o.height - o.depth) / 2 - e.fontMetrics().axisHeight, E = o.italic), a ? ec(o, t, r, e, l, E, y) : (y && (o.style.position = "relative", o.style.top = Y(y)), o);
}, Rn = (n, e) => {
  var t;
  if (n.symbol)
    t = new Vt("mo", [o0(n.name, n.mode)]), le.contains(tc, n.name) && t.setAttribute("largeop", "false");
  else if (n.body)
    t = new Vt("mo", Rt(n.body, e));
  else {
    t = new Vt("mi", [new F0(n.name.slice(1))]);
    var r = new Vt("mo", [o0("⁡", "text")]);
    n.parentIsSupSub ? t = new Vt("mrow", [t, r]) : t = T1([t, r]);
  }
  return t;
}, Ff = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
K({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = r;
    return a.length === 1 && (a = Ff[a]), {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: a
    };
  },
  htmlBuilder: Jr,
  mathmlBuilder: Rn
});
K({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0];
    return {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: it(r)
    };
  },
  htmlBuilder: Jr,
  mathmlBuilder: Rn
});
var $f = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
K({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n;
    return {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: Jr,
  mathmlBuilder: Rn
});
K({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n;
    return {
      type: "op",
      mode: e.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: Jr,
  mathmlBuilder: Rn
});
K({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var {
      parser: e,
      funcName: t
    } = n, r = t;
    return r.length === 1 && (r = $f[r]), {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: r
    };
  },
  htmlBuilder: Jr,
  mathmlBuilder: Rn
});
var rc = (n, e) => {
  var t, r, a = !1, i;
  n.type === "supsub" ? (t = n.sup, r = n.sub, i = be(n.base, "operatorname"), a = !0) : i = be(n, "operatorname");
  var l;
  if (i.body.length > 0) {
    for (var s = i.body.map((f) => {
      var p = f.text;
      return typeof p == "string" ? {
        type: "textord",
        mode: f.mode,
        text: p
      } : f;
    }), o = ft(s, e.withFont("mathrm"), !0), u = 0; u < o.length; u++) {
      var h = o[u];
      h instanceof s0 && (h.text = h.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    l = B.makeSpan(["mop"], o, e);
  } else
    l = B.makeSpan(["mop"], [], e);
  return a ? ec(l, t, r, e, e.style, 0, 0) : l;
}, Mf = (n, e) => {
  for (var t = Rt(n.body, e.withFont("mathrm")), r = !0, a = 0; a < t.length; a++) {
    var i = t[a];
    if (!(i instanceof G.SpaceNode)) if (i instanceof G.MathNode)
      switch (i.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var l = i.children[0];
          i.children.length === 1 && l instanceof G.TextNode ? l.text = l.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : r = !1;
          break;
        }
        default:
          r = !1;
      }
    else
      r = !1;
  }
  if (r) {
    var s = t.map((h) => h.toText()).join("");
    t = [new G.TextNode(s)];
  }
  var o = new G.MathNode("mi", t);
  o.setAttribute("mathvariant", "normal");
  var u = new G.MathNode("mo", [o0("⁡", "text")]);
  return n.parentIsSupSub ? new G.MathNode("mrow", [o, u]) : G.newDocumentFragment([o, u]);
};
K({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "operatorname",
      mode: t.mode,
      body: it(a),
      alwaysHandleSupSub: r === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: rc,
  mathmlBuilder: Mf
});
_("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
Mr({
  type: "ordgroup",
  htmlBuilder(n, e) {
    return n.semisimple ? B.makeFragment(ft(n.body, e, !1)) : B.makeSpan(["mord"], ft(n.body, e, !0), e);
  },
  mathmlBuilder(n, e) {
    return br(n.body, e, !0);
  }
});
K({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = e[0];
    return {
      type: "overline",
      mode: t.mode,
      body: r
    };
  },
  htmlBuilder(n, e) {
    var t = Ee(n.body, e.havingCrampedStyle()), r = B.makeLineSpan("overline-line", e), a = e.fontMetrics().defaultRuleThickness, i = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: a
      }]
    }, e);
    return B.makeSpan(["mord", "overline"], [i], e);
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mo", [new G.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var r = new G.MathNode("mover", [Pe(n.body, e), t]);
    return r.setAttribute("accent", "true"), r;
  }
});
K({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0];
    return {
      type: "phantom",
      mode: t.mode,
      body: it(r)
    };
  },
  htmlBuilder: (n, e) => {
    var t = ft(n.body, e.withPhantom(), !1);
    return B.makeFragment(t);
  },
  mathmlBuilder: (n, e) => {
    var t = Rt(n.body, e);
    return new G.MathNode("mphantom", t);
  }
});
K({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0];
    return {
      type: "hphantom",
      mode: t.mode,
      body: r
    };
  },
  htmlBuilder: (n, e) => {
    var t = B.makeSpan([], [Ee(n.body, e.withPhantom())]);
    if (t.height = 0, t.depth = 0, t.children)
      for (var r = 0; r < t.children.length; r++)
        t.children[r].height = 0, t.children[r].depth = 0;
    return t = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e), B.makeSpan(["mord"], [t], e);
  },
  mathmlBuilder: (n, e) => {
    var t = Rt(it(n.body), e), r = new G.MathNode("mphantom", t), a = new G.MathNode("mpadded", [r]);
    return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
  }
});
K({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0];
    return {
      type: "vphantom",
      mode: t.mode,
      body: r
    };
  },
  htmlBuilder: (n, e) => {
    var t = B.makeSpan(["inner"], [Ee(n.body, e.withPhantom())]), r = B.makeSpan(["fix"], []);
    return B.makeSpan(["mord", "rlap"], [t, r], e);
  },
  mathmlBuilder: (n, e) => {
    var t = Rt(it(n.body), e), r = new G.MathNode("mphantom", t), a = new G.MathNode("mpadded", [r]);
    return a.setAttribute("width", "0px"), a;
  }
});
K({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = be(e[0], "size").value, a = e[1];
    return {
      type: "raisebox",
      mode: t.mode,
      dy: r,
      body: a
    };
  },
  htmlBuilder(n, e) {
    var t = Ee(n.body, e), r = Xe(n.dy, e);
    return B.makeVList({
      positionType: "shift",
      positionData: -r,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mpadded", [Pe(n.body, e)]), r = n.dy.number + n.dy.unit;
    return t.setAttribute("voffset", r), t;
  }
});
K({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInArgument: !0
  },
  handler(n) {
    var {
      parser: e
    } = n;
    return {
      type: "internal",
      mode: e.mode
    };
  }
});
K({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    argTypes: ["size", "size", "size"]
  },
  handler(n, e, t) {
    var {
      parser: r
    } = n, a = t[0], i = be(e[0], "size"), l = be(e[1], "size");
    return {
      type: "rule",
      mode: r.mode,
      shift: a && be(a, "size").value,
      width: i.value,
      height: l.value
    };
  },
  htmlBuilder(n, e) {
    var t = B.makeSpan(["mord", "rule"], [], e), r = Xe(n.width, e), a = Xe(n.height, e), i = n.shift ? Xe(n.shift, e) : 0;
    return t.style.borderRightWidth = Y(r), t.style.borderTopWidth = Y(a), t.style.bottom = Y(i), t.width = r, t.height = a + i, t.depth = -i, t.maxFontSize = a * 1.125 * e.sizeMultiplier, t;
  },
  mathmlBuilder(n, e) {
    var t = Xe(n.width, e), r = Xe(n.height, e), a = n.shift ? Xe(n.shift, e) : 0, i = e.color && e.getColor() || "black", l = new G.MathNode("mspace");
    l.setAttribute("mathbackground", i), l.setAttribute("width", Y(t)), l.setAttribute("height", Y(r));
    var s = new G.MathNode("mpadded", [l]);
    return a >= 0 ? s.setAttribute("height", Y(a)) : (s.setAttribute("height", Y(a)), s.setAttribute("depth", Y(-a))), s.setAttribute("voffset", Y(a)), s;
  }
});
function nc(n, e, t) {
  for (var r = ft(n, e, !1), a = e.sizeMultiplier / t.sizeMultiplier, i = 0; i < r.length; i++) {
    var l = r[i].classes.indexOf("sizing");
    l < 0 ? Array.prototype.push.apply(r[i].classes, e.sizingClasses(t)) : r[i].classes[l + 1] === "reset-size" + e.size && (r[i].classes[l + 1] = "reset-size" + t.size), r[i].height *= a, r[i].depth *= a;
  }
  return B.makeFragment(r);
}
var to = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], zf = (n, e) => {
  var t = e.havingSize(n.size);
  return nc(n.body, t, e);
};
K({
  type: "sizing",
  names: to,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      breakOnTokenText: t,
      funcName: r,
      parser: a
    } = n, i = a.parseExpression(!1, t);
    return {
      type: "sizing",
      mode: a.mode,
      // Figure out what size to use based on the list of functions above
      size: to.indexOf(r) + 1,
      body: i
    };
  },
  htmlBuilder: zf,
  mathmlBuilder: (n, e) => {
    var t = e.havingSize(n.size), r = Rt(n.body, t), a = new G.MathNode("mstyle", r);
    return a.setAttribute("mathsize", Y(t.sizeMultiplier)), a;
  }
});
K({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (n, e, t) => {
    var {
      parser: r
    } = n, a = !1, i = !1, l = t[0] && be(t[0], "ordgroup");
    if (l)
      for (var s = "", o = 0; o < l.body.length; ++o) {
        var u = l.body[o];
        if (s = u.text, s === "t")
          a = !0;
        else if (s === "b")
          i = !0;
        else {
          a = !1, i = !1;
          break;
        }
      }
    else
      a = !0, i = !0;
    var h = e[0];
    return {
      type: "smash",
      mode: r.mode,
      body: h,
      smashHeight: a,
      smashDepth: i
    };
  },
  htmlBuilder: (n, e) => {
    var t = B.makeSpan([], [Ee(n.body, e)]);
    if (!n.smashHeight && !n.smashDepth)
      return t;
    if (n.smashHeight && (t.height = 0, t.children))
      for (var r = 0; r < t.children.length; r++)
        t.children[r].height = 0;
    if (n.smashDepth && (t.depth = 0, t.children))
      for (var a = 0; a < t.children.length; a++)
        t.children[a].depth = 0;
    var i = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
    return B.makeSpan(["mord"], [i], e);
  },
  mathmlBuilder: (n, e) => {
    var t = new G.MathNode("mpadded", [Pe(n.body, e)]);
    return n.smashHeight && t.setAttribute("height", "0px"), n.smashDepth && t.setAttribute("depth", "0px"), t;
  }
});
K({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(n, e, t) {
    var {
      parser: r
    } = n, a = t[0], i = e[0];
    return {
      type: "sqrt",
      mode: r.mode,
      body: i,
      index: a
    };
  },
  htmlBuilder(n, e) {
    var t = Ee(n.body, e.havingCrampedStyle());
    t.height === 0 && (t.height = e.fontMetrics().xHeight), t = B.wrapFragment(t, e);
    var r = e.fontMetrics(), a = r.defaultRuleThickness, i = a;
    e.style.id < oe.TEXT.id && (i = e.fontMetrics().xHeight);
    var l = a + i / 4, s = t.height + t.depth + l + a, {
      span: o,
      ruleWidth: u,
      advanceWidth: h
    } = er.sqrtImage(s, e), f = o.height - u;
    f > t.height + t.depth + l && (l = (l + f - t.height - t.depth) / 2);
    var p = o.height - t.height - l - u;
    t.style.paddingLeft = Y(h);
    var g = B.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(t.height + p)
      }, {
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: u
      }]
    }, e);
    if (n.index) {
      var w = e.havingStyle(oe.SCRIPTSCRIPT), v = Ee(n.index, w, e), y = 0.6 * (g.height - g.depth), E = B.makeVList({
        positionType: "shift",
        positionData: -y,
        children: [{
          type: "elem",
          elem: v
        }]
      }, e), k = B.makeSpan(["root"], [E]);
      return B.makeSpan(["mord", "sqrt"], [k, g], e);
    } else
      return B.makeSpan(["mord", "sqrt"], [g], e);
  },
  mathmlBuilder(n, e) {
    var {
      body: t,
      index: r
    } = n;
    return r ? new G.MathNode("mroot", [Pe(t, e), Pe(r, e)]) : new G.MathNode("msqrt", [Pe(t, e)]);
  }
});
var ro = {
  display: oe.DISPLAY,
  text: oe.TEXT,
  script: oe.SCRIPT,
  scriptscript: oe.SCRIPTSCRIPT
};
K({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(n, e) {
    var {
      breakOnTokenText: t,
      funcName: r,
      parser: a
    } = n, i = a.parseExpression(!0, t), l = r.slice(1, r.length - 5);
    return {
      type: "styling",
      mode: a.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: l,
      body: i
    };
  },
  htmlBuilder(n, e) {
    var t = ro[n.style], r = e.havingStyle(t).withFont("");
    return nc(n.body, r, e);
  },
  mathmlBuilder(n, e) {
    var t = ro[n.style], r = e.havingStyle(t), a = Rt(n.body, r), i = new G.MathNode("mstyle", a), l = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, s = l[n.style];
    return i.setAttribute("scriptlevel", s[0]), i.setAttribute("displaystyle", s[1]), i;
  }
});
var Bf = function(e, t) {
  var r = e.base;
  if (r)
    if (r.type === "op") {
      var a = r.limits && (t.style.size === oe.DISPLAY.size || r.alwaysHandleSupSub);
      return a ? Jr : null;
    } else if (r.type === "operatorname") {
      var i = r.alwaysHandleSupSub && (t.style.size === oe.DISPLAY.size || r.limits);
      return i ? rc : null;
    } else {
      if (r.type === "accent")
        return le.isCharacterBox(r.base) ? Pl : null;
      if (r.type === "horizBrace") {
        var l = !e.sub;
        return l === r.isOver ? J1 : null;
      } else
        return null;
    }
  else return null;
};
Mr({
  type: "supsub",
  htmlBuilder(n, e) {
    var t = Bf(n, e);
    if (t)
      return t(n, e);
    var {
      base: r,
      sup: a,
      sub: i
    } = n, l = Ee(r, e), s, o, u = e.fontMetrics(), h = 0, f = 0, p = r && le.isCharacterBox(r);
    if (a) {
      var g = e.havingStyle(e.style.sup());
      s = Ee(a, g, e), p || (h = l.height - g.fontMetrics().supDrop * g.sizeMultiplier / e.sizeMultiplier);
    }
    if (i) {
      var w = e.havingStyle(e.style.sub());
      o = Ee(i, w, e), p || (f = l.depth + w.fontMetrics().subDrop * w.sizeMultiplier / e.sizeMultiplier);
    }
    var v;
    e.style === oe.DISPLAY ? v = u.sup1 : e.style.cramped ? v = u.sup3 : v = u.sup2;
    var y = e.sizeMultiplier, E = Y(0.5 / u.ptPerEm / y), k = null;
    if (o) {
      var b = n.base && n.base.type === "op" && n.base.name && (n.base.name === "\\oiint" || n.base.name === "\\oiiint");
      (l instanceof s0 || b) && (k = Y(-l.italic));
    }
    var A;
    if (s && o) {
      h = Math.max(h, v, s.depth + 0.25 * u.xHeight), f = Math.max(f, u.sub2);
      var M = u.defaultRuleThickness, R = 4 * M;
      if (h - s.depth - (o.height - f) < R) {
        f = R - (h - s.depth) + o.height;
        var L = 0.8 * u.xHeight - (h - s.depth);
        L > 0 && (h += L, f -= L);
      }
      var H = [{
        type: "elem",
        elem: o,
        shift: f,
        marginRight: E,
        marginLeft: k
      }, {
        type: "elem",
        elem: s,
        shift: -h,
        marginRight: E
      }];
      A = B.makeVList({
        positionType: "individualShift",
        children: H
      }, e);
    } else if (o) {
      f = Math.max(f, u.sub1, o.height - 0.8 * u.xHeight);
      var q = [{
        type: "elem",
        elem: o,
        marginLeft: k,
        marginRight: E
      }];
      A = B.makeVList({
        positionType: "shift",
        positionData: f,
        children: q
      }, e);
    } else if (s)
      h = Math.max(h, v, s.depth + 0.25 * u.xHeight), A = B.makeVList({
        positionType: "shift",
        positionData: -h,
        children: [{
          type: "elem",
          elem: s,
          marginRight: E
        }]
      }, e);
    else
      throw new Error("supsub must have either sup or sub.");
    var X = fl(l, "right") || "mord";
    return B.makeSpan([X], [l, B.makeSpan(["msupsub"], [A])], e);
  },
  mathmlBuilder(n, e) {
    var t = !1, r, a;
    n.base && n.base.type === "horizBrace" && (a = !!n.sup, a === n.base.isOver && (t = !0, r = n.base.isOver)), n.base && (n.base.type === "op" || n.base.type === "operatorname") && (n.base.parentIsSupSub = !0);
    var i = [Pe(n.base, e)];
    n.sub && i.push(Pe(n.sub, e)), n.sup && i.push(Pe(n.sup, e));
    var l;
    if (t)
      l = r ? "mover" : "munder";
    else if (n.sub)
      if (n.sup) {
        var u = n.base;
        u && u.type === "op" && u.limits && e.style === oe.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (e.style === oe.DISPLAY || u.limits) ? l = "munderover" : l = "msubsup";
      } else {
        var o = n.base;
        o && o.type === "op" && o.limits && (e.style === oe.DISPLAY || o.alwaysHandleSupSub) || o && o.type === "operatorname" && o.alwaysHandleSupSub && (o.limits || e.style === oe.DISPLAY) ? l = "munder" : l = "msub";
      }
    else {
      var s = n.base;
      s && s.type === "op" && s.limits && (e.style === oe.DISPLAY || s.alwaysHandleSupSub) || s && s.type === "operatorname" && s.alwaysHandleSupSub && (s.limits || e.style === oe.DISPLAY) ? l = "mover" : l = "msup";
    }
    return new G.MathNode(l, i);
  }
});
Mr({
  type: "atom",
  htmlBuilder(n, e) {
    return B.mathsym(n.text, n.mode, e, ["m" + n.family]);
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mo", [o0(n.text, n.mode)]);
    if (n.family === "bin") {
      var r = Nl(n, e);
      r === "bold-italic" && t.setAttribute("mathvariant", r);
    } else n.family === "punct" ? t.setAttribute("separator", "true") : (n.family === "open" || n.family === "close") && t.setAttribute("stretchy", "false");
    return t;
  }
});
var ac = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
Mr({
  type: "mathord",
  htmlBuilder(n, e) {
    return B.makeOrd(n, e, "mathord");
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mi", [o0(n.text, n.mode, e)]), r = Nl(n, e) || "italic";
    return r !== ac[t.type] && t.setAttribute("mathvariant", r), t;
  }
});
Mr({
  type: "textord",
  htmlBuilder(n, e) {
    return B.makeOrd(n, e, "textord");
  },
  mathmlBuilder(n, e) {
    var t = o0(n.text, n.mode, e), r = Nl(n, e) || "normal", a;
    return n.mode === "text" ? a = new G.MathNode("mtext", [t]) : /[0-9]/.test(n.text) ? a = new G.MathNode("mn", [t]) : n.text === "\\prime" ? a = new G.MathNode("mo", [t]) : a = new G.MathNode("mi", [t]), r !== ac[a.type] && a.setAttribute("mathvariant", r), a;
  }
});
var Ei = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, Ci = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
Mr({
  type: "spacing",
  htmlBuilder(n, e) {
    if (Ci.hasOwnProperty(n.text)) {
      var t = Ci[n.text].className || "";
      if (n.mode === "text") {
        var r = B.makeOrd(n, e, "textord");
        return r.classes.push(t), r;
      } else
        return B.makeSpan(["mspace", t], [B.mathsym(n.text, n.mode, e)], e);
    } else {
      if (Ei.hasOwnProperty(n.text))
        return B.makeSpan(["mspace", Ei[n.text]], [], e);
      throw new V('Unknown type of space "' + n.text + '"');
    }
  },
  mathmlBuilder(n, e) {
    var t;
    if (Ci.hasOwnProperty(n.text))
      t = new G.MathNode("mtext", [new G.TextNode(" ")]);
    else {
      if (Ei.hasOwnProperty(n.text))
        return new G.MathNode("mspace");
      throw new V('Unknown type of space "' + n.text + '"');
    }
    return t;
  }
});
var no = () => {
  var n = new G.MathNode("mtd", []);
  return n.setAttribute("width", "50%"), n;
};
Mr({
  type: "tag",
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mtable", [new G.MathNode("mtr", [no(), new G.MathNode("mtd", [br(n.body, e)]), no(), new G.MathNode("mtd", [br(n.tag, e)])])]);
    return t.setAttribute("width", "100%"), t;
  }
});
var ao = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, io = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, Lf = {
  "\\textit": "textit",
  "\\textup": "textup"
}, lo = (n, e) => {
  var t = n.font;
  if (t) {
    if (ao[t])
      return e.withTextFontFamily(ao[t]);
    if (io[t])
      return e.withTextFontWeight(io[t]);
    if (t === "\\emph")
      return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit");
  } else return e;
  return e.withTextFontShape(Lf[t]);
};
K({
  type: "text",
  names: [
    // Font families
    "\\text",
    "\\textrm",
    "\\textsf",
    "\\texttt",
    "\\textnormal",
    // Font weights
    "\\textbf",
    "\\textmd",
    // Font Shapes
    "\\textit",
    "\\textup",
    "\\emph"
  ],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: !0,
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0];
    return {
      type: "text",
      mode: t.mode,
      body: it(a),
      font: r
    };
  },
  htmlBuilder(n, e) {
    var t = lo(n, e), r = ft(n.body, t, !0);
    return B.makeSpan(["mord", "text"], r, t);
  },
  mathmlBuilder(n, e) {
    var t = lo(n, e);
    return br(n.body, t);
  }
});
K({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "underline",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(n, e) {
    var t = Ee(n.body, e), r = B.makeLineSpan("underline-line", e), a = e.fontMetrics().defaultRuleThickness, i = B.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return B.makeSpan(["mord", "underline"], [i], e);
  },
  mathmlBuilder(n, e) {
    var t = new G.MathNode("mo", [new G.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var r = new G.MathNode("munder", [Pe(n.body, e), t]);
    return r.setAttribute("accentunder", "true"), r;
  }
});
K({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "vcenter",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(n, e) {
    var t = Ee(n.body, e), r = e.fontMetrics().axisHeight, a = 0.5 * (t.height - r - (t.depth + r));
    return B.makeVList({
      positionType: "shift",
      positionData: a,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(n, e) {
    return new G.MathNode("mpadded", [Pe(n.body, e)], ["vcenter"]);
  }
});
K({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(n, e, t) {
    throw new V("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(n, e) {
    for (var t = so(n), r = [], a = e.havingStyle(e.style.text()), i = 0; i < t.length; i++) {
      var l = t[i];
      l === "~" && (l = "\\textasciitilde"), r.push(B.makeSymbol(l, "Typewriter-Regular", n.mode, a, ["mord", "texttt"]));
    }
    return B.makeSpan(["mord", "text"].concat(a.sizingClasses(e)), B.tryCombineChars(r), a);
  },
  mathmlBuilder(n, e) {
    var t = new G.TextNode(so(n)), r = new G.MathNode("mtext", [t]);
    return r.setAttribute("mathvariant", "monospace"), r;
  }
});
var so = (n) => n.body.replace(/ /g, n.star ? "␣" : " "), pr = E1, ic = `[ \r
	]`, Rf = "\\\\[a-zA-Z@]+", qf = "\\\\[^\uD800-\uDFFF]", If = "(" + Rf + ")" + ic + "*", Nf = `\\\\(
|[ \r	]+
?)[ \r	]*`, _l = "[̀-ͯ]", Of = new RegExp(_l + "+$"), Pf = "(" + ic + "+)|" + // whitespace
(Nf + "|") + // \whitespace
"([!-\\[\\]-‧‪-퟿豈-]" + // single codepoint
(_l + "*") + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
(_l + "*") + // ...plus accents
"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
("|" + If) + // \macroName + spaces
("|" + qf + ")");
class oo {
  // Category codes. The lexer only supports comment characters (14) for now.
  // MacroExpander additionally distinguishes active (13).
  constructor(e, t) {
    this.input = void 0, this.settings = void 0, this.tokenRegex = void 0, this.catcodes = void 0, this.input = e, this.settings = t, this.tokenRegex = new RegExp(Pf, "g"), this.catcodes = {
      "%": 14,
      // comment character
      "~": 13
      // active character
    };
  }
  setCatcode(e, t) {
    this.catcodes[e] = t;
  }
  /**
   * This function lexes a single token.
   */
  lex() {
    var e = this.input, t = this.tokenRegex.lastIndex;
    if (t === e.length)
      return new l0("EOF", new Ut(this, t, t));
    var r = this.tokenRegex.exec(e);
    if (r === null || r.index !== t)
      throw new V("Unexpected character: '" + e[t] + "'", new l0(e[t], new Ut(this, t, t + 1)));
    var a = r[6] || r[3] || (r[2] ? "\\ " : " ");
    if (this.catcodes[a] === 14) {
      var i = e.indexOf(`
`, this.tokenRegex.lastIndex);
      return i === -1 ? (this.tokenRegex.lastIndex = e.length, this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")) : this.tokenRegex.lastIndex = i + 1, this.lex();
    }
    return new l0(a, new Ut(this, t, this.tokenRegex.lastIndex));
  }
}
class Hf {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(e, t) {
    e === void 0 && (e = {}), t === void 0 && (t = {}), this.current = void 0, this.builtins = void 0, this.undefStack = void 0, this.current = t, this.builtins = e, this.undefStack = [];
  }
  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }
  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0)
      throw new V("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
    var e = this.undefStack.pop();
    for (var t in e)
      e.hasOwnProperty(t) && (e[t] == null ? delete this.current[t] : this.current[t] = e[t]);
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    for (; this.undefStack.length > 0; )
      this.endGroup();
  }
  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(e) {
    return this.current.hasOwnProperty(e) || this.builtins.hasOwnProperty(e);
  }
  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(e) {
    return this.current.hasOwnProperty(e) ? this.current[e] : this.builtins[e];
  }
  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(e, t, r) {
    if (r === void 0 && (r = !1), r) {
      for (var a = 0; a < this.undefStack.length; a++)
        delete this.undefStack[a][e];
      this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][e] = t);
    } else {
      var i = this.undefStack[this.undefStack.length - 1];
      i && !i.hasOwnProperty(e) && (i[e] = this.current[e]);
    }
    t == null ? delete this.current[e] : this.current[e] = t;
  }
}
var Uf = Y1;
_("\\noexpand", function(n) {
  var e = n.popToken();
  return n.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), {
    tokens: [e],
    numArgs: 0
  };
});
_("\\expandafter", function(n) {
  var e = n.popToken();
  return n.expandOnce(!0), {
    tokens: [e],
    numArgs: 0
  };
});
_("\\@firstoftwo", function(n) {
  var e = n.consumeArgs(2);
  return {
    tokens: e[0],
    numArgs: 0
  };
});
_("\\@secondoftwo", function(n) {
  var e = n.consumeArgs(2);
  return {
    tokens: e[1],
    numArgs: 0
  };
});
_("\\@ifnextchar", function(n) {
  var e = n.consumeArgs(3);
  n.consumeSpaces();
  var t = n.future();
  return e[0].length === 1 && e[0][0].text === t.text ? {
    tokens: e[1],
    numArgs: 0
  } : {
    tokens: e[2],
    numArgs: 0
  };
});
_("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
_("\\TextOrMath", function(n) {
  var e = n.consumeArgs(2);
  return n.mode === "text" ? {
    tokens: e[0],
    numArgs: 0
  } : {
    tokens: e[1],
    numArgs: 0
  };
});
var uo = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  a: 10,
  A: 10,
  b: 11,
  B: 11,
  c: 12,
  C: 12,
  d: 13,
  D: 13,
  e: 14,
  E: 14,
  f: 15,
  F: 15
};
_("\\char", function(n) {
  var e = n.popToken(), t, r = "";
  if (e.text === "'")
    t = 8, e = n.popToken();
  else if (e.text === '"')
    t = 16, e = n.popToken();
  else if (e.text === "`")
    if (e = n.popToken(), e.text[0] === "\\")
      r = e.text.charCodeAt(1);
    else {
      if (e.text === "EOF")
        throw new V("\\char` missing argument");
      r = e.text.charCodeAt(0);
    }
  else
    t = 10;
  if (t) {
    if (r = uo[e.text], r == null || r >= t)
      throw new V("Invalid base-" + t + " digit " + e.text);
    for (var a; (a = uo[n.future().text]) != null && a < t; )
      r *= t, r += a, n.popToken();
  }
  return "\\@char{" + r + "}";
});
var Xl = (n, e, t, r) => {
  var a = n.consumeArg().tokens;
  if (a.length !== 1)
    throw new V("\\newcommand's first argument must be a macro name");
  var i = a[0].text, l = n.isDefined(i);
  if (l && !e)
    throw new V("\\newcommand{" + i + "} attempting to redefine " + (i + "; use \\renewcommand"));
  if (!l && !t)
    throw new V("\\renewcommand{" + i + "} when command " + i + " does not yet exist; use \\newcommand");
  var s = 0;
  if (a = n.consumeArg().tokens, a.length === 1 && a[0].text === "[") {
    for (var o = "", u = n.expandNextToken(); u.text !== "]" && u.text !== "EOF"; )
      o += u.text, u = n.expandNextToken();
    if (!o.match(/^\s*[0-9]+\s*$/))
      throw new V("Invalid number of arguments: " + o);
    s = parseInt(o), a = n.consumeArg().tokens;
  }
  return l && r || n.macros.set(i, {
    tokens: a,
    numArgs: s
  }), "";
};
_("\\newcommand", (n) => Xl(n, !1, !0, !1));
_("\\renewcommand", (n) => Xl(n, !0, !1, !1));
_("\\providecommand", (n) => Xl(n, !0, !0, !0));
_("\\message", (n) => {
  var e = n.consumeArgs(1)[0];
  return console.log(e.reverse().map((t) => t.text).join("")), "";
});
_("\\errmessage", (n) => {
  var e = n.consumeArgs(1)[0];
  return console.error(e.reverse().map((t) => t.text).join("")), "";
});
_("\\show", (n) => {
  var e = n.popToken(), t = e.text;
  return console.log(e, n.macros.get(t), pr[t], He.math[t], He.text[t]), "";
});
_("\\bgroup", "{");
_("\\egroup", "}");
_("~", "\\nobreakspace");
_("\\lq", "`");
_("\\rq", "'");
_("\\aa", "\\r a");
_("\\AA", "\\r A");
_("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
_("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
_("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
_("ℬ", "\\mathscr{B}");
_("ℰ", "\\mathscr{E}");
_("ℱ", "\\mathscr{F}");
_("ℋ", "\\mathscr{H}");
_("ℐ", "\\mathscr{I}");
_("ℒ", "\\mathscr{L}");
_("ℳ", "\\mathscr{M}");
_("ℛ", "\\mathscr{R}");
_("ℭ", "\\mathfrak{C}");
_("ℌ", "\\mathfrak{H}");
_("ℨ", "\\mathfrak{Z}");
_("\\Bbbk", "\\Bbb{k}");
_("·", "\\cdotp");
_("\\llap", "\\mathllap{\\textrm{#1}}");
_("\\rlap", "\\mathrlap{\\textrm{#1}}");
_("\\clap", "\\mathclap{\\textrm{#1}}");
_("\\mathstrut", "\\vphantom{(}");
_("\\underbar", "\\underline{\\text{#1}}");
_("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
_("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
_("\\ne", "\\neq");
_("≠", "\\neq");
_("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
_("∉", "\\notin");
_("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
_("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
_("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
_("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
_("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
_("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
_("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
_("⟂", "\\perp");
_("‼", "\\mathclose{!\\mkern-0.8mu!}");
_("∌", "\\notni");
_("⌜", "\\ulcorner");
_("⌝", "\\urcorner");
_("⌞", "\\llcorner");
_("⌟", "\\lrcorner");
_("©", "\\copyright");
_("®", "\\textregistered");
_("️", "\\textregistered");
_("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
_("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
_("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
_("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
_("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
_("⋮", "\\vdots");
_("\\varGamma", "\\mathit{\\Gamma}");
_("\\varDelta", "\\mathit{\\Delta}");
_("\\varTheta", "\\mathit{\\Theta}");
_("\\varLambda", "\\mathit{\\Lambda}");
_("\\varXi", "\\mathit{\\Xi}");
_("\\varPi", "\\mathit{\\Pi}");
_("\\varSigma", "\\mathit{\\Sigma}");
_("\\varUpsilon", "\\mathit{\\Upsilon}");
_("\\varPhi", "\\mathit{\\Phi}");
_("\\varPsi", "\\mathit{\\Psi}");
_("\\varOmega", "\\mathit{\\Omega}");
_("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
_("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
_("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
_("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
_("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
_("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
_("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
_("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
var co = {
  ",": "\\dotsc",
  "\\not": "\\dotsb",
  // \keybin@ checks for the following:
  "+": "\\dotsb",
  "=": "\\dotsb",
  "<": "\\dotsb",
  ">": "\\dotsb",
  "-": "\\dotsb",
  "*": "\\dotsb",
  ":": "\\dotsb",
  // Symbols whose definition starts with \DOTSB:
  "\\DOTSB": "\\dotsb",
  "\\coprod": "\\dotsb",
  "\\bigvee": "\\dotsb",
  "\\bigwedge": "\\dotsb",
  "\\biguplus": "\\dotsb",
  "\\bigcap": "\\dotsb",
  "\\bigcup": "\\dotsb",
  "\\prod": "\\dotsb",
  "\\sum": "\\dotsb",
  "\\bigotimes": "\\dotsb",
  "\\bigoplus": "\\dotsb",
  "\\bigodot": "\\dotsb",
  "\\bigsqcup": "\\dotsb",
  "\\And": "\\dotsb",
  "\\longrightarrow": "\\dotsb",
  "\\Longrightarrow": "\\dotsb",
  "\\longleftarrow": "\\dotsb",
  "\\Longleftarrow": "\\dotsb",
  "\\longleftrightarrow": "\\dotsb",
  "\\Longleftrightarrow": "\\dotsb",
  "\\mapsto": "\\dotsb",
  "\\longmapsto": "\\dotsb",
  "\\hookrightarrow": "\\dotsb",
  "\\doteq": "\\dotsb",
  // Symbols whose definition starts with \mathbin:
  "\\mathbin": "\\dotsb",
  // Symbols whose definition starts with \mathrel:
  "\\mathrel": "\\dotsb",
  "\\relbar": "\\dotsb",
  "\\Relbar": "\\dotsb",
  "\\xrightarrow": "\\dotsb",
  "\\xleftarrow": "\\dotsb",
  // Symbols whose definition starts with \DOTSI:
  "\\DOTSI": "\\dotsi",
  "\\int": "\\dotsi",
  "\\oint": "\\dotsi",
  "\\iint": "\\dotsi",
  "\\iiint": "\\dotsi",
  "\\iiiint": "\\dotsi",
  "\\idotsint": "\\dotsi",
  // Symbols whose definition starts with \DOTSX:
  "\\DOTSX": "\\dotsx"
};
_("\\dots", function(n) {
  var e = "\\dotso", t = n.expandAfterFuture().text;
  return t in co ? e = co[t] : (t.slice(0, 4) === "\\not" || t in He.math && le.contains(["bin", "rel"], He.math[t].group)) && (e = "\\dotsb"), e;
});
var Zl = {
  // \rightdelim@ checks for the following:
  ")": !0,
  "]": !0,
  "\\rbrack": !0,
  "\\}": !0,
  "\\rbrace": !0,
  "\\rangle": !0,
  "\\rceil": !0,
  "\\rfloor": !0,
  "\\rgroup": !0,
  "\\rmoustache": !0,
  "\\right": !0,
  "\\bigr": !0,
  "\\biggr": !0,
  "\\Bigr": !0,
  "\\Biggr": !0,
  // \extra@ also tests for the following:
  $: !0,
  // \extrap@ checks for the following:
  ";": !0,
  ".": !0,
  ",": !0
};
_("\\dotso", function(n) {
  var e = n.future().text;
  return e in Zl ? "\\ldots\\," : "\\ldots";
});
_("\\dotsc", function(n) {
  var e = n.future().text;
  return e in Zl && e !== "," ? "\\ldots\\," : "\\ldots";
});
_("\\cdots", function(n) {
  var e = n.future().text;
  return e in Zl ? "\\@cdots\\," : "\\@cdots";
});
_("\\dotsb", "\\cdots");
_("\\dotsm", "\\cdots");
_("\\dotsi", "\\!\\cdots");
_("\\dotsx", "\\ldots\\,");
_("\\DOTSI", "\\relax");
_("\\DOTSB", "\\relax");
_("\\DOTSX", "\\relax");
_("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
_("\\,", "\\tmspace+{3mu}{.1667em}");
_("\\thinspace", "\\,");
_("\\>", "\\mskip{4mu}");
_("\\:", "\\tmspace+{4mu}{.2222em}");
_("\\medspace", "\\:");
_("\\;", "\\tmspace+{5mu}{.2777em}");
_("\\thickspace", "\\;");
_("\\!", "\\tmspace-{3mu}{.1667em}");
_("\\negthinspace", "\\!");
_("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
_("\\negthickspace", "\\tmspace-{5mu}{.277em}");
_("\\enspace", "\\kern.5em ");
_("\\enskip", "\\hskip.5em\\relax");
_("\\quad", "\\hskip1em\\relax");
_("\\qquad", "\\hskip2em\\relax");
_("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
_("\\tag@paren", "\\tag@literal{({#1})}");
_("\\tag@literal", (n) => {
  if (n.macros.get("\\df@tag"))
    throw new V("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
_("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
_("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
_("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
_("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
_("\\newline", "\\\\\\relax");
_("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var lc = Y(T0["Main-Regular"][84][1] - 0.7 * T0["Main-Regular"][65][1]);
_("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + lc + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
_("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + lc + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
_("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
_("\\@hspace", "\\hskip #1\\relax");
_("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
_("\\ordinarycolon", ":");
_("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
_("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
_("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
_("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
_("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
_("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
_("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
_("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
_("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
_("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
_("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
_("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
_("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
_("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
_("∷", "\\dblcolon");
_("∹", "\\eqcolon");
_("≔", "\\coloneqq");
_("≕", "\\eqqcolon");
_("⩴", "\\Coloneqq");
_("\\ratio", "\\vcentcolon");
_("\\coloncolon", "\\dblcolon");
_("\\colonequals", "\\coloneqq");
_("\\coloncolonequals", "\\Coloneqq");
_("\\equalscolon", "\\eqqcolon");
_("\\equalscoloncolon", "\\Eqqcolon");
_("\\colonminus", "\\coloneq");
_("\\coloncolonminus", "\\Coloneq");
_("\\minuscolon", "\\eqcolon");
_("\\minuscoloncolon", "\\Eqcolon");
_("\\coloncolonapprox", "\\Colonapprox");
_("\\coloncolonsim", "\\Colonsim");
_("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
_("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
_("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
_("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
_("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
_("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
_("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
_("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
_("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
_("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
_("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
_("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
_("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
_("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
_("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
_("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
_("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
_("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
_("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
_("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
_("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
_("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
_("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
_("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
_("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
_("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
_("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
_("\\imath", "\\html@mathml{\\@imath}{ı}");
_("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
_("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
_("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
_("⟦", "\\llbracket");
_("⟧", "\\rrbracket");
_("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
_("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
_("⦃", "\\lBrace");
_("⦄", "\\rBrace");
_("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
_("⦵", "\\minuso");
_("\\darr", "\\downarrow");
_("\\dArr", "\\Downarrow");
_("\\Darr", "\\Downarrow");
_("\\lang", "\\langle");
_("\\rang", "\\rangle");
_("\\uarr", "\\uparrow");
_("\\uArr", "\\Uparrow");
_("\\Uarr", "\\Uparrow");
_("\\N", "\\mathbb{N}");
_("\\R", "\\mathbb{R}");
_("\\Z", "\\mathbb{Z}");
_("\\alef", "\\aleph");
_("\\alefsym", "\\aleph");
_("\\Alpha", "\\mathrm{A}");
_("\\Beta", "\\mathrm{B}");
_("\\bull", "\\bullet");
_("\\Chi", "\\mathrm{X}");
_("\\clubs", "\\clubsuit");
_("\\cnums", "\\mathbb{C}");
_("\\Complex", "\\mathbb{C}");
_("\\Dagger", "\\ddagger");
_("\\diamonds", "\\diamondsuit");
_("\\empty", "\\emptyset");
_("\\Epsilon", "\\mathrm{E}");
_("\\Eta", "\\mathrm{H}");
_("\\exist", "\\exists");
_("\\harr", "\\leftrightarrow");
_("\\hArr", "\\Leftrightarrow");
_("\\Harr", "\\Leftrightarrow");
_("\\hearts", "\\heartsuit");
_("\\image", "\\Im");
_("\\infin", "\\infty");
_("\\Iota", "\\mathrm{I}");
_("\\isin", "\\in");
_("\\Kappa", "\\mathrm{K}");
_("\\larr", "\\leftarrow");
_("\\lArr", "\\Leftarrow");
_("\\Larr", "\\Leftarrow");
_("\\lrarr", "\\leftrightarrow");
_("\\lrArr", "\\Leftrightarrow");
_("\\Lrarr", "\\Leftrightarrow");
_("\\Mu", "\\mathrm{M}");
_("\\natnums", "\\mathbb{N}");
_("\\Nu", "\\mathrm{N}");
_("\\Omicron", "\\mathrm{O}");
_("\\plusmn", "\\pm");
_("\\rarr", "\\rightarrow");
_("\\rArr", "\\Rightarrow");
_("\\Rarr", "\\Rightarrow");
_("\\real", "\\Re");
_("\\reals", "\\mathbb{R}");
_("\\Reals", "\\mathbb{R}");
_("\\Rho", "\\mathrm{P}");
_("\\sdot", "\\cdot");
_("\\sect", "\\S");
_("\\spades", "\\spadesuit");
_("\\sub", "\\subset");
_("\\sube", "\\subseteq");
_("\\supe", "\\supseteq");
_("\\Tau", "\\mathrm{T}");
_("\\thetasym", "\\vartheta");
_("\\weierp", "\\wp");
_("\\Zeta", "\\mathrm{Z}");
_("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
_("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
_("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
_("\\bra", "\\mathinner{\\langle{#1}|}");
_("\\ket", "\\mathinner{|{#1}\\rangle}");
_("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
_("\\Bra", "\\left\\langle#1\\right|");
_("\\Ket", "\\left|#1\\right\\rangle");
var sc = (n) => (e) => {
  var t = e.consumeArg().tokens, r = e.consumeArg().tokens, a = e.consumeArg().tokens, i = e.consumeArg().tokens, l = e.macros.get("|"), s = e.macros.get("\\|");
  e.macros.beginGroup();
  var o = (f) => (p) => {
    n && (p.macros.set("|", l), a.length && p.macros.set("\\|", s));
    var g = f;
    if (!f && a.length) {
      var w = p.future();
      w.text === "|" && (p.popToken(), g = !0);
    }
    return {
      tokens: g ? a : r,
      numArgs: 0
    };
  };
  e.macros.set("|", o(!1)), a.length && e.macros.set("\\|", o(!0));
  var u = e.consumeArg().tokens, h = e.expandTokens([
    ...i,
    ...u,
    ...t
    // reversed
  ]);
  return e.macros.endGroup(), {
    tokens: h.reverse(),
    numArgs: 0
  };
};
_("\\bra@ket", sc(!1));
_("\\bra@set", sc(!0));
_("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
_("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
_("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
_("\\angln", "{\\angl n}");
_("\\blue", "\\textcolor{##6495ed}{#1}");
_("\\orange", "\\textcolor{##ffa500}{#1}");
_("\\pink", "\\textcolor{##ff00af}{#1}");
_("\\red", "\\textcolor{##df0030}{#1}");
_("\\green", "\\textcolor{##28ae7b}{#1}");
_("\\gray", "\\textcolor{gray}{#1}");
_("\\purple", "\\textcolor{##9d38bd}{#1}");
_("\\blueA", "\\textcolor{##ccfaff}{#1}");
_("\\blueB", "\\textcolor{##80f6ff}{#1}");
_("\\blueC", "\\textcolor{##63d9ea}{#1}");
_("\\blueD", "\\textcolor{##11accd}{#1}");
_("\\blueE", "\\textcolor{##0c7f99}{#1}");
_("\\tealA", "\\textcolor{##94fff5}{#1}");
_("\\tealB", "\\textcolor{##26edd5}{#1}");
_("\\tealC", "\\textcolor{##01d1c1}{#1}");
_("\\tealD", "\\textcolor{##01a995}{#1}");
_("\\tealE", "\\textcolor{##208170}{#1}");
_("\\greenA", "\\textcolor{##b6ffb0}{#1}");
_("\\greenB", "\\textcolor{##8af281}{#1}");
_("\\greenC", "\\textcolor{##74cf70}{#1}");
_("\\greenD", "\\textcolor{##1fab54}{#1}");
_("\\greenE", "\\textcolor{##0d923f}{#1}");
_("\\goldA", "\\textcolor{##ffd0a9}{#1}");
_("\\goldB", "\\textcolor{##ffbb71}{#1}");
_("\\goldC", "\\textcolor{##ff9c39}{#1}");
_("\\goldD", "\\textcolor{##e07d10}{#1}");
_("\\goldE", "\\textcolor{##a75a05}{#1}");
_("\\redA", "\\textcolor{##fca9a9}{#1}");
_("\\redB", "\\textcolor{##ff8482}{#1}");
_("\\redC", "\\textcolor{##f9685d}{#1}");
_("\\redD", "\\textcolor{##e84d39}{#1}");
_("\\redE", "\\textcolor{##bc2612}{#1}");
_("\\maroonA", "\\textcolor{##ffbde0}{#1}");
_("\\maroonB", "\\textcolor{##ff92c6}{#1}");
_("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
_("\\maroonD", "\\textcolor{##ca337c}{#1}");
_("\\maroonE", "\\textcolor{##9e034e}{#1}");
_("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
_("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
_("\\purpleC", "\\textcolor{##aa87ff}{#1}");
_("\\purpleD", "\\textcolor{##7854ab}{#1}");
_("\\purpleE", "\\textcolor{##543b78}{#1}");
_("\\mintA", "\\textcolor{##f5f9e8}{#1}");
_("\\mintB", "\\textcolor{##edf2df}{#1}");
_("\\mintC", "\\textcolor{##e0e5cc}{#1}");
_("\\grayA", "\\textcolor{##f6f7f7}{#1}");
_("\\grayB", "\\textcolor{##f0f1f2}{#1}");
_("\\grayC", "\\textcolor{##e3e5e6}{#1}");
_("\\grayD", "\\textcolor{##d6d8da}{#1}");
_("\\grayE", "\\textcolor{##babec2}{#1}");
_("\\grayF", "\\textcolor{##888d93}{#1}");
_("\\grayG", "\\textcolor{##626569}{#1}");
_("\\grayH", "\\textcolor{##3b3e40}{#1}");
_("\\grayI", "\\textcolor{##21242c}{#1}");
_("\\kaBlue", "\\textcolor{##314453}{#1}");
_("\\kaGreen", "\\textcolor{##71B307}{#1}");
var oc = {
  "^": !0,
  // Parser.js
  _: !0,
  // Parser.js
  "\\limits": !0,
  // Parser.js
  "\\nolimits": !0
  // Parser.js
};
class Gf {
  constructor(e, t, r) {
    this.settings = void 0, this.expansionCount = void 0, this.lexer = void 0, this.macros = void 0, this.stack = void 0, this.mode = void 0, this.settings = t, this.expansionCount = 0, this.feed(e), this.macros = new Hf(Uf, t.macros), this.mode = r, this.stack = [];
  }
  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(e) {
    this.lexer = new oo(e, this.settings);
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e;
  }
  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }
  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }
  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    return this.stack.length === 0 && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1];
  }
  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    return this.future(), this.stack.pop();
  }
  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(e) {
    this.stack.push(e);
  }
  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(e) {
    this.stack.push(...e);
  }
  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(e) {
    var t, r, a;
    if (e) {
      if (this.consumeSpaces(), this.future().text !== "[")
        return null;
      t = this.popToken(), {
        tokens: a,
        end: r
      } = this.consumeArg(["]"]);
    } else
      ({
        tokens: a,
        start: t,
        end: r
      } = this.consumeArg());
    return this.pushToken(new l0("EOF", r.loc)), this.pushTokens(a), t.range(r, "");
  }
  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (; ; ) {
      var e = this.future();
      if (e.text === " ")
        this.stack.pop();
      else
        break;
    }
  }
  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(e) {
    var t = [], r = e && e.length > 0;
    r || this.consumeSpaces();
    var a = this.future(), i, l = 0, s = 0;
    do {
      if (i = this.popToken(), t.push(i), i.text === "{")
        ++l;
      else if (i.text === "}") {
        if (--l, l === -1)
          throw new V("Extra }", i);
      } else if (i.text === "EOF")
        throw new V("Unexpected end of input in a macro argument, expected '" + (e && r ? e[s] : "}") + "'", i);
      if (e && r)
        if ((l === 0 || l === 1 && e[s] === "{") && i.text === e[s]) {
          if (++s, s === e.length) {
            t.splice(-s, s);
            break;
          }
        } else
          s = 0;
    } while (l !== 0 || r);
    return a.text === "{" && t[t.length - 1].text === "}" && (t.pop(), t.shift()), t.reverse(), {
      tokens: t,
      start: a,
      end: i
    };
  }
  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(e, t) {
    if (t) {
      if (t.length !== e + 1)
        throw new V("The length of delimiters doesn't match the number of args!");
      for (var r = t[0], a = 0; a < r.length; a++) {
        var i = this.popToken();
        if (r[a] !== i.text)
          throw new V("Use of the macro doesn't match its definition", i);
      }
    }
    for (var l = [], s = 0; s < e; s++)
      l.push(this.consumeArg(t && t[s + 1]).tokens);
    return l;
  }
  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(e) {
    if (this.expansionCount += e, this.expansionCount > this.settings.maxExpand)
      throw new V("Too many expansions: infinite loop or need to increase maxExpand setting");
  }
  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(e) {
    var t = this.popToken(), r = t.text, a = t.noexpand ? null : this._getExpansion(r);
    if (a == null || e && a.unexpandable) {
      if (e && a == null && r[0] === "\\" && !this.isDefined(r))
        throw new V("Undefined control sequence: " + r);
      return this.pushToken(t), !1;
    }
    this.countExpansion(1);
    var i = a.tokens, l = this.consumeArgs(a.numArgs, a.delimiters);
    if (a.numArgs) {
      i = i.slice();
      for (var s = i.length - 1; s >= 0; --s) {
        var o = i[s];
        if (o.text === "#") {
          if (s === 0)
            throw new V("Incomplete placeholder at end of macro body", o);
          if (o = i[--s], o.text === "#")
            i.splice(s + 1, 1);
          else if (/^[1-9]$/.test(o.text))
            i.splice(s, 2, ...l[+o.text - 1]);
          else
            throw new V("Not a valid argument number", o);
        }
      }
    }
    return this.pushTokens(i), i.length;
  }
  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    return this.expandOnce(), this.future();
  }
  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (; ; )
      if (this.expandOnce() === !1) {
        var e = this.stack.pop();
        return e.treatAsRelax && (e.text = "\\relax"), e;
      }
    throw new Error();
  }
  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(e) {
    return this.macros.has(e) ? this.expandTokens([new l0(e)]) : void 0;
  }
  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(e) {
    var t = [], r = this.stack.length;
    for (this.pushTokens(e); this.stack.length > r; )
      if (this.expandOnce(!0) === !1) {
        var a = this.stack.pop();
        a.treatAsRelax && (a.noexpand = !1, a.treatAsRelax = !1), t.push(a);
      }
    return this.countExpansion(t.length), t;
  }
  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(e) {
    var t = this.expandMacro(e);
    return t && t.map((r) => r.text).join("");
  }
  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(e) {
    var t = this.macros.get(e);
    if (t == null)
      return t;
    if (e.length === 1) {
      var r = this.lexer.catcodes[e];
      if (r != null && r !== 13)
        return;
    }
    var a = typeof t == "function" ? t(this) : t;
    if (typeof a == "string") {
      var i = 0;
      if (a.indexOf("#") !== -1)
        for (var l = a.replace(/##/g, ""); l.indexOf("#" + (i + 1)) !== -1; )
          ++i;
      for (var s = new oo(a, this.settings), o = [], u = s.lex(); u.text !== "EOF"; )
        o.push(u), u = s.lex();
      o.reverse();
      var h = {
        tokens: o,
        numArgs: i
      };
      return h;
    }
    return a;
  }
  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(e) {
    return this.macros.has(e) || pr.hasOwnProperty(e) || He.math.hasOwnProperty(e) || He.text.hasOwnProperty(e) || oc.hasOwnProperty(e);
  }
  /**
   * Determine whether a command is expandable.
   */
  isExpandable(e) {
    var t = this.macros.get(e);
    return t != null ? typeof t == "string" || typeof t == "function" || !t.unexpandable : pr.hasOwnProperty(e) && !pr[e].primitive;
  }
}
var ho = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, ta = Object.freeze({
  "₊": "+",
  "₋": "-",
  "₌": "=",
  "₍": "(",
  "₎": ")",
  "₀": "0",
  "₁": "1",
  "₂": "2",
  "₃": "3",
  "₄": "4",
  "₅": "5",
  "₆": "6",
  "₇": "7",
  "₈": "8",
  "₉": "9",
  "ₐ": "a",
  "ₑ": "e",
  "ₕ": "h",
  "ᵢ": "i",
  "ⱼ": "j",
  "ₖ": "k",
  "ₗ": "l",
  "ₘ": "m",
  "ₙ": "n",
  "ₒ": "o",
  "ₚ": "p",
  "ᵣ": "r",
  "ₛ": "s",
  "ₜ": "t",
  "ᵤ": "u",
  "ᵥ": "v",
  "ₓ": "x",
  "ᵦ": "β",
  "ᵧ": "γ",
  "ᵨ": "ρ",
  "ᵩ": "ϕ",
  "ᵪ": "χ",
  "⁺": "+",
  "⁻": "-",
  "⁼": "=",
  "⁽": "(",
  "⁾": ")",
  "⁰": "0",
  "¹": "1",
  "²": "2",
  "³": "3",
  "⁴": "4",
  "⁵": "5",
  "⁶": "6",
  "⁷": "7",
  "⁸": "8",
  "⁹": "9",
  "ᴬ": "A",
  "ᴮ": "B",
  "ᴰ": "D",
  "ᴱ": "E",
  "ᴳ": "G",
  "ᴴ": "H",
  "ᴵ": "I",
  "ᴶ": "J",
  "ᴷ": "K",
  "ᴸ": "L",
  "ᴹ": "M",
  "ᴺ": "N",
  "ᴼ": "O",
  "ᴾ": "P",
  "ᴿ": "R",
  "ᵀ": "T",
  "ᵁ": "U",
  "ⱽ": "V",
  "ᵂ": "W",
  "ᵃ": "a",
  "ᵇ": "b",
  "ᶜ": "c",
  "ᵈ": "d",
  "ᵉ": "e",
  "ᶠ": "f",
  "ᵍ": "g",
  ʰ: "h",
  "ⁱ": "i",
  ʲ: "j",
  "ᵏ": "k",
  ˡ: "l",
  "ᵐ": "m",
  ⁿ: "n",
  "ᵒ": "o",
  "ᵖ": "p",
  ʳ: "r",
  ˢ: "s",
  "ᵗ": "t",
  "ᵘ": "u",
  "ᵛ": "v",
  ʷ: "w",
  ˣ: "x",
  ʸ: "y",
  "ᶻ": "z",
  "ᵝ": "β",
  "ᵞ": "γ",
  "ᵟ": "δ",
  "ᵠ": "ϕ",
  "ᵡ": "χ",
  "ᶿ": "θ"
}), Ti = {
  "́": {
    text: "\\'",
    math: "\\acute"
  },
  "̀": {
    text: "\\`",
    math: "\\grave"
  },
  "̈": {
    text: '\\"',
    math: "\\ddot"
  },
  "̃": {
    text: "\\~",
    math: "\\tilde"
  },
  "̄": {
    text: "\\=",
    math: "\\bar"
  },
  "̆": {
    text: "\\u",
    math: "\\breve"
  },
  "̌": {
    text: "\\v",
    math: "\\check"
  },
  "̂": {
    text: "\\^",
    math: "\\hat"
  },
  "̇": {
    text: "\\.",
    math: "\\dot"
  },
  "̊": {
    text: "\\r",
    math: "\\mathring"
  },
  "̋": {
    text: "\\H"
  },
  "̧": {
    text: "\\c"
  }
}, fo = {
  á: "á",
  à: "à",
  ä: "ä",
  ǟ: "ǟ",
  ã: "ã",
  ā: "ā",
  ă: "ă",
  ắ: "ắ",
  ằ: "ằ",
  ẵ: "ẵ",
  ǎ: "ǎ",
  â: "â",
  ấ: "ấ",
  ầ: "ầ",
  ẫ: "ẫ",
  ȧ: "ȧ",
  ǡ: "ǡ",
  å: "å",
  ǻ: "ǻ",
  ḃ: "ḃ",
  ć: "ć",
  ḉ: "ḉ",
  č: "č",
  ĉ: "ĉ",
  ċ: "ċ",
  ç: "ç",
  ď: "ď",
  ḋ: "ḋ",
  ḑ: "ḑ",
  é: "é",
  è: "è",
  ë: "ë",
  ẽ: "ẽ",
  ē: "ē",
  ḗ: "ḗ",
  ḕ: "ḕ",
  ĕ: "ĕ",
  ḝ: "ḝ",
  ě: "ě",
  ê: "ê",
  ế: "ế",
  ề: "ề",
  ễ: "ễ",
  ė: "ė",
  ȩ: "ȩ",
  ḟ: "ḟ",
  ǵ: "ǵ",
  ḡ: "ḡ",
  ğ: "ğ",
  ǧ: "ǧ",
  ĝ: "ĝ",
  ġ: "ġ",
  ģ: "ģ",
  ḧ: "ḧ",
  ȟ: "ȟ",
  ĥ: "ĥ",
  ḣ: "ḣ",
  ḩ: "ḩ",
  í: "í",
  ì: "ì",
  ï: "ï",
  ḯ: "ḯ",
  ĩ: "ĩ",
  ī: "ī",
  ĭ: "ĭ",
  ǐ: "ǐ",
  î: "î",
  ǰ: "ǰ",
  ĵ: "ĵ",
  ḱ: "ḱ",
  ǩ: "ǩ",
  ķ: "ķ",
  ĺ: "ĺ",
  ľ: "ľ",
  ļ: "ļ",
  ḿ: "ḿ",
  ṁ: "ṁ",
  ń: "ń",
  ǹ: "ǹ",
  ñ: "ñ",
  ň: "ň",
  ṅ: "ṅ",
  ņ: "ņ",
  ó: "ó",
  ò: "ò",
  ö: "ö",
  ȫ: "ȫ",
  õ: "õ",
  ṍ: "ṍ",
  ṏ: "ṏ",
  ȭ: "ȭ",
  ō: "ō",
  ṓ: "ṓ",
  ṑ: "ṑ",
  ŏ: "ŏ",
  ǒ: "ǒ",
  ô: "ô",
  ố: "ố",
  ồ: "ồ",
  ỗ: "ỗ",
  ȯ: "ȯ",
  ȱ: "ȱ",
  ő: "ő",
  ṕ: "ṕ",
  ṗ: "ṗ",
  ŕ: "ŕ",
  ř: "ř",
  ṙ: "ṙ",
  ŗ: "ŗ",
  ś: "ś",
  ṥ: "ṥ",
  š: "š",
  ṧ: "ṧ",
  ŝ: "ŝ",
  ṡ: "ṡ",
  ş: "ş",
  ẗ: "ẗ",
  ť: "ť",
  ṫ: "ṫ",
  ţ: "ţ",
  ú: "ú",
  ù: "ù",
  ü: "ü",
  ǘ: "ǘ",
  ǜ: "ǜ",
  ǖ: "ǖ",
  ǚ: "ǚ",
  ũ: "ũ",
  ṹ: "ṹ",
  ū: "ū",
  ṻ: "ṻ",
  ŭ: "ŭ",
  ǔ: "ǔ",
  û: "û",
  ů: "ů",
  ű: "ű",
  ṽ: "ṽ",
  ẃ: "ẃ",
  ẁ: "ẁ",
  ẅ: "ẅ",
  ŵ: "ŵ",
  ẇ: "ẇ",
  ẘ: "ẘ",
  ẍ: "ẍ",
  ẋ: "ẋ",
  ý: "ý",
  ỳ: "ỳ",
  ÿ: "ÿ",
  ỹ: "ỹ",
  ȳ: "ȳ",
  ŷ: "ŷ",
  ẏ: "ẏ",
  ẙ: "ẙ",
  ź: "ź",
  ž: "ž",
  ẑ: "ẑ",
  ż: "ż",
  Á: "Á",
  À: "À",
  Ä: "Ä",
  Ǟ: "Ǟ",
  Ã: "Ã",
  Ā: "Ā",
  Ă: "Ă",
  Ắ: "Ắ",
  Ằ: "Ằ",
  Ẵ: "Ẵ",
  Ǎ: "Ǎ",
  Â: "Â",
  Ấ: "Ấ",
  Ầ: "Ầ",
  Ẫ: "Ẫ",
  Ȧ: "Ȧ",
  Ǡ: "Ǡ",
  Å: "Å",
  Ǻ: "Ǻ",
  Ḃ: "Ḃ",
  Ć: "Ć",
  Ḉ: "Ḉ",
  Č: "Č",
  Ĉ: "Ĉ",
  Ċ: "Ċ",
  Ç: "Ç",
  Ď: "Ď",
  Ḋ: "Ḋ",
  Ḑ: "Ḑ",
  É: "É",
  È: "È",
  Ë: "Ë",
  Ẽ: "Ẽ",
  Ē: "Ē",
  Ḗ: "Ḗ",
  Ḕ: "Ḕ",
  Ĕ: "Ĕ",
  Ḝ: "Ḝ",
  Ě: "Ě",
  Ê: "Ê",
  Ế: "Ế",
  Ề: "Ề",
  Ễ: "Ễ",
  Ė: "Ė",
  Ȩ: "Ȩ",
  Ḟ: "Ḟ",
  Ǵ: "Ǵ",
  Ḡ: "Ḡ",
  Ğ: "Ğ",
  Ǧ: "Ǧ",
  Ĝ: "Ĝ",
  Ġ: "Ġ",
  Ģ: "Ģ",
  Ḧ: "Ḧ",
  Ȟ: "Ȟ",
  Ĥ: "Ĥ",
  Ḣ: "Ḣ",
  Ḩ: "Ḩ",
  Í: "Í",
  Ì: "Ì",
  Ï: "Ï",
  Ḯ: "Ḯ",
  Ĩ: "Ĩ",
  Ī: "Ī",
  Ĭ: "Ĭ",
  Ǐ: "Ǐ",
  Î: "Î",
  İ: "İ",
  Ĵ: "Ĵ",
  Ḱ: "Ḱ",
  Ǩ: "Ǩ",
  Ķ: "Ķ",
  Ĺ: "Ĺ",
  Ľ: "Ľ",
  Ļ: "Ļ",
  Ḿ: "Ḿ",
  Ṁ: "Ṁ",
  Ń: "Ń",
  Ǹ: "Ǹ",
  Ñ: "Ñ",
  Ň: "Ň",
  Ṅ: "Ṅ",
  Ņ: "Ņ",
  Ó: "Ó",
  Ò: "Ò",
  Ö: "Ö",
  Ȫ: "Ȫ",
  Õ: "Õ",
  Ṍ: "Ṍ",
  Ṏ: "Ṏ",
  Ȭ: "Ȭ",
  Ō: "Ō",
  Ṓ: "Ṓ",
  Ṑ: "Ṑ",
  Ŏ: "Ŏ",
  Ǒ: "Ǒ",
  Ô: "Ô",
  Ố: "Ố",
  Ồ: "Ồ",
  Ỗ: "Ỗ",
  Ȯ: "Ȯ",
  Ȱ: "Ȱ",
  Ő: "Ő",
  Ṕ: "Ṕ",
  Ṗ: "Ṗ",
  Ŕ: "Ŕ",
  Ř: "Ř",
  Ṙ: "Ṙ",
  Ŗ: "Ŗ",
  Ś: "Ś",
  Ṥ: "Ṥ",
  Š: "Š",
  Ṧ: "Ṧ",
  Ŝ: "Ŝ",
  Ṡ: "Ṡ",
  Ş: "Ş",
  Ť: "Ť",
  Ṫ: "Ṫ",
  Ţ: "Ţ",
  Ú: "Ú",
  Ù: "Ù",
  Ü: "Ü",
  Ǘ: "Ǘ",
  Ǜ: "Ǜ",
  Ǖ: "Ǖ",
  Ǚ: "Ǚ",
  Ũ: "Ũ",
  Ṹ: "Ṹ",
  Ū: "Ū",
  Ṻ: "Ṻ",
  Ŭ: "Ŭ",
  Ǔ: "Ǔ",
  Û: "Û",
  Ů: "Ů",
  Ű: "Ű",
  Ṽ: "Ṽ",
  Ẃ: "Ẃ",
  Ẁ: "Ẁ",
  Ẅ: "Ẅ",
  Ŵ: "Ŵ",
  Ẇ: "Ẇ",
  Ẍ: "Ẍ",
  Ẋ: "Ẋ",
  Ý: "Ý",
  Ỳ: "Ỳ",
  Ÿ: "Ÿ",
  Ỹ: "Ỹ",
  Ȳ: "Ȳ",
  Ŷ: "Ŷ",
  Ẏ: "Ẏ",
  Ź: "Ź",
  Ž: "Ž",
  Ẑ: "Ẑ",
  Ż: "Ż",
  ά: "ά",
  ὰ: "ὰ",
  ᾱ: "ᾱ",
  ᾰ: "ᾰ",
  έ: "έ",
  ὲ: "ὲ",
  ή: "ή",
  ὴ: "ὴ",
  ί: "ί",
  ὶ: "ὶ",
  ϊ: "ϊ",
  ΐ: "ΐ",
  ῒ: "ῒ",
  ῑ: "ῑ",
  ῐ: "ῐ",
  ό: "ό",
  ὸ: "ὸ",
  ύ: "ύ",
  ὺ: "ὺ",
  ϋ: "ϋ",
  ΰ: "ΰ",
  ῢ: "ῢ",
  ῡ: "ῡ",
  ῠ: "ῠ",
  ώ: "ώ",
  ὼ: "ὼ",
  Ύ: "Ύ",
  Ὺ: "Ὺ",
  Ϋ: "Ϋ",
  Ῡ: "Ῡ",
  Ῠ: "Ῠ",
  Ώ: "Ώ",
  Ὼ: "Ὼ"
};
class ti {
  constructor(e, t) {
    this.mode = void 0, this.gullet = void 0, this.settings = void 0, this.leftrightDepth = void 0, this.nextToken = void 0, this.mode = "math", this.gullet = new Gf(e, t, this.mode), this.settings = t, this.leftrightDepth = 0;
  }
  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(e, t) {
    if (t === void 0 && (t = !0), this.fetch().text !== e)
      throw new V("Expected '" + e + "', got '" + this.fetch().text + "'", this.fetch());
    t && this.consume();
  }
  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }
  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    return this.nextToken == null && (this.nextToken = this.gullet.expandNextToken()), this.nextToken;
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e, this.gullet.switchMode(e);
  }
  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    this.settings.globalGroup || this.gullet.beginGroup(), this.settings.colorIsTextColor && this.gullet.macros.set("\\color", "\\textcolor");
    try {
      var e = this.parseExpression(!1);
      return this.expect("EOF"), this.settings.globalGroup || this.gullet.endGroup(), e;
    } finally {
      this.gullet.endGroups();
    }
  }
  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(e) {
    var t = this.nextToken;
    this.consume(), this.gullet.pushToken(new l0("}")), this.gullet.pushTokens(e);
    var r = this.parseExpression(!1);
    return this.expect("}"), this.nextToken = t, r;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence han infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(e, t) {
    for (var r = []; ; ) {
      this.mode === "math" && this.consumeSpaces();
      var a = this.fetch();
      if (ti.endOfExpression.indexOf(a.text) !== -1 || t && a.text === t || e && pr[a.text] && pr[a.text].infix)
        break;
      var i = this.parseAtom(t);
      if (i) {
        if (i.type === "internal")
          continue;
      } else break;
      r.push(i);
    }
    return this.mode === "text" && this.formLigatures(r), this.handleInfixNodes(r);
  }
  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(e) {
    for (var t = -1, r, a = 0; a < e.length; a++)
      if (e[a].type === "infix") {
        if (t !== -1)
          throw new V("only one infix operator per group", e[a].token);
        t = a, r = e[a].replaceWith;
      }
    if (t !== -1 && r) {
      var i, l, s = e.slice(0, t), o = e.slice(t + 1);
      s.length === 1 && s[0].type === "ordgroup" ? i = s[0] : i = {
        type: "ordgroup",
        mode: this.mode,
        body: s
      }, o.length === 1 && o[0].type === "ordgroup" ? l = o[0] : l = {
        type: "ordgroup",
        mode: this.mode,
        body: o
      };
      var u;
      return r === "\\\\abovefrac" ? u = this.callFunction(r, [i, e[t], l], []) : u = this.callFunction(r, [i, l], []), [u];
    } else
      return e;
  }
  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(e) {
    var t = this.fetch(), r = t.text;
    this.consume(), this.consumeSpaces();
    var a;
    do {
      var i;
      a = this.parseGroup(e);
    } while (((i = a) == null ? void 0 : i.type) === "internal");
    if (!a)
      throw new V("Expected group after '" + r + "'", t);
    return a;
  }
  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(e) {
    for (var t = [], r = 0; r < e.length; r++)
      t.push({
        type: "textord",
        mode: "text",
        text: e[r]
      });
    var a = {
      type: "text",
      mode: this.mode,
      body: t
    }, i = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [a]
    };
    return i;
  }
  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(e) {
    var t = this.parseGroup("atom", e);
    if ((t == null ? void 0 : t.type) === "internal" || this.mode === "text")
      return t;
    for (var r, a; ; ) {
      this.consumeSpaces();
      var i = this.fetch();
      if (i.text === "\\limits" || i.text === "\\nolimits") {
        if (t && t.type === "op") {
          var l = i.text === "\\limits";
          t.limits = l, t.alwaysHandleSupSub = !0;
        } else if (t && t.type === "operatorname")
          t.alwaysHandleSupSub && (t.limits = i.text === "\\limits");
        else
          throw new V("Limit controls must follow a math operator", i);
        this.consume();
      } else if (i.text === "^") {
        if (r)
          throw new V("Double superscript", i);
        r = this.handleSupSubscript("superscript");
      } else if (i.text === "_") {
        if (a)
          throw new V("Double subscript", i);
        a = this.handleSupSubscript("subscript");
      } else if (i.text === "'") {
        if (r)
          throw new V("Double superscript", i);
        var s = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        }, o = [s];
        for (this.consume(); this.fetch().text === "'"; )
          o.push(s), this.consume();
        this.fetch().text === "^" && o.push(this.handleSupSubscript("superscript")), r = {
          type: "ordgroup",
          mode: this.mode,
          body: o
        };
      } else if (ta[i.text]) {
        var u = ho.test(i.text), h = [];
        for (h.push(new l0(ta[i.text])), this.consume(); ; ) {
          var f = this.fetch().text;
          if (!ta[f] || ho.test(f) !== u)
            break;
          h.unshift(new l0(ta[f])), this.consume();
        }
        var p = this.subparse(h);
        u ? a = {
          type: "ordgroup",
          mode: "math",
          body: p
        } : r = {
          type: "ordgroup",
          mode: "math",
          body: p
        };
      } else
        break;
    }
    return r || a ? {
      type: "supsub",
      mode: this.mode,
      base: t,
      sup: r,
      sub: a
    } : t;
  }
  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(e, t) {
    var r = this.fetch(), a = r.text, i = pr[a];
    if (!i)
      return null;
    if (this.consume(), t && t !== "atom" && !i.allowedInArgument)
      throw new V("Got function '" + a + "' with no arguments" + (t ? " as " + t : ""), r);
    if (this.mode === "text" && !i.allowedInText)
      throw new V("Can't use function '" + a + "' in text mode", r);
    if (this.mode === "math" && i.allowedInMath === !1)
      throw new V("Can't use function '" + a + "' in math mode", r);
    var {
      args: l,
      optArgs: s
    } = this.parseArguments(a, i);
    return this.callFunction(a, l, s, r, e);
  }
  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(e, t, r, a, i) {
    var l = {
      funcName: e,
      parser: this,
      token: a,
      breakOnTokenText: i
    }, s = pr[e];
    if (s && s.handler)
      return s.handler(l, t, r);
    throw new V("No function handler for " + e);
  }
  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(e, t) {
    var r = t.numArgs + t.numOptionalArgs;
    if (r === 0)
      return {
        args: [],
        optArgs: []
      };
    for (var a = [], i = [], l = 0; l < r; l++) {
      var s = t.argTypes && t.argTypes[l], o = l < t.numOptionalArgs;
      (t.primitive && s == null || // \sqrt expands into primitive if optional argument doesn't exist
      t.type === "sqrt" && l === 1 && i[0] == null) && (s = "primitive");
      var u = this.parseGroupOfType("argument to '" + e + "'", s, o);
      if (o)
        i.push(u);
      else if (u != null)
        a.push(u);
      else
        throw new V("Null argument, please report this as a bug");
    }
    return {
      args: a,
      optArgs: i
    };
  }
  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(e, t, r) {
    switch (t) {
      case "color":
        return this.parseColorGroup(r);
      case "size":
        return this.parseSizeGroup(r);
      case "url":
        return this.parseUrlGroup(r);
      case "math":
      case "text":
        return this.parseArgumentGroup(r, t);
      case "hbox": {
        var a = this.parseArgumentGroup(r, "text");
        return a != null ? {
          type: "styling",
          mode: a.mode,
          body: [a],
          style: "text"
          // simulate \textstyle
        } : null;
      }
      case "raw": {
        var i = this.parseStringGroup("raw", r);
        return i != null ? {
          type: "raw",
          mode: "text",
          string: i.text
        } : null;
      }
      case "primitive": {
        if (r)
          throw new V("A primitive argument cannot be optional");
        var l = this.parseGroup(e);
        if (l == null)
          throw new V("Expected group as " + e, this.fetch());
        return l;
      }
      case "original":
      case null:
      case void 0:
        return this.parseArgumentGroup(r);
      default:
        throw new V("Unknown group type as " + e, this.fetch());
    }
  }
  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    for (; this.fetch().text === " "; )
      this.consume();
  }
  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(e, t) {
    var r = this.gullet.scanArgument(t);
    if (r == null)
      return null;
    for (var a = "", i; (i = this.fetch()).text !== "EOF"; )
      a += i.text, this.consume();
    return this.consume(), r.text = a, r;
  }
  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(e, t) {
    for (var r = this.fetch(), a = r, i = "", l; (l = this.fetch()).text !== "EOF" && e.test(i + l.text); )
      a = l, i += a.text, this.consume();
    if (i === "")
      throw new V("Invalid " + t + ": '" + r.text + "'", r);
    return r.range(a, i);
  }
  /**
   * Parses a color description.
   */
  parseColorGroup(e) {
    var t = this.parseStringGroup("color", e);
    if (t == null)
      return null;
    var r = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);
    if (!r)
      throw new V("Invalid color: '" + t.text + "'", t);
    var a = r[0];
    return /^[0-9a-f]{6}$/i.test(a) && (a = "#" + a), {
      type: "color-token",
      mode: this.mode,
      color: a
    };
  }
  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(e) {
    var t, r = !1;
    if (this.gullet.consumeSpaces(), !e && this.gullet.future().text !== "{" ? t = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size") : t = this.parseStringGroup("size", e), !t)
      return null;
    !e && t.text.length === 0 && (t.text = "0pt", r = !0);
    var a = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);
    if (!a)
      throw new V("Invalid size: '" + t.text + "'", t);
    var i = {
      number: +(a[1] + a[2]),
      // sign + magnitude, cast to number
      unit: a[3]
    };
    if (!v1(i))
      throw new V("Invalid unit: '" + i.unit + "'", t);
    return {
      type: "size",
      mode: this.mode,
      value: i,
      isBlank: r
    };
  }
  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(e) {
    this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12);
    var t = this.parseStringGroup("url", e);
    if (this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), t == null)
      return null;
    var r = t.text.replace(/\\([#$%&~_^{}])/g, "$1");
    return {
      type: "url",
      mode: this.mode,
      url: r
    };
  }
  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(e, t) {
    var r = this.gullet.scanArgument(e);
    if (r == null)
      return null;
    var a = this.mode;
    t && this.switchMode(t), this.gullet.beginGroup();
    var i = this.parseExpression(!1, "EOF");
    this.expect("EOF"), this.gullet.endGroup();
    var l = {
      type: "ordgroup",
      mode: this.mode,
      loc: r.loc,
      body: i
    };
    return t && this.switchMode(a), l;
  }
  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(e, t) {
    var r = this.fetch(), a = r.text, i;
    if (a === "{" || a === "\\begingroup") {
      this.consume();
      var l = a === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      var s = this.parseExpression(!1, l), o = this.fetch();
      this.expect(l), this.gullet.endGroup(), i = {
        type: "ordgroup",
        mode: this.mode,
        loc: Ut.range(r, o),
        body: s,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: a === "\\begingroup" || void 0
      };
    } else if (i = this.parseFunction(t, e) || this.parseSymbol(), i == null && a[0] === "\\" && !oc.hasOwnProperty(a)) {
      if (this.settings.throwOnError)
        throw new V("Undefined control sequence: " + a, r);
      i = this.formatUnsupportedCmd(a), this.consume();
    }
    return i;
  }
  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(e) {
    for (var t = e.length - 1, r = 0; r < t; ++r) {
      var a = e[r], i = a.text;
      i === "-" && e[r + 1].text === "-" && (r + 1 < t && e[r + 2].text === "-" ? (e.splice(r, 3, {
        type: "textord",
        mode: "text",
        loc: Ut.range(a, e[r + 2]),
        text: "---"
      }), t -= 2) : (e.splice(r, 2, {
        type: "textord",
        mode: "text",
        loc: Ut.range(a, e[r + 1]),
        text: "--"
      }), t -= 1)), (i === "'" || i === "`") && e[r + 1].text === i && (e.splice(r, 2, {
        type: "textord",
        mode: "text",
        loc: Ut.range(a, e[r + 1]),
        text: i + i
      }), t -= 1);
    }
  }
  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    var e = this.fetch(), t = e.text;
    if (/^\\verb[^a-zA-Z]/.test(t)) {
      this.consume();
      var r = t.slice(5), a = r.charAt(0) === "*";
      if (a && (r = r.slice(1)), r.length < 2 || r.charAt(0) !== r.slice(-1))
        throw new V(`\\verb assertion failed --
                    please report what input caused this bug`);
      return r = r.slice(1, -1), {
        type: "verb",
        mode: "text",
        body: r,
        star: a
      };
    }
    fo.hasOwnProperty(t[0]) && !He[this.mode][t[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + t[0] + '" used in math mode', e), t = fo[t[0]] + t.slice(1));
    var i = Of.exec(t);
    i && (t = t.substring(0, i.index), t === "i" ? t = "ı" : t === "j" && (t = "ȷ"));
    var l;
    if (He[this.mode][t]) {
      this.settings.strict && this.mode === "math" && dl.indexOf(t) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e);
      var s = He[this.mode][t].group, o = Ut.range(e), u;
      if ($d.hasOwnProperty(s)) {
        var h = s;
        u = {
          type: "atom",
          mode: this.mode,
          family: h,
          loc: o,
          text: t
        };
      } else
        u = {
          type: s,
          mode: this.mode,
          loc: o,
          text: t
        };
      l = u;
    } else if (t.charCodeAt(0) >= 128)
      this.settings.strict && (g1(t.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + t[0] + '"' + (" (" + t.charCodeAt(0) + ")"), e)), l = {
        type: "textord",
        mode: "text",
        loc: Ut.range(e),
        text: t
      };
    else
      return null;
    if (this.consume(), i)
      for (var f = 0; f < i[0].length; f++) {
        var p = i[0][f];
        if (!Ti[p])
          throw new V("Unknown accent ' " + p + "'", e);
        var g = Ti[p][this.mode] || Ti[p].text;
        if (!g)
          throw new V("Accent " + p + " unsupported in " + this.mode + " mode", e);
        l = {
          type: "accent",
          mode: this.mode,
          loc: Ut.range(e),
          label: g,
          isStretchy: !1,
          isShifty: !0,
          // $FlowFixMe
          base: l
        };
      }
    return l;
  }
}
ti.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
var Kl = function(e, t) {
  if (!(typeof e == "string" || e instanceof String))
    throw new TypeError("KaTeX can only parse string typed expression");
  var r = new ti(e, t);
  delete r.gullet.macros.current["\\df@tag"];
  var a = r.parse();
  if (delete r.gullet.macros.current["\\current@color"], delete r.gullet.macros.current["\\color"], r.gullet.macros.get("\\df@tag")) {
    if (!t.displayMode)
      throw new V("\\tag works only in display equations");
    a = [{
      type: "tag",
      mode: "text",
      body: a,
      tag: r.subparse([new l0("\\df@tag")])
    }];
  }
  return a;
}, Ql = function(e, t, r) {
  t.textContent = "";
  var a = ri(e, r).toNode();
  t.appendChild(a);
};
typeof document < "u" && document.compatMode !== "CSS1Compat" && (typeof console < "u" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."), Ql = function() {
  throw new V("KaTeX doesn't work in quirks mode.");
});
var uc = function(e, t) {
  var r = ri(e, t).toMarkup();
  return r;
}, cc = function(e, t) {
  var r = new zl(t);
  return Kl(e, r);
}, hc = function(e, t, r) {
  if (r.throwOnError || !(e instanceof V))
    throw e;
  var a = B.makeSpan(["katex-error"], [new s0(t)]);
  return a.setAttribute("title", e.toString()), a.setAttribute("style", "color:" + r.errorColor), a;
}, ri = function(e, t) {
  var r = new zl(t);
  try {
    var a = Kl(e, r);
    return ef(a, e, r);
  } catch (i) {
    return hc(i, e, r);
  }
}, dc = function(e, t) {
  var r = new zl(t);
  try {
    var a = Kl(e, r);
    return tf(a, e, r);
  } catch (i) {
    return hc(i, e, r);
  }
}, fc = "0.16.22", mc = {
  Span: Ln,
  Anchor: Rl,
  SymbolNode: s0,
  SvgNode: rr,
  PathNode: vr,
  LineNode: hl
}, vl = {
  /**
   * Current KaTeX version
   */
  version: fc,
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render: Ql,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString: uc,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError: V,
  /**
   * The schema of Settings
   */
  SETTINGS_SCHEMA: yn,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: cc,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: ri,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: dc,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: _1,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: c,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: K,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: _,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: These methods are not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree: mc
};
const V7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ParseError: V,
  SETTINGS_SCHEMA: yn,
  __defineFunction: K,
  __defineMacro: _,
  __defineSymbol: c,
  __domTree: mc,
  __parse: cc,
  __renderToDomTree: ri,
  __renderToHTMLTree: dc,
  __setFontMetrics: _1,
  default: vl,
  get render() {
    return Ql;
  },
  renderToString: uc,
  version: fc
}, Symbol.toStringTag, { value: "Module" }));
var Vf = function(e, t, r) {
  for (var a = r, i = 0, l = e.length; a < t.length; ) {
    var s = t[a];
    if (i <= 0 && t.slice(a, a + l) === e)
      return a;
    s === "\\" ? a++ : s === "{" ? i++ : s === "}" && i--, a++;
  }
  return -1;
}, jf = function(e) {
  return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}, Wf = /^\\begin{/, Yf = function(e, t) {
  for (var r, a = [], i = new RegExp("(" + t.map((u) => jf(u.left)).join("|") + ")"); r = e.search(i), r !== -1; ) {
    r > 0 && (a.push({
      type: "text",
      data: e.slice(0, r)
    }), e = e.slice(r));
    var l = t.findIndex((u) => e.startsWith(u.left));
    if (r = Vf(t[l].right, e, t[l].left.length), r === -1)
      break;
    var s = e.slice(0, r + t[l].right.length), o = Wf.test(s) ? s : e.slice(t[l].left.length, r);
    a.push({
      type: "math",
      data: o,
      rawData: s,
      display: t[l].display
    }), e = e.slice(r + t[l].right.length);
  }
  return e !== "" && a.push({
    type: "text",
    data: e
  }), a;
}, Xf = function(e, t) {
  var r = Yf(e, t.delimiters);
  if (r.length === 1 && r[0].type === "text")
    return null;
  for (var a = document.createDocumentFragment(), i = 0; i < r.length; i++)
    if (r[i].type === "text")
      a.appendChild(document.createTextNode(r[i].data));
    else {
      var l = document.createElement("span"), s = r[i].data;
      t.displayMode = r[i].display;
      try {
        t.preProcess && (s = t.preProcess(s)), vl.render(s, l, t);
      } catch (o) {
        if (!(o instanceof vl.ParseError))
          throw o;
        t.errorCallback("KaTeX auto-render: Failed to parse `" + r[i].data + "` with ", o), a.appendChild(document.createTextNode(r[i].rawData));
        continue;
      }
      a.appendChild(l);
    }
  return a;
}, Zf = function n(e, t) {
  for (var r = 0; r < e.childNodes.length; r++) {
    var a = e.childNodes[r];
    if (a.nodeType === 3) {
      for (var i = a.textContent, l = a.nextSibling, s = 0; l && l.nodeType === Node.TEXT_NODE; )
        i += l.textContent, l = l.nextSibling, s++;
      var o = Xf(i, t);
      if (o) {
        for (var u = 0; u < s; u++)
          a.nextSibling.remove();
        r += o.childNodes.length - 1, e.replaceChild(o, a);
      } else
        r += s;
    } else a.nodeType === 1 && function() {
      var h = " " + a.className + " ", f = t.ignoredTags.indexOf(a.nodeName.toLowerCase()) === -1 && t.ignoredClasses.every((p) => h.indexOf(" " + p + " ") === -1);
      f && n(a, t);
    }();
  }
}, Kf = function(e, t) {
  if (!e)
    throw new Error("No element provided to render");
  var r = {};
  for (var a in t)
    t.hasOwnProperty(a) && (r[a] = t[a]);
  r.delimiters = r.delimiters || [
    {
      left: "$$",
      right: "$$",
      display: !0
    },
    {
      left: "\\(",
      right: "\\)",
      display: !1
    },
    // LaTeX uses $…$, but it ruins the display of normal `$` in text:
    // {left: "$", right: "$", display: false},
    // $ must come after $$
    // Render AMS environments even if outside $$…$$ delimiters.
    {
      left: "\\begin{equation}",
      right: "\\end{equation}",
      display: !0
    },
    {
      left: "\\begin{align}",
      right: "\\end{align}",
      display: !0
    },
    {
      left: "\\begin{alignat}",
      right: "\\end{alignat}",
      display: !0
    },
    {
      left: "\\begin{gather}",
      right: "\\end{gather}",
      display: !0
    },
    {
      left: "\\begin{CD}",
      right: "\\end{CD}",
      display: !0
    },
    {
      left: "\\[",
      right: "\\]",
      display: !0
    }
  ], r.ignoredTags = r.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"], r.ignoredClasses = r.ignoredClasses || [], r.errorCallback = r.errorCallback || console.error, r.macros = r.macros || {}, Zf(e, r);
};
function Jl() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let zr = Jl();
function pc(n) {
  zr = n;
}
const gc = /[&<>"']/, Qf = new RegExp(gc.source, "g"), _c = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Jf = new RegExp(_c.source, "g"), em = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, mo = (n) => em[n];
function Gt(n, e) {
  if (e) {
    if (gc.test(n))
      return n.replace(Qf, mo);
  } else if (_c.test(n))
    return n.replace(Jf, mo);
  return n;
}
const tm = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function rm(n) {
  return n.replace(tm, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
}
const nm = /(^|[^\[])\^/g;
function Ne(n, e) {
  let t = typeof n == "string" ? n : n.source;
  e = e || "";
  const r = {
    replace: (a, i) => {
      let l = typeof i == "string" ? i : i.source;
      return l = l.replace(nm, "$1"), t = t.replace(a, l), r;
    },
    getRegex: () => new RegExp(t, e)
  };
  return r;
}
function po(n) {
  try {
    n = encodeURI(n).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return n;
}
const kn = { exec: () => null };
function go(n, e) {
  const t = n.replace(/\|/g, (i, l, s) => {
    let o = !1, u = l;
    for (; --u >= 0 && s[u] === "\\"; )
      o = !o;
    return o ? "|" : " |";
  }), r = t.split(/ \|/);
  let a = 0;
  if (r[0].trim() || r.shift(), r.length > 0 && !r[r.length - 1].trim() && r.pop(), e)
    if (r.length > e)
      r.splice(e);
    else
      for (; r.length < e; )
        r.push("");
  for (; a < r.length; a++)
    r[a] = r[a].trim().replace(/\\\|/g, "|");
  return r;
}
function ra(n, e, t) {
  const r = n.length;
  if (r === 0)
    return "";
  let a = 0;
  for (; a < r && n.charAt(r - a - 1) === e; )
    a++;
  return n.slice(0, r - a);
}
function am(n, e) {
  if (n.indexOf(e[1]) === -1)
    return -1;
  let t = 0;
  for (let r = 0; r < n.length; r++)
    if (n[r] === "\\")
      r++;
    else if (n[r] === e[0])
      t++;
    else if (n[r] === e[1] && (t--, t < 0))
      return r;
  return -1;
}
function _o(n, e, t, r) {
  const a = e.href, i = e.title ? Gt(e.title) : null, l = n[1].replace(/\\([\[\]])/g, "$1");
  if (n[0].charAt(0) !== "!") {
    r.state.inLink = !0;
    const s = {
      type: "link",
      raw: t,
      href: a,
      title: i,
      text: l,
      tokens: r.inlineTokens(l)
    };
    return r.state.inLink = !1, s;
  }
  return {
    type: "image",
    raw: t,
    href: a,
    title: i,
    text: Gt(l)
  };
}
function im(n, e) {
  const t = n.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const r = t[1];
  return e.split(`
`).map((a) => {
    const i = a.match(/^\s+/);
    if (i === null)
      return a;
    const [l] = i;
    return l.length >= r.length ? a.slice(r.length) : a;
  }).join(`
`);
}
class Ua {
  // set by the lexer
  constructor(e) {
    Ue(this, "options");
    Ue(this, "rules");
    // set by the lexer
    Ue(this, "lexer");
    this.options = e || zr;
  }
  space(e) {
    const t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0)
      return {
        type: "space",
        raw: t[0]
      };
  }
  code(e) {
    const t = this.rules.block.code.exec(e);
    if (t) {
      const r = t[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: t[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? r : ra(r, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const r = t[0], a = im(r, t[3] || "");
      return {
        type: "code",
        raw: r,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: a
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let r = t[2].trim();
      if (/#$/.test(r)) {
        const a = ra(r, "#");
        (this.options.pedantic || !a || / $/.test(a)) && (r = a.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: r,
        tokens: this.lexer.inline(r)
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t)
      return {
        type: "hr",
        raw: t[0]
      };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let r = t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`);
      r = ra(r.replace(/^ *>[ \t]?/gm, ""), `
`);
      const a = this.lexer.state.top;
      this.lexer.state.top = !0;
      const i = this.lexer.blockTokens(r);
      return this.lexer.state.top = a, {
        type: "blockquote",
        raw: t[0],
        tokens: i,
        text: r
      };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let r = t[1].trim();
      const a = r.length > 1, i = {
        type: "list",
        raw: "",
        ordered: a,
        start: a ? +r.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      r = a ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = a ? r : "[*+-]");
      const l = new RegExp(`^( {0,3}${r})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let s = "", o = "", u = !1;
      for (; e; ) {
        let h = !1;
        if (!(t = l.exec(e)) || this.rules.block.hr.test(e))
          break;
        s = t[0], e = e.substring(s.length);
        let f = t[2].split(`
`, 1)[0].replace(/^\t+/, (E) => " ".repeat(3 * E.length)), p = e.split(`
`, 1)[0], g = 0;
        this.options.pedantic ? (g = 2, o = f.trimStart()) : (g = t[2].search(/[^ ]/), g = g > 4 ? 1 : g, o = f.slice(g), g += t[1].length);
        let w = !1;
        if (!f && /^ *$/.test(p) && (s += p + `
`, e = e.substring(p.length + 1), h = !0), !h) {
          const E = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), k = new RegExp(`^ {0,${Math.min(3, g - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), b = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:\`\`\`|~~~)`), A = new RegExp(`^ {0,${Math.min(3, g - 1)}}#`);
          for (; e; ) {
            const M = e.split(`
`, 1)[0];
            if (p = M, this.options.pedantic && (p = p.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), b.test(p) || A.test(p) || E.test(p) || k.test(e))
              break;
            if (p.search(/[^ ]/) >= g || !p.trim())
              o += `
` + p.slice(g);
            else {
              if (w || f.search(/[^ ]/) >= 4 || b.test(f) || A.test(f) || k.test(f))
                break;
              o += `
` + p;
            }
            !w && !p.trim() && (w = !0), s += M + `
`, e = e.substring(M.length + 1), f = p.slice(g);
          }
        }
        i.loose || (u ? i.loose = !0 : /\n *\n *$/.test(s) && (u = !0));
        let v = null, y;
        this.options.gfm && (v = /^\[[ xX]\] /.exec(o), v && (y = v[0] !== "[ ] ", o = o.replace(/^\[[ xX]\] +/, ""))), i.items.push({
          type: "list_item",
          raw: s,
          task: !!v,
          checked: y,
          loose: !1,
          text: o,
          tokens: []
        }), i.raw += s;
      }
      i.items[i.items.length - 1].raw = s.trimEnd(), i.items[i.items.length - 1].text = o.trimEnd(), i.raw = i.raw.trimEnd();
      for (let h = 0; h < i.items.length; h++)
        if (this.lexer.state.top = !1, i.items[h].tokens = this.lexer.blockTokens(i.items[h].text, []), !i.loose) {
          const f = i.items[h].tokens.filter((g) => g.type === "space"), p = f.length > 0 && f.some((g) => /\n.*\n/.test(g.raw));
          i.loose = p;
        }
      if (i.loose)
        for (let h = 0; h < i.items.length; h++)
          i.items[h].loose = !0;
      return i;
    }
  }
  html(e) {
    const t = this.rules.block.html.exec(e);
    if (t)
      return {
        type: "html",
        block: !0,
        raw: t[0],
        pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
        text: t[0]
      };
  }
  def(e) {
    const t = this.rules.block.def.exec(e);
    if (t) {
      const r = t[1].toLowerCase().replace(/\s+/g, " "), a = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
      return {
        type: "def",
        tag: r,
        raw: t[0],
        href: a,
        title: i
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const r = go(t[1]), a = t[2].replace(/^\||\| *$/g, "").split("|"), i = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], l = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (r.length === a.length) {
      for (const s of a)
        /^ *-+: *$/.test(s) ? l.align.push("right") : /^ *:-+: *$/.test(s) ? l.align.push("center") : /^ *:-+ *$/.test(s) ? l.align.push("left") : l.align.push(null);
      for (const s of r)
        l.header.push({
          text: s,
          tokens: this.lexer.inline(s)
        });
      for (const s of i)
        l.rows.push(go(s, l.header.length).map((o) => ({
          text: o,
          tokens: this.lexer.inline(o)
        })));
      return l;
    }
  }
  lheading(e) {
    const t = this.rules.block.lheading.exec(e);
    if (t)
      return {
        type: "heading",
        raw: t[0],
        depth: t[2].charAt(0) === "=" ? 1 : 2,
        text: t[1],
        tokens: this.lexer.inline(t[1])
      };
  }
  paragraph(e) {
    const t = this.rules.block.paragraph.exec(e);
    if (t) {
      const r = t[1].charAt(t[1].length - 1) === `
` ? t[1].slice(0, -1) : t[1];
      return {
        type: "paragraph",
        raw: t[0],
        text: r,
        tokens: this.lexer.inline(r)
      };
    }
  }
  text(e) {
    const t = this.rules.block.text.exec(e);
    if (t)
      return {
        type: "text",
        raw: t[0],
        text: t[0],
        tokens: this.lexer.inline(t[0])
      };
  }
  escape(e) {
    const t = this.rules.inline.escape.exec(e);
    if (t)
      return {
        type: "escape",
        raw: t[0],
        text: Gt(t[1])
      };
  }
  tag(e) {
    const t = this.rules.inline.tag.exec(e);
    if (t)
      return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
        type: "html",
        raw: t[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: !1,
        text: t[0]
      };
  }
  link(e) {
    const t = this.rules.inline.link.exec(e);
    if (t) {
      const r = t[2].trim();
      if (!this.options.pedantic && /^</.test(r)) {
        if (!/>$/.test(r))
          return;
        const l = ra(r.slice(0, -1), "\\");
        if ((r.length - l.length) % 2 === 0)
          return;
      } else {
        const l = am(t[2], "()");
        if (l > -1) {
          const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + l;
          t[2] = t[2].substring(0, l), t[0] = t[0].substring(0, o).trim(), t[3] = "";
        }
      }
      let a = t[2], i = "";
      if (this.options.pedantic) {
        const l = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);
        l && (a = l[1], i = l[3]);
      } else
        i = t[3] ? t[3].slice(1, -1) : "";
      return a = a.trim(), /^</.test(a) && (this.options.pedantic && !/>$/.test(r) ? a = a.slice(1) : a = a.slice(1, -1)), _o(t, {
        href: a && a.replace(this.rules.inline.anyPunctuation, "$1"),
        title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
      }, t[0], this.lexer);
    }
  }
  reflink(e, t) {
    let r;
    if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
      const a = (r[2] || r[1]).replace(/\s+/g, " "), i = t[a.toLowerCase()];
      if (!i) {
        const l = r[0].charAt(0);
        return {
          type: "text",
          raw: l,
          text: l
        };
      }
      return _o(r, i, r[0], this.lexer);
    }
  }
  emStrong(e, t, r = "") {
    let a = this.rules.inline.emStrongLDelim.exec(e);
    if (!a || a[3] && r.match(/[\p{L}\p{N}]/u))
      return;
    if (!(a[1] || a[2] || "") || !r || this.rules.inline.punctuation.exec(r)) {
      const l = [...a[0]].length - 1;
      let s, o, u = l, h = 0;
      const f = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (f.lastIndex = 0, t = t.slice(-1 * e.length + l); (a = f.exec(t)) != null; ) {
        if (s = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !s)
          continue;
        if (o = [...s].length, a[3] || a[4]) {
          u += o;
          continue;
        } else if ((a[5] || a[6]) && l % 3 && !((l + o) % 3)) {
          h += o;
          continue;
        }
        if (u -= o, u > 0)
          continue;
        o = Math.min(o, o + u + h);
        const p = [...a[0]][0].length, g = e.slice(0, l + a.index + p + o);
        if (Math.min(l, o) % 2) {
          const v = g.slice(1, -1);
          return {
            type: "em",
            raw: g,
            text: v,
            tokens: this.lexer.inlineTokens(v)
          };
        }
        const w = g.slice(2, -2);
        return {
          type: "strong",
          raw: g,
          text: w,
          tokens: this.lexer.inlineTokens(w)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let r = t[2].replace(/\n/g, " ");
      const a = /[^ ]/.test(r), i = /^ /.test(r) && / $/.test(r);
      return a && i && (r = r.substring(1, r.length - 1)), r = Gt(r, !0), {
        type: "codespan",
        raw: t[0],
        text: r
      };
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t)
      return {
        type: "br",
        raw: t[0]
      };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t)
      return {
        type: "del",
        raw: t[0],
        text: t[2],
        tokens: this.lexer.inlineTokens(t[2])
      };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let r, a;
      return t[2] === "@" ? (r = Gt(t[1]), a = "mailto:" + r) : (r = Gt(t[1]), a = r), {
        type: "link",
        raw: t[0],
        text: r,
        href: a,
        tokens: [
          {
            type: "text",
            raw: r,
            text: r
          }
        ]
      };
    }
  }
  url(e) {
    var r;
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let a, i;
      if (t[2] === "@")
        a = Gt(t[0]), i = "mailto:" + a;
      else {
        let l;
        do
          l = t[0], t[0] = ((r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) ?? "";
        while (l !== t[0]);
        a = Gt(t[0]), t[1] === "www." ? i = "http://" + t[0] : i = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: a,
        href: i,
        tokens: [
          {
            type: "text",
            raw: a,
            text: a
          }
        ]
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let r;
      return this.lexer.state.inRawBlock ? r = t[0] : r = Gt(t[0]), {
        type: "text",
        raw: t[0],
        text: r
      };
    }
  }
}
const lm = /^(?: *(?:\n|$))+/, sm = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, om = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, qn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, um = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, vc = /(?:[*+-]|\d{1,9}[.)])/, bc = Ne(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, vc).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), es = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, cm = /^[^\n]+/, ts = /(?!\s*\])(?:\\.|[^\[\]\\])+/, hm = Ne(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", ts).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), dm = Ne(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, vc).getRegex(), ni = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", rs = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, fm = Ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", rs).replace("tag", ni).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), yc = Ne(es).replace("hr", qn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ni).getRegex(), mm = Ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", yc).getRegex(), ns = {
  blockquote: mm,
  code: sm,
  def: hm,
  fences: om,
  heading: um,
  hr: qn,
  html: fm,
  lheading: bc,
  list: dm,
  newline: lm,
  paragraph: yc,
  table: kn,
  text: cm
}, vo = Ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", qn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ni).getRegex(), pm = {
  ...ns,
  table: vo,
  paragraph: Ne(es).replace("hr", qn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", vo).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ni).getRegex()
}, gm = {
  ...ns,
  html: Ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", rs).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
  fences: kn,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: Ne(es).replace("hr", qn).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", bc).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, wc = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, _m = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, kc = /^( {2,}|\\)\n(?!\s*$)/, vm = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, In = "\\p{P}\\p{S}", bm = Ne(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, In).getRegex(), ym = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, wm = Ne(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, In).getRegex(), km = Ne("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, In).getRegex(), Dm = Ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, In).getRegex(), Sm = Ne(/\\([punct])/, "gu").replace(/punct/g, In).getRegex(), xm = Ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Am = Ne(rs).replace("(?:-->|$)", "-->").getRegex(), Em = Ne("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Am).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ga = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Cm = Ne(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", Ga).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Dc = Ne(/^!?\[(label)\]\[(ref)\]/).replace("label", Ga).replace("ref", ts).getRegex(), Sc = Ne(/^!?\[(ref)\](?:\[\])?/).replace("ref", ts).getRegex(), Tm = Ne("reflink|nolink(?!\\()", "g").replace("reflink", Dc).replace("nolink", Sc).getRegex(), as = {
  _backpedal: kn,
  // only used for GFM url
  anyPunctuation: Sm,
  autolink: xm,
  blockSkip: ym,
  br: kc,
  code: _m,
  del: kn,
  emStrongLDelim: wm,
  emStrongRDelimAst: km,
  emStrongRDelimUnd: Dm,
  escape: wc,
  link: Cm,
  nolink: Sc,
  punctuation: bm,
  reflink: Dc,
  reflinkSearch: Tm,
  tag: Em,
  text: vm,
  url: kn
}, Fm = {
  ...as,
  link: Ne(/^!?\[(label)\]\((.*?)\)/).replace("label", Ga).getRegex(),
  reflink: Ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ga).getRegex()
}, bl = {
  ...as,
  escape: Ne(wc).replace("])", "~|])").getRegex(),
  url: Ne(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, $m = {
  ...bl,
  br: Ne(kc).replace("{2,}", "*").getRegex(),
  text: Ne(bl.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, na = {
  normal: ns,
  gfm: pm,
  pedantic: gm
}, rn = {
  normal: as,
  gfm: bl,
  breaks: $m,
  pedantic: Fm
};
class $0 {
  constructor(e) {
    Ue(this, "tokens");
    Ue(this, "options");
    Ue(this, "state");
    Ue(this, "tokenizer");
    Ue(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || zr, this.options.tokenizer = this.options.tokenizer || new Ua(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
      inLink: !1,
      inRawBlock: !1,
      top: !0
    };
    const t = {
      block: na.normal,
      inline: rn.normal
    };
    this.options.pedantic ? (t.block = na.pedantic, t.inline = rn.pedantic) : this.options.gfm && (t.block = na.gfm, this.options.breaks ? t.inline = rn.breaks : t.inline = rn.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block: na,
      inline: rn
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new $0(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new $0(t).inlineTokens(e);
  }
  /**
   * Preprocessing
   */
  lex(e) {
    e = e.replace(/\r\n|\r/g, `
`), this.blockTokens(e, this.tokens);
    for (let t = 0; t < this.inlineQueue.length; t++) {
      const r = this.inlineQueue[t];
      this.inlineTokens(r.src, r.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e, t = []) {
    this.options.pedantic ? e = e.replace(/\t/g, "    ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (s, o, u) => o + "    ".repeat(u.length));
    let r, a, i, l;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
        if (r = this.tokenizer.space(e)) {
          e = e.substring(r.raw.length), r.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
` : t.push(r);
          continue;
        }
        if (r = this.tokenizer.code(e)) {
          e = e.substring(r.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + r.raw, a.text += `
` + r.text, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r);
          continue;
        }
        if (r = this.tokenizer.fences(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.heading(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.hr(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.blockquote(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.list(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.html(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.def(e)) {
          e = e.substring(r.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + r.raw, a.text += `
` + r.raw, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
            href: r.href,
            title: r.title
          });
          continue;
        }
        if (r = this.tokenizer.table(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.lheading(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (i = e, this.options.extensions && this.options.extensions.startBlock) {
          let s = 1 / 0;
          const o = e.slice(1);
          let u;
          this.options.extensions.startBlock.forEach((h) => {
            u = h.call({ lexer: this }, o), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
          }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
        }
        if (this.state.top && (r = this.tokenizer.paragraph(i))) {
          a = t[t.length - 1], l && a.type === "paragraph" ? (a.raw += `
` + r.raw, a.text += `
` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r), l = i.length !== e.length, e = e.substring(r.raw.length);
          continue;
        }
        if (r = this.tokenizer.text(e)) {
          e = e.substring(r.raw.length), a = t[t.length - 1], a && a.type === "text" ? (a.raw += `
` + r.raw, a.text += `
` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r);
          continue;
        }
        if (e) {
          const s = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(s);
            break;
          } else
            throw new Error(s);
        }
      }
    return this.state.top = !0, t;
  }
  inline(e, t = []) {
    return this.inlineQueue.push({ src: e, tokens: t }), t;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(e, t = []) {
    let r, a, i, l = e, s, o, u;
    if (this.tokens.links) {
      const h = Object.keys(this.tokens.links);
      if (h.length > 0)
        for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(l)) != null; )
          h.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (l = l.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (s = this.tokenizer.rules.inline.blockSkip.exec(l)) != null; )
      l = l.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(l)) != null; )
      l = l.slice(0, s.index) + "++" + l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (o || (u = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (r = h.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
        if (r = this.tokenizer.escape(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.tag(e)) {
          e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
          continue;
        }
        if (r = this.tokenizer.link(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
          continue;
        }
        if (r = this.tokenizer.emStrong(e, l, u)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.codespan(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.br(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.del(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.autolink(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (!this.state.inLink && (r = this.tokenizer.url(e))) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (i = e, this.options.extensions && this.options.extensions.startInline) {
          let h = 1 / 0;
          const f = e.slice(1);
          let p;
          this.options.extensions.startInline.forEach((g) => {
            p = g.call({ lexer: this }, f), typeof p == "number" && p >= 0 && (h = Math.min(h, p));
          }), h < 1 / 0 && h >= 0 && (i = e.substring(0, h + 1));
        }
        if (r = this.tokenizer.inlineText(i)) {
          e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (u = r.raw.slice(-1)), o = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
          continue;
        }
        if (e) {
          const h = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(h);
            break;
          } else
            throw new Error(h);
        }
      }
    return t;
  }
}
class Va {
  constructor(e) {
    Ue(this, "options");
    this.options = e || zr;
  }
  code(e, t, r) {
    var i;
    const a = (i = (t || "").match(/^\S*/)) == null ? void 0 : i[0];
    return e = e.replace(/\n$/, "") + `
`, a ? '<pre><code class="language-' + Gt(a) + '">' + (r ? e : Gt(e, !0)) + `</code></pre>
` : "<pre><code>" + (r ? e : Gt(e, !0)) + `</code></pre>
`;
  }
  blockquote(e) {
    return `<blockquote>
${e}</blockquote>
`;
  }
  html(e, t) {
    return e;
  }
  heading(e, t, r) {
    return `<h${t}>${e}</h${t}>
`;
  }
  hr() {
    return `<hr>
`;
  }
  list(e, t, r) {
    const a = t ? "ol" : "ul", i = t && r !== 1 ? ' start="' + r + '"' : "";
    return "<" + a + i + `>
` + e + "</" + a + `>
`;
  }
  listitem(e, t, r) {
    return `<li>${e}</li>
`;
  }
  checkbox(e) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph(e) {
    return `<p>${e}</p>
`;
  }
  table(e, t) {
    return t && (t = `<tbody>${t}</tbody>`), `<table>
<thead>
` + e + `</thead>
` + t + `</table>
`;
  }
  tablerow(e) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e, t) {
    const r = t.header ? "th" : "td";
    return (t.align ? `<${r} align="${t.align}">` : `<${r}>`) + e + `</${r}>
`;
  }
  /**
   * span level renderer
   */
  strong(e) {
    return `<strong>${e}</strong>`;
  }
  em(e) {
    return `<em>${e}</em>`;
  }
  codespan(e) {
    return `<code>${e}</code>`;
  }
  br() {
    return "<br>";
  }
  del(e) {
    return `<del>${e}</del>`;
  }
  link(e, t, r) {
    const a = po(e);
    if (a === null)
      return r;
    e = a;
    let i = '<a href="' + e + '"';
    return t && (i += ' title="' + t + '"'), i += ">" + r + "</a>", i;
  }
  image(e, t, r) {
    const a = po(e);
    if (a === null)
      return r;
    e = a;
    let i = `<img src="${e}" alt="${r}"`;
    return t && (i += ` title="${t}"`), i += ">", i;
  }
  text(e) {
    return e;
  }
}
class is {
  // no need for block level renderers
  strong(e) {
    return e;
  }
  em(e) {
    return e;
  }
  codespan(e) {
    return e;
  }
  del(e) {
    return e;
  }
  html(e) {
    return e;
  }
  text(e) {
    return e;
  }
  link(e, t, r) {
    return "" + r;
  }
  image(e, t, r) {
    return "" + r;
  }
  br() {
    return "";
  }
}
class M0 {
  constructor(e) {
    Ue(this, "options");
    Ue(this, "renderer");
    Ue(this, "textRenderer");
    this.options = e || zr, this.options.renderer = this.options.renderer || new Va(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new is();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new M0(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new M0(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let r = "";
    for (let a = 0; a < e.length; a++) {
      const i = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
        const l = i, s = this.options.extensions.renderers[l.type].call({ parser: this }, l);
        if (s !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
          r += s || "";
          continue;
        }
      }
      switch (i.type) {
        case "space":
          continue;
        case "hr": {
          r += this.renderer.hr();
          continue;
        }
        case "heading": {
          const l = i;
          r += this.renderer.heading(this.parseInline(l.tokens), l.depth, rm(this.parseInline(l.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const l = i;
          r += this.renderer.code(l.text, l.lang, !!l.escaped);
          continue;
        }
        case "table": {
          const l = i;
          let s = "", o = "";
          for (let h = 0; h < l.header.length; h++)
            o += this.renderer.tablecell(this.parseInline(l.header[h].tokens), { header: !0, align: l.align[h] });
          s += this.renderer.tablerow(o);
          let u = "";
          for (let h = 0; h < l.rows.length; h++) {
            const f = l.rows[h];
            o = "";
            for (let p = 0; p < f.length; p++)
              o += this.renderer.tablecell(this.parseInline(f[p].tokens), { header: !1, align: l.align[p] });
            u += this.renderer.tablerow(o);
          }
          r += this.renderer.table(s, u);
          continue;
        }
        case "blockquote": {
          const l = i, s = this.parse(l.tokens);
          r += this.renderer.blockquote(s);
          continue;
        }
        case "list": {
          const l = i, s = l.ordered, o = l.start, u = l.loose;
          let h = "";
          for (let f = 0; f < l.items.length; f++) {
            const p = l.items[f], g = p.checked, w = p.task;
            let v = "";
            if (p.task) {
              const y = this.renderer.checkbox(!!g);
              u ? p.tokens.length > 0 && p.tokens[0].type === "paragraph" ? (p.tokens[0].text = y + " " + p.tokens[0].text, p.tokens[0].tokens && p.tokens[0].tokens.length > 0 && p.tokens[0].tokens[0].type === "text" && (p.tokens[0].tokens[0].text = y + " " + p.tokens[0].tokens[0].text)) : p.tokens.unshift({
                type: "text",
                text: y + " "
              }) : v += y + " ";
            }
            v += this.parse(p.tokens, u), h += this.renderer.listitem(v, w, !!g);
          }
          r += this.renderer.list(h, s, o);
          continue;
        }
        case "html": {
          const l = i;
          r += this.renderer.html(l.text, l.block);
          continue;
        }
        case "paragraph": {
          const l = i;
          r += this.renderer.paragraph(this.parseInline(l.tokens));
          continue;
        }
        case "text": {
          let l = i, s = l.tokens ? this.parseInline(l.tokens) : l.text;
          for (; a + 1 < e.length && e[a + 1].type === "text"; )
            l = e[++a], s += `
` + (l.tokens ? this.parseInline(l.tokens) : l.text);
          r += t ? this.renderer.paragraph(s) : s;
          continue;
        }
        default: {
          const l = 'Token with "' + i.type + '" type was not found.';
          if (this.options.silent)
            return console.error(l), "";
          throw new Error(l);
        }
      }
    }
    return r;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let r = "";
    for (let a = 0; a < e.length; a++) {
      const i = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
        const l = this.options.extensions.renderers[i.type].call({ parser: this }, i);
        if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
          r += l || "";
          continue;
        }
      }
      switch (i.type) {
        case "escape": {
          const l = i;
          r += t.text(l.text);
          break;
        }
        case "html": {
          const l = i;
          r += t.html(l.text);
          break;
        }
        case "link": {
          const l = i;
          r += t.link(l.href, l.title, this.parseInline(l.tokens, t));
          break;
        }
        case "image": {
          const l = i;
          r += t.image(l.href, l.title, l.text);
          break;
        }
        case "strong": {
          const l = i;
          r += t.strong(this.parseInline(l.tokens, t));
          break;
        }
        case "em": {
          const l = i;
          r += t.em(this.parseInline(l.tokens, t));
          break;
        }
        case "codespan": {
          const l = i;
          r += t.codespan(l.text);
          break;
        }
        case "br": {
          r += t.br();
          break;
        }
        case "del": {
          const l = i;
          r += t.del(this.parseInline(l.tokens, t));
          break;
        }
        case "text": {
          const l = i;
          r += t.text(l.text);
          break;
        }
        default: {
          const l = 'Token with "' + i.type + '" type was not found.';
          if (this.options.silent)
            return console.error(l), "";
          throw new Error(l);
        }
      }
    }
    return r;
  }
}
class Dn {
  constructor(e) {
    Ue(this, "options");
    this.options = e || zr;
  }
  /**
   * Process markdown before marked
   */
  preprocess(e) {
    return e;
  }
  /**
   * Process HTML after marked is finished
   */
  postprocess(e) {
    return e;
  }
  /**
   * Process all tokens before walk tokens
   */
  processAllTokens(e) {
    return e;
  }
}
Ue(Dn, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var $r, yl, Ac;
class xc {
  constructor(...e) {
    di(this, $r);
    Ue(this, "defaults", Jl());
    Ue(this, "options", this.setOptions);
    Ue(this, "parse", jn(this, $r, yl).call(this, $0.lex, M0.parse));
    Ue(this, "parseInline", jn(this, $r, yl).call(this, $0.lexInline, M0.parseInline));
    Ue(this, "Parser", M0);
    Ue(this, "Renderer", Va);
    Ue(this, "TextRenderer", is);
    Ue(this, "Lexer", $0);
    Ue(this, "Tokenizer", Ua);
    Ue(this, "Hooks", Dn);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    var a, i;
    let r = [];
    for (const l of e)
      switch (r = r.concat(t.call(this, l)), l.type) {
        case "table": {
          const s = l;
          for (const o of s.header)
            r = r.concat(this.walkTokens(o.tokens, t));
          for (const o of s.rows)
            for (const u of o)
              r = r.concat(this.walkTokens(u.tokens, t));
          break;
        }
        case "list": {
          const s = l;
          r = r.concat(this.walkTokens(s.items, t));
          break;
        }
        default: {
          const s = l;
          (i = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && i[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((o) => {
            const u = s[o].flat(1 / 0);
            r = r.concat(this.walkTokens(u, t));
          }) : s.tokens && (r = r.concat(this.walkTokens(s.tokens, t)));
        }
      }
    return r;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((r) => {
      const a = { ...r };
      if (a.async = this.defaults.async || a.async || !1, r.extensions && (r.extensions.forEach((i) => {
        if (!i.name)
          throw new Error("extension name required");
        if ("renderer" in i) {
          const l = t.renderers[i.name];
          l ? t.renderers[i.name] = function(...s) {
            let o = i.renderer.apply(this, s);
            return o === !1 && (o = l.apply(this, s)), o;
          } : t.renderers[i.name] = i.renderer;
        }
        if ("tokenizer" in i) {
          if (!i.level || i.level !== "block" && i.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const l = t[i.level];
          l ? l.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
        }
        "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
      }), a.extensions = t), r.renderer) {
        const i = this.defaults.renderer || new Va(this.defaults);
        for (const l in r.renderer) {
          if (!(l in i))
            throw new Error(`renderer '${l}' does not exist`);
          if (l === "options")
            continue;
          const s = l, o = r.renderer[s], u = i[s];
          i[s] = (...h) => {
            let f = o.apply(i, h);
            return f === !1 && (f = u.apply(i, h)), f || "";
          };
        }
        a.renderer = i;
      }
      if (r.tokenizer) {
        const i = this.defaults.tokenizer || new Ua(this.defaults);
        for (const l in r.tokenizer) {
          if (!(l in i))
            throw new Error(`tokenizer '${l}' does not exist`);
          if (["options", "rules", "lexer"].includes(l))
            continue;
          const s = l, o = r.tokenizer[s], u = i[s];
          i[s] = (...h) => {
            let f = o.apply(i, h);
            return f === !1 && (f = u.apply(i, h)), f;
          };
        }
        a.tokenizer = i;
      }
      if (r.hooks) {
        const i = this.defaults.hooks || new Dn();
        for (const l in r.hooks) {
          if (!(l in i))
            throw new Error(`hook '${l}' does not exist`);
          if (l === "options")
            continue;
          const s = l, o = r.hooks[s], u = i[s];
          Dn.passThroughHooks.has(l) ? i[s] = (h) => {
            if (this.defaults.async)
              return Promise.resolve(o.call(i, h)).then((p) => u.call(i, p));
            const f = o.call(i, h);
            return u.call(i, f);
          } : i[s] = (...h) => {
            let f = o.apply(i, h);
            return f === !1 && (f = u.apply(i, h)), f;
          };
        }
        a.hooks = i;
      }
      if (r.walkTokens) {
        const i = this.defaults.walkTokens, l = r.walkTokens;
        a.walkTokens = function(s) {
          let o = [];
          return o.push(l.call(this, s)), i && (o = o.concat(i.call(this, s))), o;
        };
      }
      this.defaults = { ...this.defaults, ...a };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return $0.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return M0.parse(e, t ?? this.defaults);
  }
}
$r = new WeakSet(), yl = function(e, t) {
  return (r, a) => {
    const i = { ...a }, l = { ...this.defaults, ...i };
    this.defaults.async === !0 && i.async === !1 && (l.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), l.async = !0);
    const s = jn(this, $r, Ac).call(this, !!l.silent, !!l.async);
    if (typeof r > "u" || r === null)
      return s(new Error("marked(): input parameter is undefined or null"));
    if (typeof r != "string")
      return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
    if (l.hooks && (l.hooks.options = l), l.async)
      return Promise.resolve(l.hooks ? l.hooks.preprocess(r) : r).then((o) => e(o, l)).then((o) => l.hooks ? l.hooks.processAllTokens(o) : o).then((o) => l.walkTokens ? Promise.all(this.walkTokens(o, l.walkTokens)).then(() => o) : o).then((o) => t(o, l)).then((o) => l.hooks ? l.hooks.postprocess(o) : o).catch(s);
    try {
      l.hooks && (r = l.hooks.preprocess(r));
      let o = e(r, l);
      l.hooks && (o = l.hooks.processAllTokens(o)), l.walkTokens && this.walkTokens(o, l.walkTokens);
      let u = t(o, l);
      return l.hooks && (u = l.hooks.postprocess(u)), u;
    } catch (o) {
      return s(o);
    }
  };
}, Ac = function(e, t) {
  return (r) => {
    if (r.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
      const a = "<p>An error occurred:</p><pre>" + Gt(r.message + "", !0) + "</pre>";
      return t ? Promise.resolve(a) : a;
    }
    if (t)
      return Promise.reject(r);
    throw r;
  };
};
const Tr = new xc();
function Ie(n, e) {
  return Tr.parse(n, e);
}
Ie.options = Ie.setOptions = function(n) {
  return Tr.setOptions(n), Ie.defaults = Tr.defaults, pc(Ie.defaults), Ie;
};
Ie.getDefaults = Jl;
Ie.defaults = zr;
Ie.use = function(...n) {
  return Tr.use(...n), Ie.defaults = Tr.defaults, pc(Ie.defaults), Ie;
};
Ie.walkTokens = function(n, e) {
  return Tr.walkTokens(n, e);
};
Ie.parseInline = Tr.parseInline;
Ie.Parser = M0;
Ie.parser = M0.parse;
Ie.Renderer = Va;
Ie.TextRenderer = is;
Ie.Lexer = $0;
Ie.lexer = $0.lex;
Ie.Tokenizer = Ua;
Ie.Hooks = Dn;
Ie.parse = Ie;
Ie.options;
Ie.setOptions;
Ie.use;
Ie.walkTokens;
Ie.parseInline;
M0.parse;
$0.lex;
function Mm(n) {
  if (typeof n == "function" && (n = {
    highlight: n
  }), !n || typeof n.highlight != "function")
    throw new Error("Must provide highlight function");
  return typeof n.langPrefix != "string" && (n.langPrefix = "language-"), typeof n.emptyLangClass != "string" && (n.emptyLangClass = ""), {
    async: !!n.async,
    walkTokens(e) {
      if (e.type !== "code")
        return;
      const t = bo(e.lang);
      if (n.async)
        return Promise.resolve(n.highlight(e.text, t, e.lang || "")).then(yo(e));
      const r = n.highlight(e.text, t, e.lang || "");
      if (r instanceof Promise)
        throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");
      yo(e)(r);
    },
    useNewRenderer: !0,
    renderer: {
      code(e, t, r) {
        typeof e == "object" && (r = e.escaped, t = e.lang, e = e.text);
        const a = bo(t), i = a ? n.langPrefix + ko(a) : n.emptyLangClass, l = i ? ` class="${i}"` : "";
        return e = e.replace(/\n$/, ""), `<pre><code${l}>${r ? e : ko(e, !0)}
</code></pre>`;
      }
    }
  };
}
function bo(n) {
  return (n || "").match(/\S*/)[0];
}
function yo(n) {
  return (e) => {
    typeof e == "string" && e !== n.text && (n.escaped = !0, n.text = e);
  };
}
const Ec = /[&<>"']/, zm = new RegExp(Ec.source, "g"), Cc = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Bm = new RegExp(Cc.source, "g"), Lm = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, wo = (n) => Lm[n];
function ko(n, e) {
  if (e) {
    if (Ec.test(n))
      return n.replace(zm, wo);
  } else if (Cc.test(n))
    return n.replace(Bm, wo);
  return n;
}
const Rm = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, qm = Object.hasOwnProperty;
class ls {
  /**
   * Create a new slug class.
   */
  constructor() {
    this.occurrences, this.reset();
  }
  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug(e, t) {
    const r = this;
    let a = Im(e, t === !0);
    const i = a;
    for (; qm.call(r.occurrences, a); )
      r.occurrences[i]++, a = i + "-" + r.occurrences[i];
    return r.occurrences[a] = 0, a;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function Im(n, e) {
  return typeof n != "string" ? "" : (e || (n = n.toLowerCase()), n.replace(Rm, "").replace(/ /g, "-"));
}
let Tc = new ls(), Fc = [];
function Nm({ prefix: n = "", globalSlugs: e = !1 } = {}) {
  return {
    headerIds: !1,
    // prevent deprecation warning; remove this once headerIds option is removed
    hooks: {
      preprocess(t) {
        return e || Om(), t;
      }
    },
    renderer: {
      heading(t, r, a) {
        a = a.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, "");
        const i = `${n}${Tc.slug(a)}`, l = { level: r, text: t, id: i };
        return Fc.push(l), `<h${r} id="${i}">${t}</h${r}>
`;
      }
    }
  };
}
function Om() {
  Fc = [], Tc = new ls();
}
var Do = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function j7(n) {
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var $c = { exports: {} };
(function(n) {
  var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
  /**
   * Prism: Lightweight, robust, elegant syntax highlighting
   *
   * @license MIT <https://opensource.org/licenses/MIT>
   * @author Lea Verou <https://lea.verou.me>
   * @namespace
   * @public
   */
  var t = function(r) {
    var a = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, i = 0, l = {}, s = {
      /**
       * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
       * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
       * additional languages or plugins yourself.
       *
       * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
       *
       * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.manual = true;
       * // add a new <script> to load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      manual: r.Prism && r.Prism.manual,
      /**
       * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
       * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
       * own worker, you don't want it to do this.
       *
       * By setting this value to `true`, Prism will not add its own listeners to the worker.
       *
       * You obviously have to change this value before Prism executes. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.disableWorkerMessageHandler = true;
       * // Load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      disableWorkerMessageHandler: r.Prism && r.Prism.disableWorkerMessageHandler,
      /**
       * A namespace for utility methods.
       *
       * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
       * change or disappear at any time.
       *
       * @namespace
       * @memberof Prism
       */
      util: {
        encode: function k(b) {
          return b instanceof o ? new o(b.type, k(b.content), b.alias) : Array.isArray(b) ? b.map(k) : b.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
        },
        /**
         * Returns the name of the type of the given value.
         *
         * @param {any} o
         * @returns {string}
         * @example
         * type(null)      === 'Null'
         * type(undefined) === 'Undefined'
         * type(123)       === 'Number'
         * type('foo')     === 'String'
         * type(true)      === 'Boolean'
         * type([1, 2])    === 'Array'
         * type({})        === 'Object'
         * type(String)    === 'Function'
         * type(/abc+/)    === 'RegExp'
         */
        type: function(k) {
          return Object.prototype.toString.call(k).slice(8, -1);
        },
        /**
         * Returns a unique number for the given object. Later calls will still return the same number.
         *
         * @param {Object} obj
         * @returns {number}
         */
        objId: function(k) {
          return k.__id || Object.defineProperty(k, "__id", { value: ++i }), k.__id;
        },
        /**
         * Creates a deep clone of the given object.
         *
         * The main intended use of this function is to clone language definitions.
         *
         * @param {T} o
         * @param {Record<number, any>} [visited]
         * @returns {T}
         * @template T
         */
        clone: function k(b, A) {
          A = A || {};
          var M, R;
          switch (s.util.type(b)) {
            case "Object":
              if (R = s.util.objId(b), A[R])
                return A[R];
              M = /** @type {Record<string, any>} */
              {}, A[R] = M;
              for (var L in b)
                b.hasOwnProperty(L) && (M[L] = k(b[L], A));
              return (
                /** @type {any} */
                M
              );
            case "Array":
              return R = s.util.objId(b), A[R] ? A[R] : (M = [], A[R] = M, /** @type {Array} */
              /** @type {any} */
              b.forEach(function(H, q) {
                M[q] = k(H, A);
              }), /** @type {any} */
              M);
            default:
              return b;
          }
        },
        /**
         * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
         *
         * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
         *
         * @param {Element} element
         * @returns {string}
         */
        getLanguage: function(k) {
          for (; k; ) {
            var b = a.exec(k.className);
            if (b)
              return b[1].toLowerCase();
            k = k.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(k, b) {
          k.className = k.className.replace(RegExp(a, "gi"), ""), k.classList.add("language-" + b);
        },
        /**
         * Returns the script element that is currently executing.
         *
         * This does __not__ work for line script element.
         *
         * @returns {HTMLScriptElement | null}
         */
        currentScript: function() {
          if (typeof document > "u")
            return null;
          if ("currentScript" in document)
            return (
              /** @type {any} */
              document.currentScript
            );
          try {
            throw new Error();
          } catch (M) {
            var k = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack) || [])[1];
            if (k) {
              var b = document.getElementsByTagName("script");
              for (var A in b)
                if (b[A].src == k)
                  return b[A];
            }
            return null;
          }
        },
        /**
         * Returns whether a given class is active for `element`.
         *
         * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
         * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
         * given class is just the given class with a `no-` prefix.
         *
         * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
         * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
         * ancestors have the given class or the negated version of it, then the default activation will be returned.
         *
         * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
         * version of it, the class is considered active.
         *
         * @param {Element} element
         * @param {string} className
         * @param {boolean} [defaultActivation=false]
         * @returns {boolean}
         */
        isActive: function(k, b, A) {
          for (var M = "no-" + b; k; ) {
            var R = k.classList;
            if (R.contains(b))
              return !0;
            if (R.contains(M))
              return !1;
            k = k.parentElement;
          }
          return !!A;
        }
      },
      /**
       * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
       *
       * @namespace
       * @memberof Prism
       * @public
       */
      languages: {
        /**
         * The grammar for plain, unformatted text.
         */
        plain: l,
        plaintext: l,
        text: l,
        txt: l,
        /**
         * Creates a deep copy of the language with the given id and appends the given tokens.
         *
         * If a token in `redef` also appears in the copied language, then the existing token in the copied language
         * will be overwritten at its original position.
         *
         * ## Best practices
         *
         * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
         * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
         * understand the language definition because, normally, the order of tokens matters in Prism grammars.
         *
         * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
         * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
         *
         * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
         * @param {Grammar} redef The new tokens to append.
         * @returns {Grammar} The new language created.
         * @public
         * @example
         * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
         *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
         *     // at its original position
         *     'comment': { ... },
         *     // CSS doesn't have a 'color' token, so this token will be appended
         *     'color': /\b(?:red|green|blue)\b/
         * });
         */
        extend: function(k, b) {
          var A = s.util.clone(s.languages[k]);
          for (var M in b)
            A[M] = b[M];
          return A;
        },
        /**
         * Inserts tokens _before_ another token in a language definition or any other grammar.
         *
         * ## Usage
         *
         * This helper method makes it easy to modify existing languages. For example, the CSS language definition
         * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
         * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
         * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
         * this:
         *
         * ```js
         * Prism.languages.markup.style = {
         *     // token
         * };
         * ```
         *
         * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
         * before existing tokens. For the CSS example above, you would use it like this:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'cdata', {
         *     'style': {
         *         // token
         *     }
         * });
         * ```
         *
         * ## Special cases
         *
         * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
         * will be ignored.
         *
         * This behavior can be used to insert tokens after `before`:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'comment', {
         *     'comment': Prism.languages.markup.comment,
         *     // tokens after 'comment'
         * });
         * ```
         *
         * ## Limitations
         *
         * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
         * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
         * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
         * deleting properties which is necessary to insert at arbitrary positions.
         *
         * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
         * Instead, it will create a new object and replace all references to the target object with the new one. This
         * can be done without temporarily deleting properties, so the iteration order is well-defined.
         *
         * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
         * you hold the target object in a variable, then the value of the variable will not change.
         *
         * ```js
         * var oldMarkup = Prism.languages.markup;
         * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
         *
         * assert(oldMarkup !== Prism.languages.markup);
         * assert(newMarkup === Prism.languages.markup);
         * ```
         *
         * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
         * object to be modified.
         * @param {string} before The key to insert before.
         * @param {Grammar} insert An object containing the key-value pairs to be inserted.
         * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
         * object to be modified.
         *
         * Defaults to `Prism.languages`.
         * @returns {Grammar} The new grammar object.
         * @public
         */
        insertBefore: function(k, b, A, M) {
          M = M || /** @type {any} */
          s.languages;
          var R = M[k], L = {};
          for (var H in R)
            if (R.hasOwnProperty(H)) {
              if (H == b)
                for (var q in A)
                  A.hasOwnProperty(q) && (L[q] = A[q]);
              A.hasOwnProperty(H) || (L[H] = R[H]);
            }
          var X = M[k];
          return M[k] = L, s.languages.DFS(s.languages, function(Z, J) {
            J === X && Z != k && (this[Z] = L);
          }), L;
        },
        // Traverse a language definition with Depth First Search
        DFS: function k(b, A, M, R) {
          R = R || {};
          var L = s.util.objId;
          for (var H in b)
            if (b.hasOwnProperty(H)) {
              A.call(b, H, b[H], M || H);
              var q = b[H], X = s.util.type(q);
              X === "Object" && !R[L(q)] ? (R[L(q)] = !0, k(q, A, null, R)) : X === "Array" && !R[L(q)] && (R[L(q)] = !0, k(q, A, H, R));
            }
        }
      },
      plugins: {},
      /**
       * This is the most high-level function in Prism’s API.
       * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
       * each one of them.
       *
       * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
       *
       * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
       * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
       * @memberof Prism
       * @public
       */
      highlightAll: function(k, b) {
        s.highlightAllUnder(document, k, b);
      },
      /**
       * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
       * {@link Prism.highlightElement} on each one of them.
       *
       * The following hooks will be run:
       * 1. `before-highlightall`
       * 2. `before-all-elements-highlight`
       * 3. All hooks of {@link Prism.highlightElement} for each element.
       *
       * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
       * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
       * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
       * @memberof Prism
       * @public
       */
      highlightAllUnder: function(k, b, A) {
        var M = {
          callback: A,
          container: k,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        s.hooks.run("before-highlightall", M), M.elements = Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)), s.hooks.run("before-all-elements-highlight", M);
        for (var R = 0, L; L = M.elements[R++]; )
          s.highlightElement(L, b === !0, M.callback);
      },
      /**
       * Highlights the code inside a single element.
       *
       * The following hooks will be run:
       * 1. `before-sanity-check`
       * 2. `before-highlight`
       * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
       * 4. `before-insert`
       * 5. `after-highlight`
       * 6. `complete`
       *
       * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
       * the element's language.
       *
       * @param {Element} element The element containing the code.
       * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
       * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
       * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
       * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
       *
       * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
       * asynchronous highlighting to work. You can build your own bundle on the
       * [Download page](https://prismjs.com/download.html).
       * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
       * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
       * @memberof Prism
       * @public
       */
      highlightElement: function(k, b, A) {
        var M = s.util.getLanguage(k), R = s.languages[M];
        s.util.setLanguage(k, M);
        var L = k.parentElement;
        L && L.nodeName.toLowerCase() === "pre" && s.util.setLanguage(L, M);
        var H = k.textContent, q = {
          element: k,
          language: M,
          grammar: R,
          code: H
        };
        function X(J) {
          q.highlightedCode = J, s.hooks.run("before-insert", q), q.element.innerHTML = q.highlightedCode, s.hooks.run("after-highlight", q), s.hooks.run("complete", q), A && A.call(q.element);
        }
        if (s.hooks.run("before-sanity-check", q), L = q.element.parentElement, L && L.nodeName.toLowerCase() === "pre" && !L.hasAttribute("tabindex") && L.setAttribute("tabindex", "0"), !q.code) {
          s.hooks.run("complete", q), A && A.call(q.element);
          return;
        }
        if (s.hooks.run("before-highlight", q), !q.grammar) {
          X(s.util.encode(q.code));
          return;
        }
        if (b && r.Worker) {
          var Z = new Worker(s.filename);
          Z.onmessage = function(J) {
            X(J.data);
          }, Z.postMessage(JSON.stringify({
            language: q.language,
            code: q.code,
            immediateClose: !0
          }));
        } else
          X(s.highlight(q.code, q.grammar, q.language));
      },
      /**
       * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
       * and the language definitions to use, and returns a string with the HTML produced.
       *
       * The following hooks will be run:
       * 1. `before-tokenize`
       * 2. `after-tokenize`
       * 3. `wrap`: On each {@link Token}.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @param {string} language The name of the language definition passed to `grammar`.
       * @returns {string} The highlighted HTML.
       * @memberof Prism
       * @public
       * @example
       * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
       */
      highlight: function(k, b, A) {
        var M = {
          code: k,
          grammar: b,
          language: A
        };
        if (s.hooks.run("before-tokenize", M), !M.grammar)
          throw new Error('The language "' + M.language + '" has no grammar.');
        return M.tokens = s.tokenize(M.code, M.grammar), s.hooks.run("after-tokenize", M), o.stringify(s.util.encode(M.tokens), M.language);
      },
      /**
       * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
       * and the language definitions to use, and returns an array with the tokenized code.
       *
       * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
       *
       * This method could be useful in other contexts as well, as a very crude parser.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @returns {TokenStream} An array of strings and tokens, a token stream.
       * @memberof Prism
       * @public
       * @example
       * let code = `var foo = 0;`;
       * let tokens = Prism.tokenize(code, Prism.languages.javascript);
       * tokens.forEach(token => {
       *     if (token instanceof Prism.Token && token.type === 'number') {
       *         console.log(`Found numeric literal: ${token.content}`);
       *     }
       * });
       */
      tokenize: function(k, b) {
        var A = b.rest;
        if (A) {
          for (var M in A)
            b[M] = A[M];
          delete b.rest;
        }
        var R = new f();
        return p(R, R.head, k), h(k, R, b, R.head, 0), w(R);
      },
      /**
       * @namespace
       * @memberof Prism
       * @public
       */
      hooks: {
        all: {},
        /**
         * Adds the given callback to the list of callbacks for the given hook.
         *
         * The callback will be invoked when the hook it is registered for is run.
         * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
         *
         * One callback function can be registered to multiple hooks and the same hook multiple times.
         *
         * @param {string} name The name of the hook.
         * @param {HookCallback} callback The callback function which is given environment variables.
         * @public
         */
        add: function(k, b) {
          var A = s.hooks.all;
          A[k] = A[k] || [], A[k].push(b);
        },
        /**
         * Runs a hook invoking all registered callbacks with the given environment variables.
         *
         * Callbacks will be invoked synchronously and in the order in which they were registered.
         *
         * @param {string} name The name of the hook.
         * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
         * @public
         */
        run: function(k, b) {
          var A = s.hooks.all[k];
          if (!(!A || !A.length))
            for (var M = 0, R; R = A[M++]; )
              R(b);
        }
      },
      Token: o
    };
    r.Prism = s;
    function o(k, b, A, M) {
      this.type = k, this.content = b, this.alias = A, this.length = (M || "").length | 0;
    }
    o.stringify = function k(b, A) {
      if (typeof b == "string")
        return b;
      if (Array.isArray(b)) {
        var M = "";
        return b.forEach(function(X) {
          M += k(X, A);
        }), M;
      }
      var R = {
        type: b.type,
        content: k(b.content, A),
        tag: "span",
        classes: ["token", b.type],
        attributes: {},
        language: A
      }, L = b.alias;
      L && (Array.isArray(L) ? Array.prototype.push.apply(R.classes, L) : R.classes.push(L)), s.hooks.run("wrap", R);
      var H = "";
      for (var q in R.attributes)
        H += " " + q + '="' + (R.attributes[q] || "").replace(/"/g, "&quot;") + '"';
      return "<" + R.tag + ' class="' + R.classes.join(" ") + '"' + H + ">" + R.content + "</" + R.tag + ">";
    };
    function u(k, b, A, M) {
      k.lastIndex = b;
      var R = k.exec(A);
      if (R && M && R[1]) {
        var L = R[1].length;
        R.index += L, R[0] = R[0].slice(L);
      }
      return R;
    }
    function h(k, b, A, M, R, L) {
      for (var H in A)
        if (!(!A.hasOwnProperty(H) || !A[H])) {
          var q = A[H];
          q = Array.isArray(q) ? q : [q];
          for (var X = 0; X < q.length; ++X) {
            if (L && L.cause == H + "," + X)
              return;
            var Z = q[X], J = Z.inside, De = !!Z.lookbehind, ye = !!Z.greedy, ve = Z.alias;
            if (ye && !Z.pattern.global) {
              var $e = Z.pattern.toString().match(/[imsuy]*$/)[0];
              Z.pattern = RegExp(Z.pattern.source, $e + "g");
            }
            for (var Me = Z.pattern || Z, ge = M.next, qe = R; ge !== b.tail && !(L && qe >= L.reach); qe += ge.value.length, ge = ge.next) {
              var Ce = ge.value;
              if (b.length > k.length)
                return;
              if (!(Ce instanceof o)) {
                var N = 1, S;
                if (ye) {
                  if (S = u(Me, qe, k, De), !S || S.index >= k.length)
                    break;
                  var P = S.index, T = S.index + S[0].length, z = qe;
                  for (z += ge.value.length; P >= z; )
                    ge = ge.next, z += ge.value.length;
                  if (z -= ge.value.length, qe = z, ge.value instanceof o)
                    continue;
                  for (var C = ge; C !== b.tail && (z < T || typeof C.value == "string"); C = C.next)
                    N++, z += C.value.length;
                  N--, Ce = k.slice(qe, z), S.index -= qe;
                } else if (S = u(Me, 0, Ce, De), !S)
                  continue;
                var P = S.index, I = S[0], ee = Ce.slice(0, P), ue = Ce.slice(P + I.length), fe = qe + Ce.length;
                L && fe > L.reach && (L.reach = fe);
                var ke = ge.prev;
                ee && (ke = p(b, ke, ee), qe += ee.length), g(b, ke, N);
                var W = new o(H, J ? s.tokenize(I, J) : I, ve, I);
                if (ge = p(b, ke, W), ue && p(b, ge, ue), N > 1) {
                  var te = {
                    cause: H + "," + X,
                    reach: fe
                  };
                  h(k, b, A, ge.prev, qe, te), L && te.reach > L.reach && (L.reach = te.reach);
                }
              }
            }
          }
        }
    }
    function f() {
      var k = { value: null, prev: null, next: null }, b = { value: null, prev: k, next: null };
      k.next = b, this.head = k, this.tail = b, this.length = 0;
    }
    function p(k, b, A) {
      var M = b.next, R = { value: A, prev: b, next: M };
      return b.next = R, M.prev = R, k.length++, R;
    }
    function g(k, b, A) {
      for (var M = b.next, R = 0; R < A && M !== k.tail; R++)
        M = M.next;
      b.next = M, M.prev = b, k.length -= R;
    }
    function w(k) {
      for (var b = [], A = k.head.next; A !== k.tail; )
        b.push(A.value), A = A.next;
      return b;
    }
    if (!r.document)
      return r.addEventListener && (s.disableWorkerMessageHandler || r.addEventListener("message", function(k) {
        var b = JSON.parse(k.data), A = b.language, M = b.code, R = b.immediateClose;
        r.postMessage(s.highlight(M, s.languages[A], A)), R && r.close();
      }, !1)), s;
    var v = s.util.currentScript();
    v && (s.filename = v.src, v.hasAttribute("data-manual") && (s.manual = !0));
    function y() {
      s.manual || s.highlightAll();
    }
    if (!s.manual) {
      var E = document.readyState;
      E === "loading" || E === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
    }
    return s;
  }(e);
  n.exports && (n.exports = t), typeof Do < "u" && (Do.Prism = t), t.languages.markup = {
    comment: {
      pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
      greedy: !0
    },
    prolog: {
      pattern: /<\?[\s\S]+?\?>/,
      greedy: !0
    },
    doctype: {
      // https://www.w3.org/TR/xml/#NT-doctypedecl
      pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
      greedy: !0,
      inside: {
        "internal-subset": {
          pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        string: {
          pattern: /"[^"]*"|'[^']*'/,
          greedy: !0
        },
        punctuation: /^<!|>$|[[\]]/,
        "doctype-tag": /^DOCTYPE/i,
        name: /[^\s<>'"]+/
      }
    },
    cdata: {
      pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
      greedy: !0
    },
    tag: {
      pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
      greedy: !0,
      inside: {
        tag: {
          pattern: /^<\/?[^\s>\/]+/,
          inside: {
            punctuation: /^<\/?/,
            namespace: /^[^\s>\/:]+:/
          }
        },
        "special-attr": [],
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
          inside: {
            punctuation: [
              {
                pattern: /^=/,
                alias: "attr-equals"
              },
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\/?>/,
        "attr-name": {
          pattern: /[^\s>\/]+/,
          inside: {
            namespace: /^[^\s>\/:]+:/
          }
        }
      }
    },
    entity: [
      {
        pattern: /&[\da-z]{1,8};/i,
        alias: "named-entity"
      },
      /&#x?[\da-f]{1,8};/i
    ]
  }, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(r) {
    r.type === "entity" && (r.attributes.title = r.content.replace(/&amp;/, "&"));
  }), Object.defineProperty(t.languages.markup.tag, "addInlined", {
    /**
     * Adds an inlined language to markup.
     *
     * An example of an inlined language is CSS with `<style>` tags.
     *
     * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addInlined('style', 'css');
     */
    value: function(a, i) {
      var l = {};
      l["language-" + i] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: t.languages[i]
      }, l.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var s = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: l
        }
      };
      s["language-" + i] = {
        pattern: /[\s\S]+/,
        inside: t.languages[i]
      };
      var o = {};
      o[a] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return a;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: s
      }, t.languages.insertBefore("markup", "cdata", o);
    }
  }), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
    /**
     * Adds an pattern to highlight languages embedded in HTML attributes.
     *
     * An example of an inlined language is CSS with `style` attributes.
     *
     * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addAttribute('style', 'css');
     */
    value: function(r, a) {
      t.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + r + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
          "i"
        ),
        lookbehind: !0,
        inside: {
          "attr-name": /^[^\s=]+/,
          "attr-value": {
            pattern: /=[\s\S]+/,
            inside: {
              value: {
                pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                lookbehind: !0,
                alias: [a, "language-" + a],
                inside: t.languages[a]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(r) {
    var a = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    r.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + a.source + ")*?" + /(?:;|(?=\s*\{))/.source),
        inside: {
          rule: /^@[\w-]+/,
          "selector-function-argument": {
            pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
            lookbehind: !0,
            alias: "selector"
          },
          keyword: {
            pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      url: {
        // https://drafts.csswg.org/css-values-3/#urls
        pattern: RegExp("\\burl\\((?:" + a.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + a.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + a.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: a,
        greedy: !0
      },
      property: {
        pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
        lookbehind: !0
      },
      important: /!important\b/i,
      function: {
        pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
        lookbehind: !0
      },
      punctuation: /[(){};:,]/
    }, r.languages.css.atrule.inside.rest = r.languages.css;
    var i = r.languages.markup;
    i && (i.tag.addInlined("style", "css"), i.tag.addAttribute("style", "css"));
  }(t), t.languages.clike = {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
      lookbehind: !0,
      inside: {
        punctuation: /[.\\]/
      }
    },
    keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b\w+(?=\()/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
    punctuation: /[{}[\];(),.:]/
  }, t.languages.javascript = t.languages.extend("clike", {
    "class-name": [
      t.languages.clike["class-name"],
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
        lookbehind: !0
      }
    ],
    keyword: [
      {
        pattern: /((?:^|\})\s*)catch\b/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
        lookbehind: !0
      }
    ],
    // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
    function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
    number: {
      pattern: RegExp(
        /(^|[^\w$])/.source + "(?:" + // constant
        (/NaN|Infinity/.source + "|" + // binary integer
        /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
        /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
        /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
        /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
        /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
      ),
      lookbehind: !0
    },
    operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
  }), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", {
    regex: {
      pattern: RegExp(
        // lookbehind
        // eslint-disable-next-line regexp/no-dupe-characters-character-class
        /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
        // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
        // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
        // with the only syntax, so we have to define 2 different regex patterns.
        /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
        /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
        /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
      ),
      lookbehind: !0,
      greedy: !0,
      inside: {
        "regex-source": {
          pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: t.languages.regex
        },
        "regex-delimiter": /^\/|\/$/,
        "regex-flags": /^[a-z]+$/
      }
    },
    // This must be declared before keyword because we use "function" inside the look-forward
    "function-variable": {
      pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
      alias: "function"
    },
    parameter: [
      {
        pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
        lookbehind: !0,
        inside: t.languages.javascript
      }
    ],
    constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  }), t.languages.insertBefore("javascript", "string", {
    hashbang: {
      pattern: /^#!.*/,
      greedy: !0,
      alias: "comment"
    },
    "template-string": {
      pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
      greedy: !0,
      inside: {
        "template-punctuation": {
          pattern: /^`|`$/,
          alias: "string"
        },
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            },
            rest: t.languages.javascript
          }
        },
        string: /[\s\S]+/
      }
    },
    "string-property": {
      pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    }
  }), t.languages.insertBefore("javascript", "operator", {
    "literal-property": {
      pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
      lookbehind: !0,
      alias: "property"
    }
  }), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(
    /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
    "javascript"
  )), t.languages.js = t.languages.javascript, function() {
    if (typeof t > "u" || typeof document > "u")
      return;
    Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
    var r = "Loading…", a = function(v, y) {
      return "✖ Error " + v + " while fetching file: " + y;
    }, i = "✖ Error: File does not exist or is empty", l = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, s = "data-src-status", o = "loading", u = "loaded", h = "failed", f = "pre[data-src]:not([" + s + '="' + u + '"]):not([' + s + '="' + o + '"])';
    function p(v, y, E) {
      var k = new XMLHttpRequest();
      k.open("GET", v, !0), k.onreadystatechange = function() {
        k.readyState == 4 && (k.status < 400 && k.responseText ? y(k.responseText) : k.status >= 400 ? E(a(k.status, k.statusText)) : E(i));
      }, k.send(null);
    }
    function g(v) {
      var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
      if (y) {
        var E = Number(y[1]), k = y[2], b = y[3];
        return k ? b ? [E, Number(b)] : [E, void 0] : [E, E];
      }
    }
    t.hooks.add("before-highlightall", function(v) {
      v.selector += ", " + f;
    }), t.hooks.add("before-sanity-check", function(v) {
      var y = (
        /** @type {HTMLPreElement} */
        v.element
      );
      if (y.matches(f)) {
        v.code = "", y.setAttribute(s, o);
        var E = y.appendChild(document.createElement("CODE"));
        E.textContent = r;
        var k = y.getAttribute("data-src"), b = v.language;
        if (b === "none") {
          var A = (/\.(\w+)$/.exec(k) || [, "none"])[1];
          b = l[A] || A;
        }
        t.util.setLanguage(E, b), t.util.setLanguage(y, b);
        var M = t.plugins.autoloader;
        M && M.loadLanguages(b), p(
          k,
          function(R) {
            y.setAttribute(s, u);
            var L = g(y.getAttribute("data-range"));
            if (L) {
              var H = R.split(/\r\n?|\n/g), q = L[0], X = L[1] == null ? H.length : L[1];
              q < 0 && (q += H.length), q = Math.max(0, Math.min(q - 1, H.length)), X < 0 && (X += H.length), X = Math.max(0, Math.min(X, H.length)), R = H.slice(q, X).join(`
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(q + 1));
            }
            E.textContent = R, t.highlightElement(E);
          },
          function(R) {
            y.setAttribute(s, h), E.textContent = R;
          }
        );
      }
    }), t.plugins.fileHighlight = {
      /**
       * Executes the File Highlight plugin for all matching `pre` elements under the given container.
       *
       * Note: Elements which are already loaded or currently loading will not be touched by this method.
       *
       * @param {ParentNode} [container=document]
       */
      highlight: function(y) {
        for (var E = (y || document).querySelectorAll(f), k = 0, b; b = E[k++]; )
          t.highlightElement(b);
      }
    };
    var w = !1;
    t.fileHighlight = function() {
      w || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), w = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})($c);
var Fi = $c.exports;
Prism.languages.python = {
  comment: {
    pattern: /(^|[^\\])#.*/,
    lookbehind: !0,
    greedy: !0
  },
  "string-interpolation": {
    pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
    greedy: !0,
    inside: {
      interpolation: {
        // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
        pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
        lookbehind: !0,
        inside: {
          "format-spec": {
            pattern: /(:)[^:(){}]+(?=\}$)/,
            lookbehind: !0
          },
          "conversion-option": {
            pattern: /![sra](?=[:}]$)/,
            alias: "punctuation"
          },
          rest: null
        }
      },
      string: /[\s\S]+/
    }
  },
  "triple-quoted-string": {
    pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
    greedy: !0,
    alias: "string"
  },
  string: {
    pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
    greedy: !0
  },
  function: {
    pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
    lookbehind: !0
  },
  "class-name": {
    pattern: /(\bclass\s+)\w+/i,
    lookbehind: !0
  },
  decorator: {
    pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
    lookbehind: !0,
    alias: ["annotation", "punctuation"],
    inside: {
      punctuation: /\./
    }
  },
  keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
  builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
  boolean: /\b(?:False|None|True)\b/,
  number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
  operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
  punctuation: /[{}[\];(),.:]/
};
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
(function(n) {
  var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, t = {
    "equation-command": {
      pattern: e,
      alias: "regex"
    }
  };
  n.languages.latex = {
    comment: /%.*/,
    // the verbatim environment prints whitespace to the document
    cdata: {
      pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
      lookbehind: !0
    },
    /*
     * equations can be between $$ $$ or $ $ or \( \) or \[ \]
     * (all are multiline)
     */
    equation: [
      {
        pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
        inside: t,
        alias: "string"
      },
      {
        pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0,
        inside: t,
        alias: "string"
      }
    ],
    /*
     * arguments which are keywords or references are highlighted
     * as keywords
     */
    keyword: {
      pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    url: {
      pattern: /(\\url\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    /*
     * section or chapter headlines are highlighted as bold so that
     * they stand out more
     */
    headline: {
      pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0,
      alias: "class-name"
    },
    function: {
      pattern: e,
      alias: "selector"
    },
    punctuation: /[[\]{}&]/
  }, n.languages.tex = n.languages.latex, n.languages.context = n.languages.latex;
})(Prism);
(function(n) {
  var e = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: !0,
    alias: "punctuation",
    // this looks reasonably well in all themes
    inside: null
    // see below
  }, r = {
    bash: t,
    environment: {
      pattern: RegExp("\\$" + e),
      alias: "constant"
    },
    variable: [
      // [0]: Arithmetic Environment
      {
        pattern: /\$?\(\([\s\S]+?\)\)/,
        greedy: !0,
        inside: {
          // If there is a $ sign at the beginning highlight $(( and )) as variable
          variable: [
            {
              pattern: /(^\$\(\([\s\S]+)\)\)/,
              lookbehind: !0
            },
            /^\$\(\(/
          ],
          number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
          // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
          operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
          // If there is no $ sign at the beginning highlight (( and )) as punctuation
          punctuation: /\(\(?|\)\)?|,|;/
        }
      },
      // [1]: Command Substitution
      {
        pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
        greedy: !0,
        inside: {
          variable: /^\$\(|^`|\)$|`$/
        }
      },
      // [2]: Brace expansion
      {
        pattern: /\$\{[^}]+\}/,
        greedy: !0,
        inside: {
          operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
          punctuation: /[\[\]]/,
          environment: {
            pattern: RegExp("(\\{)" + e),
            lookbehind: !0,
            alias: "constant"
          }
        }
      },
      /\$(?:\w+|[#?*!@$])/
    ],
    // Escape sequences from echo and printf's manuals, and escaped quotes.
    entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
  };
  n.languages.bash = {
    shebang: {
      pattern: /^#!\s*\/.*/,
      alias: "important"
    },
    comment: {
      pattern: /(^|[^"{\\$])#.*/,
      lookbehind: !0
    },
    "function-name": [
      // a) function foo {
      // b) foo() {
      // c) function foo() {
      // but not “foo {”
      {
        // a) and c)
        pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
        lookbehind: !0,
        alias: "function"
      },
      {
        // b)
        pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
        alias: "function"
      }
    ],
    // Highlight variable names as variables in for and select beginnings.
    "for-or-select": {
      pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
      alias: "variable",
      lookbehind: !0
    },
    // Highlight variable names as variables in the left-hand part
    // of assignments (“=” and “+=”).
    "assign-left": {
      pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
      inside: {
        environment: {
          pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + e),
          lookbehind: !0,
          alias: "constant"
        }
      },
      alias: "variable",
      lookbehind: !0
    },
    // Highlight parameter names as variables
    parameter: {
      pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
      alias: "variable",
      lookbehind: !0
    },
    string: [
      // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
      {
        pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
        lookbehind: !0,
        greedy: !0,
        inside: r
      },
      // Here-document with quotes around the tag
      // → No expansion (so no “inside”).
      {
        pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          bash: t
        }
      },
      // “Normal” string
      {
        // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
        pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
        lookbehind: !0,
        greedy: !0,
        inside: r
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
        pattern: /(^|[^$\\])'[^']*'/,
        lookbehind: !0,
        greedy: !0
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
        pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
        greedy: !0,
        inside: {
          entity: r.entity
        }
      }
    ],
    environment: {
      pattern: RegExp("\\$?" + e),
      alias: "constant"
    },
    variable: r.variable,
    function: {
      pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    keyword: {
      pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
    builtin: {
      pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
      lookbehind: !0,
      // Alias added to make those easier to distinguish from strings.
      alias: "class-name"
    },
    boolean: {
      pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    "file-descriptor": {
      pattern: /\B&\d\b/,
      alias: "important"
    },
    operator: {
      // Lots of redirections here, but not just that.
      pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
      inside: {
        "file-descriptor": {
          pattern: /^\d/,
          alias: "important"
        }
      }
    },
    punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
    number: {
      pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
      lookbehind: !0
    }
  }, t.inside = n.languages.bash;
  for (var a = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], i = r.variable[1].inside, l = 0; l < a.length; l++)
    i[a[l]] = n.languages.bash[a[l]];
  n.languages.sh = n.languages.bash, n.languages.shell = n.languages.bash;
})(Prism);
const Pm = '<svg class="md-link-icon" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true" fill="currentColor"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>', Hm = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" color="currentColor" aria-hidden="true" aria-label="Copy" stroke-width="1.3" width="15" height="15">
  <path fill="currentColor" d="M12.728 4.545v8.182H4.545V4.545zm0 -0.909H4.545a0.909 0.909 0 0 0 -0.909 0.909v8.182a0.909 0.909 0 0 0 0.909 0.909h8.182a0.909 0.909 0 0 0 0.909 -0.909V4.545a0.909 0.909 0 0 0 -0.909 -0.909"/>
  <path fill="currentColor" d="M1.818 8.182H0.909V1.818a0.909 0.909 0 0 1 0.909 -0.909h6.364v0.909H1.818Z"/>
</svg>

`, Um = `<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17" aria-hidden="true" aria-label="Copied" fill="none" stroke="currentColor" stroke-width="1.3">
  <path d="m13.813 4.781 -7.438 7.438 -3.188 -3.188"/>
</svg>
`, So = `<button title="copy" class="copy_code_button">
  <span class="copy-text">${Hm}</span>
  <span class="check">${Um}</span>
</button>`, Mc = /[&<>"']/, Gm = new RegExp(Mc.source, "g"), zc = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Vm = new RegExp(zc.source, "g"), jm = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, xo = (n) => jm[n] || "";
function $i(n, e) {
  if (e) {
    if (Mc.test(n))
      return n.replace(Gm, xo);
  } else if (zc.test(n))
    return n.replace(Vm, xo);
  return n;
}
function Wm(n) {
  const e = n.map((t) => ({
    start: new RegExp(t.left.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")),
    end: new RegExp(t.right.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"))
  }));
  return {
    name: "latex",
    level: "block",
    start(t) {
      for (const r of e) {
        const a = t.match(r.start);
        if (a)
          return a.index;
      }
      return -1;
    },
    tokenizer(t, r) {
      for (const a of e) {
        const i = new RegExp(
          `${a.start.source}([\\s\\S]+?)${a.end.source}`
        ).exec(t);
        if (i)
          return {
            type: "latex",
            raw: i[0],
            text: i[1].trim()
          };
      }
    },
    renderer(t) {
      return `<div class="latex-block">${t.text}</div>`;
    }
  };
}
function Ym() {
  return {
    name: "mermaid",
    level: "block",
    start(n) {
      var e;
      return (e = n.match(/^```mermaid\s*\n/)) == null ? void 0 : e.index;
    },
    tokenizer(n) {
      const e = /^```mermaid\s*\n([\s\S]*?)```\s*(?:\n|$)/.exec(n);
      if (e)
        return {
          type: "mermaid",
          raw: e[0],
          text: e[1].trim()
        };
    },
    renderer(n) {
      return `<div class="mermaid">${n.text}</div>
`;
    }
  };
}
const Xm = {
  code(n, e, t) {
    var a;
    const r = ((a = (e ?? "").match(/\S*/)) == null ? void 0 : a[0]) ?? "";
    return n = n.replace(/\n$/, "") + `
`, !r || r === "mermaid" ? '<div class="code_wrap">' + So + "<pre><code>" + (t ? n : $i(n, !0)) + `</code></pre></div>
` : '<div class="code_wrap">' + So + '<pre><code class="language-' + $i(r) + '">' + (t ? n : $i(n, !0)) + `</code></pre></div>
`;
  }
}, Zm = new ls();
function Km({
  header_links: n,
  line_breaks: e,
  latex_delimiters: t
}) {
  const r = new xc();
  r.use(
    {
      gfm: !0,
      pedantic: !1,
      breaks: e
    },
    Mm({
      highlight: (l, s) => {
        var o;
        return (o = Fi.languages) != null && o[s] ? Fi.highlight(l, Fi.languages[s], s) : l;
      }
    }),
    { renderer: Xm }
  ), n && (r.use(Nm()), r.use({
    extensions: [
      {
        name: "heading",
        level: "block",
        renderer(l) {
          const s = l.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + Zm.slug(s), u = l.depth, h = this.parser.parseInline(l.tokens);
          return `<h${u} id="${o}"><a class="md-header-anchor" href="#${o}">${Pm}</a>${h}</h${u}>
`;
        }
      }
    ]
  }));
  const a = Ym(), i = Wm(t);
  return r.use({
    extensions: [a, i]
  }), r;
}
const wl = (n) => JSON.parse(JSON.stringify(n)), Qm = (n) => n.nodeType === 1, Jm = (n) => y4.has(n.tagName), e4 = (n) => "action" in n, t4 = (n) => n.tagName === "IFRAME", r4 = (n) => "formAction" in n, n4 = (n) => "protocol" in n, aa = /* @__PURE__ */ (() => {
  const n = /^(?:\w+script|data):/i;
  return (e) => n.test(e);
})(), a4 = /* @__PURE__ */ (() => {
  const n = /(?:script|data):/i;
  return (e) => n.test(e);
})(), i4 = (n) => {
  const e = {};
  for (let t = 0, r = n.length; t < r; t++) {
    const a = n[t];
    for (const i in a)
      e[i] ? e[i] = e[i].concat(a[i]) : e[i] = a[i];
  }
  return e;
}, Bc = (n, e) => {
  let t = n.firstChild;
  for (; t; ) {
    const r = t.nextSibling;
    Qm(t) && (e(t, n), t.parentNode && Bc(t, e)), t = r;
  }
}, l4 = (n, e) => {
  const t = document.createNodeIterator(n, NodeFilter.SHOW_ELEMENT);
  let r;
  for (; r = t.nextNode(); ) {
    const a = r.parentNode;
    a && e(r, a);
  }
}, s4 = (n, e) => !!globalThis.document && !!globalThis.document.createNodeIterator ? l4(n, e) : Bc(n, e), Lc = [
  "a",
  "abbr",
  "acronym",
  "address",
  "area",
  "article",
  "aside",
  "audio",
  "b",
  "bdi",
  "bdo",
  "bgsound",
  "big",
  "blockquote",
  "body",
  "br",
  "button",
  "canvas",
  "caption",
  "center",
  "cite",
  "code",
  "col",
  "colgroup",
  "datalist",
  "dd",
  "del",
  "details",
  "dfn",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "font",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hgroup",
  "hr",
  "html",
  "i",
  "img",
  "input",
  "ins",
  "kbd",
  "keygen",
  "label",
  "layer",
  "legend",
  "li",
  "link",
  "listing",
  "main",
  "map",
  "mark",
  "marquee",
  "menu",
  "meta",
  "meter",
  "nav",
  "nobr",
  "ol",
  "optgroup",
  "option",
  "output",
  "p",
  "picture",
  "popup",
  "pre",
  "progress",
  "q",
  "rb",
  "rp",
  "rt",
  "rtc",
  "ruby",
  "s",
  "samp",
  "section",
  "select",
  "selectmenu",
  "small",
  "source",
  "span",
  "strike",
  "strong",
  "style",
  "sub",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "track",
  "tt",
  "u",
  "ul",
  "var",
  "video",
  "wbr"
], o4 = [
  "basefont",
  "command",
  "data",
  "iframe",
  "image",
  "plaintext",
  "portal",
  "slot",
  // 'template', //TODO: Not exactly correct to never allow this, too strict
  "textarea",
  "title",
  "xmp"
], u4 = /* @__PURE__ */ new Set([
  ...Lc,
  ...o4
]), Rc = [
  "svg",
  "a",
  "altglyph",
  "altglyphdef",
  "altglyphitem",
  "animatecolor",
  "animatemotion",
  "animatetransform",
  "circle",
  "clippath",
  "defs",
  "desc",
  "ellipse",
  "filter",
  "font",
  "g",
  "glyph",
  "glyphref",
  "hkern",
  "image",
  "line",
  "lineargradient",
  "marker",
  "mask",
  "metadata",
  "mpath",
  "path",
  "pattern",
  "polygon",
  "polyline",
  "radialgradient",
  "rect",
  "stop",
  "style",
  "switch",
  "symbol",
  "text",
  "textpath",
  "title",
  "tref",
  "tspan",
  "view",
  "vkern",
  /* FILTERS */
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feDistantLight",
  "feFlood",
  "feFuncA",
  "feFuncB",
  "feFuncG",
  "feFuncR",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMergeNode",
  "feMorphology",
  "feOffset",
  "fePointLight",
  "feSpecularLighting",
  "feSpotLight",
  "feTile",
  "feTurbulence"
], c4 = [
  "animate",
  "color-profile",
  "cursor",
  "discard",
  "fedropshadow",
  "font-face",
  "font-face-format",
  "font-face-name",
  "font-face-src",
  "font-face-uri",
  "foreignobject",
  "hatch",
  "hatchpath",
  "mesh",
  "meshgradient",
  "meshpatch",
  "meshrow",
  "missing-glyph",
  "script",
  "set",
  "solidcolor",
  "unknown",
  "use"
], h4 = /* @__PURE__ */ new Set([
  ...Rc,
  ...c4
]), qc = [
  "math",
  "menclose",
  "merror",
  "mfenced",
  "mfrac",
  "mglyph",
  "mi",
  "mlabeledtr",
  "mmultiscripts",
  "mn",
  "mo",
  "mover",
  "mpadded",
  "mphantom",
  "mroot",
  "mrow",
  "ms",
  "mspace",
  "msqrt",
  "mstyle",
  "msub",
  "msup",
  "msubsup",
  "mtable",
  "mtd",
  "mtext",
  "mtr",
  "munder",
  "munderover"
], d4 = [
  "maction",
  "maligngroup",
  "malignmark",
  "mlongdiv",
  "mscarries",
  "mscarry",
  "msgroup",
  "mstack",
  "msline",
  "msrow",
  "semantics",
  "annotation",
  "annotation-xml",
  "mprescripts",
  "none"
], f4 = /* @__PURE__ */ new Set([
  ...qc,
  ...d4
]), m4 = [
  "abbr",
  "accept",
  "accept-charset",
  "accesskey",
  "action",
  "align",
  "alink",
  "allow",
  "allowfullscreen",
  "alt",
  "anchor",
  "archive",
  "as",
  "async",
  "autocapitalize",
  "autocomplete",
  "autocorrect",
  "autofocus",
  "autopictureinpicture",
  "autoplay",
  "axis",
  "background",
  "behavior",
  "bgcolor",
  "border",
  "bordercolor",
  "capture",
  "cellpadding",
  "cellspacing",
  "challenge",
  "char",
  "charoff",
  "charset",
  "checked",
  "cite",
  "class",
  "classid",
  "clear",
  "code",
  "codebase",
  "codetype",
  "color",
  "cols",
  "colspan",
  "compact",
  "content",
  "contenteditable",
  "controls",
  "controlslist",
  "conversiondestination",
  "coords",
  "crossorigin",
  "csp",
  "data",
  "datetime",
  "declare",
  "decoding",
  "default",
  "defer",
  "dir",
  "direction",
  "dirname",
  "disabled",
  "disablepictureinpicture",
  "disableremoteplayback",
  "disallowdocumentaccess",
  "download",
  "draggable",
  "elementtiming",
  "enctype",
  "end",
  "enterkeyhint",
  "event",
  "exportparts",
  "face",
  "for",
  "form",
  "formaction",
  "formenctype",
  "formmethod",
  "formnovalidate",
  "formtarget",
  "frame",
  "frameborder",
  "headers",
  "height",
  "hidden",
  "high",
  "href",
  "hreflang",
  "hreftranslate",
  "hspace",
  "http-equiv",
  "id",
  "imagesizes",
  "imagesrcset",
  "importance",
  "impressiondata",
  "impressionexpiry",
  "incremental",
  "inert",
  "inputmode",
  "integrity",
  "invisible",
  "ismap",
  "keytype",
  "kind",
  "label",
  "lang",
  "language",
  "latencyhint",
  "leftmargin",
  "link",
  "list",
  "loading",
  "longdesc",
  "loop",
  "low",
  "lowsrc",
  "manifest",
  "marginheight",
  "marginwidth",
  "max",
  "maxlength",
  "mayscript",
  "media",
  "method",
  "min",
  "minlength",
  "multiple",
  "muted",
  "name",
  "nohref",
  "nomodule",
  "nonce",
  "noresize",
  "noshade",
  "novalidate",
  "nowrap",
  "object",
  "open",
  "optimum",
  "part",
  "pattern",
  "ping",
  "placeholder",
  "playsinline",
  "policy",
  "poster",
  "preload",
  "pseudo",
  "readonly",
  "referrerpolicy",
  "rel",
  "reportingorigin",
  "required",
  "resources",
  "rev",
  "reversed",
  "role",
  "rows",
  "rowspan",
  "rules",
  "sandbox",
  "scheme",
  "scope",
  "scopes",
  "scrollamount",
  "scrolldelay",
  "scrolling",
  "select",
  "selected",
  "shadowroot",
  "shadowrootdelegatesfocus",
  "shape",
  "size",
  "sizes",
  "slot",
  "span",
  "spellcheck",
  "src",
  "srclang",
  "srcset",
  "standby",
  "start",
  "step",
  "style",
  "summary",
  "tabindex",
  "target",
  "text",
  "title",
  "topmargin",
  "translate",
  "truespeed",
  "trusttoken",
  "type",
  "usemap",
  "valign",
  "value",
  "valuetype",
  "version",
  "virtualkeyboardpolicy",
  "vlink",
  "vspace",
  "webkitdirectory",
  "width",
  "wrap"
], p4 = [
  "accent-height",
  "accumulate",
  "additive",
  "alignment-baseline",
  "ascent",
  "attributename",
  "attributetype",
  "azimuth",
  "basefrequency",
  "baseline-shift",
  "begin",
  "bias",
  "by",
  "class",
  "clip",
  "clippathunits",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "cx",
  "cy",
  "d",
  "dx",
  "dy",
  "diffuseconstant",
  "direction",
  "display",
  "divisor",
  "dominant-baseline",
  "dur",
  "edgemode",
  "elevation",
  "end",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "filterunits",
  "flood-color",
  "flood-opacity",
  "font-family",
  "font-size",
  "font-size-adjust",
  "font-stretch",
  "font-style",
  "font-variant",
  "font-weight",
  "fx",
  "fy",
  "g1",
  "g2",
  "glyph-name",
  "glyphref",
  "gradientunits",
  "gradienttransform",
  "height",
  "href",
  "id",
  "image-rendering",
  "in",
  "in2",
  "k",
  "k1",
  "k2",
  "k3",
  "k4",
  "kerning",
  "keypoints",
  "keysplines",
  "keytimes",
  "lang",
  "lengthadjust",
  "letter-spacing",
  "kernelmatrix",
  "kernelunitlength",
  "lighting-color",
  "local",
  "marker-end",
  "marker-mid",
  "marker-start",
  "markerheight",
  "markerunits",
  "markerwidth",
  "maskcontentunits",
  "maskunits",
  "max",
  "mask",
  "media",
  "method",
  "mode",
  "min",
  "name",
  "numoctaves",
  "offset",
  "operator",
  "opacity",
  "order",
  "orient",
  "orientation",
  "origin",
  "overflow",
  "paint-order",
  "path",
  "pathlength",
  "patterncontentunits",
  "patterntransform",
  "patternunits",
  "points",
  "preservealpha",
  "preserveaspectratio",
  "primitiveunits",
  "r",
  "rx",
  "ry",
  "radius",
  "refx",
  "refy",
  "repeatcount",
  "repeatdur",
  "restart",
  "result",
  "rotate",
  "scale",
  "seed",
  "shape-rendering",
  "specularconstant",
  "specularexponent",
  "spreadmethod",
  "startoffset",
  "stddeviation",
  "stitchtiles",
  "stop-color",
  "stop-opacity",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke",
  "stroke-width",
  "style",
  "surfacescale",
  "systemlanguage",
  "tabindex",
  "targetx",
  "targety",
  "transform",
  "transform-origin",
  "text-anchor",
  "text-decoration",
  "text-rendering",
  "textlength",
  "type",
  "u1",
  "u2",
  "unicode",
  "values",
  "viewbox",
  "visibility",
  "version",
  "vert-adv-y",
  "vert-origin-x",
  "vert-origin-y",
  "width",
  "word-spacing",
  "wrap",
  "writing-mode",
  "xchannelselector",
  "ychannelselector",
  "x",
  "x1",
  "x2",
  "xmlns",
  "y",
  "y1",
  "y2",
  "z",
  "zoomandpan"
], g4 = [
  "accent",
  "accentunder",
  "align",
  "bevelled",
  "close",
  "columnsalign",
  "columnlines",
  "columnspan",
  "denomalign",
  "depth",
  "dir",
  "display",
  "displaystyle",
  "encoding",
  "fence",
  "frame",
  "height",
  "href",
  "id",
  "largeop",
  "length",
  "linethickness",
  "lspace",
  "lquote",
  "mathbackground",
  "mathcolor",
  "mathsize",
  "mathvariant",
  "maxsize",
  "minsize",
  "movablelimits",
  "notation",
  "numalign",
  "open",
  "rowalign",
  "rowlines",
  "rowspacing",
  "rowspan",
  "rspace",
  "rquote",
  "scriptlevel",
  "scriptminsize",
  "scriptsizemultiplier",
  "selection",
  "separator",
  "separators",
  "stretchy",
  "subscriptshift",
  "supscriptshift",
  "symmetric",
  "voffset",
  "width",
  "xmlns"
], w0 = {
  HTML: "http://www.w3.org/1999/xhtml",
  SVG: "http://www.w3.org/2000/svg",
  MATH: "http://www.w3.org/1998/Math/MathML"
}, _4 = {
  [w0.HTML]: u4,
  [w0.SVG]: h4,
  [w0.MATH]: f4
}, v4 = {
  [w0.HTML]: "html",
  [w0.SVG]: "svg",
  [w0.MATH]: "math"
}, b4 = {
  [w0.HTML]: "",
  [w0.SVG]: "svg:",
  [w0.MATH]: "math:"
}, y4 = /* @__PURE__ */ new Set([
  "A",
  "AREA",
  "BUTTON",
  "FORM",
  "IFRAME",
  "INPUT"
]), Ic = {
  allowComments: !0,
  allowCustomElements: !1,
  allowUnknownMarkup: !1,
  allowElements: [
    ...Lc,
    ...Rc.map((n) => `svg:${n}`),
    ...qc.map((n) => `math:${n}`)
  ],
  allowAttributes: i4([
    Object.fromEntries(m4.map((n) => [n, ["*"]])),
    Object.fromEntries(p4.map((n) => [n, ["svg:*"]])),
    Object.fromEntries(g4.map((n) => [n, ["math:*"]]))
  ])
};
var Mi = function(n, e, t, r, a) {
  if (r === "m") throw new TypeError("Private method is not writable");
  if (r === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
  if (typeof e == "function" ? n !== e || !a : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return r === "a" ? a.call(n, t) : a ? a.value = t : e.set(n, t), t;
}, Ar = function(n, e, t, r) {
  if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return t === "m" ? r : t === "a" ? r.call(n) : r ? r.value : e.get(n);
}, dr, Fa, $a;
class Nc {
  /* CONSTRUCTOR */
  constructor(e = {}) {
    dr.set(this, void 0), Fa.set(this, void 0), $a.set(this, void 0), this.getConfiguration = () => wl(Ar(this, dr, "f")), this.sanitize = (h) => {
      const f = Ar(this, Fa, "f"), p = Ar(this, $a, "f");
      return s4(h, (g, w) => {
        const v = g.namespaceURI || w0.HTML, y = w.namespaceURI || w0.HTML, E = _4[v], k = v4[v], b = b4[v], A = g.tagName.toLowerCase(), M = `${b}${A}`, L = `${b}*`;
        if (!E.has(A) || !f.has(M) || v !== y && A !== k)
          w.removeChild(g);
        else {
          const H = g.getAttributeNames(), q = H.length;
          if (q) {
            for (let X = 0; X < q; X++) {
              const Z = H[X], J = p[Z];
              (!J || !J.has(L) && !J.has(M)) && g.removeAttribute(Z);
            }
            if (Jm(g))
              if (n4(g)) {
                const X = g.getAttribute("href");
                X && a4(X) && aa(g.protocol) && g.removeAttribute("href");
              } else e4(g) ? aa(g.action) && g.removeAttribute("action") : r4(g) ? aa(g.formAction) && g.removeAttribute("formaction") : t4(g) && (aa(g.src) && g.removeAttribute("formaction"), g.setAttribute("sandbox", "allow-scripts"));
          }
        }
      }), h;
    }, this.sanitizeFor = (h, f) => {
      throw new Error('"sanitizeFor" is not implemented yet');
    };
    const { allowComments: t, allowCustomElements: r, allowUnknownMarkup: a, blockElements: i, dropElements: l, dropAttributes: s } = e;
    if (t === !1)
      throw new Error('A false "allowComments" is not supported yet');
    if (r)
      throw new Error('A true "allowCustomElements" is not supported yet');
    if (a)
      throw new Error('A true "allowUnknownMarkup" is not supported yet');
    if (i)
      throw new Error('"blockElements" is not supported yet, use "allowElements" instead');
    if (l)
      throw new Error('"dropElements" is not supported yet, use "allowElements" instead');
    if (s)
      throw new Error('"dropAttributes" is not supported yet, use "allowAttributes" instead');
    Mi(this, dr, wl(Ic), "f");
    const { allowElements: o, allowAttributes: u } = e;
    o && (Ar(this, dr, "f").allowElements = e.allowElements), u && (Ar(this, dr, "f").allowAttributes = e.allowAttributes), Mi(this, Fa, new Set(Ar(this, dr, "f").allowElements), "f"), Mi(this, $a, Object.fromEntries(Object.entries(Ar(this, dr, "f").allowAttributes || {}).map(([h, f]) => [h, new Set(f)])), "f");
  }
}
dr = /* @__PURE__ */ new WeakMap(), Fa = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap();
Nc.getDefaultConfiguration = () => wl(Ic);
const w4 = (n, e) => {
  try {
    return !!n && new URL(n).origin !== new URL(e).origin;
  } catch {
    return !1;
  }
};
function Ao(n, e) {
  const t = new Nc(), r = new DOMParser().parseFromString(n, "text/html");
  return Oc(r.body, "A", (a) => {
    a instanceof HTMLElement && "target" in a && w4(a.getAttribute("href"), e) && (a.setAttribute("target", "_blank"), a.setAttribute("rel", "noopener noreferrer"));
  }), t.sanitize(r).body.innerHTML;
}
function Oc(n, e, t) {
  n && (n.nodeName === e || typeof e == "function") && t(n);
  const r = (n == null ? void 0 : n.childNodes) || [];
  for (let a = 0; a < r.length; a++)
    Oc(r[a], e, t);
}
const Eo = [
  "!--",
  "!doctype",
  "a",
  "abbr",
  "acronym",
  "address",
  "applet",
  "area",
  "article",
  "aside",
  "audio",
  "b",
  "base",
  "basefont",
  "bdi",
  "bdo",
  "big",
  "blockquote",
  "body",
  "br",
  "button",
  "canvas",
  "caption",
  "center",
  "cite",
  "code",
  "col",
  "colgroup",
  "data",
  "datalist",
  "dd",
  "del",
  "details",
  "dfn",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "em",
  "embed",
  "fieldset",
  "figcaption",
  "figure",
  "font",
  "footer",
  "form",
  "frame",
  "frameset",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hgroup",
  "hr",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "link",
  "main",
  "map",
  "mark",
  "menu",
  "meta",
  "meter",
  "nav",
  "noframes",
  "noscript",
  "object",
  "ol",
  "optgroup",
  "option",
  "output",
  "p",
  "param",
  "picture",
  "pre",
  "progress",
  "q",
  "rp",
  "rt",
  "ruby",
  "s",
  "samp",
  "script",
  "search",
  "section",
  "select",
  "small",
  "source",
  "span",
  "strike",
  "strong",
  "style",
  "sub",
  "summary",
  "sup",
  "svg",
  "table",
  "tbody",
  "td",
  "template",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "title",
  "tr",
  "track",
  "tt",
  "u",
  "ul",
  "var",
  "video",
  "wbr"
], k4 = [
  // Base structural elements
  "g",
  "defs",
  "use",
  "symbol",
  // Shape elements
  "rect",
  "circle",
  "ellipse",
  "line",
  "polyline",
  "polygon",
  "path",
  "image",
  // Text elements
  "text",
  "tspan",
  "textPath",
  // Gradient and effects
  "linearGradient",
  "radialGradient",
  "stop",
  "pattern",
  "clipPath",
  "mask",
  "filter",
  // Filter effects
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feGaussianBlur",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTurbulence",
  "feMergeNode",
  "feFuncR",
  "feFuncG",
  "feFuncB",
  "feFuncA",
  "feDistantLight",
  "fePointLight",
  "feSpotLight",
  "feFlood",
  "feTile",
  // Animation elements
  "animate",
  "animateTransform",
  "animateMotion",
  "mpath",
  "set",
  // Interactive and other elements
  "view",
  "cursor",
  "foreignObject",
  "desc",
  "title",
  "metadata",
  "switch"
], D4 = [
  ...Eo,
  ...k4.filter((n) => !Eo.includes(n))
], {
  HtmlTagHydration: S4,
  SvelteComponent: x4,
  attr: A4,
  binding_callbacks: E4,
  children: C4,
  claim_element: T4,
  claim_html_tag: F4,
  detach: Co,
  element: $4,
  init: M4,
  insert_hydration: z4,
  noop: To,
  safe_not_equal: B4,
  toggle_class: ia
} = window.__gradio__svelte__internal, { afterUpdate: L4, tick: R4, onMount: W7 } = window.__gradio__svelte__internal;
function q4(n) {
  let e, t;
  return {
    c() {
      e = $4("span"), t = new S4(!1), this.h();
    },
    l(r) {
      e = T4(r, "SPAN", { class: !0 });
      var a = C4(e);
      t = F4(a, !1), a.forEach(Co), this.h();
    },
    h() {
      t.a = null, A4(e, "class", "md svelte-1m32c2s"), ia(
        e,
        "chatbot",
        /*chatbot*/
        n[0]
      ), ia(
        e,
        "prose",
        /*render_markdown*/
        n[1]
      );
    },
    m(r, a) {
      z4(r, e, a), t.m(
        /*html*/
        n[3],
        e
      ), n[12](e);
    },
    p(r, [a]) {
      a & /*html*/
      8 && t.p(
        /*html*/
        r[3]
      ), a & /*chatbot*/
      1 && ia(
        e,
        "chatbot",
        /*chatbot*/
        r[0]
      ), a & /*render_markdown*/
      2 && ia(
        e,
        "prose",
        /*render_markdown*/
        r[1]
      );
    },
    i: To,
    o: To,
    d(r) {
      r && Co(e), n[12](null);
    }
  };
}
function Fo(n) {
  return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function I4(n, e, t) {
  let { chatbot: r = !0 } = e, { message: a } = e, { sanitize_html: i = !0 } = e, { latex_delimiters: l = [] } = e, { render_markdown: s = !0 } = e, { line_breaks: o = !0 } = e, { header_links: u = !1 } = e, { root: h } = e, { allow_tags: f = !1 } = e, { theme_mode: p = "system" } = e, g, w;
  const v = Km({
    header_links: u,
    line_breaks: o,
    latex_delimiters: l || []
  });
  function y(A, M) {
    if (M === !0) {
      const R = /<\/?([a-zA-Z][a-zA-Z0-9-]*)([\s>])/g;
      return A.replace(R, (L, H, q) => D4.includes(H.toLowerCase()) ? L : L.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
    }
    if (Array.isArray(M)) {
      const R = M.map((H) => ({
        open: new RegExp(`<(${H})(\\s+[^>]*)?>`, "gi"),
        close: new RegExp(`</(${H})>`, "gi")
      }));
      let L = A;
      return R.forEach((H) => {
        L = L.replace(H.open, (q) => q.replace(/</g, "&lt;").replace(/>/g, "&gt;")), L = L.replace(H.close, (q) => q.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
      }), L;
    }
    return A;
  }
  function E(A) {
    let M = A;
    if (s) {
      const R = [];
      l.forEach((L, H) => {
        const q = Fo(L.left), X = Fo(L.right), Z = new RegExp(`${q}([\\s\\S]+?)${X}`, "g");
        M = M.replace(Z, (J, De) => (R.push(J), `%%%LATEX_BLOCK_${R.length - 1}%%%`));
      }), M = v.parse(M), M = M.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (L, H) => R[parseInt(H, 10)]);
    }
    return f && (M = y(M, f)), i && Ao && (M = Ao(M, h)), M;
  }
  async function k(A) {
    if (l.length > 0 && A && l.some((R) => A.includes(R.left) && A.includes(R.right)) && Kf(g, {
      delimiters: l,
      throwOnError: !1
    }), g) {
      const M = g.querySelectorAll(".mermaid");
      if (M.length > 0) {
        await R4();
        const { default: R } = await import("./mermaid.core-BhXGgcjx.js").then((L) => L.by);
        R.initialize({
          startOnLoad: !1,
          theme: p === "dark" ? "dark" : "default",
          securityLevel: "antiscript"
        }), await R.run({
          nodes: Array.from(M).map((L) => L)
        });
      }
    }
  }
  L4(async () => {
    g && document.body.contains(g) ? await k(a) : console.error("Element is not in the DOM");
  });
  function b(A) {
    E4[A ? "unshift" : "push"](() => {
      g = A, t(2, g);
    });
  }
  return n.$$set = (A) => {
    "chatbot" in A && t(0, r = A.chatbot), "message" in A && t(4, a = A.message), "sanitize_html" in A && t(5, i = A.sanitize_html), "latex_delimiters" in A && t(6, l = A.latex_delimiters), "render_markdown" in A && t(1, s = A.render_markdown), "line_breaks" in A && t(7, o = A.line_breaks), "header_links" in A && t(8, u = A.header_links), "root" in A && t(9, h = A.root), "allow_tags" in A && t(10, f = A.allow_tags), "theme_mode" in A && t(11, p = A.theme_mode);
  }, n.$$.update = () => {
    n.$$.dirty & /*message*/
    16 && (a && a.trim() ? t(3, w = E(a)) : t(3, w = ""));
  }, [
    r,
    s,
    g,
    w,
    a,
    i,
    l,
    o,
    u,
    h,
    f,
    p,
    b
  ];
}
class N4 extends x4 {
  constructor(e) {
    super(), M4(this, e, I4, q4, B4, {
      chatbot: 0,
      message: 4,
      sanitize_html: 5,
      latex_delimiters: 6,
      render_markdown: 1,
      line_breaks: 7,
      header_links: 8,
      root: 9,
      allow_tags: 10,
      theme_mode: 11
    });
  }
}
const {
  SvelteComponent: O4,
  attr: P4,
  children: H4,
  claim_component: U4,
  claim_element: G4,
  create_component: V4,
  destroy_component: j4,
  detach: $o,
  element: W4,
  init: Y4,
  insert_hydration: X4,
  mount_component: Z4,
  safe_not_equal: K4,
  transition_in: Q4,
  transition_out: J4
} = window.__gradio__svelte__internal;
function e2(n) {
  let e, t, r;
  return t = new N4({
    props: {
      root: (
        /*root*/
        n[1]
      ),
      message: (
        /*info*/
        n[0]
      ),
      sanitize_html: !0
    }
  }), {
    c() {
      e = W4("div"), V4(t.$$.fragment), this.h();
    },
    l(a) {
      e = G4(a, "DIV", { class: !0 });
      var i = H4(e);
      U4(t.$$.fragment, i), i.forEach($o), this.h();
    },
    h() {
      P4(e, "class", "svelte-17qq50w");
    },
    m(a, i) {
      X4(a, e, i), Z4(t, e, null), r = !0;
    },
    p(a, [i]) {
      const l = {};
      i & /*root*/
      2 && (l.root = /*root*/
      a[1]), i & /*info*/
      1 && (l.message = /*info*/
      a[0]), t.$set(l);
    },
    i(a) {
      r || (Q4(t.$$.fragment, a), r = !0);
    },
    o(a) {
      J4(t.$$.fragment, a), r = !1;
    },
    d(a) {
      a && $o(e), j4(t);
    }
  };
}
function t2(n, e, t) {
  let { info: r } = e, { root: a } = e;
  return n.$$set = (i) => {
    "info" in i && t(0, r = i.info), "root" in i && t(1, a = i.root);
  }, [r, a];
}
class r2 extends O4 {
  constructor(e) {
    super(), Y4(this, e, t2, e2, K4, { info: 0, root: 1 });
  }
}
const {
  SvelteComponent: n2,
  attr: la,
  check_outros: a2,
  children: i2,
  claim_component: l2,
  claim_element: s2,
  claim_space: o2,
  create_component: u2,
  create_slot: c2,
  destroy_component: h2,
  detach: sa,
  element: d2,
  empty: Mo,
  get_all_dirty_from_scope: f2,
  get_slot_changes: m2,
  group_outros: p2,
  init: g2,
  insert_hydration: zi,
  mount_component: _2,
  safe_not_equal: v2,
  space: b2,
  toggle_class: Nr,
  transition_in: gn,
  transition_out: Ma,
  update_slot_base: y2
} = window.__gradio__svelte__internal;
function zo(n) {
  let e, t;
  return e = new r2({
    props: {
      root: (
        /*root*/
        n[2]
      ),
      info: (
        /*info*/
        n[1]
      )
    }
  }), {
    c() {
      u2(e.$$.fragment);
    },
    l(r) {
      l2(e.$$.fragment, r);
    },
    m(r, a) {
      _2(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a & /*root*/
      4 && (i.root = /*root*/
      r[2]), a & /*info*/
      2 && (i.info = /*info*/
      r[1]), e.$set(i);
    },
    i(r) {
      t || (gn(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Ma(e.$$.fragment, r), t = !1;
    },
    d(r) {
      h2(e, r);
    }
  };
}
function w2(n) {
  let e, t, r, a, i;
  const l = (
    /*#slots*/
    n[5].default
  ), s = c2(
    l,
    n,
    /*$$scope*/
    n[4],
    null
  );
  let o = (
    /*info*/
    n[1] && zo(n)
  );
  return {
    c() {
      e = d2("span"), s && s.c(), r = b2(), o && o.c(), a = Mo(), this.h();
    },
    l(u) {
      e = s2(u, "SPAN", {
        "data-testid": !0,
        dir: !0,
        class: !0
      });
      var h = i2(e);
      s && s.l(h), h.forEach(sa), r = o2(u), o && o.l(u), a = Mo(), this.h();
    },
    h() {
      la(e, "data-testid", "block-info"), la(e, "dir", t = /*rtl*/
      n[3] ? "rtl" : "ltr"), la(e, "class", "svelte-zgrq3"), Nr(e, "sr-only", !/*show_label*/
      n[0]), Nr(e, "hide", !/*show_label*/
      n[0]), Nr(
        e,
        "has-info",
        /*info*/
        n[1] != null
      );
    },
    m(u, h) {
      zi(u, e, h), s && s.m(e, null), zi(u, r, h), o && o.m(u, h), zi(u, a, h), i = !0;
    },
    p(u, [h]) {
      s && s.p && (!i || h & /*$$scope*/
      16) && y2(
        s,
        l,
        u,
        /*$$scope*/
        u[4],
        i ? m2(
          l,
          /*$$scope*/
          u[4],
          h,
          null
        ) : f2(
          /*$$scope*/
          u[4]
        ),
        null
      ), (!i || h & /*rtl*/
      8 && t !== (t = /*rtl*/
      u[3] ? "rtl" : "ltr")) && la(e, "dir", t), (!i || h & /*show_label*/
      1) && Nr(e, "sr-only", !/*show_label*/
      u[0]), (!i || h & /*show_label*/
      1) && Nr(e, "hide", !/*show_label*/
      u[0]), (!i || h & /*info*/
      2) && Nr(
        e,
        "has-info",
        /*info*/
        u[1] != null
      ), /*info*/
      u[1] ? o ? (o.p(u, h), h & /*info*/
      2 && gn(o, 1)) : (o = zo(u), o.c(), gn(o, 1), o.m(a.parentNode, a)) : o && (p2(), Ma(o, 1, 1, () => {
        o = null;
      }), a2());
    },
    i(u) {
      i || (gn(s, u), gn(o), i = !0);
    },
    o(u) {
      Ma(s, u), Ma(o), i = !1;
    },
    d(u) {
      u && (sa(e), sa(r), sa(a)), s && s.d(u), o && o.d(u);
    }
  };
}
function k2(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { show_label: i = !0 } = e, { info: l = void 0 } = e, { root: s } = e, { rtl: o = !1 } = e;
  return n.$$set = (u) => {
    "show_label" in u && t(0, i = u.show_label), "info" in u && t(1, l = u.info), "root" in u && t(2, s = u.root), "rtl" in u && t(3, o = u.rtl), "$$scope" in u && t(4, a = u.$$scope);
  }, [i, l, s, o, a, r];
}
class Pc extends n2 {
  constructor(e) {
    super(), g2(this, e, k2, w2, v2, { show_label: 0, info: 1, root: 2, rtl: 3 });
  }
}
const {
  SvelteComponent: Y7,
  append_hydration: X7,
  attr: Z7,
  children: K7,
  claim_component: Q7,
  claim_element: J7,
  claim_space: e8,
  claim_text: t8,
  create_component: r8,
  destroy_component: n8,
  detach: a8,
  element: i8,
  init: l8,
  insert_hydration: s8,
  mount_component: o8,
  safe_not_equal: u8,
  set_data: c8,
  space: h8,
  text: d8,
  toggle_class: f8,
  transition_in: m8,
  transition_out: p8
} = window.__gradio__svelte__internal, {
  SvelteComponent: D2,
  append_hydration: za,
  attr: X0,
  bubble: S2,
  check_outros: x2,
  children: kl,
  claim_component: A2,
  claim_element: Dl,
  claim_space: Bo,
  claim_text: E2,
  construct_svelte_component: Lo,
  create_component: Ro,
  create_slot: C2,
  destroy_component: qo,
  detach: Sn,
  element: Sl,
  get_all_dirty_from_scope: T2,
  get_slot_changes: F2,
  group_outros: $2,
  init: M2,
  insert_hydration: Hc,
  listen: z2,
  mount_component: Io,
  safe_not_equal: B2,
  set_data: L2,
  set_style: oa,
  space: No,
  text: R2,
  toggle_class: wt,
  transition_in: Bi,
  transition_out: Li,
  update_slot_base: q2
} = window.__gradio__svelte__internal;
function Oo(n) {
  let e, t;
  return {
    c() {
      e = Sl("span"), t = R2(
        /*label*/
        n[1]
      ), this.h();
    },
    l(r) {
      e = Dl(r, "SPAN", { class: !0 });
      var a = kl(e);
      t = E2(
        a,
        /*label*/
        n[1]
      ), a.forEach(Sn), this.h();
    },
    h() {
      X0(e, "class", "svelte-qgco6m");
    },
    m(r, a) {
      Hc(r, e, a), za(e, t);
    },
    p(r, a) {
      a & /*label*/
      2 && L2(
        t,
        /*label*/
        r[1]
      );
    },
    d(r) {
      r && Sn(e);
    }
  };
}
function I2(n) {
  let e, t, r, a, i, l, s, o, u = (
    /*show_label*/
    n[2] && Oo(n)
  );
  var h = (
    /*Icon*/
    n[0]
  );
  function f(w, v) {
    return {};
  }
  h && (a = Lo(h, f()));
  const p = (
    /*#slots*/
    n[14].default
  ), g = C2(
    p,
    n,
    /*$$scope*/
    n[13],
    null
  );
  return {
    c() {
      e = Sl("button"), u && u.c(), t = No(), r = Sl("div"), a && Ro(a.$$.fragment), i = No(), g && g.c(), this.h();
    },
    l(w) {
      e = Dl(w, "BUTTON", {
        "aria-label": !0,
        "aria-haspopup": !0,
        title: !0,
        class: !0
      });
      var v = kl(e);
      u && u.l(v), t = Bo(v), r = Dl(v, "DIV", { class: !0 });
      var y = kl(r);
      a && A2(a.$$.fragment, y), i = Bo(y), g && g.l(y), y.forEach(Sn), v.forEach(Sn), this.h();
    },
    h() {
      X0(r, "class", "svelte-qgco6m"), wt(
        r,
        "x-small",
        /*size*/
        n[4] === "x-small"
      ), wt(
        r,
        "small",
        /*size*/
        n[4] === "small"
      ), wt(
        r,
        "large",
        /*size*/
        n[4] === "large"
      ), wt(
        r,
        "medium",
        /*size*/
        n[4] === "medium"
      ), e.disabled = /*disabled*/
      n[7], X0(
        e,
        "aria-label",
        /*label*/
        n[1]
      ), X0(
        e,
        "aria-haspopup",
        /*hasPopup*/
        n[8]
      ), X0(
        e,
        "title",
        /*label*/
        n[1]
      ), X0(e, "class", "svelte-qgco6m"), wt(
        e,
        "pending",
        /*pending*/
        n[3]
      ), wt(
        e,
        "padded",
        /*padded*/
        n[5]
      ), wt(
        e,
        "highlight",
        /*highlight*/
        n[6]
      ), wt(
        e,
        "transparent",
        /*transparent*/
        n[9]
      ), oa(e, "color", !/*disabled*/
      n[7] && /*_color*/
      n[11] ? (
        /*_color*/
        n[11]
      ) : "var(--block-label-text-color)"), oa(e, "--bg-color", /*disabled*/
      n[7] ? "auto" : (
        /*background*/
        n[10]
      ));
    },
    m(w, v) {
      Hc(w, e, v), u && u.m(e, null), za(e, t), za(e, r), a && Io(a, r, null), za(r, i), g && g.m(r, null), l = !0, s || (o = z2(
        e,
        "click",
        /*click_handler*/
        n[15]
      ), s = !0);
    },
    p(w, [v]) {
      if (/*show_label*/
      w[2] ? u ? u.p(w, v) : (u = Oo(w), u.c(), u.m(e, t)) : u && (u.d(1), u = null), v & /*Icon*/
      1 && h !== (h = /*Icon*/
      w[0])) {
        if (a) {
          $2();
          const y = a;
          Li(y.$$.fragment, 1, 0, () => {
            qo(y, 1);
          }), x2();
        }
        h ? (a = Lo(h, f()), Ro(a.$$.fragment), Bi(a.$$.fragment, 1), Io(a, r, i)) : a = null;
      }
      g && g.p && (!l || v & /*$$scope*/
      8192) && q2(
        g,
        p,
        w,
        /*$$scope*/
        w[13],
        l ? F2(
          p,
          /*$$scope*/
          w[13],
          v,
          null
        ) : T2(
          /*$$scope*/
          w[13]
        ),
        null
      ), (!l || v & /*size*/
      16) && wt(
        r,
        "x-small",
        /*size*/
        w[4] === "x-small"
      ), (!l || v & /*size*/
      16) && wt(
        r,
        "small",
        /*size*/
        w[4] === "small"
      ), (!l || v & /*size*/
      16) && wt(
        r,
        "large",
        /*size*/
        w[4] === "large"
      ), (!l || v & /*size*/
      16) && wt(
        r,
        "medium",
        /*size*/
        w[4] === "medium"
      ), (!l || v & /*disabled*/
      128) && (e.disabled = /*disabled*/
      w[7]), (!l || v & /*label*/
      2) && X0(
        e,
        "aria-label",
        /*label*/
        w[1]
      ), (!l || v & /*hasPopup*/
      256) && X0(
        e,
        "aria-haspopup",
        /*hasPopup*/
        w[8]
      ), (!l || v & /*label*/
      2) && X0(
        e,
        "title",
        /*label*/
        w[1]
      ), (!l || v & /*pending*/
      8) && wt(
        e,
        "pending",
        /*pending*/
        w[3]
      ), (!l || v & /*padded*/
      32) && wt(
        e,
        "padded",
        /*padded*/
        w[5]
      ), (!l || v & /*highlight*/
      64) && wt(
        e,
        "highlight",
        /*highlight*/
        w[6]
      ), (!l || v & /*transparent*/
      512) && wt(
        e,
        "transparent",
        /*transparent*/
        w[9]
      ), v & /*disabled, _color*/
      2176 && oa(e, "color", !/*disabled*/
      w[7] && /*_color*/
      w[11] ? (
        /*_color*/
        w[11]
      ) : "var(--block-label-text-color)"), v & /*disabled, background*/
      1152 && oa(e, "--bg-color", /*disabled*/
      w[7] ? "auto" : (
        /*background*/
        w[10]
      ));
    },
    i(w) {
      l || (a && Bi(a.$$.fragment, w), Bi(g, w), l = !0);
    },
    o(w) {
      a && Li(a.$$.fragment, w), Li(g, w), l = !1;
    },
    d(w) {
      w && Sn(e), u && u.d(), a && qo(a), g && g.d(w), s = !1, o();
    }
  };
}
function N2(n, e, t) {
  let r, { $$slots: a = {}, $$scope: i } = e, { Icon: l } = e, { label: s = "" } = e, { show_label: o = !1 } = e, { pending: u = !1 } = e, { size: h = "small" } = e, { padded: f = !0 } = e, { highlight: p = !1 } = e, { disabled: g = !1 } = e, { hasPopup: w = !1 } = e, { color: v = "var(--block-label-text-color)" } = e, { transparent: y = !1 } = e, { background: E = "var(--block-background-fill)" } = e;
  function k(b) {
    S2.call(this, n, b);
  }
  return n.$$set = (b) => {
    "Icon" in b && t(0, l = b.Icon), "label" in b && t(1, s = b.label), "show_label" in b && t(2, o = b.show_label), "pending" in b && t(3, u = b.pending), "size" in b && t(4, h = b.size), "padded" in b && t(5, f = b.padded), "highlight" in b && t(6, p = b.highlight), "disabled" in b && t(7, g = b.disabled), "hasPopup" in b && t(8, w = b.hasPopup), "color" in b && t(12, v = b.color), "transparent" in b && t(9, y = b.transparent), "background" in b && t(10, E = b.background), "$$scope" in b && t(13, i = b.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty & /*highlight, color*/
    4160 && t(11, r = p ? "var(--color-accent)" : v);
  }, [
    l,
    s,
    o,
    u,
    h,
    f,
    p,
    g,
    w,
    y,
    E,
    r,
    v,
    i,
    a,
    k
  ];
}
class O2 extends D2 {
  constructor(e) {
    super(), M2(this, e, N2, I2, B2, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 12,
      transparent: 9,
      background: 10
    });
  }
}
const {
  SvelteComponent: g8,
  append_hydration: _8,
  attr: v8,
  binding_callbacks: b8,
  children: y8,
  claim_element: w8,
  create_slot: k8,
  detach: D8,
  element: S8,
  get_all_dirty_from_scope: x8,
  get_slot_changes: A8,
  init: E8,
  insert_hydration: C8,
  safe_not_equal: T8,
  toggle_class: F8,
  transition_in: $8,
  transition_out: M8,
  update_slot_base: z8
} = window.__gradio__svelte__internal, {
  SvelteComponent: B8,
  append_hydration: L8,
  attr: R8,
  children: q8,
  claim_svg_element: I8,
  detach: N8,
  init: O8,
  insert_hydration: P8,
  noop: H8,
  safe_not_equal: U8,
  svg_element: G8
} = window.__gradio__svelte__internal, {
  SvelteComponent: V8,
  append_hydration: j8,
  attr: W8,
  children: Y8,
  claim_svg_element: X8,
  detach: Z8,
  init: K8,
  insert_hydration: Q8,
  noop: J8,
  safe_not_equal: eg,
  svg_element: tg
} = window.__gradio__svelte__internal, {
  SvelteComponent: rg,
  append_hydration: ng,
  attr: ag,
  children: ig,
  claim_svg_element: lg,
  detach: sg,
  init: og,
  insert_hydration: ug,
  noop: cg,
  safe_not_equal: hg,
  svg_element: dg
} = window.__gradio__svelte__internal, {
  SvelteComponent: fg,
  append_hydration: mg,
  attr: pg,
  children: gg,
  claim_svg_element: _g,
  detach: vg,
  init: bg,
  insert_hydration: yg,
  noop: wg,
  safe_not_equal: kg,
  svg_element: Dg
} = window.__gradio__svelte__internal, {
  SvelteComponent: Sg,
  append_hydration: xg,
  attr: Ag,
  children: Eg,
  claim_svg_element: Cg,
  detach: Tg,
  init: Fg,
  insert_hydration: $g,
  noop: Mg,
  safe_not_equal: zg,
  svg_element: Bg
} = window.__gradio__svelte__internal, {
  SvelteComponent: Lg,
  append_hydration: Rg,
  attr: qg,
  children: Ig,
  claim_svg_element: Ng,
  detach: Og,
  init: Pg,
  insert_hydration: Hg,
  noop: Ug,
  safe_not_equal: Gg,
  svg_element: Vg
} = window.__gradio__svelte__internal, {
  SvelteComponent: jg,
  append_hydration: Wg,
  attr: Yg,
  children: Xg,
  claim_svg_element: Zg,
  detach: Kg,
  init: Qg,
  insert_hydration: Jg,
  noop: e_,
  safe_not_equal: t_,
  svg_element: r_
} = window.__gradio__svelte__internal, {
  SvelteComponent: n_,
  append_hydration: a_,
  attr: i_,
  children: l_,
  claim_svg_element: s_,
  detach: o_,
  init: u_,
  insert_hydration: c_,
  noop: h_,
  safe_not_equal: d_,
  svg_element: f_
} = window.__gradio__svelte__internal, {
  SvelteComponent: m_,
  append_hydration: p_,
  attr: g_,
  children: __,
  claim_svg_element: v_,
  detach: b_,
  init: y_,
  insert_hydration: w_,
  noop: k_,
  safe_not_equal: D_,
  svg_element: S_
} = window.__gradio__svelte__internal, {
  SvelteComponent: x_,
  append_hydration: A_,
  attr: E_,
  children: C_,
  claim_svg_element: T_,
  detach: F_,
  init: $_,
  insert_hydration: M_,
  noop: z_,
  safe_not_equal: B_,
  svg_element: L_
} = window.__gradio__svelte__internal, {
  SvelteComponent: P2,
  append_hydration: H2,
  attr: Qt,
  children: Po,
  claim_svg_element: Ho,
  detach: Ri,
  init: U2,
  insert_hydration: G2,
  noop: qi,
  safe_not_equal: V2,
  svg_element: Uo
} = window.__gradio__svelte__internal;
function j2(n) {
  let e, t;
  return {
    c() {
      e = Uo("svg"), t = Uo("path"), this.h();
    },
    l(r) {
      e = Ho(r, "svg", {
        width: !0,
        height: !0,
        "stroke-width": !0,
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        color: !0
      });
      var a = Po(e);
      t = Ho(a, "path", {
        d: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0
      }), Po(t).forEach(Ri), a.forEach(Ri), this.h();
    },
    h() {
      Qt(t, "d", "M5 13L9 17L19 7"), Qt(t, "stroke", "currentColor"), Qt(t, "stroke-width", "1.5"), Qt(t, "stroke-linecap", "round"), Qt(t, "stroke-linejoin", "round"), Qt(e, "width", "100%"), Qt(e, "height", "100%"), Qt(e, "stroke-width", "1.5"), Qt(e, "viewBox", "0 0 24 24"), Qt(e, "fill", "none"), Qt(e, "xmlns", "http://www.w3.org/2000/svg"), Qt(e, "color", "currentColor");
    },
    m(r, a) {
      G2(r, e, a), H2(e, t);
    },
    p: qi,
    i: qi,
    o: qi,
    d(r) {
      r && Ri(e);
    }
  };
}
class W2 extends P2 {
  constructor(e) {
    super(), U2(this, e, null, j2, V2, {});
  }
}
const {
  SvelteComponent: R_,
  append_hydration: q_,
  attr: I_,
  children: N_,
  claim_svg_element: O_,
  detach: P_,
  init: H_,
  insert_hydration: U_,
  noop: G_,
  safe_not_equal: V_,
  svg_element: j_
} = window.__gradio__svelte__internal, {
  SvelteComponent: Y2,
  append_hydration: Ii,
  attr: d0,
  children: ua,
  claim_svg_element: ca,
  detach: nn,
  init: X2,
  insert_hydration: Z2,
  noop: Ni,
  safe_not_equal: K2,
  set_style: D0,
  svg_element: ha
} = window.__gradio__svelte__internal;
function Q2(n) {
  let e, t, r, a;
  return {
    c() {
      e = ha("svg"), t = ha("g"), r = ha("path"), a = ha("path"), this.h();
    },
    l(i) {
      e = ca(i, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        version: !0,
        xmlns: !0,
        "xmlns:xlink": !0,
        "xml:space": !0,
        stroke: !0,
        style: !0
      });
      var l = ua(e);
      t = ca(l, "g", { transform: !0 });
      var s = ua(t);
      r = ca(s, "path", { d: !0, style: !0 }), ua(r).forEach(nn), s.forEach(nn), a = ca(l, "path", { d: !0, style: !0 }), ua(a).forEach(nn), l.forEach(nn), this.h();
    },
    h() {
      d0(r, "d", "M18,6L6.087,17.913"), D0(r, "fill", "none"), D0(r, "fill-rule", "nonzero"), D0(r, "stroke-width", "2px"), d0(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), d0(a, "d", "M4.364,4.364L19.636,19.636"), D0(a, "fill", "none"), D0(a, "fill-rule", "nonzero"), D0(a, "stroke-width", "2px"), d0(e, "width", "100%"), d0(e, "height", "100%"), d0(e, "viewBox", "0 0 24 24"), d0(e, "version", "1.1"), d0(e, "xmlns", "http://www.w3.org/2000/svg"), d0(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), d0(e, "xml:space", "preserve"), d0(e, "stroke", "currentColor"), D0(e, "fill-rule", "evenodd"), D0(e, "clip-rule", "evenodd"), D0(e, "stroke-linecap", "round"), D0(e, "stroke-linejoin", "round");
    },
    m(i, l) {
      Z2(i, e, l), Ii(e, t), Ii(t, r), Ii(e, a);
    },
    p: Ni,
    i: Ni,
    o: Ni,
    d(i) {
      i && nn(e);
    }
  };
}
class J2 extends Y2 {
  constructor(e) {
    super(), X2(this, e, null, Q2, K2, {});
  }
}
const {
  SvelteComponent: W_,
  append_hydration: Y_,
  attr: X_,
  children: Z_,
  claim_svg_element: K_,
  detach: Q_,
  init: J_,
  insert_hydration: e9,
  noop: t9,
  safe_not_equal: r9,
  svg_element: n9
} = window.__gradio__svelte__internal, {
  SvelteComponent: a9,
  append_hydration: i9,
  attr: l9,
  children: s9,
  claim_svg_element: o9,
  detach: u9,
  init: c9,
  insert_hydration: h9,
  noop: d9,
  safe_not_equal: f9,
  svg_element: m9
} = window.__gradio__svelte__internal, {
  SvelteComponent: p9,
  append_hydration: g9,
  attr: _9,
  children: v9,
  claim_svg_element: b9,
  detach: y9,
  init: w9,
  insert_hydration: k9,
  noop: D9,
  safe_not_equal: S9,
  svg_element: x9
} = window.__gradio__svelte__internal, {
  SvelteComponent: A9,
  append_hydration: E9,
  attr: C9,
  children: T9,
  claim_svg_element: F9,
  detach: $9,
  init: M9,
  insert_hydration: z9,
  noop: B9,
  safe_not_equal: L9,
  svg_element: R9
} = window.__gradio__svelte__internal, {
  SvelteComponent: ep,
  append_hydration: Go,
  attr: S0,
  children: Oi,
  claim_svg_element: Pi,
  detach: da,
  init: tp,
  insert_hydration: rp,
  noop: Hi,
  safe_not_equal: np,
  svg_element: Ui
} = window.__gradio__svelte__internal;
function ap(n) {
  let e, t, r;
  return {
    c() {
      e = Ui("svg"), t = Ui("path"), r = Ui("path"), this.h();
    },
    l(a) {
      e = Pi(a, "svg", {
        xmlns: !0,
        viewBox: !0,
        color: !0,
        "aria-hidden": !0,
        width: !0,
        height: !0
      });
      var i = Oi(e);
      t = Pi(i, "path", { fill: !0, d: !0 }), Oi(t).forEach(da), r = Pi(i, "path", { fill: !0, d: !0 }), Oi(r).forEach(da), i.forEach(da), this.h();
    },
    h() {
      S0(t, "fill", "currentColor"), S0(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), S0(r, "fill", "currentColor"), S0(r, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), S0(e, "xmlns", "http://www.w3.org/2000/svg"), S0(e, "viewBox", "0 0 33 33"), S0(e, "color", "currentColor"), S0(e, "aria-hidden", "true"), S0(e, "width", "100%"), S0(e, "height", "100%");
    },
    m(a, i) {
      rp(a, e, i), Go(e, t), Go(e, r);
    },
    p: Hi,
    i: Hi,
    o: Hi,
    d(a) {
      a && da(e);
    }
  };
}
class ip extends ep {
  constructor(e) {
    super(), tp(this, e, null, ap, np, {});
  }
}
const {
  SvelteComponent: q9,
  append_hydration: I9,
  attr: N9,
  children: O9,
  claim_svg_element: P9,
  detach: H9,
  init: U9,
  insert_hydration: G9,
  noop: V9,
  safe_not_equal: j9,
  svg_element: W9
} = window.__gradio__svelte__internal, {
  SvelteComponent: Y9,
  append_hydration: X9,
  attr: Z9,
  children: K9,
  claim_svg_element: Q9,
  detach: J9,
  init: ev,
  insert_hydration: tv,
  noop: rv,
  safe_not_equal: nv,
  svg_element: av
} = window.__gradio__svelte__internal, {
  SvelteComponent: iv,
  append_hydration: lv,
  attr: sv,
  children: ov,
  claim_svg_element: uv,
  detach: cv,
  init: hv,
  insert_hydration: dv,
  noop: fv,
  safe_not_equal: mv,
  svg_element: pv
} = window.__gradio__svelte__internal, {
  SvelteComponent: gv,
  append_hydration: _v,
  attr: vv,
  children: bv,
  claim_svg_element: yv,
  detach: wv,
  init: kv,
  insert_hydration: Dv,
  noop: Sv,
  safe_not_equal: xv,
  svg_element: Av
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ev,
  append_hydration: Cv,
  attr: Tv,
  children: Fv,
  claim_svg_element: $v,
  detach: Mv,
  init: zv,
  insert_hydration: Bv,
  noop: Lv,
  safe_not_equal: Rv,
  svg_element: qv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Iv,
  append_hydration: Nv,
  attr: Ov,
  children: Pv,
  claim_svg_element: Hv,
  detach: Uv,
  init: Gv,
  insert_hydration: Vv,
  noop: jv,
  safe_not_equal: Wv,
  svg_element: Yv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Xv,
  append_hydration: Zv,
  attr: Kv,
  children: Qv,
  claim_svg_element: Jv,
  detach: eb,
  init: tb,
  insert_hydration: rb,
  noop: nb,
  safe_not_equal: ab,
  svg_element: ib
} = window.__gradio__svelte__internal, {
  SvelteComponent: lb,
  append_hydration: sb,
  attr: ob,
  children: ub,
  claim_svg_element: cb,
  detach: hb,
  init: db,
  insert_hydration: fb,
  noop: mb,
  safe_not_equal: pb,
  svg_element: gb
} = window.__gradio__svelte__internal, {
  SvelteComponent: _b,
  append_hydration: vb,
  attr: bb,
  children: yb,
  claim_svg_element: wb,
  detach: kb,
  init: Db,
  insert_hydration: Sb,
  noop: xb,
  safe_not_equal: Ab,
  svg_element: Eb
} = window.__gradio__svelte__internal, {
  SvelteComponent: Cb,
  append_hydration: Tb,
  attr: Fb,
  children: $b,
  claim_svg_element: Mb,
  detach: zb,
  init: Bb,
  insert_hydration: Lb,
  noop: Rb,
  safe_not_equal: qb,
  svg_element: Ib
} = window.__gradio__svelte__internal, {
  SvelteComponent: Nb,
  append_hydration: Ob,
  attr: Pb,
  children: Hb,
  claim_svg_element: Ub,
  detach: Gb,
  init: Vb,
  insert_hydration: jb,
  noop: Wb,
  safe_not_equal: Yb,
  svg_element: Xb
} = window.__gradio__svelte__internal, {
  SvelteComponent: Zb,
  append_hydration: Kb,
  attr: Qb,
  children: Jb,
  claim_svg_element: ey,
  detach: ty,
  init: ry,
  insert_hydration: ny,
  noop: ay,
  safe_not_equal: iy,
  svg_element: ly
} = window.__gradio__svelte__internal, {
  SvelteComponent: sy,
  append_hydration: oy,
  attr: uy,
  children: cy,
  claim_svg_element: hy,
  detach: dy,
  init: fy,
  insert_hydration: my,
  noop: py,
  safe_not_equal: gy,
  svg_element: _y
} = window.__gradio__svelte__internal, {
  SvelteComponent: vy,
  append_hydration: by,
  attr: yy,
  children: wy,
  claim_svg_element: ky,
  detach: Dy,
  init: Sy,
  insert_hydration: xy,
  noop: Ay,
  safe_not_equal: Ey,
  svg_element: Cy
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ty,
  append_hydration: Fy,
  attr: $y,
  children: My,
  claim_svg_element: zy,
  detach: By,
  init: Ly,
  insert_hydration: Ry,
  noop: qy,
  safe_not_equal: Iy,
  svg_element: Ny
} = window.__gradio__svelte__internal, {
  SvelteComponent: Oy,
  append_hydration: Py,
  attr: Hy,
  children: Uy,
  claim_svg_element: Gy,
  detach: Vy,
  init: jy,
  insert_hydration: Wy,
  noop: Yy,
  safe_not_equal: Xy,
  svg_element: Zy
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ky,
  append_hydration: Qy,
  attr: Jy,
  children: ew,
  claim_svg_element: tw,
  detach: rw,
  init: nw,
  insert_hydration: aw,
  noop: iw,
  safe_not_equal: lw,
  svg_element: sw
} = window.__gradio__svelte__internal, {
  SvelteComponent: ow,
  append_hydration: uw,
  attr: cw,
  children: hw,
  claim_svg_element: dw,
  detach: fw,
  init: mw,
  insert_hydration: pw,
  noop: gw,
  safe_not_equal: _w,
  svg_element: vw
} = window.__gradio__svelte__internal, {
  SvelteComponent: bw,
  append_hydration: yw,
  attr: ww,
  children: kw,
  claim_svg_element: Dw,
  detach: Sw,
  init: xw,
  insert_hydration: Aw,
  noop: Ew,
  safe_not_equal: Cw,
  svg_element: Tw
} = window.__gradio__svelte__internal, {
  SvelteComponent: Fw,
  append_hydration: $w,
  attr: Mw,
  children: zw,
  claim_svg_element: Bw,
  detach: Lw,
  init: Rw,
  insert_hydration: qw,
  noop: Iw,
  safe_not_equal: Nw,
  svg_element: Ow
} = window.__gradio__svelte__internal, {
  SvelteComponent: Pw,
  append_hydration: Hw,
  attr: Uw,
  children: Gw,
  claim_svg_element: Vw,
  detach: jw,
  init: Ww,
  insert_hydration: Yw,
  noop: Xw,
  safe_not_equal: Zw,
  svg_element: Kw
} = window.__gradio__svelte__internal, {
  SvelteComponent: Qw,
  append_hydration: Jw,
  attr: ek,
  children: tk,
  claim_svg_element: rk,
  detach: nk,
  init: ak,
  insert_hydration: ik,
  noop: lk,
  safe_not_equal: sk,
  svg_element: ok
} = window.__gradio__svelte__internal, {
  SvelteComponent: uk,
  append_hydration: ck,
  attr: hk,
  children: dk,
  claim_svg_element: fk,
  detach: mk,
  init: pk,
  insert_hydration: gk,
  noop: _k,
  safe_not_equal: vk,
  svg_element: bk
} = window.__gradio__svelte__internal, {
  SvelteComponent: yk,
  append_hydration: wk,
  attr: kk,
  children: Dk,
  claim_svg_element: Sk,
  detach: xk,
  init: Ak,
  insert_hydration: Ek,
  noop: Ck,
  safe_not_equal: Tk,
  svg_element: Fk
} = window.__gradio__svelte__internal, {
  SvelteComponent: $k,
  append_hydration: Mk,
  attr: zk,
  children: Bk,
  claim_svg_element: Lk,
  detach: Rk,
  init: qk,
  insert_hydration: Ik,
  noop: Nk,
  safe_not_equal: Ok,
  svg_element: Pk
} = window.__gradio__svelte__internal, {
  SvelteComponent: Hk,
  append_hydration: Uk,
  attr: Gk,
  children: Vk,
  claim_svg_element: jk,
  detach: Wk,
  init: Yk,
  insert_hydration: Xk,
  noop: Zk,
  safe_not_equal: Kk,
  svg_element: Qk
} = window.__gradio__svelte__internal, {
  SvelteComponent: Jk,
  append_hydration: eD,
  attr: tD,
  children: rD,
  claim_svg_element: nD,
  detach: aD,
  init: iD,
  insert_hydration: lD,
  noop: sD,
  safe_not_equal: oD,
  svg_element: uD
} = window.__gradio__svelte__internal, {
  SvelteComponent: cD,
  append_hydration: hD,
  attr: dD,
  children: fD,
  claim_svg_element: mD,
  detach: pD,
  init: gD,
  insert_hydration: _D,
  noop: vD,
  safe_not_equal: bD,
  svg_element: yD
} = window.__gradio__svelte__internal, {
  SvelteComponent: wD,
  append_hydration: kD,
  attr: DD,
  children: SD,
  claim_svg_element: xD,
  detach: AD,
  init: ED,
  insert_hydration: CD,
  noop: TD,
  safe_not_equal: FD,
  svg_element: $D
} = window.__gradio__svelte__internal, {
  SvelteComponent: MD,
  append_hydration: zD,
  attr: BD,
  children: LD,
  claim_svg_element: RD,
  detach: qD,
  init: ID,
  insert_hydration: ND,
  noop: OD,
  safe_not_equal: PD,
  set_style: HD,
  svg_element: UD
} = window.__gradio__svelte__internal, {
  SvelteComponent: GD,
  append_hydration: VD,
  attr: jD,
  children: WD,
  claim_svg_element: YD,
  detach: XD,
  init: ZD,
  insert_hydration: KD,
  noop: QD,
  safe_not_equal: JD,
  svg_element: eS
} = window.__gradio__svelte__internal, {
  SvelteComponent: tS,
  append_hydration: rS,
  attr: nS,
  children: aS,
  claim_svg_element: iS,
  detach: lS,
  init: sS,
  insert_hydration: oS,
  noop: uS,
  safe_not_equal: cS,
  svg_element: hS
} = window.__gradio__svelte__internal, {
  SvelteComponent: lp,
  append_hydration: fa,
  attr: Nt,
  children: an,
  claim_svg_element: ln,
  detach: Or,
  init: sp,
  insert_hydration: op,
  noop: Gi,
  safe_not_equal: up,
  svg_element: sn
} = window.__gradio__svelte__internal;
function cp(n) {
  let e, t, r, a, i;
  return {
    c() {
      e = sn("svg"), t = sn("g"), r = sn("g"), a = sn("g"), i = sn("path"), this.h();
    },
    l(l) {
      e = ln(l, "svg", {
        viewBox: !0,
        width: !0,
        height: !0,
        fill: !0,
        xmlns: !0
      });
      var s = an(e);
      t = ln(s, "g", { id: !0, "stroke-width": !0 }), an(t).forEach(Or), r = ln(s, "g", {
        id: !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0
      }), an(r).forEach(Or), a = ln(s, "g", { id: !0 });
      var o = an(a);
      i = ln(o, "path", { d: !0, fill: !0 }), an(i).forEach(Or), o.forEach(Or), s.forEach(Or), this.h();
    },
    h() {
      Nt(t, "id", "SVGRepo_bgCarrier"), Nt(t, "stroke-width", "0"), Nt(r, "id", "SVGRepo_tracerCarrier"), Nt(r, "stroke-linecap", "round"), Nt(r, "stroke-linejoin", "round"), Nt(i, "d", "M19.1168 12.1484C19.474 12.3581 19.9336 12.2384 20.1432 11.8811C20.3528 11.5238 20.2331 11.0643 19.8758 10.8547L19.1168 12.1484ZM6.94331 4.13656L6.55624 4.77902L6.56378 4.78344L6.94331 4.13656ZM5.92408 4.1598L5.50816 3.5357L5.50816 3.5357L5.92408 4.1598ZM5.51031 5.09156L4.76841 5.20151C4.77575 5.25101 4.78802 5.29965 4.80505 5.34671L5.51031 5.09156ZM7.12405 11.7567C7.26496 12.1462 7.69495 12.3477 8.08446 12.2068C8.47397 12.0659 8.67549 11.6359 8.53458 11.2464L7.12405 11.7567ZM19.8758 12.1484C20.2331 11.9388 20.3528 11.4793 20.1432 11.122C19.9336 10.7648 19.474 10.6451 19.1168 10.8547L19.8758 12.1484ZM6.94331 18.8666L6.56375 18.2196L6.55627 18.2241L6.94331 18.8666ZM5.92408 18.8433L5.50815 19.4674H5.50815L5.92408 18.8433ZM5.51031 17.9116L4.80505 17.6564C4.78802 17.7035 4.77575 17.7521 4.76841 17.8016L5.51031 17.9116ZM8.53458 11.7567C8.67549 11.3672 8.47397 10.9372 8.08446 10.7963C7.69495 10.6554 7.26496 10.8569 7.12405 11.2464L8.53458 11.7567ZM19.4963 12.2516C19.9105 12.2516 20.2463 11.9158 20.2463 11.5016C20.2463 11.0873 19.9105 10.7516 19.4963 10.7516V12.2516ZM7.82931 10.7516C7.4151 10.7516 7.07931 11.0873 7.07931 11.5016C7.07931 11.9158 7.4151 12.2516 7.82931 12.2516V10.7516ZM19.8758 10.8547L7.32284 3.48968L6.56378 4.78344L19.1168 12.1484L19.8758 10.8547ZM7.33035 3.49414C6.76609 3.15419 6.05633 3.17038 5.50816 3.5357L6.34 4.78391C6.40506 4.74055 6.4893 4.73863 6.55627 4.77898L7.33035 3.49414ZM5.50816 3.5357C4.95998 3.90102 4.67184 4.54987 4.76841 5.20151L6.25221 4.98161C6.24075 4.90427 6.27494 4.82727 6.34 4.78391L5.50816 3.5357ZM4.80505 5.34671L7.12405 11.7567L8.53458 11.2464L6.21558 4.83641L4.80505 5.34671ZM19.1168 10.8547L6.56378 18.2197L7.32284 19.5134L19.8758 12.1484L19.1168 10.8547ZM6.55627 18.2241C6.4893 18.2645 6.40506 18.2626 6.34 18.2192L5.50815 19.4674C6.05633 19.8327 6.76609 19.8489 7.33035 19.509L6.55627 18.2241ZM6.34 18.2192C6.27494 18.1759 6.24075 18.0988 6.25221 18.0215L4.76841 17.8016C4.67184 18.4532 4.95998 19.1021 5.50815 19.4674L6.34 18.2192ZM6.21558 18.1667L8.53458 11.7567L7.12405 11.2464L4.80505 17.6564L6.21558 18.1667ZM19.4963 10.7516H7.82931V12.2516H19.4963V10.7516Z"), Nt(i, "fill", "currentColor"), Nt(a, "id", "SVGRepo_iconCarrier"), Nt(e, "viewBox", "0 0 22 24"), Nt(e, "width", "100%"), Nt(e, "height", "100%"), Nt(e, "fill", "none"), Nt(e, "xmlns", "http://www.w3.org/2000/svg");
    },
    m(l, s) {
      op(l, e, s), fa(e, t), fa(e, r), fa(e, a), fa(a, i);
    },
    p: Gi,
    i: Gi,
    o: Gi,
    d(l) {
      l && Or(e);
    }
  };
}
class hp extends lp {
  constructor(e) {
    super(), sp(this, e, null, cp, up, {});
  }
}
const {
  SvelteComponent: dS,
  append_hydration: fS,
  attr: mS,
  children: pS,
  claim_svg_element: gS,
  detach: _S,
  init: vS,
  insert_hydration: bS,
  noop: yS,
  safe_not_equal: wS,
  svg_element: kS
} = window.__gradio__svelte__internal, {
  SvelteComponent: DS,
  append_hydration: SS,
  attr: xS,
  children: AS,
  claim_svg_element: ES,
  detach: CS,
  init: TS,
  insert_hydration: FS,
  noop: $S,
  safe_not_equal: MS,
  svg_element: zS
} = window.__gradio__svelte__internal, {
  SvelteComponent: dp,
  append_hydration: fp,
  attr: gt,
  children: Vo,
  claim_svg_element: jo,
  detach: Vi,
  init: mp,
  insert_hydration: pp,
  noop: Wo,
  safe_not_equal: gp,
  svg_element: Yo
} = window.__gradio__svelte__internal;
function _p(n) {
  let e, t, r;
  return {
    c() {
      e = Yo("svg"), t = Yo("rect"), this.h();
    },
    l(a) {
      e = jo(a, "svg", {
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0,
        fill: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        class: !0
      });
      var i = Vo(e);
      t = jo(i, "rect", {
        x: !0,
        y: !0,
        width: !0,
        height: !0,
        rx: !0,
        ry: !0
      }), Vo(t).forEach(Vi), i.forEach(Vi), this.h();
    },
    h() {
      gt(t, "x", "3"), gt(t, "y", "3"), gt(t, "width", "18"), gt(t, "height", "18"), gt(t, "rx", "2"), gt(t, "ry", "2"), gt(e, "xmlns", "http://www.w3.org/2000/svg"), gt(e, "width", "100%"), gt(e, "height", "100%"), gt(e, "viewBox", "0 0 24 24"), gt(
        e,
        "fill",
        /*fill*/
        n[0]
      ), gt(e, "stroke", "currentColor"), gt(e, "stroke-width", r = `${/*stroke_width*/
      n[1]}`), gt(e, "stroke-linecap", "round"), gt(e, "stroke-linejoin", "round"), gt(e, "class", "feather feather-square");
    },
    m(a, i) {
      pp(a, e, i), fp(e, t);
    },
    p(a, [i]) {
      i & /*fill*/
      1 && gt(
        e,
        "fill",
        /*fill*/
        a[0]
      ), i & /*stroke_width*/
      2 && r !== (r = `${/*stroke_width*/
      a[1]}`) && gt(e, "stroke-width", r);
    },
    i: Wo,
    o: Wo,
    d(a) {
      a && Vi(e);
    }
  };
}
function vp(n, e, t) {
  let { fill: r = "currentColor" } = e, { stroke_width: a = 1.5 } = e;
  return n.$$set = (i) => {
    "fill" in i && t(0, r = i.fill), "stroke_width" in i && t(1, a = i.stroke_width);
  }, [r, a];
}
class bp extends dp {
  constructor(e) {
    super(), mp(this, e, vp, _p, gp, { fill: 0, stroke_width: 1 });
  }
}
const {
  SvelteComponent: BS,
  append_hydration: LS,
  attr: RS,
  children: qS,
  claim_svg_element: IS,
  detach: NS,
  init: OS,
  insert_hydration: PS,
  noop: HS,
  safe_not_equal: US,
  svg_element: GS
} = window.__gradio__svelte__internal, {
  SvelteComponent: VS,
  append_hydration: jS,
  attr: WS,
  children: YS,
  claim_svg_element: XS,
  detach: ZS,
  init: KS,
  insert_hydration: QS,
  noop: JS,
  safe_not_equal: ex,
  svg_element: tx
} = window.__gradio__svelte__internal, {
  SvelteComponent: rx,
  append_hydration: nx,
  attr: ax,
  children: ix,
  claim_svg_element: lx,
  claim_text: sx,
  detach: ox,
  init: ux,
  insert_hydration: cx,
  noop: hx,
  safe_not_equal: dx,
  svg_element: fx,
  text: mx
} = window.__gradio__svelte__internal, {
  SvelteComponent: px,
  append_hydration: gx,
  attr: _x,
  children: vx,
  claim_svg_element: bx,
  detach: yx,
  init: wx,
  insert_hydration: kx,
  noop: Dx,
  safe_not_equal: Sx,
  svg_element: xx
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ax,
  append_hydration: Ex,
  attr: Cx,
  children: Tx,
  claim_svg_element: Fx,
  detach: $x,
  init: Mx,
  insert_hydration: zx,
  noop: Bx,
  safe_not_equal: Lx,
  svg_element: Rx
} = window.__gradio__svelte__internal, {
  SvelteComponent: qx,
  append_hydration: Ix,
  attr: Nx,
  children: Ox,
  claim_svg_element: Px,
  detach: Hx,
  init: Ux,
  insert_hydration: Gx,
  noop: Vx,
  safe_not_equal: jx,
  svg_element: Wx
} = window.__gradio__svelte__internal, {
  SvelteComponent: Yx,
  append_hydration: Xx,
  attr: Zx,
  children: Kx,
  claim_svg_element: Qx,
  detach: Jx,
  init: eA,
  insert_hydration: tA,
  noop: rA,
  safe_not_equal: nA,
  svg_element: aA
} = window.__gradio__svelte__internal, {
  SvelteComponent: iA,
  append_hydration: lA,
  attr: sA,
  children: oA,
  claim_svg_element: uA,
  detach: cA,
  init: hA,
  insert_hydration: dA,
  noop: fA,
  safe_not_equal: mA,
  svg_element: pA
} = window.__gradio__svelte__internal, {
  SvelteComponent: gA,
  append_hydration: _A,
  attr: vA,
  children: bA,
  claim_svg_element: yA,
  detach: wA,
  init: kA,
  insert_hydration: DA,
  noop: SA,
  safe_not_equal: xA,
  svg_element: AA
} = window.__gradio__svelte__internal, {
  SvelteComponent: EA,
  append_hydration: CA,
  attr: TA,
  children: FA,
  claim_svg_element: $A,
  detach: MA,
  init: zA,
  insert_hydration: BA,
  noop: LA,
  safe_not_equal: RA,
  svg_element: qA
} = window.__gradio__svelte__internal, {
  SvelteComponent: IA,
  append_hydration: NA,
  attr: OA,
  children: PA,
  claim_svg_element: HA,
  claim_text: UA,
  detach: GA,
  init: VA,
  insert_hydration: jA,
  noop: WA,
  safe_not_equal: YA,
  svg_element: XA,
  text: ZA
} = window.__gradio__svelte__internal, {
  SvelteComponent: KA,
  append_hydration: QA,
  attr: JA,
  children: eE,
  claim_svg_element: tE,
  claim_text: rE,
  detach: nE,
  init: aE,
  insert_hydration: iE,
  noop: lE,
  safe_not_equal: sE,
  svg_element: oE,
  text: uE
} = window.__gradio__svelte__internal, {
  SvelteComponent: cE,
  append_hydration: hE,
  attr: dE,
  children: fE,
  claim_svg_element: mE,
  claim_text: pE,
  detach: gE,
  init: _E,
  insert_hydration: vE,
  noop: bE,
  safe_not_equal: yE,
  svg_element: wE,
  text: kE
} = window.__gradio__svelte__internal, {
  SvelteComponent: DE,
  append_hydration: SE,
  attr: xE,
  children: AE,
  claim_svg_element: EE,
  detach: CE,
  init: TE,
  insert_hydration: FE,
  noop: $E,
  safe_not_equal: ME,
  svg_element: zE
} = window.__gradio__svelte__internal, {
  SvelteComponent: BE,
  append_hydration: LE,
  attr: RE,
  children: qE,
  claim_svg_element: IE,
  detach: NE,
  init: OE,
  insert_hydration: PE,
  noop: HE,
  safe_not_equal: UE,
  svg_element: GE
} = window.__gradio__svelte__internal, {
  SvelteComponent: VE,
  append_hydration: jE,
  attr: WE,
  children: YE,
  claim_svg_element: XE,
  detach: ZE,
  init: KE,
  insert_hydration: QE,
  noop: JE,
  safe_not_equal: eC,
  svg_element: tC
} = window.__gradio__svelte__internal, {
  SvelteComponent: rC,
  append_hydration: nC,
  attr: aC,
  children: iC,
  claim_svg_element: lC,
  detach: sC,
  init: oC,
  insert_hydration: uC,
  noop: cC,
  safe_not_equal: hC,
  svg_element: dC
} = window.__gradio__svelte__internal, {
  SvelteComponent: fC,
  append_hydration: mC,
  attr: pC,
  children: gC,
  claim_svg_element: _C,
  detach: vC,
  init: bC,
  insert_hydration: yC,
  noop: wC,
  safe_not_equal: kC,
  svg_element: DC
} = window.__gradio__svelte__internal, {
  SvelteComponent: SC,
  append_hydration: xC,
  attr: AC,
  children: EC,
  claim_svg_element: CC,
  detach: TC,
  init: FC,
  insert_hydration: $C,
  noop: MC,
  safe_not_equal: zC,
  svg_element: BC
} = window.__gradio__svelte__internal, {
  SvelteComponent: LC,
  append_hydration: RC,
  attr: qC,
  children: IC,
  claim_svg_element: NC,
  detach: OC,
  init: PC,
  insert_hydration: HC,
  noop: UC,
  safe_not_equal: GC,
  svg_element: VC
} = window.__gradio__svelte__internal, {
  SvelteComponent: jC,
  append_hydration: WC,
  attr: YC,
  children: XC,
  claim_svg_element: ZC,
  detach: KC,
  init: QC,
  insert_hydration: JC,
  noop: eT,
  safe_not_equal: tT,
  svg_element: rT
} = window.__gradio__svelte__internal, yp = [
  { color: "red", primary: 600, secondary: 100 },
  { color: "green", primary: 600, secondary: 100 },
  { color: "blue", primary: 600, secondary: 100 },
  { color: "yellow", primary: 500, secondary: 100 },
  { color: "purple", primary: 600, secondary: 100 },
  { color: "teal", primary: 600, secondary: 100 },
  { color: "orange", primary: 600, secondary: 100 },
  { color: "cyan", primary: 600, secondary: 100 },
  { color: "lime", primary: 500, secondary: 100 },
  { color: "pink", primary: 600, secondary: 100 }
], Xo = {
  inherit: "inherit",
  current: "currentColor",
  transparent: "transparent",
  black: "#000",
  white: "#fff",
  slate: {
    50: "#f8fafc",
    100: "#f1f5f9",
    200: "#e2e8f0",
    300: "#cbd5e1",
    400: "#94a3b8",
    500: "#64748b",
    600: "#475569",
    700: "#334155",
    800: "#1e293b",
    900: "#0f172a",
    950: "#020617"
  },
  gray: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712"
  },
  zinc: {
    50: "#fafafa",
    100: "#f4f4f5",
    200: "#e4e4e7",
    300: "#d4d4d8",
    400: "#a1a1aa",
    500: "#71717a",
    600: "#52525b",
    700: "#3f3f46",
    800: "#27272a",
    900: "#18181b",
    950: "#09090b"
  },
  neutral: {
    50: "#fafafa",
    100: "#f5f5f5",
    200: "#e5e5e5",
    300: "#d4d4d4",
    400: "#a3a3a3",
    500: "#737373",
    600: "#525252",
    700: "#404040",
    800: "#262626",
    900: "#171717",
    950: "#0a0a0a"
  },
  stone: {
    50: "#fafaf9",
    100: "#f5f5f4",
    200: "#e7e5e4",
    300: "#d6d3d1",
    400: "#a8a29e",
    500: "#78716c",
    600: "#57534e",
    700: "#44403c",
    800: "#292524",
    900: "#1c1917",
    950: "#0c0a09"
  },
  red: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a"
  },
  orange: {
    50: "#fff7ed",
    100: "#ffedd5",
    200: "#fed7aa",
    300: "#fdba74",
    400: "#fb923c",
    500: "#f97316",
    600: "#ea580c",
    700: "#c2410c",
    800: "#9a3412",
    900: "#7c2d12",
    950: "#431407"
  },
  amber: {
    50: "#fffbeb",
    100: "#fef3c7",
    200: "#fde68a",
    300: "#fcd34d",
    400: "#fbbf24",
    500: "#f59e0b",
    600: "#d97706",
    700: "#b45309",
    800: "#92400e",
    900: "#78350f",
    950: "#451a03"
  },
  yellow: {
    50: "#fefce8",
    100: "#fef9c3",
    200: "#fef08a",
    300: "#fde047",
    400: "#facc15",
    500: "#eab308",
    600: "#ca8a04",
    700: "#a16207",
    800: "#854d0e",
    900: "#713f12",
    950: "#422006"
  },
  lime: {
    50: "#f7fee7",
    100: "#ecfccb",
    200: "#d9f99d",
    300: "#bef264",
    400: "#a3e635",
    500: "#84cc16",
    600: "#65a30d",
    700: "#4d7c0f",
    800: "#3f6212",
    900: "#365314",
    950: "#1a2e05"
  },
  green: {
    50: "#f0fdf4",
    100: "#dcfce7",
    200: "#bbf7d0",
    300: "#86efac",
    400: "#4ade80",
    500: "#22c55e",
    600: "#16a34a",
    700: "#15803d",
    800: "#166534",
    900: "#14532d",
    950: "#052e16"
  },
  emerald: {
    50: "#ecfdf5",
    100: "#d1fae5",
    200: "#a7f3d0",
    300: "#6ee7b7",
    400: "#34d399",
    500: "#10b981",
    600: "#059669",
    700: "#047857",
    800: "#065f46",
    900: "#064e3b",
    950: "#022c22"
  },
  teal: {
    50: "#f0fdfa",
    100: "#ccfbf1",
    200: "#99f6e4",
    300: "#5eead4",
    400: "#2dd4bf",
    500: "#14b8a6",
    600: "#0d9488",
    700: "#0f766e",
    800: "#115e59",
    900: "#134e4a",
    950: "#042f2e"
  },
  cyan: {
    50: "#ecfeff",
    100: "#cffafe",
    200: "#a5f3fc",
    300: "#67e8f9",
    400: "#22d3ee",
    500: "#06b6d4",
    600: "#0891b2",
    700: "#0e7490",
    800: "#155e75",
    900: "#164e63",
    950: "#083344"
  },
  sky: {
    50: "#f0f9ff",
    100: "#e0f2fe",
    200: "#bae6fd",
    300: "#7dd3fc",
    400: "#38bdf8",
    500: "#0ea5e9",
    600: "#0284c7",
    700: "#0369a1",
    800: "#075985",
    900: "#0c4a6e",
    950: "#082f49"
  },
  blue: {
    50: "#eff6ff",
    100: "#dbeafe",
    200: "#bfdbfe",
    300: "#93c5fd",
    400: "#60a5fa",
    500: "#3b82f6",
    600: "#2563eb",
    700: "#1d4ed8",
    800: "#1e40af",
    900: "#1e3a8a",
    950: "#172554"
  },
  indigo: {
    50: "#eef2ff",
    100: "#e0e7ff",
    200: "#c7d2fe",
    300: "#a5b4fc",
    400: "#818cf8",
    500: "#6366f1",
    600: "#4f46e5",
    700: "#4338ca",
    800: "#3730a3",
    900: "#312e81",
    950: "#1e1b4b"
  },
  violet: {
    50: "#f5f3ff",
    100: "#ede9fe",
    200: "#ddd6fe",
    300: "#c4b5fd",
    400: "#a78bfa",
    500: "#8b5cf6",
    600: "#7c3aed",
    700: "#6d28d9",
    800: "#5b21b6",
    900: "#4c1d95",
    950: "#2e1065"
  },
  purple: {
    50: "#faf5ff",
    100: "#f3e8ff",
    200: "#e9d5ff",
    300: "#d8b4fe",
    400: "#c084fc",
    500: "#a855f7",
    600: "#9333ea",
    700: "#7e22ce",
    800: "#6b21a8",
    900: "#581c87",
    950: "#3b0764"
  },
  fuchsia: {
    50: "#fdf4ff",
    100: "#fae8ff",
    200: "#f5d0fe",
    300: "#f0abfc",
    400: "#e879f9",
    500: "#d946ef",
    600: "#c026d3",
    700: "#a21caf",
    800: "#86198f",
    900: "#701a75",
    950: "#4a044e"
  },
  pink: {
    50: "#fdf2f8",
    100: "#fce7f3",
    200: "#fbcfe8",
    300: "#f9a8d4",
    400: "#f472b6",
    500: "#ec4899",
    600: "#db2777",
    700: "#be185d",
    800: "#9d174d",
    900: "#831843",
    950: "#500724"
  },
  rose: {
    50: "#fff1f2",
    100: "#ffe4e6",
    200: "#fecdd3",
    300: "#fda4af",
    400: "#fb7185",
    500: "#f43f5e",
    600: "#e11d48",
    700: "#be123c",
    800: "#9f1239",
    900: "#881337",
    950: "#4c0519"
  }
};
yp.reduce(
  (n, { color: e, primary: t, secondary: r }) => ({
    ...n,
    [e]: {
      primary: Xo[e][t],
      secondary: Xo[e][r]
    }
  }),
  {}
);
const {
  SvelteComponent: nT,
  claim_component: aT,
  create_component: iT,
  destroy_component: lT,
  init: sT,
  mount_component: oT,
  safe_not_equal: uT,
  transition_in: cT,
  transition_out: hT
} = window.__gradio__svelte__internal, { createEventDispatcher: dT } = window.__gradio__svelte__internal, {
  SvelteComponent: fT,
  append_hydration: mT,
  attr: pT,
  check_outros: gT,
  children: _T,
  claim_component: vT,
  claim_element: bT,
  claim_space: yT,
  claim_text: wT,
  create_component: kT,
  destroy_component: DT,
  detach: ST,
  element: xT,
  empty: AT,
  group_outros: ET,
  init: CT,
  insert_hydration: TT,
  mount_component: FT,
  safe_not_equal: $T,
  set_data: MT,
  space: zT,
  text: BT,
  toggle_class: LT,
  transition_in: RT,
  transition_out: qT
} = window.__gradio__svelte__internal, {
  SvelteComponent: IT,
  attr: NT,
  children: OT,
  claim_element: PT,
  create_slot: HT,
  detach: UT,
  element: GT,
  get_all_dirty_from_scope: VT,
  get_slot_changes: jT,
  init: WT,
  insert_hydration: YT,
  safe_not_equal: XT,
  toggle_class: ZT,
  transition_in: KT,
  transition_out: QT,
  update_slot_base: JT
} = window.__gradio__svelte__internal, {
  SvelteComponent: eF,
  append_hydration: tF,
  attr: rF,
  check_outros: nF,
  children: aF,
  claim_component: iF,
  claim_element: lF,
  claim_space: sF,
  create_component: oF,
  destroy_component: uF,
  detach: cF,
  element: hF,
  empty: dF,
  group_outros: fF,
  init: mF,
  insert_hydration: pF,
  listen: gF,
  mount_component: _F,
  safe_not_equal: vF,
  space: bF,
  toggle_class: yF,
  transition_in: wF,
  transition_out: kF
} = window.__gradio__svelte__internal, {
  SvelteComponent: DF,
  attr: SF,
  children: xF,
  claim_element: AF,
  create_slot: EF,
  detach: CF,
  element: TF,
  get_all_dirty_from_scope: FF,
  get_slot_changes: $F,
  init: MF,
  insert_hydration: zF,
  null_to_empty: BF,
  safe_not_equal: LF,
  transition_in: RF,
  transition_out: qF,
  update_slot_base: IF
} = window.__gradio__svelte__internal, {
  SvelteComponent: NF,
  check_outros: OF,
  claim_component: PF,
  create_component: HF,
  destroy_component: UF,
  detach: GF,
  empty: VF,
  group_outros: jF,
  init: WF,
  insert_hydration: YF,
  mount_component: XF,
  noop: ZF,
  safe_not_equal: KF,
  transition_in: QF,
  transition_out: JF
} = window.__gradio__svelte__internal, { createEventDispatcher: e$ } = window.__gradio__svelte__internal;
function Vr(n) {
  let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
  for (; n > 1e3 && t < e.length - 1; )
    n /= 1e3, t++;
  let r = e[t];
  return (Number.isInteger(n) ? n : n.toFixed(1)) + r;
}
function Ba() {
}
const wp = (n) => n;
function kp(n, e) {
  return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
}
const Uc = typeof window < "u";
let Zo = Uc ? () => window.performance.now() : () => Date.now(), Gc = Uc ? (n) => requestAnimationFrame(n) : Ba;
const Yr = /* @__PURE__ */ new Set();
function Vc(n) {
  Yr.forEach((e) => {
    e.c(n) || (Yr.delete(e), e.f());
  }), Yr.size !== 0 && Gc(Vc);
}
function Dp(n) {
  let e;
  return Yr.size === 0 && Gc(Vc), {
    promise: new Promise((t) => {
      Yr.add(e = { c: n, f: t });
    }),
    abort() {
      Yr.delete(e);
    }
  };
}
function Sp(n, { delay: e = 0, duration: t = 400, easing: r = wp } = {}) {
  const a = +getComputedStyle(n).opacity;
  return {
    delay: e,
    duration: t,
    easing: r,
    css: (i) => `opacity: ${i * a}`
  };
}
const Pr = [];
function xp(n, e = Ba) {
  let t;
  const r = /* @__PURE__ */ new Set();
  function a(s) {
    if (kp(n, s) && (n = s, t)) {
      const o = !Pr.length;
      for (const u of r)
        u[1](), Pr.push(u, n);
      if (o) {
        for (let u = 0; u < Pr.length; u += 2)
          Pr[u][0](Pr[u + 1]);
        Pr.length = 0;
      }
    }
  }
  function i(s) {
    a(s(n));
  }
  function l(s, o = Ba) {
    const u = [s, o];
    return r.add(u), r.size === 1 && (t = e(a, i) || Ba), s(n), () => {
      r.delete(u), r.size === 0 && t && (t(), t = null);
    };
  }
  return { set: a, update: i, subscribe: l };
}
function Ko(n) {
  return Object.prototype.toString.call(n) === "[object Date]";
}
function xl(n, e, t, r) {
  if (typeof t == "number" || Ko(t)) {
    const a = r - t, i = (t - e) / (n.dt || 1 / 60), l = n.opts.stiffness * a, s = n.opts.damping * i, o = (l - s) * n.inv_mass, u = (i + o) * n.dt;
    return Math.abs(u) < n.opts.precision && Math.abs(a) < n.opts.precision ? r : (n.settled = !1, Ko(t) ? new Date(t.getTime() + u) : t + u);
  } else {
    if (Array.isArray(t))
      return t.map(
        (a, i) => xl(n, e[i], t[i], r[i])
      );
    if (typeof t == "object") {
      const a = {};
      for (const i in t)
        a[i] = xl(n, e[i], t[i], r[i]);
      return a;
    } else
      throw new Error(`Cannot spring ${typeof t} values`);
  }
}
function Qo(n, e = {}) {
  const t = xp(n), { stiffness: r = 0.15, damping: a = 0.8, precision: i = 0.01 } = e;
  let l, s, o, u = n, h = n, f = 1, p = 0, g = !1;
  function w(y, E = {}) {
    h = y;
    const k = o = {};
    return n == null || E.hard || v.stiffness >= 1 && v.damping >= 1 ? (g = !0, l = Zo(), u = y, t.set(n = h), Promise.resolve()) : (E.soft && (p = 1 / ((E.soft === !0 ? 0.5 : +E.soft) * 60), f = 0), s || (l = Zo(), g = !1, s = Dp((b) => {
      if (g)
        return g = !1, s = null, !1;
      f = Math.min(f + p, 1);
      const A = {
        inv_mass: f,
        opts: v,
        settled: !0,
        dt: (b - l) * 60 / 1e3
      }, M = xl(A, u, n, h);
      return l = b, u = n, t.set(n = M), A.settled && (s = null), !A.settled;
    })), new Promise((b) => {
      s.promise.then(() => {
        k === o && b();
      });
    }));
  }
  const v = {
    set: w,
    update: (y, E) => w(y(h, n), E),
    subscribe: t.subscribe,
    stiffness: r,
    damping: a,
    precision: i
  };
  return v;
}
const {
  SvelteComponent: Ap,
  append_hydration: f0,
  attr: Ae,
  children: Jt,
  claim_element: Ep,
  claim_svg_element: m0,
  component_subscribe: Jo,
  detach: Ot,
  element: Cp,
  init: Tp,
  insert_hydration: Fp,
  noop: eu,
  safe_not_equal: $p,
  set_style: ma,
  svg_element: p0,
  toggle_class: tu
} = window.__gradio__svelte__internal, { onMount: Mp } = window.__gradio__svelte__internal;
function zp(n) {
  let e, t, r, a, i, l, s, o, u, h, f, p;
  return {
    c() {
      e = Cp("div"), t = p0("svg"), r = p0("g"), a = p0("path"), i = p0("path"), l = p0("path"), s = p0("path"), o = p0("g"), u = p0("path"), h = p0("path"), f = p0("path"), p = p0("path"), this.h();
    },
    l(g) {
      e = Ep(g, "DIV", { class: !0 });
      var w = Jt(e);
      t = m0(w, "svg", {
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        class: !0
      });
      var v = Jt(t);
      r = m0(v, "g", { style: !0 });
      var y = Jt(r);
      a = m0(y, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), Jt(a).forEach(Ot), i = m0(y, "path", { d: !0, fill: !0, class: !0 }), Jt(i).forEach(Ot), l = m0(y, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), Jt(l).forEach(Ot), s = m0(y, "path", { d: !0, fill: !0, class: !0 }), Jt(s).forEach(Ot), y.forEach(Ot), o = m0(v, "g", { style: !0 });
      var E = Jt(o);
      u = m0(E, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), Jt(u).forEach(Ot), h = m0(E, "path", { d: !0, fill: !0, class: !0 }), Jt(h).forEach(Ot), f = m0(E, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), Jt(f).forEach(Ot), p = m0(E, "path", { d: !0, fill: !0, class: !0 }), Jt(p).forEach(Ot), E.forEach(Ot), v.forEach(Ot), w.forEach(Ot), this.h();
    },
    h() {
      Ae(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), Ae(a, "fill", "#FF7C00"), Ae(a, "fill-opacity", "0.4"), Ae(a, "class", "svelte-43sxxs"), Ae(i, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), Ae(i, "fill", "#FF7C00"), Ae(i, "class", "svelte-43sxxs"), Ae(l, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), Ae(l, "fill", "#FF7C00"), Ae(l, "fill-opacity", "0.4"), Ae(l, "class", "svelte-43sxxs"), Ae(s, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), Ae(s, "fill", "#FF7C00"), Ae(s, "class", "svelte-43sxxs"), ma(r, "transform", "translate(" + /*$top*/
      n[1][0] + "px, " + /*$top*/
      n[1][1] + "px)"), Ae(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), Ae(u, "fill", "#FF7C00"), Ae(u, "fill-opacity", "0.4"), Ae(u, "class", "svelte-43sxxs"), Ae(h, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), Ae(h, "fill", "#FF7C00"), Ae(h, "class", "svelte-43sxxs"), Ae(f, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), Ae(f, "fill", "#FF7C00"), Ae(f, "fill-opacity", "0.4"), Ae(f, "class", "svelte-43sxxs"), Ae(p, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), Ae(p, "fill", "#FF7C00"), Ae(p, "class", "svelte-43sxxs"), ma(o, "transform", "translate(" + /*$bottom*/
      n[2][0] + "px, " + /*$bottom*/
      n[2][1] + "px)"), Ae(t, "viewBox", "-1200 -1200 3000 3000"), Ae(t, "fill", "none"), Ae(t, "xmlns", "http://www.w3.org/2000/svg"), Ae(t, "class", "svelte-43sxxs"), Ae(e, "class", "svelte-43sxxs"), tu(
        e,
        "margin",
        /*margin*/
        n[0]
      );
    },
    m(g, w) {
      Fp(g, e, w), f0(e, t), f0(t, r), f0(r, a), f0(r, i), f0(r, l), f0(r, s), f0(t, o), f0(o, u), f0(o, h), f0(o, f), f0(o, p);
    },
    p(g, [w]) {
      w & /*$top*/
      2 && ma(r, "transform", "translate(" + /*$top*/
      g[1][0] + "px, " + /*$top*/
      g[1][1] + "px)"), w & /*$bottom*/
      4 && ma(o, "transform", "translate(" + /*$bottom*/
      g[2][0] + "px, " + /*$bottom*/
      g[2][1] + "px)"), w & /*margin*/
      1 && tu(
        e,
        "margin",
        /*margin*/
        g[0]
      );
    },
    i: eu,
    o: eu,
    d(g) {
      g && Ot(e);
    }
  };
}
function Bp(n, e, t) {
  let r, a, { margin: i = !0 } = e;
  const l = Qo([0, 0]);
  Jo(n, l, (p) => t(1, r = p));
  const s = Qo([0, 0]);
  Jo(n, s, (p) => t(2, a = p));
  let o;
  async function u() {
    await Promise.all([l.set([125, 140]), s.set([-125, -140])]), await Promise.all([l.set([-125, 140]), s.set([125, -140])]), await Promise.all([l.set([-125, 0]), s.set([125, -0])]), await Promise.all([l.set([125, 0]), s.set([-125, 0])]);
  }
  async function h() {
    await u(), o || h();
  }
  async function f() {
    await Promise.all([l.set([125, 0]), s.set([-125, 0])]), h();
  }
  return Mp(() => (f(), () => o = !0)), n.$$set = (p) => {
    "margin" in p && t(0, i = p.margin);
  }, [i, r, a, l, s];
}
class Lp extends Ap {
  constructor(e) {
    super(), Tp(this, e, Bp, zp, $p, { margin: 0 });
  }
}
const {
  SvelteComponent: Rp,
  append_hydration: Er,
  attr: y0,
  binding_callbacks: ru,
  check_outros: Al,
  children: z0,
  claim_component: jc,
  claim_element: B0,
  claim_space: n0,
  claim_text: Ze,
  create_component: Wc,
  create_slot: Yc,
  destroy_component: Xc,
  destroy_each: Zc,
  detach: ie,
  element: L0,
  empty: u0,
  ensure_array_like: ja,
  get_all_dirty_from_scope: Kc,
  get_slot_changes: Qc,
  group_outros: El,
  init: qp,
  insert_hydration: pe,
  mount_component: Jc,
  noop: Cl,
  safe_not_equal: Ip,
  set_data: c0,
  set_style: gr,
  space: a0,
  text: Ke,
  toggle_class: t0,
  transition_in: b0,
  transition_out: R0,
  update_slot_base: eh
} = window.__gradio__svelte__internal, { tick: Np } = window.__gradio__svelte__internal, { onDestroy: Op } = window.__gradio__svelte__internal, { createEventDispatcher: Pp } = window.__gradio__svelte__internal, Hp = (n) => ({}), nu = (n) => ({}), Up = (n) => ({}), au = (n) => ({});
function iu(n, e, t) {
  const r = n.slice();
  return r[40] = e[t], r[42] = t, r;
}
function lu(n, e, t) {
  const r = n.slice();
  return r[40] = e[t], r;
}
function Gp(n) {
  let e, t, r, a, i = (
    /*i18n*/
    n[1]("common.error") + ""
  ), l, s, o;
  t = new O2({
    props: {
      Icon: J2,
      label: (
        /*i18n*/
        n[1]("common.clear")
      ),
      disabled: !1
    }
  }), t.$on(
    "click",
    /*click_handler*/
    n[32]
  );
  const u = (
    /*#slots*/
    n[30].error
  ), h = Yc(
    u,
    n,
    /*$$scope*/
    n[29],
    nu
  );
  return {
    c() {
      e = L0("div"), Wc(t.$$.fragment), r = a0(), a = L0("span"), l = Ke(i), s = a0(), h && h.c(), this.h();
    },
    l(f) {
      e = B0(f, "DIV", { class: !0 });
      var p = z0(e);
      jc(t.$$.fragment, p), p.forEach(ie), r = n0(f), a = B0(f, "SPAN", { class: !0 });
      var g = z0(a);
      l = Ze(g, i), g.forEach(ie), s = n0(f), h && h.l(f), this.h();
    },
    h() {
      y0(e, "class", "clear-status svelte-17v219f"), y0(a, "class", "error svelte-17v219f");
    },
    m(f, p) {
      pe(f, e, p), Jc(t, e, null), pe(f, r, p), pe(f, a, p), Er(a, l), pe(f, s, p), h && h.m(f, p), o = !0;
    },
    p(f, p) {
      const g = {};
      p[0] & /*i18n*/
      2 && (g.label = /*i18n*/
      f[1]("common.clear")), t.$set(g), (!o || p[0] & /*i18n*/
      2) && i !== (i = /*i18n*/
      f[1]("common.error") + "") && c0(l, i), h && h.p && (!o || p[0] & /*$$scope*/
      536870912) && eh(
        h,
        u,
        f,
        /*$$scope*/
        f[29],
        o ? Qc(
          u,
          /*$$scope*/
          f[29],
          p,
          Hp
        ) : Kc(
          /*$$scope*/
          f[29]
        ),
        nu
      );
    },
    i(f) {
      o || (b0(t.$$.fragment, f), b0(h, f), o = !0);
    },
    o(f) {
      R0(t.$$.fragment, f), R0(h, f), o = !1;
    },
    d(f) {
      f && (ie(e), ie(r), ie(a), ie(s)), Xc(t), h && h.d(f);
    }
  };
}
function Vp(n) {
  let e, t, r, a, i, l, s, o, u, h = (
    /*variant*/
    n[8] === "default" && /*show_eta_bar*/
    n[18] && /*show_progress*/
    n[6] === "full" && su(n)
  );
  function f(b, A) {
    if (
      /*progress*/
      b[7]
    ) return Yp;
    if (
      /*queue_position*/
      b[2] !== null && /*queue_size*/
      b[3] !== void 0 && /*queue_position*/
      b[2] >= 0
    ) return Wp;
    if (
      /*queue_position*/
      b[2] === 0
    ) return jp;
  }
  let p = f(n), g = p && p(n), w = (
    /*timer*/
    n[5] && cu(n)
  );
  const v = [Qp, Kp], y = [];
  function E(b, A) {
    return (
      /*last_progress_level*/
      b[15] != null ? 0 : (
        /*show_progress*/
        b[6] === "full" ? 1 : -1
      )
    );
  }
  ~(i = E(n)) && (l = y[i] = v[i](n));
  let k = !/*timer*/
  n[5] && _u(n);
  return {
    c() {
      h && h.c(), e = a0(), t = L0("div"), g && g.c(), r = a0(), w && w.c(), a = a0(), l && l.c(), s = a0(), k && k.c(), o = u0(), this.h();
    },
    l(b) {
      h && h.l(b), e = n0(b), t = B0(b, "DIV", { class: !0 });
      var A = z0(t);
      g && g.l(A), r = n0(A), w && w.l(A), A.forEach(ie), a = n0(b), l && l.l(b), s = n0(b), k && k.l(b), o = u0(), this.h();
    },
    h() {
      y0(t, "class", "progress-text svelte-17v219f"), t0(
        t,
        "meta-text-center",
        /*variant*/
        n[8] === "center"
      ), t0(
        t,
        "meta-text",
        /*variant*/
        n[8] === "default"
      );
    },
    m(b, A) {
      h && h.m(b, A), pe(b, e, A), pe(b, t, A), g && g.m(t, null), Er(t, r), w && w.m(t, null), pe(b, a, A), ~i && y[i].m(b, A), pe(b, s, A), k && k.m(b, A), pe(b, o, A), u = !0;
    },
    p(b, A) {
      /*variant*/
      b[8] === "default" && /*show_eta_bar*/
      b[18] && /*show_progress*/
      b[6] === "full" ? h ? h.p(b, A) : (h = su(b), h.c(), h.m(e.parentNode, e)) : h && (h.d(1), h = null), p === (p = f(b)) && g ? g.p(b, A) : (g && g.d(1), g = p && p(b), g && (g.c(), g.m(t, r))), /*timer*/
      b[5] ? w ? w.p(b, A) : (w = cu(b), w.c(), w.m(t, null)) : w && (w.d(1), w = null), (!u || A[0] & /*variant*/
      256) && t0(
        t,
        "meta-text-center",
        /*variant*/
        b[8] === "center"
      ), (!u || A[0] & /*variant*/
      256) && t0(
        t,
        "meta-text",
        /*variant*/
        b[8] === "default"
      );
      let M = i;
      i = E(b), i === M ? ~i && y[i].p(b, A) : (l && (El(), R0(y[M], 1, 1, () => {
        y[M] = null;
      }), Al()), ~i ? (l = y[i], l ? l.p(b, A) : (l = y[i] = v[i](b), l.c()), b0(l, 1), l.m(s.parentNode, s)) : l = null), /*timer*/
      b[5] ? k && (El(), R0(k, 1, 1, () => {
        k = null;
      }), Al()) : k ? (k.p(b, A), A[0] & /*timer*/
      32 && b0(k, 1)) : (k = _u(b), k.c(), b0(k, 1), k.m(o.parentNode, o));
    },
    i(b) {
      u || (b0(l), b0(k), u = !0);
    },
    o(b) {
      R0(l), R0(k), u = !1;
    },
    d(b) {
      b && (ie(e), ie(t), ie(a), ie(s), ie(o)), h && h.d(b), g && g.d(), w && w.d(), ~i && y[i].d(b), k && k.d(b);
    }
  };
}
function su(n) {
  let e, t = `translateX(${/*eta_level*/
  (n[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = L0("div"), this.h();
    },
    l(r) {
      e = B0(r, "DIV", { class: !0 }), z0(e).forEach(ie), this.h();
    },
    h() {
      y0(e, "class", "eta-bar svelte-17v219f"), gr(e, "transform", t);
    },
    m(r, a) {
      pe(r, e, a);
    },
    p(r, a) {
      a[0] & /*eta_level*/
      131072 && t !== (t = `translateX(${/*eta_level*/
      (r[17] || 0) * 100 - 100}%)`) && gr(e, "transform", t);
    },
    d(r) {
      r && ie(e);
    }
  };
}
function jp(n) {
  let e;
  return {
    c() {
      e = Ke("processing |");
    },
    l(t) {
      e = Ze(t, "processing |");
    },
    m(t, r) {
      pe(t, e, r);
    },
    p: Cl,
    d(t) {
      t && ie(e);
    }
  };
}
function Wp(n) {
  let e, t = (
    /*queue_position*/
    n[2] + 1 + ""
  ), r, a, i, l;
  return {
    c() {
      e = Ke("queue: "), r = Ke(t), a = Ke("/"), i = Ke(
        /*queue_size*/
        n[3]
      ), l = Ke(" |");
    },
    l(s) {
      e = Ze(s, "queue: "), r = Ze(s, t), a = Ze(s, "/"), i = Ze(
        s,
        /*queue_size*/
        n[3]
      ), l = Ze(s, " |");
    },
    m(s, o) {
      pe(s, e, o), pe(s, r, o), pe(s, a, o), pe(s, i, o), pe(s, l, o);
    },
    p(s, o) {
      o[0] & /*queue_position*/
      4 && t !== (t = /*queue_position*/
      s[2] + 1 + "") && c0(r, t), o[0] & /*queue_size*/
      8 && c0(
        i,
        /*queue_size*/
        s[3]
      );
    },
    d(s) {
      s && (ie(e), ie(r), ie(a), ie(i), ie(l));
    }
  };
}
function Yp(n) {
  let e, t = ja(
    /*progress*/
    n[7]
  ), r = [];
  for (let a = 0; a < t.length; a += 1)
    r[a] = uu(lu(n, t, a));
  return {
    c() {
      for (let a = 0; a < r.length; a += 1)
        r[a].c();
      e = u0();
    },
    l(a) {
      for (let i = 0; i < r.length; i += 1)
        r[i].l(a);
      e = u0();
    },
    m(a, i) {
      for (let l = 0; l < r.length; l += 1)
        r[l] && r[l].m(a, i);
      pe(a, e, i);
    },
    p(a, i) {
      if (i[0] & /*progress*/
      128) {
        t = ja(
          /*progress*/
          a[7]
        );
        let l;
        for (l = 0; l < t.length; l += 1) {
          const s = lu(a, t, l);
          r[l] ? r[l].p(s, i) : (r[l] = uu(s), r[l].c(), r[l].m(e.parentNode, e));
        }
        for (; l < r.length; l += 1)
          r[l].d(1);
        r.length = t.length;
      }
    },
    d(a) {
      a && ie(e), Zc(r, a);
    }
  };
}
function ou(n) {
  let e, t = (
    /*p*/
    n[40].unit + ""
  ), r, a, i = " ", l;
  function s(h, f) {
    return (
      /*p*/
      h[40].length != null ? Zp : Xp
    );
  }
  let o = s(n), u = o(n);
  return {
    c() {
      u.c(), e = a0(), r = Ke(t), a = Ke(" | "), l = Ke(i);
    },
    l(h) {
      u.l(h), e = n0(h), r = Ze(h, t), a = Ze(h, " | "), l = Ze(h, i);
    },
    m(h, f) {
      u.m(h, f), pe(h, e, f), pe(h, r, f), pe(h, a, f), pe(h, l, f);
    },
    p(h, f) {
      o === (o = s(h)) && u ? u.p(h, f) : (u.d(1), u = o(h), u && (u.c(), u.m(e.parentNode, e))), f[0] & /*progress*/
      128 && t !== (t = /*p*/
      h[40].unit + "") && c0(r, t);
    },
    d(h) {
      h && (ie(e), ie(r), ie(a), ie(l)), u.d(h);
    }
  };
}
function Xp(n) {
  let e = Vr(
    /*p*/
    n[40].index || 0
  ) + "", t;
  return {
    c() {
      t = Ke(e);
    },
    l(r) {
      t = Ze(r, e);
    },
    m(r, a) {
      pe(r, t, a);
    },
    p(r, a) {
      a[0] & /*progress*/
      128 && e !== (e = Vr(
        /*p*/
        r[40].index || 0
      ) + "") && c0(t, e);
    },
    d(r) {
      r && ie(t);
    }
  };
}
function Zp(n) {
  let e = Vr(
    /*p*/
    n[40].index || 0
  ) + "", t, r, a = Vr(
    /*p*/
    n[40].length
  ) + "", i;
  return {
    c() {
      t = Ke(e), r = Ke("/"), i = Ke(a);
    },
    l(l) {
      t = Ze(l, e), r = Ze(l, "/"), i = Ze(l, a);
    },
    m(l, s) {
      pe(l, t, s), pe(l, r, s), pe(l, i, s);
    },
    p(l, s) {
      s[0] & /*progress*/
      128 && e !== (e = Vr(
        /*p*/
        l[40].index || 0
      ) + "") && c0(t, e), s[0] & /*progress*/
      128 && a !== (a = Vr(
        /*p*/
        l[40].length
      ) + "") && c0(i, a);
    },
    d(l) {
      l && (ie(t), ie(r), ie(i));
    }
  };
}
function uu(n) {
  let e, t = (
    /*p*/
    n[40].index != null && ou(n)
  );
  return {
    c() {
      t && t.c(), e = u0();
    },
    l(r) {
      t && t.l(r), e = u0();
    },
    m(r, a) {
      t && t.m(r, a), pe(r, e, a);
    },
    p(r, a) {
      /*p*/
      r[40].index != null ? t ? t.p(r, a) : (t = ou(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(r) {
      r && ie(e), t && t.d(r);
    }
  };
}
function cu(n) {
  let e, t = (
    /*eta*/
    n[0] ? `/${/*formatted_eta*/
    n[19]}` : ""
  ), r, a;
  return {
    c() {
      e = Ke(
        /*formatted_timer*/
        n[20]
      ), r = Ke(t), a = Ke("s");
    },
    l(i) {
      e = Ze(
        i,
        /*formatted_timer*/
        n[20]
      ), r = Ze(i, t), a = Ze(i, "s");
    },
    m(i, l) {
      pe(i, e, l), pe(i, r, l), pe(i, a, l);
    },
    p(i, l) {
      l[0] & /*formatted_timer*/
      1048576 && c0(
        e,
        /*formatted_timer*/
        i[20]
      ), l[0] & /*eta, formatted_eta*/
      524289 && t !== (t = /*eta*/
      i[0] ? `/${/*formatted_eta*/
      i[19]}` : "") && c0(r, t);
    },
    d(i) {
      i && (ie(e), ie(r), ie(a));
    }
  };
}
function Kp(n) {
  let e, t;
  return e = new Lp({
    props: { margin: (
      /*variant*/
      n[8] === "default"
    ) }
  }), {
    c() {
      Wc(e.$$.fragment);
    },
    l(r) {
      jc(e.$$.fragment, r);
    },
    m(r, a) {
      Jc(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a[0] & /*variant*/
      256 && (i.margin = /*variant*/
      r[8] === "default"), e.$set(i);
    },
    i(r) {
      t || (b0(e.$$.fragment, r), t = !0);
    },
    o(r) {
      R0(e.$$.fragment, r), t = !1;
    },
    d(r) {
      Xc(e, r);
    }
  };
}
function Qp(n) {
  let e, t, r, a, i, l = `${/*last_progress_level*/
  n[15] * 100}%`, s = (
    /*progress*/
    n[7] != null && hu(n)
  );
  return {
    c() {
      e = L0("div"), t = L0("div"), s && s.c(), r = a0(), a = L0("div"), i = L0("div"), this.h();
    },
    l(o) {
      e = B0(o, "DIV", { class: !0 });
      var u = z0(e);
      t = B0(u, "DIV", { class: !0 });
      var h = z0(t);
      s && s.l(h), h.forEach(ie), r = n0(u), a = B0(u, "DIV", { class: !0 });
      var f = z0(a);
      i = B0(f, "DIV", { class: !0 }), z0(i).forEach(ie), f.forEach(ie), u.forEach(ie), this.h();
    },
    h() {
      y0(t, "class", "progress-level-inner svelte-17v219f"), y0(i, "class", "progress-bar svelte-17v219f"), gr(i, "width", l), y0(a, "class", "progress-bar-wrap svelte-17v219f"), y0(e, "class", "progress-level svelte-17v219f");
    },
    m(o, u) {
      pe(o, e, u), Er(e, t), s && s.m(t, null), Er(e, r), Er(e, a), Er(a, i), n[31](i);
    },
    p(o, u) {
      /*progress*/
      o[7] != null ? s ? s.p(o, u) : (s = hu(o), s.c(), s.m(t, null)) : s && (s.d(1), s = null), u[0] & /*last_progress_level*/
      32768 && l !== (l = `${/*last_progress_level*/
      o[15] * 100}%`) && gr(i, "width", l);
    },
    i: Cl,
    o: Cl,
    d(o) {
      o && ie(e), s && s.d(), n[31](null);
    }
  };
}
function hu(n) {
  let e, t = ja(
    /*progress*/
    n[7]
  ), r = [];
  for (let a = 0; a < t.length; a += 1)
    r[a] = gu(iu(n, t, a));
  return {
    c() {
      for (let a = 0; a < r.length; a += 1)
        r[a].c();
      e = u0();
    },
    l(a) {
      for (let i = 0; i < r.length; i += 1)
        r[i].l(a);
      e = u0();
    },
    m(a, i) {
      for (let l = 0; l < r.length; l += 1)
        r[l] && r[l].m(a, i);
      pe(a, e, i);
    },
    p(a, i) {
      if (i[0] & /*progress_level, progress*/
      16512) {
        t = ja(
          /*progress*/
          a[7]
        );
        let l;
        for (l = 0; l < t.length; l += 1) {
          const s = iu(a, t, l);
          r[l] ? r[l].p(s, i) : (r[l] = gu(s), r[l].c(), r[l].m(e.parentNode, e));
        }
        for (; l < r.length; l += 1)
          r[l].d(1);
        r.length = t.length;
      }
    },
    d(a) {
      a && ie(e), Zc(r, a);
    }
  };
}
function du(n) {
  let e, t, r, a, i = (
    /*i*/
    n[42] !== 0 && Jp()
  ), l = (
    /*p*/
    n[40].desc != null && fu(n)
  ), s = (
    /*p*/
    n[40].desc != null && /*progress_level*/
    n[14] && /*progress_level*/
    n[14][
      /*i*/
      n[42]
    ] != null && mu()
  ), o = (
    /*progress_level*/
    n[14] != null && pu(n)
  );
  return {
    c() {
      i && i.c(), e = a0(), l && l.c(), t = a0(), s && s.c(), r = a0(), o && o.c(), a = u0();
    },
    l(u) {
      i && i.l(u), e = n0(u), l && l.l(u), t = n0(u), s && s.l(u), r = n0(u), o && o.l(u), a = u0();
    },
    m(u, h) {
      i && i.m(u, h), pe(u, e, h), l && l.m(u, h), pe(u, t, h), s && s.m(u, h), pe(u, r, h), o && o.m(u, h), pe(u, a, h);
    },
    p(u, h) {
      /*p*/
      u[40].desc != null ? l ? l.p(u, h) : (l = fu(u), l.c(), l.m(t.parentNode, t)) : l && (l.d(1), l = null), /*p*/
      u[40].desc != null && /*progress_level*/
      u[14] && /*progress_level*/
      u[14][
        /*i*/
        u[42]
      ] != null ? s || (s = mu(), s.c(), s.m(r.parentNode, r)) : s && (s.d(1), s = null), /*progress_level*/
      u[14] != null ? o ? o.p(u, h) : (o = pu(u), o.c(), o.m(a.parentNode, a)) : o && (o.d(1), o = null);
    },
    d(u) {
      u && (ie(e), ie(t), ie(r), ie(a)), i && i.d(u), l && l.d(u), s && s.d(u), o && o.d(u);
    }
  };
}
function Jp(n) {
  let e;
  return {
    c() {
      e = Ke(" /");
    },
    l(t) {
      e = Ze(t, " /");
    },
    m(t, r) {
      pe(t, e, r);
    },
    d(t) {
      t && ie(e);
    }
  };
}
function fu(n) {
  let e = (
    /*p*/
    n[40].desc + ""
  ), t;
  return {
    c() {
      t = Ke(e);
    },
    l(r) {
      t = Ze(r, e);
    },
    m(r, a) {
      pe(r, t, a);
    },
    p(r, a) {
      a[0] & /*progress*/
      128 && e !== (e = /*p*/
      r[40].desc + "") && c0(t, e);
    },
    d(r) {
      r && ie(t);
    }
  };
}
function mu(n) {
  let e;
  return {
    c() {
      e = Ke("-");
    },
    l(t) {
      e = Ze(t, "-");
    },
    m(t, r) {
      pe(t, e, r);
    },
    d(t) {
      t && ie(e);
    }
  };
}
function pu(n) {
  let e = (100 * /*progress_level*/
  (n[14][
    /*i*/
    n[42]
  ] || 0)).toFixed(1) + "", t, r;
  return {
    c() {
      t = Ke(e), r = Ke("%");
    },
    l(a) {
      t = Ze(a, e), r = Ze(a, "%");
    },
    m(a, i) {
      pe(a, t, i), pe(a, r, i);
    },
    p(a, i) {
      i[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (a[14][
        /*i*/
        a[42]
      ] || 0)).toFixed(1) + "") && c0(t, e);
    },
    d(a) {
      a && (ie(t), ie(r));
    }
  };
}
function gu(n) {
  let e, t = (
    /*p*/
    (n[40].desc != null || /*progress_level*/
    n[14] && /*progress_level*/
    n[14][
      /*i*/
      n[42]
    ] != null) && du(n)
  );
  return {
    c() {
      t && t.c(), e = u0();
    },
    l(r) {
      t && t.l(r), e = u0();
    },
    m(r, a) {
      t && t.m(r, a), pe(r, e, a);
    },
    p(r, a) {
      /*p*/
      r[40].desc != null || /*progress_level*/
      r[14] && /*progress_level*/
      r[14][
        /*i*/
        r[42]
      ] != null ? t ? t.p(r, a) : (t = du(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(r) {
      r && ie(e), t && t.d(r);
    }
  };
}
function _u(n) {
  let e, t, r, a;
  const i = (
    /*#slots*/
    n[30]["additional-loading-text"]
  ), l = Yc(
    i,
    n,
    /*$$scope*/
    n[29],
    au
  );
  return {
    c() {
      e = L0("p"), t = Ke(
        /*loading_text*/
        n[9]
      ), r = a0(), l && l.c(), this.h();
    },
    l(s) {
      e = B0(s, "P", { class: !0 });
      var o = z0(e);
      t = Ze(
        o,
        /*loading_text*/
        n[9]
      ), o.forEach(ie), r = n0(s), l && l.l(s), this.h();
    },
    h() {
      y0(e, "class", "loading svelte-17v219f");
    },
    m(s, o) {
      pe(s, e, o), Er(e, t), pe(s, r, o), l && l.m(s, o), a = !0;
    },
    p(s, o) {
      (!a || o[0] & /*loading_text*/
      512) && c0(
        t,
        /*loading_text*/
        s[9]
      ), l && l.p && (!a || o[0] & /*$$scope*/
      536870912) && eh(
        l,
        i,
        s,
        /*$$scope*/
        s[29],
        a ? Qc(
          i,
          /*$$scope*/
          s[29],
          o,
          Up
        ) : Kc(
          /*$$scope*/
          s[29]
        ),
        au
      );
    },
    i(s) {
      a || (b0(l, s), a = !0);
    },
    o(s) {
      R0(l, s), a = !1;
    },
    d(s) {
      s && (ie(e), ie(r)), l && l.d(s);
    }
  };
}
function e5(n) {
  let e, t, r, a, i;
  const l = [Vp, Gp], s = [];
  function o(u, h) {
    return (
      /*status*/
      u[4] === "pending" ? 0 : (
        /*status*/
        u[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(t = o(n)) && (r = s[t] = l[t](n)), {
    c() {
      e = L0("div"), r && r.c(), this.h();
    },
    l(u) {
      e = B0(u, "DIV", { class: !0 });
      var h = z0(e);
      r && r.l(h), h.forEach(ie), this.h();
    },
    h() {
      y0(e, "class", a = "wrap " + /*variant*/
      n[8] + " " + /*show_progress*/
      n[6] + " svelte-17v219f"), t0(e, "hide", !/*status*/
      n[4] || /*status*/
      n[4] === "complete" || /*show_progress*/
      n[6] === "hidden" || /*status*/
      n[4] == "streaming"), t0(
        e,
        "translucent",
        /*variant*/
        n[8] === "center" && /*status*/
        (n[4] === "pending" || /*status*/
        n[4] === "error") || /*translucent*/
        n[11] || /*show_progress*/
        n[6] === "minimal"
      ), t0(
        e,
        "generating",
        /*status*/
        n[4] === "generating" && /*show_progress*/
        n[6] === "full"
      ), t0(
        e,
        "border",
        /*border*/
        n[12]
      ), gr(
        e,
        "position",
        /*absolute*/
        n[10] ? "absolute" : "static"
      ), gr(
        e,
        "padding",
        /*absolute*/
        n[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(u, h) {
      pe(u, e, h), ~t && s[t].m(e, null), n[33](e), i = !0;
    },
    p(u, h) {
      let f = t;
      t = o(u), t === f ? ~t && s[t].p(u, h) : (r && (El(), R0(s[f], 1, 1, () => {
        s[f] = null;
      }), Al()), ~t ? (r = s[t], r ? r.p(u, h) : (r = s[t] = l[t](u), r.c()), b0(r, 1), r.m(e, null)) : r = null), (!i || h[0] & /*variant, show_progress*/
      320 && a !== (a = "wrap " + /*variant*/
      u[8] + " " + /*show_progress*/
      u[6] + " svelte-17v219f")) && y0(e, "class", a), (!i || h[0] & /*variant, show_progress, status, show_progress*/
      336) && t0(e, "hide", !/*status*/
      u[4] || /*status*/
      u[4] === "complete" || /*show_progress*/
      u[6] === "hidden" || /*status*/
      u[4] == "streaming"), (!i || h[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && t0(
        e,
        "translucent",
        /*variant*/
        u[8] === "center" && /*status*/
        (u[4] === "pending" || /*status*/
        u[4] === "error") || /*translucent*/
        u[11] || /*show_progress*/
        u[6] === "minimal"
      ), (!i || h[0] & /*variant, show_progress, status, show_progress*/
      336) && t0(
        e,
        "generating",
        /*status*/
        u[4] === "generating" && /*show_progress*/
        u[6] === "full"
      ), (!i || h[0] & /*variant, show_progress, border*/
      4416) && t0(
        e,
        "border",
        /*border*/
        u[12]
      ), h[0] & /*absolute*/
      1024 && gr(
        e,
        "position",
        /*absolute*/
        u[10] ? "absolute" : "static"
      ), h[0] & /*absolute*/
      1024 && gr(
        e,
        "padding",
        /*absolute*/
        u[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(u) {
      i || (b0(r), i = !0);
    },
    o(u) {
      R0(r), i = !1;
    },
    d(u) {
      u && ie(e), ~t && s[t].d(), n[33](null);
    }
  };
}
let pa = [], ji = !1;
const t5 = typeof window < "u", th = t5 ? window.requestAnimationFrame : (n) => {
};
async function r5(n, e = !0) {
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
    if (pa.push(n), !ji) ji = !0;
    else return;
    await Np(), th(() => {
      let t = [0, 0];
      for (let r = 0; r < pa.length; r++) {
        const i = pa[r].getBoundingClientRect();
        (r === 0 || i.top + window.scrollY <= t[0]) && (t[0] = i.top + window.scrollY, t[1] = r);
      }
      window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), ji = !1, pa = [];
    });
  }
}
function n5(n, e, t) {
  let r, { $$slots: a = {}, $$scope: i } = e;
  const l = Pp();
  let { i18n: s } = e, { eta: o = null } = e, { queue_position: u } = e, { queue_size: h } = e, { status: f } = e, { scroll_to_output: p = !1 } = e, { timer: g = !0 } = e, { show_progress: w = "full" } = e, { message: v = null } = e, { progress: y = null } = e, { variant: E = "default" } = e, { loading_text: k = "Loading..." } = e, { absolute: b = !0 } = e, { translucent: A = !1 } = e, { border: M = !1 } = e, { autoscroll: R } = e, L, H = !1, q = 0, X = 0, Z = null, J = null, De = 0, ye = null, ve, $e = null, Me = !0;
  const ge = () => {
    t(0, o = t(27, Z = t(19, N = null))), t(25, q = performance.now()), t(26, X = 0), H = !0, qe();
  };
  function qe() {
    th(() => {
      t(26, X = (performance.now() - q) / 1e3), H && qe();
    });
  }
  function Ce() {
    t(26, X = 0), t(0, o = t(27, Z = t(19, N = null))), H && (H = !1);
  }
  Op(() => {
    H && Ce();
  });
  let N = null;
  function S(C) {
    ru[C ? "unshift" : "push"](() => {
      $e = C, t(16, $e), t(7, y), t(14, ye), t(15, ve);
    });
  }
  const T = () => {
    l("clear_status");
  };
  function z(C) {
    ru[C ? "unshift" : "push"](() => {
      L = C, t(13, L);
    });
  }
  return n.$$set = (C) => {
    "i18n" in C && t(1, s = C.i18n), "eta" in C && t(0, o = C.eta), "queue_position" in C && t(2, u = C.queue_position), "queue_size" in C && t(3, h = C.queue_size), "status" in C && t(4, f = C.status), "scroll_to_output" in C && t(22, p = C.scroll_to_output), "timer" in C && t(5, g = C.timer), "show_progress" in C && t(6, w = C.show_progress), "message" in C && t(23, v = C.message), "progress" in C && t(7, y = C.progress), "variant" in C && t(8, E = C.variant), "loading_text" in C && t(9, k = C.loading_text), "absolute" in C && t(10, b = C.absolute), "translucent" in C && t(11, A = C.translucent), "border" in C && t(12, M = C.border), "autoscroll" in C && t(24, R = C.autoscroll), "$$scope" in C && t(29, i = C.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (o === null && t(0, o = Z), o != null && Z !== o && (t(28, J = (performance.now() - q) / 1e3 + o), t(19, N = J.toFixed(1)), t(27, Z = o))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && t(17, De = J === null || J <= 0 || !X ? null : Math.min(X / J, 1)), n.$$.dirty[0] & /*progress*/
    128 && y != null && t(18, Me = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (y != null ? t(14, ye = y.map((C) => {
      if (C.index != null && C.length != null)
        return C.index / C.length;
      if (C.progress != null)
        return C.progress;
    })) : t(14, ye = null), ye ? (t(15, ve = ye[ye.length - 1]), $e && (ve === 0 ? t(16, $e.style.transition = "0", $e) : t(16, $e.style.transition = "150ms", $e))) : t(15, ve = void 0)), n.$$.dirty[0] & /*status*/
    16 && (f === "pending" ? ge() : Ce()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && L && p && (f === "pending" || f === "complete") && r5(L, R), n.$$.dirty[0] & /*status, message*/
    8388624, n.$$.dirty[0] & /*timer_diff*/
    67108864 && t(20, r = X.toFixed(1));
  }, [
    o,
    s,
    u,
    h,
    f,
    g,
    w,
    y,
    E,
    k,
    b,
    A,
    M,
    L,
    ye,
    ve,
    $e,
    De,
    Me,
    N,
    r,
    l,
    p,
    v,
    R,
    q,
    X,
    Z,
    J,
    i,
    a,
    S,
    T,
    z
  ];
}
class ss extends Rp {
  constructor(e) {
    super(), qp(
      this,
      e,
      n5,
      e5,
      Ip,
      {
        i18n: 1,
        eta: 0,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 22,
        timer: 5,
        show_progress: 6,
        message: 23,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 24
      },
      null,
      [-1, -1]
    );
  }
}
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
const {
  entries: rh,
  setPrototypeOf: vu,
  isFrozen: a5,
  getPrototypeOf: i5,
  getOwnPropertyDescriptor: l5
} = Object;
let {
  freeze: Tt,
  seal: h0,
  create: nh
} = Object, {
  apply: Tl,
  construct: Fl
} = typeof Reflect < "u" && Reflect;
Tt || (Tt = function(e) {
  return e;
});
h0 || (h0 = function(e) {
  return e;
});
Tl || (Tl = function(e, t, r) {
  return e.apply(t, r);
});
Fl || (Fl = function(e, t) {
  return new e(...t);
});
const ga = Ft(Array.prototype.forEach), s5 = Ft(Array.prototype.lastIndexOf), bu = Ft(Array.prototype.pop), on = Ft(Array.prototype.push), o5 = Ft(Array.prototype.splice), La = Ft(String.prototype.toLowerCase), Wi = Ft(String.prototype.toString), yu = Ft(String.prototype.match), un = Ft(String.prototype.replace), u5 = Ft(String.prototype.indexOf), c5 = Ft(String.prototype.trim), _0 = Ft(Object.prototype.hasOwnProperty), Et = Ft(RegExp.prototype.test), cn = h5(TypeError);
function Ft(n) {
  return function(e) {
    e instanceof RegExp && (e.lastIndex = 0);
    for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
      r[a - 1] = arguments[a];
    return Tl(n, e, r);
  };
}
function h5(n) {
  return function() {
    for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
      t[r] = arguments[r];
    return Fl(n, t);
  };
}
function xe(n, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : La;
  vu && vu(n, null);
  let r = e.length;
  for (; r--; ) {
    let a = e[r];
    if (typeof a == "string") {
      const i = t(a);
      i !== a && (a5(e) || (e[r] = i), a = i);
    }
    n[a] = !0;
  }
  return n;
}
function d5(n) {
  for (let e = 0; e < n.length; e++)
    _0(n, e) || (n[e] = null);
  return n;
}
function Z0(n) {
  const e = nh(null);
  for (const [t, r] of rh(n))
    _0(n, t) && (Array.isArray(r) ? e[t] = d5(r) : r && typeof r == "object" && r.constructor === Object ? e[t] = Z0(r) : e[t] = r);
  return e;
}
function hn(n, e) {
  for (; n !== null; ) {
    const r = l5(n, e);
    if (r) {
      if (r.get)
        return Ft(r.get);
      if (typeof r.value == "function")
        return Ft(r.value);
    }
    n = i5(n);
  }
  function t() {
    return null;
  }
  return t;
}
const wu = Tt(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Yi = Tt(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Xi = Tt(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), f5 = Tt(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Zi = Tt(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), m5 = Tt(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ku = Tt(["#text"]), Du = Tt(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ki = Tt(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Su = Tt(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), _a = Tt(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), p5 = h0(/\{\{[\w\W]*|[\w\W]*\}\}/gm), g5 = h0(/<%[\w\W]*|[\w\W]*%>/gm), _5 = h0(/\$\{[\w\W]*/gm), v5 = h0(/^data-[\-\w.\u00B7-\uFFFF]+$/), b5 = h0(/^aria-[\-\w]+$/), ah = h0(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), y5 = h0(/^(?:\w+script|data):/i), w5 = h0(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), ih = h0(/^html$/i), k5 = h0(/^[a-z][.\w]*(-[.\w]+)+$/i);
var xu = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ARIA_ATTR: b5,
  ATTR_WHITESPACE: w5,
  CUSTOM_ELEMENT: k5,
  DATA_ATTR: v5,
  DOCTYPE_NAME: ih,
  ERB_EXPR: g5,
  IS_ALLOWED_URI: ah,
  IS_SCRIPT_OR_DATA: y5,
  MUSTACHE_EXPR: p5,
  TMPLIT_EXPR: _5
});
const dn = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, D5 = function() {
  return typeof window > "u" ? null : window;
}, S5 = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let r = null;
  const a = "data-tt-policy-suffix";
  t && t.hasAttribute(a) && (r = t.getAttribute(a));
  const i = "dompurify" + (r ? "#" + r : "");
  try {
    return e.createPolicy(i, {
      createHTML(l) {
        return l;
      },
      createScriptURL(l) {
        return l;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + i + " could not be created."), null;
  }
}, Au = function() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function lh() {
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : D5();
  const e = (ne) => lh(ne);
  if (e.version = "3.2.6", e.removed = [], !n || !n.document || n.document.nodeType !== dn.document || !n.Element)
    return e.isSupported = !1, e;
  let {
    document: t
  } = n;
  const r = t, a = r.currentScript, {
    DocumentFragment: i,
    HTMLTemplateElement: l,
    Node: s,
    Element: o,
    NodeFilter: u,
    NamedNodeMap: h = n.NamedNodeMap || n.MozNamedAttrMap,
    HTMLFormElement: f,
    DOMParser: p,
    trustedTypes: g
  } = n, w = o.prototype, v = hn(w, "cloneNode"), y = hn(w, "remove"), E = hn(w, "nextSibling"), k = hn(w, "childNodes"), b = hn(w, "parentNode");
  if (typeof l == "function") {
    const ne = t.createElement("template");
    ne.content && ne.content.ownerDocument && (t = ne.content.ownerDocument);
  }
  let A, M = "";
  const {
    implementation: R,
    createNodeIterator: L,
    createDocumentFragment: H,
    getElementsByTagName: q
  } = t, {
    importNode: X
  } = r;
  let Z = Au();
  e.isSupported = typeof rh == "function" && typeof b == "function" && R && R.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: J,
    ERB_EXPR: De,
    TMPLIT_EXPR: ye,
    DATA_ATTR: ve,
    ARIA_ATTR: $e,
    IS_SCRIPT_OR_DATA: Me,
    ATTR_WHITESPACE: ge,
    CUSTOM_ELEMENT: qe
  } = xu;
  let {
    IS_ALLOWED_URI: Ce
  } = xu, N = null;
  const S = xe({}, [...wu, ...Yi, ...Xi, ...Zi, ...ku]);
  let T = null;
  const z = xe({}, [...Du, ...Ki, ...Su, ..._a]);
  let C = Object.seal(nh(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), P = null, I = null, ee = !0, ue = !0, fe = !1, ke = !0, W = !1, te = !0, ae = !1, _e = !1, Se = !1, Te = !1, We = !1, ze = !1, xt = !0, Yt = !1;
  const Mt = "user-content-";
  let U = !0, de = !1, Fe = {}, at = null;
  const Xt = xe({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
  let It = null;
  const Zt = xe({}, ["audio", "video", "img", "source", "image", "track"]);
  let U0 = null;
  const Kt = xe({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Dr = "http://www.w3.org/1998/Math/MathML", Un = "http://www.w3.org/2000/svg", G0 = "http://www.w3.org/1999/xhtml";
  let Br = G0, li = !1, si = null;
  const xh = xe({}, [Dr, Un, G0], Wi);
  let Gn = xe({}, ["mi", "mo", "mn", "ms", "mtext"]), Vn = xe({}, ["annotation-xml"]);
  const Ah = xe({}, ["title", "style", "font", "a", "script"]);
  let en = null;
  const Eh = ["application/xhtml+xml", "text/html"], Ch = "text/html";
  let mt = null, Lr = null;
  const Th = t.createElement("form"), ps = function($) {
    return $ instanceof RegExp || $ instanceof Function;
  }, oi = function() {
    let $ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(Lr && Lr === $)) {
      if ((!$ || typeof $ != "object") && ($ = {}), $ = Z0($), en = // eslint-disable-next-line unicorn/prefer-includes
      Eh.indexOf($.PARSER_MEDIA_TYPE) === -1 ? Ch : $.PARSER_MEDIA_TYPE, mt = en === "application/xhtml+xml" ? Wi : La, N = _0($, "ALLOWED_TAGS") ? xe({}, $.ALLOWED_TAGS, mt) : S, T = _0($, "ALLOWED_ATTR") ? xe({}, $.ALLOWED_ATTR, mt) : z, si = _0($, "ALLOWED_NAMESPACES") ? xe({}, $.ALLOWED_NAMESPACES, Wi) : xh, U0 = _0($, "ADD_URI_SAFE_ATTR") ? xe(Z0(Kt), $.ADD_URI_SAFE_ATTR, mt) : Kt, It = _0($, "ADD_DATA_URI_TAGS") ? xe(Z0(Zt), $.ADD_DATA_URI_TAGS, mt) : Zt, at = _0($, "FORBID_CONTENTS") ? xe({}, $.FORBID_CONTENTS, mt) : Xt, P = _0($, "FORBID_TAGS") ? xe({}, $.FORBID_TAGS, mt) : Z0({}), I = _0($, "FORBID_ATTR") ? xe({}, $.FORBID_ATTR, mt) : Z0({}), Fe = _0($, "USE_PROFILES") ? $.USE_PROFILES : !1, ee = $.ALLOW_ARIA_ATTR !== !1, ue = $.ALLOW_DATA_ATTR !== !1, fe = $.ALLOW_UNKNOWN_PROTOCOLS || !1, ke = $.ALLOW_SELF_CLOSE_IN_ATTR !== !1, W = $.SAFE_FOR_TEMPLATES || !1, te = $.SAFE_FOR_XML !== !1, ae = $.WHOLE_DOCUMENT || !1, Te = $.RETURN_DOM || !1, We = $.RETURN_DOM_FRAGMENT || !1, ze = $.RETURN_TRUSTED_TYPE || !1, Se = $.FORCE_BODY || !1, xt = $.SANITIZE_DOM !== !1, Yt = $.SANITIZE_NAMED_PROPS || !1, U = $.KEEP_CONTENT !== !1, de = $.IN_PLACE || !1, Ce = $.ALLOWED_URI_REGEXP || ah, Br = $.NAMESPACE || G0, Gn = $.MATHML_TEXT_INTEGRATION_POINTS || Gn, Vn = $.HTML_INTEGRATION_POINTS || Vn, C = $.CUSTOM_ELEMENT_HANDLING || {}, $.CUSTOM_ELEMENT_HANDLING && ps($.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (C.tagNameCheck = $.CUSTOM_ELEMENT_HANDLING.tagNameCheck), $.CUSTOM_ELEMENT_HANDLING && ps($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (C.attributeNameCheck = $.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), $.CUSTOM_ELEMENT_HANDLING && typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), W && (ue = !1), We && (Te = !0), Fe && (N = xe({}, ku), T = [], Fe.html === !0 && (xe(N, wu), xe(T, Du)), Fe.svg === !0 && (xe(N, Yi), xe(T, Ki), xe(T, _a)), Fe.svgFilters === !0 && (xe(N, Xi), xe(T, Ki), xe(T, _a)), Fe.mathMl === !0 && (xe(N, Zi), xe(T, Su), xe(T, _a))), $.ADD_TAGS && (N === S && (N = Z0(N)), xe(N, $.ADD_TAGS, mt)), $.ADD_ATTR && (T === z && (T = Z0(T)), xe(T, $.ADD_ATTR, mt)), $.ADD_URI_SAFE_ATTR && xe(U0, $.ADD_URI_SAFE_ATTR, mt), $.FORBID_CONTENTS && (at === Xt && (at = Z0(at)), xe(at, $.FORBID_CONTENTS, mt)), U && (N["#text"] = !0), ae && xe(N, ["html", "head", "body"]), N.table && (xe(N, ["tbody"]), delete P.tbody), $.TRUSTED_TYPES_POLICY) {
        if (typeof $.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw cn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof $.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw cn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        A = $.TRUSTED_TYPES_POLICY, M = A.createHTML("");
      } else
        A === void 0 && (A = S5(g, a)), A !== null && typeof M == "string" && (M = A.createHTML(""));
      Tt && Tt($), Lr = $;
    }
  }, gs = xe({}, [...Yi, ...Xi, ...f5]), _s = xe({}, [...Zi, ...m5]), Fh = function($) {
    let j = b($);
    (!j || !j.tagName) && (j = {
      namespaceURI: Br,
      tagName: "template"
    });
    const re = La($.tagName), Ge = La(j.tagName);
    return si[$.namespaceURI] ? $.namespaceURI === Un ? j.namespaceURI === G0 ? re === "svg" : j.namespaceURI === Dr ? re === "svg" && (Ge === "annotation-xml" || Gn[Ge]) : !!gs[re] : $.namespaceURI === Dr ? j.namespaceURI === G0 ? re === "math" : j.namespaceURI === Un ? re === "math" && Vn[Ge] : !!_s[re] : $.namespaceURI === G0 ? j.namespaceURI === Un && !Vn[Ge] || j.namespaceURI === Dr && !Gn[Ge] ? !1 : !_s[re] && (Ah[re] || !gs[re]) : !!(en === "application/xhtml+xml" && si[$.namespaceURI]) : !1;
  }, k0 = function($) {
    on(e.removed, {
      element: $
    });
    try {
      b($).removeChild($);
    } catch {
      y($);
    }
  }, Rr = function($, j) {
    try {
      on(e.removed, {
        attribute: j.getAttributeNode($),
        from: j
      });
    } catch {
      on(e.removed, {
        attribute: null,
        from: j
      });
    }
    if (j.removeAttribute($), $ === "is")
      if (Te || We)
        try {
          k0(j);
        } catch {
        }
      else
        try {
          j.setAttribute($, "");
        } catch {
        }
  }, vs = function($) {
    let j = null, re = null;
    if (Se)
      $ = "<remove></remove>" + $;
    else {
      const dt = yu($, /^[\r\n\t ]+/);
      re = dt && dt[0];
    }
    en === "application/xhtml+xml" && Br === G0 && ($ = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + $ + "</body></html>");
    const Ge = A ? A.createHTML($) : $;
    if (Br === G0)
      try {
        j = new p().parseFromString(Ge, en);
      } catch {
      }
    if (!j || !j.documentElement) {
      j = R.createDocument(Br, "template", null);
      try {
        j.documentElement.innerHTML = li ? M : Ge;
      } catch {
      }
    }
    const bt = j.body || j.documentElement;
    return $ && re && bt.insertBefore(t.createTextNode(re), bt.childNodes[0] || null), Br === G0 ? q.call(j, ae ? "html" : "body")[0] : ae ? j.documentElement : bt;
  }, bs = function($) {
    return L.call(
      $.ownerDocument || $,
      $,
      // eslint-disable-next-line no-bitwise
      u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION,
      null
    );
  }, ui = function($) {
    return $ instanceof f && (typeof $.nodeName != "string" || typeof $.textContent != "string" || typeof $.removeChild != "function" || !($.attributes instanceof h) || typeof $.removeAttribute != "function" || typeof $.setAttribute != "function" || typeof $.namespaceURI != "string" || typeof $.insertBefore != "function" || typeof $.hasChildNodes != "function");
  }, ys = function($) {
    return typeof s == "function" && $ instanceof s;
  };
  function V0(ne, $, j) {
    ga(ne, (re) => {
      re.call(e, $, j, Lr);
    });
  }
  const ws = function($) {
    let j = null;
    if (V0(Z.beforeSanitizeElements, $, null), ui($))
      return k0($), !0;
    const re = mt($.nodeName);
    if (V0(Z.uponSanitizeElement, $, {
      tagName: re,
      allowedTags: N
    }), te && $.hasChildNodes() && !ys($.firstElementChild) && Et(/<[/\w!]/g, $.innerHTML) && Et(/<[/\w!]/g, $.textContent) || $.nodeType === dn.progressingInstruction || te && $.nodeType === dn.comment && Et(/<[/\w]/g, $.data))
      return k0($), !0;
    if (!N[re] || P[re]) {
      if (!P[re] && Ds(re) && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, re) || C.tagNameCheck instanceof Function && C.tagNameCheck(re)))
        return !1;
      if (U && !at[re]) {
        const Ge = b($) || $.parentNode, bt = k($) || $.childNodes;
        if (bt && Ge) {
          const dt = bt.length;
          for (let zt = dt - 1; zt >= 0; --zt) {
            const j0 = v(bt[zt], !0);
            j0.__removalCount = ($.__removalCount || 0) + 1, Ge.insertBefore(j0, E($));
          }
        }
      }
      return k0($), !0;
    }
    return $ instanceof o && !Fh($) || (re === "noscript" || re === "noembed" || re === "noframes") && Et(/<\/no(script|embed|frames)/i, $.innerHTML) ? (k0($), !0) : (W && $.nodeType === dn.text && (j = $.textContent, ga([J, De, ye], (Ge) => {
      j = un(j, Ge, " ");
    }), $.textContent !== j && (on(e.removed, {
      element: $.cloneNode()
    }), $.textContent = j)), V0(Z.afterSanitizeElements, $, null), !1);
  }, ks = function($, j, re) {
    if (xt && (j === "id" || j === "name") && (re in t || re in Th))
      return !1;
    if (!(ue && !I[j] && Et(ve, j))) {
      if (!(ee && Et($e, j))) {
        if (!T[j] || I[j]) {
          if (
            // First condition does a very basic check if a) it's basically a valid custom element tagname AND
            // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
            !(Ds($) && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, $) || C.tagNameCheck instanceof Function && C.tagNameCheck($)) && (C.attributeNameCheck instanceof RegExp && Et(C.attributeNameCheck, j) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(j)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            j === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, re) || C.tagNameCheck instanceof Function && C.tagNameCheck(re)))
          ) return !1;
        } else if (!U0[j]) {
          if (!Et(Ce, un(re, ge, ""))) {
            if (!((j === "src" || j === "xlink:href" || j === "href") && $ !== "script" && u5(re, "data:") === 0 && It[$])) {
              if (!(fe && !Et(Me, un(re, ge, "")))) {
                if (re)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, Ds = function($) {
    return $ !== "annotation-xml" && yu($, qe);
  }, Ss = function($) {
    V0(Z.beforeSanitizeAttributes, $, null);
    const {
      attributes: j
    } = $;
    if (!j || ui($))
      return;
    const re = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: T,
      forceKeepAttr: void 0
    };
    let Ge = j.length;
    for (; Ge--; ) {
      const bt = j[Ge], {
        name: dt,
        namespaceURI: zt,
        value: j0
      } = bt, tn = mt(dt), ci = j0;
      let yt = dt === "value" ? ci : c5(ci);
      if (re.attrName = tn, re.attrValue = yt, re.keepAttr = !0, re.forceKeepAttr = void 0, V0(Z.uponSanitizeAttribute, $, re), yt = re.attrValue, Yt && (tn === "id" || tn === "name") && (Rr(dt, $), yt = Mt + yt), te && Et(/((--!?|])>)|<\/(style|title)/i, yt)) {
        Rr(dt, $);
        continue;
      }
      if (re.forceKeepAttr)
        continue;
      if (!re.keepAttr) {
        Rr(dt, $);
        continue;
      }
      if (!ke && Et(/\/>/i, yt)) {
        Rr(dt, $);
        continue;
      }
      W && ga([J, De, ye], (As) => {
        yt = un(yt, As, " ");
      });
      const xs = mt($.nodeName);
      if (!ks(xs, tn, yt)) {
        Rr(dt, $);
        continue;
      }
      if (A && typeof g == "object" && typeof g.getAttributeType == "function" && !zt)
        switch (g.getAttributeType(xs, tn)) {
          case "TrustedHTML": {
            yt = A.createHTML(yt);
            break;
          }
          case "TrustedScriptURL": {
            yt = A.createScriptURL(yt);
            break;
          }
        }
      if (yt !== ci)
        try {
          zt ? $.setAttributeNS(zt, dt, yt) : $.setAttribute(dt, yt), ui($) ? k0($) : bu(e.removed);
        } catch {
          Rr(dt, $);
        }
    }
    V0(Z.afterSanitizeAttributes, $, null);
  }, $h = function ne($) {
    let j = null;
    const re = bs($);
    for (V0(Z.beforeSanitizeShadowDOM, $, null); j = re.nextNode(); )
      V0(Z.uponSanitizeShadowNode, j, null), ws(j), Ss(j), j.content instanceof i && ne(j.content);
    V0(Z.afterSanitizeShadowDOM, $, null);
  };
  return e.sanitize = function(ne) {
    let $ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, j = null, re = null, Ge = null, bt = null;
    if (li = !ne, li && (ne = "<!-->"), typeof ne != "string" && !ys(ne))
      if (typeof ne.toString == "function") {
        if (ne = ne.toString(), typeof ne != "string")
          throw cn("dirty is not a string, aborting");
      } else
        throw cn("toString is not a function");
    if (!e.isSupported)
      return ne;
    if (_e || oi($), e.removed = [], typeof ne == "string" && (de = !1), de) {
      if (ne.nodeName) {
        const j0 = mt(ne.nodeName);
        if (!N[j0] || P[j0])
          throw cn("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (ne instanceof s)
      j = vs("<!---->"), re = j.ownerDocument.importNode(ne, !0), re.nodeType === dn.element && re.nodeName === "BODY" || re.nodeName === "HTML" ? j = re : j.appendChild(re);
    else {
      if (!Te && !W && !ae && // eslint-disable-next-line unicorn/prefer-includes
      ne.indexOf("<") === -1)
        return A && ze ? A.createHTML(ne) : ne;
      if (j = vs(ne), !j)
        return Te ? null : ze ? M : "";
    }
    j && Se && k0(j.firstChild);
    const dt = bs(de ? ne : j);
    for (; Ge = dt.nextNode(); )
      ws(Ge), Ss(Ge), Ge.content instanceof i && $h(Ge.content);
    if (de)
      return ne;
    if (Te) {
      if (We)
        for (bt = H.call(j.ownerDocument); j.firstChild; )
          bt.appendChild(j.firstChild);
      else
        bt = j;
      return (T.shadowroot || T.shadowrootmode) && (bt = X.call(r, bt, !0)), bt;
    }
    let zt = ae ? j.outerHTML : j.innerHTML;
    return ae && N["!doctype"] && j.ownerDocument && j.ownerDocument.doctype && j.ownerDocument.doctype.name && Et(ih, j.ownerDocument.doctype.name) && (zt = "<!DOCTYPE " + j.ownerDocument.doctype.name + `>
` + zt), W && ga([J, De, ye], (j0) => {
      zt = un(zt, j0, " ");
    }), A && ze ? A.createHTML(zt) : zt;
  }, e.setConfig = function() {
    let ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    oi(ne), _e = !0;
  }, e.clearConfig = function() {
    Lr = null, _e = !1;
  }, e.isValidAttribute = function(ne, $, j) {
    Lr || oi({});
    const re = mt(ne), Ge = mt($);
    return ks(re, Ge, j);
  }, e.addHook = function(ne, $) {
    typeof $ == "function" && on(Z[ne], $);
  }, e.removeHook = function(ne, $) {
    if ($ !== void 0) {
      const j = s5(Z[ne], $);
      return j === -1 ? void 0 : o5(Z[ne], j, 1)[0];
    }
    return bu(Z[ne]);
  }, e.removeHooks = function(ne) {
    Z[ne] = [];
  }, e.removeAllHooks = function() {
    Z = Au();
  }, e;
}
var t$ = lh();
const {
  HtmlTagHydration: r$,
  SvelteComponent: n$,
  add_render_callback: a$,
  append_hydration: i$,
  attr: l$,
  bubble: s$,
  check_outros: o$,
  children: u$,
  claim_component: c$,
  claim_element: h$,
  claim_html_tag: d$,
  claim_space: f$,
  claim_text: m$,
  create_component: p$,
  create_in_transition: g$,
  create_out_transition: _$,
  destroy_component: v$,
  detach: b$,
  element: y$,
  get_svelte_dataset: w$,
  group_outros: k$,
  init: D$,
  insert_hydration: S$,
  listen: x$,
  mount_component: A$,
  run_all: E$,
  safe_not_equal: C$,
  set_data: T$,
  space: F$,
  stop_propagation: $$,
  text: M$,
  toggle_class: z$,
  transition_in: B$,
  transition_out: L$
} = window.__gradio__svelte__internal, { createEventDispatcher: R$, onMount: q$ } = window.__gradio__svelte__internal, {
  SvelteComponent: I$,
  append_hydration: N$,
  attr: O$,
  bubble: P$,
  check_outros: H$,
  children: U$,
  claim_component: G$,
  claim_element: V$,
  claim_space: j$,
  create_animation: W$,
  create_component: Y$,
  destroy_component: X$,
  detach: Z$,
  element: K$,
  ensure_array_like: Q$,
  fix_and_outro_and_destroy_block: J$,
  fix_position: eM,
  group_outros: tM,
  init: rM,
  insert_hydration: nM,
  mount_component: aM,
  noop: iM,
  safe_not_equal: lM,
  set_style: sM,
  space: oM,
  transition_in: uM,
  transition_out: cM,
  update_keyed_each: hM
} = window.__gradio__svelte__internal, {
  SvelteComponent: dM,
  attr: fM,
  children: mM,
  claim_element: pM,
  detach: gM,
  element: _M,
  empty: vM,
  init: bM,
  insert_hydration: yM,
  noop: wM,
  safe_not_equal: kM,
  set_style: DM
} = window.__gradio__svelte__internal, x5 = "pnbrqkPNBRQK", Qi = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", A5 = ["1-0", "0-1", "1/2-1/2", "*"], Ji = {
  b: [16, 32, 17, 15],
  w: [-16, -32, -17, -15]
}, Eu = {
  n: [-18, -33, -31, -14, 18, 33, 31, 14],
  b: [-17, -15, 17, 15],
  r: [-16, 1, 16, -1],
  q: [-17, -16, -15, 1, 17, 16, 15, -1],
  k: [-17, -16, -15, 1, 17, 16, 15, -1]
}, E5 = [
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  24,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  2,
  24,
  2,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  2,
  53,
  56,
  53,
  2,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  24,
  24,
  24,
  24,
  24,
  56,
  0,
  56,
  24,
  24,
  24,
  24,
  24,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  2,
  53,
  56,
  53,
  2,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  2,
  24,
  2,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  24,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  20
], C5 = [
  17,
  0,
  0,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  17,
  0,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  16,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  16,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  16,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  0,
  -1,
  -1,
  -1,
  -1,
  -1,
  -1,
  -1,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  -16,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  -16,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  -16,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  0,
  -17,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  0,
  0,
  -17
], T5 = { p: 0, n: 1, b: 2, r: 3, q: 4, k: 5 }, me = {
  NORMAL: 1,
  CAPTURE: 2,
  BIG_PAWN: 4,
  EP_CAPTURE: 8,
  PROMOTION: 16,
  KSIDE_CASTLE: 32,
  QSIDE_CASTLE: 64
}, F5 = 7, $5 = 6, M5 = 1, z5 = 0, Le = {
  a8: 0,
  b8: 1,
  c8: 2,
  d8: 3,
  e8: 4,
  f8: 5,
  g8: 6,
  h8: 7,
  a7: 16,
  b7: 17,
  c7: 18,
  d7: 19,
  e7: 20,
  f7: 21,
  g7: 22,
  h7: 23,
  a6: 32,
  b6: 33,
  c6: 34,
  d6: 35,
  e6: 36,
  f6: 37,
  g6: 38,
  h6: 39,
  a5: 48,
  b5: 49,
  c5: 50,
  d5: 51,
  e5: 52,
  f5: 53,
  g5: 54,
  h5: 55,
  a4: 64,
  b4: 65,
  c4: 66,
  d4: 67,
  e4: 68,
  f4: 69,
  g4: 70,
  h4: 71,
  a3: 80,
  b3: 81,
  c3: 82,
  d3: 83,
  e3: 84,
  f3: 85,
  g3: 86,
  h3: 87,
  a2: 96,
  b2: 97,
  c2: 98,
  d2: 99,
  e2: 100,
  f2: 101,
  g2: 102,
  h2: 103,
  a1: 112,
  b1: 113,
  c1: 114,
  d1: 115,
  e1: 116,
  f1: 117,
  g1: 118,
  h1: 119
}, or = {
  w: [
    { square: Le.a1, flag: me.QSIDE_CASTLE },
    { square: Le.h1, flag: me.KSIDE_CASTLE }
  ],
  b: [
    { square: Le.a8, flag: me.QSIDE_CASTLE },
    { square: Le.h8, flag: me.KSIDE_CASTLE }
  ]
}, B5 = 0, Cu = 1;
function L5(n, e) {
  for (var t = n.from, r = n.to, a = n.piece, i = 0, l = 0, s = 0, o = 0, u = e.length; o < u; o++) {
    var h = e[o].from, f = e[o].to, p = e[o].piece;
    a === p && t !== h && r === f && (i++, mr(t) === mr(h) && l++, Tn(t) === Tn(h) && s++);
  }
  return i > 0 ? l > 0 && s > 0 ? Pt(t) : s > 0 ? Pt(t).charAt(1) : Pt(t).charAt(0) : "";
}
function R5(n) {
  var e = n.charAt(0);
  if (e >= "a" && e <= "h") {
    var t = n.match(/[a-h]\d.*[a-h]\d/);
    return t ? void 0 : x0;
  }
  return e = e.toLowerCase(), e === "o" ? Gr : e;
}
function Tu(n) {
  return n.replace(/=/, "").replace(/[+#]?[?!]*$/, "");
}
function mr(n) {
  return n >> 4;
}
function Tn(n) {
  return n & 15;
}
function Pt(n) {
  var e = Tn(n), t = mr(n);
  return "abcdefgh".substring(e, e + 1) + "87654321".substring(t, t + 1);
}
function fn(n) {
  return n === A0 ? fr : A0;
}
function q5(n) {
  return "0123456789".indexOf(n) !== -1;
}
function sh(n) {
  var e = n instanceof Array ? [] : {};
  for (var t in n)
    typeof t == "object" ? e[t] = sh(n[t]) : e[t] = n[t];
  return e;
}
function Fu(n) {
  return n.replace(/^\s+|\s+$/g, "");
}
const fr = "b", A0 = "w", g0 = -1, x0 = "p", $u = "n", va = "b", I5 = "r", N5 = "q", Gr = "k", O5 = {
  NORMAL: "n",
  CAPTURE: "c",
  BIG_PAWN: "b",
  EP_CAPTURE: "e",
  PROMOTION: "p",
  KSIDE_CASTLE: "k",
  QSIDE_CASTLE: "q"
}, ba = function(n) {
  var e = new Array(128), t = { w: g0, b: g0 }, r = A0, a = { w: 0, b: 0 }, i = g0, l = 0, s = 1, o = [], u = {}, h = {};
  w(typeof n > "u" ? Qi : n);
  function f(S) {
    typeof S > "u" && (S = !1), e = new Array(128), t = { w: g0, b: g0 }, r = A0, a = { w: 0, b: 0 }, i = g0, l = 0, s = 1, o = [], S || (u = {}), h = {}, k(y());
  }
  function p() {
    for (var S = [], T = {}, z = function(C) {
      C in h && (T[C] = h[C]);
    }; o.length > 0; )
      S.push(ge());
    for (z(y()); S.length > 0; )
      Me(S.pop()), z(y());
    h = T;
  }
  function g() {
    w(Qi);
  }
  function w(S, T) {
    typeof T > "u" && (T = !1);
    var z = S.split(/\s+/), C = z[0], P = 0;
    if (!v(S).valid)
      return !1;
    f(T);
    for (var I = 0; I < C.length; I++) {
      var ee = C.charAt(I);
      if (ee === "/")
        P += 8;
      else if (q5(ee))
        P += parseInt(ee, 10);
      else {
        var ue = ee < "a" ? A0 : fr;
        A({ type: ee.toLowerCase(), color: ue }, Pt(P)), P++;
      }
    }
    return r = z[1], z[2].indexOf("K") > -1 && (a.w |= me.KSIDE_CASTLE), z[2].indexOf("Q") > -1 && (a.w |= me.QSIDE_CASTLE), z[2].indexOf("k") > -1 && (a.b |= me.KSIDE_CASTLE), z[2].indexOf("q") > -1 && (a.b |= me.QSIDE_CASTLE), i = z[3] === "-" ? g0 : Le[z[3]], l = parseInt(z[4], 10), s = parseInt(z[5], 10), k(y()), !0;
  }
  function v(S) {
    var T = {
      0: "No errors.",
      1: "FEN string must contain six space-delimited fields.",
      2: "6th field (move number) must be a positive integer.",
      3: "5th field (half move counter) must be a non-negative integer.",
      4: "4th field (en-passant square) is invalid.",
      5: "3rd field (castling availability) is invalid.",
      6: "2nd field (side to move) is invalid.",
      7: "1st field (piece positions) does not contain 8 '/'-delimited rows.",
      8: "1st field (piece positions) is invalid [consecutive numbers].",
      9: "1st field (piece positions) is invalid [invalid piece].",
      10: "1st field (piece positions) is invalid [row too large].",
      11: "Illegal en-passant square"
    }, z = S.split(/\s+/);
    if (z.length !== 6)
      return { valid: !1, error_number: 1, error: T[1] };
    if (isNaN(parseInt(z[5])) || parseInt(z[5], 10) <= 0)
      return { valid: !1, error_number: 2, error: T[2] };
    if (isNaN(parseInt(z[4])) || parseInt(z[4], 10) < 0)
      return { valid: !1, error_number: 3, error: T[3] };
    if (!/^(-|[abcdefgh][36])$/.test(z[3]))
      return { valid: !1, error_number: 4, error: T[4] };
    if (!/^(KQ?k?q?|Qk?q?|kq?|q|-)$/.test(z[2]))
      return { valid: !1, error_number: 5, error: T[5] };
    if (!/^(w|b)$/.test(z[1]))
      return { valid: !1, error_number: 6, error: T[6] };
    var C = z[0].split("/");
    if (C.length !== 8)
      return { valid: !1, error_number: 7, error: T[7] };
    for (var P = 0; P < C.length; P++) {
      for (var I = 0, ee = !1, ue = 0; ue < C[P].length; ue++)
        if (isNaN(C[P][ue])) {
          if (!/^[prnbqkPRNBQK]$/.test(C[P][ue]))
            return { valid: !1, error_number: 9, error: T[9] };
          I += 1, ee = !1;
        } else {
          if (ee)
            return { valid: !1, error_number: 8, error: T[8] };
          I += parseInt(C[P][ue], 10), ee = !0;
        }
      if (I !== 8)
        return { valid: !1, error_number: 10, error: T[10] };
    }
    return z[3][1] == "3" && z[1] == "w" || z[3][1] == "6" && z[1] == "b" ? { valid: !1, error_number: 11, error: T[11] } : { valid: !0, error_number: 0, error: T[0] };
  }
  function y() {
    for (var S = 0, T = "", z = Le.a8; z <= Le.h1; z++) {
      if (e[z] == null)
        S++;
      else {
        S > 0 && (T += S, S = 0);
        var C = e[z].color, P = e[z].type;
        T += C === A0 ? P.toUpperCase() : P.toLowerCase();
      }
      z + 1 & 136 && (S > 0 && (T += S), z !== Le.h1 && (T += "/"), S = 0, z += 8);
    }
    var I = "";
    a[A0] & me.KSIDE_CASTLE && (I += "K"), a[A0] & me.QSIDE_CASTLE && (I += "Q"), a[fr] & me.KSIDE_CASTLE && (I += "k"), a[fr] & me.QSIDE_CASTLE && (I += "q"), I = I || "-";
    var ee = i === g0 ? "-" : Pt(i);
    return [T, r, I, ee, l, s].join(" ");
  }
  function E(S) {
    for (var T = 0; T < S.length; T += 2)
      typeof S[T] == "string" && typeof S[T + 1] == "string" && (u[S[T]] = S[T + 1]);
    return u;
  }
  function k(S) {
    o.length > 0 || (S !== Qi ? (u.SetUp = "1", u.FEN = S) : (delete u.SetUp, delete u.FEN));
  }
  function b(S) {
    var T = e[Le[S]];
    return T ? { type: T.type, color: T.color } : null;
  }
  function A(S, T) {
    if (!("type" in S && "color" in S) || x5.indexOf(S.type.toLowerCase()) === -1 || !(T in Le))
      return !1;
    var z = Le[T];
    return S.type == Gr && !(t[S.color] == g0 || t[S.color] == z) ? !1 : (e[z] = { type: S.type, color: S.color }, S.type === Gr && (t[S.color] = z), k(y()), !0);
  }
  function M(S) {
    var T = b(S);
    return e[Le[S]] = null, T && T.type === Gr && (t[T.color] = g0), k(y()), T;
  }
  function R(S, T, z, C, P) {
    var I = {
      color: r,
      from: T,
      to: z,
      flags: C,
      piece: S[T].type
    };
    return P && (I.flags |= me.PROMOTION, I.promotion = P), S[z] ? I.captured = S[z].type : C & me.EP_CAPTURE && (I.captured = x0), I;
  }
  function L(S) {
    function T(Mt, U, de, Fe, at) {
      if (Mt[de].type === x0 && (mr(Fe) === z5 || mr(Fe) === F5))
        for (var Xt = [N5, I5, va, $u], It = 0, Zt = Xt.length; It < Zt; It++)
          U.push(R(Mt, de, Fe, at, Xt[It]));
      else
        U.push(R(Mt, de, Fe, at));
    }
    var z = [], C = r, P = fn(C), I = { b: M5, w: $5 }, ee = Le.a8, ue = Le.h1, fe = !1, ke = typeof S < "u" && "legal" in S ? S.legal : !0, W = typeof S < "u" && "piece" in S && typeof S.piece == "string" ? S.piece.toLowerCase() : !0;
    if (typeof S < "u" && "square" in S)
      if (S.square in Le)
        ee = ue = Le[S.square], fe = !0;
      else
        return [];
    for (var te = ee; te <= ue; te++) {
      if (te & 136) {
        te += 7;
        continue;
      }
      var ae = e[te];
      if (!(ae == null || ae.color !== C)) {
        if (ae.type === x0 && (W === !0 || W === x0)) {
          var _e = te + Ji[C][0];
          if (e[_e] == null) {
            T(e, z, te, _e, me.NORMAL);
            var _e = te + Ji[C][1];
            I[C] === mr(te) && e[_e] == null && T(e, z, te, _e, me.BIG_PAWN);
          }
          for (Se = 2; Se < 4; Se++) {
            var _e = te + Ji[C][Se];
            _e & 136 || (e[_e] != null && e[_e].color === P ? T(e, z, te, _e, me.CAPTURE) : _e === i && T(e, z, te, i, me.EP_CAPTURE));
          }
        } else if (W === !0 || W === ae.type)
          for (var Se = 0, Te = Eu[ae.type].length; Se < Te; Se++)
            for (var We = Eu[ae.type][Se], _e = te; _e += We, !(_e & 136); ) {
              if (e[_e] == null)
                T(e, z, te, _e, me.NORMAL);
              else {
                if (e[_e].color === C) break;
                T(e, z, te, _e, me.CAPTURE);
                break;
              }
              if (ae.type === "n" || ae.type === "k") break;
            }
      }
    }
    if ((W === !0 || W === Gr) && (!fe || ue === t[C])) {
      if (a[C] & me.KSIDE_CASTLE) {
        var ze = t[C], xt = ze + 2;
        e[ze + 1] == null && e[xt] == null && !q(P, t[C]) && !q(P, ze + 1) && !q(P, xt) && T(e, z, t[C], xt, me.KSIDE_CASTLE);
      }
      if (a[C] & me.QSIDE_CASTLE) {
        var ze = t[C], xt = ze - 2;
        e[ze - 1] == null && e[ze - 2] == null && e[ze - 3] == null && !q(P, t[C]) && !q(P, ze - 1) && !q(P, xt) && T(e, z, t[C], xt, me.QSIDE_CASTLE);
      }
    }
    if (!ke)
      return z;
    for (var Yt = [], te = 0, Te = z.length; te < Te; te++)
      Me(z[te]), X(C) || Yt.push(z[te]), ge();
    return Yt;
  }
  function H(S, T) {
    var z = "";
    if (S.flags & me.KSIDE_CASTLE)
      z = "O-O";
    else if (S.flags & me.QSIDE_CASTLE)
      z = "O-O-O";
    else {
      if (S.piece !== x0) {
        var C = L5(S, T);
        z += S.piece.toUpperCase() + C;
      }
      S.flags & (me.CAPTURE | me.EP_CAPTURE) && (S.piece === x0 && (z += Pt(S.from)[0]), z += "x"), z += Pt(S.to), S.flags & me.PROMOTION && (z += "=" + S.promotion.toUpperCase());
    }
    return Me(S), Z() && (J() ? z += "#" : z += "+"), ge(), z;
  }
  function q(S, T) {
    for (var z = Le.a8; z <= Le.h1; z++) {
      if (z & 136) {
        z += 7;
        continue;
      }
      if (!(e[z] == null || e[z].color !== S)) {
        var C = e[z], P = z - T, I = P + 119;
        if (E5[I] & 1 << T5[C.type]) {
          if (C.type === x0) {
            if (P > 0) {
              if (C.color === A0) return !0;
            } else if (C.color === fr) return !0;
            continue;
          }
          if (C.type === "n" || C.type === "k") return !0;
          for (var ee = C5[I], ue = z + ee, fe = !1; ue !== T; ) {
            if (e[ue] != null) {
              fe = !0;
              break;
            }
            ue += ee;
          }
          if (!fe) return !0;
        }
      }
    }
    return !1;
  }
  function X(S) {
    return q(fn(S), t[S]);
  }
  function Z() {
    return X(r);
  }
  function J() {
    return Z() && L().length === 0;
  }
  function De() {
    return !Z() && L().length === 0;
  }
  function ye() {
    for (var S = {}, T = [], z = 0, C = 0, P = Le.a8; P <= Le.h1; P++) {
      if (C = (C + 1) % 2, P & 136) {
        P += 7;
        continue;
      }
      var I = e[P];
      I && (S[I.type] = I.type in S ? S[I.type] + 1 : 1, I.type === va && T.push(C), z++);
    }
    if (z === 2)
      return !0;
    if (
      /* k vs. kn .... or .... k vs. kb */
      z === 3 && (S[va] === 1 || S[$u] === 1)
    )
      return !0;
    if (z === S[va] + 2) {
      for (var ee = 0, ue = T.length, P = 0; P < ue; P++)
        ee += T[P];
      if (ee === 0 || ee === ue)
        return !0;
    }
    return !1;
  }
  function ve() {
    for (var S = [], T = {}, z = !1; ; ) {
      var C = ge();
      if (!C) break;
      S.push(C);
    }
    for (; ; ) {
      var P = y().split(" ").slice(0, 4).join(" ");
      if (T[P] = P in T ? T[P] + 1 : 1, T[P] >= 3 && (z = !0), !S.length)
        break;
      Me(S.pop());
    }
    return z;
  }
  function $e(S) {
    o.push({
      move: S,
      kings: { b: t.b, w: t.w },
      turn: r,
      castling: { b: a.b, w: a.w },
      ep_square: i,
      half_moves: l,
      move_number: s
    });
  }
  function Me(S) {
    var T = r, z = fn(T);
    if ($e(S), e[S.to] = e[S.from], e[S.from] = null, S.flags & me.EP_CAPTURE && (r === fr ? e[S.to - 16] = null : e[S.to + 16] = null), S.flags & me.PROMOTION && (e[S.to] = { type: S.promotion, color: T }), e[S.to].type === Gr) {
      if (t[e[S.to].color] = S.to, S.flags & me.KSIDE_CASTLE) {
        var C = S.to - 1, P = S.to + 1;
        e[C] = e[P], e[P] = null;
      } else if (S.flags & me.QSIDE_CASTLE) {
        var C = S.to + 1, P = S.to - 2;
        e[C] = e[P], e[P] = null;
      }
      a[T] = "";
    }
    if (a[T]) {
      for (var I = 0, ee = or[T].length; I < ee; I++)
        if (S.from === or[T][I].square && a[T] & or[T][I].flag) {
          a[T] ^= or[T][I].flag;
          break;
        }
    }
    if (a[z]) {
      for (var I = 0, ee = or[z].length; I < ee; I++)
        if (S.to === or[z][I].square && a[z] & or[z][I].flag) {
          a[z] ^= or[z][I].flag;
          break;
        }
    }
    S.flags & me.BIG_PAWN ? r === "b" ? i = S.to - 16 : i = S.to + 16 : i = g0, S.piece === x0 || S.flags & (me.CAPTURE | me.EP_CAPTURE) ? l = 0 : l++, r === fr && s++, r = fn(r);
  }
  function ge() {
    var S = o.pop();
    if (S == null)
      return null;
    var T = S.move;
    t = S.kings, r = S.turn, a = S.castling, i = S.ep_square, l = S.half_moves, s = S.move_number;
    var z = r, C = fn(r);
    if (e[T.from] = e[T.to], e[T.from].type = T.piece, e[T.to] = null, T.flags & me.CAPTURE)
      e[T.to] = { type: T.captured, color: C };
    else if (T.flags & me.EP_CAPTURE) {
      var P;
      z === fr ? P = T.to - 16 : P = T.to + 16, e[P] = { type: x0, color: C };
    }
    if (T.flags & (me.KSIDE_CASTLE | me.QSIDE_CASTLE)) {
      var I, ee;
      T.flags & me.KSIDE_CASTLE ? (I = T.to + 1, ee = T.to - 1) : T.flags & me.QSIDE_CASTLE && (I = T.to - 2, ee = T.to + 1), e[I] = e[ee], e[ee] = null;
    }
    return T;
  }
  function qe(S, T) {
    for (var z = Tu(S), C = 0; C < 2; C++) {
      if (C == Cu) {
        if (!T)
          return null;
        var P = !1, I = z.match(
          /([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/
        );
        if (I) {
          var ee = I[1], ue = I[2], fe = I[3], ke = I[4];
          ue.length == 1 && (P = !0);
        } else {
          var I = z.match(
            /([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/
          );
          if (I) {
            var ee = I[1], ue = I[2], fe = I[3], ke = I[4];
            if (ue.length == 1)
              var P = !0;
          }
        }
      }
      for (var W = R5(z), te = L({
        legal: !0,
        piece: ee || W
      }), ae = 0, _e = te.length; ae < _e; ae++)
        switch (C) {
          case B5: {
            if (z === Tu(H(te[ae], te)))
              return te[ae];
            break;
          }
          case Cu:
            if (I) {
              if ((!ee || ee.toLowerCase() == te[ae].piece) && Le[ue] == te[ae].from && Le[fe] == te[ae].to && (!ke || ke.toLowerCase() == te[ae].promotion))
                return te[ae];
              if (P) {
                var Se = Pt(te[ae].from);
                if ((!ee || ee.toLowerCase() == te[ae].piece) && Le[fe] == te[ae].to && (ue == Se[0] || ue == Se[1]) && (!ke || ke.toLowerCase() == te[ae].promotion))
                  return te[ae];
              }
            }
        }
    }
    return null;
  }
  function Ce(S) {
    var T = sh(S);
    T.san = H(T, L({ legal: !0 })), T.to = Pt(T.to), T.from = Pt(T.from);
    var z = "";
    for (var C in me)
      me[C] & T.flags && (z += O5[C]);
    return T.flags = z, T;
  }
  function N(S) {
    for (var T = L({ legal: !1 }), z = 0, C = r, P = 0, I = T.length; P < I; P++) {
      if (Me(T[P]), !X(C))
        if (S - 1 > 0) {
          var ee = N(S - 1);
          z += ee;
        } else
          z++;
      ge();
    }
    return z;
  }
  return {
    /***************************************************************************
     * PUBLIC API
     **************************************************************************/
    load: function(S) {
      return w(S);
    },
    reset: function() {
      return g();
    },
    moves: function(S) {
      for (var T = L(S), z = [], C = 0, P = T.length; C < P; C++)
        typeof S < "u" && "verbose" in S && S.verbose ? z.push(Ce(T[C])) : z.push(
          H(T[C], L({ legal: !0 }))
        );
      return z;
    },
    in_check: function() {
      return Z();
    },
    in_checkmate: function() {
      return J();
    },
    in_stalemate: function() {
      return De();
    },
    in_draw: function() {
      return l >= 100 || De() || ye() || ve();
    },
    insufficient_material: function() {
      return ye();
    },
    in_threefold_repetition: function() {
      return ve();
    },
    game_over: function() {
      return l >= 100 || J() || De() || ye() || ve();
    },
    validate_fen: function(S) {
      return v(S);
    },
    fen: function() {
      return y();
    },
    board: function() {
      for (var S = [], T = [], z = Le.a8; z <= Le.h1; z++)
        e[z] == null ? T.push(null) : T.push({
          square: Pt(z),
          type: e[z].type,
          color: e[z].color
        }), z + 1 & 136 && (S.push(T), T = [], z += 8);
      return S;
    },
    pgn: function(S) {
      var T = typeof S == "object" && typeof S.newline_char == "string" ? S.newline_char : `
`, z = typeof S == "object" && typeof S.max_width == "number" ? S.max_width : 0, C = [], P = !1;
      for (var I in u)
        C.push("[" + I + ' "' + u[I] + '"]' + T), P = !0;
      P && o.length && C.push(T);
      for (var ee = function(Se) {
        var Te = h[y()];
        if (typeof Te < "u") {
          var We = Se.length > 0 ? " " : "";
          Se = `${Se}${We}{${Te}}`;
        }
        return Se;
      }, ue = []; o.length > 0; )
        ue.push(ge());
      var fe = [], ke = "";
      for (ue.length === 0 && fe.push(ee("")); ue.length > 0; ) {
        ke = ee(ke);
        var W = ue.pop();
        if (!o.length && W.color === "b") {
          const Se = `${s}. ...`;
          ke = ke ? `${ke} ${Se}` : Se;
        } else W.color === "w" && (ke.length && fe.push(ke), ke = s + ".");
        ke = ke + " " + H(W, L({ legal: !0 })), Me(W);
      }
      if (ke.length && fe.push(ee(ke)), typeof u.Result < "u" && fe.push(u.Result), z === 0)
        return C.join("") + fe.join(" ");
      for (var te = function() {
        return C.length > 0 && C[C.length - 1] === " " ? (C.pop(), !0) : !1;
      }, ae = function(Se, Te) {
        for (var We of Te.split(" "))
          if (We) {
            if (Se + We.length > z) {
              for (; te(); )
                Se--;
              C.push(T), Se = 0;
            }
            C.push(We), Se += We.length, C.push(" "), Se++;
          }
        return te() && Se--, Se;
      }, _e = 0, I = 0; I < fe.length; I++) {
        if (_e + fe[I].length > z && fe[I].includes("{")) {
          _e = ae(_e, fe[I]);
          continue;
        }
        _e + fe[I].length > z && I !== 0 ? (C[C.length - 1] === " " && C.pop(), C.push(T), _e = 0) : I !== 0 && (C.push(" "), _e++), C.push(fe[I]), _e += fe[I].length;
      }
      return C.join("");
    },
    load_pgn: function(S, T) {
      var z = typeof T < "u" && "sloppy" in T ? T.sloppy : !1;
      function C(de) {
        return de.replace(/\\/g, "\\");
      }
      function P(de, Fe) {
        for (var at = typeof Fe == "object" && typeof Fe.newline_char == "string" ? Fe.newline_char : `\r?
`, Xt = {}, It = de.split(new RegExp(C(at))), Zt = "", U0 = "", Kt = 0; Kt < It.length; Kt++) {
          var Dr = /^\s*\[([A-Za-z]+)\s*"(.*)"\s*\]\s*$/;
          Zt = It[Kt].replace(Dr, "$1"), U0 = It[Kt].replace(Dr, "$2"), Fu(Zt).length > 0 && (Xt[Zt] = U0);
        }
        return Xt;
      }
      S = S.trim();
      var I = typeof T == "object" && typeof T.newline_char == "string" ? T.newline_char : `\r?
`, ee = new RegExp(
        "^(\\[((?:" + C(I) + ")|.)*\\])(?:\\s*" + C(I) + "){2}"
      ), ue = ee.test(S) ? ee.exec(S)[1] : "";
      g();
      var fe = P(ue, T), ke = "";
      for (var W in fe)
        W.toLowerCase() === "fen" && (ke = fe[W]), E([W, fe[W]]);
      if (z) {
        if (ke && !w(ke, !0))
          return !1;
      } else if (fe.SetUp === "1" && !("FEN" in fe && w(fe.FEN, !0)))
        return !1;
      for (var te = function(de) {
        return Array.from(de).map(function(Fe) {
          return Fe.charCodeAt(0) < 128 ? Fe.charCodeAt(0).toString(16) : encodeURIComponent(Fe).replace(/\%/g, "").toLowerCase();
        }).join("");
      }, ae = function(de) {
        return de.length == 0 ? "" : decodeURIComponent("%" + de.match(/.{1,2}/g).join("%"));
      }, _e = function(de) {
        return de = de.replace(new RegExp(C(I), "g"), " "), `{${te(de.slice(1, de.length - 1))}}`;
      }, Se = function(de) {
        if (de.startsWith("{") && de.endsWith("}"))
          return ae(de.slice(1, de.length - 1));
      }, Te = S.replace(ue, "").replace(
        /* encode comments so they don't get deleted below */
        new RegExp(`({[^}]*})+?|;([^${C(I)}]*)`, "g"),
        function(de, Fe, at) {
          return Fe !== void 0 ? _e(Fe) : " " + _e(`{${at.slice(1)}}`);
        }
      ).replace(new RegExp(C(I), "g"), " "), We = /(\([^\(\)]+\))+?/g; We.test(Te); )
        Te = Te.replace(We, "");
      Te = Te.replace(/\d+\.(\.\.)?/g, ""), Te = Te.replace(/\.\.\./g, ""), Te = Te.replace(/\$\d+/g, "");
      var ze = Fu(Te).split(new RegExp(/\s+/));
      ze = ze.join(",").replace(/,,+/g, ",").split(",");
      for (var xt = "", Yt = "", Mt = 0; Mt < ze.length; Mt++) {
        var U = Se(ze[Mt]);
        if (U !== void 0) {
          h[y()] = U;
          continue;
        }
        if (xt = qe(ze[Mt], z), xt == null)
          if (A5.indexOf(ze[Mt]) > -1)
            Yt = ze[Mt];
          else
            return !1;
        else
          Yt = "", Me(xt);
      }
      return Yt && Object.keys(u).length && !u.Result && E(["Result", Yt]), !0;
    },
    header: function() {
      return E(arguments);
    },
    turn: function() {
      return r;
    },
    move: function(S, T) {
      var z = typeof T < "u" && "sloppy" in T ? T.sloppy : !1, C = null;
      if (typeof S == "string")
        C = qe(S, z);
      else if (typeof S == "object") {
        for (var P = L(), I = 0, ee = P.length; I < ee; I++)
          if (S.from === Pt(P[I].from) && S.to === Pt(P[I].to) && (!("promotion" in P[I]) || S.promotion === P[I].promotion)) {
            C = P[I];
            break;
          }
      }
      if (!C)
        return null;
      var ue = Ce(C);
      return Me(C), ue;
    },
    undo: function() {
      var S = ge();
      return S ? Ce(S) : null;
    },
    clear: function() {
      return f();
    },
    put: function(S, T) {
      return A(S, T);
    },
    get: function(S) {
      return b(S);
    },
    ascii() {
      for (var S = `   +------------------------+
`, T = Le.a8; T <= Le.h1; T++) {
        if (Tn(T) === 0 && (S += " " + "87654321"[mr(T)] + " |"), e[T] == null)
          S += " . ";
        else {
          var z = e[T].type, C = e[T].color, P = C === A0 ? z.toUpperCase() : z.toLowerCase();
          S += " " + P + " ";
        }
        T + 1 & 136 && (S += `|
`, T += 8);
      }
      return S += `   +------------------------+
`, S += "     a  b  c  d  e  f  g  h", S;
    },
    remove: function(S) {
      return M(S);
    },
    perft: function(S) {
      return N(S);
    },
    square_color: function(S) {
      if (S in Le) {
        var T = Le[S];
        return (mr(T) + Tn(T)) % 2 === 0 ? "light" : "dark";
      }
      return null;
    },
    history: function(S) {
      for (var T = [], z = [], C = typeof S < "u" && ("verbose" in S) && S.verbose; o.length > 0; )
        T.push(ge());
      for (; T.length > 0; ) {
        var P = T.pop();
        C ? z.push(Ce(P)) : z.push(H(P, L({ legal: !0 }))), Me(P);
      }
      return z;
    },
    get_comment: function() {
      return h[y()];
    },
    set_comment: function(S) {
      h[y()] = S.replace("{", "[").replace("}", "]");
    },
    delete_comment: function() {
      var S = h[y()];
      return delete h[y()], S;
    },
    get_comments: function() {
      return p(), Object.keys(h).map(function(S) {
        return { fen: S, comment: h[S] };
      });
    },
    delete_comments: function() {
      return p(), Object.keys(h).map(function(S) {
        var T = h[S];
        return delete h[S], { fen: S, comment: T };
      });
    }
  };
}, {
  SvelteComponent: P5,
  append_hydration: ya,
  attr: Hr,
  children: Mu,
  claim_element: el,
  claim_space: H5,
  claim_text: U5,
  detach: tl,
  element: rl,
  init: G5,
  insert_hydration: V5,
  listen: nl,
  noop: zu,
  run_all: j5,
  safe_not_equal: W5,
  set_data: Y5,
  space: X5,
  text: Z5,
  toggle_class: Bu
} = window.__gradio__svelte__internal, { createEventDispatcher: K5 } = window.__gradio__svelte__internal;
function Q5(n) {
  let e, t, r, a, i, l, s;
  return {
    c() {
      e = rl("label"), t = rl("input"), r = X5(), a = rl("span"), i = Z5(
        /*label*/
        n[1]
      ), this.h();
    },
    l(o) {
      e = el(o, "LABEL", { class: !0 });
      var u = Mu(e);
      t = el(u, "INPUT", {
        type: !0,
        name: !0,
        "data-testid": !0,
        class: !0
      }), r = H5(u), a = el(u, "SPAN", { class: !0 });
      var h = Mu(a);
      i = U5(
        h,
        /*label*/
        n[1]
      ), h.forEach(tl), u.forEach(tl), this.h();
    },
    h() {
      t.disabled = /*disabled*/
      n[2], Hr(t, "type", "checkbox"), Hr(t, "name", "test"), Hr(t, "data-testid", "checkbox"), Hr(t, "class", "svelte-6uhi3z"), Hr(a, "class", "svelte-6uhi3z"), Hr(e, "class", "svelte-6uhi3z"), Bu(
        e,
        "disabled",
        /*disabled*/
        n[2]
      );
    },
    m(o, u) {
      V5(o, e, u), ya(e, t), t.checked = /*value*/
      n[0], ya(e, r), ya(e, a), ya(a, i), l || (s = [
        nl(
          t,
          "change",
          /*input_change_handler*/
          n[6]
        ),
        nl(
          t,
          "keydown",
          /*handle_enter*/
          n[3]
        ),
        nl(
          t,
          "input",
          /*handle_input*/
          n[4]
        )
      ], l = !0);
    },
    p(o, [u]) {
      u & /*disabled*/
      4 && (t.disabled = /*disabled*/
      o[2]), u & /*value*/
      1 && (t.checked = /*value*/
      o[0]), u & /*label*/
      2 && Y5(
        i,
        /*label*/
        o[1]
      ), u & /*disabled*/
      4 && Bu(
        e,
        "disabled",
        /*disabled*/
        o[2]
      );
    },
    i: zu,
    o: zu,
    d(o) {
      o && tl(e), l = !1, j5(s);
    }
  };
}
function J5(n, e, t) {
  let r, { value: a = !1 } = e, { label: i = "Checkbox" } = e, { interactive: l } = e;
  const s = K5();
  async function o(f) {
    f.key === "Enter" && (t(0, a = !a), s("select", {
      index: 0,
      value: f.currentTarget.checked,
      selected: f.currentTarget.checked
    }));
  }
  async function u(f) {
    t(0, a = f.currentTarget.checked), s("select", {
      index: 0,
      value: f.currentTarget.checked,
      selected: f.currentTarget.checked
    });
  }
  function h() {
    a = this.checked, t(0, a);
  }
  return n.$$set = (f) => {
    "value" in f && t(0, a = f.value), "label" in f && t(1, i = f.label), "interactive" in f && t(5, l = f.interactive);
  }, n.$$.update = () => {
    n.$$.dirty & /*value*/
    1 && s("change", a), n.$$.dirty & /*interactive*/
    32 && t(2, r = !l);
  }, [
    a,
    i,
    r,
    o,
    u,
    l,
    h
  ];
}
class Wa extends P5 {
  constructor(e) {
    super(), G5(this, e, J5, Q5, W5, { value: 0, label: 1, interactive: 5 });
  }
}
const {
  SvelteComponent: SM,
  add_flush_callback: xM,
  assign: AM,
  bind: EM,
  binding_callbacks: CM,
  check_outros: TM,
  claim_component: FM,
  claim_space: $M,
  create_component: MM,
  destroy_component: zM,
  detach: BM,
  get_spread_object: LM,
  get_spread_update: RM,
  group_outros: qM,
  init: IM,
  insert_hydration: NM,
  mount_component: OM,
  safe_not_equal: PM,
  space: HM,
  transition_in: UM,
  transition_out: GM
} = window.__gradio__svelte__internal, { afterUpdate: VM } = window.__gradio__svelte__internal, {
  SvelteComponent: e3,
  action_destroyer: t3,
  add_render_callback: r3,
  append_hydration: mn,
  attr: ce,
  binding_callbacks: wa,
  bubble: ur,
  check_outros: Xr,
  children: Fr,
  claim_component: Nn,
  claim_element: I0,
  claim_space: ka,
  claim_text: os,
  create_component: On,
  create_in_transition: n3,
  destroy_component: Pn,
  detach: lt,
  element: N0,
  empty: Ya,
  group_outros: Zr,
  init: a3,
  insert_hydration: qt,
  is_function: i3,
  listen: Ve,
  mount_component: Hn,
  noop: yr,
  run_all: ai,
  safe_not_equal: l3,
  set_data: us,
  set_input_value: wr,
  space: Da,
  text: cs,
  toggle_class: tr,
  transition_in: st,
  transition_out: vt
} = window.__gradio__svelte__internal, { beforeUpdate: s3, afterUpdate: o3, createEventDispatcher: u3, tick: Lu } = window.__gradio__svelte__internal;
function Ru(n) {
  let e, t, r, a;
  const i = [h3, c3], l = [];
  function s(o, u) {
    return (
      /*copied*/
      o[19] ? 0 : 1
    );
  }
  return e = s(n), t = l[e] = i[e](n), {
    c() {
      t.c(), r = Ya();
    },
    l(o) {
      t.l(o), r = Ya();
    },
    m(o, u) {
      l[e].m(o, u), qt(o, r, u), a = !0;
    },
    p(o, u) {
      let h = e;
      e = s(o), e === h ? l[e].p(o, u) : (Zr(), vt(l[h], 1, 1, () => {
        l[h] = null;
      }), Xr(), t = l[e], t ? t.p(o, u) : (t = l[e] = i[e](o), t.c()), st(t, 1), t.m(r.parentNode, r));
    },
    i(o) {
      a || (st(t), a = !0);
    },
    o(o) {
      vt(t), a = !1;
    },
    d(o) {
      o && lt(r), l[e].d(o);
    }
  };
}
function c3(n) {
  let e, t, r, a, i;
  return t = new ip({}), {
    c() {
      e = N0("button"), On(t.$$.fragment), this.h();
    },
    l(l) {
      e = I0(l, "BUTTON", {
        class: !0,
        "aria-label": !0,
        "aria-roledescription": !0
      });
      var s = Fr(e);
      Nn(t.$$.fragment, s), s.forEach(lt), this.h();
    },
    h() {
      ce(e, "class", "copy-button svelte-bj4kw9"), ce(e, "aria-label", "Copy"), ce(e, "aria-roledescription", "Copy text");
    },
    m(l, s) {
      qt(l, e, s), Hn(t, e, null), r = !0, a || (i = Ve(
        e,
        "click",
        /*handle_copy*/
        n[21]
      ), a = !0);
    },
    p: yr,
    i(l) {
      r || (st(t.$$.fragment, l), r = !0);
    },
    o(l) {
      vt(t.$$.fragment, l), r = !1;
    },
    d(l) {
      l && lt(e), Pn(t), a = !1, i();
    }
  };
}
function h3(n) {
  let e, t, r, a;
  return t = new W2({}), {
    c() {
      e = N0("button"), On(t.$$.fragment), this.h();
    },
    l(i) {
      e = I0(i, "BUTTON", {
        class: !0,
        "aria-label": !0,
        "aria-roledescription": !0
      });
      var l = Fr(e);
      Nn(t.$$.fragment, l), l.forEach(lt), this.h();
    },
    h() {
      ce(e, "class", "copy-button svelte-bj4kw9"), ce(e, "aria-label", "Copied"), ce(e, "aria-roledescription", "Text copied");
    },
    m(i, l) {
      qt(i, e, l), Hn(t, e, null), a = !0;
    },
    p: yr,
    i(i) {
      a || (st(t.$$.fragment, i), i && (r || r3(() => {
        r = n3(e, Sp, { duration: 300 }), r.start();
      })), a = !0);
    },
    o(i) {
      vt(t.$$.fragment, i), a = !1;
    },
    d(i) {
      i && lt(e), Pn(t);
    }
  };
}
function d3(n) {
  let e;
  return {
    c() {
      e = cs(
        /*label*/
        n[3]
      );
    },
    l(t) {
      e = os(
        t,
        /*label*/
        n[3]
      );
    },
    m(t, r) {
      qt(t, e, r);
    },
    p(t, r) {
      r[0] & /*label*/
      8 && us(
        e,
        /*label*/
        t[3]
      );
    },
    d(t) {
      t && lt(e);
    }
  };
}
function f3(n) {
  let e, t, r, a, i, l;
  return {
    c() {
      e = N0("textarea"), this.h();
    },
    l(s) {
      e = I0(s, "TEXTAREA", {
        "data-testid": !0,
        class: !0,
        dir: !0,
        placeholder: !0,
        rows: !0,
        maxlength: !0,
        style: !0
      }), Fr(e).forEach(lt), this.h();
    },
    h() {
      ce(e, "data-testid", "textbox"), ce(e, "class", "scroll-hide svelte-bj4kw9"), ce(e, "dir", t = /*rtl*/
      n[12] ? "rtl" : "ltr"), ce(
        e,
        "placeholder",
        /*placeholder*/
        n[2]
      ), ce(
        e,
        "rows",
        /*lines*/
        n[1]
      ), e.disabled = /*disabled*/
      n[5], e.autofocus = /*autofocus*/
      n[13], ce(
        e,
        "maxlength",
        /*max_length*/
        n[15]
      ), ce(e, "style", r = /*text_align*/
      n[14] ? "text-align: " + /*text_align*/
      n[14] : ""), tr(e, "no-label", !/*show_label*/
      n[6] && /*submit_btn*/
      (n[10] || /*stop_btn*/
      n[11]));
    },
    m(s, o) {
      qt(s, e, o), wr(
        e,
        /*value*/
        n[0]
      ), n[46](e), /*autofocus*/
      n[13] && e.focus(), i || (l = [
        t3(a = /*text_area_resize*/
        n[27].call(
          null,
          e,
          /*value*/
          n[0]
        )),
        Ve(
          e,
          "input",
          /*textarea_input_handler*/
          n[45]
        ),
        Ve(
          e,
          "keypress",
          /*handle_keypress*/
          n[23]
        ),
        Ve(
          e,
          "blur",
          /*blur_handler_3*/
          n[37]
        ),
        Ve(
          e,
          "select",
          /*handle_select*/
          n[22]
        ),
        Ve(
          e,
          "focus",
          /*focus_handler_3*/
          n[38]
        ),
        Ve(
          e,
          "scroll",
          /*handle_scroll*/
          n[24]
        )
      ], i = !0);
    },
    p(s, o) {
      o[0] & /*rtl*/
      4096 && t !== (t = /*rtl*/
      s[12] ? "rtl" : "ltr") && ce(e, "dir", t), o[0] & /*placeholder*/
      4 && ce(
        e,
        "placeholder",
        /*placeholder*/
        s[2]
      ), o[0] & /*lines*/
      2 && ce(
        e,
        "rows",
        /*lines*/
        s[1]
      ), o[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      s[5]), o[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      s[13]), o[0] & /*max_length*/
      32768 && ce(
        e,
        "maxlength",
        /*max_length*/
        s[15]
      ), o[0] & /*text_align*/
      16384 && r !== (r = /*text_align*/
      s[14] ? "text-align: " + /*text_align*/
      s[14] : "") && ce(e, "style", r), a && i3(a.update) && o[0] & /*value*/
      1 && a.update.call(
        null,
        /*value*/
        s[0]
      ), o[0] & /*value*/
      1 && wr(
        e,
        /*value*/
        s[0]
      ), o[0] & /*show_label, submit_btn, stop_btn*/
      3136 && tr(e, "no-label", !/*show_label*/
      s[6] && /*submit_btn*/
      (s[10] || /*stop_btn*/
      s[11]));
    },
    d(s) {
      s && lt(e), n[46](null), i = !1, ai(l);
    }
  };
}
function m3(n) {
  let e;
  function t(i, l) {
    if (
      /*type*/
      i[8] === "text"
    ) return _3;
    if (
      /*type*/
      i[8] === "password"
    ) return g3;
    if (
      /*type*/
      i[8] === "email"
    ) return p3;
  }
  let r = t(n), a = r && r(n);
  return {
    c() {
      a && a.c(), e = Ya();
    },
    l(i) {
      a && a.l(i), e = Ya();
    },
    m(i, l) {
      a && a.m(i, l), qt(i, e, l);
    },
    p(i, l) {
      r === (r = t(i)) && a ? a.p(i, l) : (a && a.d(1), a = r && r(i), a && (a.c(), a.m(e.parentNode, e)));
    },
    d(i) {
      i && lt(e), a && a.d(i);
    }
  };
}
function p3(n) {
  let e, t, r;
  return {
    c() {
      e = N0("input"), this.h();
    },
    l(a) {
      e = I0(a, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        placeholder: !0,
        maxlength: !0,
        autocomplete: !0
      }), this.h();
    },
    h() {
      ce(e, "data-testid", "textbox"), ce(e, "type", "email"), ce(e, "class", "scroll-hide svelte-bj4kw9"), ce(
        e,
        "placeholder",
        /*placeholder*/
        n[2]
      ), e.disabled = /*disabled*/
      n[5], e.autofocus = /*autofocus*/
      n[13], ce(
        e,
        "maxlength",
        /*max_length*/
        n[15]
      ), ce(e, "autocomplete", "email");
    },
    m(a, i) {
      qt(a, e, i), wr(
        e,
        /*value*/
        n[0]
      ), n[44](e), /*autofocus*/
      n[13] && e.focus(), t || (r = [
        Ve(
          e,
          "input",
          /*input_input_handler_2*/
          n[43]
        ),
        Ve(
          e,
          "keypress",
          /*handle_keypress*/
          n[23]
        ),
        Ve(
          e,
          "blur",
          /*blur_handler_2*/
          n[35]
        ),
        Ve(
          e,
          "select",
          /*handle_select*/
          n[22]
        ),
        Ve(
          e,
          "focus",
          /*focus_handler_2*/
          n[36]
        )
      ], t = !0);
    },
    p(a, i) {
      i[0] & /*placeholder*/
      4 && ce(
        e,
        "placeholder",
        /*placeholder*/
        a[2]
      ), i[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      a[5]), i[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      a[13]), i[0] & /*max_length*/
      32768 && ce(
        e,
        "maxlength",
        /*max_length*/
        a[15]
      ), i[0] & /*value*/
      1 && e.value !== /*value*/
      a[0] && wr(
        e,
        /*value*/
        a[0]
      );
    },
    d(a) {
      a && lt(e), n[44](null), t = !1, ai(r);
    }
  };
}
function g3(n) {
  let e, t, r;
  return {
    c() {
      e = N0("input"), this.h();
    },
    l(a) {
      e = I0(a, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        placeholder: !0,
        maxlength: !0,
        autocomplete: !0
      }), this.h();
    },
    h() {
      ce(e, "data-testid", "password"), ce(e, "type", "password"), ce(e, "class", "scroll-hide svelte-bj4kw9"), ce(
        e,
        "placeholder",
        /*placeholder*/
        n[2]
      ), e.disabled = /*disabled*/
      n[5], e.autofocus = /*autofocus*/
      n[13], ce(
        e,
        "maxlength",
        /*max_length*/
        n[15]
      ), ce(e, "autocomplete", "");
    },
    m(a, i) {
      qt(a, e, i), wr(
        e,
        /*value*/
        n[0]
      ), n[42](e), /*autofocus*/
      n[13] && e.focus(), t || (r = [
        Ve(
          e,
          "input",
          /*input_input_handler_1*/
          n[41]
        ),
        Ve(
          e,
          "keypress",
          /*handle_keypress*/
          n[23]
        ),
        Ve(
          e,
          "blur",
          /*blur_handler_1*/
          n[33]
        ),
        Ve(
          e,
          "select",
          /*handle_select*/
          n[22]
        ),
        Ve(
          e,
          "focus",
          /*focus_handler_1*/
          n[34]
        )
      ], t = !0);
    },
    p(a, i) {
      i[0] & /*placeholder*/
      4 && ce(
        e,
        "placeholder",
        /*placeholder*/
        a[2]
      ), i[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      a[5]), i[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      a[13]), i[0] & /*max_length*/
      32768 && ce(
        e,
        "maxlength",
        /*max_length*/
        a[15]
      ), i[0] & /*value*/
      1 && e.value !== /*value*/
      a[0] && wr(
        e,
        /*value*/
        a[0]
      );
    },
    d(a) {
      a && lt(e), n[42](null), t = !1, ai(r);
    }
  };
}
function _3(n) {
  let e, t, r, a, i;
  return {
    c() {
      e = N0("input"), this.h();
    },
    l(l) {
      e = I0(l, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        dir: !0,
        placeholder: !0,
        maxlength: !0,
        style: !0
      }), this.h();
    },
    h() {
      ce(e, "data-testid", "textbox"), ce(e, "type", "text"), ce(e, "class", "scroll-hide svelte-bj4kw9"), ce(e, "dir", t = /*rtl*/
      n[12] ? "rtl" : "ltr"), ce(
        e,
        "placeholder",
        /*placeholder*/
        n[2]
      ), e.disabled = /*disabled*/
      n[5], e.autofocus = /*autofocus*/
      n[13], ce(
        e,
        "maxlength",
        /*max_length*/
        n[15]
      ), ce(e, "style", r = /*text_align*/
      n[14] ? "text-align: " + /*text_align*/
      n[14] : "");
    },
    m(l, s) {
      qt(l, e, s), wr(
        e,
        /*value*/
        n[0]
      ), n[40](e), /*autofocus*/
      n[13] && e.focus(), a || (i = [
        Ve(
          e,
          "input",
          /*input_input_handler*/
          n[39]
        ),
        Ve(
          e,
          "keypress",
          /*handle_keypress*/
          n[23]
        ),
        Ve(
          e,
          "blur",
          /*blur_handler*/
          n[31]
        ),
        Ve(
          e,
          "select",
          /*handle_select*/
          n[22]
        ),
        Ve(
          e,
          "focus",
          /*focus_handler*/
          n[32]
        )
      ], a = !0);
    },
    p(l, s) {
      s[0] & /*rtl*/
      4096 && t !== (t = /*rtl*/
      l[12] ? "rtl" : "ltr") && ce(e, "dir", t), s[0] & /*placeholder*/
      4 && ce(
        e,
        "placeholder",
        /*placeholder*/
        l[2]
      ), s[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      l[5]), s[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      l[13]), s[0] & /*max_length*/
      32768 && ce(
        e,
        "maxlength",
        /*max_length*/
        l[15]
      ), s[0] & /*text_align*/
      16384 && r !== (r = /*text_align*/
      l[14] ? "text-align: " + /*text_align*/
      l[14] : "") && ce(e, "style", r), s[0] & /*value*/
      1 && e.value !== /*value*/
      l[0] && wr(
        e,
        /*value*/
        l[0]
      );
    },
    d(l) {
      l && lt(e), n[40](null), a = !1, ai(i);
    }
  };
}
function qu(n) {
  let e, t, r, a, i, l;
  const s = [b3, v3], o = [];
  function u(h, f) {
    return (
      /*submit_btn*/
      h[10] === !0 ? 0 : 1
    );
  }
  return t = u(n), r = o[t] = s[t](n), {
    c() {
      e = N0("button"), r.c(), this.h();
    },
    l(h) {
      e = I0(h, "BUTTON", { class: !0 });
      var f = Fr(e);
      r.l(f), f.forEach(lt), this.h();
    },
    h() {
      ce(e, "class", "submit-button svelte-bj4kw9"), tr(
        e,
        "padded-button",
        /*submit_btn*/
        n[10] !== !0
      );
    },
    m(h, f) {
      qt(h, e, f), o[t].m(e, null), a = !0, i || (l = Ve(
        e,
        "click",
        /*handle_submit*/
        n[26]
      ), i = !0);
    },
    p(h, f) {
      let p = t;
      t = u(h), t === p ? o[t].p(h, f) : (Zr(), vt(o[p], 1, 1, () => {
        o[p] = null;
      }), Xr(), r = o[t], r ? r.p(h, f) : (r = o[t] = s[t](h), r.c()), st(r, 1), r.m(e, null)), (!a || f[0] & /*submit_btn*/
      1024) && tr(
        e,
        "padded-button",
        /*submit_btn*/
        h[10] !== !0
      );
    },
    i(h) {
      a || (st(r), a = !0);
    },
    o(h) {
      vt(r), a = !1;
    },
    d(h) {
      h && lt(e), o[t].d(), i = !1, l();
    }
  };
}
function v3(n) {
  let e;
  return {
    c() {
      e = cs(
        /*submit_btn*/
        n[10]
      );
    },
    l(t) {
      e = os(
        t,
        /*submit_btn*/
        n[10]
      );
    },
    m(t, r) {
      qt(t, e, r);
    },
    p(t, r) {
      r[0] & /*submit_btn*/
      1024 && us(
        e,
        /*submit_btn*/
        t[10]
      );
    },
    i: yr,
    o: yr,
    d(t) {
      t && lt(e);
    }
  };
}
function b3(n) {
  let e, t;
  return e = new hp({}), {
    c() {
      On(e.$$.fragment);
    },
    l(r) {
      Nn(e.$$.fragment, r);
    },
    m(r, a) {
      Hn(e, r, a), t = !0;
    },
    p: yr,
    i(r) {
      t || (st(e.$$.fragment, r), t = !0);
    },
    o(r) {
      vt(e.$$.fragment, r), t = !1;
    },
    d(r) {
      Pn(e, r);
    }
  };
}
function Iu(n) {
  let e, t, r, a, i, l;
  const s = [w3, y3], o = [];
  function u(h, f) {
    return (
      /*stop_btn*/
      h[11] === !0 ? 0 : 1
    );
  }
  return t = u(n), r = o[t] = s[t](n), {
    c() {
      e = N0("button"), r.c(), this.h();
    },
    l(h) {
      e = I0(h, "BUTTON", { class: !0 });
      var f = Fr(e);
      r.l(f), f.forEach(lt), this.h();
    },
    h() {
      ce(e, "class", "stop-button svelte-bj4kw9"), tr(
        e,
        "padded-button",
        /*stop_btn*/
        n[11] !== !0
      );
    },
    m(h, f) {
      qt(h, e, f), o[t].m(e, null), a = !0, i || (l = Ve(
        e,
        "click",
        /*handle_stop*/
        n[25]
      ), i = !0);
    },
    p(h, f) {
      let p = t;
      t = u(h), t === p ? o[t].p(h, f) : (Zr(), vt(o[p], 1, 1, () => {
        o[p] = null;
      }), Xr(), r = o[t], r ? r.p(h, f) : (r = o[t] = s[t](h), r.c()), st(r, 1), r.m(e, null)), (!a || f[0] & /*stop_btn*/
      2048) && tr(
        e,
        "padded-button",
        /*stop_btn*/
        h[11] !== !0
      );
    },
    i(h) {
      a || (st(r), a = !0);
    },
    o(h) {
      vt(r), a = !1;
    },
    d(h) {
      h && lt(e), o[t].d(), i = !1, l();
    }
  };
}
function y3(n) {
  let e;
  return {
    c() {
      e = cs(
        /*stop_btn*/
        n[11]
      );
    },
    l(t) {
      e = os(
        t,
        /*stop_btn*/
        n[11]
      );
    },
    m(t, r) {
      qt(t, e, r);
    },
    p(t, r) {
      r[0] & /*stop_btn*/
      2048 && us(
        e,
        /*stop_btn*/
        t[11]
      );
    },
    i: yr,
    o: yr,
    d(t) {
      t && lt(e);
    }
  };
}
function w3(n) {
  let e, t;
  return e = new bp({
    props: { fill: "none", stroke_width: 2.5 }
  }), {
    c() {
      On(e.$$.fragment);
    },
    l(r) {
      Nn(e.$$.fragment, r);
    },
    m(r, a) {
      Hn(e, r, a), t = !0;
    },
    p: yr,
    i(r) {
      t || (st(e.$$.fragment, r), t = !0);
    },
    o(r) {
      vt(e.$$.fragment, r), t = !1;
    },
    d(r) {
      Pn(e, r);
    }
  };
}
function k3(n) {
  let e, t, r, a, i, l, s, o, u = (
    /*show_label*/
    n[6] && /*show_copy_button*/
    n[9] && Ru(n)
  );
  r = new Pc({
    props: {
      root: (
        /*root*/
        n[16]
      ),
      show_label: (
        /*show_label*/
        n[6]
      ),
      info: (
        /*info*/
        n[4]
      ),
      $$slots: { default: [d3] },
      $$scope: { ctx: n }
    }
  });
  function h(v, y) {
    return (
      /*lines*/
      v[1] === 1 && /*_max_lines*/
      v[18] === 1 ? m3 : f3
    );
  }
  let f = h(n), p = f(n), g = (
    /*submit_btn*/
    n[10] && qu(n)
  ), w = (
    /*stop_btn*/
    n[11] && Iu(n)
  );
  return {
    c() {
      e = N0("label"), u && u.c(), t = Da(), On(r.$$.fragment), a = Da(), i = N0("div"), p.c(), l = Da(), g && g.c(), s = Da(), w && w.c(), this.h();
    },
    l(v) {
      e = I0(v, "LABEL", { class: !0 });
      var y = Fr(e);
      u && u.l(y), t = ka(y), Nn(r.$$.fragment, y), a = ka(y), i = I0(y, "DIV", { class: !0 });
      var E = Fr(i);
      p.l(E), l = ka(E), g && g.l(E), s = ka(E), w && w.l(E), E.forEach(lt), y.forEach(lt), this.h();
    },
    h() {
      ce(i, "class", "input-container svelte-bj4kw9"), ce(e, "class", "svelte-bj4kw9"), tr(
        e,
        "container",
        /*container*/
        n[7]
      ), tr(
        e,
        "show_textbox_border",
        /*show_textbox_border*/
        n[20]
      );
    },
    m(v, y) {
      qt(v, e, y), u && u.m(e, null), mn(e, t), Hn(r, e, null), mn(e, a), mn(e, i), p.m(i, null), mn(i, l), g && g.m(i, null), mn(i, s), w && w.m(i, null), o = !0;
    },
    p(v, y) {
      /*show_label*/
      v[6] && /*show_copy_button*/
      v[9] ? u ? (u.p(v, y), y[0] & /*show_label, show_copy_button*/
      576 && st(u, 1)) : (u = Ru(v), u.c(), st(u, 1), u.m(e, t)) : u && (Zr(), vt(u, 1, 1, () => {
        u = null;
      }), Xr());
      const E = {};
      y[0] & /*root*/
      65536 && (E.root = /*root*/
      v[16]), y[0] & /*show_label*/
      64 && (E.show_label = /*show_label*/
      v[6]), y[0] & /*info*/
      16 && (E.info = /*info*/
      v[4]), y[0] & /*label*/
      8 | y[1] & /*$$scope*/
      33554432 && (E.$$scope = { dirty: y, ctx: v }), r.$set(E), f === (f = h(v)) && p ? p.p(v, y) : (p.d(1), p = f(v), p && (p.c(), p.m(i, l))), /*submit_btn*/
      v[10] ? g ? (g.p(v, y), y[0] & /*submit_btn*/
      1024 && st(g, 1)) : (g = qu(v), g.c(), st(g, 1), g.m(i, s)) : g && (Zr(), vt(g, 1, 1, () => {
        g = null;
      }), Xr()), /*stop_btn*/
      v[11] ? w ? (w.p(v, y), y[0] & /*stop_btn*/
      2048 && st(w, 1)) : (w = Iu(v), w.c(), st(w, 1), w.m(i, null)) : w && (Zr(), vt(w, 1, 1, () => {
        w = null;
      }), Xr()), (!o || y[0] & /*container*/
      128) && tr(
        e,
        "container",
        /*container*/
        v[7]
      );
    },
    i(v) {
      o || (st(u), st(r.$$.fragment, v), st(g), st(w), o = !0);
    },
    o(v) {
      vt(u), vt(r.$$.fragment, v), vt(g), vt(w), o = !1;
    },
    d(v) {
      v && lt(e), u && u.d(), Pn(r), p.d(), g && g.d(), w && w.d();
    }
  };
}
function D3(n, e, t) {
  let { value: r = "" } = e, { value_is_output: a = !1 } = e, { lines: i = 1 } = e, { placeholder: l = "Type here..." } = e, { label: s } = e, { info: o = void 0 } = e, { disabled: u = !1 } = e, { show_label: h = !0 } = e, { container: f = !0 } = e, { max_lines: p = void 0 } = e, { type: g = "text" } = e, { show_copy_button: w = !1 } = e, { submit_btn: v = null } = e, { stop_btn: y = null } = e, { rtl: E = !1 } = e, { autofocus: k = !1 } = e, { text_align: b = void 0 } = e, { autoscroll: A = !0 } = e, { max_length: M = void 0 } = e, { root: R } = e, L, H = !1, q, X, Z = 0, J = !1, De;
  const ye = !v, ve = u3();
  s3(() => {
    !J && L && L.offsetHeight + L.scrollTop > L.scrollHeight - 100 && (X = !0);
  });
  const $e = () => {
    X && A && !J && L.scrollTo(0, L.scrollHeight);
  };
  function Me() {
    ve("change", r), a || ve("input");
  }
  o3(() => {
    k && L.focus(), X && A && $e(), t(28, a = !1);
  });
  async function ge() {
    "clipboard" in navigator && (await navigator.clipboard.writeText(r), ve("copy", { value: r }), qe());
  }
  function qe() {
    t(19, H = !0), q && clearTimeout(q), q = setTimeout(
      () => {
        t(19, H = !1);
      },
      1e3
    );
  }
  function Ce(U) {
    const de = U.target, Fe = de.value, at = [de.selectionStart, de.selectionEnd];
    ve("select", { value: Fe.substring(...at), index: at });
  }
  async function N(U) {
    await Lu(), (U.key === "Enter" && U.shiftKey && i > 1 || U.key === "Enter" && !U.shiftKey && i === 1 && De >= 1) && (U.preventDefault(), ve("submit"));
  }
  function S(U) {
    const de = U.target, Fe = de.scrollTop;
    Fe < Z && (J = !0), Z = Fe;
    const at = de.scrollHeight - de.clientHeight;
    Fe >= at && (J = !1);
  }
  function T() {
    ve("stop");
  }
  function z() {
    ve("submit");
  }
  async function C(U) {
    if (await Lu(), i === De) return;
    const de = U.target, Fe = window.getComputedStyle(de), at = parseFloat(Fe.paddingTop), Xt = parseFloat(Fe.paddingBottom), It = parseFloat(Fe.lineHeight);
    let Zt = De === void 0 ? !1 : at + Xt + It * De, U0 = at + Xt + i * It;
    de.style.height = "1px";
    let Kt;
    Zt && de.scrollHeight > Zt ? Kt = Zt : de.scrollHeight < U0 ? Kt = U0 : Kt = de.scrollHeight, de.style.height = `${Kt}px`;
  }
  function P(U, de) {
    if (i !== De && (U.style.overflowY = "scroll", U.addEventListener("input", C), !!de.trim()))
      return C({ target: U }), {
        destroy: () => U.removeEventListener("input", C)
      };
  }
  function I(U) {
    ur.call(this, n, U);
  }
  function ee(U) {
    ur.call(this, n, U);
  }
  function ue(U) {
    ur.call(this, n, U);
  }
  function fe(U) {
    ur.call(this, n, U);
  }
  function ke(U) {
    ur.call(this, n, U);
  }
  function W(U) {
    ur.call(this, n, U);
  }
  function te(U) {
    ur.call(this, n, U);
  }
  function ae(U) {
    ur.call(this, n, U);
  }
  function _e() {
    r = this.value, t(0, r);
  }
  function Se(U) {
    wa[U ? "unshift" : "push"](() => {
      L = U, t(17, L);
    });
  }
  function Te() {
    r = this.value, t(0, r);
  }
  function We(U) {
    wa[U ? "unshift" : "push"](() => {
      L = U, t(17, L);
    });
  }
  function ze() {
    r = this.value, t(0, r);
  }
  function xt(U) {
    wa[U ? "unshift" : "push"](() => {
      L = U, t(17, L);
    });
  }
  function Yt() {
    r = this.value, t(0, r);
  }
  function Mt(U) {
    wa[U ? "unshift" : "push"](() => {
      L = U, t(17, L);
    });
  }
  return n.$$set = (U) => {
    "value" in U && t(0, r = U.value), "value_is_output" in U && t(28, a = U.value_is_output), "lines" in U && t(1, i = U.lines), "placeholder" in U && t(2, l = U.placeholder), "label" in U && t(3, s = U.label), "info" in U && t(4, o = U.info), "disabled" in U && t(5, u = U.disabled), "show_label" in U && t(6, h = U.show_label), "container" in U && t(7, f = U.container), "max_lines" in U && t(29, p = U.max_lines), "type" in U && t(8, g = U.type), "show_copy_button" in U && t(9, w = U.show_copy_button), "submit_btn" in U && t(10, v = U.submit_btn), "stop_btn" in U && t(11, y = U.stop_btn), "rtl" in U && t(12, E = U.rtl), "autofocus" in U && t(13, k = U.autofocus), "text_align" in U && t(14, b = U.text_align), "autoscroll" in U && t(30, A = U.autoscroll), "max_length" in U && t(15, M = U.max_length), "root" in U && t(16, R = U.root);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*max_lines, type, lines*/
    536871170 && (p === void 0 ? g === "text" ? t(18, De = Math.max(i, 20)) : t(18, De = 1) : t(18, De = Math.max(p, i))), n.$$.dirty[0] & /*value*/
    1 && r === null && t(0, r = ""), n.$$.dirty[0] & /*value, el, lines, _max_lines*/
    393219 && L && i !== De && C({ target: L }), n.$$.dirty[0] & /*value*/
    1 && Me();
  }, [
    r,
    i,
    l,
    s,
    o,
    u,
    h,
    f,
    g,
    w,
    v,
    y,
    E,
    k,
    b,
    M,
    R,
    L,
    De,
    H,
    ye,
    ge,
    Ce,
    N,
    S,
    T,
    z,
    P,
    a,
    p,
    A,
    I,
    ee,
    ue,
    fe,
    ke,
    W,
    te,
    ae,
    _e,
    Se,
    Te,
    We,
    ze,
    xt,
    Yt,
    Mt
  ];
}
class S3 extends e3 {
  constructor(e) {
    super(), a3(
      this,
      e,
      D3,
      k3,
      l3,
      {
        value: 0,
        value_is_output: 28,
        lines: 1,
        placeholder: 2,
        label: 3,
        info: 4,
        disabled: 5,
        show_label: 6,
        container: 7,
        max_lines: 29,
        type: 8,
        show_copy_button: 9,
        submit_btn: 10,
        stop_btn: 11,
        rtl: 12,
        autofocus: 13,
        text_align: 14,
        autoscroll: 30,
        max_length: 15,
        root: 16
      },
      null,
      [-1, -1]
    );
  }
}
const {
  SvelteComponent: jM,
  add_iframe_resize_listener: WM,
  add_render_callback: YM,
  append_hydration: XM,
  attr: ZM,
  binding_callbacks: KM,
  children: QM,
  claim_element: JM,
  claim_text: ez,
  detach: tz,
  element: rz,
  init: nz,
  insert_hydration: az,
  noop: iz,
  safe_not_equal: lz,
  set_data: sz,
  text: oz,
  toggle_class: uz
} = window.__gradio__svelte__internal, { onMount: cz } = window.__gradio__svelte__internal, {
  SvelteComponent: hz,
  add_flush_callback: dz,
  assign: fz,
  bind: mz,
  binding_callbacks: pz,
  check_outros: gz,
  claim_component: _z,
  claim_space: vz,
  create_component: bz,
  destroy_component: yz,
  detach: wz,
  flush: kz,
  get_spread_object: Dz,
  get_spread_update: Sz,
  group_outros: xz,
  init: Az,
  insert_hydration: Ez,
  mount_component: Cz,
  safe_not_equal: Tz,
  space: Fz,
  transition_in: $z,
  transition_out: Mz
} = window.__gradio__svelte__internal;
new Intl.Collator(0, { numeric: 1 }).compare;
typeof process < "u" && process.versions && process.versions.node;
var Q0;
class zz extends TransformStream {
  /** Constructs a new instance. */
  constructor(t = { allowCR: !1 }) {
    super({
      transform: (r, a) => {
        for (r = qr(this, Q0) + r; ; ) {
          const i = r.indexOf(`
`), l = t.allowCR ? r.indexOf("\r") : -1;
          if (l !== -1 && l !== r.length - 1 && (i === -1 || i - 1 > l)) {
            a.enqueue(r.slice(0, l)), r = r.slice(l + 1);
            continue;
          }
          if (i === -1)
            break;
          const s = r[i - 1] === "\r" ? i - 1 : i;
          a.enqueue(r.slice(0, s)), r = r.slice(i + 1);
        }
        Cs(this, Q0, r);
      },
      flush: (r) => {
        if (qr(this, Q0) === "")
          return;
        const a = t.allowCR && qr(this, Q0).endsWith("\r") ? qr(this, Q0).slice(0, -1) : qr(this, Q0);
        r.enqueue(a);
      }
    });
    di(this, Q0, "");
  }
}
Q0 = new WeakMap();
const { setContext: Bz, getContext: x3 } = window.__gradio__svelte__internal, A3 = "WORKER_PROXY_CONTEXT_KEY";
function E3() {
  return x3(A3);
}
const C3 = "lite.local";
function T3(n) {
  return n.host === window.location.host || n.host === "localhost:7860" || n.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
  n.host === C3;
}
function F3(n, e) {
  const t = e.toLowerCase();
  for (const [r, a] of Object.entries(n))
    if (r.toLowerCase() === t)
      return a;
}
function $3(n) {
  const e = typeof window < "u";
  if (n == null || !e)
    return !1;
  const t = new URL(n, window.location.href);
  return !(!T3(t) || t.protocol !== "http:" && t.protocol !== "https:");
}
let Sa;
async function M3(n) {
  const e = typeof window < "u";
  if (n == null || !e || !$3(n))
    return n;
  if (Sa == null)
    try {
      Sa = E3();
    } catch {
      return n;
    }
  if (Sa == null)
    return n;
  const r = new URL(n, window.location.href).pathname;
  return Sa.httpRequest({
    method: "GET",
    path: r,
    headers: {},
    query_string: ""
  }).then((a) => {
    if (a.status !== 200)
      throw new Error(`Failed to get file ${r} from the Wasm worker.`);
    const i = new Blob([a.body], {
      type: F3(a.headers, "content-type")
    });
    return URL.createObjectURL(i);
  });
}
const {
  SvelteComponent: Lz,
  assign: Rz,
  check_outros: qz,
  children: Iz,
  claim_element: Nz,
  compute_rest_props: Oz,
  create_slot: Pz,
  detach: Hz,
  element: Uz,
  empty: Gz,
  exclude_internal_props: Vz,
  get_all_dirty_from_scope: jz,
  get_slot_changes: Wz,
  get_spread_update: Yz,
  group_outros: Xz,
  init: Zz,
  insert_hydration: Kz,
  listen: Qz,
  prevent_default: Jz,
  safe_not_equal: eB,
  set_attributes: tB,
  set_style: rB,
  toggle_class: nB,
  transition_in: aB,
  transition_out: iB,
  update_slot_base: lB
} = window.__gradio__svelte__internal, { createEventDispatcher: sB, onMount: oB } = window.__gradio__svelte__internal, {
  SvelteComponent: z3,
  assign: $l,
  bubble: B3,
  claim_element: L3,
  compute_rest_props: Nu,
  detach: R3,
  element: q3,
  exclude_internal_props: I3,
  get_spread_update: N3,
  init: O3,
  insert_hydration: P3,
  listen: H3,
  noop: Ou,
  safe_not_equal: U3,
  set_attributes: Pu,
  src_url_equal: G3,
  toggle_class: Hu
} = window.__gradio__svelte__internal;
function V3(n) {
  let e, t, r, a, i = [
    {
      src: t = /*resolved_src*/
      n[0]
    },
    /*$$restProps*/
    n[1]
  ], l = {};
  for (let s = 0; s < i.length; s += 1)
    l = $l(l, i[s]);
  return {
    c() {
      e = q3("img"), this.h();
    },
    l(s) {
      e = L3(s, "IMG", { src: !0 }), this.h();
    },
    h() {
      Pu(e, l), Hu(e, "svelte-kxeri3", !0);
    },
    m(s, o) {
      P3(s, e, o), r || (a = H3(
        e,
        "load",
        /*load_handler*/
        n[4]
      ), r = !0);
    },
    p(s, [o]) {
      Pu(e, l = N3(i, [
        o & /*resolved_src*/
        1 && !G3(e.src, t = /*resolved_src*/
        s[0]) && { src: t },
        o & /*$$restProps*/
        2 && /*$$restProps*/
        s[1]
      ])), Hu(e, "svelte-kxeri3", !0);
    },
    i: Ou,
    o: Ou,
    d(s) {
      s && R3(e), r = !1, a();
    }
  };
}
function j3(n, e, t) {
  const r = ["src"];
  let a = Nu(e, r), { src: i = void 0 } = e, l, s;
  function o(u) {
    B3.call(this, n, u);
  }
  return n.$$set = (u) => {
    e = $l($l({}, e), I3(u)), t(1, a = Nu(e, r)), "src" in u && t(2, i = u.src);
  }, n.$$.update = () => {
    if (n.$$.dirty & /*src, latest_src*/
    12) {
      t(0, l = i), t(3, s = i);
      const u = i;
      M3(u).then((h) => {
        s === u && t(0, l = h);
      });
    }
  }, [l, a, i, s, o];
}
class oh extends z3 {
  constructor(e) {
    super(), O3(this, e, j3, V3, U3, { src: 2 });
  }
}
const {
  SvelteComponent: uB,
  append_hydration: cB,
  attr: hB,
  binding_callbacks: dB,
  bubble: fB,
  check_outros: mB,
  children: pB,
  claim_component: gB,
  claim_element: _B,
  claim_space: vB,
  create_component: bB,
  destroy_component: yB,
  detach: wB,
  element: kB,
  empty: DB,
  group_outros: SB,
  init: xB,
  insert_hydration: AB,
  listen: EB,
  mount_component: CB,
  safe_not_equal: TB,
  space: FB,
  toggle_class: $B,
  transition_in: MB,
  transition_out: zB
} = window.__gradio__svelte__internal, { createEventDispatcher: BB, onMount: LB } = window.__gradio__svelte__internal, {
  SvelteComponent: W3,
  append_hydration: uh,
  attr: Ht,
  bubble: Y3,
  check_outros: hs,
  children: ch,
  claim_component: hh,
  claim_element: dh,
  claim_space: fh,
  create_component: mh,
  create_slot: ph,
  destroy_component: gh,
  detach: Fn,
  element: _h,
  empty: Uu,
  get_all_dirty_from_scope: vh,
  get_slot_changes: bh,
  group_outros: ds,
  init: X3,
  insert_hydration: fs,
  listen: Z3,
  mount_component: yh,
  safe_not_equal: K3,
  set_style: Lt,
  space: wh,
  toggle_class: jr,
  transition_in: i0,
  transition_out: q0,
  update_slot_base: kh
} = window.__gradio__svelte__internal;
function Q3(n) {
  let e, t, r, a, i, l, s = (
    /*icon*/
    n[7] && Gu(n)
  );
  const o = (
    /*#slots*/
    n[12].default
  ), u = ph(
    o,
    n,
    /*$$scope*/
    n[11],
    null
  );
  return {
    c() {
      e = _h("button"), s && s.c(), t = wh(), u && u.c(), this.h();
    },
    l(h) {
      e = dh(h, "BUTTON", { class: !0, id: !0 });
      var f = ch(e);
      s && s.l(f), t = fh(f), u && u.l(f), f.forEach(Fn), this.h();
    },
    h() {
      Ht(e, "class", r = /*size*/
      n[4] + " " + /*variant*/
      n[3] + " " + /*elem_classes*/
      n[1].join(" ") + " svelte-rvoavt"), Ht(
        e,
        "id",
        /*elem_id*/
        n[0]
      ), e.disabled = /*disabled*/
      n[8], jr(e, "hidden", !/*visible*/
      n[2]), Lt(
        e,
        "flex-grow",
        /*scale*/
        n[9]
      ), Lt(
        e,
        "width",
        /*scale*/
        n[9] === 0 ? "fit-content" : null
      ), Lt(e, "min-width", typeof /*min_width*/
      n[10] == "number" ? `calc(min(${/*min_width*/
      n[10]}px, 100%))` : null);
    },
    m(h, f) {
      fs(h, e, f), s && s.m(e, null), uh(e, t), u && u.m(e, null), a = !0, i || (l = Z3(
        e,
        "click",
        /*click_handler*/
        n[13]
      ), i = !0);
    },
    p(h, f) {
      /*icon*/
      h[7] ? s ? (s.p(h, f), f & /*icon*/
      128 && i0(s, 1)) : (s = Gu(h), s.c(), i0(s, 1), s.m(e, t)) : s && (ds(), q0(s, 1, 1, () => {
        s = null;
      }), hs()), u && u.p && (!a || f & /*$$scope*/
      2048) && kh(
        u,
        o,
        h,
        /*$$scope*/
        h[11],
        a ? bh(
          o,
          /*$$scope*/
          h[11],
          f,
          null
        ) : vh(
          /*$$scope*/
          h[11]
        ),
        null
      ), (!a || f & /*size, variant, elem_classes*/
      26 && r !== (r = /*size*/
      h[4] + " " + /*variant*/
      h[3] + " " + /*elem_classes*/
      h[1].join(" ") + " svelte-rvoavt")) && Ht(e, "class", r), (!a || f & /*elem_id*/
      1) && Ht(
        e,
        "id",
        /*elem_id*/
        h[0]
      ), (!a || f & /*disabled*/
      256) && (e.disabled = /*disabled*/
      h[8]), (!a || f & /*size, variant, elem_classes, visible*/
      30) && jr(e, "hidden", !/*visible*/
      h[2]), f & /*scale*/
      512 && Lt(
        e,
        "flex-grow",
        /*scale*/
        h[9]
      ), f & /*scale*/
      512 && Lt(
        e,
        "width",
        /*scale*/
        h[9] === 0 ? "fit-content" : null
      ), f & /*min_width*/
      1024 && Lt(e, "min-width", typeof /*min_width*/
      h[10] == "number" ? `calc(min(${/*min_width*/
      h[10]}px, 100%))` : null);
    },
    i(h) {
      a || (i0(s), i0(u, h), a = !0);
    },
    o(h) {
      q0(s), q0(u, h), a = !1;
    },
    d(h) {
      h && Fn(e), s && s.d(), u && u.d(h), i = !1, l();
    }
  };
}
function J3(n) {
  let e, t, r, a, i = (
    /*icon*/
    n[7] && Vu(n)
  );
  const l = (
    /*#slots*/
    n[12].default
  ), s = ph(
    l,
    n,
    /*$$scope*/
    n[11],
    null
  );
  return {
    c() {
      e = _h("a"), i && i.c(), t = wh(), s && s.c(), this.h();
    },
    l(o) {
      e = dh(o, "A", {
        href: !0,
        rel: !0,
        "aria-disabled": !0,
        class: !0,
        id: !0
      });
      var u = ch(e);
      i && i.l(u), t = fh(u), s && s.l(u), u.forEach(Fn), this.h();
    },
    h() {
      Ht(
        e,
        "href",
        /*link*/
        n[6]
      ), Ht(e, "rel", "noopener noreferrer"), Ht(
        e,
        "aria-disabled",
        /*disabled*/
        n[8]
      ), Ht(e, "class", r = /*size*/
      n[4] + " " + /*variant*/
      n[3] + " " + /*elem_classes*/
      n[1].join(" ") + " svelte-rvoavt"), Ht(
        e,
        "id",
        /*elem_id*/
        n[0]
      ), jr(e, "hidden", !/*visible*/
      n[2]), jr(
        e,
        "disabled",
        /*disabled*/
        n[8]
      ), Lt(
        e,
        "flex-grow",
        /*scale*/
        n[9]
      ), Lt(
        e,
        "pointer-events",
        /*disabled*/
        n[8] ? "none" : null
      ), Lt(
        e,
        "width",
        /*scale*/
        n[9] === 0 ? "fit-content" : null
      ), Lt(e, "min-width", typeof /*min_width*/
      n[10] == "number" ? `calc(min(${/*min_width*/
      n[10]}px, 100%))` : null);
    },
    m(o, u) {
      fs(o, e, u), i && i.m(e, null), uh(e, t), s && s.m(e, null), a = !0;
    },
    p(o, u) {
      /*icon*/
      o[7] ? i ? (i.p(o, u), u & /*icon*/
      128 && i0(i, 1)) : (i = Vu(o), i.c(), i0(i, 1), i.m(e, t)) : i && (ds(), q0(i, 1, 1, () => {
        i = null;
      }), hs()), s && s.p && (!a || u & /*$$scope*/
      2048) && kh(
        s,
        l,
        o,
        /*$$scope*/
        o[11],
        a ? bh(
          l,
          /*$$scope*/
          o[11],
          u,
          null
        ) : vh(
          /*$$scope*/
          o[11]
        ),
        null
      ), (!a || u & /*link*/
      64) && Ht(
        e,
        "href",
        /*link*/
        o[6]
      ), (!a || u & /*disabled*/
      256) && Ht(
        e,
        "aria-disabled",
        /*disabled*/
        o[8]
      ), (!a || u & /*size, variant, elem_classes*/
      26 && r !== (r = /*size*/
      o[4] + " " + /*variant*/
      o[3] + " " + /*elem_classes*/
      o[1].join(" ") + " svelte-rvoavt")) && Ht(e, "class", r), (!a || u & /*elem_id*/
      1) && Ht(
        e,
        "id",
        /*elem_id*/
        o[0]
      ), (!a || u & /*size, variant, elem_classes, visible*/
      30) && jr(e, "hidden", !/*visible*/
      o[2]), (!a || u & /*size, variant, elem_classes, disabled*/
      282) && jr(
        e,
        "disabled",
        /*disabled*/
        o[8]
      ), u & /*scale*/
      512 && Lt(
        e,
        "flex-grow",
        /*scale*/
        o[9]
      ), u & /*disabled*/
      256 && Lt(
        e,
        "pointer-events",
        /*disabled*/
        o[8] ? "none" : null
      ), u & /*scale*/
      512 && Lt(
        e,
        "width",
        /*scale*/
        o[9] === 0 ? "fit-content" : null
      ), u & /*min_width*/
      1024 && Lt(e, "min-width", typeof /*min_width*/
      o[10] == "number" ? `calc(min(${/*min_width*/
      o[10]}px, 100%))` : null);
    },
    i(o) {
      a || (i0(i), i0(s, o), a = !0);
    },
    o(o) {
      q0(i), q0(s, o), a = !1;
    },
    d(o) {
      o && Fn(e), i && i.d(), s && s.d(o);
    }
  };
}
function Gu(n) {
  let e, t;
  return e = new oh({
    props: {
      class: `button-icon ${/*value*/
      n[5] ? "right-padded" : ""}`,
      src: (
        /*icon*/
        n[7].url
      ),
      alt: `${/*value*/
      n[5]} icon`
    }
  }), {
    c() {
      mh(e.$$.fragment);
    },
    l(r) {
      hh(e.$$.fragment, r);
    },
    m(r, a) {
      yh(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a & /*value*/
      32 && (i.class = `button-icon ${/*value*/
      r[5] ? "right-padded" : ""}`), a & /*icon*/
      128 && (i.src = /*icon*/
      r[7].url), a & /*value*/
      32 && (i.alt = `${/*value*/
      r[5]} icon`), e.$set(i);
    },
    i(r) {
      t || (i0(e.$$.fragment, r), t = !0);
    },
    o(r) {
      q0(e.$$.fragment, r), t = !1;
    },
    d(r) {
      gh(e, r);
    }
  };
}
function Vu(n) {
  let e, t;
  return e = new oh({
    props: {
      class: "button-icon",
      src: (
        /*icon*/
        n[7].url
      ),
      alt: `${/*value*/
      n[5]} icon`
    }
  }), {
    c() {
      mh(e.$$.fragment);
    },
    l(r) {
      hh(e.$$.fragment, r);
    },
    m(r, a) {
      yh(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a & /*icon*/
      128 && (i.src = /*icon*/
      r[7].url), a & /*value*/
      32 && (i.alt = `${/*value*/
      r[5]} icon`), e.$set(i);
    },
    i(r) {
      t || (i0(e.$$.fragment, r), t = !0);
    },
    o(r) {
      q0(e.$$.fragment, r), t = !1;
    },
    d(r) {
      gh(e, r);
    }
  };
}
function e6(n) {
  let e, t, r, a;
  const i = [J3, Q3], l = [];
  function s(o, u) {
    return (
      /*link*/
      o[6] && /*link*/
      o[6].length > 0 ? 0 : 1
    );
  }
  return e = s(n), t = l[e] = i[e](n), {
    c() {
      t.c(), r = Uu();
    },
    l(o) {
      t.l(o), r = Uu();
    },
    m(o, u) {
      l[e].m(o, u), fs(o, r, u), a = !0;
    },
    p(o, [u]) {
      let h = e;
      e = s(o), e === h ? l[e].p(o, u) : (ds(), q0(l[h], 1, 1, () => {
        l[h] = null;
      }), hs(), t = l[e], t ? t.p(o, u) : (t = l[e] = i[e](o), t.c()), i0(t, 1), t.m(r.parentNode, r));
    },
    i(o) {
      a || (i0(t), a = !0);
    },
    o(o) {
      q0(t), a = !1;
    },
    d(o) {
      o && Fn(r), l[e].d(o);
    }
  };
}
function t6(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { elem_id: i = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { variant: o = "secondary" } = e, { size: u = "lg" } = e, { value: h = null } = e, { link: f = null } = e, { icon: p = null } = e, { disabled: g = !1 } = e, { scale: w = null } = e, { min_width: v = void 0 } = e;
  function y(E) {
    Y3.call(this, n, E);
  }
  return n.$$set = (E) => {
    "elem_id" in E && t(0, i = E.elem_id), "elem_classes" in E && t(1, l = E.elem_classes), "visible" in E && t(2, s = E.visible), "variant" in E && t(3, o = E.variant), "size" in E && t(4, u = E.size), "value" in E && t(5, h = E.value), "link" in E && t(6, f = E.link), "icon" in E && t(7, p = E.icon), "disabled" in E && t(8, g = E.disabled), "scale" in E && t(9, w = E.scale), "min_width" in E && t(10, v = E.min_width), "$$scope" in E && t(11, a = E.$$scope);
  }, [
    i,
    l,
    s,
    o,
    u,
    h,
    f,
    p,
    g,
    w,
    v,
    a,
    r,
    y
  ];
}
class ms extends W3 {
  constructor(e) {
    super(), X3(this, e, t6, e6, K3, {
      elem_id: 0,
      elem_classes: 1,
      visible: 2,
      variant: 3,
      size: 4,
      value: 5,
      link: 6,
      icon: 7,
      disabled: 8,
      scale: 9,
      min_width: 10
    });
  }
}
const {
  SvelteComponent: RB,
  claim_component: qB,
  claim_text: IB,
  create_component: NB,
  destroy_component: OB,
  detach: PB,
  init: HB,
  insert_hydration: UB,
  mount_component: GB,
  safe_not_equal: VB,
  set_data: jB,
  text: WB,
  transition_in: YB,
  transition_out: XB
} = window.__gradio__svelte__internal, {
  SvelteComponent: r6,
  append_hydration: xa,
  attr: Y0,
  children: ju,
  claim_element: al,
  claim_space: n6,
  claim_text: a6,
  detach: il,
  element: ll,
  init: i6,
  init_binding_group: l6,
  insert_hydration: s6,
  listen: o6,
  noop: Wu,
  safe_not_equal: u6,
  set_data: c6,
  set_input_value: Yu,
  space: h6,
  text: d6,
  toggle_class: Ur
} = window.__gradio__svelte__internal, { createEventDispatcher: f6 } = window.__gradio__svelte__internal;
function m6(n) {
  let e, t, r = !1, a, i, l, s, o, u, h;
  return o = l6(
    /*$$binding_groups*/
    n[7][0]
  ), {
    c() {
      e = ll("label"), t = ll("input"), a = h6(), i = ll("span"), l = d6(
        /*display_value*/
        n[1]
      ), this.h();
    },
    l(f) {
      e = al(f, "LABEL", { "data-testid": !0, class: !0 });
      var p = ju(e);
      t = al(p, "INPUT", {
        type: !0,
        name: !0,
        "aria-checked": !0,
        class: !0
      }), a = n6(p), i = al(p, "SPAN", { class: !0 });
      var g = ju(i);
      l = a6(
        g,
        /*display_value*/
        n[1]
      ), g.forEach(il), p.forEach(il), this.h();
    },
    h() {
      t.disabled = /*disabled*/
      n[3], Y0(t, "type", "radio"), Y0(t, "name", "radio-" + ++p6), t.__value = /*internal_value*/
      n[2], Yu(t, t.__value), Y0(
        t,
        "aria-checked",
        /*is_selected*/
        n[5]
      ), Y0(t, "class", "svelte-e9stf"), Y0(i, "class", "svelte-e9stf"), Y0(e, "data-testid", s = /*display_value*/
      n[1] + "-radio-label"), Y0(e, "class", "svelte-e9stf"), Ur(
        e,
        "disabled",
        /*disabled*/
        n[3]
      ), Ur(
        e,
        "selected",
        /*is_selected*/
        n[5]
      ), Ur(
        e,
        "rtl",
        /*rtl*/
        n[4]
      ), o.p(t);
    },
    m(f, p) {
      s6(f, e, p), xa(e, t), t.checked = t.__value === /*selected*/
      n[0], xa(e, a), xa(e, i), xa(i, l), u || (h = o6(
        t,
        "change",
        /*input_change_handler*/
        n[6]
      ), u = !0);
    },
    p(f, [p]) {
      p & /*disabled*/
      8 && (t.disabled = /*disabled*/
      f[3]), p & /*internal_value*/
      4 && (t.__value = /*internal_value*/
      f[2], Yu(t, t.__value), r = !0), p & /*is_selected*/
      32 && Y0(
        t,
        "aria-checked",
        /*is_selected*/
        f[5]
      ), (r || p & /*selected*/
      1) && (t.checked = t.__value === /*selected*/
      f[0]), p & /*display_value*/
      2 && c6(
        l,
        /*display_value*/
        f[1]
      ), p & /*display_value*/
      2 && s !== (s = /*display_value*/
      f[1] + "-radio-label") && Y0(e, "data-testid", s), p & /*disabled*/
      8 && Ur(
        e,
        "disabled",
        /*disabled*/
        f[3]
      ), p & /*is_selected*/
      32 && Ur(
        e,
        "selected",
        /*is_selected*/
        f[5]
      ), p & /*rtl*/
      16 && Ur(
        e,
        "rtl",
        /*rtl*/
        f[4]
      );
    },
    i: Wu,
    o: Wu,
    d(f) {
      f && il(e), o.r(), u = !1, h();
    }
  };
}
let p6 = 0;
function g6(n, e, t) {
  let { display_value: r } = e, { internal_value: a } = e, { disabled: i = !1 } = e, { selected: l = null } = e, { rtl: s = !1 } = e;
  const o = f6();
  let u = !1;
  async function h(g, w) {
    t(5, u = g === w), u && o("input", w);
  }
  const f = [[]];
  function p() {
    l = this.__value, t(0, l);
  }
  return n.$$set = (g) => {
    "display_value" in g && t(1, r = g.display_value), "internal_value" in g && t(2, a = g.internal_value), "disabled" in g && t(3, i = g.disabled), "selected" in g && t(0, l = g.selected), "rtl" in g && t(4, s = g.rtl);
  }, n.$$.update = () => {
    n.$$.dirty & /*selected, internal_value*/
    5 && h(l, a);
  }, [
    l,
    r,
    a,
    i,
    s,
    u,
    p,
    f
  ];
}
class Xu extends r6 {
  constructor(e) {
    super(), i6(this, e, g6, m6, u6, {
      display_value: 1,
      internal_value: 2,
      disabled: 3,
      selected: 0,
      rtl: 4
    });
  }
}
const {
  SvelteComponent: ZB,
  append_hydration: KB,
  attr: QB,
  children: JB,
  claim_element: eL,
  claim_text: tL,
  detach: rL,
  element: nL,
  init: aL,
  insert_hydration: iL,
  noop: lL,
  safe_not_equal: sL,
  set_data: oL,
  text: uL,
  toggle_class: cL
} = window.__gradio__svelte__internal, {
  SvelteComponent: hL,
  add_flush_callback: dL,
  assign: fL,
  attr: mL,
  bind: pL,
  binding_callbacks: gL,
  check_outros: _L,
  children: vL,
  claim_component: bL,
  claim_element: yL,
  claim_space: wL,
  claim_text: kL,
  create_component: DL,
  destroy_component: SL,
  detach: xL,
  element: AL,
  empty: EL,
  ensure_array_like: CL,
  get_spread_object: TL,
  get_spread_update: FL,
  group_outros: $L,
  init: ML,
  insert_hydration: zL,
  mount_component: BL,
  outro_and_destroy_block: LL,
  safe_not_equal: RL,
  set_data: qL,
  space: IL,
  text: NL,
  transition_in: OL,
  transition_out: PL,
  update_keyed_each: HL
} = window.__gradio__svelte__internal, {
  SvelteComponent: _6,
  append_hydration: v6,
  assign: b6,
  attr: Aa,
  check_outros: y6,
  children: w6,
  claim_component: k6,
  claim_element: D6,
  claim_space: S6,
  create_component: x6,
  create_slot: A6,
  destroy_component: E6,
  detach: Zu,
  element: C6,
  get_all_dirty_from_scope: T6,
  get_slot_changes: F6,
  get_spread_object: $6,
  get_spread_update: M6,
  group_outros: z6,
  init: B6,
  insert_hydration: L6,
  mount_component: R6,
  safe_not_equal: q6,
  set_style: cr,
  space: I6,
  toggle_class: e0,
  transition_in: _n,
  transition_out: Ra,
  update_slot_base: N6
} = window.__gradio__svelte__internal;
function Ku(n) {
  let e, t;
  const r = [
    { autoscroll: (
      /*gradio*/
      n[6].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      n[6].i18n
    ) },
    /*loading_status*/
    n[5],
    {
      status: (
        /*loading_status*/
        n[5] ? (
          /*loading_status*/
          n[5].status == "pending" ? "generating" : (
            /*loading_status*/
            n[5].status
          )
        ) : null
      )
    }
  ];
  let a = {};
  for (let i = 0; i < r.length; i += 1)
    a = b6(a, r[i]);
  return e = new ss({ props: a }), {
    c() {
      x6(e.$$.fragment);
    },
    l(i) {
      k6(e.$$.fragment, i);
    },
    m(i, l) {
      R6(e, i, l), t = !0;
    },
    p(i, l) {
      const s = l & /*gradio, loading_status*/
      96 ? M6(r, [
        l & /*gradio*/
        64 && { autoscroll: (
          /*gradio*/
          i[6].autoscroll
        ) },
        l & /*gradio*/
        64 && { i18n: (
          /*gradio*/
          i[6].i18n
        ) },
        l & /*loading_status*/
        32 && $6(
          /*loading_status*/
          i[5]
        ),
        l & /*loading_status*/
        32 && {
          status: (
            /*loading_status*/
            i[5] ? (
              /*loading_status*/
              i[5].status == "pending" ? "generating" : (
                /*loading_status*/
                i[5].status
              )
            ) : null
          )
        }
      ]) : {};
      e.$set(s);
    },
    i(i) {
      t || (_n(e.$$.fragment, i), t = !0);
    },
    o(i) {
      Ra(e.$$.fragment, i), t = !1;
    },
    d(i) {
      E6(e, i);
    }
  };
}
function O6(n) {
  let e, t, r, a, i = (
    /*loading_status*/
    n[5] && /*show_progress*/
    n[7] && /*gradio*/
    n[6] && Ku(n)
  );
  const l = (
    /*#slots*/
    n[14].default
  ), s = A6(
    l,
    n,
    /*$$scope*/
    n[13],
    null
  );
  return {
    c() {
      e = C6("div"), i && i.c(), t = I6(), s && s.c(), this.h();
    },
    l(o) {
      e = D6(o, "DIV", { id: !0, class: !0 });
      var u = w6(e);
      i && i.l(u), t = S6(u), s && s.l(u), u.forEach(Zu), this.h();
    },
    h() {
      Aa(
        e,
        "id",
        /*elem_id*/
        n[1]
      ), Aa(e, "class", r = "row " + /*elem_classes*/
      n[2].join(" ") + " svelte-14z3143"), e0(
        e,
        "compact",
        /*variant*/
        n[4] === "compact"
      ), e0(
        e,
        "panel",
        /*variant*/
        n[4] === "panel"
      ), e0(
        e,
        "unequal-height",
        /*equal_height*/
        n[0] === !1
      ), e0(
        e,
        "stretch",
        /*equal_height*/
        n[0]
      ), e0(e, "hide", !/*visible*/
      n[3]), e0(
        e,
        "grow-children",
        /*scale*/
        n[11] && /*scale*/
        n[11] >= 1
      ), cr(
        e,
        "height",
        /*get_dimension*/
        n[12](
          /*height*/
          n[8]
        )
      ), cr(
        e,
        "max-height",
        /*get_dimension*/
        n[12](
          /*max_height*/
          n[10]
        )
      ), cr(
        e,
        "min-height",
        /*get_dimension*/
        n[12](
          /*min_height*/
          n[9]
        )
      ), cr(
        e,
        "flex-grow",
        /*scale*/
        n[11]
      );
    },
    m(o, u) {
      L6(o, e, u), i && i.m(e, null), v6(e, t), s && s.m(e, null), a = !0;
    },
    p(o, [u]) {
      /*loading_status*/
      o[5] && /*show_progress*/
      o[7] && /*gradio*/
      o[6] ? i ? (i.p(o, u), u & /*loading_status, show_progress, gradio*/
      224 && _n(i, 1)) : (i = Ku(o), i.c(), _n(i, 1), i.m(e, t)) : i && (z6(), Ra(i, 1, 1, () => {
        i = null;
      }), y6()), s && s.p && (!a || u & /*$$scope*/
      8192) && N6(
        s,
        l,
        o,
        /*$$scope*/
        o[13],
        a ? F6(
          l,
          /*$$scope*/
          o[13],
          u,
          null
        ) : T6(
          /*$$scope*/
          o[13]
        ),
        null
      ), (!a || u & /*elem_id*/
      2) && Aa(
        e,
        "id",
        /*elem_id*/
        o[1]
      ), (!a || u & /*elem_classes*/
      4 && r !== (r = "row " + /*elem_classes*/
      o[2].join(" ") + " svelte-14z3143")) && Aa(e, "class", r), (!a || u & /*elem_classes, variant*/
      20) && e0(
        e,
        "compact",
        /*variant*/
        o[4] === "compact"
      ), (!a || u & /*elem_classes, variant*/
      20) && e0(
        e,
        "panel",
        /*variant*/
        o[4] === "panel"
      ), (!a || u & /*elem_classes, equal_height*/
      5) && e0(
        e,
        "unequal-height",
        /*equal_height*/
        o[0] === !1
      ), (!a || u & /*elem_classes, equal_height*/
      5) && e0(
        e,
        "stretch",
        /*equal_height*/
        o[0]
      ), (!a || u & /*elem_classes, visible*/
      12) && e0(e, "hide", !/*visible*/
      o[3]), (!a || u & /*elem_classes, scale*/
      2052) && e0(
        e,
        "grow-children",
        /*scale*/
        o[11] && /*scale*/
        o[11] >= 1
      ), u & /*height*/
      256 && cr(
        e,
        "height",
        /*get_dimension*/
        o[12](
          /*height*/
          o[8]
        )
      ), u & /*max_height*/
      1024 && cr(
        e,
        "max-height",
        /*get_dimension*/
        o[12](
          /*max_height*/
          o[10]
        )
      ), u & /*min_height*/
      512 && cr(
        e,
        "min-height",
        /*get_dimension*/
        o[12](
          /*min_height*/
          o[9]
        )
      ), u & /*scale*/
      2048 && cr(
        e,
        "flex-grow",
        /*scale*/
        o[11]
      );
    },
    i(o) {
      a || (_n(i), _n(s, o), a = !0);
    },
    o(o) {
      Ra(i), Ra(s, o), a = !1;
    },
    d(o) {
      o && Zu(e), i && i.d(), s && s.d(o);
    }
  };
}
function P6(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { equal_height: i = !0 } = e, { elem_id: l } = e, { elem_classes: s = [] } = e, { visible: o = !0 } = e, { variant: u = "default" } = e, { loading_status: h = void 0 } = e, { gradio: f = void 0 } = e, { show_progress: p = !1 } = e, { height: g } = e, { min_height: w } = e, { max_height: v } = e, { scale: y = null } = e;
  const E = (k) => {
    if (k !== void 0) {
      if (typeof k == "number")
        return k + "px";
      if (typeof k == "string")
        return k;
    }
  };
  return n.$$set = (k) => {
    "equal_height" in k && t(0, i = k.equal_height), "elem_id" in k && t(1, l = k.elem_id), "elem_classes" in k && t(2, s = k.elem_classes), "visible" in k && t(3, o = k.visible), "variant" in k && t(4, u = k.variant), "loading_status" in k && t(5, h = k.loading_status), "gradio" in k && t(6, f = k.gradio), "show_progress" in k && t(7, p = k.show_progress), "height" in k && t(8, g = k.height), "min_height" in k && t(9, w = k.min_height), "max_height" in k && t(10, v = k.max_height), "scale" in k && t(11, y = k.scale), "$$scope" in k && t(13, a = k.$$scope);
  }, [
    i,
    l,
    s,
    o,
    u,
    h,
    f,
    p,
    g,
    w,
    v,
    y,
    E,
    a,
    r
  ];
}
let sl = class extends _6 {
  constructor(e) {
    super(), B6(this, e, P6, O6, q6, {
      equal_height: 0,
      elem_id: 1,
      elem_classes: 2,
      visible: 3,
      variant: 4,
      loading_status: 5,
      gradio: 6,
      show_progress: 7,
      height: 8,
      min_height: 9,
      max_height: 10,
      scale: 11
    });
  }
};
const {
  SvelteComponent: H6,
  append_hydration: U6,
  assign: G6,
  attr: Ea,
  check_outros: V6,
  children: j6,
  claim_component: W6,
  claim_element: Y6,
  claim_space: X6,
  create_component: Z6,
  create_slot: K6,
  destroy_component: Q6,
  detach: Qu,
  element: J6,
  get_all_dirty_from_scope: e7,
  get_slot_changes: t7,
  get_spread_object: r7,
  get_spread_update: n7,
  group_outros: a7,
  init: i7,
  insert_hydration: l7,
  mount_component: s7,
  safe_not_equal: o7,
  set_style: Ca,
  space: u7,
  toggle_class: hr,
  transition_in: vn,
  transition_out: qa,
  update_slot_base: c7
} = window.__gradio__svelte__internal;
function Ju(n) {
  let e, t;
  const r = [
    { autoscroll: (
      /*gradio*/
      n[8].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      n[8].i18n
    ) },
    /*loading_status*/
    n[7],
    {
      status: (
        /*loading_status*/
        n[7] ? (
          /*loading_status*/
          n[7].status == "pending" ? "generating" : (
            /*loading_status*/
            n[7].status
          )
        ) : null
      )
    }
  ];
  let a = {};
  for (let i = 0; i < r.length; i += 1)
    a = G6(a, r[i]);
  return e = new ss({ props: a }), {
    c() {
      Z6(e.$$.fragment);
    },
    l(i) {
      W6(e.$$.fragment, i);
    },
    m(i, l) {
      s7(e, i, l), t = !0;
    },
    p(i, l) {
      const s = l & /*gradio, loading_status*/
      384 ? n7(r, [
        l & /*gradio*/
        256 && { autoscroll: (
          /*gradio*/
          i[8].autoscroll
        ) },
        l & /*gradio*/
        256 && { i18n: (
          /*gradio*/
          i[8].i18n
        ) },
        l & /*loading_status*/
        128 && r7(
          /*loading_status*/
          i[7]
        ),
        l & /*loading_status*/
        128 && {
          status: (
            /*loading_status*/
            i[7] ? (
              /*loading_status*/
              i[7].status == "pending" ? "generating" : (
                /*loading_status*/
                i[7].status
              )
            ) : null
          )
        }
      ]) : {};
      e.$set(s);
    },
    i(i) {
      t || (vn(e.$$.fragment, i), t = !0);
    },
    o(i) {
      qa(e.$$.fragment, i), t = !1;
    },
    d(i) {
      Q6(e, i);
    }
  };
}
function h7(n) {
  let e, t, r, a = `calc(min(${/*min_width*/
  n[2]}px, 100%))`, i, l = (
    /*loading_status*/
    n[7] && /*show_progress*/
    n[9] && /*gradio*/
    n[8] && Ju(n)
  );
  const s = (
    /*#slots*/
    n[11].default
  ), o = K6(
    s,
    n,
    /*$$scope*/
    n[10],
    null
  );
  return {
    c() {
      e = J6("div"), l && l.c(), t = u7(), o && o.c(), this.h();
    },
    l(u) {
      e = Y6(u, "DIV", { id: !0, class: !0 });
      var h = j6(e);
      l && l.l(h), t = X6(h), o && o.l(h), h.forEach(Qu), this.h();
    },
    h() {
      Ea(
        e,
        "id",
        /*elem_id*/
        n[3]
      ), Ea(e, "class", r = "column " + /*elem_classes*/
      n[4].join(" ") + " svelte-1m1obck"), hr(
        e,
        "gap",
        /*gap*/
        n[1]
      ), hr(
        e,
        "compact",
        /*variant*/
        n[6] === "compact"
      ), hr(
        e,
        "panel",
        /*variant*/
        n[6] === "panel"
      ), hr(e, "hide", !/*visible*/
      n[5]), Ca(
        e,
        "flex-grow",
        /*scale*/
        n[0]
      ), Ca(e, "min-width", a);
    },
    m(u, h) {
      l7(u, e, h), l && l.m(e, null), U6(e, t), o && o.m(e, null), i = !0;
    },
    p(u, [h]) {
      /*loading_status*/
      u[7] && /*show_progress*/
      u[9] && /*gradio*/
      u[8] ? l ? (l.p(u, h), h & /*loading_status, show_progress, gradio*/
      896 && vn(l, 1)) : (l = Ju(u), l.c(), vn(l, 1), l.m(e, t)) : l && (a7(), qa(l, 1, 1, () => {
        l = null;
      }), V6()), o && o.p && (!i || h & /*$$scope*/
      1024) && c7(
        o,
        s,
        u,
        /*$$scope*/
        u[10],
        i ? t7(
          s,
          /*$$scope*/
          u[10],
          h,
          null
        ) : e7(
          /*$$scope*/
          u[10]
        ),
        null
      ), (!i || h & /*elem_id*/
      8) && Ea(
        e,
        "id",
        /*elem_id*/
        u[3]
      ), (!i || h & /*elem_classes*/
      16 && r !== (r = "column " + /*elem_classes*/
      u[4].join(" ") + " svelte-1m1obck")) && Ea(e, "class", r), (!i || h & /*elem_classes, gap*/
      18) && hr(
        e,
        "gap",
        /*gap*/
        u[1]
      ), (!i || h & /*elem_classes, variant*/
      80) && hr(
        e,
        "compact",
        /*variant*/
        u[6] === "compact"
      ), (!i || h & /*elem_classes, variant*/
      80) && hr(
        e,
        "panel",
        /*variant*/
        u[6] === "panel"
      ), (!i || h & /*elem_classes, visible*/
      48) && hr(e, "hide", !/*visible*/
      u[5]), h & /*scale*/
      1 && Ca(
        e,
        "flex-grow",
        /*scale*/
        u[0]
      ), h & /*min_width*/
      4 && a !== (a = `calc(min(${/*min_width*/
      u[2]}px, 100%))`) && Ca(e, "min-width", a);
    },
    i(u) {
      i || (vn(l), vn(o, u), i = !0);
    },
    o(u) {
      qa(l), qa(o, u), i = !1;
    },
    d(u) {
      u && Qu(e), l && l.d(), o && o.d(u);
    }
  };
}
function d7(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { scale: i = null } = e, { gap: l = !0 } = e, { min_width: s = 0 } = e, { elem_id: o = "" } = e, { elem_classes: u = [] } = e, { visible: h = !0 } = e, { variant: f = "default" } = e, { loading_status: p = void 0 } = e, { gradio: g = void 0 } = e, { show_progress: w = !1 } = e;
  return n.$$set = (v) => {
    "scale" in v && t(0, i = v.scale), "gap" in v && t(1, l = v.gap), "min_width" in v && t(2, s = v.min_width), "elem_id" in v && t(3, o = v.elem_id), "elem_classes" in v && t(4, u = v.elem_classes), "visible" in v && t(5, h = v.visible), "variant" in v && t(6, f = v.variant), "loading_status" in v && t(7, p = v.loading_status), "gradio" in v && t(8, g = v.gradio), "show_progress" in v && t(9, w = v.show_progress), "$$scope" in v && t(10, a = v.$$scope);
  }, [
    i,
    l,
    s,
    o,
    u,
    h,
    f,
    p,
    g,
    w,
    a,
    r
  ];
}
let Cr = class extends H6 {
  constructor(e) {
    super(), i7(this, e, d7, h7, o7, {
      scale: 0,
      gap: 1,
      min_width: 2,
      elem_id: 3,
      elem_classes: 4,
      visible: 5,
      variant: 6,
      loading_status: 7,
      gradio: 8,
      show_progress: 9
    });
  }
};
const {
  SvelteComponent: f7,
  add_flush_callback: $n,
  add_render_callback: m7,
  append_hydration: _t,
  assign: p7,
  attr: nt,
  bind: Mn,
  binding_callbacks: zn,
  check_outros: e1,
  children: jt,
  claim_component: Qe,
  claim_element: ot,
  claim_space: Dt,
  claim_text: Dh,
  create_component: Je,
  destroy_component: et,
  destroy_each: g7,
  detach: we,
  element: ut,
  ensure_array_like: t1,
  get_spread_object: _7,
  get_spread_update: v7,
  get_svelte_dataset: xn,
  group_outros: r1,
  head_selector: b7,
  init: y7,
  insert_hydration: ct,
  listen: Ml,
  mount_component: tt,
  noop: ii,
  run_all: w7,
  safe_not_equal: k7,
  select_option: n1,
  select_value: D7,
  set_data: S7,
  set_input_value: x7,
  set_style: A7,
  space: St,
  src_url_equal: a1,
  text: Sh,
  transition_in: Re,
  transition_out: Oe
} = window.__gradio__svelte__internal;
function i1(n, e, t) {
  const r = n.slice();
  return r[45] = e[t], r;
}
function l1(n) {
  let e, t;
  const r = [
    { autoscroll: (
      /*gradio*/
      n[3].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      n[3].i18n
    ) },
    /*loading_status*/
    n[11]
  ];
  let a = {};
  for (let i = 0; i < r.length; i += 1)
    a = p7(a, r[i]);
  return e = new ss({ props: a }), e.$on(
    "clear_status",
    /*clear_status_handler*/
    n[29]
  ), {
    c() {
      Je(e.$$.fragment);
    },
    l(i) {
      Qe(e.$$.fragment, i);
    },
    m(i, l) {
      tt(e, i, l), t = !0;
    },
    p(i, l) {
      const s = l[0] & /*gradio, loading_status*/
      2056 ? v7(r, [
        l[0] & /*gradio*/
        8 && { autoscroll: (
          /*gradio*/
          i[3].autoscroll
        ) },
        l[0] & /*gradio*/
        8 && { i18n: (
          /*gradio*/
          i[3].i18n
        ) },
        l[0] & /*loading_status*/
        2048 && _7(
          /*loading_status*/
          i[11]
        )
      ]) : {};
      e.$set(s);
    },
    i(i) {
      t || (Re(e.$$.fragment, i), t = !0);
    },
    o(i) {
      Oe(e.$$.fragment, i), t = !1;
    },
    d(i) {
      et(e, i);
    }
  };
}
function E7(n) {
  let e;
  return {
    c() {
      e = Sh(
        /*label*/
        n[4]
      );
    },
    l(t) {
      e = Dh(
        t,
        /*label*/
        n[4]
      );
    },
    m(t, r) {
      ct(t, e, r);
    },
    p(t, r) {
      r[0] & /*label*/
      16 && S7(
        e,
        /*label*/
        t[4]
      );
    },
    d(t) {
      t && we(e);
    }
  };
}
function s1(n) {
  let e, t, r, a, i, l, s;
  return t = new sl({
    props: {
      style: "align-items: center; gap: 2rem;",
      $$slots: { default: [L7] },
      $$scope: { ctx: n }
    }
  }), a = new sl({
    props: {
      style: "align-items: center; gap: 2rem;",
      $$slots: { default: [I7] },
      $$scope: { ctx: n }
    }
  }), l = new sl({
    props: {
      class: "bottom‐row",
      $$slots: { default: [O7] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      e = ut("div"), Je(t.$$.fragment), r = St(), Je(a.$$.fragment), i = St(), Je(l.$$.fragment), this.h();
    },
    l(o) {
      e = ot(o, "DIV", { class: !0 });
      var u = jt(e);
      Qe(t.$$.fragment, u), r = Dt(u), Qe(a.$$.fragment, u), i = Dt(u), Qe(l.$$.fragment, u), u.forEach(we), this.h();
    },
    h() {
      nt(e, "class", "controls-container svelte-gikd8m");
    },
    m(o, u) {
      ct(o, e, u), tt(t, e, null), _t(e, r), tt(a, e, null), _t(e, i), tt(l, e, null), s = !0;
    },
    p(o, u) {
      const h = {};
      u[0] & /*board, orientation, sideToMove*/
      49156 | u[1] & /*$$scope*/
      131072 && (h.$$scope = { dirty: u, ctx: o }), t.$set(h);
      const f = {};
      u[0] & /*blackQueenside, blackKingside, whiteQueenside, whiteKingside*/
      983040 | u[1] & /*$$scope*/
      131072 && (f.$$scope = { dirty: u, ctx: o }), a.$set(f);
      const p = {};
      u[0] & /*value*/
      1 | u[1] & /*$$scope*/
      131072 && (p.$$scope = { dirty: u, ctx: o }), l.$set(p);
    },
    i(o) {
      s || (Re(t.$$.fragment, o), Re(a.$$.fragment, o), Re(l.$$.fragment, o), s = !0);
    },
    o(o) {
      Oe(t.$$.fragment, o), Oe(a.$$.fragment, o), Oe(l.$$.fragment, o), s = !1;
    },
    d(o) {
      o && we(e), et(t), et(a), et(l);
    }
  };
}
function o1(n) {
  let e, t = (
    /*item*/
    n[45].label + ""
  ), r;
  return {
    c() {
      e = ut("option"), r = Sh(t), this.h();
    },
    l(a) {
      e = ot(a, "OPTION", {});
      var i = jt(e);
      r = Dh(i, t), i.forEach(we), this.h();
    },
    h() {
      e.__value = /*item*/
      n[45].value, x7(e, e.__value);
    },
    m(a, i) {
      ct(a, e, i), _t(e, r);
    },
    p: ii,
    d(a) {
      a && we(e);
    }
  };
}
function C7(n) {
  let e, t, r, a, i = t1(
    /*items*/
    n[21]
  ), l = [];
  for (let s = 0; s < i.length; s += 1)
    l[s] = o1(i1(n, i, s));
  return {
    c() {
      e = ut("div"), t = ut("select");
      for (let s = 0; s < l.length; s += 1)
        l[s].c();
      this.h();
    },
    l(s) {
      e = ot(s, "DIV", { class: !0 });
      var o = jt(e);
      t = ot(o, "SELECT", { class: !0 });
      var u = jt(t);
      for (let h = 0; h < l.length; h += 1)
        l[h].l(u);
      u.forEach(we), o.forEach(we), this.h();
    },
    h() {
      nt(t, "class", "svelte-gikd8m"), /*sideToMove*/
      n[15] === void 0 && m7(() => (
        /*select_change_handler*/
        n[32].call(t)
      )), nt(e, "class", "dropdown-container svelte-gikd8m");
    },
    m(s, o) {
      ct(s, e, o), _t(e, t);
      for (let u = 0; u < l.length; u += 1)
        l[u] && l[u].m(t, null);
      n1(
        t,
        /*sideToMove*/
        n[15],
        !0
      ), r || (a = [
        Ml(
          t,
          "change",
          /*select_change_handler*/
          n[32]
        ),
        Ml(
          t,
          "change",
          /*updateValue*/
          n[26]
        )
      ], r = !0);
    },
    p(s, o) {
      if (o[0] & /*items*/
      2097152) {
        i = t1(
          /*items*/
          s[21]
        );
        let u;
        for (u = 0; u < i.length; u += 1) {
          const h = i1(s, i, u);
          l[u] ? l[u].p(h, o) : (l[u] = o1(h), l[u].c(), l[u].m(t, null));
        }
        for (; u < l.length; u += 1)
          l[u].d(1);
        l.length = i.length;
      }
      o[0] & /*sideToMove, items*/
      2129920 && n1(
        t,
        /*sideToMove*/
        s[15]
      );
    },
    d(s) {
      s && we(e), g7(l, s), r = !1, w7(a);
    }
  };
}
function T7(n) {
  let e;
  return {
    c() {
      e = ut("i"), this.h();
    },
    l(t) {
      e = ot(t, "I", { class: !0 }), jt(e).forEach(we), this.h();
    },
    h() {
      nt(e, "class", "fa-solid fa-arrows-rotate");
    },
    m(t, r) {
      ct(t, e, r);
    },
    p: ii,
    d(t) {
      t && we(e);
    }
  };
}
function F7(n) {
  let e, t;
  return e = new ms({
    props: {
      label: "Flip",
      interactive: !0,
      $$slots: { default: [T7] },
      $$scope: { ctx: n }
    }
  }), e.$on(
    "click",
    /*click_handler*/
    n[33]
  ), {
    c() {
      Je(e.$$.fragment);
    },
    l(r) {
      Qe(e.$$.fragment, r);
    },
    m(r, a) {
      tt(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: r }), e.$set(i);
    },
    i(r) {
      t || (Re(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Oe(e.$$.fragment, r), t = !1;
    },
    d(r) {
      et(e, r);
    }
  };
}
function $7(n) {
  let e;
  return {
    c() {
      e = ut("i"), this.h();
    },
    l(t) {
      e = ot(t, "I", { class: !0 }), jt(e).forEach(we), this.h();
    },
    h() {
      nt(e, "class", "fa-solid fa-rotate-left");
    },
    m(t, r) {
      ct(t, e, r);
    },
    p: ii,
    d(t) {
      t && we(e);
    }
  };
}
function M7(n) {
  let e, t;
  return e = new ms({
    props: {
      label: "Reset",
      interactive: !0,
      $$slots: { default: [$7] },
      $$scope: { ctx: n }
    }
  }), e.$on(
    "click",
    /*resetBoard*/
    n[23]
  ), {
    c() {
      Je(e.$$.fragment);
    },
    l(r) {
      Qe(e.$$.fragment, r);
    },
    m(r, a) {
      tt(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: r }), e.$set(i);
    },
    i(r) {
      t || (Re(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Oe(e.$$.fragment, r), t = !1;
    },
    d(r) {
      et(e, r);
    }
  };
}
function z7(n) {
  let e;
  return {
    c() {
      e = ut("i"), this.h();
    },
    l(t) {
      e = ot(t, "I", { class: !0 }), jt(e).forEach(we), this.h();
    },
    h() {
      nt(e, "class", "fa-solid fa-trash");
    },
    m(t, r) {
      ct(t, e, r);
    },
    p: ii,
    d(t) {
      t && we(e);
    }
  };
}
function B7(n) {
  let e, t;
  return e = new ms({
    props: {
      label: "Clear",
      interactive: !0,
      $$slots: { default: [z7] },
      $$scope: { ctx: n }
    }
  }), e.$on(
    "click",
    /*clearBoard*/
    n[24]
  ), {
    c() {
      Je(e.$$.fragment);
    },
    l(r) {
      Qe(e.$$.fragment, r);
    },
    m(r, a) {
      tt(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: r }), e.$set(i);
    },
    i(r) {
      t || (Re(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Oe(e.$$.fragment, r), t = !1;
    },
    d(r) {
      et(e, r);
    }
  };
}
function L7(n) {
  let e, t, r, a, i, l, s, o;
  return e = new Cr({
    props: {
      style: "flex: 0 0 50%",
      min_width: 200,
      $$slots: { default: [C7] },
      $$scope: { ctx: n }
    }
  }), r = new Cr({
    props: {
      style: "flex: 1",
      $$slots: { default: [F7] },
      $$scope: { ctx: n }
    }
  }), i = new Cr({
    props: {
      style: "flex: 1",
      $$slots: { default: [M7] },
      $$scope: { ctx: n }
    }
  }), s = new Cr({
    props: {
      style: "flex: 1",
      $$slots: { default: [B7] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      Je(e.$$.fragment), t = St(), Je(r.$$.fragment), a = St(), Je(i.$$.fragment), l = St(), Je(s.$$.fragment);
    },
    l(u) {
      Qe(e.$$.fragment, u), t = Dt(u), Qe(r.$$.fragment, u), a = Dt(u), Qe(i.$$.fragment, u), l = Dt(u), Qe(s.$$.fragment, u);
    },
    m(u, h) {
      tt(e, u, h), ct(u, t, h), tt(r, u, h), ct(u, a, h), tt(i, u, h), ct(u, l, h), tt(s, u, h), o = !0;
    },
    p(u, h) {
      const f = {};
      h[0] & /*sideToMove*/
      32768 | h[1] & /*$$scope*/
      131072 && (f.$$scope = { dirty: h, ctx: u }), e.$set(f);
      const p = {};
      h[0] & /*board, orientation*/
      16388 | h[1] & /*$$scope*/
      131072 && (p.$$scope = { dirty: h, ctx: u }), r.$set(p);
      const g = {};
      h[1] & /*$$scope*/
      131072 && (g.$$scope = { dirty: h, ctx: u }), i.$set(g);
      const w = {};
      h[1] & /*$$scope*/
      131072 && (w.$$scope = { dirty: h, ctx: u }), s.$set(w);
    },
    i(u) {
      o || (Re(e.$$.fragment, u), Re(r.$$.fragment, u), Re(i.$$.fragment, u), Re(s.$$.fragment, u), o = !0);
    },
    o(u) {
      Oe(e.$$.fragment, u), Oe(r.$$.fragment, u), Oe(i.$$.fragment, u), Oe(s.$$.fragment, u), o = !1;
    },
    d(u) {
      u && (we(t), we(a), we(l)), et(e, u), et(r, u), et(i, u), et(s, u);
    }
  };
}
function R7(n) {
  let e, t = "White", r, a, i, l, s, o, u, h;
  function f(v) {
    n[34](v);
  }
  let p = { label: "(O‐O)", interactive: !0 };
  /*whiteKingside*/
  n[16] !== void 0 && (p.value = /*whiteKingside*/
  n[16]), i = new Wa({ props: p }), zn.push(() => Mn(i, "value", f)), i.$on(
    "change",
    /*updateValue*/
    n[26]
  );
  function g(v) {
    n[35](v);
  }
  let w = { label: "(O‐O‐O)", interactive: !0 };
  return (
    /*whiteQueenside*/
    n[17] !== void 0 && (w.value = /*whiteQueenside*/
    n[17]), o = new Wa({ props: w }), zn.push(() => Mn(o, "value", g)), o.$on(
      "change",
      /*updateValue*/
      n[26]
    ), {
      c() {
        e = ut("label"), e.textContent = t, r = St(), a = ut("div"), Je(i.$$.fragment), s = St(), Je(o.$$.fragment), this.h();
      },
      l(v) {
        e = ot(v, "LABEL", {
          class: !0,
          for: !0,
          "data-svelte-h": !0
        }), xn(e) !== "svelte-bxm7jb" && (e.textContent = t), r = Dt(v), a = ot(v, "DIV", { id: !0 });
        var y = jt(a);
        Qe(i.$$.fragment, y), s = Dt(y), Qe(o.$$.fragment, y), y.forEach(we), this.h();
      },
      h() {
        nt(e, "class", "header svelte-gikd8m"), nt(e, "for", "white-checkbox-group"), nt(a, "id", "white-checkbox-group");
      },
      m(v, y) {
        ct(v, e, y), ct(v, r, y), ct(v, a, y), tt(i, a, null), _t(a, s), tt(o, a, null), h = !0;
      },
      p(v, y) {
        const E = {};
        !l && y[0] & /*whiteKingside*/
        65536 && (l = !0, E.value = /*whiteKingside*/
        v[16], $n(() => l = !1)), i.$set(E);
        const k = {};
        !u && y[0] & /*whiteQueenside*/
        131072 && (u = !0, k.value = /*whiteQueenside*/
        v[17], $n(() => u = !1)), o.$set(k);
      },
      i(v) {
        h || (Re(i.$$.fragment, v), Re(o.$$.fragment, v), h = !0);
      },
      o(v) {
        Oe(i.$$.fragment, v), Oe(o.$$.fragment, v), h = !1;
      },
      d(v) {
        v && (we(e), we(r), we(a)), et(i), et(o);
      }
    }
  );
}
function q7(n) {
  let e, t = "Black", r, a, i, l, s, o, u, h;
  function f(v) {
    n[36](v);
  }
  let p = { label: "(O‐O)", interactive: !0 };
  /*blackKingside*/
  n[18] !== void 0 && (p.value = /*blackKingside*/
  n[18]), i = new Wa({ props: p }), zn.push(() => Mn(i, "value", f)), i.$on(
    "change",
    /*updateValue*/
    n[26]
  );
  function g(v) {
    n[37](v);
  }
  let w = { label: "(O‐O‐O)", interactive: !0 };
  return (
    /*blackQueenside*/
    n[19] !== void 0 && (w.value = /*blackQueenside*/
    n[19]), o = new Wa({ props: w }), zn.push(() => Mn(o, "value", g)), o.$on(
      "change",
      /*updateValue*/
      n[26]
    ), {
      c() {
        e = ut("label"), e.textContent = t, r = St(), a = ut("div"), Je(i.$$.fragment), s = St(), Je(o.$$.fragment), this.h();
      },
      l(v) {
        e = ot(v, "LABEL", {
          class: !0,
          for: !0,
          "data-svelte-h": !0
        }), xn(e) !== "svelte-v755rv" && (e.textContent = t), r = Dt(v), a = ot(v, "DIV", { id: !0 });
        var y = jt(a);
        Qe(i.$$.fragment, y), s = Dt(y), Qe(o.$$.fragment, y), y.forEach(we), this.h();
      },
      h() {
        nt(e, "class", "header svelte-gikd8m"), nt(e, "for", "black-checkbox-group"), nt(a, "id", "black-checkbox-group");
      },
      m(v, y) {
        ct(v, e, y), ct(v, r, y), ct(v, a, y), tt(i, a, null), _t(a, s), tt(o, a, null), h = !0;
      },
      p(v, y) {
        const E = {};
        !l && y[0] & /*blackKingside*/
        262144 && (l = !0, E.value = /*blackKingside*/
        v[18], $n(() => l = !1)), i.$set(E);
        const k = {};
        !u && y[0] & /*blackQueenside*/
        524288 && (u = !0, k.value = /*blackQueenside*/
        v[19], $n(() => u = !1)), o.$set(k);
      },
      i(v) {
        h || (Re(i.$$.fragment, v), Re(o.$$.fragment, v), h = !0);
      },
      o(v) {
        Oe(i.$$.fragment, v), Oe(o.$$.fragment, v), h = !1;
      },
      d(v) {
        v && (we(e), we(r), we(a)), et(i), et(o);
      }
    }
  );
}
function I7(n) {
  let e, t, r, a;
  return e = new Cr({
    props: {
      class: "checkbox‐group",
      style: "flex: 0 0 120px",
      $$slots: { default: [R7] },
      $$scope: { ctx: n }
    }
  }), r = new Cr({
    props: {
      class: "checkbox‐group",
      style: "flex: 0 0 120px",
      $$slots: { default: [q7] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      Je(e.$$.fragment), t = St(), Je(r.$$.fragment);
    },
    l(i) {
      Qe(e.$$.fragment, i), t = Dt(i), Qe(r.$$.fragment, i);
    },
    m(i, l) {
      tt(e, i, l), ct(i, t, l), tt(r, i, l), a = !0;
    },
    p(i, l) {
      const s = {};
      l[0] & /*whiteQueenside, whiteKingside*/
      196608 | l[1] & /*$$scope*/
      131072 && (s.$$scope = { dirty: l, ctx: i }), e.$set(s);
      const o = {};
      l[0] & /*blackQueenside, blackKingside*/
      786432 | l[1] & /*$$scope*/
      131072 && (o.$$scope = { dirty: l, ctx: i }), r.$set(o);
    },
    i(i) {
      a || (Re(e.$$.fragment, i), Re(r.$$.fragment, i), a = !0);
    },
    o(i) {
      Oe(e.$$.fragment, i), Oe(r.$$.fragment, i), a = !1;
    },
    d(i) {
      i && we(t), et(e, i), et(r, i);
    }
  };
}
function N7(n) {
  let e, t, r;
  function a(l) {
    n[38](l);
  }
  let i = { label: "" };
  return (
    /*value*/
    n[0] !== void 0 && (i.value = /*value*/
    n[0]), e = new S3({ props: i }), zn.push(() => Mn(e, "value", a)), {
      c() {
        Je(e.$$.fragment);
      },
      l(l) {
        Qe(e.$$.fragment, l);
      },
      m(l, s) {
        tt(e, l, s), r = !0;
      },
      p(l, s) {
        const o = {};
        !t && s[0] & /*value*/
        1 && (t = !0, o.value = /*value*/
        l[0], $n(() => t = !1)), e.$set(o);
      },
      i(l) {
        r || (Re(e.$$.fragment, l), r = !0);
      },
      o(l) {
        Oe(e.$$.fragment, l), r = !1;
      },
      d(l) {
        et(e, l);
      }
    }
  );
}
function O7(n) {
  let e, t;
  return e = new Cr({
    props: {
      style: "flex: 1",
      $$slots: { default: [N7] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      Je(e.$$.fragment);
    },
    l(r) {
      Qe(e.$$.fragment, r);
    },
    m(r, a) {
      tt(e, r, a), t = !0;
    },
    p(r, a) {
      const i = {};
      a[0] & /*value*/
      1 | a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: r }), e.$set(i);
    },
    i(r) {
      t || (Re(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Oe(e.$$.fragment, r), t = !1;
    },
    d(r) {
      et(e, r);
    }
  };
}
function P7(n) {
  let e, t, r, a, i, l, s, o, u, h, f, p, g, w = !/*game_mode*/
  n[1] && /*loading_status*/
  n[11] && l1(n);
  r = new Pc({
    props: {
      root: (
        /*root*/
        n[12]
      ),
      show_label: (
        /*show_label*/
        n[8]
      ),
      info: void 0,
      $$slots: { default: [E7] },
      $$scope: { ctx: n }
    }
  }), l = new Xu({
    props: {
      display_value: "Play mode",
      internal_value: "game",
      selected: (
        /*selected*/
        n[13]
      )
    }
  }), l.$on(
    "input",
    /*input_handler*/
    n[30]
  ), o = new Xu({
    props: {
      display_value: "Edit mode",
      internal_value: "edit",
      selected: (
        /*selected*/
        n[13]
      )
    }
  }), o.$on(
    "input",
    /*input_handler_1*/
    n[31]
  );
  let v = !/*game_mode*/
  n[1] && s1(n);
  return {
    c() {
      w && w.c(), e = St(), t = ut("div"), Je(r.$$.fragment), a = St(), i = ut("div"), Je(l.$$.fragment), s = St(), Je(o.$$.fragment), u = St(), h = ut("div"), f = ut("div"), p = St(), v && v.c(), this.h();
    },
    l(y) {
      w && w.l(y), e = Dt(y), t = ot(y, "DIV", { class: !0 });
      var E = jt(t);
      Qe(r.$$.fragment, E), a = Dt(E), i = ot(E, "DIV", { class: !0 });
      var k = jt(i);
      Qe(l.$$.fragment, k), s = Dt(k), Qe(o.$$.fragment, k), k.forEach(we), u = Dt(E), h = ot(E, "DIV", { class: !0 });
      var b = jt(h);
      f = ot(b, "DIV", { id: !0, style: !0 }), jt(f).forEach(we), b.forEach(we), p = Dt(E), v && v.l(E), E.forEach(we), this.h();
    },
    h() {
      nt(i, "class", "mode-selector svelte-gikd8m"), nt(
        f,
        "id",
        /*board_id*/
        n[20]
      ), A7(f, "width", "500px"), nt(h, "class", "board-container svelte-gikd8m"), nt(t, "class", "main-container svelte-gikd8m");
    },
    m(y, E) {
      w && w.m(y, E), ct(y, e, E), ct(y, t, E), tt(r, t, null), _t(t, a), _t(t, i), tt(l, i, null), _t(i, s), tt(o, i, null), _t(t, u), _t(t, h), _t(h, f), _t(t, p), v && v.m(t, null), g = !0;
    },
    p(y, E) {
      !/*game_mode*/
      y[1] && /*loading_status*/
      y[11] ? w ? (w.p(y, E), E[0] & /*game_mode, loading_status*/
      2050 && Re(w, 1)) : (w = l1(y), w.c(), Re(w, 1), w.m(e.parentNode, e)) : w && (r1(), Oe(w, 1, 1, () => {
        w = null;
      }), e1());
      const k = {};
      E[0] & /*root*/
      4096 && (k.root = /*root*/
      y[12]), E[0] & /*show_label*/
      256 && (k.show_label = /*show_label*/
      y[8]), E[0] & /*label*/
      16 | E[1] & /*$$scope*/
      131072 && (k.$$scope = { dirty: E, ctx: y }), r.$set(k);
      const b = {};
      E[0] & /*selected*/
      8192 && (b.selected = /*selected*/
      y[13]), l.$set(b);
      const A = {};
      E[0] & /*selected*/
      8192 && (A.selected = /*selected*/
      y[13]), o.$set(A), /*game_mode*/
      y[1] ? v && (r1(), Oe(v, 1, 1, () => {
        v = null;
      }), e1()) : v ? (v.p(y, E), E[0] & /*game_mode*/
      2 && Re(v, 1)) : (v = s1(y), v.c(), Re(v, 1), v.m(t, null));
    },
    i(y) {
      g || (Re(w), Re(r.$$.fragment, y), Re(l.$$.fragment, y), Re(o.$$.fragment, y), Re(v), g = !0);
    },
    o(y) {
      Oe(w), Oe(r.$$.fragment, y), Oe(l.$$.fragment, y), Oe(o.$$.fragment, y), Oe(v), g = !1;
    },
    d(y) {
      y && (we(e), we(t)), w && w.d(y), et(r), et(l), et(o), v && v.d();
    }
  };
}
function H7(n) {
  let e, t = "", r, a, i, l, s = "", o, u, h = `[class*="spare-pieces"] {
			display: flex !important;
			flex-direction: row !important;
			justify-content: center !important;
		}`, f, p, g, w, v;
  return p = new Xh({
    props: {
      visible: (
        /*visible*/
        n[7]
      ),
      elem_id: (
        /*elem_id*/
        n[5]
      ),
      elem_classes: (
        /*elem_classes*/
        n[6]
      ),
      scale: (
        /*scale*/
        n[9]
      ),
      min_width: (
        /*min_width*/
        n[10]
      ),
      $$slots: { default: [P7] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      e = ut("script"), e.innerHTML = t, a = ut("link"), i = ut("link"), l = ut("script"), l.innerHTML = s, u = ut("style"), u.textContent = h, f = St(), Je(p.$$.fragment), this.h();
    },
    l(y) {
      const E = b7("svelte-9s06f8", document.head);
      e = ot(E, "SCRIPT", { src: !0, "data-svelte-h": !0 }), xn(e) !== "svelte-1ds4dxo" && (e.innerHTML = t), a = ot(E, "LINK", { rel: !0, href: !0 }), i = ot(E, "LINK", { rel: !0, href: !0 }), l = ot(E, "SCRIPT", { src: !0, "data-svelte-h": !0 }), xn(l) !== "svelte-16g0mo4" && (l.innerHTML = s), u = ot(E, "STYLE", { "data-svelte-h": !0 }), xn(u) !== "svelte-y69n3l" && (u.textContent = h), E.forEach(we), f = Dt(y), Qe(p.$$.fragment, y), this.h();
    },
    h() {
      a1(e.src, r = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js") || nt(e, "src", r), e.defer = !0, nt(a, "rel", "stylesheet"), nt(a, "href", "https://cdnjs.cloudflare.com/ajax/libs/chessboard-js/1.0.0/chessboard-1.0.0.min.css"), nt(i, "rel", "stylesheet"), nt(i, "href", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"), a1(l.src, o = "https://cdnjs.cloudflare.com/ajax/libs/chessboard-js/1.0.0/chessboard-1.0.0.js") || nt(l, "src", o), l.defer = !0;
    },
    m(y, E) {
      _t(document.head, e), _t(document.head, a), _t(document.head, i), _t(document.head, l), _t(document.head, u), ct(y, f, E), tt(p, y, E), g = !0, w || (v = Ml(
        l,
        "load",
        /*initBoard*/
        n[22]
      ), w = !0);
    },
    p(y, E) {
      const k = {};
      E[0] & /*visible*/
      128 && (k.visible = /*visible*/
      y[7]), E[0] & /*elem_id*/
      32 && (k.elem_id = /*elem_id*/
      y[5]), E[0] & /*elem_classes*/
      64 && (k.elem_classes = /*elem_classes*/
      y[6]), E[0] & /*scale*/
      512 && (k.scale = /*scale*/
      y[9]), E[0] & /*min_width*/
      1024 && (k.min_width = /*min_width*/
      y[10]), E[0] & /*value, blackQueenside, blackKingside, whiteQueenside, whiteKingside, board, orientation, sideToMove, game_mode, selected, root, show_label, label, gradio, loading_status*/
      1046815 | E[1] & /*$$scope*/
      131072 && (k.$$scope = { dirty: E, ctx: y }), p.$set(k);
    },
    i(y) {
      g || (Re(p.$$.fragment, y), g = !0);
    },
    o(y) {
      Oe(p.$$.fragment, y), g = !1;
    },
    d(y) {
      y && we(f), we(e), we(a), we(i), we(l), we(u), et(p, y), w = !1, v();
    }
  };
}
function U7(n, e, t) {
  let { gradio: r } = e, { label: a = "Chessboard" } = e, { elem_id: i = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { value: o = new ba().fen() } = e, { show_label: u } = e, { scale: h = null } = e, { min_width: f = void 0 } = e, { loading_status: p = void 0 } = e, { value_is_output: g = !1 } = e, { interactive: w } = e, { game_mode: v = !1 } = e, { orientation: y = "white" } = e, { root: E } = e, k = "game", b = new ba(o), A, M = "board_" + Math.random().toString(36).substring(2, 15), R = "White to move", L = !0, H = !0, q = !0, X = !0, Z = [
    {
      label: "White to move",
      value: "White to move"
    },
    {
      label: "Black to move",
      value: "Black to move"
    }
  ];
  const J = () => {
    v ? t(14, A = Chessboard(M, {
      draggable: w,
      position: b.fen(),
      orientation: y,
      pieceTheme: "https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png",
      onDrop: ge,
      onDragStart: Me
    })) : t(14, A = Chessboard(M, {
      draggable: w,
      position: b.fen(),
      orientation: y,
      pieceTheme: "https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png",
      sparePieces: !0,
      dropOffBoard: "trash",
      onChange: qe
    }));
  };
  function De() {
    b.reset(), A.start(), t(0, o = b.fen()), t(15, R = "White to move"), t(16, L = !0), t(17, H = !0), t(18, q = !0), t(19, X = !0);
  }
  function ye() {
    b.clear(), A.clear(), t(0, o = b.fen()), t(15, R = "White to move"), t(16, L = !1), t(17, H = !1), t(18, q = !1), t(19, X = !1);
  }
  function ve(W) {
    t(13, k = String(W)), t(1, v = k === "game"), J();
  }
  function $e() {
    (o === null || o === "") && t(0, o = new ba().fen()), A !== void 0 && (A.position(o), b.load(o), r.dispatch("change"));
  }
  function Me(W, te, ae, _e) {
    if (b.isGameOver() || b.turn() === "w" && te.search(/^b/) !== -1 || b.turn() === "b" && te.search(/^w/) !== -1)
      return !1;
  }
  function ge(W, te) {
    try {
      var ae = b.move({
        from: W,
        to: te,
        promotion: "q"
        // NOTE: always promote to a queen for now
      });
    } catch {
      return "snapback";
    }
    if (ae === null) return "snapback";
    t(0, o = b.fen()), r.dispatch("move");
  }
  function qe(W, te) {
    const ae = Chessboard.objToFen(te);
    t(0, o = N(ae));
  }
  function Ce(W) {
    t(0, o = N(A.fen()));
  }
  function N(W) {
    let te = R === "White to move" ? "w" : "b", ae = "";
    return L && (ae += "K"), H && (ae += "Q"), q && (ae += "k"), X && (ae += "q"), ae === "" && (ae = "-"), `${W} ${te} ${ae} - 0 1`;
  }
  const S = () => r.dispatch("clear_status", p), T = (W) => ve(W.detail), z = (W) => ve(W.detail);
  function C() {
    R = D7(this), t(15, R), t(21, Z);
  }
  const P = () => {
    A.flip(), t(2, y = A.orientation());
  };
  function I(W) {
    L = W, t(16, L);
  }
  function ee(W) {
    H = W, t(17, H);
  }
  function ue(W) {
    q = W, t(18, q);
  }
  function fe(W) {
    X = W, t(19, X);
  }
  function ke(W) {
    o = W, t(0, o);
  }
  return n.$$set = (W) => {
    "gradio" in W && t(3, r = W.gradio), "label" in W && t(4, a = W.label), "elem_id" in W && t(5, i = W.elem_id), "elem_classes" in W && t(6, l = W.elem_classes), "visible" in W && t(7, s = W.visible), "value" in W && t(0, o = W.value), "show_label" in W && t(8, u = W.show_label), "scale" in W && t(9, h = W.scale), "min_width" in W && t(10, f = W.min_width), "loading_status" in W && t(11, p = W.loading_status), "value_is_output" in W && t(27, g = W.value_is_output), "interactive" in W && t(28, w = W.interactive), "game_mode" in W && t(1, v = W.game_mode), "orientation" in W && t(2, y = W.orientation), "root" in W && t(12, E = W.root);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*value*/
    1 && o === null && t(0, o = new ba().fen()), n.$$.dirty[0] & /*value*/
    1 && $e();
  }, [
    o,
    v,
    y,
    r,
    a,
    i,
    l,
    s,
    u,
    h,
    f,
    p,
    E,
    k,
    A,
    R,
    L,
    H,
    q,
    X,
    M,
    Z,
    J,
    De,
    ye,
    ve,
    Ce,
    g,
    w,
    S,
    T,
    z,
    C,
    P,
    I,
    ee,
    ue,
    fe,
    ke
  ];
}
class VL extends f7 {
  constructor(e) {
    super(), y7(
      this,
      e,
      U7,
      H7,
      k7,
      {
        gradio: 3,
        label: 4,
        elem_id: 5,
        elem_classes: 6,
        visible: 7,
        value: 0,
        show_label: 8,
        scale: 9,
        min_width: 10,
        loading_status: 11,
        value_is_output: 27,
        interactive: 28,
        game_mode: 1,
        orientation: 2,
        root: 12
      },
      null,
      [-1, -1]
    );
  }
}
export {
  VL as I,
  Do as c,
  j7 as g,
  V7 as k,
  t$ as p
};
